summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/token/properties.txt2
-rw-r--r--oox/source/vml/vmlshape.cxx26
-rw-r--r--oox/source/vml/vmlshapecontext.cxx4
3 files changed, 32 insertions, 0 deletions
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index ff4e47b09f34..c925d1fe7b1e 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -374,9 +374,11 @@ ReferenceSheet
RefreshPeriod
RegularExpressions
RelId
+RelativeHeight
RelativeHorizontalTabbarWidth
RelativePosition
RelativeSize
+RelativeWidth
Repeat
RepeatDelay
Representation
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 7d8d1660a42e..7773d8a50243 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -450,6 +450,32 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
PropertySet( xShape ).setAnyProperty( PROP_FrameIsAutomaticHeight, makeAny( maTypeModel.mbAutoHeight ) );
PropertySet( xShape ).setAnyProperty( PROP_SizeType, makeAny( maTypeModel.mbAutoHeight ? SizeType::MIN : SizeType::FIX ) );
}
+ else
+ {
+ // FIXME Setting the relative width/heigh only for everything but text frames as
+ // TextFrames already have relative widht/heigh feature... but currently not working
+ // in the way we need.
+
+ // Set the relative width / height if any
+ if ( !maTypeModel.maWidthPercent.isEmpty( ) )
+ {
+ // Only page-relative width is supported ATM
+ if ( maTypeModel.maWidthRelative.isEmpty() || maTypeModel.maWidthRelative == "page" )
+ {
+ sal_Int16 nWidth = maTypeModel.maWidthPercent.toInt32() / 10;
+ PropertySet( xShape ).setAnyProperty(PROP_RelativeWidth, makeAny( nWidth ) );
+ }
+ }
+ if ( !maTypeModel.maHeightPercent.isEmpty( ) )
+ {
+ // Only page-relative height is supported ATM
+ if ( maTypeModel.maHeightRelative.isEmpty() || maTypeModel.maHeightRelative == "page" )
+ {
+ sal_Int16 nHeight = maTypeModel.maHeightPercent.toInt32() / 10;
+ PropertySet( xShape ).setAnyProperty(PROP_RelativeHeight, makeAny( nHeight ) );
+ }
+ }
+ }
// Import Legacy Fragments (if any)
if( xShape.is() && !maShapeModel.maLegacyDiagramPath.isEmpty() )
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index 01543c31e8d8..35525e69f76f 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -364,6 +364,10 @@ void ShapeTypeContext::setStyle( const OUString& rStyle )
else if( aName == "mso-position-horizontal-relative" ) mrTypeModel.maPositionHorizontalRelative = aValue;
else if( aName == "mso-position-horizontal" ) mrTypeModel.maPositionHorizontal = aValue;
else if( aName == "mso-position-vertical" ) mrTypeModel.maPositionVertical = aValue;
+ else if( aName == "mso-width-percent" ) mrTypeModel.maWidthPercent = aValue;
+ else if( aName == "mso-width-relative" ) mrTypeModel.maWidthRelative = aValue;
+ else if( aName == "mso-height-percent" ) mrTypeModel.maHeightPercent = aValue;
+ else if( aName == "mso-height-relative" ) mrTypeModel.maHeightRelative = aValue;
else if( aName == "mso-fit-shape-to-text" ) mrTypeModel.mbAutoHeight = sal_True;
else if( aName == "rotation" ) mrTypeModel.maRotation = aValue;
else if( aName == "flip" ) mrTypeModel.maFlip = aValue;