diff options
56 files changed, 348 insertions, 954 deletions
diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx index f818242b70d8..cc457c1c5942 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 ba7f6335f59c..c7a8dcd4b1ae 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 72adb5e01c63..d7d967bd2202 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 c884c84eaf62..1cf8042d1e23 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 4dfab9b76f16..00a0125670c4 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 5c39e8f79f88..8f997e5b64fc 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 00aca139a7d8..a733993a7e6a 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 493c0d5c26a7..06e4b50c82c0 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 301a7f7303cf..8e8db41dd068 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 bbf03c0959e0..cfbe93d4005d 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 63f0cbff00b8..71d00fcb84f9 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 49e4dca7a6e6..78721b62f3b4 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 49b0f23beb7c..ff4f718ce395 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 eebcb951211b..584c67627288 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 ea1fe7264e2c..062b0ba31bc8 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 b5809421b81e..cd17da5cbac3 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 c71cd9fedcc9..ce125aaaeedb 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 75a5a0ca1801..1b9ff89a47e0 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 62a69a6c5f4d..f37e66f74a4c 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 f31e3875e585..f8e8d3e1b9db 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 ee3747887c10..4640f859f629 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 52e679a34f8b..3aa829e4d69d 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 9500fbf4d10c..bbd827f00cc5 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 d3bfef932e83..34e48d38369b 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 d7bd6c21c546..b9c6215c07a4 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 46399c5981b7..beaf17bba10d 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 60ea983c80a7..c95ff0dfbdf3 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 d259ee21bc54..c6268af8a7a7 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 db8048f9424e..eaee15cd753c 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 3a831860e0d6..347875d97d64 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 b0f033407897..12d9d4640f8a 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 d42c905e4640..8c5f01e2d819 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 511dd303c72f..a61dc4d4ab7b 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 d41d2f1971eb..a2c042809a53 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 a56daa855eea..084e86516247 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 4530be7efdc4..2b05e69bc1ed 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 9299c08839f0..e91cfeec3ee0 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 5dcd27008047..c81dfeb1b605 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 21bd226504cd..1016ceef8f5a 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 95c826ac4ab3..93f808e07322 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 640404aff3d9..b078feb0d7c9 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 baf0d6de8760..d619e8b87034 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 3e43e5653a71..c5b234ee67e7 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 d4a17450db6a..791ceca006b3 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 8342a18a755c..c5d52df87dc5 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 baf72f06b8a0..1b9ae2358cfa 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 e67ad5babdff..ea7a5c2d09ad 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 08a2aaceb48c..753cb43b73a8 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); diff --git a/xmloff/source/text/XMLSectionSourceDDEImportContext.hxx b/xmloff/source/text/XMLSectionSourceDDEImportContext.hxx index deda6962809c..756ff9fe8a63 100644 --- a/xmloff/source/text/XMLSectionSourceDDEImportContext.hxx +++ b/xmloff/source/text/XMLSectionSourceDDEImportContext.hxx @@ -32,11 +32,6 @@ class XMLSectionSourceDDEImportContext : public SvXMLImportContext { css::uno::Reference<css::beans::XPropertySet> & rSectionPropertySet; - const OUString sDdeCommandFile; - const OUString sDdeCommandType; - const OUString sDdeCommandElement; - const OUString sIsAutomaticUpdate; - public: diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index d72c55e8737a..c4a290cd382c 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -333,29 +333,6 @@ class XMLTextFrameContext_Impl : public SvXMLImportContext /// old list item and block (#89891#) bool mbListContextPushed; - const OUString sWidth; - const OUString sWidthType; - const OUString sRelativeWidth; - const OUString sHeight; - const OUString sRelativeHeight; - const OUString sSizeType; - const OUString sIsSyncWidthToHeight; - const OUString sIsSyncHeightToWidth; - const OUString sHoriOrient; - const OUString sHoriOrientPosition; - const OUString sVertOrient; - const OUString sVertOrientPosition; - const OUString sAnchorType; - const OUString sAnchorPageNo; - const OUString sGraphicURL; - const OUString sGraphicFilter; - const OUString sTitle; - const OUString sDescription; - const OUString sFrameStyleName; - const OUString sGraphicRotation; - const OUString sTextBoxServiceName; - const OUString sGraphicServiceName; - OUString m_sOrigName; OUString sName; OUString sStyleName; @@ -527,8 +504,8 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ ) OUString sServiceName; switch( nType ) { - case XML_TEXT_FRAME_TEXTBOX: sServiceName = sTextBoxServiceName; break; - case XML_TEXT_FRAME_GRAPHIC: sServiceName = sGraphicServiceName; break; + case XML_TEXT_FRAME_TEXTBOX: sServiceName = "com.sun.star.text.TextFrame"; break; + case XML_TEXT_FRAME_GRAPHIC: sServiceName = "com.sun.star.text.GraphicObject"; break; } Reference<XInterface> xIfc = xFactory->createInstance( sServiceName ); SAL_WARN_IF( !xIfc.is(), "xmloff", "couldn't create frame" ); @@ -596,14 +573,14 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ ) if( rStyles.is() && rStyles->hasByName( sDisplayStyleName ) ) { - xPropSet->setPropertyValue( sFrameStyleName, Any(sDisplayStyleName) ); + xPropSet->setPropertyValue( "FrameStyleName", Any(sDisplayStyleName) ); } } // anchor type (must be set before any other properties, because // otherwise some orientations cannot be set or will be changed // afterwards) - xPropSet->setPropertyValue( sAnchorType, Any(eAnchorType) ); + xPropSet->setPropertyValue( "AnchorType", Any(eAnchorType) ); // hard properties if( pStyle ) @@ -611,62 +588,62 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ ) // x and y sal_Int16 nHoriOrient = HoriOrientation::NONE; - aAny = xPropSet->getPropertyValue( sHoriOrient ); + aAny = xPropSet->getPropertyValue( "HoriOrient" ); aAny >>= nHoriOrient; if( HoriOrientation::NONE == nHoriOrient ) { - xPropSet->setPropertyValue( sHoriOrientPosition, Any(nX) ); + xPropSet->setPropertyValue( "HoriOrientPosition", Any(nX) ); } sal_Int16 nVertOrient = VertOrientation::NONE; - aAny = xPropSet->getPropertyValue( sVertOrient ); + aAny = xPropSet->getPropertyValue( "VertOrient" ); aAny >>= nVertOrient; if( VertOrientation::NONE == nVertOrient ) { - xPropSet->setPropertyValue( sVertOrientPosition, Any(nY) ); + xPropSet->setPropertyValue( "VertOrientPosition", Any(nY) ); } // width if( nWidth > 0 ) { - xPropSet->setPropertyValue( sWidth, Any(nWidth) ); + xPropSet->setPropertyValue( "Width", Any(nWidth) ); } if( nRelWidth > 0 || nWidth > 0 ) { - xPropSet->setPropertyValue( sRelativeWidth, Any(nRelWidth) ); + xPropSet->setPropertyValue( "RelativeWidth", Any(nRelWidth) ); } if( bSyncWidth || nWidth > 0 ) { - xPropSet->setPropertyValue( sIsSyncWidthToHeight, Any(bSyncWidth) ); + xPropSet->setPropertyValue( "IsSyncWidthToHeight", Any(bSyncWidth) ); } - if( xPropSetInfo->hasPropertyByName( sWidthType ) && + if( xPropSetInfo->hasPropertyByName( "WidthType" ) && (bMinWidth || nWidth > 0 || nRelWidth > 0 ) ) { sal_Int16 nSizeType = (bMinWidth && XML_TEXT_FRAME_TEXTBOX == nType) ? SizeType::MIN : SizeType::FIX; - xPropSet->setPropertyValue( sWidthType, Any(nSizeType) ); + xPropSet->setPropertyValue( "WidthType", Any(nSizeType) ); } if( nHeight > 0 ) { - xPropSet->setPropertyValue( sHeight, Any(nHeight) ); + xPropSet->setPropertyValue( "Height", Any(nHeight) ); } if( nRelHeight > 0 || nHeight > 0 ) { - xPropSet->setPropertyValue( sRelativeHeight, Any(nRelHeight) ); + xPropSet->setPropertyValue( "RelativeHeight", Any(nRelHeight) ); } if( bSyncHeight || nHeight > 0 ) { - xPropSet->setPropertyValue( sIsSyncHeightToWidth, Any(bSyncHeight) ); + xPropSet->setPropertyValue( "IsSyncHeightToWidth", Any(bSyncHeight) ); } - if( xPropSetInfo->hasPropertyByName( sSizeType ) && + if( xPropSetInfo->hasPropertyByName( "SizeType" ) && (bMinHeight || nHeight > 0 || nRelHeight > 0 ) ) { sal_Int16 nSizeType = (bMinHeight && XML_TEXT_FRAME_TEXTBOX == nType) ? SizeType::MIN : SizeType::FIX; - xPropSet->setPropertyValue( sSizeType, Any(nSizeType) ); + xPropSet->setPropertyValue( "SizeType", Any(nSizeType) ); } if( XML_TEXT_FRAME_GRAPHIC == nType ) @@ -689,20 +666,20 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ ) sHRef = GetImport().ResolveGraphicObjectURLFromBase64( xBase64Stream ); xBase64Stream = nullptr; } - xPropSet->setPropertyValue( sGraphicURL, Any(sHRef) ); + xPropSet->setPropertyValue( "GraphicURL", Any(sHRef) ); // filter name - xPropSet->setPropertyValue( sGraphicFilter, Any(sFilterName) ); + xPropSet->setPropertyValue( "GraphicFilter", Any(sFilterName) ); // rotation - xPropSet->setPropertyValue( sGraphicRotation, Any(nRotation) ); + xPropSet->setPropertyValue( "GraphicRotation", Any(nRotation) ); } // page number (must be set after the frame is inserted, because it // will be overwritten then inserting the frame. if( TextContentAnchorType_AT_PAGE == eAnchorType && nPage > 0 ) { - xPropSet->setPropertyValue( sAnchorPageNo, Any(nPage) ); + xPropSet->setPropertyValue( "AnchorPageNo", Any(nPage) ); } if( XML_TEXT_FRAME_OBJECT != nType && @@ -811,28 +788,6 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( const Reference< XAttributeList > & rFrameAttrList ) : SvXMLImportContext( rImport, nPrfx, rLName ) , mbListContextPushed( false ) -, sWidth("Width") -, sWidthType("WidthType") -, sRelativeWidth("RelativeWidth") -, sHeight("Height") -, sRelativeHeight("RelativeHeight") -, sSizeType("SizeType") -, sIsSyncWidthToHeight("IsSyncWidthToHeight") -, sIsSyncHeightToWidth("IsSyncHeightToWidth") -, sHoriOrient("HoriOrient") -, sHoriOrientPosition("HoriOrientPosition") -, sVertOrient("VertOrient") -, sVertOrientPosition("VertOrientPosition") -, sAnchorType("AnchorType") -, sAnchorPageNo("AnchorPageNo") -, sGraphicURL("GraphicURL") -, sGraphicFilter("GraphicFilter") -, sTitle("Title") -, sDescription("Description") -, sFrameStyleName("FrameStyleName") -, sGraphicRotation("GraphicRotation") -, sTextBoxServiceName("com.sun.star.text.TextFrame") -, sGraphicServiceName("com.sun.star.text.GraphicObject") , nType( nNewType ) , eAnchorType( eATyp ) { @@ -1280,9 +1235,9 @@ void XMLTextFrameContext_Impl::SetTitle( const OUString& rTitle ) if ( xPropSet.is() ) { Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); - if( xPropSetInfo->hasPropertyByName( sTitle ) ) + if( xPropSetInfo->hasPropertyByName( "Title" ) ) { - xPropSet->setPropertyValue( sTitle, makeAny( rTitle ) ); + xPropSet->setPropertyValue( "Title", makeAny( rTitle ) ); } } } @@ -1292,9 +1247,9 @@ void XMLTextFrameContext_Impl::SetDesc( const OUString& rDesc ) if ( xPropSet.is() ) { Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); - if( xPropSetInfo->hasPropertyByName( sDescription ) ) + if( xPropSetInfo->hasPropertyByName( "Description" ) ) { - xPropSet->setPropertyValue( sDescription, makeAny( rDesc ) ); + xPropSet->setPropertyValue( "Description", makeAny( rDesc ) ); } } } diff --git a/xmloff/source/text/XMLTextNumRuleInfo.cxx b/xmloff/source/text/XMLTextNumRuleInfo.cxx index 3e4836fbc3ad..7ee74d63d218 100644 --- a/xmloff/source/text/XMLTextNumRuleInfo.cxx +++ b/xmloff/source/text/XMLTextNumRuleInfo.cxx @@ -36,17 +36,7 @@ using namespace ::com::sun::star::style; // Complete refactoring of the class and enhancement of the class for lists. XMLTextNumRuleInfo::XMLTextNumRuleInfo() - : msNumberingRules("NumberingRules") - , msNumberingLevel("NumberingLevel") - , msNumberingStartValue("NumberingStartValue") - , msParaIsNumberingRestart("ParaIsNumberingRestart") - , msNumberingIsNumber("NumberingIsNumber") - , msNumberingIsOutline("NumberingIsOutline") - , msPropNameListId("ListId") - , msPropNameStartWith("StartWith") - , msContinueingPreviousSubTree("ContinueingPreviousSubTree") - , msListLabelStringProp("ListLabelString") - , mxNumRules() + : mxNumRules() , msNumRulesName() , msListId() , mnListStartValue( -1 ) @@ -74,14 +64,14 @@ void XMLTextNumRuleInfo::Set( Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); // check if this paragraph supports a numbering - if( !xPropSetInfo->hasPropertyByName( msNumberingLevel ) ) + if( !xPropSetInfo->hasPropertyByName( "NumberingLevel" ) ) return; - if( xPropSet->getPropertyValue( msNumberingLevel ) >>= mnListLevel ) + if( xPropSet->getPropertyValue( "NumberingLevel" ) >>= mnListLevel ) { - if( xPropSetInfo->hasPropertyByName( msNumberingRules ) ) + if( xPropSetInfo->hasPropertyByName( "NumberingRules" ) ) { - xPropSet->getPropertyValue( msNumberingRules ) >>= mxNumRules; + xPropSet->getPropertyValue( "NumberingRules" ) >>= mxNumRules; } } else @@ -117,10 +107,10 @@ void XMLTextNumRuleInfo::Set( Reference<XPropertySet> xNumRulesProps(mxNumRules, UNO_QUERY); if ( xNumRulesProps.is() && xNumRulesProps->getPropertySetInfo()-> - hasPropertyByName( msNumberingIsOutline ) ) + hasPropertyByName( "NumberingIsOutline" ) ) { bool bIsOutline = false; - xNumRulesProps->getPropertyValue( msNumberingIsOutline ) >>= bIsOutline; + xNumRulesProps->getPropertyValue( "NumberingIsOutline" ) >>= bIsOutline; bSuppressListStyle = bIsOutline; } } @@ -144,21 +134,21 @@ void XMLTextNumRuleInfo::Set( SAL_WARN_IF( msNumRulesName.isEmpty(), "xmloff", "<XMLTextNumRuleInfo::Set(..)> - no name found for numbering rules instance. Serious defect." ); - if( xPropSetInfo->hasPropertyByName( msPropNameListId ) ) + if( xPropSetInfo->hasPropertyByName( "ListId" ) ) { - xPropSet->getPropertyValue( msPropNameListId ) >>= msListId; + xPropSet->getPropertyValue( "ListId" ) >>= msListId; } mbContinueingPreviousSubTree = false; - if( xPropSetInfo->hasPropertyByName( msContinueingPreviousSubTree ) ) + if( xPropSetInfo->hasPropertyByName( "ContinueingPreviousSubTree" ) ) { - xPropSet->getPropertyValue( msContinueingPreviousSubTree ) >>= mbContinueingPreviousSubTree; + xPropSet->getPropertyValue( "ContinueingPreviousSubTree" ) >>= mbContinueingPreviousSubTree; } mbIsNumbered = true; - if( xPropSetInfo->hasPropertyByName( msNumberingIsNumber ) ) + if( xPropSetInfo->hasPropertyByName( "NumberingIsNumber" ) ) { - if( !(xPropSet->getPropertyValue( msNumberingIsNumber ) >>= mbIsNumbered ) ) + if( !(xPropSet->getPropertyValue( "NumberingIsNumber" ) >>= mbIsNumbered ) ) { OSL_FAIL( "numbered paragraph without number info" ); mbIsNumbered = false; @@ -167,13 +157,13 @@ void XMLTextNumRuleInfo::Set( if( mbIsNumbered ) { - if( xPropSetInfo->hasPropertyByName( msParaIsNumberingRestart ) ) + if( xPropSetInfo->hasPropertyByName( "ParaIsNumberingRestart" ) ) { - xPropSet->getPropertyValue( msParaIsNumberingRestart ) >>= mbIsRestart; + xPropSet->getPropertyValue( "ParaIsNumberingRestart" ) >>= mbIsRestart; } - if( xPropSetInfo->hasPropertyByName( msNumberingStartValue ) ) + if( xPropSetInfo->hasPropertyByName( "NumberingStartValue" ) ) { - xPropSet->getPropertyValue( msNumberingStartValue ) >>= mnListStartValue; + xPropSet->getPropertyValue( "NumberingStartValue" ) >>= mnListStartValue; } } @@ -193,7 +183,7 @@ void XMLTextNumRuleInfo::Set( { const PropertyValue& rProp = pPropArray[i]; - if ( rProp.Name == msPropNameStartWith ) + if ( rProp.Name == "StartWith" ) { rProp.Value >>= mnListLevelStartValue; break; @@ -202,9 +192,9 @@ void XMLTextNumRuleInfo::Set( msListLabelString.clear(); if ( bExportTextNumberElement && - xPropSetInfo->hasPropertyByName( msListLabelStringProp ) ) + xPropSetInfo->hasPropertyByName( "ListLabelString" ) ) { - xPropSet->getPropertyValue( msListLabelStringProp ) >>= msListLabelString; + xPropSet->getPropertyValue( "ListLabelString" ) >>= msListLabelString; } // paragraph's list level range is [0..9] representing list levels [1..10] diff --git a/xmloff/source/text/XMLTextNumRuleInfo.hxx b/xmloff/source/text/XMLTextNumRuleInfo.hxx index 6a23a729303b..6ec6bd1fa173 100644 --- a/xmloff/source/text/XMLTextNumRuleInfo.hxx +++ b/xmloff/source/text/XMLTextNumRuleInfo.hxx @@ -38,36 +38,25 @@ class XMLTextListAutoStylePool; */ class XMLTextNumRuleInfo { - const OUString msNumberingRules; - const OUString msNumberingLevel; - const OUString msNumberingStartValue; - const OUString msParaIsNumberingRestart; - const OUString msNumberingIsNumber; - const OUString msNumberingIsOutline; - const OUString msPropNameListId; - const OUString msPropNameStartWith; - const OUString msContinueingPreviousSubTree; - const OUString msListLabelStringProp; - // numbering rules instance and its name css::uno::Reference < css::container::XIndexReplace > mxNumRules; - OUString msNumRulesName; + OUString msNumRulesName; // paragraph's list attributes - OUString msListId; + OUString msListId; sal_Int16 mnListStartValue; sal_Int16 mnListLevel; - bool mbIsNumbered; - bool mbIsRestart; + bool mbIsNumbered; + bool mbIsRestart; // numbering rules' attributes sal_Int16 mnListLevelStartValue; // Written OpenDocument file format doesn't fit to the created text document (#i69627#) - bool mbOutlineStyleAsNormalListStyle; + bool mbOutlineStyleAsNormalListStyle; - bool mbContinueingPreviousSubTree; - OUString msListLabelString; + bool mbContinueingPreviousSubTree; + OUString msListLabelString; public: diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index 24acfd16d7a7..c9901616b5c3 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -2316,8 +2316,6 @@ XMLPageVarGetFieldImportContext::XMLPageVarGetFieldImportContext( sal_uInt16 nPrfx, const OUString& sLocalName) : XMLTextFieldImportContext(rImport, rHlp, "ReferencePageGet", nPrfx, sLocalName), - sPropertyNumberingType( - sAPI_numbering_type), sNumberFormat(), sLetterSync(), bNumberFormatOK(false) @@ -2354,7 +2352,7 @@ void XMLPageVarGetFieldImportContext::PrepareField( } else nNumType = style::NumberingType::PAGE_DESCRIPTOR; - xPropertySet->setPropertyValue(sPropertyNumberingType, Any(nNumType)); + xPropertySet->setPropertyValue(sAPI_numbering_type, Any(nNumType)); // display old content (#96657#) xPropertySet->setPropertyValue( sAPI_current_presentation, Any(GetContent()) ); @@ -2369,8 +2367,6 @@ XMLPageVarSetFieldImportContext::XMLPageVarSetFieldImportContext( const OUString& sLocalName) : XMLTextFieldImportContext(rImport, rHlp, "ReferencePageSet", nPrfx, sLocalName), - sPropertyOn("On"), - sPropertyOffset(sAPI_offset), nAdjust(0), bActive(true) { @@ -2409,8 +2405,8 @@ void XMLPageVarSetFieldImportContext::ProcessAttribute( void XMLPageVarSetFieldImportContext::PrepareField( const Reference<XPropertySet> & xPropertySet) { - xPropertySet->setPropertyValue(sPropertyOn, Any(bActive)); - xPropertySet->setPropertyValue(sPropertyOffset, Any(nAdjust)); + xPropertySet->setPropertyValue("On", Any(bActive)); + xPropertySet->setPropertyValue(sAPI_offset, Any(nAdjust)); } @@ -2422,9 +2418,6 @@ XMLMacroFieldImportContext::XMLMacroFieldImportContext( const OUString& sLocalName) : XMLTextFieldImportContext(rImport, rHlp, "Macro", nPrfx, sLocalName), - sPropertyHint(sAPI_hint), - sPropertyMacroName("MacroName"), - sPropertyScriptURL("ScriptURL"), bDescriptionOK(false) { } @@ -2479,7 +2472,7 @@ void XMLMacroFieldImportContext::PrepareField( OUString sPropertyMacroLibrary("MacroLibrary"); aAny <<= (bDescriptionOK ? sDescription : GetContent()); - xPropertySet->setPropertyValue(sPropertyHint, aAny); + xPropertySet->setPropertyValue(sAPI_hint, aAny); // if we have an events child element, we'll look for the OnClick // event if not, it may be an old (pre-638i) document. Then, we'll @@ -2539,8 +2532,8 @@ void XMLMacroFieldImportContext::PrepareField( sMacroName = sMacro; } - xPropertySet->setPropertyValue(sPropertyScriptURL, Any(sScriptURL)); - xPropertySet->setPropertyValue(sPropertyMacroName, Any(sMacroName)); + xPropertySet->setPropertyValue("ScriptURL", Any(sScriptURL)); + xPropertySet->setPropertyValue("MacroName", Any(sMacroName)); xPropertySet->setPropertyValue(sPropertyMacroLibrary, Any(sLibraryName)); } @@ -2552,10 +2545,6 @@ XMLReferenceFieldImportContext::XMLReferenceFieldImportContext( SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nToken, sal_uInt16 nPrfx, const OUString& sLocalName) : XMLTextFieldImportContext(rImport, rHlp, "GetReference", nPrfx, sLocalName) -, sPropertyReferenceFieldPart("ReferenceFieldPart") -, sPropertyReferenceFieldSource("ReferenceFieldSource") -, sPropertySourceName("SourceName") -, sPropertyCurrentPresentation(sAPI_current_presentation) , nElementToken(nToken) , nSource(0) , nType(ReferenceFieldPart::PAGE_DESC) @@ -2651,15 +2640,15 @@ void XMLReferenceFieldImportContext::ProcessAttribute( void XMLReferenceFieldImportContext::PrepareField( const Reference<XPropertySet> & xPropertySet) { - xPropertySet->setPropertyValue(sPropertyReferenceFieldPart, Any(nType)); + xPropertySet->setPropertyValue("ReferenceFieldPart", Any(nType)); - xPropertySet->setPropertyValue(sPropertyReferenceFieldSource, Any(nSource)); + xPropertySet->setPropertyValue("ReferenceFieldSource", Any(nSource)); switch (nElementToken) { case XML_TOK_TEXT_REFERENCE_REF: case XML_TOK_TEXT_BOOKMARK_REF: - xPropertySet->setPropertyValue(sPropertySourceName, Any(sName)); + xPropertySet->setPropertyValue("SourceName", Any(sName)); break; case XML_TOK_TEXT_NOTE_REF: @@ -2671,7 +2660,7 @@ void XMLReferenceFieldImportContext::PrepareField( break; } - xPropertySet->setPropertyValue(sPropertyCurrentPresentation, Any(GetContent())); + xPropertySet->setPropertyValue(sAPI_current_presentation, Any(GetContent())); } @@ -2732,11 +2721,6 @@ XMLDdeFieldDeclImportContext::XMLDdeFieldDeclImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& sLocalName, const SvXMLTokenMap& rMap) : SvXMLImportContext(rImport, nPrfx, sLocalName) -, sPropertyIsAutomaticUpdate("IsAutomaticUpdate") -, sPropertyName(sAPI_name) -, sPropertyDDECommandType("DDECommandType") -, sPropertyDDECommandFile("DDECommandFile") -, sPropertyDDECommandElement("DDECommandElement") , rTokenMap(rMap) { DBG_ASSERT(XML_NAMESPACE_TEXT == nPrfx, "wrong prefix"); @@ -2825,18 +2809,18 @@ void XMLDdeFieldDeclImportContext::StartElement( Reference<XPropertySet> xPropSet( xIfc, UNO_QUERY ); if (xPropSet.is() && xPropSet->getPropertySetInfo()->hasPropertyByName( - sPropertyDDECommandType)) + "DDECommandType")) { - xPropSet->setPropertyValue(sPropertyName, Any(sName)); + xPropSet->setPropertyValue(sAPI_name, Any(sName)); - xPropSet->setPropertyValue(sPropertyDDECommandType, Any(sCommandApplication)); + xPropSet->setPropertyValue("DDECommandType", Any(sCommandApplication)); - xPropSet->setPropertyValue(sPropertyDDECommandFile, Any(sCommandTopic)); + xPropSet->setPropertyValue("DDECommandFile", Any(sCommandTopic)); - xPropSet->setPropertyValue(sPropertyDDECommandElement, + xPropSet->setPropertyValue("DDECommandElement", Any(sCommandItem)); - xPropSet->setPropertyValue(sPropertyIsAutomaticUpdate, + xPropSet->setPropertyValue("IsAutomaticUpdate", Any(bUpdate)); } // else: ignore (can't get XPropertySet, or DDE @@ -2998,9 +2982,6 @@ XMLUrlFieldImportContext::XMLUrlFieldImportContext( const OUString& sLocalName) : XMLTextFieldImportContext(rImport, rHlp, sAPI_url, nPrfx, sLocalName), - sPropertyURL(sAPI_url), - sPropertyTargetFrame("TargetFrame"), - sPropertyRepresentation("Representation"), bFrameOK(false) { } @@ -3028,14 +3009,14 @@ void XMLUrlFieldImportContext::ProcessAttribute( void XMLUrlFieldImportContext::PrepareField( const Reference<XPropertySet> & xPropertySet) { - xPropertySet->setPropertyValue(sPropertyURL, Any(sURL)); + xPropertySet->setPropertyValue(sAPI_url, Any(sURL)); if (bFrameOK) { - xPropertySet->setPropertyValue(sPropertyTargetFrame, Any(sFrame)); + xPropertySet->setPropertyValue("TargetFrame", Any(sFrame)); } - xPropertySet->setPropertyValue(sPropertyRepresentation, Any(GetContent())); + xPropertySet->setPropertyValue("Representation", Any(GetContent())); } @@ -3046,7 +3027,6 @@ XMLBibliographyFieldImportContext::XMLBibliographyFieldImportContext( const OUString& sLocalName) : XMLTextFieldImportContext(rImport, rHlp, "Bibliography", nPrfx, sLocalName), - sPropertyFields("Fields"), aValues() { bValid = true; @@ -3151,7 +3131,7 @@ void XMLBibliographyFieldImportContext::PrepareField( } // set sequence - xPropertySet->setPropertyValue(sPropertyFields, Any(aValueSequence)); + xPropertySet->setPropertyValue("Fields", Any(aValueSequence)); } const sal_Char* XMLBibliographyFieldImportContext::MapBibliographyFieldName( @@ -3306,13 +3286,6 @@ XMLAnnotationImportContext::XMLAnnotationImportContext( const OUString& sLocalName) : XMLTextFieldImportContext(rImport, rHlp, "Annotation", nPrfx, sLocalName), - sPropertyAuthor(sAPI_author), - sPropertyInitials("Initials"), - sPropertyContent(sAPI_content), - // why is there no UNO_NAME_DATE_TIME, but only UNO_NAME_DATE_TIME_VALUE? - sPropertyDate(sAPI_date_time_value), - sPropertyTextRange("TextRange"), - sPropertyName(sAPI_name), m_nToken(nToken) { bValid = true; @@ -3362,7 +3335,7 @@ SvXMLImportContext* XMLAnnotationImportContext::CreateChildContext( bOK = CreateField( mxField, sServicePrefix + GetServiceName() ); if (bOK) { - Any aAny = mxField->getPropertyValue( sPropertyTextRange ); + Any aAny = mxField->getPropertyValue( "TextRange" ); Reference< XText > xText; aAny >>= xText; if( xText.is() ) @@ -3399,10 +3372,9 @@ void XMLAnnotationImportContext::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(); @@ -3429,10 +3401,10 @@ void XMLAnnotationImportContext::EndElement() uno::Reference<beans::XPropertySet> xCurrField(xFields->nextElement(), uno::UNO_QUERY); uno::Reference<beans::XPropertySetInfo> const xInfo( xCurrField->getPropertySetInfo()); - if (xInfo->hasPropertyByName(sPropertyName)) + if (xInfo->hasPropertyByName(sAPI_name)) { OUString aFieldName; - xCurrField->getPropertyValue(sPropertyName) >>= aFieldName; + xCurrField->getPropertyValue(sAPI_name) >>= aFieldName; if (aFieldName == aName) { xPrevField.set( xCurrField, uno::UNO_QUERY ); @@ -3485,11 +3457,11 @@ void XMLAnnotationImportContext::PrepareField( { // import (possibly empty) author OUString sAuthor( aAuthorBuffer.makeStringAndClear() ); - xPropertySet->setPropertyValue(sPropertyAuthor, makeAny(sAuthor)); + xPropertySet->setPropertyValue(sAPI_author, makeAny(sAuthor)); // import (possibly empty) initials OUString sInitials( aInitialsBuffer.makeStringAndClear() ); - xPropertySet->setPropertyValue(sPropertyInitials, makeAny(sInitials)); + xPropertySet->setPropertyValue("Initials", makeAny(sInitials)); util::DateTime aDateTime; if (::sax::Converter::parseDateTime(aDateTime, nullptr, @@ -3502,7 +3474,8 @@ void XMLAnnotationImportContext::PrepareField( aDate.Day = aDateTime.Day; xPropertySet->setPropertyValue(sPropertyDate, makeAny(aDate)); */ - xPropertySet->setPropertyValue(sPropertyDate, makeAny(aDateTime)); + // why is there no UNO_NAME_DATE_TIME, but only UNO_NAME_DATE_TIME_VALUE? + xPropertySet->setPropertyValue(sAPI_date_time_value, makeAny(aDateTime)); } OUString sBuffer = aTextBuffer.makeStringAndClear(); @@ -3511,11 +3484,11 @@ void XMLAnnotationImportContext::PrepareField( // delete last paragraph mark (if necessary) if (sal_Char(0x0a) == sBuffer[sBuffer.getLength()-1]) sBuffer = sBuffer.copy(0, sBuffer.getLength()-1); - xPropertySet->setPropertyValue(sPropertyContent, makeAny(sBuffer)); + xPropertySet->setPropertyValue(sAPI_content, makeAny(sBuffer)); } if (!aName.isEmpty()) - xPropertySet->setPropertyValue(sPropertyName, makeAny(aName)); + xPropertySet->setPropertyValue(sAPI_name, makeAny(aName)); } @@ -3528,9 +3501,6 @@ XMLScriptImportContext::XMLScriptImportContext( sal_uInt16 nPrfx, const OUString& sLocalName) : XMLTextFieldImportContext(rImport, rHlp, "Script", nPrfx, sLocalName) -, sPropertyScriptType("ScriptType") -, sPropertyURLContent("URLContent") -, sPropertyContent(sAPI_content) , bContentOK(false) , bScriptTypeOK(false) { @@ -3569,12 +3539,12 @@ void XMLScriptImportContext::PrepareField( { sContent = GetContent(); } - xPropertySet->setPropertyValue(sPropertyContent, Any(sContent)); + xPropertySet->setPropertyValue(sAPI_content, Any(sContent)); // URL or script text? We use URL if we have an href-attribute - xPropertySet->setPropertyValue(sPropertyURLContent, Any(bContentOK)); + xPropertySet->setPropertyValue("URLContent", Any(bContentOK)); - xPropertySet->setPropertyValue(sPropertyScriptType, Any(sScriptType)); + xPropertySet->setPropertyValue("ScriptType", Any(sScriptType)); } @@ -3637,12 +3607,7 @@ XMLDropDownFieldImportContext::XMLDropDownFieldImportContext( nSelected( -1 ), bNameOK( false ), bHelpOK(false), - bHintOK(false), - sPropertyItems( "Items" ), - sPropertySelectedItem( "SelectedItem" ), - sPropertyName( "Name" ), - sPropertyHelp( "Help" ), - sPropertyToolTip( "Tooltip" ) + bHintOK(false) { bValid = true; } @@ -3732,27 +3697,27 @@ void XMLDropDownFieldImportContext::PrepareField( // now set values: - xPropertySet->setPropertyValue( sPropertyItems, Any(aSequence) ); + xPropertySet->setPropertyValue( "Items", Any(aSequence) ); if( nSelected >= 0 && nSelected < nLength ) { - xPropertySet->setPropertyValue( sPropertySelectedItem, Any(pSequence[nSelected]) ); + xPropertySet->setPropertyValue( "SelectedItem", Any(pSequence[nSelected]) ); } // set name if( bNameOK ) { - xPropertySet->setPropertyValue( sPropertyName, Any(sName) ); + xPropertySet->setPropertyValue( "Name", Any(sName) ); } // set help if( bHelpOK ) { - xPropertySet->setPropertyValue( sPropertyHelp, Any(sHelp) ); + xPropertySet->setPropertyValue( "Help", Any(sHelp) ); } // set hint if( bHintOK ) { - xPropertySet->setPropertyValue( sPropertyToolTip, Any(sHint) ); + xPropertySet->setPropertyValue( "Tooltip", Any(sHint) ); } } diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 0ba5f9ddce6f..ed8bc406be34 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -1805,7 +1805,7 @@ bool XMLTextParagraphExport::exportTextContentEnumeration( pSectionExport->ExportMasterDocHeadingDummies(); while (rContEnum->hasMoreElements() && - pSectionExport->IsInSection( xCurrentTextSection, + XMLSectionExport::IsInSection( xCurrentTextSection, xTxtCntnt, true )) { xTxtCntnt.set(rContEnum->nextElement(), uno::UNO_QUERY); @@ -1814,7 +1814,7 @@ bool XMLTextParagraphExport::exportTextContentEnumeration( } // the first non-mute element still needs to be processed bHoldElement = - ! pSectionExport->IsInSection( xCurrentTextSection, + ! XMLSectionExport::IsInSection( xCurrentTextSection, xTxtCntnt, false ); } else diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index 85da6adbda6d..58c201e7ab70 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -983,8 +983,6 @@ void XMLMetaFieldImportContext::InsertMeta( */ class XMLIndexMarkImportContext_Impl : public SvXMLImportContext { - const OUString sAlternativeText; - XMLHints_Impl& m_rHints; const enum XMLTextPElemTokens eToken; OUString sID; @@ -1034,7 +1032,6 @@ XMLIndexMarkImportContext_Impl::XMLIndexMarkImportContext_Impl( enum XMLTextPElemTokens eTok, XMLHints_Impl& rHints) : SvXMLImportContext(rImport, nPrefix, rLocalName) - , sAlternativeText("AlternativeText") , m_rHints(rHints) , eToken(eTok) { @@ -1159,7 +1156,7 @@ void XMLIndexMarkImportContext_Impl::ProcessAttribute( if ( (XML_NAMESPACE_TEXT == nNamespace) && IsXMLToken( sLocalName, XML_STRING_VALUE ) ) { - rPropSet->setPropertyValue(sAlternativeText, uno::makeAny(sValue)); + rPropSet->setPropertyValue("AlternativeText", uno::makeAny(sValue)); } // else: ignore! break; @@ -1245,8 +1242,6 @@ bool XMLIndexMarkImportContext_Impl::CreateMark( class XMLTOCMarkImportContext_Impl : public XMLIndexMarkImportContext_Impl { - const OUString sLevel; - public: XMLTOCMarkImportContext_Impl( @@ -1270,8 +1265,7 @@ XMLTOCMarkImportContext_Impl::XMLTOCMarkImportContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName, enum XMLTextPElemTokens nTok, XMLHints_Impl& rHints) : XMLIndexMarkImportContext_Impl(rImport, nPrefix, rLocalName, - nTok, rHints), - sLevel("Level") + nTok, rHints) { } @@ -1293,7 +1287,7 @@ void XMLTOCMarkImportContext_Impl::ProcessAttribute( && nTmp < GetImport().GetTextImport()-> GetChapterNumbering()->getCount() ) { - rPropSet->setPropertyValue(sLevel, uno::makeAny((sal_Int16)(nTmp - 1))); + rPropSet->setPropertyValue("Level", uno::makeAny((sal_Int16)(nTmp - 1))); } // else: value out of range -> ignore } @@ -1307,9 +1301,6 @@ void XMLTOCMarkImportContext_Impl::ProcessAttribute( class XMLUserIndexMarkImportContext_Impl : public XMLIndexMarkImportContext_Impl { - const OUString sUserIndexName; - const OUString sLevel; - public: XMLUserIndexMarkImportContext_Impl( @@ -1333,9 +1324,7 @@ XMLUserIndexMarkImportContext_Impl::XMLUserIndexMarkImportContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName, enum XMLTextPElemTokens nTok, XMLHints_Impl& rHints) : XMLIndexMarkImportContext_Impl(rImport, nPrefix, rLocalName, - nTok, rHints), - sUserIndexName("UserIndexName"), - sLevel("Level") + nTok, rHints) { } @@ -1347,7 +1336,7 @@ void XMLUserIndexMarkImportContext_Impl::ProcessAttribute( { if ( IsXMLToken( sLocalName, XML_INDEX_NAME ) ) { - rPropSet->setPropertyValue(sUserIndexName, uno::makeAny(sValue)); + rPropSet->setPropertyValue("UserIndexName", uno::makeAny(sValue)); } else if ( IsXMLToken( sLocalName, XML_OUTLINE_LEVEL ) ) { @@ -1357,7 +1346,7 @@ void XMLUserIndexMarkImportContext_Impl::ProcessAttribute( nTmp, sValue, 0, GetImport().GetTextImport()->GetChapterNumbering()->getCount())) { - rPropSet->setPropertyValue(sLevel, uno::makeAny(static_cast<sal_Int16>(nTmp - 1))); + rPropSet->setPropertyValue("Level", uno::makeAny(static_cast<sal_Int16>(nTmp - 1))); } // else: value out of range -> ignore } @@ -1378,13 +1367,6 @@ void XMLUserIndexMarkImportContext_Impl::ProcessAttribute( class XMLAlphaIndexMarkImportContext_Impl : public XMLIndexMarkImportContext_Impl { - const OUString sPrimaryKey; - const OUString sSecondaryKey; - const OUString sTextReading; - const OUString sPrimaryKeyReading; - const OUString sSecondaryKeyReading; - const OUString sMainEntry; - public: XMLAlphaIndexMarkImportContext_Impl( @@ -1408,13 +1390,7 @@ XMLAlphaIndexMarkImportContext_Impl::XMLAlphaIndexMarkImportContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName, enum XMLTextPElemTokens nTok, XMLHints_Impl& rHints) : XMLIndexMarkImportContext_Impl(rImport, nPrefix, rLocalName, - nTok, rHints), - sPrimaryKey("PrimaryKey"), - sSecondaryKey("SecondaryKey"), - sTextReading("TextReading"), - sPrimaryKeyReading("PrimaryKeyReading"), - sSecondaryKeyReading("SecondaryKeyReading"), - sMainEntry("IsMainEntry") + nTok, rHints) { } @@ -1426,23 +1402,23 @@ void XMLAlphaIndexMarkImportContext_Impl::ProcessAttribute( { if ( IsXMLToken( sLocalName, XML_KEY1 ) ) { - rPropSet->setPropertyValue(sPrimaryKey, uno::makeAny(sValue)); + rPropSet->setPropertyValue("PrimaryKey", uno::makeAny(sValue)); } else if ( IsXMLToken( sLocalName, XML_KEY2 ) ) { - rPropSet->setPropertyValue(sSecondaryKey, uno::makeAny(sValue)); + rPropSet->setPropertyValue("SecondaryKey", uno::makeAny(sValue)); } else if ( IsXMLToken( sLocalName, XML_KEY1_PHONETIC ) ) { - rPropSet->setPropertyValue(sPrimaryKeyReading, uno::makeAny(sValue)); + rPropSet->setPropertyValue("PrimaryKeyReading", uno::makeAny(sValue)); } else if ( IsXMLToken( sLocalName, XML_KEY2_PHONETIC ) ) { - rPropSet->setPropertyValue(sSecondaryKeyReading, uno::makeAny(sValue)); + rPropSet->setPropertyValue("SecondaryKeyReading", uno::makeAny(sValue)); } else if ( IsXMLToken( sLocalName, XML_STRING_VALUE_PHONETIC ) ) { - rPropSet->setPropertyValue(sTextReading, uno::makeAny(sValue)); + rPropSet->setPropertyValue("TextReading", uno::makeAny(sValue)); } else if ( IsXMLToken( sLocalName, XML_MAIN_ENTRY ) ) { @@ -1452,7 +1428,7 @@ void XMLAlphaIndexMarkImportContext_Impl::ProcessAttribute( if (::sax::Converter::convertBool(bTmp, sValue)) bMainEntry = bTmp; - rPropSet->setPropertyValue(sMainEntry, uno::makeAny(bMainEntry)); + rPropSet->setPropertyValue("IsMainEntry", uno::makeAny(bMainEntry)); } else { diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx index a39315b52c8f..4d67e17baca6 100644 --- a/xmloff/source/text/txtvfldi.cxx +++ b/xmloff/source/text/txtvfldi.cxx @@ -85,13 +85,6 @@ XMLVarFieldImportContext::XMLVarFieldImportContext( bool bType, bool bStyle, bool bValue, bool bPresentation) : XMLTextFieldImportContext(rImport, rHlp, pServiceName, nPrfx, rLocalName), - sPropertyContent(sAPI_content), - sPropertyHint("Hint"), - sPropertyHelp("Help"), - sPropertyTooltip("Tooltip"), - sPropertyIsVisible(sAPI_is_visible), - sPropertyIsDisplayFormula("IsShowFormula"), - sPropertyCurrentPresentation(sAPI_current_presentation), aValueHelper(rImport, rHlp, bType, bStyle, bValue, false), bDisplayFormula(false), bDisplayNone(false), @@ -193,34 +186,34 @@ void XMLVarFieldImportContext::PrepareField( if (bFormulaOK) { - xPropertySet->setPropertyValue(sPropertyContent, Any(sFormula)); + xPropertySet->setPropertyValue(sAPI_content, Any(sFormula)); } } if (bSetDescription && bDescriptionOK) { - xPropertySet->setPropertyValue(sPropertyHint, Any(sDescription)); + xPropertySet->setPropertyValue("Hint", Any(sDescription)); } if (bSetHelp && bHelpOK) { - xPropertySet->setPropertyValue(sPropertyHelp, Any(sHelp)); + xPropertySet->setPropertyValue("Help", Any(sHelp)); } if (bSetHint && bHintOK) { - xPropertySet->setPropertyValue(sPropertyTooltip, Any(sHint)); + xPropertySet->setPropertyValue("Tooltip", Any(sHint)); } if (bSetVisible && bDisplayOK) { bool bTmp = ! (bDisplayNone && bDisplayOK); - xPropertySet->setPropertyValue(sPropertyIsVisible, Any(bTmp)); + xPropertySet->setPropertyValue(sAPI_is_visible, Any(bTmp)); } // workaround for #no-bug#: display formula by default if (xPropertySet->getPropertySetInfo()-> - hasPropertyByName(sPropertyIsDisplayFormula) && + hasPropertyByName("IsShowFormula") && !bSetDisplayFormula) { bDisplayFormula = false; @@ -231,7 +224,7 @@ void XMLVarFieldImportContext::PrepareField( if (bSetDisplayFormula) { bool bTmp = bDisplayFormula && bDisplayOK; - xPropertySet->setPropertyValue(sPropertyIsDisplayFormula, Any(bTmp)); + xPropertySet->setPropertyValue("IsShowFormula", Any(bTmp)); } // delegate to value helper @@ -243,7 +236,7 @@ void XMLVarFieldImportContext::PrepareField( { Any aAny; aAny <<= GetContent(); - xPropertySet->setPropertyValue(sPropertyCurrentPresentation, aAny); + xPropertySet->setPropertyValue(sAPI_current_presentation, aAny); } } @@ -346,8 +339,6 @@ XMLSequenceFieldImportContext::XMLSequenceFieldImportContext( false, false, false, false, true), - sPropertyNumberFormat(sAPI_number_format), - sPropertySequenceValue("SequenceValue"), sNumFormat(OUString('1')), sNumFormatSync(GetXMLToken(XML_FALSE)), bRefNameOK(false) @@ -386,13 +377,13 @@ void XMLSequenceFieldImportContext::PrepareField( // set format sal_Int16 nNumType = NumberingType::ARABIC; GetImport().GetMM100UnitConverter().convertNumFormat( nNumType, sNumFormat, sNumFormatSync ); - xPropertySet->setPropertyValue(sPropertyNumberFormat, Any(nNumType)); + xPropertySet->setPropertyValue(sAPI_number_format, Any(nNumType)); // handle reference name if (bRefNameOK) { Any aAny; - aAny = xPropertySet->getPropertyValue(sPropertySequenceValue); + aAny = xPropertySet->getPropertyValue("SequenceValue"); sal_Int16 nValue = 0; aAny >>= nValue; GetImportHelper().InsertSequenceID(sRefName, GetName(), nValue); @@ -414,8 +405,7 @@ XMLVariableSetFieldImportContext::XMLVariableSetFieldImportContext( false, false, false, true, false, true, true, true, - true), - sPropertySubType(sAPI_sub_type) + true) { } @@ -425,7 +415,7 @@ void XMLVariableSetFieldImportContext::PrepareField( // set type Any aAny; aAny <<= (IsStringValue()? SetVariableType::STRING : SetVariableType::VAR); - xPropertySet->setPropertyValue(sPropertySubType, aAny); + xPropertySet->setPropertyValue(sAPI_sub_type, aAny); // the remainder is handled by super class XMLSetVarFieldImportContext::PrepareField(xPropertySet); @@ -446,9 +436,7 @@ XMLVariableInputFieldImportContext::XMLVariableInputFieldImportContext( true, true, true, true, false, true, true, true, - true), - sPropertySubType(sAPI_sub_type), - sPropertyIsInput("Input") + true) { } @@ -457,11 +445,11 @@ void XMLVariableInputFieldImportContext::PrepareField( { // set type (input field) Any aAny; - xPropertySet->setPropertyValue(sPropertyIsInput, Any(true)); + xPropertySet->setPropertyValue("Input", Any(true)); // set type aAny <<= (IsStringValue()? SetVariableType::STRING : SetVariableType::VAR); - xPropertySet->setPropertyValue(sPropertySubType, aAny); + xPropertySet->setPropertyValue(sAPI_sub_type, aAny); // the remainder is handled by super class XMLSetVarFieldImportContext::PrepareField(xPropertySet); @@ -507,7 +495,7 @@ XMLUserFieldInputImportContext::XMLUserFieldInputImportContext( void XMLUserFieldInputImportContext::PrepareField( const Reference<XPropertySet> & xPropertySet) { - xPropertySet->setPropertyValue(sPropertyContent, Any(GetName())); + xPropertySet->setPropertyValue(sAPI_content, Any(GetName())); // delegate to super class XMLVarFieldImportContext::PrepareField(xPropertySet); @@ -535,7 +523,7 @@ void XMLVariableGetFieldImportContext::PrepareField( const Reference<XPropertySet> & xPropertySet) { // set name - xPropertySet->setPropertyValue(sPropertyContent, Any(GetName())); + xPropertySet->setPropertyValue(sAPI_content, Any(GetName())); // the remainder is handled by super class XMLVarFieldImportContext::PrepareField(xPropertySet); @@ -555,8 +543,7 @@ XMLExpressionFieldImportContext::XMLExpressionFieldImportContext( false, false, false, false, true, true, true, false, - true), - sPropertySubType(sAPI_sub_type) + true) { bValid = true; // always valid } @@ -566,7 +553,7 @@ void XMLExpressionFieldImportContext::PrepareField( const Reference<XPropertySet> & xPropertySet) { sal_Int16 nSubType = SetVariableType::FORMULA; - xPropertySet->setPropertyValue(sPropertySubType, Any(nSubType)); + xPropertySet->setPropertyValue(sAPI_sub_type, Any(nSubType)); // delegate to super class XMLVarFieldImportContext::PrepareField(xPropertySet); @@ -596,7 +583,7 @@ void XMLTextInputFieldImportContext::PrepareField( { XMLVarFieldImportContext::PrepareField(xPropertySet); - xPropertySet->setPropertyValue(sPropertyContent, Any(GetContent())); + xPropertySet->setPropertyValue(sAPI_content, Any(GetContent())); } @@ -610,9 +597,6 @@ XMLTableFormulaImportContext::XMLTableFormulaImportContext( const OUString& rLocalName) : XMLTextFieldImportContext(rImport, rHlp, "TableFormula", nPrfx, rLocalName), - sPropertyIsShowFormula("IsShowFormula"), - sPropertyCurrentPresentation( - "CurrentPresentation"), aValueHelper(rImport, rHlp, false, true, false, true), bIsShowFormula(false) { @@ -655,10 +639,10 @@ void XMLTableFormulaImportContext::PrepareField( Any aAny; // set 'show formula' and presentation - xPropertySet->setPropertyValue( sPropertyIsShowFormula, Any(bIsShowFormula) ); + xPropertySet->setPropertyValue( "IsShowFormula", Any(bIsShowFormula) ); aAny <<= GetContent(); - xPropertySet->setPropertyValue( sPropertyCurrentPresentation, aAny ); + xPropertySet->setPropertyValue( "CurrentPresentation", aAny ); } @@ -734,10 +718,6 @@ XMLVariableDeclImportContext::XMLVariableDeclImportContext( enum VarType eVarType) : SvXMLImportContext(rImport, nPrfx, rLocalName), // bug?? which properties for userfield/userfieldmaster - sPropertySubType(sAPI_sub_type), - sPropertyNumberingLevel("ChapterNumberingLevel"), - sPropertyNumberingSeparator("NumberingSeparator"), - sPropertyIsExpression("IsExpression"), aValueHelper(rImport, rHlp, true, false, true, false), nNumLevel(-1), cSeparationChar('.') { @@ -800,13 +780,13 @@ XMLVariableDeclImportContext::XMLVariableDeclImportContext( switch (eVarType) { case VarTypeSequence: - xFieldMaster->setPropertyValue(sPropertyNumberingLevel, Any(nNumLevel)); + xFieldMaster->setPropertyValue("ChapterNumberingLevel", Any(nNumLevel)); if (nNumLevel >= 0) { OUString sStr(&cSeparationChar, 1); xFieldMaster->setPropertyValue( - sPropertyNumberingSeparator, Any(sStr)); + "NumberingSeparator", Any(sStr)); } break; case VarTypeSimple: @@ -816,13 +796,13 @@ XMLVariableDeclImportContext::XMLVariableDeclImportContext( // method, but it needs to be adjusted if it's a string. aAny <<= aValueHelper.IsStringValue() ? SetVariableType::STRING : SetVariableType::VAR; - xFieldMaster->setPropertyValue(sPropertySubType, aAny); + xFieldMaster->setPropertyValue(sAPI_sub_type, aAny); } break; case VarTypeUserField: { bool bTmp = !aValueHelper.IsStringValue(); - xFieldMaster->setPropertyValue(sPropertyIsExpression, Any(bTmp)); + xFieldMaster->setPropertyValue("IsExpression", Any(bTmp)); aValueHelper.PrepareField(xFieldMaster); break; } @@ -975,10 +955,6 @@ XMLDatabaseDisplayImportContext::XMLDatabaseDisplayImportContext( const OUString& rLocalName) : XMLDatabaseFieldImportContext(rImport, rHlp, sAPI_database, nPrfx, rLocalName, false), - sPropertyColumnName("DataColumnName"), - sPropertyDatabaseFormat("DataBaseFormat"), - sPropertyCurrentPresentation(sAPI_current_presentation), - sPropertyIsVisible(sAPI_is_visible), aValueHelper(rImport, rHlp, false, true, false, false), bColumnOK(false), bDisplay( true ), @@ -1037,7 +1013,7 @@ void XMLDatabaseDisplayImportContext::EndElement() "com.sun.star.text.FieldMaster.Database")) { Any aAny; - xMaster->setPropertyValue(sPropertyColumnName, Any(sColumnName)); + xMaster->setPropertyValue("DataColumnName", Any(sColumnName)); // fieldmaster takes database, table and column name XMLDatabaseFieldImportContext::PrepareField(xMaster); @@ -1063,7 +1039,7 @@ void XMLDatabaseDisplayImportContext::EndElement() // prepare field: format from database? bool bTmp = !aValueHelper.IsFormatOK(); - xField->setPropertyValue(sPropertyDatabaseFormat, Any(bTmp)); + xField->setPropertyValue("DataBaseFormat", Any(bTmp)); // value, value-type and format done by value helper aValueHelper.PrepareField(xField); @@ -1071,13 +1047,12 @@ void XMLDatabaseDisplayImportContext::EndElement() // visibility if( bDisplayOK ) { - xField->setPropertyValue(sPropertyIsVisible, Any(bDisplay)); + xField->setPropertyValue(sAPI_is_visible, Any(bDisplay)); } // set presentation aAny <<= GetContent(); - xField->setPropertyValue(sPropertyCurrentPresentation, - aAny); + xField->setPropertyValue(sAPI_current_presentation, aAny); // success! return; @@ -1123,10 +1098,6 @@ XMLValueImportHelper::XMLValueImportHelper( SvXMLImport& rImprt, XMLTextImportHelper& rHlp, bool bType, bool bStyle, bool bValue, bool bFormula) : - sPropertyContent(sAPI_content), - sPropertyValue("Value"), - sPropertyNumberFormat(sAPI_number_format), - sPropertyIsFixedLanguage("IsFixedLanguage"), rImport(rImprt), rHelper(rHlp), @@ -1294,19 +1265,19 @@ void XMLValueImportHelper::PrepareField( if (bSetFormula) { aAny <<= !bFormulaOK ? sDefault : sFormula; - xPropertySet->setPropertyValue(sPropertyContent, aAny); + xPropertySet->setPropertyValue(sAPI_content, aAny); } // format/style if (bSetStyle && bFormatOK) { - xPropertySet->setPropertyValue(sPropertyNumberFormat, Any(nFormatKey)); + xPropertySet->setPropertyValue(sAPI_number_format, Any(nFormatKey)); if( xPropertySet->getPropertySetInfo()-> - hasPropertyByName( sPropertyIsFixedLanguage ) ) + hasPropertyByName( "IsFixedLanguage" ) ) { bool bIsFixedLanguage = ! bIsDefaultLanguage; - xPropertySet->setPropertyValue( sPropertyIsFixedLanguage, Any(bIsFixedLanguage) ); + xPropertySet->setPropertyValue( "IsFixedLanguage", Any(bIsFixedLanguage) ); } } @@ -1316,11 +1287,11 @@ void XMLValueImportHelper::PrepareField( if (bStringType) { aAny <<= !bStringValueOK ? sDefault : sValue; - xPropertySet->setPropertyValue(sPropertyContent, aAny); + xPropertySet->setPropertyValue(sAPI_content, aAny); } else { - xPropertySet->setPropertyValue(sPropertyValue, Any(fValue)); + xPropertySet->setPropertyValue("Value", Any(fValue)); } } } |