|
|
|
|
@ -239,15 +239,20 @@ xaccPriceCellPrintValue (PriceCell *cell)
|
|
|
|
|
double
|
|
|
|
|
xaccGetPriceCellValue (PriceCell *cell)
|
|
|
|
|
{
|
|
|
|
|
assert(cell != NULL);
|
|
|
|
|
if (cell == NULL)
|
|
|
|
|
return 0.0;
|
|
|
|
|
|
|
|
|
|
return cell->amount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void xaccSetPriceCellValue (PriceCell * cell, double amt)
|
|
|
|
|
void
|
|
|
|
|
xaccSetPriceCellValue (PriceCell * cell, double amt)
|
|
|
|
|
{
|
|
|
|
|
char *buff;
|
|
|
|
|
|
|
|
|
|
if (cell == NULL)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
cell->amount = amt;
|
|
|
|
|
buff = xaccPriceCellPrintValue (cell);
|
|
|
|
|
|
|
|
|
|
@ -257,6 +262,19 @@ void xaccSetPriceCellValue (PriceCell * cell, double amt)
|
|
|
|
|
COLORIZE (cell, amt);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
xaccSetPriceCellBlank (PriceCell *cell)
|
|
|
|
|
{
|
|
|
|
|
if (cell == NULL)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
cell->amount = 0.0;
|
|
|
|
|
|
|
|
|
|
SET ( &(cell->cell), "");
|
|
|
|
|
|
|
|
|
|
COLORIZE (cell, 0.0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ================================================ */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
@ -318,9 +336,17 @@ static void
|
|
|
|
|
PriceSetValue (BasicCell *_cell, const char *str)
|
|
|
|
|
{
|
|
|
|
|
PriceCell *cell = (PriceCell *) _cell;
|
|
|
|
|
double amt = xaccParseAmount (str, cell->monetary);
|
|
|
|
|
double amount;
|
|
|
|
|
|
|
|
|
|
if (str == NULL)
|
|
|
|
|
str = "";
|
|
|
|
|
|
|
|
|
|
xaccSetPriceCellValue (cell, amt);
|
|
|
|
|
if (!cell->blank_zero && (*str == '\0'))
|
|
|
|
|
xaccSetPriceCellBlank(cell);
|
|
|
|
|
else {
|
|
|
|
|
amount = xaccParseAmount (str, cell->monetary);
|
|
|
|
|
xaccSetPriceCellValue (cell, amount);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* --------------- end of file ---------------------- */
|
|
|
|
|
|