diff options
-rw-r--r-- | sdext/source/pdfimport/tree/drawtreevisiting.cxx | 25 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 5 |
3 files changed, 22 insertions, 11 deletions
diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx index dfdec02539db..51ef5f232d85 100644 --- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx +++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx @@ -188,21 +188,30 @@ void DrawXmlEmitter::fillFrameProps( DrawElement& rElem, bool bWasTransformed ) { - rProps[ "draw:z-index" ] = OUString::number( rElem.ZOrder ); - rProps[ "draw:style-name"] = rEmitContext.rStyles.getStyleName( rElem.StyleId ); + static constexpr OUStringLiteral sDrawZIndex = u"draw:z-index"; + static constexpr OUStringLiteral sDrawStyleName = u"draw:style-name"; + static constexpr OUStringLiteral sDrawTextStyleName = u"draw:text-style-name"; + static constexpr OUStringLiteral sSvgX = u"svg:x"; + static constexpr OUStringLiteral sSvgY = u"svg:y"; + static constexpr OUStringLiteral sSvgWidth = u"svg:width"; + static constexpr OUStringLiteral sSvgHeight = u"svg:height"; + static constexpr OUStringLiteral sDrawTransform = u"draw:transform"; + + rProps[ sDrawZIndex ] = OUString::number( rElem.ZOrder ); + rProps[ sDrawStyleName ] = rEmitContext.rStyles.getStyleName( rElem.StyleId ); if (rElem.IsForText) - rProps["draw:text-style-name"] = rEmitContext.rStyles.getStyleName(rElem.TextStyleId); + rProps[ sDrawTextStyleName ] = rEmitContext.rStyles.getStyleName(rElem.TextStyleId); const GraphicsContext& rGC = rEmitContext.rProcessor.getGraphicsContext( rElem.GCId ); if (bWasTransformed) { - rProps[ "svg:x" ] = convertPixelToUnitString(rElem.x); - rProps[ "svg:y" ] = convertPixelToUnitString(rElem.y); - rProps[ "svg:width" ] = convertPixelToUnitString(rElem.w); - rProps[ "svg:height" ] = convertPixelToUnitString(rElem.h); + rProps[ sSvgX ] = convertPixelToUnitString(rElem.x); + rProps[ sSvgY ] = convertPixelToUnitString(rElem.y); + rProps[ sSvgWidth ] = convertPixelToUnitString(rElem.w); + rProps[ sSvgHeight ] = convertPixelToUnitString(rElem.h); } else { @@ -236,7 +245,7 @@ void DrawXmlEmitter::fillFrameProps( DrawElement& rElem, aBuf.append(mat.get(1, 2)); aBuf.append(")"); - rProps["draw:transform"] = aBuf.makeStringAndClear(); + rProps[ sDrawTransform ] = aBuf.makeStringAndClear(); } } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 2280402dcb76..e559fe8b4b9f 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -143,8 +143,9 @@ namespace { class ShapePositionProvider : public PropertyValueProvider { public: + static constexpr OUStringLiteral sPosition = u"Position"; explicit ShapePositionProvider( SvxShape& _shape ) - :PropertyValueProvider( _shape, "Position" ) + :PropertyValueProvider( _shape, sPosition ) { } diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 22c302205e02..2dc2e33fb91c 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -707,8 +707,9 @@ void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */) // SwTextBoxHelper::syncProperty, which indirectly calls SwTextBoxHelper::isTextBox) uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropSet->getPropertySetInfo(); - if (xPropertySetInfo->hasPropertyByName("TextBox")) - xPropSet->setPropertyValue("TextBox", uno::Any(mbTextBox)); + static constexpr OUStringLiteral sTextBox = u"TextBox"; + if (xPropertySetInfo->hasPropertyByName(sTextBox)) + xPropSet->setPropertyValue(sTextBox, uno::Any(mbTextBox)); // if this is an auto style, set its properties if(bAutoStyle && pDocStyle) |