[Libreoffice-commits] .: oox/inc oox/source
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Fri Mar 23 07:36:08 PDT 2012
oox/inc/oox/vml/vmlshape.hxx | 1 +
oox/source/token/properties.txt | 2 ++
oox/source/vml/vmlshape.cxx | 9 ++++++++-
oox/source/vml/vmlshapecontext.cxx | 1 +
4 files changed, 12 insertions(+), 1 deletion(-)
New commits:
commit 3751ab6910d06ca01d1980fce40792560afc9ebb
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date: Fri Mar 23 15:28:29 2012 +0100
n#751573: docx, no mso-fit-shape-to-text means the textbox size is fixed
diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index 37e9c09..8c68337 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -80,6 +80,7 @@ struct ShapeTypeModel
::rtl::OUString maMarginLeft; /// X position of the shape bounding box to shape anchor (number with unit).
::rtl::OUString maMarginTop; /// Y position of the shape bounding box to shape anchor (number with unit).
::rtl::OUString maPositionVerticalRelative; /// The Y position is relative to this.
+ sal_Bool mbAutoHeight; /// If true, the height value is a minimum value (mostly used for textboxes)
StrokeModel maStrokeModel; /// Border line formatting.
FillModel maFillModel; /// Shape fill formatting.
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 560f879..97555c8 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -180,6 +180,7 @@ FooterIsDynamicHeight
FooterIsOn
FooterIsShared
FormulaConvention
+FrameIsAutomaticHeight
Function
GapwidthSequence
Geometry3D
@@ -418,6 +419,7 @@ Size
Size100thMM
SizePixel
SizeProtect
+SizeType
SkipDuplicates
SortInfo
Sound
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index bdecb8b..ec34f0e 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -113,7 +113,8 @@ Rectangle lclGetAbsRect( const Rectangle& rRelRect, const Rectangle& rShapeRect,
// ============================================================================
-ShapeTypeModel::ShapeTypeModel()
+ShapeTypeModel::ShapeTypeModel():
+ mbAutoHeight( sal_False )
{
}
@@ -368,6 +369,12 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
Reference< XShape > xShape = mrDrawing.createAndInsertXShape( maService, rxShapes, rShapeRect );
convertShapeProperties( xShape );
+ if ( maService.equalsAscii( "com.sun.star.text.TextFrame" ) )
+ {
+ PropertySet( xShape ).setAnyProperty( PROP_FrameIsAutomaticHeight, makeAny( maTypeModel.mbAutoHeight ) );
+ PropertySet( xShape ).setAnyProperty( PROP_SizeType, makeAny( maTypeModel.mbAutoHeight ? SizeType::MIN : SizeType::FIX ) );
+ }
+
// 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 91703fc..12d2dc4 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -347,6 +347,7 @@ void ShapeTypeContext::setStyle( const OUString& rStyle )
else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "margin-left" ) ) ) mrTypeModel.maMarginLeft = aValue;
else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "margin-top" ) ) ) mrTypeModel.maMarginTop = aValue;
else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "mso-position-vertical-relative" ) ) ) mrTypeModel.maPositionVerticalRelative = aValue;
+ else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "mso-fit-shape-to-text" ) ) ) mrTypeModel.mbAutoHeight = sal_True;
}
}
}
More information about the Libreoffice-commits
mailing list