summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-06-07 18:10:20 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-06-08 16:41:37 +0200
commit2f82bf1949299a3c27423db36f4a1c679e5492ce (patch)
tree78cfae409781407f3efae0c7cc6b8077772fa466 /oox
parent01e6c68e0a182ff5cb783f896ed832b58b7a1d76 (diff)
handle f suffix (1/65536ths) when reading VML percentages
Not all percentage attributes actually use this, but better be safe and no point in checking only the allowed ones use them. Change-Id: I851f9b19ea85201d70d5e6b2e219bbcd88ae3dea
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/oox/vml/vmlformatting.hxx5
-rw-r--r--oox/source/vml/vmlformatting.cxx3
2 files changed, 6 insertions, 2 deletions
diff --git a/oox/inc/oox/vml/vmlformatting.hxx b/oox/inc/oox/vml/vmlformatting.hxx
index 25f7a555d94b..428e2bd1d5e4 100644
--- a/oox/inc/oox/vml/vmlformatting.hxx
+++ b/oox/inc/oox/vml/vmlformatting.hxx
@@ -66,9 +66,10 @@ public:
floating-point value.
@param rValue The VML percentage value. This is a floating-point value
- with optional following '%' sign. If the '%' sign is missing, the
+ with optional following '%' or 'f' sign. If the sign is missing, the
floating point value will be returned unmodified. If the '%' sign
- is present, the value will be divided by 100.
+ is present, the value will be divided by 100. If the 'f' sign is present,
+ the value will be divided by 65536.
*/
static double decodePercent(
const ::rtl::OUString& rValue,
diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index 4bc582d777be..6d202767fb2b 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -107,6 +107,9 @@ bool lclExtractDouble( double& orfValue, sal_Int32& ornEndPos, const OUString& r
if( (nEndPos + 1 == rValue.getLength()) && (rValue[ nEndPos ] == '%') )
return fValue / 100.0;
+ if( (nEndPos + 1 == rValue.getLength()) && (rValue[ nEndPos ] == 'f') )
+ return fValue / 65536.0;
+
OSL_FAIL( "ConversionHelper::decodePercent - unknown measure unit" );
return fDefValue;
}