summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-05-25 11:16:40 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-05-28 18:06:14 +0200
commit96c7ab19b77c2f90acd4c34552474b0f616f48a7 (patch)
treed55f0c40fb4a3758c7464c2731d2b284f5530846 /oox
parentc52ba433491afbca70aa1977a624c795bdd5b9ef (diff)
hack the same meaning for o:hr handling like MSO uses
This doesn't in fact change much in LO, since ShapeType::getAbsRectangle() uses 0 as the reference size, 100% is still actually 0. Change-Id: I81690d710402224c8477c90ad14672b593aacc24
Diffstat (limited to 'oox')
-rw-r--r--oox/source/vml/vmlshapecontext.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index ddae966b59b8..e6485f3c7927 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -267,6 +267,15 @@ ShapeTypeContext::ShapeTypeContext( ContextHandler2Helper& rParent, ShapeType& r
mrTypeModel.moCoordPos = lclDecodeInt32Pair( rAttribs, XML_coordorigin );
mrTypeModel.moCoordSize = lclDecodeInt32Pair( rAttribs, XML_coordsize );
setStyle( rAttribs.getString( XML_style, OUString() ) );
+ if( lclDecodeBool( rAttribs, O_TOKEN( hr )).get( false ))
+ { // MSO's handling of o:hr width is nowhere near what the spec says:
+ // - o:hrpct is not in % but in 0.1%
+ // - if o:hrpct is not given, 100% width is assumed
+ // - given width is used only if explicit o:hrpct="0" is given
+ OUString hrpct = rAttribs.getString( O_TOKEN( hrpct ), "1000" );
+ if( hrpct != "0" )
+ mrTypeModel.maWidth = OUString::valueOf( hrpct.toInt32() / 10 ) + "%";
+ }
// stroke settings (may be overridden by v:stroke element later)
mrTypeModel.maStrokeModel.moStroked = lclDecodeBool( rAttribs, XML_stroked );