diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-04-20 17:22:29 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2012-04-23 07:28:21 +0200 |
commit | 691325d67ef395ec9a758e5f8acc46767455ac98 (patch) | |
tree | bb019690b63369678df5a6504b86b79c433fac79 | |
parent | fdo#48356 fix RTF import of special unicode characters (diff) | |
download | core-691325d67ef395ec9a758e5f8acc46767455ac98.tar.gz core-691325d67ef395ec9a758e5f8acc46767455ac98.zip |
fdo#48969: switch units in Converter::convertDouble
The factor here is used to divide, so the parameters have to be
switched; this has always been broken but probably before
3ca2bef76886450058d1667703aeafe4c2e456c3 nothing called this.
This also reverts 7bf1fa3757133f12cf6ca624f8cee6ba5363e7d8 because
that was a workaround for the problem in the wrong place.
Signed-off-by: Fridrich Štrba <fridrich.strba@bluewin.ch>
Signed-off-by: Miklos Vajna <vmiklos@suse.cz>
Signed-off-by: David Tardon <dtardon@redhat.com>
-rw-r--r-- | sax/source/tools/converter.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/core/xmluconv.cxx | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index eb22e0f2d544..cf5a5b50089f 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -644,8 +644,9 @@ bool Converter::convertDouble(double& rValue, if(eStatus == rtl_math_ConversionStatus_Ok) { OUStringBuffer sUnit; + // fdo#48969: switch source and target because factor is used to divide! double const fFactor = - GetConversionFactor(sUnit, nSourceUnit, nTargetUnit); + GetConversionFactor(sUnit, nTargetUnit, nSourceUnit); if(fFactor != 1.0 && fFactor != 0.0) rValue /= fFactor; } diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx index 6ceb8850b014..f1ad2a1dcba8 100644 --- a/xmloff/source/core/xmluconv.cxx +++ b/xmloff/source/core/xmluconv.cxx @@ -340,7 +340,7 @@ sal_Bool SvXMLUnitConverter::convertDouble(double& rValue, rString, m_pImpl->m_eCoreMeasureUnit); return ::sax::Converter::convertDouble(rValue, rString, - m_pImpl->m_eCoreMeasureUnit, eSrcUnit); + eSrcUnit, m_pImpl->m_eCoreMeasureUnit); } else { |