diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-04 12:28:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-04 13:15:29 +0000 |
commit | 2dfc4c0845c72b3a1cf19546a1606907f36eea42 (patch) | |
tree | 8df986c777d2b6847782a4395af50fbca5eea96f | |
parent | 859204a52351c4d5d146e8b22d14bd4a44f294e9 (diff) |
loplugin:oncevar in desktop..filter
Change-Id: I21c47cacbcd68f06eea7ccbbfa6d04fc65e2b7ee
Reviewed-on: https://gerrit.libreoffice.org/30564
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | desktop/source/app/app.cxx | 3 | ||||
-rw-r--r-- | desktop/source/deployment/registry/dp_backend.cxx | 4 | ||||
-rw-r--r-- | desktop/source/migration/services/wordbookmigration.cxx | 10 | ||||
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 5 | ||||
-rw-r--r-- | editeng/source/uno/unonrule.cxx | 5 | ||||
-rw-r--r-- | extensions/source/dbpilots/controlwizard.cxx | 3 | ||||
-rw-r--r-- | extensions/source/dbpilots/gridwizard.cxx | 9 | ||||
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.cxx | 9 | ||||
-rw-r--r-- | filter/source/msfilter/escherex.cxx | 33 | ||||
-rw-r--r-- | filter/source/msfilter/mstoolbar.cxx | 6 | ||||
-rw-r--r-- | filter/source/msfilter/msvbahelper.cxx | 19 | ||||
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 60 | ||||
-rw-r--r-- | filter/source/svg/svgexport.cxx | 44 | ||||
-rw-r--r-- | filter/source/svg/svgreader.cxx | 9 | ||||
-rw-r--r-- | filter/source/svg/svgwriter.cxx | 73 |
15 files changed, 90 insertions, 202 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 44598da773ac..7f278e14e546 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1142,14 +1142,13 @@ void impl_checkRecoveryState(bool& bCrashed , bool impl_callRecoveryUI(bool bEmergencySave , bool bExistsRecoveryData) { - static const char SERVICENAME_RECOVERYUI[] = "com.sun.star.comp.svx.RecoveryUI"; static const char COMMAND_EMERGENCYSAVE[] = "vnd.sun.star.autorecovery:/doEmergencySave"; static const char COMMAND_RECOVERY[] = "vnd.sun.star.autorecovery:/doAutoRecovery"; css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< css::frame::XSynchronousDispatch > xRecoveryUI( - xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_RECOVERYUI, xContext), + xContext->getServiceManager()->createInstanceWithContext("com.sun.star.comp.svx.RecoveryUI", xContext), css::uno::UNO_QUERY_THROW); Reference< css::util::XURLTransformer > xURLParser = diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx index a7ca243e3d89..4b81c5e51197 100644 --- a/desktop/source/deployment/registry/dp_backend.cxx +++ b/desktop/source/deployment/registry/dp_backend.cxx @@ -268,8 +268,6 @@ void PackageRegistryBackend::deleteUnusedFolders( // get all temp directories: ::std::vector<OUString> tempEntries; - const char tmp[] = ".tmp"; - while (xResultSet->next()) { OUString title( @@ -277,7 +275,7 @@ void PackageRegistryBackend::deleteUnusedFolders( xResultSet, UNO_QUERY_THROW )->getString( 1 /* Title */ ) ); - if (title.endsWith(tmp)) + if (title.endsWith(".tmp")) tempEntries.push_back( makeURLAppendSysPathSegment(sDataFolder, title)); } diff --git a/desktop/source/migration/services/wordbookmigration.cxx b/desktop/source/migration/services/wordbookmigration.cxx index f74b719a4ad4..bf6816d0295b 100644 --- a/desktop/source/migration/services/wordbookmigration.cxx +++ b/desktop/source/migration/services/wordbookmigration.cxx @@ -29,12 +29,6 @@ using namespace ::com::sun::star::uno; namespace migration { - - - static const char sSourceSubDir[] = "/user/wordbook"; - static const char sTargetSubDir[] = "/user/wordbook"; - - // component operations @@ -156,7 +150,7 @@ bool IsUserWordbook( const OUString& rFile ) ::utl::Bootstrap::PathStatus aStatus = ::utl::Bootstrap::locateUserInstallation( sTargetDir ); if ( aStatus == ::utl::Bootstrap::PATH_EXISTS ) { - sTargetDir += sTargetSubDir; + sTargetDir += "/user/wordbook"; TStringVectorPtr aFileList = getFiles( m_sSourceDir ); TStringVector::const_iterator aI = aFileList->begin(); while ( aI != aFileList->end() ) @@ -229,7 +223,7 @@ bool IsUserWordbook( const OUString& rFile ) { OSL_FAIL( "WordbookMigration::initialize: argument UserData has wrong type!" ); } - m_sSourceDir += sSourceSubDir; + m_sSourceDir += "/user/wordbook"; break; } } diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 247d03bd9bc6..fafb4be81ebc 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -96,9 +96,6 @@ static const sal_Char /* also at these ends - Brackets and all kinds of begin characters */ sImplEndSkipChars[] = "\"\')]}\x83\x84\x89\x91\x92\x93\x94"; -// These characters are allowed in words: (for FnCapitalStartSentence) -static const sal_Char sImplWordChars[] = "-'"; - OUString EncryptBlockName_Imp(const OUString& rName); static inline bool IsWordDelim( const sal_Unicode c ) @@ -833,7 +830,7 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc, } else if (pWordStt && !rCC.isDigit(aText, pStr - pStart)) { - if( lcl_IsInAsciiArr( sImplWordChars, *pStr ) && + if( lcl_IsInAsciiArr( "-'", *pStr ) && // These characters are allowed in words pWordStt - 1 == pStr && // Installation at beginning of paragraph. Replaced < by <= (#i38971#) (pStart + 1) <= pStr && diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx index 313d5928f760..1970f5fb2c39 100644 --- a/editeng/source/uno/unonrule.cxx +++ b/editeng/source/uno/unonrule.cxx @@ -150,9 +150,6 @@ Reference< XCloneable > SAL_CALL SvxUnoNumberingRules::createClone( ) throw (Ru return new SvxUnoNumberingRules(maRule); } -// XServiceInfo -const char pSvxUnoNumberingRulesService[] = "com.sun.star.text.NumberingRules"; - OUString SAL_CALL SvxUnoNumberingRules::getImplementationName( ) throw(RuntimeException, std::exception) { return OUString( "SvxUnoNumberingRules" ); @@ -165,7 +162,7 @@ sal_Bool SAL_CALL SvxUnoNumberingRules::supportsService( const OUString& Service Sequence< OUString > SAL_CALL SvxUnoNumberingRules::getSupportedServiceNames( ) throw(RuntimeException, std::exception) { - OUString aService( pSvxUnoNumberingRulesService ); + OUString aService( "com.sun.star.text.NumberingRules" ); Sequence< OUString > aSeq( &aService, 1 ); return aSeq; } diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index 8f9a21cabfb6..ad1d236921c3 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -574,7 +574,6 @@ namespace dbp if (xColumns.is()) { m_aContext.aFieldNames = xColumns->getElementNames(); - static const char s_sFieldTypeProperty[] = "Type"; const OUString* pBegin = m_aContext.aFieldNames.getConstArray(); const OUString* pEnd = pBegin + m_aContext.aFieldNames.getLength(); for(;pBegin != pEnd;++pBegin) @@ -584,7 +583,7 @@ namespace dbp { Reference< XPropertySet > xColumn; xColumns->getByName(*pBegin) >>= xColumn; - xColumn->getPropertyValue(s_sFieldTypeProperty) >>= nFieldType; + xColumn->getPropertyValue("Type") >>= nFieldType; } catch(const Exception&) { diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index 3795fa5e0bab..698318bdae73 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -100,9 +100,6 @@ namespace dbp if (!xColumnFactory.is() || !xColumnContainer.is()) return; - static const char s_sDataFieldProperty [] = "DataField"; - static const char s_sLabelProperty [] = "Label"; - static const char s_sWidthProperty [] = "Width"; static const char s_sMouseWheelBehavior[] = "MouseWheelBehavior"; static const char s_sEmptyString[] = ""; @@ -201,11 +198,11 @@ namespace dbp disambiguateName(xExistenceChecker, sColumnName); // the data field the column should be bound to - xColumn->setPropertyValue(s_sDataFieldProperty, makeAny(*pFormFieldName)); + xColumn->setPropertyValue("DataField", makeAny(*pFormFieldName)); // the label - xColumn->setPropertyValue(s_sLabelProperty, makeAny(*pFormFieldName + *pColumnLabelPostfix)); + xColumn->setPropertyValue("Label", makeAny(*pFormFieldName + *pColumnLabelPostfix)); // the width (<void/> => column will be auto-sized) - xColumn->setPropertyValue(s_sWidthProperty, Any()); + xColumn->setPropertyValue("Width", Any()); if ( xColumnPSI->hasPropertyByName( s_sMouseWheelBehavior ) ) xColumn->setPropertyValue( s_sMouseWheelBehavior, makeAny( MouseWheelBehavior::SCROLL_DISABLED ) ); diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 362861d1271c..c20126ef3b6a 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -220,12 +220,10 @@ namespace pcr if ( (eType == TypeClass_STRING || eType == TypeClass_SEQUENCE) && lcl_isLanguageDependentProperty( _rPropertyName ) ) { - static const char s_sResourceResolverPropName[] = "ResourceResolver"; - Reference< resource::XStringResourceResolver > xStringResourceResolver; try { - xStringResourceResolver.set( _xComponent->getPropertyValue( s_sResourceResolverPropName ),UNO_QUERY); + xStringResourceResolver.set( _xComponent->getPropertyValue( "ResourceResolver" ),UNO_QUERY); if( xStringResourceResolver.is() && xStringResourceResolver->getLocales().getLength() > 0 ) { @@ -373,7 +371,6 @@ namespace pcr else if( eType == TypeClass_SEQUENCE ) { static const char aDot[] = "."; - static const char aEsc[] = "&"; // Put strings into resource using new ids Sequence< OUString > aNewStrings; @@ -456,9 +453,7 @@ namespace pcr OUString aStr = pNewStrings[i]; xStringResourceManager->setString( aPureIdStr, aStr ); - OUString aIdStr = aEsc; - aIdStr += aPureIdStr; - pNewIdStrings[i] = aIdStr; + pNewIdStrings[i] = "&" + aPureIdStr; } aValue <<= aNewIdStrings; diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index ff78d89dbe2f..dea7097c6018 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -843,13 +843,8 @@ bool EscherPropertyContainer::GetLineArrow( const bool bLineStart, const css::uno::Reference< css::beans::XPropertySet > & rXPropSet, ESCHER_LineEnd& reLineEnd, sal_Int32& rnArrowLength, sal_Int32& rnArrowWidth ) { - static const char sLineStart [] = "LineStart"; - static const char sLineStartName[] = "LineStartName"; - static const char sLineEnd [] = "LineEnd"; - static const char sLineEndName [] = "LineEndName"; - - const OUString sLine ( bLineStart ? OUString(sLineStart) : OUString(sLineEnd) ); - const OUString sLineName ( bLineStart ? OUString(sLineStartName) : OUString(sLineEndName) ); + const OUString sLine ( bLineStart ? OUString("LineStart") : OUString("LineEnd") ); + const OUString sLineName ( bLineStart ? OUString("LineStartName") : OUString("LineEndName") ); bool bIsArrow = false; @@ -1908,9 +1903,6 @@ bool EscherPropertyContainer::CreatePolygonProperties( css::awt::Rectangle& rGeoRect, tools::Polygon* pPolygon ) { - static const char sPolyPolygonBezier [] = "PolyPolygonBezier"; - static const char sPolyPolygon [] = "PolyPolygon"; - bool bRetValue = true; bool bLine = ( nFlags & ESCHER_CREATEPOLYGON_LINE ) != 0; @@ -1922,7 +1914,7 @@ bool EscherPropertyContainer::CreatePolygonProperties( { css::uno::Any aAny; bRetValue = EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, - ( bBezier ) ? OUString(sPolyPolygonBezier) : OUString(sPolyPolygon), true ); + ( bBezier ) ? OUString("PolyPolygonBezier") : OUString("PolyPolygon"), true ); if ( bRetValue ) { aPolyPolygon = GetPolyPolygon( aAny ); @@ -2205,13 +2197,6 @@ bool EscherPropertyContainer::CreateConnectorProperties( EscherSolverContainer& rSolverContainer, css::awt::Rectangle& rGeoRect, sal_uInt16& rShapeType, sal_uInt16& rShapeFlags ) { - static const char sEdgeKind [] = "EdgeKind"; - static const char sEdgeStartPoint [] = "EdgeStartPoint"; - static const char sEdgeEndPoint [] = "EdgeEndPoint"; - static const char sEdgeStartConnection [] = "EdgeStartConnection"; - static const char sEdgeEndConnection [] = "EdgeEndConnection"; - static const char sEdgePath [] = "PolyPolygonBezier"; - bool bRetValue = false; rShapeType = rShapeFlags = 0; @@ -2223,14 +2208,14 @@ bool EscherPropertyContainer::CreateConnectorProperties( css::uno::Any aAny( rXShape->queryInterface( cppu::UnoType<css::beans::XPropertySet>::get())); if ( aAny >>= aXPropSet ) { - if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sEdgeKind, true ) ) + if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, "EdgeKind", true ) ) { css::drawing::ConnectorType eCt; aAny >>= eCt; - if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sEdgeStartPoint ) ) + if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, "EdgeStartPoint" ) ) { aStartPoint = *o3tl::doAccess<css::awt::Point>(aAny); - if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sEdgeEndPoint ) ) + if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, "EdgeEndPoint" ) ) { aEndPoint = *o3tl::doAccess<css::awt::Point>(aAny); @@ -2256,9 +2241,9 @@ bool EscherPropertyContainer::CreateConnectorProperties( sal_uInt32 nAdjustValue1, nAdjustValue2, nAdjustValue3; nAdjustValue1 = nAdjustValue2 = nAdjustValue3 = 0x2a30; - if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sEdgeStartConnection ) ) + if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, "EdgeStartConnection" ) ) aAny >>= aShapeA; - if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sEdgeEndConnection ) ) + if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, "EdgeEndConnection" ) ) aAny >>= aShapeB; rSolverContainer.AddConnector( rXShape, aStartPoint, aShapeA, aEndPoint, aShapeB ); switch ( eCt ) @@ -2274,7 +2259,7 @@ bool EscherPropertyContainer::CreateConnectorProperties( case css::drawing::ConnectorType_STANDARD :// Connector 2->5 { - if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sEdgePath ) ) + if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, "PolyPolygonBezier" ) ) { tools::PolyPolygon aPolyPolygon = GetPolyPolygon( aAny ); tools::Polygon aPoly; diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx index 51ea8b573d29..e0698a36f370 100644 --- a/filter/source/msfilter/mstoolbar.cxx +++ b/filter/source/msfilter/mstoolbar.cxx @@ -99,11 +99,9 @@ CustomToolBarImportHelper::getCfgManager() uno::Any CustomToolBarImportHelper::createCommandFromMacro( const OUString& sCmd ) { -//"vnd.sun.star.script:Standard.Module1.Main?language=Basic&location=document" - static const char scheme[] = "vnd.sun.star.script:"; - static const char part2 [] = "?language=Basic&location=document"; + //"vnd.sun.star.script:Standard.Module1.Main?language=Basic&location=document" // create script url - OUString scriptURL = scheme + sCmd + part2; + OUString scriptURL = "vnd.sun.star.script:" + sCmd + "?language=Basic&location=document"; return uno::makeAny( scriptURL ); } diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx index 4690c6fd0657..115855569ad0 100644 --- a/filter/source/msfilter/msvbahelper.cxx +++ b/filter/source/msfilter/msvbahelper.cxx @@ -607,16 +607,15 @@ OUString SAL_CALL VBAMacroResolver::resolveScriptURLtoVBAMacro( const OUString& bool getModifier( char c, sal_uInt16& mod ) { - static const char modifiers[] = "+^%"; - static const sal_uInt16 KEY_MODS[] = {KEY_SHIFT, KEY_MOD1, KEY_MOD2}; - - for ( unsigned int i=0; i<SAL_N_ELEMENTS(KEY_MODS); ++i ) - { - if ( c == modifiers[i] ) - { - mod = mod | KEY_MODS[ i ]; - return true; - } + if ( c == '+' ) { + mod |= KEY_SHIFT; + return true; + } else if ( c == '^' ) { + mod |= KEY_MOD1; + return true; + } else if ( c == '%' ) { + mod |= KEY_MOD2; + return true; } return false; } diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 2f57c2b7d489..6eada0130a03 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -7327,9 +7327,8 @@ void CreateTableRows( const Reference< XTableRows >& xTableRows, const std::set< else nHeight = nTableBottom - nLastPosition; - static const char sWidth[] = "Height"; Reference< XPropertySet > xPropSet( xTableRows->getByIndex( n ), UNO_QUERY_THROW ); - xPropSet->setPropertyValue( sWidth, Any( nHeight ) ); + xPropSet->setPropertyValue( "Height", Any( nHeight ) ); } } @@ -7351,9 +7350,8 @@ void CreateTableColumns( const Reference< XTableColumns >& xTableColumns, const else nWidth = nTableRight - nLastPosition; - static const char sWidth[] = "Width"; Reference< XPropertySet > xPropSet( xTableColumns->getByIndex( n ), UNO_QUERY_THROW ); - xPropSet->setPropertyValue( sWidth, Any( nWidth ) ); + xPropSet->setPropertyValue( "Width", Any( nWidth ) ); } } @@ -7386,33 +7384,26 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell >& xCell ) const sal_Int32 nRightDist(static_cast<const SdrMetricItem&>(pObj->GetMergedItem(SDRATTR_TEXT_RIGHTDIST)).GetValue()); const sal_Int32 nUpperDist(static_cast<const SdrMetricItem&>(pObj->GetMergedItem(SDRATTR_TEXT_UPPERDIST)).GetValue()); const sal_Int32 nLowerDist(static_cast<const SdrMetricItem&>(pObj->GetMergedItem(SDRATTR_TEXT_LOWERDIST)).GetValue()); - static const char sTopBorder[] = "TextUpperDistance"; - static const char sBottomBorder[] = "TextLowerDistance"; - static const char sLeftBorder[] = "TextLeftDistance"; - static const char sRightBorder[] = "TextRightDistance"; - xPropSet->setPropertyValue( sTopBorder, Any( nUpperDist ) ); - xPropSet->setPropertyValue( sRightBorder, Any( nRightDist ) ); - xPropSet->setPropertyValue( sLeftBorder, Any( nLeftDist ) ); - xPropSet->setPropertyValue( sBottomBorder, Any( nLowerDist ) ); - - static const char sTextVerticalAdjust[] = "TextVerticalAdjust"; + xPropSet->setPropertyValue( "TextUpperDistance", Any( nUpperDist ) ); + xPropSet->setPropertyValue( "TextRightDistance", Any( nRightDist ) ); + xPropSet->setPropertyValue( "TextLeftDistance", Any( nLeftDist ) ); + xPropSet->setPropertyValue( "TextLowerDistance", Any( nLowerDist ) ); + const SdrTextVertAdjust eTextVertAdjust(static_cast<const SdrTextVertAdjustItem&>(pObj->GetMergedItem(SDRATTR_TEXT_VERTADJUST)).GetValue()); drawing::TextVerticalAdjust eVA( drawing::TextVerticalAdjust_TOP ); if ( eTextVertAdjust == SDRTEXTVERTADJUST_CENTER ) eVA = drawing::TextVerticalAdjust_CENTER; else if ( eTextVertAdjust == SDRTEXTVERTADJUST_BOTTOM ) eVA = drawing::TextVerticalAdjust_BOTTOM; - xPropSet->setPropertyValue( sTextVerticalAdjust, Any( eVA ) ); + xPropSet->setPropertyValue( "TextVerticalAdjust", Any( eVA ) ); //set textHorizontalAdjust and TextWritingMode attr const sal_Int32 eHA(static_cast<const SdrTextHorzAdjustItem&>(pObj->GetMergedItem(SDRATTR_TEXT_HORZADJUST)).GetValue()); const SvxFrameDirection eDirection = (const SvxFrameDirection)(static_cast<const SvxFrameDirectionItem&>(pObj->GetMergedItem(EE_PARA_WRITINGDIR)).GetValue()); - static const char sHorizontalAdjust[] = "TextHorizontalAdjust"; - static const char sWritingMode[] = "TextWritingMode"; - xPropSet->setPropertyValue( sHorizontalAdjust , Any( eHA ) ); + xPropSet->setPropertyValue( "TextHorizontalAdjust" , Any( eHA ) ); if ( eDirection == FRMDIR_VERT_TOP_RIGHT ) {//vertical writing - xPropSet->setPropertyValue( sWritingMode , Any( css::text::WritingMode_TB_RL ) ); + xPropSet->setPropertyValue( "TextWritingMode" , Any( css::text::WritingMode_TB_RL ) ); } SfxItemSet aSet( pObj->GetMergedItemSet() ); drawing::FillStyle eFillStyle(static_cast<const XFillStyleItem&>(pObj->GetMergedItem( XATTR_FILLSTYLE )).GetValue()); @@ -7421,11 +7412,10 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell >& xCell ) { case drawing::FillStyle_SOLID : { - static const char sFillColor[] = "FillColor"; eFS = css::drawing::FillStyle_SOLID; Color aFillColor( static_cast<const XFillColorItem&>(pObj->GetMergedItem( XATTR_FILLCOLOR )).GetColorValue() ); sal_Int32 nFillColor( aFillColor.GetColor() ); - xPropSet->setPropertyValue( sFillColor, Any( nFillColor ) ); + xPropSet->setPropertyValue( "FillColor", Any( nFillColor ) ); } break; case drawing::FillStyle_GRADIENT : @@ -7445,8 +7435,7 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell >& xCell ) aGradient.EndIntensity = aXGradient.GetEndIntens(); aGradient.StepCount = aXGradient.GetSteps(); - static const char sFillGradient[] = "FillGradient"; - xPropSet->setPropertyValue( sFillGradient, Any( aGradient ) ); + xPropSet->setPropertyValue( "FillGradient", Any( aGradient ) ); } break; case drawing::FillStyle_HATCH : @@ -7480,13 +7469,11 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell >& xCell ) break; } - static const char sFillStyle[] = "FillStyle"; - xPropSet->setPropertyValue( sFillStyle, Any( eFS ) ); + xPropSet->setPropertyValue( "FillStyle", Any( eFS ) ); if ( eFillStyle != drawing::FillStyle_NONE ) { sal_Int16 nFillTransparence( static_cast<const XFillTransparenceItem&>(pObj->GetMergedItem( XATTR_FILLTRANSPARENCE ) ).GetValue() ); - static const char sFillTransparence[] = "FillTransparence"; - xPropSet->setPropertyValue( sFillTransparence, Any( nFillTransparence ) ); + xPropSet->setPropertyValue( "FillTransparence", Any( nFillTransparence ) ); } } catch( const Exception& ) @@ -7525,13 +7512,6 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTabl std::vector< sal_Int32 >::const_iterator aIter( vPositions.begin() ); while( aIter != vPositions.end() ) { - static const char sTopBorder[] = "TopBorder"; - static const char sBottomBorder[] = "BottomBorder"; - static const char sLeftBorder[] = "LeftBorder"; - static const char sRightBorder[] = "RightBorder"; - static const char sDiagonalTLBR[] = "DiagonalTLBR"; - static const char sDiagonalBLTR[] = "DiagonalBLTR"; - sal_Int32 nPosition = *aIter & 0xffffff; sal_Int32 nFlags = *aIter &~0xffffff; sal_Int32 nRow = nPosition / nColumns; @@ -7540,17 +7520,17 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTabl Reference< XPropertySet > xPropSet( xCell, UNO_QUERY_THROW ); if ( nFlags & LinePositionLeft ) - xPropSet->setPropertyValue( sLeftBorder, Any( aBorderLine ) ); + xPropSet->setPropertyValue( "LeftBorder", Any( aBorderLine ) ); if ( nFlags & LinePositionTop ) - xPropSet->setPropertyValue( sTopBorder, Any( aBorderLine ) ); + xPropSet->setPropertyValue( "TopBorder", Any( aBorderLine ) ); if ( nFlags & LinePositionRight ) - xPropSet->setPropertyValue( sRightBorder, Any( aBorderLine ) ); + xPropSet->setPropertyValue( "RightBorder", Any( aBorderLine ) ); if ( nFlags & LinePositionBottom ) - xPropSet->setPropertyValue( sBottomBorder, Any( aBorderLine ) ); + xPropSet->setPropertyValue( "BottomBorder", Any( aBorderLine ) ); if ( nFlags & LinePositionTLBR ) - xPropSet->setPropertyValue( sDiagonalTLBR, Any( true ) ); + xPropSet->setPropertyValue( "DiagonalTLBR", Any( true ) ); if ( nFlags & LinePositionBLTR ) - xPropSet->setPropertyValue( sDiagonalBLTR, Any( true ) ); + xPropSet->setPropertyValue( "DiagonalBLTR", Any( true ) ); ++aIter; } } diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 1cd7fa3ddc9c..7db79d29d473 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -61,39 +61,21 @@ using namespace ::xmloff::token; #define NSPREFIX "ooo:" // ooo xml elements -static const char aOOOElemMetaSlides[] = NSPREFIX "meta_slides"; -static const char aOOOElemMetaSlide[] = NSPREFIX "meta_slide"; static const char aOOOElemTextField[] = NSPREFIX "text_field"; -// ooo xml attributes for meta_slides -static const char aOOOAttrNumberOfSlides[] = NSPREFIX "number-of-slides"; -static const char aOOOAttrStartSlideNumber[] = NSPREFIX "start-slide-number"; -static const char aOOOAttrNumberingType[] = NSPREFIX "page-numbering-type"; -static const char aOOOAttrUsePositionedChars[] = NSPREFIX "use-positioned-chars"; // ooo xml attributes for meta_slide static const char aOOOAttrSlide[] = NSPREFIX "slide"; static const char aOOOAttrMaster[] = NSPREFIX "master"; static const char aOOOAttrBackgroundVisibility[] = NSPREFIX "background-visibility"; static const char aOOOAttrMasterObjectsVisibility[] = NSPREFIX "master-objects-visibility"; -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 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"; -static const char aOOOAttrIdList[] = NSPREFIX "id-list"; // ooo xml attributes for pages and shapes static const char aOOOAttrName[] = NSPREFIX "name"; -// ooo xml attributes for date_time_field -static const char aOOOAttrDateTimeFormat[] = NSPREFIX "date-time-format"; - -// ooo xml attributes for Placeholder Shapes -static const char aOOOAttrTextAdjust[] = NSPREFIX "text-adjust"; - static const char constSvgNamespace[] = "http://www.w3.org/2000/svg"; @@ -292,7 +274,7 @@ public: OUString sDateTimeFormat = sDateFormat + " " + sTimeFormat; - pSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrDateTimeFormat, sDateTimeFormat ); + pSVGExport->AddAttribute( XML_NAMESPACE_NONE, NSPREFIX "date-time-format", sDateTimeFormat ); SvXMLElementExport aExp( *pSVGExport, XML_NAMESPACE_NONE, "g", true, true ); } virtual void growCharSet( SVGFilter::UCharSetMapMap & aTextFieldCharSets ) const override @@ -923,13 +905,13 @@ void SVGFilter::implGenerateMetaData() // we wrap all meta presentation info into a svg:defs element SvXMLElementExport aDefsElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", true, true ); - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", aOOOElemMetaSlides ); - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrNumberOfSlides, OUString::number( nCount ) ); - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrStartSlideNumber, OUString::number( mnVisiblePage ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", NSPREFIX "meta_slides" ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, NSPREFIX "number-of-slides", OUString::number( nCount ) ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, NSPREFIX "start-slide-number", OUString::number( mnVisiblePage ) ); if( mpSVGExport->IsUsePositionedCharacters() ) { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrUsePositionedChars, "true" ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, NSPREFIX "use-positioned-chars", "true" ); } // Add a (global) Page Numbering Type attribute for the document @@ -970,13 +952,13 @@ void SVGFilter::implGenerateMetaData() break; } if( !sNumberingType.isEmpty() ) - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrNumberingType, sNumberingType ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, NSPREFIX "page-numbering-type", sNumberingType ); } { SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true ); - const OUString aId( aOOOElemMetaSlide ); + const OUString aId( NSPREFIX "meta_slide" ); const OUString aElemTextFieldId( aOOOElemTextField ); std::vector< TextField* > aFieldSet; @@ -1036,7 +1018,7 @@ void SVGFilter::implGenerateMetaData() bPageNumberVisibility = bPageNumberVisibility && ( nPageNumberingType != css::style::NumberingType::NUMBER_NONE ); if( bPageNumberVisibility ) // visibility default value: 'hidden' { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrPageNumberVisibility, "visible" ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, NSPREFIX "page-number-visibility", "visible" ); } // Date/Time Field @@ -1063,7 +1045,7 @@ void SVGFilter::implGenerateMetaData() } else { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrDateTimeVisibility, "hidden" ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, NSPREFIX "date-time-visibility", "hidden" ); } // Footer Field @@ -1079,7 +1061,7 @@ void SVGFilter::implGenerateMetaData() } else { - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrFooterVisibility, "hidden" ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, NSPREFIX "footer-visibility", "hidden" ); } } else @@ -1213,7 +1195,7 @@ void SVGFilter::implExportTextShapeIndex() if( !rPageId.isEmpty() && !sTextShapeIdList.isEmpty() ) { mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrSlide, rPageId ); - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrIdList, sTextShapeIdList ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, NSPREFIX "id-list", sTextShapeIdList ); SvXMLElementExport aGElem( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true ); } } @@ -1767,7 +1749,7 @@ bool SVGFilter::implExportShape( const Reference< XShape >& rxShape, bool bMaste default: break; } - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrTextAdjust, sTextAdjust ); + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, NSPREFIX "text-adjust", sTextAdjust ); } } mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", aShapeClass ); @@ -2156,7 +2138,7 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo, void ) } bool bHasCharSetMap = !( mTextFieldCharSets.find( mCreateOjectsCurrentMasterPage ) == mTextFieldCharSets.end() ); - static const OUString aHeaderId( aOOOAttrHeaderField ); + static const OUString aHeaderId( NSPREFIX "header-field" ); static const OUString aFooterId( aOOOAttrFooterField ); static const OUString aDateTimeId( aOOOAttrDateTimeField ); static const OUString aVariableDateTimeId( aOOOAttrDateTimeField + "-variable" ); diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index 7efe1323531c..377a74680037 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -600,18 +600,15 @@ struct AnnotatingVisitor static OUString getOdfAlign( TextAlign eAlign ) { - static const char aStart[] = "start"; - static const char aEnd[] = "end"; - static const char aCenter[] = "center"; switch(eAlign) { default: case BEFORE: - return OUString(aStart); + return OUString("start"); case CENTER: - return OUString(aCenter); + return OUString("center"); case AFTER: - return OUString(aEnd); + return OUString("end"); } } diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index e3c74c743ba5..1723eebf327b 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -35,28 +35,15 @@ static const char aPrefixClipPathId[] = "clip_path_"; static const char aXMLElemG[] = "g"; -static const char aXMLElemA[] = "a"; -static const char aXMLElemClipPath[] = "clipPath"; static const char aXMLElemDefs[] = "defs"; -static const char aXMLElemLine[] = "line"; -static const char aXMLElemRect[] = "rect"; -static const char aXMLElemEllipse[] = "ellipse"; -static const char aXMLElemPath[] = "path"; static const char aXMLElemText[] = "text"; static const char aXMLElemTspan[] = "tspan"; -static const char aXMLElemImage[] = "image"; -static const char aXMLElemMask[] = "mask"; -static const char aXMLElemPattern[] = "pattern"; static const char aXMLElemLinearGradient[] = "linearGradient"; -static const char aXMLElemRadialGradient[] = "radialGradient"; static const char aXMLElemStop[] = "stop"; static const char aXMLAttrTransform[] = "transform"; static const char aXMLAttrStyle[] = "style"; static const char aXMLAttrId[] = "id"; -static const char aXMLAttrClipPath[] = "clip-path"; -static const char aXMLAttrClipPathUnits[] = "clipPathUnits"; -static const char aXMLAttrD[] = "d"; static const char aXMLAttrX[] = "x"; static const char aXMLAttrY[] = "y"; static const char aXMLAttrX1[] = "x1"; @@ -65,17 +52,12 @@ static const char aXMLAttrX2[] = "x2"; static const char aXMLAttrY2[] = "y2"; static const char aXMLAttrCX[] = "cx"; static const char aXMLAttrCY[] = "cy"; -static const char aXMLAttrR[] = "r"; static const char aXMLAttrRX[] = "rx"; static const char aXMLAttrRY[] = "ry"; static const char aXMLAttrWidth[] = "width"; static const char aXMLAttrHeight[] = "height"; -static const char aXMLAttrStroke[] = "stroke"; -static const char aXMLAttrStrokeOpacity[] = "stroke-opacity"; static const char aXMLAttrStrokeWidth[] = "stroke-width"; -static const char aXMLAttrStrokeDashArray[] = "stroke-dasharray"; static const char aXMLAttrFill[] = "fill"; -static const char aXMLAttrFillOpacity[] = "fill-opacity"; static const char aXMLAttrFontFamily[] = "font-family"; static const char aXMLAttrFontSize[] = "font-size"; static const char aXMLAttrFontStyle[] = "font-style"; @@ -83,23 +65,12 @@ static const char aXMLAttrFontWeight[] = "font-weight"; static const char aXMLAttrTextDecoration[] = "text-decoration"; static const char aXMLAttrXLinkHRef[] = "xlink:href"; static const char aXMLAttrGradientUnits[] = "gradientUnits"; -static const char aXMLAttrPatternUnits[] = "patternUnits"; -static const char aXMLAttrPreserveAspectRatio[] = "preserveAspectRatio"; static const char aXMLAttrOffset[] = "offset"; static const char aXMLAttrStopColor[] = "stop-color"; static const char aXMLAttrStrokeLinejoin[] = "stroke-linejoin"; static const char aXMLAttrStrokeLinecap[] = "stroke-linecap"; -#define NSPREFIX "ooo:" - -static const char aOOOAttrNumberingType[] = NSPREFIX "numbering-type"; - - -static sal_Char const XML_UNO_NAME_NRULE_NUMBERINGTYPE[] = "NumberingType"; -static sal_Char const XML_UNO_NAME_NRULE_BULLET_CHAR[] = "BulletChar"; - - PushFlags SVGContextHandler::getPushFlags() const { if (maStateStack.empty()) @@ -221,10 +192,10 @@ void SVGAttributeWriter::AddPaintAttr( const Color& rLineColor, const Color& rFi } } else - AddColorAttr( aXMLAttrFill, aXMLAttrFillOpacity, rFillColor ); + AddColorAttr( aXMLAttrFill, "fill-opacity", rFillColor ); // Stroke - AddColorAttr( aXMLAttrStroke, aXMLAttrStrokeOpacity, rLineColor ); + AddColorAttr( "stroke", "stroke-opacity", rLineColor ); } @@ -321,9 +292,9 @@ void SVGAttributeWriter::AddGradientDef( const Rectangle& rObjRect, const Gradie mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrGradientUnits, "userSpaceOnUse" ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrCX, OUString::number( ImplRound( fCenterX ) ) ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrCY, OUString::number( ImplRound( fCenterY ) ) ); - mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrR, OUString::number( ImplRound( fRadius ) ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "r", OUString::number( ImplRound( fRadius ) ) ); - apGradient.reset( new SvXMLElementExport( mrExport, XML_NAMESPACE_NONE, aXMLElemRadialGradient, true, true ) ); + apGradient.reset( new SvXMLElementExport( mrExport, XML_NAMESPACE_NONE, "radialGradient", true, true ) ); // write stop values ImplGetColorStr( aEndColor, aColorStr ); @@ -1039,11 +1010,11 @@ bool SVGTextWriter::nextParagraph() for( sal_Int32 i = 0; i < nCount; ++i ) { const PropertyValue& rProp = pPropArray[i]; - if( rProp.Name == XML_UNO_NAME_NRULE_NUMBERINGTYPE ) + if( rProp.Name == "NumberingType" ) { rProp.Value >>= eType; } - else if( rProp.Name == XML_UNO_NAME_NRULE_BULLET_CHAR ) + else if( rProp.Name == "BulletChar" ) { OUString sValue; rProp.Value >>= sValue; @@ -1320,7 +1291,7 @@ void SVGTextWriter::startTextParagraph() sNumberingType = "number-style"; break; } - mrExport.AddAttribute( XML_NAMESPACE_NONE, aOOOAttrNumberingType, sNumberingType ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "ooo:numbering-type", sNumberingType ); mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "ListItem" ); } else @@ -1738,7 +1709,7 @@ void SVGTextWriter::implWriteTextPortion( const Point& rPos, SvXMLElementExport aSVGTspanElem( mrExport, XML_NAMESPACE_NONE, aXMLElemTspan, mbIWS, mbIWS ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrXLinkHRef, msUrl ); { - SvXMLElementExport aSVGAElem( mrExport, XML_NAMESPACE_NONE, aXMLElemA, mbIWS, mbIWS ); + SvXMLElementExport aSVGAElem( mrExport, XML_NAMESPACE_NONE, "a", mbIWS, mbIWS ); mrExport.GetDocHandler()->characters( rText ); } } @@ -1933,7 +1904,7 @@ void SVGActionWriter::ImplWriteLine( const Point& rPt1, const Point& rPt2, } { - SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemLine, true, true ); + SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, "line", true, true ); } } @@ -1955,7 +1926,7 @@ void SVGActionWriter::ImplWriteRect( const Rectangle& rRect, long nRadX, long nR if( nRadY ) mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrRY, OUString::number( ImplMap( nRadY ) ) ); - SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemRect, true, true ); + SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, "rect", true, true ); } @@ -1971,7 +1942,7 @@ void SVGActionWriter::ImplWriteEllipse( const Point& rCenter, long nRadX, long n mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrRY, OUString::number( ImplMap( nRadY ) ) ); { - SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemEllipse, true, true ); + SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, "ellipse", true, true ); } } @@ -2042,11 +2013,11 @@ void SVGActionWriter::ImplWritePolyPolygon( const tools::PolyPolygon& rPolyPoly, aPolyPoly = rPolyPoly; // add path data attribute - mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrD, GetPathString( aPolyPoly, bLineOnly ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "d", GetPathString( aPolyPoly, bLineOnly ) ); { // write polyline/polygon element - SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemPath, true, true ); + SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, "path", true, true ); } } @@ -2131,7 +2102,7 @@ void SVGActionWriter::ImplWriteShape( const SVGShapeDescriptor& rShape ) aDashArrayStr += OUString::number( nDash ); } - mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrStrokeDashArray, aDashArrayStr ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "stroke-dasharray", aDashArrayStr ); } ImplWritePolyPolygon( aPolyPoly, bLineOnly, false ); @@ -2147,8 +2118,8 @@ void SVGActionWriter::ImplCreateClipPathDef( const tools::PolyPolygon& rPolyPoly { mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrId, aClipPathId ); - mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrClipPathUnits, "userSpaceOnUse" ); - SvXMLElementExport aElemClipPath( mrExport, XML_NAMESPACE_NONE, aXMLElemClipPath, true, true ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "clipPathUnits", "userSpaceOnUse" ); + SvXMLElementExport aElemClipPath( mrExport, XML_NAMESPACE_NONE, "clipPath", true, true ); ImplWritePolyPolygon(rPolyPoly, false); } @@ -2162,7 +2133,7 @@ void SVGActionWriter::ImplStartClipRegion(sal_Int32 nClipPathId) return; OUString aUrl = OUStringLiteral("url(#") + aPrefixClipPathId + OUString::number( nClipPathId ) + ")"; - mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrClipPath, aUrl ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "clip-path", aUrl ); mpCurrentClipRegionElem.reset( new SvXMLElementExport( mrExport, XML_NAMESPACE_NONE, aXMLElemG, true, true ) ); } @@ -2210,10 +2181,10 @@ void SVGActionWriter::ImplWritePattern( const tools::PolyPolygon& rPolyPoly, mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrWidth, OUString::number( aRect.GetWidth() ) ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrHeight, OUString::number( aRect.GetHeight() ) ); - mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrPatternUnits, OUString( "userSpaceOnUse") ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "patternUnits", OUString( "userSpaceOnUse") ); { - SvXMLElementExport aElemPattern( mrExport, XML_NAMESPACE_NONE, aXMLElemPattern, true, true ); + SvXMLElementExport aElemPattern( mrExport, XML_NAMESPACE_NONE, "pattern", true, true ); // The origin of a pattern is positioned at (aRect.Left(), aRect.Top()). // So we need to adjust the pattern coordinate. @@ -2445,7 +2416,7 @@ void SVGActionWriter::ImplWriteMask( GDIMetaFile& rMtf, mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrId, aMaskId ); { - SvXMLElementExport aElemMask( mrExport, XML_NAMESPACE_NONE, aXMLElemMask, true, true ); + SvXMLElementExport aElemMask( mrExport, XML_NAMESPACE_NONE, "mask", true, true ); const tools::PolyPolygon aPolyPolygon( tools::PolyPolygon( Rectangle( rDestPt, rDestSize ) ) ); Gradient aGradient( rGradient ); @@ -2780,11 +2751,11 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx, mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrHeight, OUString::number( aSz.Height() ) ); // the image must be scaled to aSz in a non-uniform way - mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrPreserveAspectRatio, "none" ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "preserveAspectRatio", "none" ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrXLinkHRef, aBuffer.makeStringAndClear() ); { - SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemImage, true, true ); + SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, "image", true, true ); } } } |