diff options
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/export/vmlexport.cxx | 27 | ||||
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 2 |
2 files changed, 28 insertions, 1 deletions
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index a401c3c44465..f45edde6cc86 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -68,6 +68,8 @@ VMLExport::VMLExport( ::sax_fastparser::FSHelperPtr const & pSerializer, VMLText , m_aShapeTypeWritten( ESCHER_ShpInst_COUNT ) , m_bSkipwzName( false ) , m_bUseHashMarkForType( false ) + , m_bOverrideShapeIdGeneration( false ) + , m_nShapeIDCounter( 0 ) { mnGroupLevel = 1; } @@ -208,6 +210,18 @@ bool VMLExport::IsWaterMarkShape(const OUString& rStr) return rStr.match("PowerPlusWaterMarkObject") || rStr.match("WordPictureWatermark"); } +void VMLExport::OverrideShapeIDGen(bool bOverrideShapeIdGen, const OString sShapeIDPrefix) +{ + m_bOverrideShapeIdGeneration = bOverrideShapeIdGen; + if(bOverrideShapeIdGen) + { + assert(!sShapeIDPrefix.isEmpty()); + m_sShapeIDPrefix = sShapeIDPrefix; + } + else + m_sShapeIDPrefix.clear(); +} + static void impl_AddArrowHead( sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue ) { if ( !pAttrList ) @@ -884,7 +898,10 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle& OString VMLExport::ShapeIdString( sal_uInt32 nId ) { - return "shape_" + OString::number( nId ); + if(m_bOverrideShapeIdGeneration) + return m_sShapeIDPrefix + OString::number( nId ); + else + return "shape_" + OString::number( nId ); } void VMLExport::AddFlipXY( ) @@ -1025,6 +1042,14 @@ OUString lcl_getAnchorIdFromGrabBag(const SdrObject* pSdrObject) return aResult; } +sal_uInt32 VMLExport::GenerateShapeId() +{ + if(!m_bOverrideShapeIdGeneration) + return EscherEx::GenerateShapeId(); + else + return m_nShapeIDCounter++; +} + sal_Int32 VMLExport::StartShape() { if ( m_nShapeType == ESCHER_ShpInst_Nil ) diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index b51a9020393f..e1d0cf6d9a41 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -616,6 +616,8 @@ void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel, else // static (is the default) means anchored inline { rPropSet.setProperty(PROP_AnchorType, text::TextContentAnchorType_AS_CHARACTER); + // Use top orientation, this one seems similar to what MSO uses as inline + rPropSet.setAnyProperty(PROP_VertOrient, makeAny(text::VertOrientation::TOP)); } lcl_setSurround( rPropSet, rTypeModel, rGraphicHelper ); } |