summaryrefslogtreecommitdiff
path: root/connectivity/source/commontools/DateConversion.cxx
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2014-08-20 18:35:20 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2014-08-20 18:35:41 +0200
commit73ff8a29c1d546bbe2864d714ddb9c35c1d875f4 (patch)
tree814b12b47735091ec12aa56029ac91d291530ccd /connectivity/source/commontools/DateConversion.cxx
parentda401ac07b4e41b43723722aaff135b3a1376b31 (diff)
update comments with my new findings
Change-Id: I58e07994e627ce980573812cbe56a068f66b1862
Diffstat (limited to 'connectivity/source/commontools/DateConversion.cxx')
-rw-r--r--connectivity/source/commontools/DateConversion.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx
index cf6fbe13bd78..979884580b2f 100644
--- a/connectivity/source/commontools/DateConversion.cxx
+++ b/connectivity/source/commontools/DateConversion.cxx
@@ -263,10 +263,12 @@ void DBTypeConversion::setValue(const Reference<XColumnUpdate>& xVariant,
nStandardKey = xFormatTypes->getStandardIndex(loc);
}
}
- // Why use nStandardKey rather than nKeyToUse here? Don't know, but "it was always like that".
+ // Why use nStandardKey rather than nKeyToUse here? I'm not sure, but "it was always like that".
// Previously had hardcoded 0 instead of nStandardKey, which led to problems with dates
// because of differences M/D/Y vs D/M/Y. This at least fixes those problems, but possibly
// nKeyToUse is an even better choice than nStandardKey.
+ // OTOH, using nKeyToUse nullifies the special treatment for percent formats,
+ // leading to "5" (in a percent format) to be understood as "500%" instead of "5%".
sal_Int32 nRealUsedKey = xFormatter->detectNumberFormat(nStandardKey, rString);
if (nRealUsedKey != nKeyToUse)
nRealUsedTypeClass = getNumberFormatType(xFormatter, nRealUsedKey) & ~NumberFormat::DEFINED;