From 97eb8a6e0eb830f37dcba64a51d725aab4c5ff53 Mon Sep 17 00:00:00 2001 From: Jean-Noël Rouvignac Date: Wed, 30 Jan 2013 11:44:23 +0100 Subject: Removed several useless macros: A2OU, A2S, C2U, C2S, OUSTR, OUSTRING MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie859cb2dfdc7103c379fce56be88eef8fe390afd Reviewed-on: https://gerrit.libreoffice.org/1924 Tested-by: Luboš Luňák Reviewed-by: Luboš Luňák --- filter/source/msfilter/msocximex.cxx | 8 +- filter/source/svg/svgexport.cxx | 339 +++++++++++++++++------------------ filter/source/svg/svgfontexport.cxx | 12 +- filter/source/svg/svgwriter.cxx | 309 +++++++++++++------------------ filter/source/svg/svgwriter.hxx | 5 +- 5 files changed, 300 insertions(+), 373 deletions(-) (limited to 'filter') diff --git a/filter/source/msfilter/msocximex.cxx b/filter/source/msfilter/msocximex.cxx index 09f25e03872b..abf8b26a47e1 100644 --- a/filter/source/msfilter/msocximex.cxx +++ b/filter/source/msfilter/msocximex.cxx @@ -30,7 +30,7 @@ using namespace ::com::sun::star; using namespace ::rtl; -#define C2U(cChar) OUString(cChar) +#define cChar OUString(cChar) OUString sWW8_form( "WW-Standard" ); @@ -121,15 +121,15 @@ const uno::Reference< container::XIndexContainer >& return xFormComps; uno::Reference< uno::XInterface > xCreate = - rServiceFactory->createInstance( C2U( - "com.sun.star.form.component.Form") ); + rServiceFactory->createInstance( + "com.sun.star.form.component.Form" ); if( xCreate.is() ) { uno::Reference< beans::XPropertySet > xFormPropSet( xCreate, uno::UNO_QUERY ); uno::Any aTmp(&sName,getCppuType((OUString *)0)); - xFormPropSet->setPropertyValue( C2U("Name"), aTmp ); + xFormPropSet->setPropertyValue( "Name", aTmp ); uno::Reference< form::XForm > xForm( xCreate, uno::UNO_QUERY ); OSL_ENSURE(xForm.is(), "no Form?"); diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 4d04490a17fd..36d66b47f712 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -71,7 +71,7 @@ static const char aOOOAttrMasterObjectsVisibility[] = NSPREFIX "master-object static const char aOOOAttrPageNumberVisibility[] = NSPREFIX "page-number-visibility"; static const char aOOOAttrDateTimeVisibility[] = NSPREFIX "date-time-visibility"; static const char aOOOAttrFooterVisibility[] = NSPREFIX "footer-visibility"; -static const char aOOOAttrDateTimeField[] = NSPREFIX "date-time-field"; +static const OUString aOOOAttrDateTimeField = NSPREFIX "date-time-field"; static const char aOOOAttrFooterField[] = NSPREFIX "footer-field"; static const char aOOOAttrHeaderField[] = NSPREFIX "header-field"; static const char aOOOAttrHasTransition[] = NSPREFIX "has-transition"; @@ -99,7 +99,7 @@ static const char aOOOAttrTextAdjust[] = NSPREFIX "text-adjust"; virtual ::rtl::OUString getClassName() const \ { \ static const char className[] = #class_name; \ - return B2UCONST( className ); \ + return OUString( className ); \ } @@ -168,8 +168,7 @@ public: TEXT_FIELD_GET_CLASS_NAME_METHOD( FixedDateTimeField ) virtual void growCharSet( SVGFilter::UCharSetMapMap & aTextFieldCharSets ) const { - static const ::rtl::OUString sFieldId = B2UCONST( aOOOAttrDateTimeField ); - implGrowCharSet( aTextFieldCharSets, text, sFieldId ); + implGrowCharSet( aTextFieldCharSets, text, aOOOAttrDateTimeField ); } virtual ~FixedDateTimeField() {} }; @@ -181,7 +180,7 @@ public: TEXT_FIELD_GET_CLASS_NAME_METHOD( FooterField ) virtual void growCharSet( SVGFilter::UCharSetMapMap & aTextFieldCharSets ) const { - static const ::rtl::OUString sFieldId = B2UCONST( aOOOAttrFooterField ); + static const OUString sFieldId = aOOOAttrFooterField; implGrowCharSet( aTextFieldCharSets, text, sFieldId ); } virtual ~FooterField() {} @@ -194,7 +193,7 @@ public: TEXT_FIELD_GET_CLASS_NAME_METHOD( HeaderField ) virtual void growCharSet( SVGFilter::UCharSetMapMap & aTextFieldCharSets ) const { - static const ::rtl::OUString sFieldId = B2UCONST( aOOOAttrHeaderField ); + static const OUString sFieldId = aOOOAttrHeaderField; implGrowCharSet( aTextFieldCharSets, text, sFieldId ); } virtual ~HeaderField() {} @@ -233,25 +232,25 @@ public: { case SVXDATEFORMAT_STDSMALL: ; case SVXDATEFORMAT_A: // 13.02.96 - sDateFormat = B2UCONST( "" ); + sDateFormat = ""; break; case SVXDATEFORMAT_C: // 13.Feb 1996 - sDateFormat = B2UCONST( "" ); + sDateFormat = ""; break; case SVXDATEFORMAT_D: // 13.February 1996 - sDateFormat = B2UCONST( "" ); + sDateFormat = ""; break; case SVXDATEFORMAT_E: // Tue, 13.February 1996 - sDateFormat = B2UCONST( "" ); + sDateFormat = ""; break; case SVXDATEFORMAT_STDBIG: ; case SVXDATEFORMAT_F: // Tuesday, 13.February 1996 - sDateFormat = B2UCONST( "" ); + sDateFormat = ""; break; // default case case SVXDATEFORMAT_B: ; // 13.02.1996 default: - sDateFormat = B2UCONST( "" ); + sDateFormat = ""; break; } } @@ -262,27 +261,25 @@ public: switch( eTimeFormat ) { case SVXTIMEFORMAT_24_HMS: // 13:49:38 - sTimeFormat = B2UCONST( "" ); + sTimeFormat = ""; break; case SVXTIMEFORMAT_AM_HM: ; // 01:49 PM case SVXTIMEFORMAT_12_HM: - sTimeFormat = B2UCONST( "" ); + sTimeFormat = ""; break; case SVXTIMEFORMAT_AM_HMS: ; // 01:49:38 PM case SVXTIMEFORMAT_12_HMS: - sTimeFormat = B2UCONST( "" ); + sTimeFormat = ""; break; // default case case SVXTIMEFORMAT_24_HM: ; // 13:49 default: - sTimeFormat = B2UCONST( "" ); + sTimeFormat = ""; break; } } - OUString sDateTimeFormat = sDateFormat; - sDateTimeFormat += OUString::valueOf( sal_Unicode(' ') ); - sDateTimeFormat += sTimeFormat; + OUString sDateTimeFormat = sDateFormat + " " + sTimeFormat; pSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrDateTimeFormat, sDateTimeFormat ); SvXMLElementExport aExp( *pSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True ); @@ -291,7 +288,7 @@ public: { // we use the unicode char set in an improper way: we put in the date/time fortat // in order to pass it to the CalcFieldValue method - static const ::rtl::OUString sFieldId = B2UCONST( aOOOAttrDateTimeField ) + B2UCONST( "-variable" ); + static const OUString sFieldId = aOOOAttrDateTimeField + "-variable"; SVGFilter::ObjectSet::const_iterator aMasterPageIt = mMasterPageSet.begin(); for( ; aMasterPageIt != mMasterPageSet.end(); ++aMasterPageIt ) { @@ -584,7 +581,7 @@ sal_Bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) { maFilterData.realloc( 6 ); - maFilterData[ 0 ].Name = B2UCONST( SVG_PROP_TINYPROFILE ); + maFilterData[ 0 ].Name = SVG_PROP_TINYPROFILE; maFilterData[ 0 ].Value <<= (sal_Bool) sal_True; // font embedding @@ -595,29 +592,29 @@ sal_Bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) const bool bEmbedFonts=pSVGDisableFontEmbedding ? false : ( aEmbedFontEnv.getLength() ? false : true); - maFilterData[ 1 ].Name = B2UCONST( SVG_PROP_EMBEDFONTS ); + maFilterData[ 1 ].Name = SVG_PROP_EMBEDFONTS; maFilterData[ 1 ].Value <<= (sal_Bool) (bEmbedFonts); // Native decoration - maFilterData[ 2 ].Name = B2UCONST( SVG_PROP_NATIVEDECORATION ); + maFilterData[ 2 ].Name = SVG_PROP_NATIVEDECORATION; maFilterData[ 2 ].Value <<= (sal_Bool) sal_False; // glyph placement const char* pSVGGlyphPlacement = getenv( "SVG_GLYPH_PLACEMENT" ); - maFilterData[ 3 ].Name = B2UCONST( SVG_PROP_GLYPHPLACEMENT ); + maFilterData[ 3 ].Name = SVG_PROP_GLYPHPLACEMENT; if( pSVGGlyphPlacement ) maFilterData[ 3 ].Value <<= ::rtl::OUString::createFromAscii( pSVGGlyphPlacement ); else - maFilterData[ 3 ].Value <<= B2UCONST( "xlist" ); + maFilterData[ 3 ].Value <<= OUString("xlist"); // Tiny Opacity - maFilterData[ 4 ].Name = B2UCONST( SVG_PROP_OPACITY ); + maFilterData[ 4 ].Name = SVG_PROP_OPACITY; maFilterData[ 4 ].Value <<= (sal_Bool) sal_True; // Tiny Gradient - maFilterData[ 5 ].Name = B2UCONST( SVG_PROP_GRADIENT ); + maFilterData[ 5 ].Name = SVG_PROP_GRADIENT; maFilterData[ 5 ].Value <<= (sal_Bool) sal_False; } @@ -732,7 +729,7 @@ sal_Bool SVGFilter::implLookForFirstVisiblePage() sal_Bool bVisible = sal_False; if( !mbPresentation || mbSinglePage || - ( ( xPropSet->getPropertyValue( B2UCONST( "Visible" ) ) >>= bVisible ) && bVisible ) ) + ( ( xPropSet->getPropertyValue( "Visible" ) >>= bVisible ) && bVisible ) ) { mnVisiblePage = nCurPage; } @@ -763,8 +760,8 @@ sal_Bool SVGFilter::implExportDocument() if( xDefaultPagePropertySet.is() ) { - xDefaultPagePropertySet->getPropertyValue( B2UCONST( "Width" ) ) >>= nDocWidth; - xDefaultPagePropertySet->getPropertyValue( B2UCONST( "Height" ) ) >>= nDocHeight; + xDefaultPagePropertySet->getPropertyValue( "Width" ) >>= nDocWidth; + xDefaultPagePropertySet->getPropertyValue( "Height" ) >>= nDocHeight; } if( xExtDocHandler.is() && !mpSVGExport->IsUseTinyProfile() ) @@ -772,10 +769,10 @@ sal_Bool SVGFilter::implExportDocument() xExtDocHandler->unknown( SVG_DTD_STRING ); } - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "version", B2UCONST( "1.2" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "version", "1.2" ); if( mpSVGExport->IsUseTinyProfile() ) - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "baseProfile", B2UCONST( "tiny" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "baseProfile", "tiny" ); // enabling _SVG_WRITE_EXTENTS means that the slide size is not adapted // to the size of the browser window, moreover the slide is top left aligned @@ -784,47 +781,42 @@ sal_Bool SVGFilter::implExportDocument() #ifdef _SVG_WRITE_EXTENTS if( mbSinglePage ) { - aAttr = OUString::valueOf( nDocWidth * 0.01 ); - aAttr += B2UCONST( "mm" ); + aAttr = OUString::valueOf( nDocWidth * 0.01 ) + "mm"; mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "width", aAttr ); - aAttr = OUString::valueOf( nDocHeight * 0.01 ); - aAttr += B2UCONST( "mm" ); + aAttr = OUString::valueOf( nDocHeight * 0.01 ) + "mm"; mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "height", aAttr ); } #endif - aAttr = B2UCONST( "0 0 " ); - aAttr += OUString::valueOf( nDocWidth ); - aAttr += B2UCONST( " " ); - aAttr += OUString::valueOf( nDocHeight ); + aAttr = "0 0 " + OUString::valueOf( nDocWidth ) + " " + OUString::valueOf( nDocHeight ); - msClipPathId = B2UCONST( "presentation_clip_path" ); - OUString sClipPathAttrValue = B2UCONST( "url(#" ) + msClipPathId + B2UCONST( ")" ); + msClipPathId = "presentation_clip_path"; + OUString sClipPathAttrValue = "url(#" + msClipPathId + ")"; mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "viewBox", aAttr ); - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "preserveAspectRatio", B2UCONST( "xMidYMid" ) ); - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "fill-rule", B2UCONST( "evenodd" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "preserveAspectRatio", "xMidYMid" ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "fill-rule", "evenodd" ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clip-path", sClipPathAttrValue ); // standard line width is based on 1 pixel on a 90 DPI device (0.28222mmm) mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "stroke-width", OUString::valueOf( 28.222 ) ); - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "stroke-linejoin", B2UCONST( "round" ) ); - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns", B2UCONST( "http://www.w3.org/2000/svg" ) ); - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns:ooo", B2UCONST( "http://xml.openoffice.org/svg/export" ) ); - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns:xlink", B2UCONST( "http://www.w3.org/1999/xlink" ) ); - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xml:space", B2UCONST( "preserve" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "stroke-linejoin", "round" ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns", "http://www.w3.org/2000/svg" ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns:ooo", "http://xml.openoffice.org/svg/export" ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns:xlink", "http://www.w3.org/1999/xlink" ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xml:space", "preserve" ); mpSVGDoc = new SvXMLElementExport( *mpSVGExport, XML_NAMESPACE_NONE, "svg", sal_True, sal_True ); // Create a ClipPath element that will be used for cutting bitmaps and other elements that could exceed the page margins. { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "ClipPathGroup" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "ClipPathGroup" ); SvXMLElementExport aDefsElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", sal_True, sal_True ); { mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", msClipPathId ); - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clipPathUnits", B2UCONST( "userSpaceOnUse" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clipPathUnits", "userSpaceOnUse" ); SvXMLElementExport aClipPathElem( *mpSVGExport, XML_NAMESPACE_NONE, "clipPath", sal_True, sal_True ); { mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "x", OUString::valueOf( sal_Int32(0) ) ); @@ -936,7 +928,7 @@ sal_Bool SVGFilter::implGenerateMetaData() // we wrap all meta presentation info into a svg:defs element SvXMLElementExport aDefsElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", sal_True, sal_True ); - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", B2UCONST( aOOOElemMetaSlides ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", aOOOElemMetaSlides ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrNumberOfSlides, OUString::valueOf( nCount ) ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrStartSlideNumber, OUString::valueOf( mnVisiblePage ) ); @@ -963,16 +955,16 @@ sal_Bool SVGFilter::implGenerateMetaData() switch( nPageNumberingType ) { case SVX_CHARS_UPPER_LETTER: - sNumberingType = B2UCONST( "alpha-upper" ); + sNumberingType = "alpha-upper"; break; case SVX_CHARS_LOWER_LETTER: - sNumberingType = B2UCONST( "alpha-lower" ); + sNumberingType = "alpha-lower"; break; case SVX_ROMAN_UPPER: - sNumberingType = B2UCONST( "roman-upper" ); + sNumberingType = "roman-upper"; break; case SVX_ROMAN_LOWER: - sNumberingType = B2UCONST( "roman-lower" ); + sNumberingType = "roman-lower"; break; // arabic numbering type is the default, so we do not append any attribute for it case SVX_ARABIC: ; @@ -987,8 +979,8 @@ sal_Bool SVGFilter::implGenerateMetaData() { SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True ); - const OUString aId( B2UCONST( aOOOElemMetaSlide ) ); - const OUString aElemTextFieldId( B2UCONST( aOOOElemTextField ) ); + const OUString aId( aOOOElemMetaSlide ); + const OUString aElemTextFieldId( aOOOElemTextField ); std::vector< TextField* > aFieldSet; for( sal_Int32 i = 0; i < nCount; ++i ) @@ -1022,35 +1014,35 @@ sal_Bool SVGFilter::implGenerateMetaData() VariableDateTimeField aVariableDateTimeField; FooterField aFooterField; - xPropSet->getPropertyValue( B2UCONST( "IsBackgroundVisible" ) ) >>= bBackgroundVisibility; + xPropSet->getPropertyValue( "IsBackgroundVisible" ) >>= bBackgroundVisibility; // in case the attribute is set to its default value it is not appended to the meta-slide element if( !bBackgroundVisibility ) // visibility default value: 'visible' - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrBackgroundVisibility, B2UCONST( "hidden" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrBackgroundVisibility, "hidden" ); // Page Number, Date/Time, Footer and Header Fields are regarded as background objects. // So bBackgroundObjectsVisibility overrides visibility of master page text fields. - xPropSet->getPropertyValue( B2UCONST( "IsBackgroundObjectsVisible" ) ) >>= bBackgroundObjectsVisibility; + xPropSet->getPropertyValue( "IsBackgroundObjectsVisible" ) >>= bBackgroundObjectsVisibility; if( bBackgroundObjectsVisibility ) // visibility default value: 'visible' { /* * Page Number Field */ - xPropSet->getPropertyValue( B2UCONST( "IsPageNumberVisible" ) ) >>= bPageNumberVisibility; + xPropSet->getPropertyValue( "IsPageNumberVisible" ) >>= bPageNumberVisibility; bPageNumberVisibility = bPageNumberVisibility && ( nPageNumberingType != SVX_NUMBER_NONE ); if( bPageNumberVisibility ) // visibility default value: 'hidden' { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrPageNumberVisibility, B2UCONST( "visible" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrPageNumberVisibility, "visible" ); } /* * Date/Time Field */ - xPropSet->getPropertyValue( B2UCONST( "IsDateTimeVisible" ) ) >>= bDateTimeVisibility; + xPropSet->getPropertyValue( "IsDateTimeVisible" ) >>= bDateTimeVisibility; if( bDateTimeVisibility ) // visibility default value: 'visible' { - xPropSet->getPropertyValue( B2UCONST( "IsDateTimeFixed" ) ) >>= bDateTimeFixed; + xPropSet->getPropertyValue( "IsDateTimeFixed" ) >>= bDateTimeFixed; if( bDateTimeFixed ) // we are interested only in the field text not in the date/time format { - xPropSet->getPropertyValue( B2UCONST( "DateTimeText" ) ) >>= aFixedDateTimeField.text; + xPropSet->getPropertyValue( "DateTimeText" ) >>= aFixedDateTimeField.text; if( !aFixedDateTimeField.text.isEmpty() ) { OUString sFieldId = implGenerateFieldId( aFieldSet, aFixedDateTimeField, aElemTextFieldId, xMasterPage ); @@ -1059,22 +1051,22 @@ sal_Bool SVGFilter::implGenerateMetaData() } else // the inverse applies: we are interested only in the date/time format not in the field text { - xPropSet->getPropertyValue( B2UCONST( "DateTimeFormat" ) ) >>= aVariableDateTimeField.format; + xPropSet->getPropertyValue( "DateTimeFormat" ) >>= aVariableDateTimeField.format; OUString sFieldId = implGenerateFieldId( aFieldSet, aVariableDateTimeField, aElemTextFieldId, xMasterPage ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrDateTimeField, sFieldId ); } } else { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrDateTimeVisibility, B2UCONST( "hidden" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrDateTimeVisibility, "hidden" ); } /* * Footer Field */ - xPropSet->getPropertyValue( B2UCONST( "IsFooterVisible" ) ) >>= bFooterVisibility; + xPropSet->getPropertyValue( "IsFooterVisible" ) >>= bFooterVisibility; if( bFooterVisibility ) // visibility default value: 'visible' { - xPropSet->getPropertyValue( B2UCONST( "FooterText" ) ) >>= aFooterField.text; + xPropSet->getPropertyValue( "FooterText" ) >>= aFooterField.text; if( !aFooterField.text.isEmpty() ) { OUString sFieldId = implGenerateFieldId( aFieldSet, aFooterField, aElemTextFieldId, xMasterPage ); @@ -1083,12 +1075,12 @@ sal_Bool SVGFilter::implGenerateMetaData() } else { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrFooterVisibility, B2UCONST( "hidden" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrFooterVisibility, "hidden" ); } } else { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrMasterObjectsVisibility, B2UCONST( "hidden" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrMasterObjectsVisibility, "hidden" ); } // We look for a slide transition. @@ -1098,9 +1090,9 @@ sal_Bool SVGFilter::implGenerateMetaData() (xPropSet->getPropertyValue( "TransitionType" ) >>= nTransitionType) ) { sal_Int16 nTransitionSubType(0); - if( xPropSet->getPropertyValue( B2UCONST( "TransitionSubtype" ) ) >>= nTransitionSubType ) + if( xPropSet->getPropertyValue( "TransitionSubtype" ) >>= nTransitionSubType ) { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrHasTransition, B2UCONST( "true" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrHasTransition, "true" ); } } @@ -1117,9 +1109,7 @@ sal_Bool SVGFilter::implGenerateMetaData() { for( sal_Int32 i = 0, nSize = aFieldSet.size(); i < nSize; ++i ) { - OUString sElemId = B2UCONST( aOOOElemTextField ); - sElemId += OUString::valueOf( sal_Unicode('_') ); - sElemId += OUString::valueOf( i ); + OUString sElemId = OUString(aOOOElemTextField) + "_" + OUString::number( i ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sElemId ); aFieldSet[i]->elementExport( mpSVGExport ); } @@ -1152,7 +1142,7 @@ sal_Bool SVGFilter::implExportAnimations() { sal_Bool bRet = sal_False; - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", B2UCONST( "presentation-animations" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", "presentation-animations" ); SvXMLElementExport aDefsContainerElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", sal_True, sal_True ); for( sal_Int32 i = 0; i < mSelectedPages.getLength(); ++i ) @@ -1162,7 +1152,7 @@ sal_Bool SVGFilter::implExportAnimations() if( xProps.is() && xProps->getPropertySetInfo()->hasPropertyByName( "TransitionType" ) ) { sal_Int16 nTransition = 0; - xProps->getPropertyValue( B2UCONST( "TransitionType" ) ) >>= nTransition; + xProps->getPropertyValue( "TransitionType" ) >>= nTransition; // we have a slide transition ? sal_Bool bHasEffects = ( nTransition != 0 ); @@ -1193,9 +1183,9 @@ sal_Bool SVGFilter::implExportAnimations() { OUString sId = implGetValidIDFromInterface( mSelectedPages[i] ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrSlide, sId ); - sId += B2UCONST( "-animations" ); + sId += "-animations"; mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sId ); - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "Animations" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "Animations" ); SvXMLElementExport aDefsElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", sal_True, sal_True ); UniReference< xmloff::AnimationsExporter > xAnimationsExporter; @@ -1216,7 +1206,7 @@ sal_Bool SVGFilter::implExportAnimations() void SVGFilter::implExportTextShapeIndex() { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "TextShapeIndex" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "TextShapeIndex" ); SvXMLElementExport aDefsContainerElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", sal_True, sal_True ); sal_Int32 nCount = mSelectedPages.getLength(); @@ -1243,26 +1233,26 @@ void SVGFilter::implExportTextShapeIndex() void SVGFilter::implEmbedBulletGlyphs() { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "EmbeddedBulletChars" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "EmbeddedBulletChars" ); SvXMLElementExport aDefsContainerElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", sal_True, sal_True ); - OUString sPathData = B2UCONST( "M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z" ); + OUString sPathData = "M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z"; implEmbedBulletGlyph( 57356, sPathData ); - sPathData = B2UCONST( "M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z" ); + sPathData = "M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z"; implEmbedBulletGlyph( 57354, sPathData ); - sPathData = B2UCONST( "M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z" ); + sPathData = "M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z"; implEmbedBulletGlyph( 10146, sPathData ); - sPathData = B2UCONST( "M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z" ); + sPathData = "M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z"; implEmbedBulletGlyph( 10132, sPathData ); - sPathData = B2UCONST( "M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z" ); + sPathData = "M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z"; implEmbedBulletGlyph( 10007, sPathData ); - sPathData = B2UCONST( "M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z" ); + sPathData = "M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z"; implEmbedBulletGlyph( 10004, sPathData ); - sPathData = B2UCONST( "M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z" ); + sPathData = "M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"; implEmbedBulletGlyph( 9679, sPathData ); - sPathData = B2UCONST( "M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z" ); + sPathData = "M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z"; implEmbedBulletGlyph( 8226, sPathData ); - sPathData = B2UCONST( "M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z" ); + sPathData = "M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z"; implEmbedBulletGlyph( 8211, sPathData ); } @@ -1270,16 +1260,12 @@ void SVGFilter::implEmbedBulletGlyphs() void SVGFilter::implEmbedBulletGlyph( sal_Unicode cBullet, const ::rtl::OUString & sPathData ) { - OUString sId = B2UCONST( "bullet-char-template(" ); - sId += OUString::valueOf( (sal_Int32)cBullet ); - sId += B2UCONST( ")" ); + OUString sId = "bullet-char-template(" + OUString::number( (sal_Int32)cBullet ) + ")"; mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sId ); double fFactor = 1.0 / 2048; OUString sFactor = OUString::valueOf( fFactor ); - OUString sTransform = B2UCONST( "scale(" ); - sTransform += sFactor; sTransform += B2UCONST( ",-" ); sTransform += sFactor; - sTransform += B2UCONST( ")" ); + OUString sTransform = "scale(" + sFactor + ",-" + sFactor + ")"; mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "transform", sTransform ); SvXMLElementExport aGElem( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True ); @@ -1297,7 +1283,7 @@ void SVGFilter::implEmbedBulletGlyph( sal_Unicode cBullet, const ::rtl::OUString */ sal_Bool SVGFilter::implExportTextEmbeddedBitmaps() { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "TextEmbeddedBitmaps" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "TextEmbeddedBitmaps" ); SvXMLElementExport aDefsContainerElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", sal_True, sal_True ); OUString sId; @@ -1314,15 +1300,13 @@ sal_Bool SVGFilter::implExportTextEmbeddedBitmaps() if( pAction ) { sal_uLong nId = GetBitmapChecksum( pAction ); - sId = B2UCONST( "bitmap(" ); - sId += OUString::valueOf( (sal_Int64)nId ); - sId += B2UCONST( ")" ); + sId = "bitmap(" + OUString::valueOf( (sal_Int64)nId ) + ")"; mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sId ); const Reference< XShape >& rxShape = (const Reference< XShape >&)( it->GetObject() ); Reference< XPropertySet > xShapePropSet( rxShape, UNO_QUERY ); ::com::sun::star::awt::Rectangle aBoundRect; - if( xShapePropSet.is() && ( xShapePropSet->getPropertyValue( B2UCONST( "BoundRect" ) ) >>= aBoundRect ) ) + if( xShapePropSet.is() && ( xShapePropSet->getPropertyValue( "BoundRect" ) >>= aBoundRect ) ) { // Origin of the coordinate device must be (0,0). const Point aTopLeft; @@ -1369,7 +1353,7 @@ sal_Bool SVGFilter::implExportTextEmbeddedBitmaps() sal_Bool SVGFilter::implGenerateScript() { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "type", B2UCONST( "text/ecmascript" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "type", "text/ecmascript" ); { SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "script", sal_True, sal_True ); @@ -1431,19 +1415,19 @@ sal_Bool SVGFilter::implGetPagePropSet( const Reference< XDrawPage > & rxPage ) Reference< XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() ); if( xPropSetInfo.is() ) { - implSafeGetPagePropSet( B2UCONST( "IsBackgroundVisible" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsBackgroundVisible; - implSafeGetPagePropSet( B2UCONST( "IsBackgroundObjectsVisible" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bAreBackgroundObjectsVisible; - implSafeGetPagePropSet( B2UCONST( "IsPageNumberVisible" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsPageNumberFieldVisible; - implSafeGetPagePropSet( B2UCONST( "IsHeaderVisible" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsHeaderFieldVisible; - implSafeGetPagePropSet( B2UCONST( "IsFooterVisible" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsFooterFieldVisible; - implSafeGetPagePropSet( B2UCONST( "IsDateTimeVisible" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsDateTimeFieldVisible; - - implSafeGetPagePropSet( B2UCONST( "IsDateTimeFixed" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsDateTimeFieldFixed; - implSafeGetPagePropSet( B2UCONST( "DateTimeFormat" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.nDateTimeFormat; - implSafeGetPagePropSet( B2UCONST( "Number" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.nPageNumber; - implSafeGetPagePropSet( B2UCONST( "DateTimeText" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.sDateTimeText; - implSafeGetPagePropSet( B2UCONST( "FooterText" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.sFooterText; - implSafeGetPagePropSet( B2UCONST( "HeaderText" ), xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.sHeaderText; + implSafeGetPagePropSet( "IsBackgroundVisible", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsBackgroundVisible; + implSafeGetPagePropSet( "IsBackgroundObjectsVisible", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bAreBackgroundObjectsVisible; + implSafeGetPagePropSet( "IsPageNumberVisible", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsPageNumberFieldVisible; + implSafeGetPagePropSet( "IsHeaderVisible", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsHeaderFieldVisible; + implSafeGetPagePropSet( "IsFooterVisible", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsFooterFieldVisible; + implSafeGetPagePropSet( "IsDateTimeVisible", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsDateTimeFieldVisible; + + implSafeGetPagePropSet( "IsDateTimeFixed", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsDateTimeFieldFixed; + implSafeGetPagePropSet( "DateTimeFormat", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.nDateTimeFormat; + implSafeGetPagePropSet( "Number", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.nPageNumber; + implSafeGetPagePropSet( "DateTimeText", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.sDateTimeText; + implSafeGetPagePropSet( "FooterText", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.sFooterText; + implSafeGetPagePropSet( "HeaderText", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.sHeaderText; if( mVisiblePagePropSet.bIsPageNumberFieldVisible ) { @@ -1474,7 +1458,7 @@ sal_Bool SVGFilter::implExportMasterPages( const SVGFilter::XDrawPageSequence & // When the exported slides are more than one we wrap master page elements // with a svg element. - OUString aContainerTag = (mbSinglePage) ? B2UCONST( "g" ) : B2UCONST( "defs" ); + OUString aContainerTag = (mbSinglePage) ? OUString( "g" ) : OUString( "defs" ); SvXMLElementExport aContainerElement( *mpSVGExport, XML_NAMESPACE_NONE, aContainerTag, sal_True, sal_True ); sal_Bool bRet = sal_False; @@ -1506,7 +1490,7 @@ sal_Bool SVGFilter::implExportDrawPages( const SVGFilter::XDrawPageSequence & rx "SVGFilter::implExportPages: nFirstPage > nLastPage" ); // We wrap all slide in a group element with class name "SlideGroup". - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "SlideGroup" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "SlideGroup" ); SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True ); sal_Bool bRet = sal_False; @@ -1522,7 +1506,7 @@ sal_Bool SVGFilter::implExportDrawPages( const SVGFilter::XDrawPageSequence & rx // visibility of each slide is set to 'hidden'. if( !mbSinglePage ) { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", B2UCONST( "hidden" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", "hidden" ); } SvXMLElementExport aGElement( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True ); @@ -1531,12 +1515,12 @@ sal_Bool SVGFilter::implExportDrawPages( const SVGFilter::XDrawPageSequence & rx const OUString & sPageId = implGetValidIDFromInterface( rxPages[i] ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sPageId ); - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "Slide" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "Slide" ); // Adding a clip path to each exported slide , so in case // bitmaps or other elements exceed the slide margins, they are // trimmed, even when they are shown inside a thumbnail view. - OUString sClipPathAttrValue = B2UCONST( "url(#" ) + msClipPathId + B2UCONST( ")" ); + OUString sClipPathAttrValue = "url(#" + msClipPathId + ")"; mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clip-path", sClipPathAttrValue ); SvXMLElementExport aSlideElement( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True ); @@ -1570,9 +1554,9 @@ sal_Bool SVGFilter::implExportPage( const ::rtl::OUString & sPageId, OUString aDesc; if( bMaster ) - aDesc = B2UCONST( "Master_Slide" ); + aDesc = "Master_Slide"; else - aDesc = B2UCONST( "Page" ); + aDesc = "Page"; mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", aDesc ); } @@ -1588,7 +1572,7 @@ sal_Bool SVGFilter::implExportPage( const ::rtl::OUString & sPageId, if( rMtf.GetActionSize() ) { // background id = "bg-" + page id - OUString sBackgroundId = B2UCONST( "bg-" ); + OUString sBackgroundId = "bg-"; sBackgroundId += sPageId; mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sBackgroundId ); @@ -1603,11 +1587,11 @@ sal_Bool SVGFilter::implExportPage( const ::rtl::OUString & sPageId, { if( !mVisiblePagePropSet.bIsBackgroundVisible ) { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", B2UCONST( "hidden" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", "hidden" ); } } - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "Background" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "Background" ); // insert the open tag related to the Background SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True ); @@ -1623,17 +1607,17 @@ sal_Bool SVGFilter::implExportPage( const ::rtl::OUString & sPageId, if( bMaster ) { // background objects id = "bo-" + page id - OUString sBackgroundObjectsId = B2UCONST( "bo-" ); + OUString sBackgroundObjectsId = "bo-"; sBackgroundObjectsId += sPageId; mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sBackgroundObjectsId ); if( mbSinglePage ) { if( !mVisiblePagePropSet.bAreBackgroundObjectsVisible ) { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", B2UCONST( "hidden" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", "hidden" ); } } - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "BackgroundObjects" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "BackgroundObjects" ); // insert the open tag related to the Background Objects SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True ); @@ -1684,18 +1668,18 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) if( mbPresentation ) { - xShapePropSet->getPropertyValue( B2UCONST( "IsEmptyPresentationObject" ) ) >>= bHideObj; + xShapePropSet->getPropertyValue( "IsEmptyPresentationObject" ) >>= bHideObj; } if( !bHideObj ) { - if( aShapeType.lastIndexOf( B2UCONST( "drawing.GroupShape" ) ) != -1 ) + if( aShapeType.lastIndexOf( "drawing.GroupShape" ) != -1 ) { Reference< XShapes > xShapes( rxShape, UNO_QUERY ); if( xShapes.is() ) { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "Group" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "Group" ); SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True ); bRet = implExportShapes( xShapes ); @@ -1709,7 +1693,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) ::com::sun::star::awt::Rectangle aBoundRect; const GDIMetaFile& rMtf = (*mpObjects)[ rxShape ].GetRepresentation(); - xShapePropSet->getPropertyValue( B2UCONST( "BoundRect" ) ) >>= aBoundRect; + xShapePropSet->getPropertyValue( "BoundRect" ) >>= aBoundRect; const Point aTopLeft( aBoundRect.X, aBoundRect.Y ); const Size aSize( aBoundRect.Width, aBoundRect.Height ); @@ -1731,22 +1715,22 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) // that we are dealing with a placeholder shape pElementId = &sPlaceholderTag; - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", B2UCONST( "hidden" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", "hidden" ); sal_uInt16 nTextAdjust = ParagraphAdjust_LEFT; OUString sTextAdjust; - xShapePropSet->getPropertyValue( B2UCONST( "ParaAdjust" ) ) >>= nTextAdjust; + xShapePropSet->getPropertyValue( "ParaAdjust" ) >>= nTextAdjust; switch( nTextAdjust ) { case ParagraphAdjust_LEFT: - sTextAdjust = B2UCONST( "left" ); + sTextAdjust = "left"; break; case ParagraphAdjust_CENTER: - sTextAdjust = B2UCONST( "center" ); + sTextAdjust = "center"; break; case ParagraphAdjust_RIGHT: - sTextAdjust = B2UCONST( "right" ); + sTextAdjust = "right"; break; default: break; @@ -1760,7 +1744,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) ( bIsDateTime && !mVisiblePagePropSet.bIsDateTimeFieldVisible ) || ( bIsFooter && !mVisiblePagePropSet.bIsFooterFieldVisible ) ) ) { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", B2UCONST( "hidden" ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", "hidden" ); } } } @@ -1771,7 +1755,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) Reference< XExtendedDocumentHandler > xExtDocHandler( mpSVGExport->GetDocHandler(), UNO_QUERY ); OUString aTitle; - xShapePropSet->getPropertyValue( B2UCONST( "Title" ) ) >>= aTitle; + xShapePropSet->getPropertyValue( "Title" ) >>= aTitle; if( !aTitle.isEmpty() ) { SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "title", sal_True, sal_True ); @@ -1779,7 +1763,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) } OUString aDescription; - xShapePropSet->getPropertyValue( B2UCONST( "Description" ) ) >>= aDescription; + xShapePropSet->getPropertyValue( "Description" ) >>= aDescription; if( !aDescription.isEmpty() ) { SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "desc", sal_True, sal_True ); @@ -1857,11 +1841,11 @@ sal_Bool SVGFilter::implCreateObjects() // this is really too expensive! Reference< XPropertySet > xPropSet( xDrawPage, UNO_QUERY ); Reference< XPropertySet > xBackground; - xPropSet->getPropertyValue( B2UCONST( "Background" ) ) >>= xBackground; + xPropSet->getPropertyValue( "Background" ) >>= xBackground; if( xBackground.is() ) { drawing::FillStyle aFillStyle; - sal_Bool assigned = ( xBackground->getPropertyValue( B2UCONST( "FillStyle" ) ) >>= aFillStyle ); + sal_Bool assigned = ( xBackground->getPropertyValue( "FillStyle" ) >>= aFillStyle ); if( assigned && aFillStyle != drawing::FillStyle_NONE ) { implCreateObjectsFromBackground( xDrawPage ); @@ -1900,7 +1884,7 @@ sal_Bool SVGFilter::implCreateObjectsFromShapes( const Reference< XDrawPage > & sal_Bool SVGFilter::implCreateObjectsFromShape( const Reference< XDrawPage > & rxPage, const Reference< XShape >& rxShape ) { sal_Bool bRet = sal_False; - if( rxShape->getShapeType().lastIndexOf( B2UCONST( "drawing.GroupShape" ) ) != -1 ) + if( rxShape->getShapeType().lastIndexOf( "drawing.GroupShape" ) != -1 ) { Reference< XShapes > xShapes( rxShape, UNO_QUERY ); @@ -1946,7 +1930,7 @@ sal_Bool SVGFilter::implCreateObjectsFromShape( const Reference< XDrawPage > & r if( mbPresentation ) { - xShapePropSet->getPropertyValue( B2UCONST( "IsEmptyPresentationObject" ) ) >>= bHideObj; + xShapePropSet->getPropertyValue( "IsEmptyPresentationObject" ) >>= bHideObj; } if( !bHideObj ) @@ -1958,7 +1942,7 @@ sal_Bool SVGFilter::implCreateObjectsFromShape( const Reference< XDrawPage > & r if( !rShapeId.isEmpty() ) { mTextShapeIdListMap[rxPage] += rShapeId; - mTextShapeIdListMap[rxPage] += B2UCONST( " " ); + mTextShapeIdListMap[rxPage] += " "; } // We create a set of bitmaps embedded into text shape. @@ -2018,7 +2002,7 @@ sal_Bool SVGFilter::implCreateObjectsFromShape( const Reference< XDrawPage > & r sal_Bool SVGFilter::implCreateObjectsFromBackground( const Reference< XDrawPage >& rxDrawPage ) { - Reference< XExporter > xExporter( mxContext->getServiceManager()->createInstanceWithContext( B2UCONST( "com.sun.star.drawing.GraphicExportFilter" ), mxContext ), UNO_QUERY ); + Reference< XExporter > xExporter( mxContext->getServiceManager()->createInstanceWithContext( "com.sun.star.drawing.GraphicExportFilter", mxContext ), UNO_QUERY ); sal_Bool bRet = sal_False; if( xExporter.is() ) @@ -2030,11 +2014,11 @@ sal_Bool SVGFilter::implCreateObjectsFromBackground( const Reference< XDrawPage aFile.EnableKillingFile(); Sequence< PropertyValue > aDescriptor( 3 ); - aDescriptor[0].Name = B2UCONST( "FilterName" ); - aDescriptor[0].Value <<= B2UCONST( "SVM" ); - aDescriptor[1].Name = B2UCONST( "URL" ); + aDescriptor[0].Name = "FilterName"; + aDescriptor[0].Value <<= OUString( "SVM" ); + aDescriptor[1].Name = "URL"; aDescriptor[1].Value <<= OUString( aFile.GetURL() ); - aDescriptor[2].Name = B2UCONST( "ExportOnlyBackground" ); + aDescriptor[2].Name = "ExportOnlyBackground"; aDescriptor[2].Value <<= (sal_Bool) sal_True; xExporter->setSourceDocument( Reference< XComponent >( rxDrawPage, UNO_QUERY ) ); @@ -2056,23 +2040,22 @@ OUString SVGFilter::implGetClassFromShape( const Reference< XShape >& rxShape ) OUString aRet; const OUString aShapeType( rxShape->getShapeType() ); - if( aShapeType.lastIndexOf( B2UCONST( "drawing.GroupShape" ) ) != -1 ) - aRet = B2UCONST( "Group" ); - else if( aShapeType.lastIndexOf( B2UCONST( "drawing.GraphicObjectShape" ) ) != -1 ) - aRet = B2UCONST( "Graphic" ); - else if( aShapeType.lastIndexOf( B2UCONST( "drawing.OLE2Shape" ) ) != -1 ) - aRet = B2UCONST( "OLE2" ); - else if( aShapeType.lastIndexOf( B2UCONST( "presentation.HeaderShape" ) ) != -1 ) - aRet = B2UCONST( "Header" ); - else if( aShapeType.lastIndexOf( B2UCONST( "presentation.FooterShape" ) ) != -1 ) - aRet = B2UCONST( "Footer" ); - else if( aShapeType.lastIndexOf( B2UCONST( "presentation.DateTimeShape" ) ) != -1 ) - aRet = B2UCONST( "Date/Time" ); - else if( aShapeType.lastIndexOf( B2UCONST( "presentation.SlideNumberShape" ) ) != -1 ) - aRet = B2UCONST( "Slide_Number" ); + if( aShapeType.lastIndexOf( "drawing.GroupShape" ) != -1 ) + aRet = "Group"; + else if( aShapeType.lastIndexOf( "drawing.GraphicObjectShape" ) != -1 ) + aRet = "Graphic"; + else if( aShapeType.lastIndexOf( "drawing.OLE2Shape" ) != -1 ) + aRet = "OLE2"; + else if( aShapeType.lastIndexOf( "presentation.HeaderShape" ) != -1 ) + aRet = "Header"; + else if( aShapeType.lastIndexOf( "presentation.FooterShape" ) != -1 ) + aRet = "Footer"; + else if( aShapeType.lastIndexOf( "presentation.DateTimeShape" ) != -1 ) + aRet = "Date/Time"; + else if( aShapeType.lastIndexOf( "presentation.SlideNumberShape" ) != -1 ) + aRet = "Slide_Number"; else aRet = aShapeType; - //aRet = B2UCONST( "Drawing" ); return aRet; } @@ -2113,7 +2096,7 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo ) if( pInfo && mbPresentation ) { bFieldProcessed = true; - OUString aRepresentation = B2UCONST(""); + OUString aRepresentation; if( !mbSinglePage ) { if( mpSVGExport->IsEmbedFonts() && mpSVGExport->IsUsePositionedCharacters() ) @@ -2129,10 +2112,10 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo ) } sal_Bool bHasCharSetMap = !( mTextFieldCharSets.find( mCreateOjectsCurrentMasterPage ) == mTextFieldCharSets.end() ); - static const ::rtl::OUString aHeaderId( B2UCONST( aOOOAttrHeaderField ) ); - static const ::rtl::OUString aFooterId( B2UCONST( aOOOAttrFooterField ) ); - static const ::rtl::OUString aDateTimeId( B2UCONST( aOOOAttrDateTimeField ) ); - static const ::rtl::OUString aVariableDateTimeId( B2UCONST( aOOOAttrDateTimeField ) + B2UCONST( "-variable" ) ); + static const OUString aHeaderId( aOOOAttrHeaderField ); + static const OUString aFooterId( aOOOAttrFooterField ); + static const OUString aDateTimeId( aOOOAttrDateTimeField ); + static const OUString aVariableDateTimeId( aOOOAttrDateTimeField + "-variable" ); const UCharSet * pCharSet = NULL; UCharSetMap * pCharSetMap = NULL; @@ -2200,7 +2183,7 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo ) } // Independently of the date format, we always put all these characters by default. // They should be enough to cover every time format. - aRepresentation += B2UCONST( "0123456789.:/-APM" ); + aRepresentation += "0123456789.:/-APM"; if( eDateFormat ) { @@ -2246,22 +2229,22 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo ) switch( mVisiblePagePropSet.nPageNumberingType ) { case SVX_CHARS_UPPER_LETTER: - aRepresentation += B2UCONST( "QWERTYUIOPASDFGHJKLZXCVBNM" ); + aRepresentation += "QWERTYUIOPASDFGHJKLZXCVBNM"; break; case SVX_CHARS_LOWER_LETTER: - aRepresentation += B2UCONST( "qwertyuiopasdfghjklzxcvbnm" ); + aRepresentation += "qwertyuiopasdfghjklzxcvbnm"; break; case SVX_ROMAN_UPPER: - aRepresentation += B2UCONST( "IVXLCDM" ); + aRepresentation += "IVXLCDM"; break; case SVX_ROMAN_LOWER: - aRepresentation += B2UCONST( "ivxlcdm" ); + aRepresentation += "ivxlcdm"; break; // arabic numbering type is the default case SVX_ARABIC: ; // in case the numbering type is not handled we fall back on arabic numbering default: - aRepresentation += B2UCONST( "0123456789" ); + aRepresentation += "0123456789"; break; } } diff --git a/filter/source/svg/svgfontexport.cxx b/filter/source/svg/svgfontexport.cxx index d9e6272db7ad..46b038f2d191 100644 --- a/filter/source/svg/svgfontexport.cxx +++ b/filter/source/svg/svgfontexport.cxx @@ -182,7 +182,7 @@ void SVGFontExport::implEmbedFont( const Font& rFont ) if( !rGlyphSet.empty() ) { GlyphSet::const_iterator aIter( rGlyphSet.begin() ); - const ::rtl::OUString aEmbeddedFontStr( B2UCONST( "EmbeddedFont_" ) ); + const OUString aEmbeddedFontStr( "EmbeddedFont_" ); { SvXMLElementExport aExp( mrExport, XML_NAMESPACE_NONE, "defs", sal_True, sal_True ); @@ -208,15 +208,15 @@ void SVGFontExport::implEmbedFont( const Font& rFont ) // Font Weight if( aFont.GetWeight() != WEIGHT_NORMAL ) - aFontWeight = B2UCONST( "bold" ); + aFontWeight = "bold"; else - aFontWeight = B2UCONST( "normal" ); + aFontWeight = "normal"; // Font Italic if( aFont.GetItalic() != ITALIC_NONE ) - aFontStyle = B2UCONST( "italic" ); + aFontStyle = "italic"; else - aFontStyle = B2UCONST( "normal" ); + aFontStyle = "normal"; mrExport.AddAttribute( XML_NAMESPACE_NONE, "font-family", GetMappedFontName( rFont.GetName() ) ); mrExport.AddAttribute( XML_NAMESPACE_NONE, "units-per-em", aUnitsPerEM ); @@ -334,7 +334,7 @@ void SVGFontExport::EmbedFonts() ::rtl::OUString aRet( rFontName.getToken( 0, ';', nNextTokenPos ) ); if( mnCurFontId ) - aRet += B2UCONST( " embedded" ); + aRet += " embedded"; return aRet; } diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 332ff7ef58d2..36fc03f42a46 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -135,7 +135,7 @@ double SVGAttributeWriter::ImplRound( double fValue, sal_Int32 nDecs ) void SVGAttributeWriter::ImplGetColorStr( const Color& rColor, ::rtl::OUString& rColorStr ) { if( rColor.GetTransparency() == 255 ) - rColorStr = B2UCONST( "none" ); + rColorStr = "none"; else { ::rtl::OUStringBuffer aStyle; @@ -183,8 +183,8 @@ void SVGAttributeWriter::AddPaintAttr( const Color& rLineColor, const Color& rFi if( !aGradientId.isEmpty() ) { - ::rtl::OUString aGradientURL( B2UCONST( "url(#" ) ); - mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrFill, ( aGradientURL += aGradientId ) += B2UCONST( ")" ) ); + OUString aGradientURL = "url(#" + aGradientId + ")"; + mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrFill, aGradientURL ); } } else @@ -222,7 +222,7 @@ void SVGAttributeWriter::AddGradientDef( const Rectangle& rObjRect, const Gradie aEndColor.SetBlue( (sal_uInt8)( (long) aEndColor.GetBlue() * rGradient.GetEndIntensity() ) / 100 ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrId, - ( rGradientId = B2UCONST( "Gradient_" ) ) += ::rtl::OUString::valueOf( nCurGradientId++ ) ); + ( rGradientId = "Gradient_" ) += OUString::valueOf( nCurGradientId++ ) ); { ::std::auto_ptr< SvXMLElementExport > apGradient; @@ -237,7 +237,7 @@ void SVGAttributeWriter::AddGradientDef( const Rectangle& rObjRect, const Gradie aLinePoly.Rotate( aObjRectCenter, nAngle ); - mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrGradientUnits, B2UCONST( "userSpaceOnUse" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrGradientUnits, "userSpaceOnUse" ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX1, ::rtl::OUString::valueOf( aLinePoly[ 0 ].X() ) ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrY1, ::rtl::OUString::valueOf( aLinePoly[ 0 ].Y() ) ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX2, ::rtl::OUString::valueOf( aLinePoly[ 1 ].X() ) ); @@ -286,7 +286,7 @@ void SVGAttributeWriter::AddGradientDef( const Rectangle& rObjRect, const Gradie const double fRadius = sqrt( static_cast< double >( rObjRect.GetWidth() ) * rObjRect.GetWidth() + rObjRect.GetHeight() * rObjRect.GetHeight() ) * 0.5; - mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrGradientUnits, B2UCONST( "userSpaceOnUse" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrGradientUnits, "userSpaceOnUse" ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrCX, ::rtl::OUString::valueOf( ImplRound( fCenterX ) ) ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrCY, ::rtl::OUString::valueOf( ImplRound( fCenterY ) ) ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrR, ::rtl::OUString::valueOf( ImplRound( fRadius ) ) ); @@ -333,18 +333,18 @@ void SVGAttributeWriter::SetFontAttr( const Font& rFont ) // Font Size mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrFontSize, - ::rtl::OUString::valueOf( rFont.GetHeight() ) + B2UCONST( "px" ) ); + OUString::valueOf( rFont.GetHeight() ) + "px" ); // Font Style if( rFont.GetItalic() != ITALIC_NONE ) { if( rFont.GetItalic() == ITALIC_OBLIQUE ) - aFontStyle = B2UCONST( "oblique" ); + aFontStyle = "oblique"; else - aFontStyle = B2UCONST( "italic" ); + aFontStyle = "italic"; } else - aFontStyle = B2UCONST( "normal" ); + aFontStyle = "normal"; mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrFontStyle, aFontStyle ); @@ -371,13 +371,13 @@ void SVGAttributeWriter::SetFontAttr( const Font& rFont ) if( rFont.GetUnderline() != UNDERLINE_NONE || rFont.GetStrikeout() != STRIKEOUT_NONE ) { if( rFont.GetUnderline() != UNDERLINE_NONE ) - aTextDecoration = B2UCONST( "underline " ); + aTextDecoration = "underline "; if( rFont.GetStrikeout() != STRIKEOUT_NONE ) - aTextDecoration += B2UCONST( "line-through " ); + aTextDecoration += "line-through "; } else - aTextDecoration = B2UCONST( "none" ); + aTextDecoration = "none"; mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrTextDecoration, aTextDecoration ); } @@ -422,15 +422,15 @@ void SVGAttributeWriter::setFontFamily() FontPitch ePitch = maCurFont.GetPitch(); if( ePitch == PITCH_FIXED ) { - sFontFamily += B2UCONST( ", monospace" ); + sFontFamily += ", monospace"; } else { FontFamily eFamily = maCurFont.GetFamily(); if( eFamily == FAMILY_ROMAN ) - sFontFamily += B2UCONST( ", serif" ); + sFontFamily += ", serif"; else if( eFamily == FAMILY_SWISS ) - sFontFamily += B2UCONST( ", sans-serif" ); + sFontFamily += ", sans-serif"; } mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrFontFamily, sFontFamily ); } @@ -808,7 +808,7 @@ void SVGTextWriter::addFontAttributes( sal_Bool bIsTextContainer ) if( nCurFontSize != nParFontSize ) { mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrFontSize, - ::rtl::OUString::valueOf( nCurFontSize ) + B2UCONST( "px" ) ); + OUString::valueOf( nCurFontSize ) + "px" ); } // Font Style @@ -818,13 +818,13 @@ void SVGTextWriter::addFontAttributes( sal_Bool bIsTextContainer ) if( eCurFontItalic != ITALIC_NONE ) { if( eCurFontItalic == ITALIC_OBLIQUE ) - sFontStyle = B2UCONST( "oblique" ); + sFontStyle = "oblique"; else - sFontStyle = B2UCONST( "italic" ); + sFontStyle = "italic"; } else { - sFontStyle = B2UCONST( "normal" ); + sFontStyle = "normal"; } mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrFontStyle, sFontStyle ); } @@ -867,12 +867,12 @@ void SVGTextWriter::addFontAttributes( sal_Bool bIsTextContainer ) if( eCurFontUnderline != eParFontUnderline ) { if( eCurFontUnderline != UNDERLINE_NONE ) - sTextDecoration = B2UCONST( "underline " ); + sTextDecoration = "underline "; } if( eCurFontStrikeout != eParFontStrikeout ) { if( eCurFontStrikeout != STRIKEOUT_NONE ) - sTextDecoration += B2UCONST( "line-through " ); + sTextDecoration += "line-through "; } if( !sTextDecoration.isEmpty() ) mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrTextDecoration, sTextDecoration ); @@ -889,15 +889,15 @@ void SVGTextWriter::implSetFontFamily() FontPitch ePitch = maCurrentFont.GetPitch(); if( ePitch == PITCH_FIXED ) { - sFontFamily += B2UCONST( ", monospace" ); + sFontFamily += ", monospace"; } else { FontFamily eFamily = maCurrentFont.GetFamily(); if( eFamily == FAMILY_ROMAN ) - sFontFamily += B2UCONST( ", serif" ); + sFontFamily += ", serif"; else if( eFamily == FAMILY_SWISS ) - sFontFamily += B2UCONST( ", sans-serif" ); + sFontFamily += ", sans-serif"; } mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrFontFamily, sFontFamily ); } @@ -949,25 +949,24 @@ sal_Bool SVGTextWriter::nextParagraph() if( xServiceInfo.is() ) { OUString sInfo; - if( xServiceInfo->supportsService( B2UCONST( "com.sun.star.text.Paragraph" ) ) ) + if( xServiceInfo->supportsService( "com.sun.star.text.Paragraph" ) ) { mrCurrentTextParagraph.set( xTextContent ); Reference< XPropertySet > xPropSet( xTextContent, UNO_QUERY_THROW ); Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); - if( xPropSetInfo->hasPropertyByName( B2UCONST( "NumberingLevel" ) ) ) + if( xPropSetInfo->hasPropertyByName( "NumberingLevel" ) ) { sal_Int16 nListLevel = 0; - if( xPropSet->getPropertyValue( B2UCONST( "NumberingLevel" ) ) >>= nListLevel ) + if( xPropSet->getPropertyValue( "NumberingLevel" ) >>= nListLevel ) { mbIsNewListItem = sal_True; - sInfo = B2UCONST( "NumberingLevel: " ); - sInfo += OUString::valueOf( (sal_Int32)nListLevel ); + sInfo = "NumberingLevel: " + OUString::valueOf( (sal_Int32)nListLevel ); mrExport.AddAttribute( XML_NAMESPACE_NONE, "style", sInfo ); Reference< XIndexReplace > xNumRules; - if( xPropSetInfo->hasPropertyByName( B2UCONST( "NumberingRules" ) ) ) + if( xPropSetInfo->hasPropertyByName( "NumberingRules" ) ) { - xPropSet->getPropertyValue( B2UCONST( "NumberingRules" ) ) >>= xNumRules; + xPropSet->getPropertyValue( "NumberingRules" ) >>= xNumRules; } if( xNumRules.is() && ( nListLevel < xNumRules->getCount() ) ) { @@ -982,7 +981,7 @@ sal_Bool SVGTextWriter::nextParagraph() } if( bIsNumbered ) { - sInfo = B2UCONST( "true" ); + sInfo = "true"; mrExport.AddAttribute( XML_NAMESPACE_NONE, "is-numbered", sInfo ); } } @@ -1043,12 +1042,12 @@ sal_Bool SVGTextWriter::nextParagraph() { mrTextPortionEnumeration.set( xEnumeration ); } - sInfo = B2UCONST( "Paragraph" ); + sInfo = "Paragraph"; } - else if( xServiceInfo->supportsService( B2UCONST( "com.sun.star.text.Table" ) ) ) + else if( xServiceInfo->supportsService( "com.sun.star.text.Table" ) ) { OSL_FAIL( "SVGTextWriter::nextParagraph: text tables are not handled." ); - sInfo = B2UCONST( "Table" ); + sInfo = "Table"; } else { @@ -1082,22 +1081,22 @@ sal_Bool SVGTextWriter::nextParagraph() Reference< XServiceInfo > xServiceInfo( xTextContent, UNO_QUERY_THROW ); if( xServiceInfo.is() ) { - if( xServiceInfo->supportsService( B2UCONST( "com.sun.star.text.Paragraph" ) ) ) + if( xServiceInfo->supportsService( "com.sun.star.text.Paragraph" ) ) { mrCurrentTextParagraph.set( xTextContent ); Reference< XPropertySet > xPropSet( xTextContent, UNO_QUERY_THROW ); Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); - if( xPropSetInfo->hasPropertyByName( B2UCONST( "NumberingLevel" ) ) ) + if( xPropSetInfo->hasPropertyByName( "NumberingLevel" ) ) { sal_Int16 nListLevel = 0; - if( xPropSet->getPropertyValue( B2UCONST( "NumberingLevel" ) ) >>= nListLevel ) + if( xPropSet->getPropertyValue( "NumberingLevel" ) >>= nListLevel ) { mbIsNewListItem = sal_True; Reference< XIndexReplace > xNumRules; - if( xPropSetInfo->hasPropertyByName( B2UCONST( "NumberingRules" ) ) ) + if( xPropSetInfo->hasPropertyByName( "NumberingRules" ) ) { - xPropSet->getPropertyValue( B2UCONST( "NumberingRules" ) ) >>= xNumRules; + xPropSet->getPropertyValue( "NumberingRules" ) >>= xNumRules; } if( xNumRules.is() && ( nListLevel < xNumRules->getCount() ) ) { @@ -1167,7 +1166,7 @@ sal_Bool SVGTextWriter::nextParagraph() mrTextPortionEnumeration.set( xEnumeration ); } } - else if( xServiceInfo->supportsService( B2UCONST( "com.sun.star.text.Table" ) ) ) + else if( xServiceInfo->supportsService( "com.sun.star.text.Table" ) ) { OSL_FAIL( "SVGTextWriter::nextParagraph: text tables are not handled." ); } @@ -1211,27 +1210,23 @@ sal_Bool SVGTextWriter::nextTextPortion() Reference< XPropertySetInfo > xPortionPropInfo( xPortionPropSet->getPropertySetInfo() ); Reference < XTextRange > xPortionTextRange( xPortionPropSet, UNO_QUERY); if( xPortionPropSet.is() && xPortionPropInfo.is() - && xPortionPropInfo->hasPropertyByName( B2UCONST( "TextPortionType" ) ) ) + && xPortionPropInfo->hasPropertyByName( "TextPortionType" ) ) { ::rtl::OUString sPortionType; - if( xPortionPropSet->getPropertyValue( B2UCONST( "TextPortionType" ) ) >>= sPortionType ) + if( xPortionPropSet->getPropertyValue( "TextPortionType" ) >>= sPortionType ) { - sInfo = B2UCONST( "type: " ); - sInfo += sPortionType; - sInfo += B2UCONST( "; " ); + sInfo = "type: " + sPortionType + "; "; } if( xPortionTextRange.is() ) { - sInfo += B2UCONST( "content: " ); - sInfo += xPortionTextRange->getString(); - sInfo += B2UCONST( "; " ); + sInfo += "content: " + xPortionTextRange->getString() + "; "; mrCurrentTextPortion.set( xPortionTextRange ); Reference < XPropertySet > xRangePropSet( xPortionTextRange, UNO_QUERY ); - if( xRangePropSet.is() && xRangePropSet->getPropertySetInfo()->hasPropertyByName( B2UCONST( "TextField" ) ) ) + if( xRangePropSet.is() && xRangePropSet->getPropertySetInfo()->hasPropertyByName( "TextField" ) ) { - Reference < XTextField > xTextField( xRangePropSet->getPropertyValue( B2UCONST( "TextField" ) ), UNO_QUERY ); + Reference < XTextField > xTextField( xRangePropSet->getPropertyValue( "TextField" ), UNO_QUERY ); if( xTextField.is() ) { const ::rtl::OUString sServicePrefix( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.textfield.") ); @@ -1264,13 +1259,8 @@ sal_Bool SVGTextWriter::nextTextPortion() ++pNames; } - sInfo += B2UCONST( "text field type: " ); - sInfo += sFieldName; - sInfo += B2UCONST( "; " ); - - sInfo += B2UCONST( "content: " ); - sInfo += xTextField->getPresentation( /* show command: */ sal_False ); - sInfo += B2UCONST( "; " ); + sInfo += "text field type: " + sFieldName + "; " + + "content: " + xTextField->getPresentation( /* show command: */ sal_False ) + "; "; if( sFieldName.equalsAscii( "DateTime" ) || sFieldName.equalsAscii( "Header" ) || sFieldName.equalsAscii( "Footer" ) || sFieldName.equalsAscii( "PageNumber" ) ) @@ -1289,7 +1279,7 @@ sal_Bool SVGTextWriter::nextTextPortion() OUString sURL; if( ( xTextFieldPropSet->getPropertyValue( sFieldName ) ) >>= sURL ) { - sInfo += B2UCONST( "url: " ); + sInfo += "url: "; sInfo += mrExport.GetRelativeReference( sURL ); msUrl = mrExport.GetRelativeReference( sURL ); @@ -1302,7 +1292,7 @@ sal_Bool SVGTextWriter::nextTextPortion() if( !rTextPortionId.isEmpty() ) { msHyperlinkIdList += rTextPortionId; - msHyperlinkIdList += B2UCONST( " " ); + msHyperlinkIdList += " "; } } } @@ -1312,7 +1302,7 @@ sal_Bool SVGTextWriter::nextTextPortion() } } } - mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "TextPortion" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "TextPortion" ); SvXMLElementExport aPortionElem( mrExport, XML_NAMESPACE_NONE, "desc", mbIWS, mbIWS ); mrExport.GetDocHandler()->characters( sInfo ); return sal_True; @@ -1326,16 +1316,16 @@ sal_Bool SVGTextWriter::nextTextPortion() Reference< XPropertySetInfo > xPortionPropInfo( xPortionPropSet->getPropertySetInfo() ); Reference < XTextRange > xPortionTextRange( xPortionPropSet, UNO_QUERY); if( xPortionPropSet.is() && xPortionPropInfo.is() - && xPortionPropInfo->hasPropertyByName( B2UCONST( "TextPortionType" ) ) ) + && xPortionPropInfo->hasPropertyByName( "TextPortionType" ) ) { if( xPortionTextRange.is() ) { mrCurrentTextPortion.set( xPortionTextRange ); Reference < XPropertySet > xRangePropSet( xPortionTextRange, UNO_QUERY ); - if( xRangePropSet.is() && xRangePropSet->getPropertySetInfo()->hasPropertyByName( B2UCONST( "TextField" ) ) ) + if( xRangePropSet.is() && xRangePropSet->getPropertySetInfo()->hasPropertyByName( "TextField" ) ) { - Reference < XTextField > xTextField( xRangePropSet->getPropertyValue( B2UCONST( "TextField" ) ), UNO_QUERY ); + Reference < XTextField > xTextField( xRangePropSet->getPropertyValue( "TextField" ), UNO_QUERY ); if( xTextField.is() ) { const ::rtl::OUString sServicePrefix( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.textfield.") ); @@ -1394,7 +1384,7 @@ sal_Bool SVGTextWriter::nextTextPortion() if( !rTextPortionId.isEmpty() ) { msHyperlinkIdList += rTextPortionId; - msHyperlinkIdList += B2UCONST( " " ); + msHyperlinkIdList += " "; } } } @@ -1423,7 +1413,7 @@ void SVGTextWriter::startTextShape() { mbIsTextShapeStarted = sal_True; maParentFont = Font(); - mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "TextShape" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "TextShape" ); mpTextShapeElem = new SvXMLElementExport( mrExport, XML_NAMESPACE_NONE, aXMLElemText, sal_True, mbIWS ); startTextParagraph(); } @@ -1465,21 +1455,21 @@ void SVGTextWriter::startTextParagraph() switch( meNumberingType ) { case( NumberingType::CHAR_SPECIAL ): - sNumberingType = B2UCONST( "bullet-style" ); + sNumberingType = "bullet-style"; break; case( NumberingType::BITMAP ): - sNumberingType = B2UCONST( "image-style" ); + sNumberingType = "image-style"; break; default: - sNumberingType = B2UCONST( "number-style" ); + sNumberingType = "number-style"; break; } mrExport.AddAttribute( XML_NAMESPACE_NONE, aOOOAttrNumberingType, sNumberingType ); - mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "ListItem" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "ListItem" ); } else { - mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "TextParagraph" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "TextParagraph" ); } maParentFont = Font(); addFontAttributes( /* isTexTContainer: */ true ); @@ -1514,7 +1504,7 @@ void SVGTextWriter::startTextPosition( sal_Bool bExportX, sal_Bool bExportY ) { endTextPosition(); mnTextWidth = 0; - mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "TextPosition" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "TextPosition" ); if( bExportX ) mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX, ::rtl::OUString::valueOf( maTextPos.X() ) ); if( bExportY ) @@ -1525,17 +1515,12 @@ void SVGTextWriter::startTextPosition( sal_Bool bExportX, sal_Bool bExportY ) if( rFont.GetOrientation() ) { Point aRot( maTextPos ); - OUString aTransform( "translate(" ); - aTransform += OUString::valueOf( aRot.X() ) + ","; - aTransform += OUString::valueOf( aRot.Y() ) + ")"; - - aTransform += " rotate("; - aTransform += OUString::valueOf( rFont.GetOrientation() * -0.1 ); - aTransform += ")"; - - aTransform += " translate("; - aTransform += OUString::valueOf( -aRot.X() ) + ","; - aTransform += OUString::valueOf( -aRot.Y() ) + ")"; + OUString aTransform = + OUString("translate(") + OUString::valueOf( aRot.X() ) + + "," + OUString::valueOf( aRot.Y() ) + ")" + + " rotate(" + OUString::valueOf( rFont.GetOrientation() * -0.1 ) + + ")" + " translate(" + OUString::valueOf( -aRot.X() ) + + "," + OUString::valueOf( -aRot.Y() ) + ")"; mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrTransform, aTransform ); } @@ -1560,7 +1545,7 @@ void SVGTextWriter::implExportHyperlinkIds() { if( !msHyperlinkIdList.isEmpty() ) { - mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "HyperlinkIdList" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "HyperlinkIdList" ); SvXMLElementExport aDescElem( mrExport, XML_NAMESPACE_NONE, "desc", sal_True, sal_False ); mrExport.GetDocHandler()->characters( msHyperlinkIdList.trim() ); msHyperlinkIdList = OUString(); @@ -1574,7 +1559,7 @@ void SVGTextWriter::implWriteBulletChars() if( maBulletListItemMap.empty() ) return; - mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "BulletChars" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "BulletChars" ); SvXMLElementExport aGroupElem( mrExport, XML_NAMESPACE_NONE, aXMLElemG, sal_True, sal_True ); BulletListItemInfoMap::const_iterator it = maBulletListItemMap.begin(); @@ -1586,11 +1571,9 @@ void SVGTextWriter::implWriteBulletChars() { // As id we use the id of the text portion placeholder wrapped // by bullet-char(*) - sId = B2UCONST( "bullet-char(" ); - sId += it->first; - sId += B2UCONST( ")" ); + sId = "bullet-char(" + it->first+ ")"; mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", sId ); - mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "BulletChar" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "BulletChar" ); SvXMLElementExport aBulletCharElem( mrExport, XML_NAMESPACE_NONE, aXMLElemG, sal_True, sal_True ); // @@ -1598,11 +1581,9 @@ void SVGTextWriter::implWriteBulletChars() const BulletListItemInfo& rInfo = it->second; // Add positioning attribute through a translation - sPosition = B2UCONST( "translate(" ); - sPosition += OUString::valueOf( rInfo.aPos.X() ); - sPosition += B2UCONST( "," ); - sPosition += OUString::valueOf( rInfo.aPos.Y() ); - sPosition += B2UCONST( ")" ); + sPosition = OUString("translate(") + + OUString::valueOf( rInfo.aPos.X() ) + + "," + OUString::valueOf( rInfo.aPos.Y() ) + ")"; mrExport.AddAttribute( XML_NAMESPACE_NONE, "transform", sPosition ); mpContext->AddPaintAttr( COL_TRANSPARENT, rInfo.aColor ); @@ -1612,17 +1593,14 @@ void SVGTextWriter::implWriteBulletChars() // { // Add size attribute through a scaling - sScaling = B2UCONST( "scale(" ); - sScaling += OUString::valueOf( rInfo.nFontSize ); - sScaling += B2UCONST( "," ); - sScaling += OUString::valueOf( rInfo.nFontSize ); - sScaling += B2UCONST( ")" ); + sScaling = "scale(" + OUString::valueOf( rInfo.nFontSize ) + + "," + OUString::valueOf( rInfo.nFontSize )+ ")"; mrExport.AddAttribute( XML_NAMESPACE_NONE, "transform", sScaling ); // Add ref attribute - sRefId = B2UCONST( "#bullet-char-template(" ); - sRefId += OUString::valueOf( (sal_Int32)( rInfo.cBulletChar ) ); - sRefId += B2UCONST( ")" ); + sRefId = "#bullet-char-template(" + + OUString::valueOf( (sal_Int32)( rInfo.cBulletChar ) ) + + ")"; mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrXLinkHRef, sRefId ); SvXMLElementExport aRefElem( mrExport, XML_NAMESPACE_NONE, "use", sal_True, sal_True ); @@ -1654,15 +1632,12 @@ void SVGTextWriter::writeBitmapPlaceholder( const MetaBitmapActionType* pAction // bitmap placeholder element sal_uLong nId = SVGActionWriter::GetChecksum( pAction ); - OUString sId = B2UCONST( "bitmap-placeholder(" ); - sId += msShapeId; - sId += B2UCONST( "." ); - sId += OUString::valueOf( (sal_Int64)nId ); - sId += B2UCONST( ")" ); + OUString sId = "bitmap-placeholder(" + msShapeId + "." + + OUString::valueOf( (sal_Int64)nId ) + ")"; { mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", sId ); - mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "BitmapPlaceholder" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "BitmapPlaceholder" ); SvXMLElementExport aSVGTspanElem( mrExport, XML_NAMESPACE_NONE, aXMLElemTspan, mbIWS, mbIWS ); } endTextPosition(); @@ -1674,7 +1649,7 @@ void SVGTextWriter::implWriteEmbeddedBitmaps() { if( mpTextEmbeddedBitmapMtf && mpTextEmbeddedBitmapMtf->GetActionSize() ) { - mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "EmbeddedBitmaps" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "EmbeddedBitmaps" ); SvXMLElementExport aEmbBitmapGroupElem( mrExport, XML_NAMESPACE_NONE, aXMLElemG, sal_True, sal_True ); const GDIMetaFile& rMtf = *mpTextEmbeddedBitmapMtf; @@ -1714,22 +1689,22 @@ void SVGTextWriter::implWriteEmbeddedBitmaps() { // embedded bitmap id nId = SVGActionWriter::GetChecksum( pAction ); - sId = B2UCONST( "embedded-bitmap(" ); + sId = "embedded-bitmap("; sId += msShapeId; - sId += B2UCONST( "." ); + sId += "."; sId += OUString::valueOf( (sal_Int64)nId ); - sId += B2UCONST( ")" ); + sId += ")"; mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", sId ); - mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "EmbeddedBitmap" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "EmbeddedBitmap" ); SvXMLElementExport aEmbBitmapElem( mrExport, XML_NAMESPACE_NONE, aXMLElemG, sal_True, sal_True ); // { // referenced bitmap template - sRefId = B2UCONST( "#bitmap(" ); + sRefId = "#bitmap("; sRefId += OUString::valueOf( (sal_Int64)nChecksum ); - sRefId += B2UCONST( ")" ); + sRefId += ")"; Point aPoint; Size aSize; @@ -1775,7 +1750,7 @@ void SVGTextWriter::writeTextPortion( const Point& rPos, if( mbIsURLField && sContent.isEmpty() ) { Reference < XPropertySet > xPropSet( mrCurrentTextPortion, UNO_QUERY ); - Reference < XTextField > xTextField( xPropSet->getPropertyValue( B2UCONST( "TextField" ) ), UNO_QUERY ); + Reference < XTextField > xTextField( xPropSet->getPropertyValue( "TextField" ), UNO_QUERY ); sContent = xTextField->getPresentation( /* show command: */ sal_False ); if( sContent.isEmpty() ) OSL_FAIL( "SVGTextWriter::writeTextPortion: content of URL TextField is empty." ); @@ -1893,7 +1868,7 @@ void SVGTextWriter::implWriteTextPortion( const Point& rPos, // Make this text portion a bullet placeholder mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", sId ); - mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "BulletPlaceholder" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "BulletPlaceholder" ); SvXMLElementExport aSVGTspanElem( mrExport, XML_NAMESPACE_NONE, aXMLElemTspan, mbIWS, mbIWS ); return; } @@ -1909,12 +1884,12 @@ void SVGTextWriter::implWriteTextPortion( const Point& rPos, if( mbIsPlacehlolderShape ) { - mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "PlaceholderText" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "PlaceholderText" ); mbIsPlacehlolderShape = sal_False; } else if( mbIsURLField && !msUrl.isEmpty() ) { - mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "UrlField" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "UrlField" ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrXLinkHRef, msUrl ); mbIsURLField = sal_False; } @@ -2027,9 +2002,9 @@ PolyPolygon& SVGActionWriter::ImplMap( const PolyPolygon& rPolyPoly, PolyPolygon ::rtl::OUString SVGActionWriter::GetPathString( const PolyPolygon& rPolyPoly, sal_Bool bLine ) { - ::rtl::OUString aPathData; - const ::rtl::OUString aBlank( B2UCONST( " " ) ); - const ::rtl::OUString aComma( B2UCONST( "," ) ); + OUString aPathData; + const OUString aBlank( " " ); + const OUString aComma( "," ); Point aPolyPoint; for( long i = 0, nCount = rPolyPoly.Count(); i < nCount; i++ ) @@ -2039,7 +2014,7 @@ PolyPolygon& SVGActionWriter::ImplMap( const PolyPolygon& rPolyPoly, PolyPolygon if( nSize > 1 ) { - aPathData += B2UCONST( "M " ); + aPathData += "M "; aPathData += ::rtl::OUString::valueOf( ( aPolyPoint = rPoly[ 0 ] ).X() ); aPathData += aComma; aPathData += ::rtl::OUString::valueOf( aPolyPoint.Y() ); @@ -2055,7 +2030,7 @@ PolyPolygon& SVGActionWriter::ImplMap( const PolyPolygon& rPolyPoly, PolyPolygon if ( nCurrentMode != 'C' ) { nCurrentMode = 'C'; - aPathData += B2UCONST( "C " ); + aPathData += "C "; } for ( int j = 0; j < 3; j++ ) { @@ -2071,7 +2046,7 @@ PolyPolygon& SVGActionWriter::ImplMap( const PolyPolygon& rPolyPoly, PolyPolygon if ( nCurrentMode != 'L' ) { nCurrentMode = 'L'; - aPathData += B2UCONST( "L " ); + aPathData += "L "; } aPathData += ::rtl::OUString::valueOf( ( aPolyPoint = rPoly[ n++ ] ).X() ); aPathData += aComma; @@ -2080,7 +2055,7 @@ PolyPolygon& SVGActionWriter::ImplMap( const PolyPolygon& rPolyPoly, PolyPolygon } if(bClose) - aPathData += B2UCONST( " Z" ); + aPathData += " Z"; if( i < ( nCount - 1 ) ) aPathData += aBlank; @@ -2278,8 +2253,8 @@ void SVGActionWriter::ImplWriteShape( const SVGShapeDescriptor& rShape, sal_Bool if( rShape.maDashArray.size() ) { - const ::rtl::OUString aComma( B2UCONST( "," ) ); - ::rtl::OUString aDashArrayStr; + const OUString aComma( "," ); + OUString aDashArrayStr; for( unsigned int k = 0; k < rShape.maDashArray.size(); ++k ) { @@ -2310,9 +2285,7 @@ void SVGActionWriter::ImplWritePattern( const PolyPolygon& rPolyPoly, { SvXMLElementExport aElemG( mrExport, XML_NAMESPACE_NONE, aXMLElemG, sal_True, sal_True ); - ::rtl::OUString aPatternId; - aPatternId += B2UCONST( "pattern" ); - aPatternId += OUString::valueOf( mnCurPatternId++ ); + OUString aPatternId = "pattern" + OUString::valueOf( mnCurPatternId++ ); { SvXMLElementExport aElemDefs( mrExport, XML_NAMESPACE_NONE, aXMLElemDefs, sal_True, sal_True ); @@ -2334,13 +2307,10 @@ void SVGActionWriter::ImplWritePattern( const PolyPolygon& rPolyPoly, // The origin of a pattern is positioned at (aRect.Left(), aRect.Top()). // So we need to adjust the pattern coordinate. - ::rtl::OUString aTransform; - aTransform += B2UCONST( "translate" ); - aTransform += B2UCONST( "(" ); - aTransform += OUString::valueOf( -aRect.Left() ); - aTransform += B2UCONST( "," ); - aTransform += OUString::valueOf( -aRect.Top() ); - aTransform += B2UCONST( ")" ); + OUString aTransform = OUString("translate") + + "(" + OUString::valueOf( -aRect.Left() ) + + "," + OUString::valueOf( -aRect.Top() ) + + ")"; mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrTransform, aTransform ); { @@ -2356,10 +2326,7 @@ void SVGActionWriter::ImplWritePattern( const PolyPolygon& rPolyPoly, } } - ::rtl::OUString aPatternStyle; - aPatternStyle += B2UCONST( "fill:url(#" ); - aPatternStyle += aPatternId; - aPatternStyle += B2UCONST( ")" ); + OUString aPatternStyle = "fill:url(#" + aPatternId + ")"; mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrStyle, aPatternStyle ); ImplWritePolyPolygon( rPolyPoly, sal_False ); @@ -2398,9 +2365,7 @@ void SVGActionWriter::ImplWriteGradientLinear( const PolyPolygon& rPolyPoly, { SvXMLElementExport aElemG( mrExport, XML_NAMESPACE_NONE, aXMLElemG, sal_True, sal_True ); - ::rtl::OUString aGradientId; - aGradientId += B2UCONST( "gradient" ); - aGradientId += OUString::valueOf( mnCurGradientId++ ); + OUString aGradientId = "gradient" + OUString::valueOf( mnCurGradientId++ ); { SvXMLElementExport aElemDefs( mrExport, XML_NAMESPACE_NONE, aXMLElemDefs, sal_True, sal_True ); @@ -2493,11 +2458,7 @@ void SVGActionWriter::ImplWriteGradientLinear( const PolyPolygon& rPolyPoly, } } - ::rtl::OUString aGradientStyle; - aGradientStyle += B2UCONST( "fill:" ); - aGradientStyle += B2UCONST( "url(#" ); - aGradientStyle += aGradientId; - aGradientStyle += B2UCONST( ")" ); + OUString aGradientStyle = "fill:url(#" + aGradientId + ")"; mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrStyle, aGradientStyle ); ImplWritePolyPolygon( rPolyPoly, sal_False ); @@ -2509,7 +2470,7 @@ void SVGActionWriter::ImplWriteGradientStop( const Color& rColor, double fOffset mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrOffset, rtl::OUString::valueOf( fOffset ) ); ::rtl::OUString aStyle, aColor; - aStyle += B2UCONST( "stop-color:" ); + aStyle += "stop-color:"; SVGAttributeWriter::ImplGetColorStr ( rColor, aColor ); aStyle += aColor; @@ -2572,9 +2533,7 @@ void SVGActionWriter::ImplWriteMask( GDIMetaFile& rMtf, if( nMoveX || nMoveY ) rMtf.Move( nMoveX, nMoveY ); - ::rtl::OUString aMaskId; - aMaskId += B2UCONST( "mask" ); - aMaskId += OUString::valueOf( mnCurMaskId++ ); + OUString aMaskId = "mask" + OUString::valueOf( mnCurMaskId++ ); { SvXMLElementExport aElemDefs( mrExport, XML_NAMESPACE_NONE, aXMLElemDefs, sal_True, sal_True ); @@ -2598,10 +2557,7 @@ void SVGActionWriter::ImplWriteMask( GDIMetaFile& rMtf, } } - ::rtl::OUString aMaskStyle; - aMaskStyle += B2UCONST( "mask:url(#" ); - aMaskStyle += aMaskId; - aMaskStyle += B2UCONST( ")" ); + OUString aMaskStyle = "mask:url(#" + aMaskId + ")"; mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrStyle, aMaskStyle ); { @@ -2743,26 +2699,15 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText, if( rFont.GetOrientation() ) { Point aRot( aPos ); - String aTransform; - - aTransform = String( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "translate" ) ) ); - aTransform += '('; - aTransform += String( ::rtl::OUString::valueOf( aRot.X() ) ); - aTransform += ','; - aTransform += String( ::rtl::OUString::valueOf( aRot.Y() ) ); - aTransform += ')'; - - aTransform += String( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " rotate" ) ) ); - aTransform += '('; - aTransform += String( ::rtl::OUString::valueOf( rFont.GetOrientation() * -0.1 ) ); - aTransform += ')'; - - aTransform += String( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " translate" ) ) ); - aTransform += '('; - aTransform += String( ::rtl::OUString::valueOf( -aRot.X() ) ); - aTransform += ','; - aTransform += String( ::rtl::OUString::valueOf( -aRot.Y() ) ); - aTransform += ')'; + OUString aTransform = + OUString("translate") + + "(" + OUString::valueOf( aRot.X() ) + + "," + OUString::valueOf( aRot.Y() ) + ")" + + " rotate" + + "(" + OUString::valueOf( rFont.GetOrientation() * -0.1 ) + ")" + + " translate" + + "(" + OUString::valueOf( -aRot.X() ) + + "," + OUString::valueOf( -aRot.Y() ) + ")"; mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrTransform, aTransform ); } @@ -2788,7 +2733,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText, { sCleanTextContent = sTextContent.copy( nFrom ); } - mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "PlaceholderText" ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "PlaceholderText" ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX, ::rtl::OUString::valueOf( aPos.X() ) ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrY, ::rtl::OUString::valueOf( aPos.Y() ) ); { @@ -3345,7 +3290,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, if( pElementId ) { - mapCurShape->maId = *pElementId + B2UCONST("_") + ::rtl::OUString::valueOf(nEntryCount++); + mapCurShape->maId = *pElementId + "_" + OUString::valueOf(nEntryCount++); } mapCurShape->maShapePolyPoly = aShapePolyPoly; @@ -3434,7 +3379,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, if( pElementId ) { - mapCurShape->maId = *pElementId + B2UCONST("_") + ::rtl::OUString::valueOf(nEntryCount++); + mapCurShape->maId = *pElementId + "_" + OUString::valueOf(nEntryCount++); } aStroke.getPath( aPoly ); diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx index ce2e441ce8b1..e8032fe58071 100644 --- a/filter/source/svg/svgwriter.hxx +++ b/filter/source/svg/svgwriter.hxx @@ -80,9 +80,8 @@ using namespace ::com::sun::star::style; #define REF( _def_Obj ) NMSP_UNO::Reference< _def_Obj > #define SEQ( _def_Obj ) NMSP_UNO::Sequence< _def_Obj > -#define B2UCONST( _def_pChar ) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(_def_pChar ))) -#define SVG_DTD_STRING B2UCONST( "" ) -#define SVG_TINY_DTD_STRING B2UCONST( "" ) +#define SVG_DTD_STRING OUString( "" ) +#define SVG_TINY_DTD_STRING OUString( "" ) #define SVGWRITER_WRITE_NONE 0x00000000 #define SVGWRITER_WRITE_FILL 0x00000001 -- cgit