Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/reports/pivottable.h
Show First 20 Lines • Show All 155 Lines • ▼ Show 20 Line(s) | 150 | /** | |||
---|---|---|---|---|---|
156 | * HTML font tag to modify the color to reflect the user settings for | 156 | * HTML font tag to modify the color to reflect the user settings for | ||
157 | * negtive numbers. | 157 | * negtive numbers. | ||
158 | * | 158 | * | ||
159 | * Example: 1.23 is returned as '1.23' whereas -1.23 is returned as | 159 | * Example: 1.23 is returned as '1.23' whereas -1.23 is returned as | ||
160 | * @verbatim <font color="rgb($red,$green,$blue)">-1.23</font>@endverbatim | 160 | * @verbatim <font color="rgb($red,$green,$blue)">-1.23</font>@endverbatim | ||
161 | * with $red, $green and $blue being the actual value for the | 161 | * with $red, $green and $blue being the actual value for the | ||
162 | * chosen color. | 162 | * chosen color. | ||
163 | */ | 163 | */ | ||
164 | QString coloredAmount(const MyMoneyMoney& amount, const QString& currencySymbol = QString(), int prec = 2) const; | 164 | QString coloredAmount(const MyMoneyMoney& amount, const QString& currencySymbol = QString()) const; | ||
christiand: Hi Lukasz,
I think here it is better to add an overload:
```
QString coloredAmount(const… | |||||
wojnilowicz: Outcome is the same. Why overload? | |||||
The only reason is my personal view of style. The set default value is not the real value to use but a code for something different. If a caller uses the function he has to notice that -1 itself is a useless value and thus encodes something else instead. Also someone could have the idea to explicitly set this parameter to -1 which means you cannot change that behavior in future. christiand: The only reason is my personal view of style.
The set default value is not the real value to… | |||||
165 | QString coloredAmount(const MyMoneyMoney& amount, const QString& currencySymbol, int prec) const; | ||||
165 | 166 | | |||
166 | protected: | 167 | protected: | ||
167 | /** | 168 | /** | ||
168 | * Creates a row in the grid if it doesn't already exist | 169 | * Creates a row in the grid if it doesn't already exist | ||
169 | * | 170 | * | ||
170 | * Downsteam assignment functions will assume that this row already | 171 | * Downsteam assignment functions will assume that this row already | ||
171 | * exists, so this function creates a row of the needed length populated | 172 | * exists, so this function creates a row of the needed length populated | ||
172 | * with zeros. | 173 | * with zeros. | ||
▲ Show 20 Lines • Show All 202 Lines • Show Last 20 Lines |
Hi Lukasz,
I think here it is better to add an overload:
and change this function to: