src/strings.cpp
changeset 7422 fb7f6dc87b55
parent 7411 6aa1fd67a914
child 7435 c5d1a7a3235c
equal deleted inserted replaced
7421:deb7fa2bdebe 7422:fb7f6dc87b55
   341 	cs.MultiplyCost(spec->rate);
   341 	cs.MultiplyCost(spec->rate);
   342 	number = cs.GetCost();
   342 	number = cs.GetCost();
   343 
   343 
   344 	/* convert from negative */
   344 	/* convert from negative */
   345 	if (number < 0) {
   345 	if (number < 0) {
       
   346 		if (buff + Utf8CharLen(SCC_RED) > last) return buff;
       
   347 		buff += Utf8Encode(buff, SCC_RED);
   346 		buff = strecpy(buff, "-", last);
   348 		buff = strecpy(buff, "-", last);
   347 		number = -number;
   349 		number = -number;
   348 	}
   350 	}
   349 
   351 
   350 	/* Add prefix part, folowing symbol_pos specification.
   352 	/* Add prefix part, folowing symbol_pos specification.
   380 
   382 
   381 	/* Add suffix part, folowing symbol_pos specification.
   383 	/* Add suffix part, folowing symbol_pos specification.
   382 	 * Here, it can can be either 1 (suffix) or 2 (both prefix anf suffix).
   384 	 * Here, it can can be either 1 (suffix) or 2 (both prefix anf suffix).
   383 	 * The only remaining value is 1 (prefix), so everything that is not 0 */
   385 	 * The only remaining value is 1 (prefix), so everything that is not 0 */
   384 	if (spec->symbol_pos != 0) buff = strecpy(buff, spec->suffix, last);
   386 	if (spec->symbol_pos != 0) buff = strecpy(buff, spec->suffix, last);
       
   387 
       
   388 	if (cs.GetCost() < 0) {
       
   389 		if (buff + Utf8CharLen(SCC_PREVIOUS_COLOUR) > last) return buff;
       
   390 		buff += Utf8Encode(buff, SCC_PREVIOUS_COLOUR);
       
   391 		*buff = '\0';
       
   392 	}
   385 
   393 
   386 	return buff;
   394 	return buff;
   387 }
   395 }
   388 
   396 
   389 static int DeterminePluralForm(int64 cnt)
   397 static int DeterminePluralForm(int64 cnt)