summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej@ahunt.org>2015-02-05 17:45:01 +0000
committerAndrzej Hunt <andrzej@ahunt.org>2015-10-20 18:18:09 +0200
commitdbf8feeb9223adb20828d5b2bff4c879fd789d3d (patch)
tree65c000b2bc6ed99748842326d2a73c2607325c0f
parent93ed1c72b63472457051ad78203ea85442566746 (diff)
Trim unit string for ut_parse.
Change-Id: I83c32e5336b589174db92123c4959db4ac8624c8
-rw-r--r--sc/source/core/units/utunit.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sc/source/core/units/utunit.cxx b/sc/source/core/units/utunit.cxx
index 706165828df4..1cd64b76d631 100644
--- a/sc/source/core/units/utunit.cxx
+++ b/sc/source/core/units/utunit.cxx
@@ -14,7 +14,9 @@
using namespace sc::units;
bool UtUnit::createUnit(const OUString& rUnitString, UtUnit& rUnitOut, const boost::shared_ptr< ut_system >& pUTSystem) {
- OString sUnitStringUTF8 = OUStringToOString(rUnitString, RTL_TEXTENCODING_UTF8);
+ // ut_parse requires the string to be trimmed of whitespace, it's
+ // simplest just to do this during conversion:
+ OString sUnitStringUTF8 = OUStringToOString(rUnitString.trim(), RTL_TEXTENCODING_UTF8);
UtUnit pParsedUnit(ut_parse(pUTSystem.get(), sUnitStringUTF8.getStr(), UT_UTF8));