[Libreoffice-commits] core.git: 3 commits - connectivity/source
David Tardon
dtardon at redhat.com
Wed Aug 20 01:09:21 PDT 2014
connectivity/source/commontools/DateConversion.cxx | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 34d6e7790f17080bea95ad770a819c7b5159b4c4
Author: David Tardon <dtardon at redhat.com>
Date: Wed Aug 20 10:06:26 2014 +0200
avoid potential null dereference
Change-Id: I2236a18608ffa9481c30088044f34e1a3372dd11
diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx
index 373d048..cf6fbe1 100644
--- a/connectivity/source/commontools/DateConversion.cxx
+++ b/connectivity/source/commontools/DateConversion.cxx
@@ -255,9 +255,13 @@ void DBTypeConversion::setValue(const Reference<XColumnUpdate>& xVariant,
sal_Int32 nStandardKey(0);
if(xFormatTypes.is())
{
- css::lang::Locale loc;
- if (xFormats->getByKey(nKeyToUse)->getPropertyValue("Locale") >>= loc)
- nStandardKey = xFormatTypes->getStandardIndex(loc);
+ const Reference< XPropertySet > xFormatProps(xFormats->getByKey(nKeyToUse));
+ if (xFormatProps.is())
+ {
+ css::lang::Locale loc;
+ if (xFormatProps->getPropertyValue("Locale") >>= loc)
+ nStandardKey = xFormatTypes->getStandardIndex(loc);
+ }
}
// Why use nStandardKey rather than nKeyToUse here? Don't know, but "it was always like that".
// Previously had hardcoded 0 instead of nStandardKey, which led to problems with dates
commit 8c536baf2072295691711927e262d2341d14a3e1
Author: David Tardon <dtardon at redhat.com>
Date: Wed Aug 20 10:05:31 2014 +0200
do not use obsolete OSL_VERIFY macro
Change-Id: I8efdd4933d3e47c5e086dc4a4685110390d6b6e8
diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx
index 3780608..373d048 100644
--- a/connectivity/source/commontools/DateConversion.cxx
+++ b/connectivity/source/commontools/DateConversion.cxx
@@ -256,8 +256,8 @@ void DBTypeConversion::setValue(const Reference<XColumnUpdate>& xVariant,
if(xFormatTypes.is())
{
css::lang::Locale loc;
- OSL_VERIFY(xFormats->getByKey(nKeyToUse)->getPropertyValue("Locale") >>= loc);
- nStandardKey = xFormatTypes->getStandardIndex(loc);
+ if (xFormats->getByKey(nKeyToUse)->getPropertyValue("Locale") >>= loc)
+ nStandardKey = xFormatTypes->getStandardIndex(loc);
}
// Why use nStandardKey rather than nKeyToUse here? Don't know, but "it was always like that".
// Previously had hardcoded 0 instead of nStandardKey, which led to problems with dates
commit 238d6ac878fd5ebc7d5534674b5b98cdac15cf17
Author: David Tardon <dtardon at redhat.com>
Date: Wed Aug 20 10:00:21 2014 +0200
this assert does not make sense
... as the code apparently can work even if xFormatTypes is empty.
Change-Id: I6b733b9b31329d4fafc745bc23d0f555286950e6
diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx
index 954e987..3780608 100644
--- a/connectivity/source/commontools/DateConversion.cxx
+++ b/connectivity/source/commontools/DateConversion.cxx
@@ -252,7 +252,6 @@ void DBTypeConversion::setValue(const Reference<XColumnUpdate>& xVariant,
double fValue = xFormatter->convertStringToNumber(nKeyToUse, rString);
Reference< XNumberFormats > xFormats(xFormatter->getNumberFormatsSupplier()->getNumberFormats());
Reference< XNumberFormatTypes > xFormatTypes(xFormats, UNO_QUERY);
- assert(xFormatTypes.is());
sal_Int32 nStandardKey(0);
if(xFormatTypes.is())
{
More information about the Libreoffice-commits
mailing list