xmloff/inc/txtfldi.hxx | 43 --- xmloff/inc/txtvfldi.hxx | 39 --- xmloff/source/draw/XMLImageMapContext.cxx | 41 --- xmloff/source/draw/sdxmlexp.cxx | 8 xmloff/source/draw/ximppage.cxx | 3 xmloff/source/draw/ximpshap.cxx | 6 xmloff/source/forms/elementimport.cxx | 2 xmloff/source/forms/formcellbinding.cxx | 2 xmloff/source/table/XMLTableImport.cxx | 3 xmloff/source/text/XMLAutoMarkFileContext.cxx | 5 xmloff/source/text/XMLAutoMarkFileContext.hxx | 3 xmloff/source/text/XMLFootnoteImportContext.cxx | 3 xmloff/source/text/XMLFootnoteImportContext.hxx | 2 xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx | 33 -- xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx | 12 xmloff/source/text/XMLIndexBibliographyEntryContext.cxx | 4 xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx | 8 xmloff/source/text/XMLIndexObjectSourceContext.cxx | 15 - xmloff/source/text/XMLIndexObjectSourceContext.hxx | 6 xmloff/source/text/XMLIndexSimpleEntryContext.cxx | 4 xmloff/source/text/XMLIndexSimpleEntryContext.hxx | 2 xmloff/source/text/XMLIndexSourceBaseContext.cxx | 6 xmloff/source/text/XMLIndexSourceBaseContext.hxx | 4 xmloff/source/text/XMLIndexSpanEntryContext.cxx | 4 xmloff/source/text/XMLIndexTOCContext.cxx | 6 xmloff/source/text/XMLIndexTOCContext.hxx | 3 xmloff/source/text/XMLIndexTOCSourceContext.cxx | 12 xmloff/source/text/XMLIndexTOCSourceContext.hxx | 5 xmloff/source/text/XMLIndexTOCStylesContext.cxx | 3 xmloff/source/text/XMLIndexTOCStylesContext.hxx | 2 xmloff/source/text/XMLIndexTabStopEntryContext.cxx | 8 xmloff/source/text/XMLIndexTableSourceContext.cxx | 9 xmloff/source/text/XMLIndexTableSourceContext.hxx | 4 xmloff/source/text/XMLIndexTemplateContext.cxx | 31 -- xmloff/source/text/XMLIndexTemplateContext.hxx | 26 -- xmloff/source/text/XMLIndexTitleTemplateContext.cxx | 6 xmloff/source/text/XMLIndexTitleTemplateContext.hxx | 4 xmloff/source/text/XMLIndexUserSourceContext.cxx | 24 - xmloff/source/text/XMLIndexUserSourceContext.hxx | 9 xmloff/source/text/XMLLineNumberingExport.cxx | 35 -- xmloff/source/text/XMLLineNumberingExport.hxx | 12 xmloff/source/text/XMLRedlineExport.cxx | 89 ++----- xmloff/source/text/XMLRedlineExport.hxx | 22 - xmloff/source/text/XMLSectionExport.cxx | 182 +++++---------- xmloff/source/text/XMLSectionExport.hxx | 62 ----- xmloff/source/text/XMLSectionImportContext.cxx | 21 - xmloff/source/text/XMLSectionImportContext.hxx | 8 xmloff/source/text/XMLSectionSourceDDEImportContext.cxx | 16 - xmloff/source/text/XMLSectionSourceDDEImportContext.hxx | 5 xmloff/source/text/XMLTextFrameContext.cxx | 97 ++----- xmloff/source/text/XMLTextNumRuleInfo.cxx | 50 +--- xmloff/source/text/XMLTextNumRuleInfo.hxx | 25 -- xmloff/source/text/txtfldi.cxx | 113 +++------ xmloff/source/text/txtparae.cxx | 4 xmloff/source/text/txtparai.cxx | 50 +--- xmloff/source/text/txtvfldi.cxx | 101 ++------ 56 files changed, 348 insertions(+), 954 deletions(-)
New commits: commit 06eb947c1651cb623cd60d81b08281de4cc6a86b Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Thu Dec 1 10:51:35 2016 +0200 inline some constant strings in xmloff (part1) Change-Id: I7971f210ffb30bdd80a1adde2c286b4d092bd053 Reviewed-on: https://gerrit.libreoffice.org/31433 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx index f818242..cc457c1 100644 --- a/xmloff/inc/txtfldi.hxx +++ b/xmloff/inc/txtfldi.hxx @@ -851,8 +851,6 @@ protected: /** import page variable fields (<text:get-page-variable>) */ class XMLPageVarGetFieldImportContext : public XMLTextFieldImportContext { - const OUString sPropertyNumberingType; - OUString sNumberFormat; OUString sLetterSync; @@ -878,9 +876,6 @@ protected: /** import page variable fields (<text:get-page-variable>) */ class XMLPageVarSetFieldImportContext : public XMLTextFieldImportContext { - const OUString sPropertyOn; - const OUString sPropertyOffset; - sal_Int16 nAdjust; bool bActive; @@ -904,10 +899,6 @@ protected: /** import macro fields (<text:execute-macro>) */ class XMLMacroFieldImportContext : public XMLTextFieldImportContext { - const OUString sPropertyHint; - const OUString sPropertyMacroName; - const OUString sPropertyScriptURL; - OUString sDescription; SvXMLImportContextRef xEventContext; @@ -941,11 +932,6 @@ protected: /** import reference fields (<text:reference-get>) */ class XMLReferenceFieldImportContext : public XMLTextFieldImportContext { - const OUString sPropertyReferenceFieldPart; - const OUString sPropertyReferenceFieldSource; - const OUString sPropertySourceName; - const OUString sPropertyCurrentPresentation; - OUString sName; sal_uInt16 nElementToken; sal_Int16 nSource; @@ -996,12 +982,6 @@ public: /** import dde field declaration (<text:dde-connection-decl>) */ class XMLDdeFieldDeclImportContext : public SvXMLImportContext { - const OUString sPropertyIsAutomaticUpdate; - const OUString sPropertyName; - const OUString sPropertyDDECommandType; - const OUString sPropertyDDECommandFile; - const OUString sPropertyDDECommandElement; - const SvXMLTokenMap& rTokenMap; public: @@ -1086,10 +1066,6 @@ public: /** import hyperlinks as URL fields (Calc, Impress, Draw) (<office:a>) */ class XMLUrlFieldImportContext : public XMLTextFieldImportContext { - const OUString sPropertyURL; - const OUString sPropertyTargetFrame; - const OUString sPropertyRepresentation; - OUString sURL; OUString sFrame; bool bFrameOK; @@ -1114,8 +1090,6 @@ protected: /** import bibliography info fields (<text:bibliography-mark>) */ class XMLBibliographyFieldImportContext : public XMLTextFieldImportContext { - const OUString sPropertyFields; - ::std::vector< css::beans::PropertyValue> aValues; public: @@ -1144,13 +1118,6 @@ protected: /** Import an annotation field (<text:annotation>) */ class XMLAnnotationImportContext : public XMLTextFieldImportContext { - const OUString sPropertyAuthor; - const OUString sPropertyInitials; - const OUString sPropertyContent; - const OUString sPropertyDate; - const OUString sPropertyTextRange; - const OUString sPropertyName; - OUStringBuffer aAuthorBuffer; OUStringBuffer aInitialsBuffer; OUString aName; @@ -1190,10 +1157,6 @@ protected: /** Import a script field (<text:script>) */ class XMLScriptImportContext : public XMLTextFieldImportContext { - const OUString sPropertyScriptType; - const OUString sPropertyURLContent; - const OUString sPropertyContent; - OUString sContent; OUString sScriptType; @@ -1251,12 +1214,6 @@ class XMLDropDownFieldImportContext : public XMLTextFieldImportContext bool bHelpOK; bool bHintOK; - const OUString sPropertyItems; - const OUString sPropertySelectedItem; - const OUString sPropertyName; - const OUString sPropertyHelp; - const OUString sPropertyToolTip; - public: XMLDropDownFieldImportContext(SvXMLImport& rImport, diff --git a/xmloff/inc/txtvfldi.hxx b/xmloff/inc/txtvfldi.hxx index ba7f633..c7a8dcd 100644 --- a/xmloff/inc/txtvfldi.hxx +++ b/xmloff/inc/txtvfldi.hxx @@ -33,12 +33,6 @@ /** helper class: parses value-type and associated value attributes */ class XMLValueImportHelper final { - - const OUString sPropertyContent; - const OUString sPropertyValue; - const OUString sPropertyNumberFormat; - const OUString sPropertyIsFixedLanguage; - SvXMLImport& rImport; XMLTextImportHelper& rHelper; @@ -116,15 +110,6 @@ public: */ class XMLVarFieldImportContext : public XMLTextFieldImportContext { -protected: - const OUString sPropertyContent; - const OUString sPropertyHint; - const OUString sPropertyHelp; - const OUString sPropertyTooltip; - const OUString sPropertyIsVisible; - const OUString sPropertyIsDisplayFormula; - const OUString sPropertyCurrentPresentation; - private: OUString sName; /// name attribute OUString sFormula; /// formula attribute @@ -214,11 +199,8 @@ protected: /** import expression fields (<text:expression>) */ class XMLExpressionFieldImportContext : public XMLVarFieldImportContext { - const OUString sPropertySubType; - public: - XMLExpressionFieldImportContext( SvXMLImport& rImport, /// XML Import XMLTextImportHelper& rHlp, /// Text import helper @@ -298,11 +280,8 @@ protected: /** import variable set fields (<text:variable-set>) */ class XMLVariableSetFieldImportContext : public XMLSetVarFieldImportContext { - const OUString sPropertySubType; - public: - XMLVariableSetFieldImportContext( SvXMLImport& rImport, /// XML Import XMLTextImportHelper& rHlp, /// Text import helper @@ -319,9 +298,6 @@ protected: /** variable input fields (<text:variable-input>) */ class XMLVariableInputFieldImportContext : public XMLSetVarFieldImportContext { - const OUString sPropertySubType; - const OUString sPropertyIsInput; - public: @@ -374,8 +350,6 @@ public: /** sequence fields (<text:sequence>) */ class XMLSequenceFieldImportContext : public XMLSetVarFieldImportContext { - const OUString sPropertyNumberFormat; - const OUString sPropertySequenceValue; OUString sNumFormat; OUString sNumFormatSync; OUString sRefName; @@ -434,11 +408,6 @@ public: */ class XMLVariableDeclImportContext : public SvXMLImportContext { - const OUString sPropertySubType; - const OUString sPropertyNumberingLevel; - const OUString sPropertyNumberingSeparator; - const OUString sPropertyIsExpression; - OUString sName; XMLValueImportHelper aValueHelper; sal_Int8 nNumLevel; @@ -467,9 +436,6 @@ public: /** import table formula fields (deprecated; for Writer 2.0 compatibility) */ class XMLTableFormulaImportContext : public XMLTextFieldImportContext { - const OUString sPropertyIsShowFormula; - const OUString sPropertyCurrentPresentation; - XMLValueImportHelper aValueHelper; bool bIsShowFormula; @@ -499,11 +465,6 @@ protected: /** import database display fields (<text:database-display>) */ class XMLDatabaseDisplayImportContext : public XMLDatabaseFieldImportContext { - const OUString sPropertyColumnName; - const OUString sPropertyDatabaseFormat; - const OUString sPropertyCurrentPresentation; - const OUString sPropertyIsVisible; - XMLValueImportHelper aValueHelper; OUString sColumnName; diff --git a/xmloff/source/draw/XMLImageMapContext.cxx b/xmloff/source/draw/XMLImageMapContext.cxx index 72adb5e..d7d967b 100644 --- a/xmloff/source/draw/XMLImageMapContext.cxx +++ b/xmloff/source/draw/XMLImageMapContext.cxx @@ -97,17 +97,6 @@ class XMLImageMapObjectContext : public SvXMLImportContext protected: - const OUString sBoundary; - const OUString sCenter; - const OUString sTitle; - const OUString sDescription; - const OUString sIsActive; - const OUString sName; - const OUString sPolygon; - const OUString sRadius; - const OUString sTarget; - const OUString sURL; - Reference<XIndexContainer> xImageMap; /// the image map Reference<XPropertySet> xMapEntry; /// one map-entry (one area) @@ -157,16 +146,6 @@ XMLImageMapObjectContext::XMLImageMapObjectContext( Reference<XIndexContainer> const & xMap, const sal_Char* pServiceName) : SvXMLImportContext(rImport, nPrefix, rLocalName), - sBoundary("Boundary"), - sCenter("Center"), - sTitle("Title"), - sDescription("Description"), - sIsActive("IsActive"), - sName("Name"), - sPolygon("Polygon"), - sRadius("Radius"), - sTarget("Target"), - sURL("URL"), xImageMap(xMap), bIsActive(true), bValid(false) @@ -285,12 +264,12 @@ void XMLImageMapObjectContext::ProcessAttribute( void XMLImageMapObjectContext::Prepare( Reference<XPropertySet> & rPropertySet) { - rPropertySet->setPropertyValue( sURL, Any( sUrl ) ); - rPropertySet->setPropertyValue( sTitle, Any( sTitleBuffer.makeStringAndClear() ) ); - rPropertySet->setPropertyValue( sDescription, Any( sDescriptionBuffer.makeStringAndClear() ) ); - rPropertySet->setPropertyValue( sTarget, Any( sTargt ) ); - rPropertySet->setPropertyValue( sIsActive, Any( bIsActive ) ); - rPropertySet->setPropertyValue( sName, Any( sNam ) ); + rPropertySet->setPropertyValue( "URL", Any( sUrl ) ); + rPropertySet->setPropertyValue( "Title", Any( sTitleBuffer.makeStringAndClear() ) ); + rPropertySet->setPropertyValue( "Description", Any( sDescriptionBuffer.makeStringAndClear() ) ); + rPropertySet->setPropertyValue( "Target", Any( sTargt ) ); + rPropertySet->setPropertyValue( "IsActive", Any( bIsActive ) ); + rPropertySet->setPropertyValue( "Name", Any( sNam ) ); } @@ -384,7 +363,7 @@ void XMLImageMapRectangleContext::ProcessAttribute( void XMLImageMapRectangleContext::Prepare( Reference<XPropertySet> & rPropertySet) { - rPropertySet->setPropertyValue( sBoundary, uno::Any(aRectangle) ); + rPropertySet->setPropertyValue( "Boundary", uno::Any(aRectangle) ); // common properties handled by super class XMLImageMapObjectContext::Prepare(rPropertySet); @@ -465,7 +444,7 @@ void XMLImageMapPolygonContext::Prepare(Reference<XPropertySet> & rPropertySet) { css::drawing::PointSequence aPointSequence; basegfx::tools::B2DPolygonToUnoPointSequence(aPolygon, aPointSequence); - rPropertySet->setPropertyValue(sPolygon, Any(aPointSequence)); + rPropertySet->setPropertyValue("Polygon", Any(aPointSequence)); } } @@ -556,9 +535,9 @@ void XMLImageMapCircleContext::Prepare( Reference<XPropertySet> & rPropertySet) { // center (x,y) - rPropertySet->setPropertyValue( sCenter, uno::Any(aCenter) ); + rPropertySet->setPropertyValue( "Center", uno::Any(aCenter) ); // radius - rPropertySet->setPropertyValue( sRadius, uno::Any(nRadius) ); + rPropertySet->setPropertyValue( "Radius", uno::Any(nRadius) ); // common properties handled by super class XMLImageMapObjectContext::Prepare(rPropertySet); diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index c884c84..1cf8042 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -414,8 +414,6 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent { SvXMLExport::setSourceDocument( xDoc ); - const OUString aEmpty; - // prepare factory parts mpSdPropHdlFactory = new XMLSdPropHdlFactory( GetModel(), *this ); @@ -465,7 +463,7 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent if(mxDocMasterPages.is()) { mnDocMasterPageCount = mxDocMasterPages->getCount(); - maMasterPagesStyleNames.insert( maMasterPagesStyleNames.begin(), mnDocMasterPageCount, aEmpty ); + maMasterPagesStyleNames.insert( maMasterPagesStyleNames.begin(), mnDocMasterPageCount, "" ); } } @@ -477,8 +475,8 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent if(mxDocDrawPages.is()) { mnDocDrawPageCount = mxDocDrawPages->getCount(); - maDrawPagesStyleNames.insert( maDrawPagesStyleNames.begin(), mnDocDrawPageCount, aEmpty ); - maDrawNotesPagesStyleNames.insert( maDrawNotesPagesStyleNames.begin(), mnDocDrawPageCount, aEmpty ); + maDrawPagesStyleNames.insert( maDrawPagesStyleNames.begin(), mnDocDrawPageCount, "" ); + maDrawNotesPagesStyleNames.insert( maDrawNotesPagesStyleNames.begin(), mnDocDrawPageCount, "" ); if( !mbIsDraw ) maDrawPagesAutoLayoutNames.realloc( mnDocDrawPageCount + 1 ); diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx index 4dfab9b..00a0125 100644 --- a/xmloff/source/draw/ximppage.cxx +++ b/xmloff/source/draw/ximppage.cxx @@ -182,10 +182,9 @@ void DrawAnnotationContext::EndElement() if(mxCursor.is()) { // delete addition newline - const OUString aEmpty; mxCursor->gotoEnd( false ); mxCursor->goLeft( 1, true ); - mxCursor->setString( aEmpty ); + mxCursor->setString( "" ); // reset cursor GetImport().GetTextImport()->ResetCursor(); diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 5c39e8f..8f997e5 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -346,10 +346,9 @@ void SdXMLShapeContext::EndElement() if(mxCursor.is()) { // delete addition newline - const OUString aEmpty; mxCursor->gotoEnd( false ); mxCursor->goLeft( 1, true ); - mxCursor->setString( aEmpty ); + mxCursor->setString( "" ); // reset cursor GetImport().GetTextImport()->ResetCursor(); @@ -2215,10 +2214,9 @@ void SdXMLMeasureShapeContext::EndElement() if( !xCursor.is() ) break; - const OUString aEmpty; xCursor->collapseToStart(); xCursor->goRight( 1, true ); - xCursor->setString( aEmpty ); + xCursor->setString( "" ); } while(false); diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index 00aca13..a733993 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -1471,7 +1471,7 @@ namespace xmloff struct EqualName : public ::std::unary_function< PropertyValue, bool > { - const OUString m_sName; + const OUString & m_sName; explicit EqualName( const OUString& _rName ) : m_sName( _rName ) { } inline bool operator()( const PropertyValue& _rProp ) diff --git a/xmloff/source/forms/formcellbinding.cxx b/xmloff/source/forms/formcellbinding.cxx index 493c0d5..06e4b50 100644 --- a/xmloff/source/forms/formcellbinding.cxx +++ b/xmloff/source/forms/formcellbinding.cxx @@ -83,7 +83,7 @@ namespace struct StringCompare : public ::std::unary_function< OUString, bool > { private: - const OUString m_sReference; + const OUString & m_sReference; public: explicit StringCompare( const OUString& _rReference ) : m_sReference( _rReference ) { } diff --git a/xmloff/source/table/XMLTableImport.cxx b/xmloff/source/table/XMLTableImport.cxx index 301a7f7..8e8db41 100644 --- a/xmloff/source/table/XMLTableImport.cxx +++ b/xmloff/source/table/XMLTableImport.cxx @@ -742,10 +742,9 @@ void XMLCellImportContext::EndElement() if(mxCursor.is()) { // delete addition newline - const OUString aEmpty; mxCursor->gotoEnd( false ); mxCursor->goLeft( 1, true ); - mxCursor->setString( aEmpty ); + mxCursor->setString( "" ); // reset cursor GetImport().GetTextImport()->ResetCursor(); diff --git a/xmloff/source/text/XMLAutoMarkFileContext.cxx b/xmloff/source/text/XMLAutoMarkFileContext.cxx index bbf03c0..cfbe93d 100644 --- a/xmloff/source/text/XMLAutoMarkFileContext.cxx +++ b/xmloff/source/text/XMLAutoMarkFileContext.cxx @@ -42,8 +42,7 @@ XMLAutoMarkFileContext::XMLAutoMarkFileContext( SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName) : - SvXMLImportContext(rImport, nPrefix, rLocalName), - sIndexAutoMarkFileURL("IndexAutoMarkFileURL") + SvXMLImportContext(rImport, nPrefix, rLocalName) { } @@ -74,7 +73,7 @@ void XMLAutoMarkFileContext::StartElement( GetImport().GetModel(), UNO_QUERY ); if (xPropertySet.is()) { - xPropertySet->setPropertyValue( sIndexAutoMarkFileURL, aAny ); + xPropertySet->setPropertyValue( "IndexAutoMarkFileURL", aAny ); } } } diff --git a/xmloff/source/text/XMLAutoMarkFileContext.hxx b/xmloff/source/text/XMLAutoMarkFileContext.hxx index 63f0cbf..71d00fc 100644 --- a/xmloff/source/text/XMLAutoMarkFileContext.hxx +++ b/xmloff/source/text/XMLAutoMarkFileContext.hxx @@ -32,11 +32,8 @@ namespace com { namespace sun { namespace star { class XMLAutoMarkFileContext : public SvXMLImportContext { - const OUString sIndexAutoMarkFileURL; - public: - XMLAutoMarkFileContext( SvXMLImport& rImport, sal_uInt16 nPrfx, diff --git a/xmloff/source/text/XMLFootnoteImportContext.cxx b/xmloff/source/text/XMLFootnoteImportContext.cxx index 49e4dca7..78721b6 100644 --- a/xmloff/source/text/XMLFootnoteImportContext.cxx +++ b/xmloff/source/text/XMLFootnoteImportContext.cxx @@ -65,7 +65,6 @@ XMLFootnoteImportContext::XMLFootnoteImportContext( sal_uInt16 nPrfx, const OUString& rLocalName ) : SvXMLImportContext(rImport, nPrfx, rLocalName) -, sPropertyReferenceId("ReferenceId") , mbListContextPushed(false) , rHelper(rHlp) { @@ -120,7 +119,7 @@ void XMLFootnoteImportContext::StartElement( { // get ID ... Reference<XPropertySet> xPropertySet(xTextContent, UNO_QUERY); - Any aAny =xPropertySet->getPropertyValue(sPropertyReferenceId); + Any aAny =xPropertySet->getPropertyValue("ReferenceId"); sal_Int16 nID = 0; aAny >>= nID; diff --git a/xmloff/source/text/XMLFootnoteImportContext.hxx b/xmloff/source/text/XMLFootnoteImportContext.hxx index 49b0f23..ff4f718 100644 --- a/xmloff/source/text/XMLFootnoteImportContext.hxx +++ b/xmloff/source/text/XMLFootnoteImportContext.hxx @@ -38,8 +38,6 @@ class XMLTextImportHelper; /// import footnote elements (<text:footnote>) class XMLFootnoteImportContext : public SvXMLImportContext { - const OUString sPropertyReferenceId; - /// old document cursor css::uno::Reference<css::text::XTextCursor> xOldCursor; diff --git a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx index eebcb95..584c676 100644 --- a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx +++ b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx @@ -52,17 +52,6 @@ XMLIndexAlphabeticalSourceContext::XMLIndexAlphabeticalSourceContext( const OUString& rLocalName, Reference<XPropertySet> & rPropSet) : XMLIndexSourceBaseContext(rImport, nPrfx, rLocalName, rPropSet, false) -, sMainEntryCharacterStyleName("MainEntryCharacterStyleName") -, sUseAlphabeticalSeparators("UseAlphabeticalSeparators") -, sUseCombinedEntries("UseCombinedEntries") -, sIsCaseSensitive("IsCaseSensitive") -, sUseKeyAsEntry("UseKeyAsEntry") -, sUseUpperCase("UseUpperCase") -, sUseDash("UseDash") -, sUsePP("UsePP") -, sIsCommaSeparated("IsCommaSeparated") -, sSortAlgorithm("SortAlgorithm") -, sLocale("Locale") , bMainEntryStyleNameOK(false) , bSeparators(false) , bCombineEntries(true) @@ -184,28 +173,28 @@ void XMLIndexAlphabeticalSourceContext::EndElement() { aAny <<= GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_TEXT, sMainEntryStyleName ); - rIndexPropertySet->setPropertyValue(sMainEntryCharacterStyleName,aAny); + rIndexPropertySet->setPropertyValue("MainEntryCharacterStyleName",aAny); } - rIndexPropertySet->setPropertyValue(sUseAlphabeticalSeparators, css::uno::Any(bSeparators)); - rIndexPropertySet->setPropertyValue(sUseCombinedEntries, css::uno::Any(bCombineEntries)); - rIndexPropertySet->setPropertyValue(sIsCaseSensitive, css::uno::Any(bCaseSensitive)); - rIndexPropertySet->setPropertyValue(sUseKeyAsEntry, css::uno::Any(bEntry)); - rIndexPropertySet->setPropertyValue(sUseUpperCase, css::uno::Any(bUpperCase)); - rIndexPropertySet->setPropertyValue(sUseDash, css::uno::Any(bCombineDash)); - rIndexPropertySet->setPropertyValue(sUsePP, css::uno::Any(bCombinePP)); - rIndexPropertySet->setPropertyValue(sIsCommaSeparated, css::uno::Any(bCommaSeparated)); + rIndexPropertySet->setPropertyValue("UseAlphabeticalSeparators", css::uno::Any(bSeparators)); + rIndexPropertySet->setPropertyValue("UseCombinedEntries", css::uno::Any(bCombineEntries)); + rIndexPropertySet->setPropertyValue("IsCaseSensitive", css::uno::Any(bCaseSensitive)); + rIndexPropertySet->setPropertyValue("UseKeyAsEntry", css::uno::Any(bEntry)); + rIndexPropertySet->setPropertyValue("UseUpperCase", css::uno::Any(bUpperCase)); + rIndexPropertySet->setPropertyValue("UseDash", css::uno::Any(bCombineDash)); + rIndexPropertySet->setPropertyValue("UsePP", css::uno::Any(bCombinePP)); + rIndexPropertySet->setPropertyValue("IsCommaSeparated", css::uno::Any(bCommaSeparated)); if (!sAlgorithm.isEmpty()) { - rIndexPropertySet->setPropertyValue(sSortAlgorithm, css::uno::Any(sAlgorithm)); + rIndexPropertySet->setPropertyValue("SortAlgorithm", css::uno::Any(sAlgorithm)); } if ( !maLanguageTagODF.isEmpty() ) { aAny <<= maLanguageTagODF.getLanguageTag().getLocale( false); - rIndexPropertySet->setPropertyValue(sLocale, aAny); + rIndexPropertySet->setPropertyValue("Locale", aAny); } XMLIndexSourceBaseContext::EndElement(); diff --git a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx index ea1fe72..062b0ba 100644 --- a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx +++ b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx @@ -37,18 +37,6 @@ namespace com { namespace sun { namespace star { */ class XMLIndexAlphabeticalSourceContext : public XMLIndexSourceBaseContext { - const OUString sMainEntryCharacterStyleName; - const OUString sUseAlphabeticalSeparators; - const OUString sUseCombinedEntries; - const OUString sIsCaseSensitive; - const OUString sUseKeyAsEntry; - const OUString sUseUpperCase; - const OUString sUseDash; - const OUString sUsePP; - const OUString sIsCommaSeparated; - const OUString sSortAlgorithm; - const OUString sLocale; - LanguageTagODF maLanguageTagODF; OUString sAlgorithm; diff --git a/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx b/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx index b580942..cd17da5 100644 --- a/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx +++ b/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx @@ -45,7 +45,7 @@ XMLIndexBibliographyEntryContext::XMLIndexBibliographyEntryContext( sal_uInt16 nPrfx, const OUString& rLocalName ) : XMLIndexSimpleEntryContext(rImport, - rTemplate.sTokenBibliographyDataField, + "TokenBibliographyDataField", rTemplate, nPrfx, rLocalName), nBibliographyInfo(BibliographyDataField::IDENTIFIER), @@ -154,7 +154,7 @@ void XMLIndexBibliographyEntryContext::FillPropertyValues( // bibliography data field sal_Int32 nIndex = bCharStyleNameOK ? 2 : 1; - rValues[nIndex].Name = rTemplateContext.sBibliographyDataField; + rValues[nIndex].Name = "BibliographyDataField"; rValues[nIndex].Value = css::uno::Any(nBibliographyInfo); } diff --git a/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx b/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx index c71cd9f..ce125aa 100644 --- a/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx +++ b/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx @@ -51,8 +51,8 @@ XMLIndexChapterInfoEntryContext::XMLIndexChapterInfoEntryContext( const OUString& rLocalName, bool bT ) : XMLIndexSimpleEntryContext(rImport, - (bT ? rTemplate.sTokenEntryNumber - : rTemplate.sTokenChapterInfo), + (bT ? OUString("TokenEntryNumber") + : OUString("TokenChapterInfo")), rTemplate, nPrfx, rLocalName), nChapterInfo(ChapterFormat::NAME_NUMBER), bChapterInfoOK(false), @@ -176,13 +176,13 @@ void XMLIndexChapterInfoEntryContext::FillPropertyValues( if( bChapterInfoOK ) { // chapter info field - rValues[nIndex].Name = rTemplateContext.sChapterFormat; + rValues[nIndex].Name = "ChapterFormat"; rValues[nIndex].Value = css::uno::Any(nChapterInfo); nIndex++; } if( bOutlineLevelOK ) { - rValues[nIndex].Name = rTemplateContext.sChapterLevel; + rValues[nIndex].Name = "ChapterLevel"; rValues[nIndex].Value = css::uno::Any(nOutlineLevel); } } diff --git a/xmloff/source/text/XMLIndexObjectSourceContext.cxx b/xmloff/source/text/XMLIndexObjectSourceContext.cxx index 75a5a0c..1b9ff89 100644 --- a/xmloff/source/text/XMLIndexObjectSourceContext.cxx +++ b/xmloff/source/text/XMLIndexObjectSourceContext.cxx @@ -54,11 +54,6 @@ XMLIndexObjectSourceContext::XMLIndexObjectSourceContext( Reference<XPropertySet> & rPropSet) : XMLIndexSourceBaseContext(rImport, nPrfx, rLocalName, rPropSet, false), - sCreateFromStarCalc("CreateFromStarCalc"), - sCreateFromStarChart("CreateFromStarChart"), - sCreateFromStarDraw("CreateFromStarDraw"), - sCreateFromStarMath("CreateFromStarMath"), - sCreateFromOtherEmbeddedObjects("CreateFromOtherEmbeddedObjects"), bUseCalc(false), bUseChart(false), bUseDraw(false), @@ -122,11 +117,11 @@ void XMLIndexObjectSourceContext::ProcessAttribute( void XMLIndexObjectSourceContext::EndElement() { - rIndexPropertySet->setPropertyValue(sCreateFromStarCalc, css::uno::Any(bUseCalc)); - rIndexPropertySet->setPropertyValue(sCreateFromStarChart, css::uno::Any(bUseChart)); - rIndexPropertySet->setPropertyValue(sCreateFromStarDraw, css::uno::Any(bUseDraw)); - rIndexPropertySet->setPropertyValue(sCreateFromStarMath, css::uno::Any(bUseMath)); - rIndexPropertySet->setPropertyValue(sCreateFromOtherEmbeddedObjects, css::uno::Any(bUseOtherObjects)); + rIndexPropertySet->setPropertyValue("CreateFromStarCalc", css::uno::Any(bUseCalc)); + rIndexPropertySet->setPropertyValue("CreateFromStarChart", css::uno::Any(bUseChart)); + rIndexPropertySet->setPropertyValue("CreateFromStarDraw", css::uno::Any(bUseDraw)); + rIndexPropertySet->setPropertyValue("CreateFromStarMath", css::uno::Any(bUseMath)); + rIndexPropertySet->setPropertyValue("CreateFromOtherEmbeddedObjects", css::uno::Any(bUseOtherObjects)); XMLIndexSourceBaseContext::EndElement(); } diff --git a/xmloff/source/text/XMLIndexObjectSourceContext.hxx b/xmloff/source/text/XMLIndexObjectSourceContext.hxx index 62a69a6..f37e66f 100644 --- a/xmloff/source/text/XMLIndexObjectSourceContext.hxx +++ b/xmloff/source/text/XMLIndexObjectSourceContext.hxx @@ -35,12 +35,6 @@ namespace com { namespace sun { namespace star { */ class XMLIndexObjectSourceContext : public XMLIndexSourceBaseContext { - const OUString sCreateFromStarCalc; - const OUString sCreateFromStarChart; - const OUString sCreateFromStarDraw; - const OUString sCreateFromStarMath; - const OUString sCreateFromOtherEmbeddedObjects; - bool bUseCalc; bool bUseChart; bool bUseDraw; diff --git a/xmloff/source/text/XMLIndexSimpleEntryContext.cxx b/xmloff/source/text/XMLIndexSimpleEntryContext.cxx index f31e387..f8e8d3e 100644 --- a/xmloff/source/text/XMLIndexSimpleEntryContext.cxx +++ b/xmloff/source/text/XMLIndexSimpleEntryContext.cxx @@ -107,13 +107,13 @@ void XMLIndexSimpleEntryContext::FillPropertyValues( Any aAny; // token type - rValues[0].Name = rTemplateContext.sTokenType; + rValues[0].Name = "TokenType"; rValues[0].Value = css::uno::Any(rEntryType); // char style if (bCharStyleNameOK) { - rValues[1].Name = rTemplateContext.sCharacterStyleName; + rValues[1].Name = "CharacterStyleName"; aAny <<= GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_TEXT, sCharStyleName ); diff --git a/xmloff/source/text/XMLIndexSimpleEntryContext.hxx b/xmloff/source/text/XMLIndexSimpleEntryContext.hxx index ee37478..4640f85 100644 --- a/xmloff/source/text/XMLIndexSimpleEntryContext.hxx +++ b/xmloff/source/text/XMLIndexSimpleEntryContext.hxx @@ -38,7 +38,7 @@ class XMLIndexSimpleEntryContext : public SvXMLImportContext { // entry type - const OUString& rEntryType; + const OUString rEntryType; protected: // character style diff --git a/xmloff/source/text/XMLIndexSourceBaseContext.cxx b/xmloff/source/text/XMLIndexSourceBaseContext.cxx index 52e679a..3aa829e 100644 --- a/xmloff/source/text/XMLIndexSourceBaseContext.cxx +++ b/xmloff/source/text/XMLIndexSourceBaseContext.cxx @@ -148,8 +148,6 @@ XMLIndexSourceBaseContext::XMLIndexSourceBaseContext( Reference<XPropertySet> & rPropSet, bool bLevelFormats) : SvXMLImportContext(rImport, nPrfx, rLocalName) -, sCreateFromChapter("CreateFromChapter") -, sIsRelativeTabstops("IsRelativeTabstops") , bUseLevelFormats(bLevelFormats) , bChapterIndex(false) , bRelativeTabs(true) @@ -213,8 +211,8 @@ void XMLIndexSourceBaseContext::ProcessAttribute( void XMLIndexSourceBaseContext::EndElement() { - rIndexPropertySet->setPropertyValue(sIsRelativeTabstops, css::uno::Any(bRelativeTabs)); - rIndexPropertySet->setPropertyValue(sCreateFromChapter, css::uno::Any(bChapterIndex)); + rIndexPropertySet->setPropertyValue("IsRelativeTabstops", css::uno::Any(bRelativeTabs)); + rIndexPropertySet->setPropertyValue("CreateFromChapter", css::uno::Any(bChapterIndex)); } SvXMLImportContext* XMLIndexSourceBaseContext::CreateChildContext( diff --git a/xmloff/source/text/XMLIndexSourceBaseContext.hxx b/xmloff/source/text/XMLIndexSourceBaseContext.hxx index 9500fbf..bbd827f 100644 --- a/xmloff/source/text/XMLIndexSourceBaseContext.hxx +++ b/xmloff/source/text/XMLIndexSourceBaseContext.hxx @@ -75,11 +75,7 @@ enum IndexSourceParamEnum */ class XMLIndexSourceBaseContext : public SvXMLImportContext { - const OUString sCreateFromChapter; - const OUString sIsRelativeTabstops; - bool bUseLevelFormats; - bool bChapterIndex; /// chapter-wise or document index? bool bRelativeTabs; /// tab stops relative to margin or indent? diff --git a/xmloff/source/text/XMLIndexSpanEntryContext.cxx b/xmloff/source/text/XMLIndexSpanEntryContext.cxx index d3bfef9..34e48d3 100644 --- a/xmloff/source/text/XMLIndexSpanEntryContext.cxx +++ b/xmloff/source/text/XMLIndexSpanEntryContext.cxx @@ -33,7 +33,7 @@ XMLIndexSpanEntryContext::XMLIndexSpanEntryContext( XMLIndexTemplateContext& rTemplate, sal_uInt16 nPrfx, const OUString& rLocalName ) : - XMLIndexSimpleEntryContext(rImport, rTemplate.sTokenText, + XMLIndexSimpleEntryContext(rImport, "TokenText", rTemplate, nPrfx, rLocalName) { nValues++; // one more for the text string @@ -57,7 +57,7 @@ void XMLIndexSpanEntryContext::FillPropertyValues( // content Any aAny; aAny <<= sContent.makeStringAndClear(); - rValues[nValues-1].Name = rTemplateContext.sText; + rValues[nValues-1].Name = "Text"; rValues[nValues-1].Value = aAny; } diff --git a/xmloff/source/text/XMLIndexTOCContext.cxx b/xmloff/source/text/XMLIndexTOCContext.cxx index d7bd6c2..b9c6215 100644 --- a/xmloff/source/text/XMLIndexTOCContext.cxx +++ b/xmloff/source/text/XMLIndexTOCContext.cxx @@ -96,8 +96,6 @@ SvXMLEnumMapEntry const aIndexTypeMap[] = XMLIndexTOCContext::XMLIndexTOCContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName) : SvXMLImportContext(rImport, nPrfx, rLocalName) - , sIsProtected("IsProtected") - , sName("Name") , eIndexType(TEXT_INDEX_UNKNOWN) , bValid(false) { @@ -240,11 +238,11 @@ void XMLIndexTOCContext::StartElement( pStyle->FillPropertySet( xTOCPropertySet ); } - xTOCPropertySet->setPropertyValue( sIsProtected, Any(bProtected) ); + xTOCPropertySet->setPropertyValue( "IsProtected", Any(bProtected) ); if (!sIndexName.isEmpty()) { - xTOCPropertySet->setPropertyValue( sName, Any(sIndexName) ); + xTOCPropertySet->setPropertyValue( "Name", Any(sIndexName) ); } } } diff --git a/xmloff/source/text/XMLIndexTOCContext.hxx b/xmloff/source/text/XMLIndexTOCContext.hxx index 46399c5..beaf17b 100644 --- a/xmloff/source/text/XMLIndexTOCContext.hxx +++ b/xmloff/source/text/XMLIndexTOCContext.hxx @@ -54,9 +54,6 @@ enum IndexTypeEnum */ class XMLIndexTOCContext : public SvXMLImportContext { - const OUString sIsProtected; - const OUString sName; - /** XPropertySet of the index */ css::uno::Reference<css::beans::XPropertySet> xTOCPropertySet; diff --git a/xmloff/source/text/XMLIndexTOCSourceContext.cxx b/xmloff/source/text/XMLIndexTOCSourceContext.cxx index 60ea983..c95ff0d 100644 --- a/xmloff/source/text/XMLIndexTOCSourceContext.cxx +++ b/xmloff/source/text/XMLIndexTOCSourceContext.cxx @@ -46,10 +46,6 @@ XMLIndexTOCSourceContext::XMLIndexTOCSourceContext( const OUString& rLocalName, Reference<XPropertySet> & rPropSet) : XMLIndexSourceBaseContext(rImport, nPrfx, rLocalName, rPropSet, true) -, sCreateFromMarks("CreateFromMarks") -, sLevel("Level") -, sCreateFromOutline("CreateFromOutline") -, sCreateFromLevelParagraphStyles("CreateFromLevelParagraphStyles") // use all chapters by default , nOutlineLevel(rImport.GetTextImport()->GetChapterNumbering()->getCount()) , bUseOutline(true) @@ -129,11 +125,11 @@ void XMLIndexTOCSourceContext::ProcessAttribute( void XMLIndexTOCSourceContext::EndElement() { - rIndexPropertySet->setPropertyValue(sCreateFromMarks, css::uno::Any(bUseMarks)); - rIndexPropertySet->setPropertyValue(sCreateFromOutline, css::uno::Any(bUseOutline)); - rIndexPropertySet->setPropertyValue(sCreateFromLevelParagraphStyles, css::uno::Any(bUseParagraphStyles)); + rIndexPropertySet->setPropertyValue("CreateFromMarks", css::uno::Any(bUseMarks)); + rIndexPropertySet->setPropertyValue("CreateFromOutline", css::uno::Any(bUseOutline)); + rIndexPropertySet->setPropertyValue("CreateFromLevelParagraphStyles", css::uno::Any(bUseParagraphStyles)); - rIndexPropertySet->setPropertyValue(sLevel, css::uno::Any((sal_Int16)nOutlineLevel)); + rIndexPropertySet->setPropertyValue("Level", css::uno::Any((sal_Int16)nOutlineLevel)); // process common attributes XMLIndexSourceBaseContext::EndElement(); diff --git a/xmloff/source/text/XMLIndexTOCSourceContext.hxx b/xmloff/source/text/XMLIndexTOCSourceContext.hxx index d259ee2..c6268af 100644 --- a/xmloff/source/text/XMLIndexTOCSourceContext.hxx +++ b/xmloff/source/text/XMLIndexTOCSourceContext.hxx @@ -35,11 +35,6 @@ namespace com { namespace sun { namespace star { */ class XMLIndexTOCSourceContext : public XMLIndexSourceBaseContext { - const OUString sCreateFromMarks; - const OUString sLevel; - const OUString sCreateFromOutline; - const OUString sCreateFromLevelParagraphStyles; - sal_Int32 nOutlineLevel; bool bUseOutline; bool bUseMarks; diff --git a/xmloff/source/text/XMLIndexTOCStylesContext.cxx b/xmloff/source/text/XMLIndexTOCStylesContext.cxx index db8048f..eaee15c 100644 --- a/xmloff/source/text/XMLIndexTOCStylesContext.cxx +++ b/xmloff/source/text/XMLIndexTOCStylesContext.cxx @@ -46,7 +46,6 @@ XMLIndexTOCStylesContext::XMLIndexTOCStylesContext( SvXMLImport& rImport, Reference<XPropertySet> & rPropSet, sal_uInt16 nPrfx, const OUString& rLocalName) : SvXMLImportContext(rImport, nPrfx, rLocalName) - , sLevelParagraphStyles("LevelParagraphStyles") , rTOCPropertySet(rPropSet) , nOutlineLevel(0) { @@ -99,7 +98,7 @@ void XMLIndexTOCStylesContext::EndElement() } // get index replace - Any aAny = rTOCPropertySet->getPropertyValue(sLevelParagraphStyles); + Any aAny = rTOCPropertySet->getPropertyValue("LevelParagraphStyles"); Reference<XIndexReplace> xIndexReplace; aAny >>= xIndexReplace; diff --git a/xmloff/source/text/XMLIndexTOCStylesContext.hxx b/xmloff/source/text/XMLIndexTOCStylesContext.hxx index 3a83186..347875d 100644 --- a/xmloff/source/text/XMLIndexTOCStylesContext.hxx +++ b/xmloff/source/text/XMLIndexTOCStylesContext.hxx @@ -42,8 +42,6 @@ namespace com { namespace sun { namespace star { */ class XMLIndexTOCStylesContext : public SvXMLImportContext { - const OUString sLevelParagraphStyles; - /// XPropertySet of the index css::uno::Reference<css::beans::XPropertySet> & rTOCPropertySet; diff --git a/xmloff/source/text/XMLIndexTabStopEntryContext.cxx b/xmloff/source/text/XMLIndexTabStopEntryContext.cxx index b0f0334..12d9d46 100644 --- a/xmloff/source/text/XMLIndexTabStopEntryContext.cxx +++ b/xmloff/source/text/XMLIndexTabStopEntryContext.cxx @@ -46,7 +46,7 @@ XMLIndexTabStopEntryContext::XMLIndexTabStopEntryContext( XMLIndexTemplateContext& rTemplate, sal_uInt16 nPrfx, const OUString& rLocalName ) : - XMLIndexSimpleEntryContext(rImport, rTemplate.sTokenTabStop, + XMLIndexSimpleEntryContext(rImport, "TokenTabStop", rTemplate, nPrfx, rLocalName), sLeaderChar(), nTabPosition(0), @@ -128,14 +128,14 @@ void XMLIndexTabStopEntryContext::FillPropertyValues( PropertyValue* pValues = rValues.getArray(); // right aligned? - pValues[nNextEntry].Name = rTemplateContext.sTabStopRightAligned; + pValues[nNextEntry].Name = "TabStopRightAligned"; pValues[nNextEntry].Value <<= bTabRightAligned; nNextEntry++; // position if (bTabPositionOK) { - pValues[nNextEntry].Name = rTemplateContext.sTabStopPosition; + pValues[nNextEntry].Name = "TabStopPosition"; pValues[nNextEntry].Value <<= nTabPosition; nNextEntry++; } @@ -143,7 +143,7 @@ void XMLIndexTabStopEntryContext::FillPropertyValues( // leader char if (bLeaderCharOK) { - pValues[nNextEntry].Name = rTemplateContext.sTabStopFillCharacter; + pValues[nNextEntry].Name = "TabStopFillCharacter"; pValues[nNextEntry].Value <<= sLeaderChar; nNextEntry++; } diff --git a/xmloff/source/text/XMLIndexTableSourceContext.cxx b/xmloff/source/text/XMLIndexTableSourceContext.cxx index d42c905..8c5f01e 100644 --- a/xmloff/source/text/XMLIndexTableSourceContext.cxx +++ b/xmloff/source/text/XMLIndexTableSourceContext.cxx @@ -52,9 +52,6 @@ XMLIndexTableSourceContext::XMLIndexTableSourceContext( const OUString& rLocalName, Reference<XPropertySet> & rPropSet) : XMLIndexSourceBaseContext(rImport, nPrfx, rLocalName, rPropSet, false) - , sCreateFromLabels("CreateFromLabels") - , sLabelCategory("LabelCategory") - , sLabelDisplayType("LabelDisplayType") , nDisplayFormat(0) , bSequenceOK(false) , bDisplayFormatOK(false) @@ -121,16 +118,16 @@ void XMLIndexTableSourceContext::ProcessAttribute( void XMLIndexTableSourceContext::EndElement() { - rIndexPropertySet->setPropertyValue(sCreateFromLabels, css::uno::Any(bUseCaption)); + rIndexPropertySet->setPropertyValue("CreateFromLabels", css::uno::Any(bUseCaption)); if (bSequenceOK) { - rIndexPropertySet->setPropertyValue(sLabelCategory, css::uno::Any(sSequence)); + rIndexPropertySet->setPropertyValue("LabelCategory", css::uno::Any(sSequence)); } if (bDisplayFormatOK) { - rIndexPropertySet->setPropertyValue(sLabelDisplayType, css::uno::Any(nDisplayFormat)); + rIndexPropertySet->setPropertyValue("LabelDisplayType", css::uno::Any(nDisplayFormat)); } XMLIndexSourceBaseContext::EndElement(); diff --git a/xmloff/source/text/XMLIndexTableSourceContext.hxx b/xmloff/source/text/XMLIndexTableSourceContext.hxx index 511dd30..a61dc4d 100644 --- a/xmloff/source/text/XMLIndexTableSourceContext.hxx +++ b/xmloff/source/text/XMLIndexTableSourceContext.hxx @@ -35,10 +35,6 @@ namespace com { namespace sun { namespace star { */ class XMLIndexTableSourceContext : public XMLIndexSourceBaseContext { - const OUString sCreateFromLabels; - const OUString sLabelCategory; - const OUString sLabelDisplayType; - OUString sSequence; sal_Int16 nDisplayFormat; diff --git a/xmloff/source/text/XMLIndexTemplateContext.cxx b/xmloff/source/text/XMLIndexTemplateContext.cxx index d41d2f1..a2c04280 100644 --- a/xmloff/source/text/XMLIndexTemplateContext.cxx +++ b/xmloff/source/text/XMLIndexTemplateContext.cxx @@ -67,27 +67,6 @@ XMLIndexTemplateContext::XMLIndexTemplateContext( , bOutlineLevelOK(false) , bTOC( bT ) , rPropertySet(rPropSet) -, sTokenEntryNumber("TokenEntryNumber") -, sTokenEntryText("TokenEntryText") -, sTokenTabStop("TokenTabStop") -, sTokenText("TokenText") -, sTokenPageNumber("TokenPageNumber") -, sTokenChapterInfo("TokenChapterInfo") -, sTokenHyperlinkStart("TokenHyperlinkStart") -, sTokenHyperlinkEnd("TokenHyperlinkEnd") -, sTokenBibliographyDataField("TokenBibliographyDataField") - -, sCharacterStyleName("CharacterStyleName") -, sTokenType("TokenType") -, sText("Text") -, sTabStopRightAligned("TabStopRightAligned") -, sTabStopPosition("TabStopPosition") -, sTabStopFillCharacter("TabStopFillCharacter") -, sBibliographyDataField("BibliographyDataField") -, sChapterFormat("ChapterFormat") -, sChapterLevel("ChapterLevel") //#i53420 - -, sLevelFormat("LevelFormat") { DBG_ASSERT( ((XML_TOKEN_INVALID != eLevelAttrName) && (nullptr != pLevelNameMap)) || ((XML_TOKEN_INVALID == eLevelAttrName) && (nullptr == pLevelNameMap)), @@ -170,7 +149,7 @@ void XMLIndexTemplateContext::EndElement() } // get LevelFormat IndexReplace ... - Any aAny = rPropertySet->getPropertyValue(sLevelFormat); + Any aAny = rPropertySet->getPropertyValue("LevelFormat"); Reference<XIndexReplace> xIndexReplace; aAny >>= xIndexReplace; @@ -251,25 +230,25 @@ SvXMLImportContext *XMLIndexTemplateContext::CreateChildContext( { case XML_TOK_INDEX_TYPE_ENTRY_TEXT: pContext = new XMLIndexSimpleEntryContext( - GetImport(), sTokenEntryText, *this, + GetImport(), "TokenEntryText", *this, nPrefix, rLocalName); break; case XML_TOK_INDEX_TYPE_PAGE_NUMBER: pContext = new XMLIndexSimpleEntryContext( - GetImport(), sTokenPageNumber, *this, + GetImport(), "TokenPageNumber", *this, nPrefix, rLocalName); break; case XML_TOK_INDEX_TYPE_LINK_START: pContext = new XMLIndexSimpleEntryContext( - GetImport(), sTokenHyperlinkStart, *this, + GetImport(), "TokenHyperlinkStart", *this, nPrefix, rLocalName); break; case XML_TOK_INDEX_TYPE_LINK_END: pContext = new XMLIndexSimpleEntryContext( - GetImport(), sTokenHyperlinkEnd, *this, + GetImport(), "TokenHyperlinkEnd", *this, nPrefix, rLocalName); break; diff --git a/xmloff/source/text/XMLIndexTemplateContext.hxx b/xmloff/source/text/XMLIndexTemplateContext.hxx index a56daa8..084e865 100644 --- a/xmloff/source/text/XMLIndexTemplateContext.hxx +++ b/xmloff/source/text/XMLIndexTemplateContext.hxx @@ -83,32 +83,6 @@ class XMLIndexTemplateContext : public SvXMLImportContext css::uno::Reference<css::beans::XPropertySet> & rPropertySet; public: - - // constants made available to other contexts (template entry - // contexts, in particular) - const OUString sTokenEntryNumber; - const OUString sTokenEntryText; - const OUString sTokenTabStop; - const OUString sTokenText; - const OUString sTokenPageNumber; - const OUString sTokenChapterInfo; - const OUString sTokenHyperlinkStart; - const OUString sTokenHyperlinkEnd; - const OUString sTokenBibliographyDataField; - - const OUString sCharacterStyleName; - const OUString sTokenType; - const OUString sText; - const OUString sTabStopRightAligned; - const OUString sTabStopPosition; - const OUString sTabStopFillCharacter; - const OUString sBibliographyDataField; - const OUString sChapterFormat; - const OUString sChapterLevel;//i53420 - - const OUString sLevelFormat; - - XMLIndexTemplateContext( SvXMLImport& rImport, css::uno::Reference<css::beans::XPropertySet> & rPropSet, diff --git a/xmloff/source/text/XMLIndexTitleTemplateContext.cxx b/xmloff/source/text/XMLIndexTitleTemplateContext.cxx index 4530be7..2b05e69 100644 --- a/xmloff/source/text/XMLIndexTitleTemplateContext.cxx +++ b/xmloff/source/text/XMLIndexTitleTemplateContext.cxx @@ -39,8 +39,6 @@ XMLIndexTitleTemplateContext::XMLIndexTitleTemplateContext( sal_uInt16 nPrfx, const OUString& rLocalName) : SvXMLImportContext(rImport, nPrfx, rLocalName) -, sTitle("Title") -, sParaStyleHeading("ParaStyleHeading") , bStyleNameOK(false) , rTOCPropertySet(rPropSet) { @@ -80,14 +78,14 @@ void XMLIndexTitleTemplateContext::EndElement() Any aAny; aAny <<= sContent.makeStringAndClear(); - rTOCPropertySet->setPropertyValue(sTitle, aAny); + rTOCPropertySet->setPropertyValue("Title", aAny); if (bStyleNameOK) { aAny <<= GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH, sStyleName ); - rTOCPropertySet->setPropertyValue(sParaStyleHeading, aAny); + rTOCPropertySet->setPropertyValue("ParaStyleHeading", aAny); } } diff --git a/xmloff/source/text/XMLIndexTitleTemplateContext.hxx b/xmloff/source/text/XMLIndexTitleTemplateContext.hxx index 9299c08..e91cfee 100644 --- a/xmloff/source/text/XMLIndexTitleTemplateContext.hxx +++ b/xmloff/source/text/XMLIndexTitleTemplateContext.hxx @@ -37,10 +37,6 @@ namespace com { namespace sun { namespace star { */ class XMLIndexTitleTemplateContext : public SvXMLImportContext { - - const OUString sTitle; - const OUString sParaStyleHeading; - // paragraph style OUString sStyleName; bool bStyleNameOK; diff --git a/xmloff/source/text/XMLIndexUserSourceContext.cxx b/xmloff/source/text/XMLIndexUserSourceContext.cxx index 5dcd270..c81dfeb 100644 --- a/xmloff/source/text/XMLIndexUserSourceContext.cxx +++ b/xmloff/source/text/XMLIndexUserSourceContext.cxx @@ -48,14 +48,6 @@ XMLIndexUserSourceContext::XMLIndexUserSourceContext( Reference<XPropertySet> & rPropSet) : XMLIndexSourceBaseContext(rImport, nPrfx, rLocalName, rPropSet, true), - sCreateFromEmbeddedObjects("CreateFromEmbeddedObjects"), - sCreateFromGraphicObjects("CreateFromGraphicObjects"), - sCreateFromMarks("CreateFromMarks"), - sCreateFromTables("CreateFromTables"), - sCreateFromTextFrames("CreateFromTextFrames"), - sUseLevelFromSource("UseLevelFromSource"), - sCreateFromLevelParagraphStyles("CreateFromLevelParagraphStyles"), - sUserIndexName("UserIndexName"), bUseObjects(false), bUseGraphic(false), bUseMarks(false), @@ -140,17 +132,17 @@ void XMLIndexUserSourceContext::ProcessAttribute( void XMLIndexUserSourceContext::EndElement() { - rIndexPropertySet->setPropertyValue(sCreateFromEmbeddedObjects, css::uno::Any(bUseObjects)); - rIndexPropertySet->setPropertyValue(sCreateFromGraphicObjects, css::uno::Any(bUseGraphic)); - rIndexPropertySet->setPropertyValue(sUseLevelFromSource, css::uno::Any(bUseLevelFromSource)); - rIndexPropertySet->setPropertyValue(sCreateFromMarks, css::uno::Any(bUseMarks)); - rIndexPropertySet->setPropertyValue(sCreateFromTables, css::uno::Any(bUseTables)); - rIndexPropertySet->setPropertyValue(sCreateFromTextFrames, css::uno::Any(bUseFrames)); - rIndexPropertySet->setPropertyValue(sCreateFromLevelParagraphStyles, css::uno::Any(bUseLevelParagraphStyles)); + rIndexPropertySet->setPropertyValue("CreateFromEmbeddedObjects", css::uno::Any(bUseObjects)); + rIndexPropertySet->setPropertyValue("CreateFromGraphicObjects", css::uno::Any(bUseGraphic)); + rIndexPropertySet->setPropertyValue("UseLevelFromSource", css::uno::Any(bUseLevelFromSource)); + rIndexPropertySet->setPropertyValue("CreateFromMarks", css::uno::Any(bUseMarks)); + rIndexPropertySet->setPropertyValue("CreateFromTables", css::uno::Any(bUseTables)); + rIndexPropertySet->setPropertyValue("CreateFromTextFrames", css::uno::Any(bUseFrames)); + rIndexPropertySet->setPropertyValue("CreateFromLevelParagraphStyles", css::uno::Any(bUseLevelParagraphStyles)); if( !sIndexName.isEmpty() ) { - rIndexPropertySet->setPropertyValue(sUserIndexName, css::uno::Any(sIndexName)); + rIndexPropertySet->setPropertyValue("UserIndexName", css::uno::Any(sIndexName)); } XMLIndexSourceBaseContext::EndElement(); diff --git a/xmloff/source/text/XMLIndexUserSourceContext.hxx b/xmloff/source/text/XMLIndexUserSourceContext.hxx index 21bd226..1016cee 100644 --- a/xmloff/source/text/XMLIndexUserSourceContext.hxx +++ b/xmloff/source/text/XMLIndexUserSourceContext.hxx @@ -35,15 +35,6 @@ namespace com { namespace sun { namespace star { */ class XMLIndexUserSourceContext : public XMLIndexSourceBaseContext { - const OUString sCreateFromEmbeddedObjects; - const OUString sCreateFromGraphicObjects; - const OUString sCreateFromMarks; - const OUString sCreateFromTables; - const OUString sCreateFromTextFrames; - const OUString sUseLevelFromSource; - const OUString sCreateFromLevelParagraphStyles; - const OUString sUserIndexName; - bool bUseObjects; bool bUseGraphic; bool bUseMarks; diff --git a/xmloff/source/text/XMLLineNumberingExport.cxx b/xmloff/source/text/XMLLineNumberingExport.cxx index 95c826a..93f808e 100644 --- a/xmloff/source/text/XMLLineNumberingExport.cxx +++ b/xmloff/source/text/XMLLineNumberingExport.cxx @@ -39,18 +39,7 @@ using ::com::sun::star::text::XLineNumberingProperties; XMLLineNumberingExport::XMLLineNumberingExport(SvXMLExport& rExp) -: sCharStyleName("CharStyleName") -, sCountEmptyLines("CountEmptyLines") -, sCountLinesInFrames("CountLinesInFrames") -, sDistance("Distance") -, sInterval("Interval") -, sSeparatorText("SeparatorText") -, sNumberPosition("NumberPosition") -, sNumberingType("NumberingType") -, sIsOn("IsOn") -, sRestartAtEachPage("RestartAtEachPage") -, sSeparatorInterval("SeparatorInterval") -, rExport(rExp) +: rExport(rExp) { } @@ -79,7 +68,7 @@ void XMLLineNumberingExport::Export() Any aAny; // char style - aAny = xLineNumbering->getPropertyValue(sCharStyleName); + aAny = xLineNumbering->getPropertyValue("CharStyleName"); OUString sTmp; aAny >>= sTmp; if (!sTmp.isEmpty()) @@ -89,7 +78,7 @@ void XMLLineNumberingExport::Export() } // enable - aAny = xLineNumbering->getPropertyValue(sIsOn); + aAny = xLineNumbering->getPropertyValue("IsOn"); if (! *o3tl::doAccess<bool>(aAny)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, @@ -97,7 +86,7 @@ void XMLLineNumberingExport::Export() } // count empty lines - aAny = xLineNumbering->getPropertyValue(sCountEmptyLines); + aAny = xLineNumbering->getPropertyValue("CountEmptyLines"); if (! *o3tl::doAccess<bool>(aAny)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, @@ -105,7 +94,7 @@ void XMLLineNumberingExport::Export() } // count in frames - aAny = xLineNumbering->getPropertyValue(sCountLinesInFrames); + aAny = xLineNumbering->getPropertyValue("CountLinesInFrames"); if (*o3tl::doAccess<bool>(aAny)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, @@ -113,7 +102,7 @@ void XMLLineNumberingExport::Export() } // restart numbering - aAny = xLineNumbering->getPropertyValue(sRestartAtEachPage); + aAny = xLineNumbering->getPropertyValue("RestartAtEachPage"); if (*o3tl::doAccess<bool>(aAny)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, @@ -121,7 +110,7 @@ void XMLLineNumberingExport::Export() } // Distance - aAny = xLineNumbering->getPropertyValue(sDistance); + aAny = xLineNumbering->getPropertyValue("Distance"); sal_Int32 nLength = 0; aAny >>= nLength; if (nLength != 0) @@ -135,7 +124,7 @@ void XMLLineNumberingExport::Export() // NumeringType OUStringBuffer sNumPosBuf; - aAny = xLineNumbering->getPropertyValue(sNumberingType); + aAny = xLineNumbering->getPropertyValue("NumberingType"); sal_Int16 nFormat = 0; aAny >>= nFormat; rExport.GetMM100UnitConverter().convertNumFormat( sNumPosBuf, nFormat ); @@ -150,7 +139,7 @@ void XMLLineNumberingExport::Export() } // number position - aAny = xLineNumbering->getPropertyValue(sNumberPosition); + aAny = xLineNumbering->getPropertyValue("NumberPosition"); sal_Int16 nPosition = 0; aAny >>= nPosition; if (SvXMLUnitConverter::convertEnum(sNumPosBuf, nPosition, @@ -161,7 +150,7 @@ void XMLLineNumberingExport::Export() } // sInterval - aAny = xLineNumbering->getPropertyValue(sInterval); + aAny = xLineNumbering->getPropertyValue("Interval"); sal_Int16 nLineInterval = 0; aAny >>= nLineInterval; OUStringBuffer sBuf; @@ -175,14 +164,14 @@ void XMLLineNumberingExport::Export() true, true); // line separator - aAny = xLineNumbering->getPropertyValue(sSeparatorText); + aAny = xLineNumbering->getPropertyValue("SeparatorText"); OUString sSeparator; aAny >>= sSeparator; if (!sSeparator.isEmpty()) { // SeparatorInterval - aAny = xLineNumbering->getPropertyValue(sSeparatorInterval); + aAny = xLineNumbering->getPropertyValue("SeparatorInterval"); sal_Int16 nLineDistance = 0; aAny >>= nLineDistance; ::sax::Converter::convertNumber(sBuf, diff --git a/xmloff/source/text/XMLLineNumberingExport.hxx b/xmloff/source/text/XMLLineNumberingExport.hxx index 640404af..b078feb 100644 --- a/xmloff/source/text/XMLLineNumberingExport.hxx +++ b/xmloff/source/text/XMLLineNumberingExport.hxx @@ -28,18 +28,6 @@ class SvXMLExport; /** export <text:linenumbering-configuration> and its child elements */ class XMLLineNumberingExport { - const OUString sCharStyleName; - const OUString sCountEmptyLines; - const OUString sCountLinesInFrames; - const OUString sDistance; - const OUString sInterval; - const OUString sSeparatorText; - const OUString sNumberPosition; - const OUString sNumberingType; - const OUString sIsOn; - const OUString sRestartAtEachPage; - const OUString sSeparatorInterval; - SvXMLExport& rExport; public: diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx index baf0d6d..d619e8b 100644 --- a/xmloff/source/text/XMLRedlineExport.cxx +++ b/xmloff/source/text/XMLRedlineExport.cxx @@ -60,28 +60,9 @@ using ::std::list; XMLRedlineExport::XMLRedlineExport(SvXMLExport& rExp) -: sDelete("Delete") -, sDeletion(GetXMLToken(XML_DELETION)) -, sFormat("Format") +: sDeletion(GetXMLToken(XML_DELETION)) , sFormatChange(GetXMLToken(XML_FORMAT_CHANGE)) -, sInsert("Insert") , sInsertion(GetXMLToken(XML_INSERTION)) -, sIsCollapsed("IsCollapsed") -, sIsStart("IsStart") -, sRedlineAuthor("RedlineAuthor") -, sRedlineComment("RedlineComment") -, sRedlineDateTime("RedlineDateTime") -, sRedlineSuccessorData("RedlineSuccessorData") -, sRedlineText("RedlineText") -, sRedlineType("RedlineType") -, sUnknownChange("UnknownChange") -, sStartRedline("StartRedline") -, sEndRedline("EndRedline") -, sRedlineIdentifier("RedlineIdentifier") -, sIsInHeaderFooter("IsInHeaderFooter") -, sRecordChanges("RecordChanges") -, sMergeLastPara("MergeLastPara") -, sChangePrefix("ct") , rExport(rExp) , pCurrentChangesList(nullptr) { @@ -215,7 +196,7 @@ void XMLRedlineExport::ExportChangesListElements() uno::UNO_QUERY ); // redlining enabled? bool bEnabled = *o3tl::doAccess<bool>(aDocPropertySet->getPropertyValue( - sRecordChanges )); + "RecordChanges" )); // only export if we have redlines or attributes if ( aEnumAccess->hasElements() || bEnabled ) @@ -248,7 +229,7 @@ void XMLRedlineExport::ExportChangesListElements() { // export only if not in header or footer // (those must be exported with their XText) - aAny = xPropSet->getPropertyValue(sIsInHeaderFooter); + aAny = xPropSet->getPropertyValue("IsInHeaderFooter"); if (! *o3tl::doAccess<bool>(aAny)) { // and finally, export change @@ -270,8 +251,8 @@ void XMLRedlineExport::ExportChangeAutoStyle( if (nullptr != pCurrentChangesList) { // put redline in list if it's collapsed or the redline start - Any aIsStart = rPropSet->getPropertyValue(sIsStart); - Any aIsCollapsed = rPropSet->getPropertyValue(sIsCollapsed); + Any aIsStart = rPropSet->getPropertyValue("IsStart"); + Any aIsCollapsed = rPropSet->getPropertyValue("IsCollapsed"); if ( *o3tl::doAccess<bool>(aIsStart) || *o3tl::doAccess<bool>(aIsCollapsed) ) @@ -279,7 +260,7 @@ void XMLRedlineExport::ExportChangeAutoStyle( } // get XText for export of redline auto styles - Any aAny = rPropSet->getPropertyValue(sRedlineText); + Any aAny = rPropSet->getPropertyValue("RedlineText"); Reference<XText> xText; aAny >>= xText; if (xText.is()) @@ -315,7 +296,7 @@ void XMLRedlineExport::ExportChangesListAutoStyles() // export only if not in header or footer // (those must be exported with their XText) - aAny = xPropSet->getPropertyValue(sIsInHeaderFooter); + aAny = xPropSet->getPropertyValue("IsInHeaderFooter"); if (! *o3tl::doAccess<bool>(aAny)) { ExportChangeAutoStyle(xPropSet); @@ -331,7 +312,7 @@ void XMLRedlineExport::ExportChangeInline( { // determine element name (depending on collapsed, start/end) enum XMLTokenEnum eElement = XML_TOKEN_INVALID; - Any aAny = rPropSet->getPropertyValue(sIsCollapsed); + Any aAny = rPropSet->getPropertyValue("IsCollapsed"); bool bCollapsed = *o3tl::doAccess<bool>(aAny); if (bCollapsed) { @@ -339,7 +320,7 @@ void XMLRedlineExport::ExportChangeInline( } else { - aAny = rPropSet->getPropertyValue(sIsStart); + aAny = rPropSet->getPropertyValue("IsStart"); const bool bStart = *o3tl::doAccess<bool>(aAny); eElement = bStart ? XML_CHANGE_START : XML_CHANGE_END; } @@ -364,7 +345,7 @@ void XMLRedlineExport::ExportChangedRegion( rExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT, GetRedlineID(rPropSet)); // merge-last-paragraph - Any aAny = rPropSet->getPropertyValue(sMergeLastPara); + Any aAny = rPropSet->getPropertyValue("MergeLastPara"); if( ! *o3tl::doAccess<bool>(aAny) ) rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_MERGE_LAST_PARAGRAPH, XML_FALSE); @@ -376,7 +357,7 @@ void XMLRedlineExport::ExportChangedRegion( // scope for (first) change element { - aAny = rPropSet->getPropertyValue(sRedlineType); + aAny = rPropSet->getPropertyValue("RedlineType"); OUString sType; aAny >>= sType; SvXMLElementExport aChange(rExport, XML_NAMESPACE_TEXT, @@ -385,7 +366,7 @@ void XMLRedlineExport::ExportChangedRegion( ExportChangeInfo(rPropSet); // get XText from the redline and export (if the XText exists) - aAny = rPropSet->getPropertyValue(sRedlineText); + aAny = rPropSet->getPropertyValue("RedlineText"); Reference<XText> xText; aAny >>= xText; if (xText.is()) @@ -399,7 +380,7 @@ void XMLRedlineExport::ExportChangedRegion( // changed change? Hierarchical changes can onl be two levels // deep. Here we check for the second level. - aAny = rPropSet->getPropertyValue(sRedlineSuccessorData); + aAny = rPropSet->getPropertyValue("RedlineSuccessorData"); Sequence<PropertyValue> aSuccessorData; aAny >>= aSuccessorData; @@ -424,37 +405,36 @@ void XMLRedlineExport::ExportChangedRegion( OUString const & XMLRedlineExport::ConvertTypeName( const OUString& sApiName) { - if (sApiName == sDelete) + if (sApiName == "Delete") { return sDeletion; } - else if (sApiName == sInsert) + else if (sApiName == "Insert") { return sInsertion; } - else if (sApiName == sFormat) + else if (sApiName == "Format") { return sFormatChange; } else { OSL_FAIL("unknown redline type"); + static const OUString sUnknownChange("UnknownChange"); return sUnknownChange; } } /** Create a Redline-ID */ -const OUString XMLRedlineExport::GetRedlineID( +OUString XMLRedlineExport::GetRedlineID( const Reference<XPropertySet> & rPropSet) { - Any aAny = rPropSet->getPropertyValue(sRedlineIdentifier); + Any aAny = rPropSet->getPropertyValue("RedlineIdentifier"); OUString sTmp; aAny >>= sTmp; - OUStringBuffer sBuf(sChangePrefix); - sBuf.append(sTmp); - return sBuf.makeStringAndClear(); + return "ct" + sTmp; } @@ -465,7 +445,7 @@ void XMLRedlineExport::ExportChangeInfo( SvXMLElementExport aChangeInfo(rExport, XML_NAMESPACE_OFFICE, XML_CHANGE_INFO, true, true); - Any aAny = rPropSet->getPropertyValue(sRedlineAuthor); + Any aAny = rPropSet->getPropertyValue("RedlineAuthor"); OUString sTmp; aAny >>= sTmp; if (!sTmp.isEmpty()) @@ -476,7 +456,7 @@ void XMLRedlineExport::ExportChangeInfo( rExport.Characters(sTmp); } - aAny = rPropSet->getPropertyValue(sRedlineDateTime); + aAny = rPropSet->getPropertyValue("RedlineDateTime"); util::DateTime aDateTime; aAny >>= aDateTime; { @@ -489,7 +469,7 @@ void XMLRedlineExport::ExportChangeInfo( } // comment as <text:p> sequence - aAny = rPropSet->getPropertyValue(sRedlineComment); + aAny = rPropSet->getPropertyValue("RedlineComment"); aAny >>= sTmp; WriteComment( sTmp ); } @@ -504,7 +484,7 @@ void XMLRedlineExport::ExportChangeInfo( { const PropertyValue& rVal = rPropertyValues[i]; - if( rVal.Name.equals(sRedlineAuthor) ) + if( rVal.Name == "RedlineAuthor" ) { OUString sTmp; rVal.Value >>= sTmp; @@ -513,11 +493,11 @@ void XMLRedlineExport::ExportChangeInfo( rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CHG_AUTHOR, sTmp); } } - else if( rVal.Name.equals(sRedlineComment) ) + else if( rVal.Name == "RedlineComment" ) { rVal.Value >>= sComment; } - else if( rVal.Name.equals(sRedlineDateTime) ) + else if( rVal.Name == "RedlineDateTime" ) { util::DateTime aDateTime; rVal.Value >>= aDateTime; @@ -526,12 +506,12 @@ void XMLRedlineExport::ExportChangeInfo( rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CHG_DATE_TIME, sBuf.makeStringAndClear()); } - else if( rVal.Name.equals(sRedlineType) ) + else if( rVal.Name == "RedlineType" ) { // check if this is an insertion; cf. comment at calling location OUString sTmp; rVal.Value >>= sTmp; - DBG_ASSERT(sTmp.equals(sInsert), + DBG_ASSERT(sTmp == "Insert", "hierarchical change must be insertion"); } // else: unknown value -> ignore @@ -555,7 +535,7 @@ void XMLRedlineExport::ExportStartOrEndRedline( Any aAny; try { - aAny = rPropSet->getPropertyValue(bStart ? sStartRedline : sEndRedline); + aAny = rPropSet->getPropertyValue(bStart ? OUString("StartRedline") : OUString("EndRedline")); } catch(const UnknownPropertyException&) { @@ -575,16 +555,16 @@ void XMLRedlineExport::ExportStartOrEndRedline( sal_Int32 nLength = aValues.getLength(); for(sal_Int32 i = 0; i < nLength; i++) { - if (sRedlineIdentifier.equals(pValues[i].Name)) + if (pValues[i].Name == "RedlineIdentifier") { pValues[i].Value >>= sId; bIdOK = true; } - else if (sIsCollapsed.equals(pValues[i].Name)) + else if (pValues[i].Name == "IsCollapsed") { bIsCollapsed = *o3tl::doAccess<bool>(pValues[i].Value); } - else if (sIsStart.equals(pValues[i].Name)) + else if (pValues[i].Name == "IsStart") { bIsStart = *o3tl::doAccess<bool>(pValues[i].Value); } @@ -595,11 +575,8 @@ void XMLRedlineExport::ExportStartOrEndRedline( SAL_WARN_IF( sId.isEmpty(), "xmloff", "Redlines must have IDs" ); // TODO: use GetRedlineID or eliminate that function - OUStringBuffer sBuffer(sChangePrefix); - sBuffer.append(sId); - rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_CHANGE_ID, - sBuffer.makeStringAndClear()); + "ct" + sId); // export the element // (whitespace because we're not inside paragraphs) diff --git a/xmloff/source/text/XMLRedlineExport.hxx b/xmloff/source/text/XMLRedlineExport.hxx index 3e43e56..c5b234e 100644 --- a/xmloff/source/text/XMLRedlineExport.hxx +++ b/xmloff/source/text/XMLRedlineExport.hxx @@ -52,29 +52,9 @@ typedef ::std::map< */ class XMLRedlineExport { - const OUString sDelete; const OUString sDeletion; - const OUString sFormat; const OUString sFormatChange; - const OUString sInsert; const OUString sInsertion; - const OUString sIsCollapsed; - const OUString sIsStart; - const OUString sRedlineAuthor; - const OUString sRedlineComment; - const OUString sRedlineDateTime; - const OUString sRedlineSuccessorData; - const OUString sRedlineText; - const OUString sRedlineType; - const OUString sUnknownChange; - const OUString sStartRedline; - const OUString sEndRedline; - const OUString sRedlineIdentifier; - const OUString sIsInHeaderFooter; - const OUString sRecordChanges; - const OUString sMergeLastPara; - - const OUString sChangePrefix; SvXMLExport& rExport; @@ -174,7 +154,7 @@ private: OUString const & ConvertTypeName(const OUString& sApiName); /// Get ID string! - const OUString GetRedlineID( + static OUString GetRedlineID( const css::uno::Reference<css::beans::XPropertySet> & rPropSet); /// write a comment string as sequence of <text:p> elements diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index d4a1745..791ceca 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -71,63 +71,7 @@ using ::com::sun::star::lang::Locale; XMLSectionExport::XMLSectionExport( SvXMLExport& rExp, XMLTextParagraphExport& rParaExp) -: sCondition("Condition") -, sCreateFromChapter("CreateFromChapter") -, sCreateFromEmbeddedObjects("CreateFromEmbeddedObjects") -, sCreateFromGraphicObjects("CreateFromGraphicObjects") -, sCreateFromLabels("CreateFromLabels") -, sCreateFromMarks("CreateFromMarks") -, sCreateFromOtherEmbeddedObjects("CreateFromOtherEmbeddedObjects") -, sCreateFromOutline("CreateFromOutline") -, sCreateFromStarCalc("CreateFromStarCalc") -, sCreateFromStarChart("CreateFromStarChart") -, sCreateFromStarDraw("CreateFromStarDraw") -, sCreateFromStarMath("CreateFromStarMath") -, sCreateFromTables("CreateFromTables") -, sCreateFromTextFrames("CreateFromTextFrames") -, sDdeCommandElement("DDECommandElement") -, sDdeCommandFile("DDECommandFile") -, sDdeCommandType("DDECommandType") -, sFileLink("FileLink") -, sIsCaseSensitive("IsCaseSensitive") -, sIsProtected("IsProtected") -, sIsVisible("IsVisible") -, sLabelCategory("LabelCategory") -, sLabelDisplayType("LabelDisplayType") -, sLevel("Level") -, sLevelFormat("LevelFormat") -, sLevelParagraphStyles("LevelParagraphStyles") -, sLinkRegion("LinkRegion") -, sMainEntryCharacterStyleName("MainEntryCharacterStyleName") -, sParaStyleHeading("ParaStyleHeading") -, sTitle("Title") -, sName("Name") -, sUseAlphabeticalSeparators("UseAlphabeticalSeparators") -, sUseCombinedEntries("UseCombinedEntries") -, sUseDash("UseDash") -, sUseKeyAsEntry("UseKeyAsEntry") -, sUseLevelFromSource("UseLevelFromSource") -, sUsePP("UsePP") -, sUseUpperCase("UseUpperCase") -, sIsCommaSeparated("IsCommaSeparated") -, sIsAutomaticUpdate("IsAutomaticUpdate") -, sIsRelativeTabstops("IsRelativeTabstops") -, sCreateFromLevelParagraphStyles("CreateFromLevelParagraphStyles") -, sDocumentIndex("DocumentIndex") -, sContentSection("ContentSection") -, sHeaderSection("HeaderSection") - -, sTextSection("TextSection") -, sIsGlobalDocumentSection("IsGlobalDocumentSection") -, sProtectionKey("ProtectionKey") -, sSortAlgorithm("SortAlgorithm") -, sLocale("Locale") -, sUserIndexName("UserIndexName") - -, sIsCurrentlyVisible("IsCurrentlyVisible") -, sHeadingStyleName("HeadingStyleName") - -, rExport(rExp) +: rExport(rExp) , rParaExport(rParaExp) , bHeadingDummiesExported( false ) { @@ -182,7 +126,7 @@ void XMLSectionExport::ExportSectionStart( bool XMLSectionExport::GetIndex( const Reference<XTextSection> & rSection, - Reference<XDocumentIndex> & rIndex) const + Reference<XDocumentIndex> & rIndex) { // first, reset result bool bRet = false; @@ -193,9 +137,9 @@ bool XMLSectionExport::GetIndex( // then check if this section happens to be inside an index if (xSectionPropSet->getPropertySetInfo()-> - hasPropertyByName(sDocumentIndex)) + hasPropertyByName("DocumentIndex")) { - Any aAny = xSectionPropSet->getPropertyValue(sDocumentIndex); + Any aAny = xSectionPropSet->getPropertyValue("DocumentIndex"); Reference<XDocumentIndex> xDocumentIndex; aAny >>= xDocumentIndex; @@ -204,7 +148,7 @@ bool XMLSectionExport::GetIndex( { // is the enclosing index identical with "our" section? Reference<XPropertySet> xIndexPropSet(xDocumentIndex, UNO_QUERY); - aAny = xIndexPropSet->getPropertyValue(sContentSection); + aAny = xIndexPropSet->getPropertyValue("ContentSection"); Reference<XTextSection> xEnclosingSection; aAny >>= xEnclosingSection; @@ -217,7 +161,7 @@ bool XMLSectionExport::GetIndex( // else: index header or regular section // is the enclosing index identical with the header section? - aAny = xIndexPropSet->getPropertyValue(sHeaderSection); + aAny = xIndexPropSet->getPropertyValue("HeaderSection"); // now mis-named: contains header section aAny >>= xEnclosingSection; @@ -416,7 +360,7 @@ void XMLSectionExport::ExportRegularSectionStart( Any aAny; // condition and display - aAny = xPropSet->getPropertyValue(sCondition); + aAny = xPropSet->getPropertyValue("Condition"); OUString sCond; aAny >>= sCond; enum XMLTokenEnum eDisplay = XML_TOKEN_INVALID; @@ -429,7 +373,7 @@ void XMLSectionExport::ExportRegularSectionStart( eDisplay = XML_CONDITION; // #97450# store hidden-status (of conditional sections only) - aAny = xPropSet->getPropertyValue(sIsCurrentlyVisible); + aAny = xPropSet->getPropertyValue("IsCurrentlyVisible"); if (! *o3tl::doAccess<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_IS_HIDDEN, @@ -440,20 +384,20 @@ void XMLSectionExport::ExportRegularSectionStart( { eDisplay = XML_NONE; } - aAny = xPropSet->getPropertyValue(sIsVisible); + aAny = xPropSet->getPropertyValue("IsVisible"); if (! *o3tl::doAccess<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_DISPLAY, eDisplay); } // protect + protection key - aAny = xPropSet->getPropertyValue(sIsProtected); + aAny = xPropSet->getPropertyValue("IsProtected"); if (*o3tl::doAccess<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_PROTECTED, XML_TRUE); } Sequence<sal_Int8> aPassword; - xPropSet->getPropertyValue(sProtectionKey) >>= aPassword; + xPropSet->getPropertyValue("ProtectionKey") >>= aPassword; if (aPassword.getLength() > 0) { OUStringBuffer aBuffer; @@ -468,11 +412,11 @@ void XMLSectionExport::ExportRegularSectionStart( // data source // unfortunately, we have to test all relevant strings for non-zero length - aAny = xPropSet->getPropertyValue(sFileLink); + aAny = xPropSet->getPropertyValue("FileLink"); SectionFileLink aFileLink; aAny >>= aFileLink; - aAny = xPropSet->getPropertyValue(sLinkRegion); + aAny = xPropSet->getPropertyValue("LinkRegion"); OUString sRegionName; aAny >>= sRegionName; @@ -505,18 +449,18 @@ void XMLSectionExport::ExportRegularSectionStart( else { // check for DDE first - if (xPropSet->getPropertySetInfo()->hasPropertyByName(sDdeCommandFile)) + if (xPropSet->getPropertySetInfo()->hasPropertyByName("DDECommandFile")) { // data source DDE // unfortunately, we have to test all relevant strings for // non-zero length - aAny = xPropSet->getPropertyValue(sDdeCommandFile); + aAny = xPropSet->getPropertyValue("DDECommandFile"); OUString sApplication; aAny >>= sApplication; - aAny = xPropSet->getPropertyValue(sDdeCommandType); + aAny = xPropSet->getPropertyValue("DDECommandType"); OUString sTopic; aAny >>= sTopic; - aAny = xPropSet->getPropertyValue(sDdeCommandElement); + aAny = xPropSet->getPropertyValue("DDECommandElement"); OUString sItem; aAny >>= sItem; @@ -531,7 +475,7 @@ void XMLSectionExport::ExportRegularSectionStart( GetExport().AddAttribute(XML_NAMESPACE_OFFICE, XML_DDE_ITEM, sItem); - aAny = xPropSet->getPropertyValue(sIsAutomaticUpdate); + aAny = xPropSet->getPropertyValue("IsAutomaticUpdate"); if (*o3tl::doAccess<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_OFFICE, @@ -560,7 +504,7 @@ void XMLSectionExport::ExportTableOfContentStart( // outline-level: 1..10 sal_Int16 nLevel = sal_Int16(); - if( rPropertySet->getPropertyValue(sLevel) >>= nLevel ) + if( rPropertySet->getPropertyValue("Level") >>= nLevel ) { OUStringBuffer sBuffer; ::sax::Converter::convertNumber(sBuffer, (sal_Int32)nLevel); @@ -570,15 +514,15 @@ void XMLSectionExport::ExportTableOfContentStart( } // use outline level - ExportBoolean(rPropertySet, sCreateFromOutline, + ExportBoolean(rPropertySet, "CreateFromOutline", XML_USE_OUTLINE_LEVEL, true); // use index marks - ExportBoolean(rPropertySet, sCreateFromMarks, + ExportBoolean(rPropertySet, "CreateFromMarks", XML_USE_INDEX_MARKS, true); // use level styles - ExportBoolean(rPropertySet, sCreateFromLevelParagraphStyles, + ExportBoolean(rPropertySet, "CreateFromLevelParagraphStyles", XML_USE_INDEX_SOURCE_STYLES, false); ExportBaseIndexSource(TEXT_SECTION_TYPE_TOC, rPropertySet); @@ -595,15 +539,15 @@ void XMLSectionExport::ExportObjectIndexStart( // scope for index source element { - ExportBoolean(rPropertySet, sCreateFromOtherEmbeddedObjects, + ExportBoolean(rPropertySet, "CreateFromOtherEmbeddedObjects", XML_USE_OTHER_OBJECTS, false); - ExportBoolean(rPropertySet, sCreateFromStarCalc, + ExportBoolean(rPropertySet, "CreateFromStarCalc", XML_USE_SPREADSHEET_OBJECTS, false); - ExportBoolean(rPropertySet, sCreateFromStarChart, + ExportBoolean(rPropertySet, "CreateFromStarChart", XML_USE_CHART_OBJECTS, false); - ExportBoolean(rPropertySet, sCreateFromStarDraw, + ExportBoolean(rPropertySet, "CreateFromStarDraw", XML_USE_DRAW_OBJECTS, false); - ExportBoolean(rPropertySet, sCreateFromStarMath, + ExportBoolean(rPropertySet, "CreateFromStarMath", XML_USE_MATH_OBJECTS, false); ExportBaseIndexSource(TEXT_SECTION_TYPE_OBJECT, rPropertySet); @@ -657,7 +601,7 @@ void XMLSectionExport::ExportAlphabeticalIndexStart( // style name (if present) Any aAny; - aAny = rPropertySet->getPropertyValue(sMainEntryCharacterStyleName); + aAny = rPropertySet->getPropertyValue("MainEntryCharacterStyleName"); OUString sStyleName; aAny >>= sStyleName; if (!sStyleName.isEmpty()) @@ -668,25 +612,25 @@ void XMLSectionExport::ExportAlphabeticalIndexStart( } // other (boolean) attributes - ExportBoolean(rPropertySet, sIsCaseSensitive, XML_IGNORE_CASE, + ExportBoolean(rPropertySet, "IsCaseSensitive", XML_IGNORE_CASE, false, true); - ExportBoolean(rPropertySet, sUseAlphabeticalSeparators, + ExportBoolean(rPropertySet, "UseAlphabeticalSeparators", XML_ALPHABETICAL_SEPARATORS, false); - ExportBoolean(rPropertySet, sUseCombinedEntries, XML_COMBINE_ENTRIES, + ExportBoolean(rPropertySet, "UseCombinedEntries", XML_COMBINE_ENTRIES, true); - ExportBoolean(rPropertySet, sUseDash, XML_COMBINE_ENTRIES_WITH_DASH, + ExportBoolean(rPropertySet, "UseDash", XML_COMBINE_ENTRIES_WITH_DASH, false); - ExportBoolean(rPropertySet, sUseKeyAsEntry, XML_USE_KEYS_AS_ENTRIES, + ExportBoolean(rPropertySet, "UseKeyAsEntry", XML_USE_KEYS_AS_ENTRIES, false); - ExportBoolean(rPropertySet, sUsePP, XML_COMBINE_ENTRIES_WITH_PP, + ExportBoolean(rPropertySet, "UsePP", XML_COMBINE_ENTRIES_WITH_PP, true); - ExportBoolean(rPropertySet, sUseUpperCase, XML_CAPITALIZE_ENTRIES, + ExportBoolean(rPropertySet, "UseUpperCase", XML_CAPITALIZE_ENTRIES, false); - ExportBoolean(rPropertySet, sIsCommaSeparated, XML_COMMA_SEPARATED, + ExportBoolean(rPropertySet, "IsCommaSeparated", XML_COMMA_SEPARATED, false); // sort algorithm - aAny = rPropertySet->getPropertyValue(sSortAlgorithm); + aAny = rPropertySet->getPropertyValue("SortAlgorithm"); OUString sAlgorithm; aAny >>= sAlgorithm; if (!sAlgorithm.isEmpty()) @@ -696,7 +640,7 @@ void XMLSectionExport::ExportAlphabeticalIndexStart( } // locale - aAny = rPropertySet->getPropertyValue(sLocale); + aAny = rPropertySet->getPropertyValue("Locale"); Locale aLocale; aAny >>= aLocale; GetExport().AddLanguageTagAttributes( XML_NAMESPACE_FO, XML_NAMESPACE_STYLE, aLocale, true); @@ -716,22 +660,22 @@ void XMLSectionExport::ExportUserIndexStart( // scope for table-of-content-source element { // bool attributes - ExportBoolean(rPropertySet, sCreateFromEmbeddedObjects, + ExportBoolean(rPropertySet, "CreateFromEmbeddedObjects", XML_USE_OBJECTS, false); - ExportBoolean(rPropertySet, sCreateFromGraphicObjects, + ExportBoolean(rPropertySet, "CreateFromGraphicObjects", XML_USE_GRAPHICS, false); - ExportBoolean(rPropertySet, sCreateFromMarks, + ExportBoolean(rPropertySet, "CreateFromMarks", XML_USE_INDEX_MARKS, false); - ExportBoolean(rPropertySet, sCreateFromTables, + ExportBoolean(rPropertySet, "CreateFromTables", XML_USE_TABLES, false); - ExportBoolean(rPropertySet, sCreateFromTextFrames, + ExportBoolean(rPropertySet, "CreateFromTextFrames", XML_USE_FLOATING_FRAMES, false); - ExportBoolean(rPropertySet, sUseLevelFromSource, + ExportBoolean(rPropertySet, "UseLevelFromSource", XML_COPY_OUTLINE_LEVELS, false); - ExportBoolean(rPropertySet, sCreateFromLevelParagraphStyles, + ExportBoolean(rPropertySet, "CreateFromLevelParagraphStyles", XML_USE_INDEX_SOURCE_STYLES, false); - Any aAny = rPropertySet->getPropertyValue( sUserIndexName ); + Any aAny = rPropertySet->getPropertyValue( "UserIndexName" ); OUString sIndexName; aAny >>= sIndexName; GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_INDEX_NAME, @@ -765,7 +709,7 @@ void XMLSectionExport::ExportBaseIndexStart( const Reference<XPropertySet> & rPropertySet) { // protect + protection key - Any aAny = rPropertySet->getPropertyValue(sIsProtected); + Any aAny = rPropertySet->getPropertyValue("IsProtected"); if (*o3tl::doAccess<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_PROTECTED, XML_TRUE); @@ -773,7 +717,7 @@ void XMLSectionExport::ExportBaseIndexStart( // index name OUString sIndexName; - rPropertySet->getPropertyValue(sName) >>= sIndexName; + rPropertySet->getPropertyValue("Name") >>= sIndexName; if ( !sIndexName.isEmpty() ) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, sIndexName); @@ -809,7 +753,7 @@ void XMLSectionExport::ExportBaseIndexSource( if (eType != TEXT_SECTION_TYPE_BIBLIOGRAPHY) { // document or chapter index? - aAny = rPropertySet->getPropertyValue(sCreateFromChapter); + aAny = rPropertySet->getPropertyValue("CreateFromChapter"); if (*o3tl::doAccess<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, @@ -817,7 +761,7 @@ void XMLSectionExport::ExportBaseIndexSource( } // tab-stops relative to margin? - aAny = rPropertySet->getPropertyValue(sIsRelativeTabstops); + aAny = rPropertySet->getPropertyValue("IsRelativeTabstops"); if (! *o3tl::doAccess<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, @@ -837,7 +781,7 @@ void XMLSectionExport::ExportBaseIndexSource( // scope for title template (all indices) { // header style name - aAny = rPropertySet->getPropertyValue(sParaStyleHeading); + aAny = rPropertySet->getPropertyValue("ParaStyleHeading"); OUString sStyleName; aAny >>= sStyleName; GetExport().AddAttribute(XML_NAMESPACE_TEXT, @@ -851,14 +795,14 @@ void XMLSectionExport::ExportBaseIndexSource( true, false); // title as element content - aAny = rPropertySet->getPropertyValue(sTitle); + aAny = rPropertySet->getPropertyValue("Title"); OUString sTitleString; aAny >>= sTitleString; GetExport().Characters(sTitleString); } // export level templates (all indices) - aAny = rPropertySet->getPropertyValue(sLevelFormat); + aAny = rPropertySet->getPropertyValue("LevelFormat"); Reference<XIndexReplace> xLevelTemplates; aAny >>= xLevelTemplates; @@ -884,7 +828,7 @@ void XMLSectionExport::ExportBaseIndexSource( if ( (TEXT_SECTION_TYPE_TOC == eType) || (TEXT_SECTION_TYPE_USER == eType) ) { - aAny = rPropertySet->getPropertyValue(sLevelParagraphStyles); + aAny = rPropertySet->getPropertyValue("LevelParagraphStyles"); Reference<XIndexReplace> xLevelParagraphStyles; aAny >>= xLevelParagraphStyles; ExportLevelParagraphStyles(xLevelParagraphStyles); @@ -914,7 +858,7 @@ void XMLSectionExport::ExportTableAndIllustrationIndexSourceAttributes( const Reference<XPropertySet> & rPropertySet) { // use caption - Any aAny = rPropertySet->getPropertyValue(sCreateFromLabels); + Any aAny = rPropertySet->getPropertyValue("CreateFromLabels"); if (! *o3tl::doAccess<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, @@ -922,7 +866,7 @@ void XMLSectionExport::ExportTableAndIllustrationIndexSourceAttributes( } // sequence name - aAny = rPropertySet->getPropertyValue(sLabelCategory); + aAny = rPropertySet->getPropertyValue("LabelCategory"); OUString sSequenceName; aAny >>= sSequenceName; GetExport().AddAttribute(XML_NAMESPACE_TEXT, @@ -930,7 +874,7 @@ void XMLSectionExport::ExportTableAndIllustrationIndexSourceAttributes( sSequenceName); // caption format - aAny = rPropertySet->getPropertyValue(sLabelDisplayType); + aAny = rPropertySet->getPropertyValue("LabelDisplayType"); sal_Int16 nType = 0; aAny >>= nType; GetExport().AddAttribute(XML_NAMESPACE_TEXT, @@ -1745,7 +1689,7 @@ bool XMLSectionExport::IsMuteSection( Reference<XPropertySet> xPropSet(aSection, UNO_QUERY); if (xPropSet.is()) { - Any aAny = xPropSet->getPropertyValue(sIsGlobalDocumentSection); + Any aAny = xPropSet->getPropertyValue("IsGlobalDocumentSection"); if ( *o3tl::doAccess<bool>(aAny) ) { @@ -1777,9 +1721,9 @@ bool XMLSectionExport::IsMuteSection( Reference<XPropertySet> xPropSet(rSection->getAnchor(), UNO_QUERY); if (xPropSet.is()) { - if (xPropSet->getPropertySetInfo()->hasPropertyByName(sTextSection)) + if (xPropSet->getPropertySetInfo()->hasPropertyByName("TextSection")) { - Any aAny = xPropSet->getPropertyValue(sTextSection); + Any aAny = xPropSet->getPropertyValue("TextSection"); Reference<XTextSection> xSection; aAny >>= xSection; @@ -1804,9 +1748,9 @@ bool XMLSectionExport::IsInSection( Reference<XPropertySet> xPropSet(rContent, UNO_QUERY); if (xPropSet.is()) { - if (xPropSet->getPropertySetInfo()->hasPropertyByName(sTextSection)) + if (xPropSet->getPropertySetInfo()->hasPropertyByName("TextSection")) { - Any aAny = xPropSet->getPropertyValue(sTextSection); + Any aAny = xPropSet->getPropertyValue("TextSection"); Reference<XTextSection> xSection; aAny >>= xSection; @@ -1854,7 +1798,7 @@ void XMLSectionExport::ExportMasterDocHeadingDummies() xChapterNumbering->getByIndex( nLevel ) >>= aProperties; for( sal_Int32 i = 0; i < aProperties.getLength(); i++ ) { - if( aProperties[i].Name == sHeadingStyleName ) + if( aProperties[i].Name == "HeadingStyleName" ) { aProperties[i].Value >>= sStyle; break; diff --git a/xmloff/source/text/XMLSectionExport.hxx b/xmloff/source/text/XMLSectionExport.hxx index 8342a18..c5d52df 100644 --- a/xmloff/source/text/XMLSectionExport.hxx +++ b/xmloff/source/text/XMLSectionExport.hxx @@ -74,62 +74,6 @@ enum SectionTypeEnum */ class XMLSectionExport { - const OUString sCondition; - const OUString sCreateFromChapter; - const OUString sCreateFromEmbeddedObjects; - const OUString sCreateFromGraphicObjects; - const OUString sCreateFromLabels; - const OUString sCreateFromMarks; - const OUString sCreateFromOtherEmbeddedObjects; - const OUString sCreateFromOutline; - const OUString sCreateFromStarCalc; - const OUString sCreateFromStarChart; - const OUString sCreateFromStarDraw; - const OUString sCreateFromStarMath; - const OUString sCreateFromTables; - const OUString sCreateFromTextFrames; - const OUString sDdeCommandElement; - const OUString sDdeCommandFile; - const OUString sDdeCommandType; - const OUString sFileLink; - const OUString sIsCaseSensitive; - const OUString sIsProtected; - const OUString sIsVisible; - const OUString sLabelCategory; - const OUString sLabelDisplayType; - const OUString sLevel; - const OUString sLevelFormat; - const OUString sLevelParagraphStyles; - const OUString sLinkRegion; - const OUString sMainEntryCharacterStyleName; - const OUString sParaStyleHeading; - const OUString sTitle; - const OUString sName; - const OUString sUseAlphabeticalSeparators; - const OUString sUseCombinedEntries; - const OUString sUseDash; - const OUString sUseKeyAsEntry; - const OUString sUseLevelFromSource; - const OUString sUsePP; - const OUString sUseUpperCase; - const OUString sIsCommaSeparated; - const OUString sIsAutomaticUpdate; - const OUString sIsRelativeTabstops; - const OUString sCreateFromLevelParagraphStyles; - const OUString sDocumentIndex; - const OUString sContentSection; - const OUString sHeaderSection; - - const OUString sTextSection; - const OUString sIsGlobalDocumentSection; - const OUString sProtectionKey; - const OUString sSortAlgorithm; - const OUString sLocale; - const OUString sUserIndexName; - - const OUString sIsCurrentlyVisible; - const OUString sHeadingStyleName; - SvXMLExport& rExport; XMLTextParagraphExport& rParaExport; @@ -175,7 +119,7 @@ public: * Determine whether rContent is contained in rEnclosingSection. If the * current section of rContent can not be determined, return bDefault. */ - bool IsInSection( + static bool IsInSection( const css::uno::Reference < css::text::XTextSection > & rEnclosingSection, const css::uno::Reference < css::text::XTextContent > & rContent, /// return value if this content doesn't support the section property @@ -254,9 +198,9 @@ protected: * return sal_False: regular section * return sal_True, xIndex is empty: index header section * return sal_True, xIndex is set: index section */ - bool GetIndex( + static bool GetIndex( const css::uno::Reference < css::text::XTextSection > & rSection, - css::uno::Reference < css::text::XDocumentIndex > & rIndex) const; + css::uno::Reference < css::text::XDocumentIndex > & rIndex); /// map service name to section type static enum SectionTypeEnum MapSectionType(const OUString& rSectionName); diff --git a/xmloff/source/text/XMLSectionImportContext.cxx b/xmloff/source/text/XMLSectionImportContext.cxx index baf72f0..1b9ae23 100644 --- a/xmloff/source/text/XMLSectionImportContext.cxx +++ b/xmloff/source/text/XMLSectionImportContext.cxx @@ -85,13 +85,6 @@ XMLSectionImportContext::XMLSectionImportContext( sal_uInt16 nPrfx, const OUString& rLocalName ) : SvXMLImportContext(rImport, nPrfx, rLocalName) -, sTextSection("com.sun.star.text.TextSection") -, sIndexHeaderSection("com.sun.star.text.IndexHeaderSection") -, sCondition("Condition") -, sIsVisible("IsVisible") -, sProtectionKey("ProtectionKey") -, sIsProtected("IsProtected") -, sIsCurrentlyVisible("IsCurrentlyVisible") , bProtect(false) , bCondOK(false) , bIsVisible(true) @@ -131,8 +124,8 @@ void XMLSectionImportContext::StartElement( if (xFactory.is()) { Reference<XInterface> xIfc = - xFactory->createInstance( bIsIndexHeader ? sIndexHeaderSection - : sTextSection ); + xFactory->createInstance( bIsIndexHeader ? OUString("com.sun.star.text.IndexHeaderSection") + : OUString("com.sun.star.text.TextSection") ); if (xIfc.is()) { Reference<XPropertySet> xPropSet(xIfc, UNO_QUERY); @@ -159,19 +152,19 @@ void XMLSectionImportContext::StartElement( // IsVisible and condition (not for index headers) if (! bIsIndexHeader) { - xPropSet->setPropertyValue( sIsVisible, Any(bIsVisible) ); + xPropSet->setPropertyValue( "IsVisible", Any(bIsVisible) ); // #97450# hidden sections must be hidden on reload // For backwards compatibility, set flag only if it is // present if( bIsCurrentlyVisibleOK ) { - xPropSet->setPropertyValue( sIsCurrentlyVisible, Any(bIsCurrentlyVisible)); + xPropSet->setPropertyValue( "IsCurrentlyVisible", Any(bIsCurrentlyVisible)); } if (bCondOK) { - xPropSet->setPropertyValue( sCondition, Any(sCond) ); + xPropSet->setPropertyValue( "Condition", Any(sCond) ); } } @@ -179,11 +172,11 @@ void XMLSectionImportContext::StartElement( if ( bSequenceOK && IsXMLToken(GetLocalName(), XML_SECTION) ) { - xPropSet->setPropertyValue(sProtectionKey, Any(aSequence)); + xPropSet->setPropertyValue("ProtectionKey", Any(aSequence)); } // protection - xPropSet->setPropertyValue( sIsProtected, Any(bProtect) ); + xPropSet->setPropertyValue( "IsProtected", Any(bProtect) ); // insert marker, <paragraph>, marker; then insert // section over the first marker character, and delete the diff --git a/xmloff/source/text/XMLSectionImportContext.hxx b/xmloff/source/text/XMLSectionImportContext.hxx index e67ad5b..ea7a5c2 100644 --- a/xmloff/source/text/XMLSectionImportContext.hxx +++ b/xmloff/source/text/XMLSectionImportContext.hxx @@ -42,14 +42,6 @@ class XMLSectionImportContext : public SvXMLImportContext /// TextSection (as XPropertySet) for passing down to data source elements css::uno::Reference<css::beans::XPropertySet> xSectionPropertySet; - const OUString sTextSection; - const OUString sIndexHeaderSection; - const OUString sCondition; - const OUString sIsVisible; - const OUString sProtectionKey; - const OUString sIsProtected; - const OUString sIsCurrentlyVisible; - OUString sXmlId; OUString sStyleName; OUString sName; diff --git a/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx b/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx index 08a2aac..753cb43 100644 --- a/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx +++ b/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx @@ -47,11 +47,7 @@ XMLSectionSourceDDEImportContext::XMLSectionSourceDDEImportContext( const OUString& rLocalName, Reference<XPropertySet> & rSectPropSet) : SvXMLImportContext(rImport, nPrfx, rLocalName), - rSectionPropertySet(rSectPropSet), - sDdeCommandFile("DDECommandFile"), - sDdeCommandType("DDECommandType"), - sDdeCommandElement("DDECommandElement"), - sIsAutomaticUpdate("IsAutomaticUpdate") + rSectionPropertySet(rSectPropSet) { } @@ -125,23 +121,23 @@ void XMLSectionSourceDDEImportContext::StartElement( // DDE not supported on all platforms; query property first if (rSectionPropertySet->getPropertySetInfo()-> - hasPropertyByName(sDdeCommandFile)) + hasPropertyByName("DDECommandFile")) { // use multi property set to force single update of connection #83654# Sequence<OUString> aNames(4); Sequence<Any> aValues(4); aValues[0] <<= sApplication; - aNames[0] = sDdeCommandFile; + aNames[0] = "DDECommandFile"; aValues[1] <<= sTopic; - aNames[1] = sDdeCommandType; + aNames[1] = "DDECommandType"; aValues[2] <<= sItem; - aNames[2] = sDdeCommandElement; + aNames[2] = "DDECommandElement"; aValues[3] <<= bAutomaticUpdate; - aNames[3] = sIsAutomaticUpdate; + aNames[3] = "IsAutomaticUpdate"; Reference<XMultiPropertySet> rMultiPropSet(rSectionPropertySet, UNO_QUERY); ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits