diff options
Diffstat (limited to 'xmloff/source/text')
-rw-r--r-- | xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx | 48 | ||||
-rw-r--r-- | xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx | 43 | ||||
-rw-r--r-- | xmloff/source/text/XMLLineNumberingImportContext.cxx | 45 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextColumnsContext.cxx | 29 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextColumnsExport.cxx | 35 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextMasterPageContext.cxx | 9 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextMasterPageExport.cxx | 49 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextShapeImportHelper.cxx | 15 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextShapeStyleContext.cxx | 7 | ||||
-rw-r--r-- | xmloff/source/text/txtflde.cxx | 571 | ||||
-rw-r--r-- | xmloff/source/text/txtfldi.cxx | 75 | ||||
-rw-r--r-- | xmloff/source/text/txtftne.cxx | 32 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 384 | ||||
-rw-r--r-- | xmloff/source/text/txtsecte.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/text/txtstyle.cxx | 10 |
15 files changed, 687 insertions, 669 deletions
diff --git a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx index 31412606573f..633a2151c400 100644 --- a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx +++ b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx @@ -109,6 +109,18 @@ void XMLFootnoteConfigHelper::Characters( const OUString& rChars ) // XMLFootnoteConfigurationImportContext +static const OUStringLiteral gsPropertyAnchorCharStyleName("AnchorCharStyleName"); +static const OUStringLiteral gsPropertyCharStyleName("CharStyleName"); +static const OUStringLiteral gsPropertyNumberingType("NumberingType"); +static const OUStringLiteral gsPropertyPageStyleName("PageStyleName"); +static const OUStringLiteral gsPropertyParagraphStyleName("ParaStyleName"); +static const OUStringLiteral gsPropertyPrefix("Prefix"); +static const OUStringLiteral gsPropertyStartAt("StartAt"); +static const OUStringLiteral gsPropertySuffix("Suffix"); +static const OUStringLiteral gsPropertyPositionEndOfDoc("PositionEndOfDoc"); +static const OUStringLiteral gsPropertyFootnoteCounting("FootnoteCounting"); +static const OUStringLiteral gsPropertyEndNotice("EndNotice"); +static const OUStringLiteral gsPropertyBeginNotice("BeginNotice"); XMLFootnoteConfigurationImportContext::XMLFootnoteConfigurationImportContext( SvXMLImport& rImport, @@ -116,18 +128,6 @@ XMLFootnoteConfigurationImportContext::XMLFootnoteConfigurationImportContext( const OUString& rLocalName, const Reference<XAttributeList> & xAttrList) : SvXMLStyleContext(rImport, nPrfx, rLocalName, xAttrList, XML_STYLE_FAMILY_TEXT_FOOTNOTECONFIG) -, sPropertyAnchorCharStyleName("AnchorCharStyleName") -, sPropertyCharStyleName("CharStyleName") -, sPropertyNumberingType("NumberingType") -, sPropertyPageStyleName("PageStyleName") -, sPropertyParagraphStyleName("ParaStyleName") -, sPropertyPrefix("Prefix") -, sPropertyStartAt("StartAt") -, sPropertySuffix("Suffix") -, sPropertyPositionEndOfDoc("PositionEndOfDoc") -, sPropertyFootnoteCounting("FootnoteCounting") -, sPropertyEndNotice("EndNotice") -, sPropertyBeginNotice("BeginNotice") , sNumFormat("1") , sNumSync("false") , pAttrTokenMap(nullptr) @@ -356,33 +356,33 @@ void XMLFootnoteConfigurationImportContext::ProcessSettings( { aAny <<= GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_TEXT, sCitationStyle ); - rConfig->setPropertyValue(sPropertyCharStyleName, aAny); + rConfig->setPropertyValue(gsPropertyCharStyleName, aAny); } if (!sAnchorStyle.isEmpty()) { aAny <<= GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_TEXT, sAnchorStyle ); - rConfig->setPropertyValue(sPropertyAnchorCharStyleName, aAny); + rConfig->setPropertyValue(gsPropertyAnchorCharStyleName, aAny); } if (!sPageStyle.isEmpty()) { aAny <<= GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_MASTER_PAGE, sPageStyle ); - rConfig->setPropertyValue(sPropertyPageStyleName, aAny); + rConfig->setPropertyValue(gsPropertyPageStyleName, aAny); } if (!sDefaultStyle.isEmpty()) { aAny <<= GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH, sDefaultStyle ); - rConfig->setPropertyValue(sPropertyParagraphStyleName, aAny); + rConfig->setPropertyValue(gsPropertyParagraphStyleName, aAny); } - rConfig->setPropertyValue(sPropertyPrefix, Any(sPrefix)); + rConfig->setPropertyValue(gsPropertyPrefix, Any(sPrefix)); - rConfig->setPropertyValue(sPropertySuffix, Any(sSuffix)); + rConfig->setPropertyValue(gsPropertySuffix, Any(sSuffix)); sal_Int16 nNumType = NumberingType::ARABIC; GetImport().GetMM100UnitConverter().convertNumFormat( nNumType, sNumFormat, @@ -392,16 +392,16 @@ void XMLFootnoteConfigurationImportContext::ProcessSettings( if( NumberingType::CHAR_SPECIAL == nNumType ) nNumType = NumberingType::ARABIC; - rConfig->setPropertyValue(sPropertyNumberingType, Any(nNumType)); + rConfig->setPropertyValue(gsPropertyNumberingType, Any(nNumType)); - rConfig->setPropertyValue(sPropertyStartAt, Any(nOffset)); + rConfig->setPropertyValue(gsPropertyStartAt, Any(nOffset)); if (!bIsEndnote) { - rConfig->setPropertyValue(sPropertyPositionEndOfDoc, Any(bPosition)); - rConfig->setPropertyValue(sPropertyFootnoteCounting, Any(nNumbering)); - rConfig->setPropertyValue(sPropertyEndNotice, Any(sEndNotice)); - rConfig->setPropertyValue(sPropertyBeginNotice, Any(sBeginNotice)); + rConfig->setPropertyValue(gsPropertyPositionEndOfDoc, Any(bPosition)); + rConfig->setPropertyValue(gsPropertyFootnoteCounting, Any(nNumbering)); + rConfig->setPropertyValue(gsPropertyEndNotice, Any(sEndNotice)); + rConfig->setPropertyValue(gsPropertyBeginNotice, Any(sBeginNotice)); } } diff --git a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx index ef696c540a16..b84bc32b38a6 100644 --- a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx +++ b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx @@ -41,22 +41,23 @@ using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::lang::XMultiServiceFactory; +static const OUStringLiteral gsFieldMaster_Bibliography("com.sun.star.text.FieldMaster.Bibliography"); +static const OUStringLiteral gsBracketBefore("BracketBefore"); +static const OUStringLiteral gsBracketAfter("BracketAfter"); +static const OUStringLiteral gsIsNumberEntries("IsNumberEntries"); +static const OUStringLiteral gsIsSortByPosition("IsSortByPosition"); +static const OUStringLiteral gsSortKeys("SortKeys"); +static const OUStringLiteral gsSortKey("SortKey"); +static const OUStringLiteral gsIsSortAscending("IsSortAscending"); +static const OUStringLiteral gsSortAlgorithm("SortAlgorithm"); +static const OUStringLiteral gsLocale("Locale"); + XMLIndexBibliographyConfigurationContext::XMLIndexBibliographyConfigurationContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference<XAttributeList> & xAttrList) : SvXMLStyleContext(rImport, nPrfx, rLocalName, xAttrList, XML_STYLE_FAMILY_TEXT_BIBLIOGRAPHYCONFIG), - sFieldMaster_Bibliography("com.sun.star.text.FieldMaster.Bibliography"), - sBracketBefore("BracketBefore"), - sBracketAfter("BracketAfter"), - sIsNumberEntries("IsNumberEntries"), - sIsSortByPosition("IsSortByPosition"), - sSortKeys("SortKeys"), - sSortKey("SortKey"), - sIsSortAscending("IsSortAscending"), - sSortAlgorithm("SortAlgorithm"), - sLocale("Locale"), sSuffix(), sPrefix(), sAlgorithm(), @@ -193,12 +194,12 @@ SvXMLImportContextRef XMLIndexBibliographyConfigurationContext::CreateChildConte Sequence<PropertyValue> aKey(2); PropertyValue aNameValue; - aNameValue.Name = sSortKey; + aNameValue.Name = gsSortKey; aNameValue.Value <<= static_cast<sal_Int16>(nKey); aKey[0] = aNameValue; PropertyValue aSortValue; - aSortValue.Name = sIsSortAscending; + aSortValue.Name = gsIsSortAscending; aSortValue.Value <<= bSort; aKey[1] = aSortValue; @@ -227,7 +228,7 @@ void XMLIndexBibliographyConfigurationContext::CreateAndInsert(bool) sal_Int32 nServiceCount(aServices.getLength()); while (i < nServiceCount && !bFound) { - if (aServices[i] == sFieldMaster_Bibliography) + if (aServices[i] == gsFieldMaster_Bibliography) // here we should use a method which compares in reverse order if available bFound = true; else @@ -236,26 +237,26 @@ void XMLIndexBibliographyConfigurationContext::CreateAndInsert(bool) if (bFound) { Reference<XInterface> xIfc = - xFactory->createInstance(sFieldMaster_Bibliography); + xFactory->createInstance(gsFieldMaster_Bibliography); if( xIfc.is() ) { Reference<XPropertySet> xPropSet( xIfc, UNO_QUERY ); Any aAny; - xPropSet->setPropertyValue(sBracketAfter, Any(sSuffix)); - xPropSet->setPropertyValue(sBracketBefore, Any(sPrefix)); - xPropSet->setPropertyValue(sIsNumberEntries, Any(bNumberedEntries)); - xPropSet->setPropertyValue(sIsSortByPosition, Any(bSortByPosition)); + xPropSet->setPropertyValue(gsBracketAfter, Any(sSuffix)); + xPropSet->setPropertyValue(gsBracketBefore, Any(sPrefix)); + xPropSet->setPropertyValue(gsIsNumberEntries, Any(bNumberedEntries)); + xPropSet->setPropertyValue(gsIsSortByPosition, Any(bSortByPosition)); if( !maLanguageTagODF.isEmpty() ) { aAny <<= maLanguageTagODF.getLanguageTag().getLocale( false); - xPropSet->setPropertyValue(sLocale, aAny); + xPropSet->setPropertyValue(gsLocale, aAny); } if( !sAlgorithm.isEmpty() ) { - xPropSet->setPropertyValue(sSortAlgorithm, Any(sAlgorithm)); + xPropSet->setPropertyValue(gsSortAlgorithm, Any(sAlgorithm)); } sal_Int32 nCount = aSortKeys.size(); @@ -264,7 +265,7 @@ void XMLIndexBibliographyConfigurationContext::CreateAndInsert(bool) { aKeysSeq[i] = aSortKeys[i]; } - xPropSet->setPropertyValue(sSortKeys, Any(aKeysSeq)); + xPropSet->setPropertyValue(gsSortKeys, Any(aKeysSeq)); } // else: can't get FieldMaster -> ignore } diff --git a/xmloff/source/text/XMLLineNumberingImportContext.cxx b/xmloff/source/text/XMLLineNumberingImportContext.cxx index 4bf0fc2669fc..a02090e901d3 100644 --- a/xmloff/source/text/XMLLineNumberingImportContext.cxx +++ b/xmloff/source/text/XMLLineNumberingImportContext.cxx @@ -42,23 +42,24 @@ using ::com::sun::star::xml::sax::XAttributeList; using ::com::sun::star::text::XLineNumberingProperties; +static const OUStringLiteral gsCharStyleName("CharStyleName"); +static const OUStringLiteral gsCountEmptyLines("CountEmptyLines"); +static const OUStringLiteral gsCountLinesInFrames("CountLinesInFrames"); +static const OUStringLiteral gsDistance("Distance"); +static const OUStringLiteral gsInterval("Interval"); +static const OUStringLiteral gsSeparatorText("SeparatorText"); +static const OUStringLiteral gsNumberPosition("NumberPosition"); +static const OUStringLiteral gsNumberingType("NumberingType"); +static const OUStringLiteral gsIsOn("IsOn"); +static const OUStringLiteral gsRestartAtEachPage("RestartAtEachPage"); +static const OUStringLiteral gsSeparatorInterval("SeparatorInterval"); + XMLLineNumberingImportContext::XMLLineNumberingImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference<XAttributeList> & xAttrList) : SvXMLStyleContext(rImport, nPrfx, rLocalName, xAttrList, XML_STYLE_FAMILY_TEXT_LINENUMBERINGCONFIG) -, sCharStyleName("CharStyleName") -, sCountEmptyLines("CountEmptyLines") -, sCountLinesInFrames("CountLinesInFrames") -, sDistance("Distance") -, sInterval("Interval") -, sSeparatorText("SeparatorText") -, sNumberPosition("NumberPosition") -, sNumberingType("NumberingType") -, sIsOn("IsOn") -, sRestartAtEachPage("RestartAtEachPage") -, sSeparatorInterval("SeparatorInterval") , sNumFormat(GetXMLToken(XML_1)) , sNumLetterSync(GetXMLToken(XML_FALSE)) , nOffset(-1) @@ -226,33 +227,33 @@ void XMLLineNumberingImportContext::CreateAndInsert(bool) { aAny <<= GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_TEXT, sStyleName ); - xLineNumbering->setPropertyValue(sCharStyleName, aAny); + xLineNumbering->setPropertyValue(gsCharStyleName, aAny); } - xLineNumbering->setPropertyValue(sSeparatorText, Any(sSeparator)); - xLineNumbering->setPropertyValue(sDistance, Any(nOffset)); - xLineNumbering->setPropertyValue(sNumberPosition, Any(nNumberPosition)); + xLineNumbering->setPropertyValue(gsSeparatorText, Any(sSeparator)); + xLineNumbering->setPropertyValue(gsDistance, Any(nOffset)); + xLineNumbering->setPropertyValue(gsNumberPosition, Any(nNumberPosition)); if (nIncrement >= 0) { - xLineNumbering->setPropertyValue(sInterval, Any(nIncrement)); + xLineNumbering->setPropertyValue(gsInterval, Any(nIncrement)); } if (nSeparatorIncrement >= 0) { - xLineNumbering->setPropertyValue(sSeparatorInterval, Any(nSeparatorIncrement)); + xLineNumbering->setPropertyValue(gsSeparatorInterval, Any(nSeparatorIncrement)); } - xLineNumbering->setPropertyValue(sIsOn, Any(bNumberLines)); - xLineNumbering->setPropertyValue(sCountEmptyLines, Any(bCountEmptyLines)); - xLineNumbering->setPropertyValue(sCountLinesInFrames, Any(bCountInFloatingFrames)); - xLineNumbering->setPropertyValue(sRestartAtEachPage, Any(bRestartNumbering)); + xLineNumbering->setPropertyValue(gsIsOn, Any(bNumberLines)); + xLineNumbering->setPropertyValue(gsCountEmptyLines, Any(bCountEmptyLines)); + xLineNumbering->setPropertyValue(gsCountLinesInFrames, Any(bCountInFloatingFrames)); + xLineNumbering->setPropertyValue(gsRestartAtEachPage, Any(bRestartNumbering)); sal_Int16 nNumType = NumberingType::ARABIC; GetImport().GetMM100UnitConverter().convertNumFormat( nNumType, sNumFormat, sNumLetterSync ); - xLineNumbering->setPropertyValue(sNumberingType, Any(nNumType)); + xLineNumbering->setPropertyValue(gsNumberingType, Any(nNumType)); } } } diff --git a/xmloff/source/text/XMLTextColumnsContext.cxx b/xmloff/source/text/XMLTextColumnsContext.cxx index feff3ca8d05a..0cabdc2ca9ab 100644 --- a/xmloff/source/text/XMLTextColumnsContext.cxx +++ b/xmloff/source/text/XMLTextColumnsContext.cxx @@ -236,6 +236,14 @@ XMLTextColumnSepContext_Impl::XMLTextColumnSepContext_Impl( } } +static const OUStringLiteral gsSeparatorLineIsOn("SeparatorLineIsOn"); +static const OUStringLiteral gsSeparatorLineWidth("SeparatorLineWidth"); +static const OUStringLiteral gsSeparatorLineColor("SeparatorLineColor"); +static const OUStringLiteral gsSeparatorLineRelativeHeight("SeparatorLineRelativeHeight"); +static const OUStringLiteral gsSeparatorLineVerticalAlignment("SeparatorLineVerticalAlignment"); +static const OUStringLiteral gsAutomaticDistance("AutomaticDistance"); +static const OUStringLiteral gsSeparatorLineStyle("SeparatorLineStyle"); + XMLTextColumnsContext::XMLTextColumnsContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, @@ -244,13 +252,6 @@ XMLTextColumnsContext::XMLTextColumnsContext( const XMLPropertyState& rProp, ::std::vector< XMLPropertyState > &rProps ) : XMLElementPropertyContext( rImport, nPrfx, rLName, rProp, rProps ) -, sSeparatorLineIsOn("SeparatorLineIsOn") -, sSeparatorLineWidth("SeparatorLineWidth") -, sSeparatorLineColor("SeparatorLineColor") -, sSeparatorLineRelativeHeight("SeparatorLineRelativeHeight") -, sSeparatorLineVerticalAlignment("SeparatorLineVerticalAlignment") -, sAutomaticDistance("AutomaticDistance") -, sSeparatorLineStyle("SeparatorLineStyle") , pColumnAttrTokenMap( new SvXMLTokenMap(aColAttrTokenMap) ) , pColumnSepAttrTokenMap( new SvXMLTokenMap(aColSepAttrTokenMap) ) , nCount( 0 ) @@ -398,33 +399,33 @@ void XMLTextColumnsContext::EndElement( ) { bool bOn = mxColumnSep != nullptr; - xPropSet->setPropertyValue( sSeparatorLineIsOn, Any(bOn) ); + xPropSet->setPropertyValue( gsSeparatorLineIsOn, Any(bOn) ); if( mxColumnSep.is() ) { if( mxColumnSep->GetWidth() ) { - xPropSet->setPropertyValue( sSeparatorLineWidth, Any(mxColumnSep->GetWidth()) ); + xPropSet->setPropertyValue( gsSeparatorLineWidth, Any(mxColumnSep->GetWidth()) ); } if( mxColumnSep->GetHeight() ) { - xPropSet->setPropertyValue( sSeparatorLineRelativeHeight, + xPropSet->setPropertyValue( gsSeparatorLineRelativeHeight, Any(mxColumnSep->GetHeight()) ); } if ( mxColumnSep->GetStyle() ) { - xPropSet->setPropertyValue( sSeparatorLineStyle, Any(mxColumnSep->GetStyle()) ); + xPropSet->setPropertyValue( gsSeparatorLineStyle, Any(mxColumnSep->GetStyle()) ); } - xPropSet->setPropertyValue( sSeparatorLineColor, Any(mxColumnSep->GetColor()) ); + xPropSet->setPropertyValue( gsSeparatorLineColor, Any(mxColumnSep->GetColor()) ); - xPropSet->setPropertyValue( sSeparatorLineVerticalAlignment, Any(mxColumnSep->GetVertAlign()) ); + xPropSet->setPropertyValue( gsSeparatorLineVerticalAlignment, Any(mxColumnSep->GetVertAlign()) ); } // handle 'automatic columns': column distance if( bAutomatic ) { - xPropSet->setPropertyValue( sAutomaticDistance, Any(nAutomaticDistance) ); + xPropSet->setPropertyValue( gsAutomaticDistance, Any(nAutomaticDistance) ); } } diff --git a/xmloff/source/text/XMLTextColumnsExport.cxx b/xmloff/source/text/XMLTextColumnsExport.cxx index eca4e3c2734f..84501d2f6653 100644 --- a/xmloff/source/text/XMLTextColumnsExport.cxx +++ b/xmloff/source/text/XMLTextColumnsExport.cxx @@ -43,16 +43,17 @@ using namespace ::com::sun::star::beans; using namespace ::xmloff::token; +static const OUStringLiteral gsSeparatorLineIsOn("SeparatorLineIsOn"); +static const OUStringLiteral gsSeparatorLineWidth("SeparatorLineWidth"); +static const OUStringLiteral gsSeparatorLineColor("SeparatorLineColor"); +static const OUStringLiteral gsSeparatorLineRelativeHeight("SeparatorLineRelativeHeight"); +static const OUStringLiteral gsSeparatorLineVerticalAlignment("SeparatorLineVerticalAlignment"); +static const OUStringLiteral gsIsAutomatic("IsAutomatic"); +static const OUStringLiteral gsAutomaticDistance("AutomaticDistance"); +static const OUStringLiteral gsSeparatorLineStyle("SeparatorLineStyle"); + XMLTextColumnsExport::XMLTextColumnsExport( SvXMLExport& rExp ) : - rExport( rExp ), - sSeparatorLineIsOn("SeparatorLineIsOn"), - sSeparatorLineWidth("SeparatorLineWidth"), - sSeparatorLineColor("SeparatorLineColor"), - sSeparatorLineRelativeHeight("SeparatorLineRelativeHeight"), - sSeparatorLineVerticalAlignment("SeparatorLineVerticalAlignment"), - sIsAutomatic("IsAutomatic"), - sAutomaticDistance("AutomaticDistance"), - sSeparatorLineStyle("SeparatorLineStyle") + rExport( rExp ) { } @@ -73,10 +74,10 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) Reference < XPropertySet > xPropSet( xColumns, UNO_QUERY ); if( xPropSet.is() ) { - Any aAny = xPropSet->getPropertyValue( sIsAutomatic ); + Any aAny = xPropSet->getPropertyValue( gsIsAutomatic ); if ( *o3tl::doAccess<bool>(aAny) ) { - aAny = xPropSet->getPropertyValue( sAutomaticDistance ); + aAny = xPropSet->getPropertyValue( gsAutomaticDistance ); sal_Int32 nDistance = 0; aAny >>= nDistance; OUStringBuffer aBuffer; @@ -93,11 +94,11 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) if( xPropSet.is() ) { - Any aAny = xPropSet->getPropertyValue( sSeparatorLineIsOn ); + Any aAny = xPropSet->getPropertyValue( gsSeparatorLineIsOn ); if( *o3tl::doAccess<bool>(aAny) ) { // style:width - aAny = xPropSet->getPropertyValue( sSeparatorLineWidth ); + aAny = xPropSet->getPropertyValue( gsSeparatorLineWidth ); sal_Int32 nWidth = 0; aAny >>= nWidth; GetExport().GetMM100UnitConverter().convertMeasureToXML( sValue, @@ -106,7 +107,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) sValue.makeStringAndClear() ); // style:color - aAny = xPropSet->getPropertyValue( sSeparatorLineColor ); + aAny = xPropSet->getPropertyValue( gsSeparatorLineColor ); sal_Int32 nColor = 0; aAny >>= nColor; ::sax::Converter::convertColor( sValue, nColor ); @@ -114,7 +115,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) sValue.makeStringAndClear() ); // style:height - aAny = xPropSet->getPropertyValue( sSeparatorLineRelativeHeight ); + aAny = xPropSet->getPropertyValue( gsSeparatorLineRelativeHeight ); sal_Int8 nHeight = 0; aAny >>= nHeight; ::sax::Converter::convertPercent( sValue, nHeight ); @@ -122,7 +123,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) sValue.makeStringAndClear() ); // style::style - aAny = xPropSet->getPropertyValue( sSeparatorLineStyle ); + aAny = xPropSet->getPropertyValue( gsSeparatorLineStyle ); sal_Int8 nStyle = 0; aAny >>= nStyle; @@ -140,7 +141,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_STYLE, eStr ); // style:vertical-align - aAny = xPropSet->getPropertyValue( sSeparatorLineVerticalAlignment ); + aAny = xPropSet->getPropertyValue( gsSeparatorLineVerticalAlignment ); VerticalAlignment eVertAlign; aAny >>= eVertAlign; diff --git a/xmloff/source/text/XMLTextMasterPageContext.cxx b/xmloff/source/text/XMLTextMasterPageContext.cxx index f679c7d2d273..9d298aa730bc 100644 --- a/xmloff/source/text/XMLTextMasterPageContext.cxx +++ b/xmloff/source/text/XMLTextMasterPageContext.cxx @@ -59,12 +59,13 @@ Reference < XStyle > XMLTextMasterPageContext::Create() return xNewStyle; } +static const OUStringLiteral gsFollowStyle( "FollowStyle" ); + XMLTextMasterPageContext::XMLTextMasterPageContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList > & xAttrList, bool bOverwrite ) : SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, XML_STYLE_FAMILY_MASTER_PAGE ) -, sFollowStyle( "FollowStyle" ) , bInsertHeader( false ) , bInsertFooter( false ) , bInsertHeaderLeft( false ) @@ -271,7 +272,7 @@ void XMLTextMasterPageContext::Finish( bool bOverwrite ) Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); - if( xPropSetInfo->hasPropertyByName( sFollowStyle ) ) + if( xPropSetInfo->hasPropertyByName( gsFollowStyle ) ) { OUString sDisplayFollow( GetImport().GetStyleDisplayName( @@ -280,12 +281,12 @@ void XMLTextMasterPageContext::Finish( bool bOverwrite ) !xPageStyles->hasByName( sDisplayFollow ) ) sDisplayFollow = xStyle->getName(); - Any aAny = xPropSet->getPropertyValue( sFollowStyle ); + Any aAny = xPropSet->getPropertyValue( gsFollowStyle ); OUString sCurrFollow; aAny >>= sCurrFollow; if( sCurrFollow != sDisplayFollow ) { - xPropSet->setPropertyValue( sFollowStyle, Any(sDisplayFollow) ); + xPropSet->setPropertyValue( gsFollowStyle, Any(sDisplayFollow) ); } } diff --git a/xmloff/source/text/XMLTextMasterPageExport.cxx b/xmloff/source/text/XMLTextMasterPageExport.cxx index 9aed4eac2823..f2adab2600fa 100644 --- a/xmloff/source/text/XMLTextMasterPageExport.cxx +++ b/xmloff/source/text/XMLTextMasterPageExport.cxx @@ -32,19 +32,20 @@ using namespace ::com::sun::star::text; using namespace ::com::sun::star::beans; using namespace ::xmloff::token; +static const OUStringLiteral gsHeaderText( "HeaderText" ); +static const OUStringLiteral gsHeaderOn( "HeaderIsOn" ); +static const OUStringLiteral gsHeaderShareContent( "HeaderIsShared" ); +static const OUStringLiteral gsHeaderTextFirst( "HeaderTextFirst" ); +static const OUStringLiteral gsHeaderTextLeft( "HeaderTextLeft" ); +static const OUStringLiteral gsFirstShareContent( "FirstIsShared" ); +static const OUStringLiteral gsFooterText( "FooterText" ); +static const OUStringLiteral gsFooterOn( "FooterIsOn" ); +static const OUStringLiteral gsFooterShareContent( "FooterIsShared" ); +static const OUStringLiteral gsFooterTextFirst( "FooterTextFirst" ); +static const OUStringLiteral gsFooterTextLeft( "FooterTextLeft" ); + XMLTextMasterPageExport::XMLTextMasterPageExport( SvXMLExport& rExp ) : - XMLPageExport( rExp ), - sHeaderText( "HeaderText" ), - sHeaderOn( "HeaderIsOn" ), - sHeaderShareContent( "HeaderIsShared" ), - sHeaderTextFirst( "HeaderTextFirst" ), - sHeaderTextLeft( "HeaderTextLeft" ), - sFirstShareContent( "FirstIsShared" ), - sFooterText( "FooterText" ), - sFooterOn( "FooterIsOn" ), - sFooterShareContent( "FooterIsShared" ), - sFooterTextFirst( "FooterTextFirst" ), - sFooterTextLeft( "FooterTextLeft" ) + XMLPageExport( rExp ) { } @@ -83,27 +84,27 @@ void XMLTextMasterPageExport::exportMasterPageContent( Any aAny; Reference < XText > xHeaderText; - aAny = rPropSet->getPropertyValue( sHeaderText ); + aAny = rPropSet->getPropertyValue( gsHeaderText ); aAny >>= xHeaderText; Reference < XText > xHeaderTextFirst; - aAny = rPropSet->getPropertyValue( sHeaderTextFirst ); + aAny = rPropSet->getPropertyValue( gsHeaderTextFirst ); aAny >>= xHeaderTextFirst; Reference < XText > xHeaderTextLeft; - aAny = rPropSet->getPropertyValue( sHeaderTextLeft ); + aAny = rPropSet->getPropertyValue( gsHeaderTextLeft ); aAny >>= xHeaderTextLeft; Reference < XText > xFooterText; - aAny = rPropSet->getPropertyValue( sFooterText ); + aAny = rPropSet->getPropertyValue( gsFooterText ); aAny >>= xFooterText; Reference < XText > xFooterTextFirst; - aAny = rPropSet->getPropertyValue( sFooterTextFirst ); + aAny = rPropSet->getPropertyValue( gsFooterTextFirst ); aAny >>= xFooterTextFirst; Reference < XText > xFooterTextLeft; - aAny = rPropSet->getPropertyValue( sFooterTextLeft ); + aAny = rPropSet->getPropertyValue( gsFooterTextLeft ); aAny >>= xFooterTextLeft; if( bAutoStyles ) @@ -123,21 +124,21 @@ void XMLTextMasterPageExport::exportMasterPageContent( } else { - aAny = rPropSet->getPropertyValue( sHeaderOn ); + aAny = rPropSet->getPropertyValue( gsHeaderOn ); bool bHeader = false; aAny >>= bHeader; bool bHeaderFirstShared = false; if( bHeader ) { - aAny = rPropSet->getPropertyValue( sFirstShareContent ); + aAny = rPropSet->getPropertyValue( gsFirstShareContent ); aAny >>= bHeaderFirstShared; } bool bHeaderLeftShared = false; if( bHeader ) { - aAny = rPropSet->getPropertyValue( sHeaderShareContent ); + aAny = rPropSet->getPropertyValue( gsHeaderShareContent ); aAny >>= bHeaderLeftShared; } @@ -171,21 +172,21 @@ void XMLTextMasterPageExport::exportMasterPageContent( exportHeaderFooterContent( xHeaderTextFirst, false ); } - aAny = rPropSet->getPropertyValue( sFooterOn ); + aAny = rPropSet->getPropertyValue( gsFooterOn ); bool bFooter = false; aAny >>= bFooter; bool bFooterFirstShared = false; if( bFooter ) { - aAny = rPropSet->getPropertyValue( sFirstShareContent ); + aAny = rPropSet->getPropertyValue( gsFirstShareContent ); aAny >>= bFooterFirstShared; } bool bFooterLeftShared = false; if( bFooter ) { - aAny = rPropSet->getPropertyValue( sFooterShareContent ); + aAny = rPropSet->getPropertyValue( gsFooterShareContent ); aAny >>= bFooterLeftShared; } diff --git a/xmloff/source/text/XMLTextShapeImportHelper.cxx b/xmloff/source/text/XMLTextShapeImportHelper.cxx index 0d42e9a3b183..2fbad1717326 100644 --- a/xmloff/source/text/XMLTextShapeImportHelper.cxx +++ b/xmloff/source/text/XMLTextShapeImportHelper.cxx @@ -39,14 +39,15 @@ using namespace ::com::sun::star::text; using namespace ::com::sun::star::container; using namespace ::com::sun::star::xml::sax; +static const OUStringLiteral gsAnchorType("AnchorType"); +static const OUStringLiteral gsAnchorPageNo("AnchorPageNo"); +static const OUStringLiteral gsVertOrientPosition("VertOrientPosition"); + XMLTextShapeImportHelper::XMLTextShapeImportHelper( SvXMLImport& rImp ) : XMLShapeImportHelper( rImp, rImp.GetModel(), XMLTextImportHelper::CreateShapeExtPropMapper(rImp) ), - rImport( rImp ), - sAnchorType("AnchorType"), - sAnchorPageNo("AnchorPageNo"), - sVertOrientPosition("VertOrientPosition") + rImport( rImp ) { Reference < XDrawPageSupplier > xDPS( rImp.GetModel(), UNO_QUERY ); if( xDPS.is() ) @@ -121,7 +122,7 @@ void XMLTextShapeImportHelper::addShape( Reference < XPropertySet > xPropSet( rShape, UNO_QUERY ); // anchor type - xPropSet->setPropertyValue( sAnchorType, Any(eAnchorType) ); + xPropSet->setPropertyValue( gsAnchorType, Any(eAnchorType) ); Reference < XTextContent > xTxtCntnt( rShape, UNO_QUERY ); xTxtImport->InsertTextContent( xTxtCntnt ); @@ -134,11 +135,11 @@ void XMLTextShapeImportHelper::addShape( // only set positive page numbers if ( nPage > 0 ) { - xPropSet->setPropertyValue( sAnchorPageNo, Any(nPage) ); + xPropSet->setPropertyValue( gsAnchorPageNo, Any(nPage) ); } break; case TextContentAnchorType_AS_CHARACTER: - xPropSet->setPropertyValue( sVertOrientPosition, Any(nY) ); + xPropSet->setPropertyValue( gsVertOrientPosition, Any(nY) ); break; default: break; diff --git a/xmloff/source/text/XMLTextShapeStyleContext.cxx b/xmloff/source/text/XMLTextShapeStyleContext.cxx index 2608afdcff9a..c785a967ad52 100644 --- a/xmloff/source/text/XMLTextShapeStyleContext.cxx +++ b/xmloff/source/text/XMLTextShapeStyleContext.cxx @@ -134,13 +134,14 @@ void XMLTextShapeStyleContext::SetAttribute( sal_uInt16 nPrefixKey, } +static const OUStringLiteral gsIsAutoUpdate( "IsAutoUpdate" ); + XMLTextShapeStyleContext::XMLTextShapeStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList > & xAttrList, SvXMLStylesContext& rStyles, sal_uInt16 nFamily ) : XMLShapeStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, nFamily ), - sIsAutoUpdate( "IsAutoUpdate" ), bAutoUpdate( false ) { } @@ -204,10 +205,10 @@ void XMLTextShapeStyleContext::CreateAndInsert( bool bOverwrite ) Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY ); Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); - if( xPropSetInfo->hasPropertyByName( sIsAutoUpdate ) ) + if( xPropSetInfo->hasPropertyByName( gsIsAutoUpdate ) ) { bool bTmp = bAutoUpdate; - xPropSet->setPropertyValue( sIsAutoUpdate, Any(bTmp) ); + xPropSet->setPropertyValue( gsIsAutoUpdate, Any(bTmp) ); } // tell the style about it's events (if applicable) diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 87ed6f8ff62f..63bbb7cee2ca 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -272,80 +272,83 @@ inline Sequence<OUString> const GetStringSequenceProperty( const Reference<XPropertySet> & xPropSet); + // service names +static const OUStringLiteral gsServicePrefix("com.sun.star.text.textfield."); +static const OUStringLiteral gsFieldMasterPrefix("com.sun.star.text.FieldMaster."); +static const OUStringLiteral gsPresentationServicePrefix("com.sun.star.presentation.TextField."); + + // property names +static const OUStringLiteral gsPropertyAdjust("Adjust"); +static const OUStringLiteral gsPropertyAuthor("Author"); +static const OUStringLiteral gsPropertyChapterFormat("ChapterFormat"); +static const OUStringLiteral gsPropertyChapterNumberingLevel("ChapterNumberingLevel"); +static const OUStringLiteral gsPropertyCharStyleNames("CharStyleNames"); +static const OUStringLiteral gsPropertyCondition("Condition"); +static const OUStringLiteral gsPropertyContent("Content"); +static const OUStringLiteral gsPropertyDataBaseName("DataBaseName"); +static const OUStringLiteral gsPropertyDataBaseURL("DataBaseURL"); +static const OUStringLiteral gsPropertyDataColumnName("DataColumnName"); +static const OUStringLiteral gsPropertyDataCommandType("DataCommandType"); +static const OUStringLiteral gsPropertyDataTableName("DataTableName"); +static const OUStringLiteral gsPropertyDateTime("DateTime"); +static const OUStringLiteral gsPropertyDateTimeValue("DateTimeValue"); +static const OUStringLiteral gsPropertyDDECommandElement("DDECommandElement"); +static const OUStringLiteral gsPropertyDDECommandFile("DDECommandFile"); +static const OUStringLiteral gsPropertyDDECommandType("DDECommandType"); +static const OUStringLiteral gsPropertyDependentTextFields("DependentTextFields"); +static const OUStringLiteral gsPropertyFalseContent("FalseContent"); +static const OUStringLiteral gsPropertyFields("Fields"); +static const OUStringLiteral gsPropertyFieldSubType("UserDataType"); +static const OUStringLiteral gsPropertyFileFormat("FileFormat"); +static const OUStringLiteral gsPropertyFullName("FullName"); +static const OUStringLiteral gsPropertyHint("Hint"); +static const OUStringLiteral gsPropertyInitials("Initials"); +static const OUStringLiteral gsPropertyInstanceName("InstanceName"); +static const OUStringLiteral gsPropertyIsAutomaticUpdate("IsAutomaticUpdate"); +static const OUStringLiteral gsPropertyIsConditionTrue("IsConditionTrue"); +static const OUStringLiteral gsPropertyIsDataBaseFormat("DataBaseFormat"); +static const OUStringLiteral gsPropertyIsDate("IsDate"); +static const OUStringLiteral gsPropertyIsExpression("IsExpression"); +static const OUStringLiteral gsPropertyIsFixed("IsFixed"); +static const OUStringLiteral gsPropertyIsFixedLanguage("IsFixedLanguage"); +static const OUStringLiteral gsPropertyIsHidden("IsHidden"); +static const OUStringLiteral gsPropertyIsInput("Input"); +static const OUStringLiteral gsPropertyIsShowFormula("IsShowFormula"); +static const OUStringLiteral gsPropertyIsVisible("IsVisible"); +static const OUStringLiteral gsPropertyItems("Items"); +static const OUStringLiteral gsPropertyLevel("Level"); +static const OUStringLiteral gsPropertyMeasureKind("Kind"); +static const OUStringLiteral gsPropertyName("Name"); +static const OUStringLiteral gsPropertyNumberFormat("NumberFormat"); +static const OUStringLiteral gsPropertyNumberingSeparator("NumberingSeparator"); +static const OUStringLiteral gsPropertyNumberingType("NumberingType"); +static const OUStringLiteral gsPropertyOffset("Offset"); +static const OUStringLiteral gsPropertyOn("On"); +static const OUStringLiteral gsPropertyPlaceholderType("PlaceHolderType"); +static const OUStringLiteral gsPropertyReferenceFieldPart("ReferenceFieldPart"); +static const OUStringLiteral gsPropertyReferenceFieldSource("ReferenceFieldSource"); +static const OUStringLiteral gsPropertyReferenceFieldLanguage("ReferenceFieldLanguage"); +static const OUStringLiteral gsPropertyScriptType("ScriptType"); +static const OUStringLiteral gsPropertySelectedItem("SelectedItem"); +static const OUStringLiteral gsPropertySequenceNumber("SequenceNumber"); +static const OUStringLiteral gsPropertySequenceValue("SequenceValue"); +static const OUStringLiteral gsPropertySetNumber("SetNumber"); +static const OUStringLiteral gsPropertySourceName("SourceName"); +static const OUStringLiteral gsPropertySubType("SubType"); +static const OUStringLiteral gsPropertyTargetFrame("TargetFrame"); +static const OUStringLiteral gsPropertyTrueContent("TrueContent"); +static const OUStringLiteral gsPropertyURL("URL"); +static const OUStringLiteral gsPropertyURLContent("URLContent"); +static const OUStringLiteral gsPropertyUserText("UserText"); +static const OUStringLiteral gsPropertyValue("Value"); +static const OUStringLiteral gsPropertyVariableName("VariableName"); +static const OUStringLiteral gsPropertyHelp("Help"); +static const OUStringLiteral gsPropertyTooltip("Tooltip"); +static const OUStringLiteral gsPropertyTextRange("TextRange"); + XMLTextFieldExport::XMLTextFieldExport( SvXMLExport& rExp, std::unique_ptr<XMLPropertyState> pCombinedCharState) : rExport(rExp), - sServicePrefix("com.sun.star.text.textfield."), - sFieldMasterPrefix("com.sun.star.text.FieldMaster."), - sPresentationServicePrefix("com.sun.star.presentation.TextField."), - - sPropertyAdjust("Adjust"), - sPropertyAuthor("Author"), - sPropertyChapterFormat("ChapterFormat"), - sPropertyChapterNumberingLevel("ChapterNumberingLevel"), - sPropertyCharStyleNames("CharStyleNames"), - sPropertyCondition("Condition"), - sPropertyContent("Content"), - sPropertyDataBaseName("DataBaseName"), - sPropertyDataBaseURL("DataBaseURL"), - sPropertyDataColumnName("DataColumnName"), - sPropertyDataCommandType("DataCommandType"), - sPropertyDataTableName("DataTableName"), - sPropertyDateTime("DateTime"), - sPropertyDateTimeValue("DateTimeValue"), - sPropertyDDECommandElement("DDECommandElement"), - sPropertyDDECommandFile("DDECommandFile"), - sPropertyDDECommandType("DDECommandType"), - sPropertyDependentTextFields("DependentTextFields"), - sPropertyFalseContent("FalseContent"), - sPropertyFields("Fields"), - sPropertyFieldSubType("UserDataType"), - sPropertyFileFormat("FileFormat"), - sPropertyFullName("FullName"), - sPropertyHint("Hint"), - sPropertyInitials("Initials"), - sPropertyInstanceName("InstanceName"), - sPropertyIsAutomaticUpdate("IsAutomaticUpdate"), - sPropertyIsConditionTrue("IsConditionTrue"), - sPropertyIsDataBaseFormat("DataBaseFormat"), - sPropertyIsDate("IsDate"), - sPropertyIsExpression("IsExpression"), - sPropertyIsFixed("IsFixed"), - sPropertyIsFixedLanguage("IsFixedLanguage"), - sPropertyIsHidden("IsHidden"), - sPropertyIsInput("Input"), - sPropertyIsShowFormula("IsShowFormula"), - sPropertyIsVisible("IsVisible"), - sPropertyItems("Items"), - sPropertyLevel("Level"), - sPropertyMeasureKind("Kind"), - sPropertyName("Name"), - sPropertyNumberFormat("NumberFormat"), - sPropertyNumberingSeparator("NumberingSeparator"), - sPropertyNumberingType("NumberingType"), - sPropertyOffset("Offset"), - sPropertyOn("On"), - sPropertyPlaceholderType("PlaceHolderType"), - sPropertyReferenceFieldPart("ReferenceFieldPart"), - sPropertyReferenceFieldSource("ReferenceFieldSource"), - sPropertyReferenceFieldLanguage("ReferenceFieldLanguage"), - sPropertyScriptType("ScriptType"), - sPropertySelectedItem("SelectedItem"), - sPropertySequenceNumber("SequenceNumber"), - sPropertySequenceValue("SequenceValue"), - sPropertySetNumber("SetNumber"), - sPropertySourceName("SourceName"), - sPropertySubType("SubType"), - sPropertyTargetFrame("TargetFrame"), - sPropertyTrueContent("TrueContent"), - sPropertyURL("URL"), - sPropertyURLContent("URLContent"), - sPropertyUserText("UserText"), - sPropertyValue("Value"), - sPropertyVariableName("VariableName"), - sPropertyHelp("Help"), - sPropertyTooltip("Tooltip"), - sPropertyTextRange("TextRange"), pCombinedCharactersPropertyState(std::move(pCombinedCharState)) { SetExportOnlyUsedFieldDeclarations(); @@ -371,10 +374,10 @@ enum FieldIdEnum XMLTextFieldExport::GetFieldID( // search for TextField service name while( nCount-- ) { - if (pNames->matchIgnoreAsciiCase(sServicePrefix)) + if (pNames->matchIgnoreAsciiCase(gsServicePrefix)) { // TextField found => postfix is field type! - sFieldName = pNames->copy(sServicePrefix.getLength()); + sFieldName = pNames->copy(gsServicePrefix.getLength()); break; } @@ -389,10 +392,10 @@ enum FieldIdEnum XMLTextFieldExport::GetFieldID( // search for TextField service name while( nCount2-- ) { - if( pNames2->startsWith(sPresentationServicePrefix) ) + if( pNames2->startsWith(gsPresentationServicePrefix) ) { // TextField found => postfix is field type! - sFieldName = pNames2->copy(sPresentationServicePrefix.getLength()); + sFieldName = pNames2->copy(gsPresentationServicePrefix.getLength()); break; } @@ -449,13 +452,13 @@ enum FieldIdEnum XMLTextFieldExport::MapFieldName( // b) map prelim. to final FIELD_IDs switch (nToken) { case FIELD_ID_VARIABLE_SET: - if (GetBoolProperty(sPropertyIsInput, xPropSet)) + if (GetBoolProperty(gsPropertyIsInput, xPropSet)) { nToken = FIELD_ID_VARIABLE_INPUT; } else { - switch (GetIntProperty(sPropertySubType, xPropSet)) + switch (GetIntProperty(gsPropertySubType, xPropSet)) { case SetVariableType::STRING: // text field case SetVariableType::VAR: // num field @@ -473,7 +476,7 @@ enum FieldIdEnum XMLTextFieldExport::MapFieldName( break; case FIELD_ID_VARIABLE_GET: - switch (GetIntProperty(sPropertySubType, xPropSet)) + switch (GetIntProperty(gsPropertySubType, xPropSet)) { case SetVariableType::STRING: // text field case SetVariableType::VAR: // num field @@ -490,7 +493,7 @@ enum FieldIdEnum XMLTextFieldExport::MapFieldName( break; case FIELD_ID_TIME: - if (GetBoolProperty(sPropertyIsDate, xPropSet)) + if (GetBoolProperty(gsPropertyIsDate, xPropSet)) { nToken = FIELD_ID_DATE; } @@ -499,10 +502,10 @@ enum FieldIdEnum XMLTextFieldExport::MapFieldName( case FIELD_ID_PAGENUMBER: // NumberingType not available in non-Writer apps if (xPropSet->getPropertySetInfo()-> - hasPropertyByName(sPropertyNumberingType)) + hasPropertyByName(gsPropertyNumberingType)) { if (NumberingType::CHAR_SPECIAL == GetIntProperty( - sPropertyNumberingType, xPropSet)) + gsPropertyNumberingType, xPropSet)) { nToken = FIELD_ID_PAGESTRING; } @@ -510,28 +513,28 @@ enum FieldIdEnum XMLTextFieldExport::MapFieldName( break; case FIELD_ID_DOCINFO_CREATION_TIME: - if (GetBoolProperty(sPropertyIsDate, xPropSet)) + if (GetBoolProperty(gsPropertyIsDate, xPropSet)) { nToken = FIELD_ID_DOCINFO_CREATION_DATE; } break; case FIELD_ID_DOCINFO_PRINT_TIME: - if (GetBoolProperty(sPropertyIsDate, xPropSet)) + if (GetBoolProperty(gsPropertyIsDate, xPropSet)) { nToken = FIELD_ID_DOCINFO_PRINT_DATE; } break; case FIELD_ID_DOCINFO_SAVE_TIME: - if (GetBoolProperty(sPropertyIsDate, xPropSet)) + if (GetBoolProperty(gsPropertyIsDate, xPropSet)) { nToken = FIELD_ID_DOCINFO_SAVE_DATE; } break; case FIELD_ID_REF_REFERENCE: - switch (GetInt16Property(sPropertyReferenceFieldSource, xPropSet)) + switch (GetInt16Property(gsPropertyReferenceFieldSource, xPropSet)) { case ReferenceFieldSource::REFERENCE_MARK: nToken = FIELD_ID_REF_REFERENCE; @@ -626,7 +629,7 @@ bool XMLTextFieldExport::IsStringField( case FIELD_ID_VARIABLE_INPUT: { // depends on field sub type - return ( GetIntProperty(sPropertySubType, xPropSet) == + return ( GetIntProperty(gsPropertySubType, xPropSet) == SetVariableType::STRING ); } @@ -635,18 +638,18 @@ bool XMLTextFieldExport::IsStringField( { Reference<XTextField> xTextField(xPropSet, UNO_QUERY); DBG_ASSERT(xTextField.is(), "field is no XTextField!"); - bool bRet = GetBoolProperty(sPropertyIsExpression, + bool bRet = GetBoolProperty(gsPropertyIsExpression, GetMasterPropertySet(xTextField)); return !bRet; } case FIELD_ID_META: - return 0 > GetIntProperty(sPropertyNumberFormat, xPropSet); + return 0 > GetIntProperty(gsPropertyNumberFormat, xPropSet); case FIELD_ID_DATABASE_DISPLAY: // TODO: depends on... ??? // workaround #no-bug#: no data type - return 5100 == GetIntProperty(sPropertyNumberFormat, xPropSet); + return 5100 == GetIntProperty(gsPropertyNumberFormat, xPropSet); case FIELD_ID_TABLE_FORMULA: // legacy field: always a number field (because it always has @@ -760,7 +763,7 @@ void XMLTextFieldExport::ExportFieldAutoStyle( // insert this text field master OUString sFieldMasterName = GetStringProperty( - sPropertyInstanceName, xDepField->getTextFieldMaster()); + gsPropertyInstanceName, xDepField->getTextFieldMaster()); if (!sFieldMasterName.isEmpty()) aMapIter->second.insert( sFieldMasterName ); } @@ -785,10 +788,10 @@ void XMLTextFieldExport::ExportFieldAutoStyle( case FIELD_ID_DATABASE_DISPLAY: { - sal_Int32 nFormat = GetIntProperty(sPropertyNumberFormat, xPropSet); + sal_Int32 nFormat = GetIntProperty(gsPropertyNumberFormat, xPropSet); // workaround: #no-bug#; see IsStringField(...) if ( (5100 != nFormat) && - !GetBoolProperty(sPropertyIsDataBaseFormat, xPropSet) ) + !GetBoolProperty(gsPropertyIsDataBaseFormat, xPropSet) ) { GetExport().addDataStyle(nFormat); } @@ -803,17 +806,17 @@ void XMLTextFieldExport::ExportFieldAutoStyle( // support it) Reference<XPropertySetInfo> xPropSetInfo( xPropSet->getPropertySetInfo() ); - if ( xPropSetInfo->hasPropertyByName( sPropertyNumberFormat ) ) + if ( xPropSetInfo->hasPropertyByName( gsPropertyNumberFormat ) ) { sal_Int32 nFormat = - GetIntProperty(sPropertyNumberFormat, xPropSet); + GetIntProperty(gsPropertyNumberFormat, xPropSet); // nFormat may be -1 for numeric fields that display their // variable name. (Maybe this should be a field type, then?) if (nFormat != -1) { if( ! GetOptionalBoolProperty( - sPropertyIsFixedLanguage, + gsPropertyIsFixedLanguage, xPropSet, xPropSetInfo, false ) ) { nFormat = @@ -853,7 +856,7 @@ void XMLTextFieldExport::ExportFieldAutoStyle( if (! IsStringField(nToken, xPropSet)) { sal_Int32 nFormat = - GetIntProperty(sPropertyNumberFormat, xPropSet); + GetIntProperty(gsPropertyNumberFormat, xPropSet); // nFormat may be -1 for numeric fields that display their // variable name. (Maybe this should be a field type, then?) @@ -863,7 +866,7 @@ void XMLTextFieldExport::ExportFieldAutoStyle( // for all these fields (except table formula) if( ( nToken != FIELD_ID_TABLE_FORMULA ) && ! GetOptionalBoolProperty( - sPropertyIsFixedLanguage, + gsPropertyIsFixedLanguage, xPropSet, xPropSet->getPropertySetInfo(), false ) ) { @@ -1017,7 +1020,7 @@ void XMLTextFieldExport::ExportField( GetExport().GetTextParagraphExport() ->GetCharStyleNamesPropInfoCache().hasProperty( xRangePropSet, xRangePropSetInfo ), bHasAutoStyle, - xRangePropSet, sPropertyCharStyleNames ); + xRangePropSet, gsPropertyCharStyleNames ); // export span with style (if necessary) // (except for combined characters field) @@ -1056,10 +1059,10 @@ void XMLTextFieldExport::ExportFieldHelper( switch (nToken) { case FIELD_ID_AUTHOR: // author field: fixed, field (sub-)type - if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed)) + if (xPropSetInfo->hasPropertyByName(gsPropertyIsFixed)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_FIXED, - (GetBoolProperty(sPropertyIsFixed, rPropSet) ? XML_TRUE : XML_FALSE) ); + (GetBoolProperty(gsPropertyIsFixed, rPropSet) ? XML_TRUE : XML_FALSE) ); } ExportElement(MapAuthorFieldName(rPropSet), sPresentation); break; @@ -1067,7 +1070,7 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_SENDER: // sender field: fixed, field (sub-)type ProcessBoolean(XML_FIXED, - GetBoolProperty(sPropertyIsFixed, rPropSet), true); + GetBoolProperty(gsPropertyIsFixed, rPropSet), true); ExportElement(MapSenderFieldName(rPropSet), sPresentation); break; @@ -1075,9 +1078,9 @@ void XMLTextFieldExport::ExportFieldHelper( // placeholder field: type, name, description ProcessString(XML_PLACEHOLDER_TYPE, MapPlaceholderType( - GetInt16Property(sPropertyPlaceholderType, rPropSet))); + GetInt16Property(gsPropertyPlaceholderType, rPropSet))); ProcessString(XML_DESCRIPTION, - GetStringProperty(sPropertyHint,rPropSet), true); + GetStringProperty(gsPropertyHint,rPropSet), true); ExportElement(XML_PLACEHOLDER, sPresentation); break; @@ -1085,20 +1088,20 @@ void XMLTextFieldExport::ExportFieldHelper( { // variable set field: name, visible, format&value ProcessString(XML_NAME, - GetStringProperty(sPropertyVariableName, rPropSet)); - ProcessDisplay(GetBoolProperty(sPropertyIsVisible, rPropSet), + GetStringProperty(gsPropertyVariableName, rPropSet)); + ProcessDisplay(GetBoolProperty(gsPropertyIsVisible, rPropSet), false); ProcessString(XML_FORMULA, XML_NAMESPACE_OOOW, - GetStringProperty(sPropertyContent, rPropSet), + GetStringProperty(gsPropertyContent, rPropSet), sPresentation); ProcessValueAndType(IsStringField(nToken, rPropSet), - GetIntProperty(sPropertyNumberFormat, rPropSet), - GetStringProperty(sPropertyContent, rPropSet), + GetIntProperty(gsPropertyNumberFormat, rPropSet), + GetStringProperty(gsPropertyContent, rPropSet), sPresentation, - GetDoubleProperty(sPropertyValue, rPropSet), + GetDoubleProperty(gsPropertyValue, rPropSet), true, true, true, ! GetOptionalBoolProperty( - sPropertyIsFixedLanguage, + gsPropertyIsFixedLanguage, rPropSet, xPropSetInfo, false ) ); ExportElement(XML_VARIABLE_SET, sPresentation); break; @@ -1107,20 +1110,20 @@ void XMLTextFieldExport::ExportFieldHelper( { // variable get field: name, format&value ProcessString(XML_NAME, - GetStringProperty(sPropertyContent, rPropSet)); - bool bCmd = GetBoolProperty(sPropertyIsShowFormula, rPropSet); + GetStringProperty(gsPropertyContent, rPropSet)); + bool bCmd = GetBoolProperty(gsPropertyIsShowFormula, rPropSet); ProcessDisplay(true, bCmd); // #i81766# for older versions export of the value-type bool bExportValueType = !bCmd && ( GetExport().getExportFlags() & SvXMLExportFlags::SAVEBACKWARDCOMPATIBLE ); // show style, unless name will be shown ProcessValueAndType(IsStringField(nToken, rPropSet), - GetIntProperty(sPropertyNumberFormat, rPropSet), + GetIntProperty(gsPropertyNumberFormat, rPropSet), "", "", 0.0, // values not used false, bExportValueType, !bCmd, ! GetOptionalBoolProperty( - sPropertyIsFixedLanguage, + gsPropertyIsFixedLanguage, rPropSet, xPropSetInfo, false ) ); ExportElement(XML_VARIABLE_GET, sPresentation); break; @@ -1128,22 +1131,22 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_VARIABLE_INPUT: // variable input field: name, description, format&value ProcessString(XML_NAME, - GetStringProperty(sPropertyVariableName, rPropSet)); + GetStringProperty(gsPropertyVariableName, rPropSet)); ProcessString(XML_DESCRIPTION, - GetStringProperty(sPropertyHint , rPropSet)); - ProcessDisplay(GetBoolProperty(sPropertyIsVisible, rPropSet), + GetStringProperty(gsPropertyHint , rPropSet)); + ProcessDisplay(GetBoolProperty(gsPropertyIsVisible, rPropSet), false); ProcessString(XML_FORMULA, XML_NAMESPACE_OOOW, - GetStringProperty(sPropertyContent, rPropSet), + GetStringProperty(gsPropertyContent, rPropSet), sPresentation); ProcessValueAndType(IsStringField(nToken, rPropSet), - GetIntProperty(sPropertyNumberFormat, rPropSet), - GetStringProperty(sPropertyContent, rPropSet), + GetIntProperty(gsPropertyNumberFormat, rPropSet), + GetStringProperty(gsPropertyContent, rPropSet), sPresentation, - GetDoubleProperty(sPropertyValue, rPropSet), + GetDoubleProperty(gsPropertyValue, rPropSet), true, true, true, ! GetOptionalBoolProperty( - sPropertyIsFixedLanguage, + gsPropertyIsFixedLanguage, rPropSet, xPropSetInfo, false ) ); ExportElement(XML_VARIABLE_INPUT, sPresentation); break; @@ -1151,20 +1154,20 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_USER_GET: // user field: name, hidden, style { - bool bCmd = GetBoolProperty(sPropertyIsShowFormula, rPropSet); - ProcessDisplay(GetBoolProperty(sPropertyIsVisible, rPropSet), + bool bCmd = GetBoolProperty(gsPropertyIsShowFormula, rPropSet); + ProcessDisplay(GetBoolProperty(gsPropertyIsVisible, rPropSet), bCmd); ProcessValueAndType(IsStringField(nToken, rPropSet), - GetIntProperty(sPropertyNumberFormat, rPropSet), + GetIntProperty(gsPropertyNumberFormat, rPropSet), "", "", 0.0, // values not used false, false, !bCmd, ! GetOptionalBoolProperty( - sPropertyIsFixedLanguage, + gsPropertyIsFixedLanguage, rPropSet, xPropSetInfo, false ) ); // name from FieldMaster ProcessString(XML_NAME, - GetStringProperty(sPropertyName, + GetStringProperty(gsPropertyName, GetMasterPropertySet(rTextField))); ExportElement(XML_USER_FIELD_GET, sPresentation); break; @@ -1176,26 +1179,26 @@ void XMLTextFieldExport::ExportFieldHelper( // GetStringProperty(sPropertyName, // GetMasterPropertySet(rTextField))); ProcessString(XML_NAME, - GetStringProperty(sPropertyContent, rPropSet)); + GetStringProperty(gsPropertyContent, rPropSet)); ProcessString(XML_DESCRIPTION, - GetStringProperty(sPropertyHint, rPropSet)); + GetStringProperty(gsPropertyHint, rPropSet)); ExportElement(XML_USER_FIELD_INPUT, sPresentation); break; case FIELD_ID_SEQUENCE: { // sequence field: name, formula, seq-format - OUString sName = GetStringProperty(sPropertyVariableName, rPropSet); + OUString sName = GetStringProperty(gsPropertyVariableName, rPropSet); // TODO: use reference name only if actually being referenced. ProcessString(XML_REF_NAME, MakeSequenceRefName( - GetInt16Property(sPropertySequenceValue, rPropSet), + GetInt16Property(gsPropertySequenceValue, rPropSet), sName)); ProcessString(XML_NAME, sName); ProcessString(XML_FORMULA, XML_NAMESPACE_OOOW, - GetStringProperty(sPropertyContent, rPropSet), + GetStringProperty(gsPropertyContent, rPropSet), sPresentation); - ProcessNumberingType(GetInt16Property(sPropertyNumberingType, + ProcessNumberingType(GetInt16Property(gsPropertyNumberingType, rPropSet)); ExportElement(XML_SEQUENCE, sPresentation); break; @@ -1204,19 +1207,19 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_EXPRESSION: { // formula field: formula, format&value - bool bCmd = GetBoolProperty(sPropertyIsShowFormula, rPropSet); + bool bCmd = GetBoolProperty(gsPropertyIsShowFormula, rPropSet); ProcessString(XML_FORMULA, XML_NAMESPACE_OOOW, - GetStringProperty(sPropertyContent, rPropSet), + GetStringProperty(gsPropertyContent, rPropSet), sPresentation); ProcessDisplay(true, bCmd); ProcessValueAndType(IsStringField(nToken, rPropSet), - GetIntProperty(sPropertyNumberFormat, rPropSet), - GetStringProperty(sPropertyContent, rPropSet), + GetIntProperty(gsPropertyNumberFormat, rPropSet), + GetStringProperty(gsPropertyContent, rPropSet), sPresentation, - GetDoubleProperty(sPropertyValue, rPropSet), + GetDoubleProperty(gsPropertyValue, rPropSet), !bCmd, !bCmd, !bCmd, ! GetOptionalBoolProperty( - sPropertyIsFixedLanguage, + gsPropertyIsFixedLanguage, rPropSet, xPropSetInfo, false ) ); ExportElement(XML_EXPRESSION, sPresentation); break; @@ -1225,51 +1228,51 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_TEXT_INPUT: // text input field: description and string-value ProcessString(XML_DESCRIPTION, - GetStringProperty(sPropertyHint, rPropSet)); + GetStringProperty(gsPropertyHint, rPropSet)); ProcessString(XML_HELP, - GetStringProperty(sPropertyHelp, rPropSet), true); + GetStringProperty(gsPropertyHelp, rPropSet), true); ProcessString(XML_HINT, - GetStringProperty(sPropertyTooltip, rPropSet), true); + GetStringProperty(gsPropertyTooltip, rPropSet), true); ExportElement(XML_TEXT_INPUT, sPresentation); break; case FIELD_ID_TIME: // all properties (except IsDate) are optional! - if (xPropSetInfo->hasPropertyByName(sPropertyNumberFormat)) + if (xPropSetInfo->hasPropertyByName(gsPropertyNumberFormat)) { ProcessValueAndType(false, - GetIntProperty(sPropertyNumberFormat,rPropSet), + GetIntProperty(gsPropertyNumberFormat,rPropSet), "", "", 0.0, // not used false, false, true, ! GetOptionalBoolProperty( - sPropertyIsFixedLanguage, + gsPropertyIsFixedLanguage, rPropSet, xPropSetInfo, false ), true); } - if (xPropSetInfo->hasPropertyByName(sPropertyDateTimeValue)) + if (xPropSetInfo->hasPropertyByName(gsPropertyDateTimeValue)) { // no value -> current time ProcessTimeOrDateTime(XML_TIME_VALUE, - GetDateTimeProperty(sPropertyDateTimeValue, + GetDateTimeProperty(gsPropertyDateTimeValue, rPropSet)); } - if (xPropSetInfo->hasPropertyByName(sPropertyDateTime)) + if (xPropSetInfo->hasPropertyByName(gsPropertyDateTime)) { // no value -> current time ProcessTimeOrDateTime(XML_TIME_VALUE, - GetDateTimeProperty(sPropertyDateTime,rPropSet)); + GetDateTimeProperty(gsPropertyDateTime,rPropSet)); } - if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed)) + if (xPropSetInfo->hasPropertyByName(gsPropertyIsFixed)) { ProcessBoolean(XML_FIXED, - GetBoolProperty(sPropertyIsFixed, rPropSet), + GetBoolProperty(gsPropertyIsFixed, rPropSet), false); } - if (xPropSetInfo->hasPropertyByName(sPropertyAdjust)) + if (xPropSetInfo->hasPropertyByName(gsPropertyAdjust)) { // adjust value given as integer in minutes ProcessDateTime(XML_TIME_ADJUST, - GetIntProperty(sPropertyAdjust, rPropSet), + GetIntProperty(gsPropertyAdjust, rPropSet), false, true); } ExportElement(XML_TIME, sPresentation); @@ -1277,40 +1280,40 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_DATE: // all properties (except IsDate) are optional! - if (xPropSetInfo->hasPropertyByName(sPropertyNumberFormat)) + if (xPropSetInfo->hasPropertyByName(gsPropertyNumberFormat)) { ProcessValueAndType(false, - GetIntProperty(sPropertyNumberFormat,rPropSet), + GetIntProperty(gsPropertyNumberFormat,rPropSet), "", "", 0.0, // not used false, false, true, ! GetOptionalBoolProperty( - sPropertyIsFixedLanguage, + gsPropertyIsFixedLanguage, rPropSet, xPropSetInfo, false ) ); } - if (xPropSetInfo->hasPropertyByName(sPropertyDateTimeValue)) + if (xPropSetInfo->hasPropertyByName(gsPropertyDateTimeValue)) { // no value -> current date ProcessDateTime(XML_DATE_VALUE, - GetDateTimeProperty(sPropertyDateTimeValue, + GetDateTimeProperty(gsPropertyDateTimeValue, rPropSet)); } // TODO: remove double-handling after SRC614 - else if (xPropSetInfo->hasPropertyByName(sPropertyDateTime)) + else if (xPropSetInfo->hasPropertyByName(gsPropertyDateTime)) { ProcessDateTime(XML_DATE_VALUE, - GetDateTimeProperty(sPropertyDateTime,rPropSet)); + GetDateTimeProperty(gsPropertyDateTime,rPropSet)); } - if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed)) + if (xPropSetInfo->hasPropertyByName(gsPropertyIsFixed)) { ProcessBoolean(XML_FIXED, - GetBoolProperty(sPropertyIsFixed, rPropSet), + GetBoolProperty(gsPropertyIsFixed, rPropSet), false); } - if (xPropSetInfo->hasPropertyByName(sPropertyAdjust)) + if (xPropSetInfo->hasPropertyByName(gsPropertyAdjust)) { // adjust value given as number of days ProcessDateTime(XML_DATE_ADJUST, - GetIntProperty(sPropertyAdjust, rPropSet), + GetIntProperty(gsPropertyAdjust, rPropSet), true, true); } ExportElement(XML_DATE, sPresentation); @@ -1318,16 +1321,16 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_PAGENUMBER: // all properties are optional - if (xPropSetInfo->hasPropertyByName(sPropertyNumberingType)) + if (xPropSetInfo->hasPropertyByName(gsPropertyNumberingType)) { - ProcessNumberingType(GetInt16Property(sPropertyNumberingType, + ProcessNumberingType(GetInt16Property(gsPropertyNumberingType, rPropSet)); } - if (xPropSetInfo->hasPropertyByName(sPropertyOffset)) + if (xPropSetInfo->hasPropertyByName(gsPropertyOffset)) { - sal_Int32 nAdjust = GetIntProperty(sPropertyOffset, rPropSet); + sal_Int32 nAdjust = GetIntProperty(gsPropertyOffset, rPropSet); - if (xPropSetInfo->hasPropertyByName(sPropertySubType)) + if (xPropSetInfo->hasPropertyByName(gsPropertySubType)) { // property SubType used in MapPageNumebrName ProcessString(XML_SELECT_PAGE, @@ -1341,7 +1344,7 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_PAGESTRING: { ProcessString(XML_STRING_VALUE, - GetStringProperty(sPropertyUserText, rPropSet), + GetStringProperty(gsPropertyUserText, rPropSet), sPresentation); sal_Int32 nDummy = 0; // MapPageNumberName need int ProcessString(XML_SELECT_PAGE, MapPageNumberName(rPropSet, nDummy)); @@ -1354,9 +1357,9 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_DATABASE_NAME: ProcessString(XML_TABLE_NAME, - GetStringProperty(sPropertyDataTableName, rPropSet)); - ProcessCommandType(GetIntProperty(sPropertyDataCommandType, rPropSet)); - ProcessDisplay(GetBoolProperty(sPropertyIsVisible, rPropSet), + GetStringProperty(gsPropertyDataTableName, rPropSet)); + ProcessCommandType(GetIntProperty(gsPropertyDataCommandType, rPropSet)); + ProcessDisplay(GetBoolProperty(gsPropertyIsVisible, rPropSet), false); ExportDataBaseElement(XML_DATABASE_NAME, sPresentation, rPropSet, xPropSetInfo); @@ -1364,13 +1367,13 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_DATABASE_NUMBER: ProcessString(XML_TABLE_NAME, - GetStringProperty(sPropertyDataTableName, rPropSet)); - ProcessCommandType(GetIntProperty(sPropertyDataCommandType, rPropSet)); + GetStringProperty(gsPropertyDataTableName, rPropSet)); + ProcessCommandType(GetIntProperty(gsPropertyDataCommandType, rPropSet)); ProcessNumberingType( - GetInt16Property(sPropertyNumberingType,rPropSet)); + GetInt16Property(gsPropertyNumberingType,rPropSet)); ProcessInteger(XML_VALUE, - GetIntProperty(sPropertySetNumber, rPropSet)); - ProcessDisplay(GetBoolProperty(sPropertyIsVisible, rPropSet), + GetIntProperty(gsPropertySetNumber, rPropSet)); + ProcessDisplay(GetBoolProperty(gsPropertyIsVisible, rPropSet), false); ExportDataBaseElement(XML_DATABASE_ROW_NUMBER, sPresentation, rPropSet, xPropSetInfo); @@ -1378,10 +1381,10 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_DATABASE_NEXT: ProcessString(XML_TABLE_NAME, - GetStringProperty(sPropertyDataTableName, rPropSet)); - ProcessCommandType(GetIntProperty(sPropertyDataCommandType, rPropSet)); + GetStringProperty(gsPropertyDataTableName, rPropSet)); + ProcessCommandType(GetIntProperty(gsPropertyDataCommandType, rPropSet)); ProcessString(XML_CONDITION, XML_NAMESPACE_OOOW, - GetStringProperty(sPropertyCondition, rPropSet)); + GetStringProperty(gsPropertyCondition, rPropSet)); DBG_ASSERT(sPresentation.isEmpty(), "Unexpected presentation for database next field"); ExportDataBaseElement(XML_DATABASE_NEXT, OUString(), @@ -1390,12 +1393,12 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_DATABASE_SELECT: ProcessString(XML_TABLE_NAME, - GetStringProperty(sPropertyDataTableName, rPropSet)); - ProcessCommandType(GetIntProperty(sPropertyDataCommandType, rPropSet)); + GetStringProperty(gsPropertyDataTableName, rPropSet)); + ProcessCommandType(GetIntProperty(gsPropertyDataCommandType, rPropSet)); ProcessString(XML_CONDITION, XML_NAMESPACE_OOOW, - GetStringProperty(sPropertyCondition, rPropSet)); + GetStringProperty(gsPropertyCondition, rPropSet)); ProcessInteger(XML_ROW_NUMBER, - GetIntProperty(sPropertySetNumber, rPropSet)); + GetIntProperty(gsPropertySetNumber, rPropSet)); DBG_ASSERT(sPresentation.isEmpty(), "Unexpected presentation for database select field"); ExportDataBaseElement(XML_DATABASE_ROW_SELECT, OUString(), @@ -1407,19 +1410,19 @@ void XMLTextFieldExport::ExportFieldHelper( // get database, table and column name from field master const Reference<XPropertySet> & xMaster = GetMasterPropertySet(rTextField); ProcessString(XML_TABLE_NAME, - GetStringProperty(sPropertyDataTableName, xMaster)); - ProcessCommandType(GetIntProperty(sPropertyDataCommandType, xMaster)); + GetStringProperty(gsPropertyDataTableName, xMaster)); + ProcessCommandType(GetIntProperty(gsPropertyDataCommandType, xMaster)); ProcessString(XML_COLUMN_NAME, - GetStringProperty(sPropertyDataColumnName, xMaster)); + GetStringProperty(gsPropertyDataColumnName, xMaster)); // export number format if available (happens only for numbers!) - if (!GetBoolProperty(sPropertyIsDataBaseFormat, rPropSet)) + if (!GetBoolProperty(gsPropertyIsDataBaseFormat, rPropSet)) { ProcessValueAndType(false, // doesn't happen for text - GetIntProperty(sPropertyNumberFormat,rPropSet), + GetIntProperty(gsPropertyNumberFormat,rPropSet), "", "", 0.0, // not used false, false, true, false); } - ProcessDisplay(GetBoolProperty(sPropertyIsVisible, rPropSet), + ProcessDisplay(GetBoolProperty(gsPropertyIsVisible, rPropSet), false); ExportDataBaseElement(XML_DATABASE_DISPLAY, sPresentation, xMaster, xMaster->getPropertySetInfo()); @@ -1428,7 +1431,7 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_DOCINFO_REVISION: ProcessBoolean(XML_FIXED, - GetBoolProperty(sPropertyIsFixed, rPropSet), false); + GetBoolProperty(gsPropertyIsFixed, rPropSet), false); ExportElement(MapDocInfoFieldName(nToken), sPresentation); break; @@ -1440,16 +1443,16 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_DOCINFO_CREATION_DATE: case FIELD_ID_DOCINFO_PRINT_DATE: ProcessValueAndType(false, - GetIntProperty(sPropertyNumberFormat, rPropSet), + GetIntProperty(gsPropertyNumberFormat, rPropSet), "", "", 0.0, false, false, true, ! GetOptionalBoolProperty( - sPropertyIsFixedLanguage, + gsPropertyIsFixedLanguage, rPropSet, xPropSetInfo, false ) ); // todo: export date/time value, but values not available -> core bug ProcessBoolean(XML_FIXED, - GetBoolProperty(sPropertyIsFixed, rPropSet), false); + GetBoolProperty(gsPropertyIsFixed, rPropSet), false); ExportElement(MapDocInfoFieldName(nToken), sPresentation); break; @@ -1460,10 +1463,10 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_DOCINFO_SUBJECT: case FIELD_ID_DOCINFO_KEYWORDS: case FIELD_ID_DOCINFO_SAVE_AUTHOR: - if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed)) + if (xPropSetInfo->hasPropertyByName(gsPropertyIsFixed)) { ProcessBoolean(XML_FIXED, - GetBoolProperty(sPropertyIsFixed, rPropSet), false); + GetBoolProperty(gsPropertyIsFixed, rPropSet), false); } ExportElement(MapDocInfoFieldName(nToken), sPresentation); break; @@ -1471,17 +1474,17 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_DOCINFO_CUSTOM: { ProcessValueAndType(false, // doesn't happen for text - GetIntProperty(sPropertyNumberFormat,rPropSet), + GetIntProperty(gsPropertyNumberFormat,rPropSet), "", "", 0.0, // not used false, false, true, ! GetOptionalBoolProperty( - sPropertyIsFixedLanguage, + gsPropertyIsFixedLanguage, rPropSet, xPropSetInfo, false )); - uno::Any aAny = rPropSet->getPropertyValue( sPropertyName ); + uno::Any aAny = rPropSet->getPropertyValue( gsPropertyName ); OUString sName; aAny >>= sName; ProcessString(XML_NAME, sName); - ProcessBoolean(XML_FIXED, GetBoolProperty(sPropertyIsFixed, rPropSet), false); + ProcessBoolean(XML_FIXED, GetBoolProperty(gsPropertyIsFixed, rPropSet), false); ExportElement(XML_USER_DEFINED, sPresentation); break; } @@ -1495,9 +1498,9 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_COUNT_OBJECTS: // all properties optional (applies to pages only, but I'll do // it for all for sake of common implementation) - if (xPropSetInfo->hasPropertyByName(sPropertyNumberingType)) + if (xPropSetInfo->hasPropertyByName(gsPropertyNumberingType)) { - ProcessNumberingType(GetInt16Property(sPropertyNumberingType, + ProcessNumberingType(GetInt16Property(gsPropertyNumberingType, rPropSet)); } ExportElement(MapCountFieldName(nToken), sPresentation); @@ -1505,33 +1508,33 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_CONDITIONAL_TEXT: ProcessString(XML_CONDITION, XML_NAMESPACE_OOOW, - GetStringProperty(sPropertyCondition, rPropSet)); + GetStringProperty(gsPropertyCondition, rPropSet)); ProcessString(XML_STRING_VALUE_IF_TRUE, - GetStringProperty(sPropertyTrueContent, rPropSet)); + GetStringProperty(gsPropertyTrueContent, rPropSet)); ProcessString(XML_STRING_VALUE_IF_FALSE, - GetStringProperty(sPropertyFalseContent, rPropSet)); + GetStringProperty(gsPropertyFalseContent, rPropSet)); ProcessBoolean(XML_CURRENT_VALUE, - GetBoolProperty(sPropertyIsConditionTrue, rPropSet), + GetBoolProperty(gsPropertyIsConditionTrue, rPropSet), false); ExportElement(XML_CONDITIONAL_TEXT, sPresentation); break; case FIELD_ID_HIDDEN_TEXT: ProcessString(XML_CONDITION, XML_NAMESPACE_OOOW, - GetStringProperty(sPropertyCondition, rPropSet)); + GetStringProperty(gsPropertyCondition, rPropSet)); ProcessString(XML_STRING_VALUE, - GetStringProperty(sPropertyContent, rPropSet)); + GetStringProperty(gsPropertyContent, rPropSet)); ProcessBoolean(XML_IS_HIDDEN, - GetBoolProperty(sPropertyIsHidden, rPropSet), + GetBoolProperty(gsPropertyIsHidden, rPropSet), false); ExportElement(XML_HIDDEN_TEXT, sPresentation); break; case FIELD_ID_HIDDEN_PARAGRAPH: ProcessString(XML_CONDITION, XML_NAMESPACE_OOOW, - GetStringProperty(sPropertyCondition, rPropSet)); + GetStringProperty(gsPropertyCondition, rPropSet)); ProcessBoolean(XML_IS_HIDDEN, - GetBoolProperty(sPropertyIsHidden, rPropSet), + GetBoolProperty(gsPropertyIsHidden, rPropSet), false); DBG_ASSERT(sPresentation.isEmpty(), "Unexpected presentation for hidden paragraph field"); @@ -1541,32 +1544,32 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_TEMPLATE_NAME: ProcessString(XML_DISPLAY, MapTemplateDisplayFormat( - GetInt16Property(sPropertyFileFormat, rPropSet))); + GetInt16Property(gsPropertyFileFormat, rPropSet))); ExportElement(XML_TEMPLATE_NAME, sPresentation); break; case FIELD_ID_CHAPTER: ProcessString(XML_DISPLAY, MapChapterDisplayFormat( - GetInt16Property(sPropertyChapterFormat, rPropSet))); + GetInt16Property(gsPropertyChapterFormat, rPropSet))); // API numbers 0..9, we number 1..10 ProcessInteger(XML_OUTLINE_LEVEL, - GetInt8Property(sPropertyLevel, rPropSet) + 1); + GetInt8Property(gsPropertyLevel, rPropSet) + 1); ExportElement(XML_CHAPTER, sPresentation); break; case FIELD_ID_FILE_NAME: // all properties are optional - if (xPropSetInfo->hasPropertyByName(sPropertyFileFormat)) + if (xPropSetInfo->hasPropertyByName(gsPropertyFileFormat)) { ProcessString(XML_DISPLAY, MapFilenameDisplayFormat( - GetInt16Property(sPropertyFileFormat, rPropSet))); + GetInt16Property(gsPropertyFileFormat, rPropSet))); } - if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed)) + if (xPropSetInfo->hasPropertyByName(gsPropertyIsFixed)) { ProcessBoolean(XML_FIXED, - GetBoolProperty(sPropertyIsFixed, rPropSet), + GetBoolProperty(gsPropertyIsFixed, rPropSet), false); } ExportElement(XML_FILE_NAME, sPresentation); @@ -1574,9 +1577,9 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_REFPAGE_SET: ProcessBoolean(XML_ACTIVE, - GetBoolProperty(sPropertyOn, rPropSet), true); + GetBoolProperty(gsPropertyOn, rPropSet), true); ProcessIntegerDef(XML_PAGE_ADJUST, - GetInt16Property(sPropertyOffset, rPropSet), 0); + GetInt16Property(gsPropertyOffset, rPropSet), 0); DBG_ASSERT(sPresentation.isEmpty(), "Unexpected presentation page variable field"); ExportElement(XML_PAGE_VARIABLE_SET); @@ -1584,7 +1587,7 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_REFPAGE_GET: ProcessNumberingType( - GetInt16Property(sPropertyNumberingType, rPropSet)); + GetInt16Property(gsPropertyNumberingType, rPropSet)); ExportElement(XML_PAGE_VARIABLE_GET, sPresentation); break; @@ -1597,22 +1600,22 @@ void XMLTextFieldExport::ExportFieldHelper( // was: if (nSeqNumber != -1) ... ProcessString(XML_REFERENCE_FORMAT, MapReferenceType(GetInt16Property( - sPropertyReferenceFieldPart, rPropSet)), + gsPropertyReferenceFieldPart, rPropSet)), XML_TEMPLATE); ProcessString(XML_REF_NAME, MakeSequenceRefName( - GetInt16Property(sPropertySequenceNumber, rPropSet), - GetStringProperty(sPropertySourceName, rPropSet) ) ); - if (xPropSetInfo->hasPropertyByName(sPropertyReferenceFieldLanguage) && + GetInt16Property(gsPropertySequenceNumber, rPropSet), + GetStringProperty(gsPropertySourceName, rPropSet) ) ); + if (xPropSetInfo->hasPropertyByName(gsPropertyReferenceFieldLanguage) && SvtSaveOptions().GetODFDefaultVersion() > SvtSaveOptions::ODFVER_012) { // export text:reference-language attribute, if not empty ProcessString(XML_REFERENCE_LANGUAGE, - GetStringProperty(sPropertyReferenceFieldLanguage, rPropSet), true, XML_NAMESPACE_LO_EXT); + GetStringProperty(gsPropertyReferenceFieldLanguage, rPropSet), true, XML_NAMESPACE_LO_EXT); } ExportElement( MapReferenceSource( - GetInt16Property(sPropertyReferenceFieldSource, rPropSet)), + GetInt16Property(gsPropertyReferenceFieldSource, rPropSet)), sPresentation); break; @@ -1621,20 +1624,20 @@ void XMLTextFieldExport::ExportFieldHelper( // reference to bookmarks, references: format, name (and element) ProcessString(XML_REFERENCE_FORMAT, MapReferenceType(GetInt16Property( - sPropertyReferenceFieldPart, rPropSet)), + gsPropertyReferenceFieldPart, rPropSet)), XML_TEMPLATE); ProcessString(XML_REF_NAME, - GetStringProperty(sPropertySourceName, rPropSet)); - if (xPropSetInfo->hasPropertyByName(sPropertyReferenceFieldLanguage) && + GetStringProperty(gsPropertySourceName, rPropSet)); + if (xPropSetInfo->hasPropertyByName(gsPropertyReferenceFieldLanguage) && SvtSaveOptions().GetODFDefaultVersion() > SvtSaveOptions::ODFVER_012) { // export text:reference-language attribute, if not empty ProcessString(XML_REFERENCE_LANGUAGE, - GetStringProperty(sPropertyReferenceFieldLanguage, rPropSet), true, XML_NAMESPACE_LO_EXT); + GetStringProperty(gsPropertyReferenceFieldLanguage, rPropSet), true, XML_NAMESPACE_LO_EXT); } ExportElement( MapReferenceSource(GetInt16Property( - sPropertyReferenceFieldSource, rPropSet)), + gsPropertyReferenceFieldSource, rPropSet)), sPresentation); break; @@ -1645,21 +1648,21 @@ void XMLTextFieldExport::ExportFieldHelper( FIELD_ID_REF_ENDNOTE==nToken ? XML_ENDNOTE : XML_FOOTNOTE ); ProcessString(XML_REFERENCE_FORMAT, MapReferenceType(GetInt16Property( - sPropertyReferenceFieldPart, rPropSet)), + gsPropertyReferenceFieldPart, rPropSet)), XML_TEMPLATE); ProcessString(XML_REF_NAME, MakeFootnoteRefName(GetInt16Property( - sPropertySequenceNumber, rPropSet))); - if (xPropSetInfo->hasPropertyByName(sPropertyReferenceFieldLanguage) && + gsPropertySequenceNumber, rPropSet))); + if (xPropSetInfo->hasPropertyByName(gsPropertyReferenceFieldLanguage) && SvtSaveOptions().GetODFDefaultVersion() > SvtSaveOptions::ODFVER_012) { // export text:reference-language attribute, if not empty ProcessString(XML_REFERENCE_LANGUAGE, - GetStringProperty(sPropertyReferenceFieldLanguage, rPropSet), true, XML_NAMESPACE_LO_EXT); + GetStringProperty(gsPropertyReferenceFieldLanguage, rPropSet), true, XML_NAMESPACE_LO_EXT); } ExportElement( MapReferenceSource(GetInt16Property( - sPropertyReferenceFieldSource, rPropSet)), + gsPropertyReferenceFieldSource, rPropSet)), sPresentation); break; @@ -1667,7 +1670,7 @@ void XMLTextFieldExport::ExportFieldHelper( // name from field master ProcessString(XML_CONNECTION_NAME, - GetStringProperty(sPropertyName, + GetStringProperty(gsPropertyName, GetMasterPropertySet(rTextField))); ExportElement(XML_DDE_CONNECTION, sPresentation); break; @@ -1691,10 +1694,10 @@ void XMLTextFieldExport::ExportFieldHelper( { // this field is a special case because it gets mapped onto a // hyperlink, rather than one of the regular text field. - ProcessString(XML_HREF, GetExport().GetRelativeReference(GetStringProperty(sPropertyURL, rPropSet)), + ProcessString(XML_HREF, GetExport().GetRelativeReference(GetStringProperty(gsPropertyURL, rPropSet)), false, XML_NAMESPACE_XLINK); ProcessString(XML_TARGET_FRAME_NAME, - GetStringProperty(sPropertyTargetFrame,rPropSet), + GetStringProperty(gsPropertyTargetFrame,rPropSet), true, XML_NAMESPACE_OFFICE); GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); SvXMLElementExport aUrlField(rExport, XML_NAMESPACE_TEXT, XML_A, @@ -1712,21 +1715,21 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_SCRIPT: ProcessString(XML_LANGUAGE, - GetStringProperty(sPropertyScriptType, rPropSet), + GetStringProperty(gsPropertyScriptType, rPropSet), true, XML_NAMESPACE_SCRIPT); DBG_ASSERT(sPresentation.isEmpty(), "Unexpected presentation for script field"); - if (GetBoolProperty(sPropertyURLContent, rPropSet)) + if (GetBoolProperty(gsPropertyURLContent, rPropSet)) { ProcessString(XML_HREF, - GetExport().GetRelativeReference(GetStringProperty(sPropertyContent, rPropSet)), + GetExport().GetRelativeReference(GetStringProperty(gsPropertyContent, rPropSet)), false, XML_NAMESPACE_XLINK); ExportElement(XML_SCRIPT); } else { ExportElement(XML_SCRIPT, - GetStringProperty(sPropertyContent, rPropSet)); + GetStringProperty(gsPropertyContent, rPropSet)); } break; @@ -1738,14 +1741,14 @@ void XMLTextFieldExport::ExportFieldHelper( // annotation element + content OUString aName; - rPropSet->getPropertyValue(sPropertyName) >>= aName; + rPropSet->getPropertyValue(gsPropertyName) >>= aName; if (!aName.isEmpty()) GetExport().AddAttribute(XML_NAMESPACE_OFFICE, XML_NAME, aName); SvXMLElementExport aElem(GetExport(), XML_NAMESPACE_OFFICE, XML_ANNOTATION, false, true); // author - OUString aAuthor( GetStringProperty(sPropertyAuthor, rPropSet) ); + OUString aAuthor( GetStringProperty(gsPropertyAuthor, rPropSet) ); if( !aAuthor.isEmpty() ) { SvXMLElementExport aCreatorElem( GetExport(), XML_NAMESPACE_DC, @@ -1755,7 +1758,7 @@ void XMLTextFieldExport::ExportFieldHelper( } // date time - util::DateTime aDate( GetDateTimeProperty(sPropertyDateTimeValue, rPropSet) ); + util::DateTime aDate( GetDateTimeProperty(gsPropertyDateTimeValue, rPropSet) ); { OUStringBuffer aBuffer; ::sax::Converter::convertDateTime(aBuffer, aDate, nullptr, true); @@ -1768,7 +1771,7 @@ void XMLTextFieldExport::ExportFieldHelper( if (SvtSaveOptions().GetODFDefaultVersion() > SvtSaveOptions::ODFVER_012) { // initials - OUString aInitials( GetStringProperty(sPropertyInitials, rPropSet) ); + OUString aInitials( GetStringProperty(gsPropertyInitials, rPropSet) ); if( !aInitials.isEmpty() ) { // TODO: see OFFICE-3776 export meta:creator-initials for ODF 1.3 @@ -1782,7 +1785,7 @@ void XMLTextFieldExport::ExportFieldHelper( css::uno::Reference < css::text::XText > xText; try { - css::uno::Any aRet = rPropSet->getPropertyValue(sPropertyTextRange); + css::uno::Any aRet = rPropSet->getPropertyValue(gsPropertyTextRange); aRet >>= xText; } catch ( css::uno::Exception& ) @@ -1791,7 +1794,7 @@ void XMLTextFieldExport::ExportFieldHelper( if ( xText.is() ) GetExport().GetTextParagraphExport()->exportText( xText ); else - ProcessParagraphSequence(GetStringProperty(sPropertyContent,rPropSet)); + ProcessParagraphSequence(GetStringProperty(gsPropertyContent,rPropSet)); break; } @@ -1812,18 +1815,18 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_MEASURE: { - ProcessString(XML_KIND, MapMeasureKind(GetInt16Property(sPropertyMeasureKind, rPropSet))); + ProcessString(XML_KIND, MapMeasureKind(GetInt16Property(gsPropertyMeasureKind, rPropSet))); ExportElement( XML_MEASURE, sPresentation ); break; } case FIELD_ID_TABLE_FORMULA: ProcessString( XML_FORMULA, XML_NAMESPACE_OOOW, - GetStringProperty(sPropertyContent, rPropSet) ); + GetStringProperty(gsPropertyContent, rPropSet) ); ProcessDisplay( true, - GetBoolProperty(sPropertyIsShowFormula, rPropSet) ); + GetBoolProperty(gsPropertyIsShowFormula, rPropSet) ); ProcessValueAndType( false, - GetIntProperty(sPropertyNumberFormat, rPropSet), + GetIntProperty(gsPropertyNumberFormat, rPropSet), "", "", 0.0f, false, false, true, false ); @@ -1832,17 +1835,17 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_DROP_DOWN: { - ProcessString(XML_NAME, GetStringProperty(sPropertyName, rPropSet)); + ProcessString(XML_NAME, GetStringProperty(gsPropertyName, rPropSet)); ProcessString(XML_HELP, - GetStringProperty(sPropertyHelp, rPropSet), true); + GetStringProperty(gsPropertyHelp, rPropSet), true); ProcessString(XML_HINT, - GetStringProperty(sPropertyTooltip, rPropSet), true); + GetStringProperty(gsPropertyTooltip, rPropSet), true); SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, XML_DROP_DOWN, false, false ); ProcessStringSequence - (GetStringSequenceProperty( sPropertyItems, rPropSet ), - GetStringProperty( sPropertySelectedItem, rPropSet ) ); + (GetStringSequenceProperty( gsPropertyItems, rPropSet ), + GetStringProperty( gsPropertySelectedItem, rPropSet ) ); GetExport().Characters( sPresentation ); } @@ -1968,7 +1971,7 @@ void XMLTextFieldExport::ExportFieldDeclarations( // save interesting field masters if (sFieldMasterType == FIELD_SERVICE_SETEXP) { - sal_Int32 nType = GetIntProperty(sPropertySubType, xPropSet); + sal_Int32 nType = GetIntProperty(gsPropertySubType, xPropSet); // sequence or variable? if ( SetVariableType::SEQUENCE == nType ) @@ -2021,7 +2024,7 @@ void XMLTextFieldExport::ExportFieldDeclarations( ExplodeFieldMasterName(sName, sFieldMasterType, sVarName); // determine string/numeric field - bool bIsString = ( GetIntProperty(sPropertySubType, xPropSet) + bool bIsString = ( GetIntProperty(gsPropertySubType, xPropSet) == SetVariableType::STRING ); // get dependent field property set @@ -2031,7 +2034,7 @@ void XMLTextFieldExport::ExportFieldDeclarations( // process value and type. ProcessValueAndType( bIsString, - GetIntProperty(sPropertyNumberFormat, xFieldPropSet), + GetIntProperty(gsPropertyNumberFormat, xFieldPropSet), "", "", 0.0, false, true, false, false); } @@ -2081,7 +2084,7 @@ void XMLTextFieldExport::ExportFieldDeclarations( // outline level sal_Int32 nLevel = 1 + GetIntProperty( - sPropertyChapterNumberingLevel, xPropSet); + gsPropertyChapterNumberingLevel, xPropSet); DBG_ASSERT(nLevel >= 0, "illegal outline level"); DBG_ASSERT(nLevel < 127, "possible illegal outline level"); ProcessInteger(XML_DISPLAY_OUTLINE_LEVEL, nLevel); @@ -2089,7 +2092,7 @@ void XMLTextFieldExport::ExportFieldDeclarations( // separation character if (nLevel > 0) { ProcessString(XML_SEPARATION_CHARACTER, GetStringProperty( - sPropertyNumberingSeparator, xPropSet)); + gsPropertyNumberingSeparator, xPropSet)); } ProcessString(XML_NAME, sVarName); ExportElement(XML_SEQUENCE_DECL, true); @@ -2121,13 +2124,13 @@ void XMLTextFieldExport::ExportFieldDeclarations( OUString sVarName; ExplodeFieldMasterName(sName, sFieldMasterType, sVarName); - if (GetBoolProperty(sPropertyIsExpression, xPropSet)) + if (GetBoolProperty(gsPropertyIsExpression, xPropSet)) { // expression: ProcessValueAndType( false, 0, "", "", - GetDoubleProperty(sPropertyValue, xPropSet), + GetDoubleProperty(gsPropertyValue, xPropSet), true, true, false, @@ -2139,7 +2142,7 @@ void XMLTextFieldExport::ExportFieldDeclarations( ProcessString(XML_VALUE_TYPE, XML_STRING, XML_NAMESPACE_OFFICE); ProcessString(XML_STRING_VALUE, - GetStringProperty(sPropertyContent, xPropSet), + GetStringProperty(gsPropertyContent, xPropSet), false, XML_NAMESPACE_OFFICE ); } ProcessString(XML_NAME, sVarName); @@ -2173,25 +2176,25 @@ void XMLTextFieldExport::ExportFieldDeclarations( { ProcessString(XML_NAME, - GetStringProperty(sPropertyName, xPropSet), + GetStringProperty(gsPropertyName, xPropSet), false, XML_NAMESPACE_OFFICE); // export elements; can't use ProcessString because // elements are in office namespace ProcessString(XML_DDE_APPLICATION, - GetStringProperty(sPropertyDDECommandType, + GetStringProperty(gsPropertyDDECommandType, xPropSet), false, XML_NAMESPACE_OFFICE); ProcessString(XML_DDE_TOPIC, - GetStringProperty(sPropertyDDECommandFile, + GetStringProperty(gsPropertyDDECommandFile, xPropSet), false, XML_NAMESPACE_OFFICE); ProcessString(XML_DDE_ITEM, - GetStringProperty(sPropertyDDECommandElement, + GetStringProperty(gsPropertyDDECommandElement, xPropSet), false, XML_NAMESPACE_OFFICE); bool bIsAutomaticUpdate = GetBoolProperty( - sPropertyIsAutomaticUpdate, xPropSet); + gsPropertyIsAutomaticUpdate, xPropSet); if (bIsAutomaticUpdate) { GetExport().AddAttribute(XML_NAMESPACE_OFFICE, @@ -2262,7 +2265,7 @@ void XMLTextFieldExport::ExportMacro( // the description attribute ProcessString(XML_DESCRIPTION, - GetStringProperty(sPropertyHint, rPropSet), + GetStringProperty(gsPropertyHint, rPropSet), rContent); // the element @@ -2328,7 +2331,7 @@ void XMLTextFieldExport::ExportMetaField( // style:data-style-name ProcessValueAndType(false, - GetIntProperty(sPropertyNumberFormat, i_xMeta), + GetIntProperty(gsPropertyNumberFormat, i_xMeta), "", "", 0.0, false, false, true, false ); @@ -2698,7 +2701,7 @@ void XMLTextFieldExport::ProcessBibliographyData( const Reference<XPropertySet>& rPropSet) { // get the values - Any aAny = rPropSet->getPropertyValue(sPropertyFields); + Any aAny = rPropSet->getPropertyValue(gsPropertyFields); Sequence<PropertyValue> aValues; aAny >>= aValues; @@ -2802,13 +2805,13 @@ void XMLTextFieldExport::ExportDataBaseElement( OUString sDataBaseName; OUString sDataBaseURL; OUString sStr; - if( ( rPropertySet->getPropertyValue( sPropertyDataBaseName ) >>= sStr ) + if( ( rPropertySet->getPropertyValue( gsPropertyDataBaseName ) >>= sStr ) && !sStr.isEmpty() ) { sDataBaseName = sStr; } - else if( rPropertySetInfo->hasPropertyByName( sPropertyDataBaseURL ) && - (rPropertySet->getPropertyValue( sPropertyDataBaseURL ) >>= sStr) && + else if( rPropertySetInfo->hasPropertyByName( gsPropertyDataBaseURL ) && + (rPropertySet->getPropertyValue( gsPropertyDataBaseURL ) >>= sStr) && !sStr.isEmpty() ) { sDataBaseURL = sStr; @@ -2840,7 +2843,7 @@ void XMLTextFieldExport::ExportDataBaseElement( void XMLTextFieldExport::ExplodeFieldMasterName( const OUString& sMasterName, OUString& sFieldType, OUString& sVarName) { - sal_Int32 nLength = sFieldMasterPrefix.getLength(); + sal_Int32 nLength = gsFieldMasterPrefix.getLength(); sal_Int32 nSeparator = sMasterName.indexOf('.', nLength); // '.' found? @@ -2871,7 +2874,7 @@ bool XMLTextFieldExport::GetDependentFieldPropertySet( { Any aAny; Sequence<Reference<XDependentTextField> > aFields; - aAny = xMaster->getPropertyValue(sPropertyDependentTextFields); + aAny = xMaster->getPropertyValue(gsPropertyDependentTextFields); aAny >>= aFields; // any fields? @@ -2932,7 +2935,7 @@ enum XMLTokenEnum XMLTextFieldExport::MapAuthorFieldName( const Reference<XPropertySet> & xPropSet) { // Initials or full name? - return GetBoolProperty(sPropertyFullName, xPropSet) + return GetBoolProperty(gsPropertyFullName, xPropSet) ? XML_AUTHOR_NAME : XML_AUTHOR_INITIALS; } @@ -2942,7 +2945,7 @@ enum XMLTokenEnum XMLTextFieldExport::MapPageNumberName( { enum XMLTokenEnum eName = XML_TOKEN_INVALID; PageNumberType ePage; - Any aAny = xPropSet->getPropertyValue(sPropertySubType); + Any aAny = xPropSet->getPropertyValue(gsPropertySubType); ePage = *o3tl::doAccess<PageNumberType>(aAny); switch (ePage) @@ -3185,7 +3188,7 @@ enum XMLTokenEnum XMLTextFieldExport::MapSenderFieldName( enum XMLTokenEnum eName = XML_TOKEN_INVALID; // sub-field type - switch (GetInt16Property(sPropertyFieldSubType, xPropSet)) + switch (GetInt16Property(gsPropertyFieldSubType, xPropSet)) { case UserDataPart::COMPANY : eName = XML_SENDER_COMPANY; diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index 9f0946873102..b14c45d64b32 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -537,6 +537,8 @@ void XMLTextFieldImportContext::ForceUpdate( // XMLSenderFieldImportContext +static const OUStringLiteral gsPropertyFieldSubType("UserDataType"); + XMLSenderFieldImportContext::XMLSenderFieldImportContext( SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx, const OUString& sLocalName, @@ -544,7 +546,6 @@ XMLSenderFieldImportContext::XMLSenderFieldImportContext( : XMLTextFieldImportContext(rImport, rHlp, "ExtendedUser", nPrfx, sLocalName) , nSubType(0) , sPropertyFixed(sAPI_is_fixed) - , sPropertyFieldSubType("UserDataType") , sPropertyContent(sAPI_content) , bFixed(true) , nElementToken(nToken) @@ -631,7 +632,7 @@ void XMLSenderFieldImportContext::PrepareField( const Reference<XPropertySet> & rPropSet) { // set members - rPropSet->setPropertyValue(sPropertyFieldSubType, Any(nSubType)); + rPropSet->setPropertyValue(gsPropertyFieldSubType, Any(nSubType)); // set fixed rPropSet->setPropertyValue(sPropertyFixed, Any(bFixed)); @@ -655,6 +656,7 @@ void XMLSenderFieldImportContext::PrepareField( // XMLAuthorFieldImportContext +static const OUStringLiteral gsPropertyAuthorFullName("FullName"); XMLAuthorFieldImportContext::XMLAuthorFieldImportContext( SvXMLImport& rImport, XMLTextImportHelper& rHlp, @@ -662,7 +664,6 @@ XMLAuthorFieldImportContext::XMLAuthorFieldImportContext( sal_uInt16 nToken) : XMLSenderFieldImportContext(rImport, rHlp, nPrfx, sLocalName, nToken) , bAuthorFullName(true) -, sPropertyAuthorFullName("FullName") , sPropertyFixed(sAPI_is_fixed) , sPropertyContent(sAPI_content) { @@ -695,7 +696,7 @@ void XMLAuthorFieldImportContext::PrepareField( { // set members Any aAny; - rPropSet->setPropertyValue(sPropertyAuthorFullName, Any(bAuthorFullName)); + rPropSet->setPropertyValue(gsPropertyAuthorFullName, Any(bAuthorFullName)); rPropSet->setPropertyValue(sPropertyFixed, Any(bFixed)); @@ -728,12 +729,13 @@ static SvXMLEnumMapEntry<PageNumberType> const lcl_aSelectPageAttrMap[] = { XML_TOKEN_INVALID, PageNumberType(0) }, }; +static const OUStringLiteral gsPropertyUserText("UserText"); + XMLPageContinuationImportContext::XMLPageContinuationImportContext( SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx, const OUString& sLocalName) : XMLTextFieldImportContext(rImport, rHlp, sAPI_page_number, nPrfx, sLocalName) , sPropertySubType(sAPI_sub_type) -, sPropertyUserText("UserText") , sPropertyNumberingType(sAPI_numbering_type) , eSelectPage(PageNumberType_CURRENT) , sStringOK(false) @@ -772,7 +774,7 @@ void XMLPageContinuationImportContext::PrepareField( xPropertySet->setPropertyValue(sPropertySubType, Any(eSelectPage)); aAny <<= (sStringOK ? sString : GetContent()); - xPropertySet->setPropertyValue(sPropertyUserText, aAny); + xPropertySet->setPropertyValue(gsPropertyUserText, aAny); aAny <<= style::NumberingType::CHAR_SPECIAL; xPropertySet->setPropertyValue(sPropertyNumberingType, aAny); @@ -878,12 +880,13 @@ void XMLPageNumberImportContext::PrepareField( // Placeholder +static const OUStringLiteral gsPropertyPlaceholderType("PlaceHolderType"); +static const OUStringLiteral gsPropertyPlaceholder("PlaceHolder"); + XMLPlaceholderFieldImportContext::XMLPlaceholderFieldImportContext( SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx, const OUString& sLocalName) : XMLTextFieldImportContext(rImport, rHlp, "JumpEdit", nPrfx, sLocalName) -, sPropertyPlaceholderType("PlaceHolderType") -, sPropertyPlaceholder("PlaceHolder") , sPropertyHint(sAPI_hint) , nPlaceholderType(PlaceholderType::TEXT) { @@ -951,14 +954,15 @@ void XMLPlaceholderFieldImportContext::PrepareField( --nLength; } aAny <<= aContent.copy(nStart, nLength); - xPropertySet->setPropertyValue(sPropertyPlaceholder, aAny); + xPropertySet->setPropertyValue(gsPropertyPlaceholder, aAny); - xPropertySet->setPropertyValue(sPropertyPlaceholderType, Any(nPlaceholderType)); + xPropertySet->setPropertyValue(gsPropertyPlaceholderType, Any(nPlaceholderType)); } // time field +static const OUStringLiteral gsPropertyAdjust("Adjust"); XMLTimeFieldImportContext::XMLTimeFieldImportContext( SvXMLImport& rImport, XMLTextImportHelper& rHlp, @@ -968,7 +972,6 @@ XMLTimeFieldImportContext::XMLTimeFieldImportContext( , sPropertyFixed(sAPI_is_fixed) , sPropertyDateTimeValue(sAPI_date_time_value) , sPropertyDateTime(sAPI_date_time) -, sPropertyAdjust("Adjust") , sPropertyIsDate(sAPI_is_date) , sPropertyIsFixedLanguage(sAPI_is_fixed_language) , nAdjust(0) @@ -1043,9 +1046,9 @@ void XMLTimeFieldImportContext::PrepareField( rPropertySet->setPropertyValue(sPropertyIsDate, Any(bIsDate)); - if (xPropertySetInfo->hasPropertyByName(sPropertyAdjust)) + if (xPropertySetInfo->hasPropertyByName(gsPropertyAdjust)) { - rPropertySet->setPropertyValue(sPropertyAdjust, Any(nAdjust)); + rPropertySet->setPropertyValue(gsPropertyAdjust, Any(nAdjust)); } // set value @@ -1135,16 +1138,17 @@ void XMLDateFieldImportContext::ProcessAttribute( // database field superclass +static const OUStringLiteral gsPropertyDataBaseName("DataBaseName"); +static const OUStringLiteral gsPropertyDataBaseURL("DataBaseURL"); +static const OUStringLiteral gsPropertyTableName("DataTableName"); +static const OUStringLiteral gsPropertyDataCommandType("DataCommandType"); +static const OUStringLiteral gsPropertyIsVisible("IsVisible"); + XMLDatabaseFieldImportContext::XMLDatabaseFieldImportContext( SvXMLImport& rImport, XMLTextImportHelper& rHlp, const sal_Char* pServiceName, sal_uInt16 nPrfx, const OUString& sLocalName, bool bUseDisply) : XMLTextFieldImportContext(rImport, rHlp, pServiceName, nPrfx, sLocalName) -, sPropertyDataBaseName("DataBaseName") -, sPropertyDataBaseURL("DataBaseURL") -, sPropertyTableName("DataTableName") -, sPropertyDataCommandType("DataCommandType") -, sPropertyIsVisible("IsVisible") , nCommandType( sdb::CommandType::TABLE ) , bCommandTypeOK(false) , bDisplay( true ) @@ -1240,27 +1244,27 @@ SvXMLImportContextRef XMLDatabaseFieldImportContext::CreateChildContext( void XMLDatabaseFieldImportContext::PrepareField( const Reference<XPropertySet> & xPropertySet) { - xPropertySet->setPropertyValue(sPropertyTableName, Any(sTableName)); + xPropertySet->setPropertyValue(gsPropertyTableName, Any(sTableName)); if( bDatabaseNameOK ) { - xPropertySet->setPropertyValue(sPropertyDataBaseName, Any(sDatabaseName)); + xPropertySet->setPropertyValue(gsPropertyDataBaseName, Any(sDatabaseName)); } else if( bDatabaseURLOK ) { - xPropertySet->setPropertyValue(sPropertyDataBaseURL, Any(sDatabaseURL)); + xPropertySet->setPropertyValue(gsPropertyDataBaseURL, Any(sDatabaseURL)); } // #99980# load/save command type for all fields; also load // old documents without command type if( bCommandTypeOK ) { - xPropertySet->setPropertyValue( sPropertyDataCommandType, Any(nCommandType) ); + xPropertySet->setPropertyValue( gsPropertyDataCommandType, Any(nCommandType) ); } if( bUseDisplay && bDisplayOK ) { - xPropertySet->setPropertyValue( sPropertyIsVisible, Any(bDisplay) ); + xPropertySet->setPropertyValue( gsPropertyIsVisible, Any(bDisplay) ); } } @@ -1602,13 +1606,13 @@ const sal_Char* XMLSimpleDocInfoImportContext::MapTokenToServiceName( // revision field +static const OUStringLiteral sPropertyRevision("Revision"); XMLRevisionDocInfoImportContext::XMLRevisionDocInfoImportContext( SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx, const OUString& sLocalName, sal_uInt16 nToken) : XMLSimpleDocInfoImportContext(rImport, rHlp, nPrfx, sLocalName, - nToken, false, false), - sPropertyRevision("Revision") + nToken, false, false) { bValid = true; } @@ -1872,6 +1876,9 @@ void XMLHiddenParagraphImportContext::PrepareField( // import conditional text (<text:conditional-text>) +static const OUStringLiteral gsPropertyTrueContent("TrueContent"); +static const OUStringLiteral gsPropertyFalseContent("FalseContent"); +static const OUStringLiteral gsPropertyIsConditionTrue("IsConditionTrue"); XMLConditionalTextImportContext::XMLConditionalTextImportContext( SvXMLImport& rImport, XMLTextImportHelper& rHlp, @@ -1879,9 +1886,6 @@ XMLConditionalTextImportContext::XMLConditionalTextImportContext( XMLTextFieldImportContext(rImport, rHlp, "ConditionalText", nPrfx, sLocalName), sPropertyCondition(sAPI_condition), - sPropertyTrueContent("TrueContent"), - sPropertyFalseContent("FalseContent"), - sPropertyIsConditionTrue("IsConditionTrue"), sPropertyCurrentPresentation(sAPI_current_presentation), bConditionOK(false), bTrueOK(false), @@ -1936,9 +1940,9 @@ void XMLConditionalTextImportContext::PrepareField( const Reference<XPropertySet> & xPropertySet) { xPropertySet->setPropertyValue(sPropertyCondition, Any(sCondition)); - xPropertySet->setPropertyValue(sPropertyFalseContent, Any(sFalseContent)); - xPropertySet->setPropertyValue(sPropertyTrueContent, Any(sTrueContent)); - xPropertySet->setPropertyValue(sPropertyIsConditionTrue, Any(bCurrentValue)); + xPropertySet->setPropertyValue(gsPropertyFalseContent, Any(sFalseContent)); + xPropertySet->setPropertyValue(gsPropertyTrueContent, Any(sTrueContent)); + xPropertySet->setPropertyValue(gsPropertyIsConditionTrue, Any(bCurrentValue)); xPropertySet->setPropertyValue(sPropertyCurrentPresentation, Any(GetContent())); } @@ -2157,13 +2161,14 @@ static const SvXMLEnumMapEntry<sal_uInt16> aChapterDisplayMap[] = { XML_TOKEN_INVALID, 0 } }; +static const OUStringLiteral gsPropertyChapterFormat("ChapterFormat"); +static const OUStringLiteral gsPropertyLevel("Level"); + XMLChapterImportContext::XMLChapterImportContext( SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx, const OUString& sLocalName) : XMLTextFieldImportContext(rImport, rHlp, "Chapter", nPrfx, sLocalName), - sPropertyChapterFormat("ChapterFormat"), - sPropertyLevel("Level"), nFormat(ChapterFormat::NAME_NUMBER), nLevel(0) { @@ -2209,8 +2214,8 @@ void XMLChapterImportContext::ProcessAttribute( void XMLChapterImportContext::PrepareField( const Reference<XPropertySet> & xPropertySet) { - xPropertySet->setPropertyValue(sPropertyChapterFormat, Any(nFormat)); - xPropertySet->setPropertyValue(sPropertyLevel, Any(nLevel)); + xPropertySet->setPropertyValue(gsPropertyChapterFormat, Any(nFormat)); + xPropertySet->setPropertyValue(gsPropertyLevel, Any(nLevel)); } diff --git a/xmloff/source/text/txtftne.cxx b/xmloff/source/text/txtftne.cxx index 31303fdde72a..0c7b7682413b 100644 --- a/xmloff/source/text/txtftne.cxx +++ b/xmloff/source/text/txtftne.cxx @@ -73,14 +73,14 @@ void XMLTextParagraphExport::exportTextFootnote( { // get footnote and associated text Any aAny; - aAny = rPropSet->getPropertyValue(sFootnote); + aAny = rPropSet->getPropertyValue(gsFootnote); Reference<XFootnote> xFootnote; aAny >>= xFootnote; Reference<XText> xText(xFootnote, UNO_QUERY); // are we an endnote? Reference<XServiceInfo> xServiceInfo( xFootnote, UNO_QUERY ); - bool bIsEndnote = xServiceInfo->supportsService(sTextEndnoteService); + bool bIsEndnote = xServiceInfo->supportsService(gsTextEndnoteService); if (bAutoStyles) { @@ -133,7 +133,7 @@ void XMLTextParagraphExport::exportTextFootnote( GetExport(), bIsUICharStyle && aCharStyleNamesPropInfoCache.hasProperty( rPropSet ), bHasAutoStyle, - rPropSet, sCharStyleNames ); + rPropSet, gsCharStyleNames ); if( !sStyle.isEmpty() ) { GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, @@ -169,7 +169,7 @@ void XMLTextParagraphExport::exportTextFootnoteHelper( { // export reference Id (for reference fields) Reference<XPropertySet> xPropSet(rFootnote, UNO_QUERY); - Any aAny = xPropSet->getPropertyValue(sReferenceId); + Any aAny = xPropSet->getPropertyValue(gsReferenceId); sal_Int32 nNumber = 0; aAny >>= nNumber; OUStringBuffer aBuf; @@ -255,34 +255,34 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper( : XML_FOOTNOTE ) ); // default/paragraph style lcl_exportString( GetExport(), rFootnoteConfig, - sParaStyleName, + gsParaStyleName, XML_NAMESPACE_TEXT, XML_DEFAULT_STYLE_NAME, true); // citation style lcl_exportString( GetExport(), rFootnoteConfig, - sCharStyleName, + gsCharStyleName, XML_NAMESPACE_TEXT, XML_CITATION_STYLE_NAME, true); // citation body style lcl_exportString( GetExport(), rFootnoteConfig, - sAnchorCharStyleName, + gsAnchorCharStyleName, XML_NAMESPACE_TEXT, XML_CITATION_BODY_STYLE_NAME, true); // page style lcl_exportString( GetExport(), rFootnoteConfig, - sPageStyleName, + gsPageStyleName, XML_NAMESPACE_TEXT, XML_MASTER_PAGE_NAME, true ); // prefix - lcl_exportString( GetExport(), rFootnoteConfig, sPrefix, + lcl_exportString( GetExport(), rFootnoteConfig, gsPrefix, XML_NAMESPACE_STYLE, XML_NUM_PREFIX, false); // suffix - lcl_exportString( GetExport(), rFootnoteConfig, sSuffix, + lcl_exportString( GetExport(), rFootnoteConfig, gsSuffix, XML_NAMESPACE_STYLE, XML_NUM_SUFFIX, false); @@ -290,7 +290,7 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper( // numbering style OUStringBuffer sBuffer; - aAny = rFootnoteConfig->getPropertyValue(sNumberingType); + aAny = rFootnoteConfig->getPropertyValue(gsNumberingType); sal_Int16 nNumbering = 0; aAny >>= nNumbering; GetExport().GetMM100UnitConverter().convertNumFormat( sBuffer, nNumbering); @@ -304,7 +304,7 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper( } // StartAt / start-value - aAny = rFootnoteConfig->getPropertyValue(sStartAt); + aAny = rFootnoteConfig->getPropertyValue(gsStartAt); sal_Int16 nOffset = 0; aAny >>= nOffset; GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_START_VALUE, @@ -315,12 +315,12 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper( { // footnotes position aAny = rFootnoteConfig->getPropertyValue( - sPositionEndOfDoc); + gsPositionEndOfDoc); GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_FOOTNOTES_POSITION, ( (*o3tl::doAccess<bool>(aAny)) ? XML_DOCUMENT : XML_PAGE ) ); - aAny = rFootnoteConfig->getPropertyValue(sFootnoteCounting); + aAny = rFootnoteConfig->getPropertyValue(gsFootnoteCounting); sal_Int16 nTmp = 0; aAny >>= nTmp; enum XMLTokenEnum eElement; @@ -353,7 +353,7 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper( OUString sTmp; // end notice / quo vadis - aAny = rFootnoteConfig->getPropertyValue(sEndNotice); + aAny = rFootnoteConfig->getPropertyValue(gsEndNotice); aAny >>= sTmp; if (!sTmp.isEmpty()) @@ -365,7 +365,7 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper( } // begin notice / ergo sum - aAny = rFootnoteConfig->getPropertyValue(sBeginNotice); + aAny = rFootnoteConfig->getPropertyValue(gsBeginNotice); aAny >>= sTmp; if (!sTmp.isEmpty()) diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 93d5fe16424c..569be2c3c707 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -135,6 +135,84 @@ using namespace ::com::sun::star::graphic; using namespace ::xmloff; using namespace ::xmloff::token; +// Implement Title/Description Elements UI (#i73249#) +static const OUStringLiteral gsTitle("Title"); +static const OUStringLiteral gsDescription("Description"); +const OUStringLiteral XMLTextParagraphExport::gsAnchorCharStyleName("AnchorCharStyleName"); +static const OUStringLiteral gsAnchorPageNo("AnchorPageNo"); +static const OUStringLiteral gsAnchorType("AnchorType"); +const OUStringLiteral XMLTextParagraphExport::gsBeginNotice("BeginNotice"); +static const OUStringLiteral gsBookmark("Bookmark"); +const OUStringLiteral XMLTextParagraphExport::gsCategory("Category"); +static const OUStringLiteral gsChainNextName("ChainNextName"); +const OUStringLiteral XMLTextParagraphExport::gsCharStyleName("CharStyleName"); +const OUStringLiteral XMLTextParagraphExport::gsCharStyleNames("CharStyleNames"); +static const OUStringLiteral gsContourPolyPolygon("ContourPolyPolygon"); +static const OUStringLiteral gsDocumentIndexMark("DocumentIndexMark"); +const OUStringLiteral XMLTextParagraphExport::gsEndNotice("EndNotice"); +const OUStringLiteral XMLTextParagraphExport::gsFootnote("Footnote"); +const OUStringLiteral XMLTextParagraphExport::gsFootnoteCounting("FootnoteCounting"); +static const OUStringLiteral gsFrame("Frame"); +static const OUStringLiteral gsGraphicFilter("GraphicFilter"); +static const OUStringLiteral gsGraphicRotation("GraphicRotation"); +static const OUStringLiteral gsHeight("Height"); +static const OUStringLiteral gsHoriOrient("HoriOrient"); +static const OUStringLiteral gsHoriOrientPosition("HoriOrientPosition"); +static const OUStringLiteral gsHyperLinkName("HyperLinkName"); +static const OUStringLiteral gsHyperLinkTarget("HyperLinkTarget"); +static const OUStringLiteral gsHyperLinkURL("HyperLinkURL"); +static const OUStringLiteral gsIsAutomaticContour("IsAutomaticContour"); +static const OUStringLiteral gsIsCollapsed("IsCollapsed"); +static const OUStringLiteral gsIsPixelContour("IsPixelContour"); +static const OUStringLiteral gsIsStart("IsStart"); +static const OUStringLiteral gsIsSyncHeightToWidth("IsSyncHeightToWidth"); +static const OUStringLiteral gsIsSyncWidthToHeight("IsSyncWidthToHeight"); +static const OUStringLiteral gsNumberingRules("NumberingRules"); +const OUStringLiteral XMLTextParagraphExport::gsNumberingType("NumberingType"); +const OUStringLiteral XMLTextParagraphExport::gsPageDescName("PageDescName"); +const OUStringLiteral XMLTextParagraphExport::gsPageStyleName("PageStyleName"); +static const OUStringLiteral gsParaConditionalStyleName("ParaConditionalStyleName"); +static const OUStringLiteral gsParagraphService("com.sun.star.text.Paragraph"); +const OUStringLiteral XMLTextParagraphExport::gsParaStyleName("ParaStyleName"); +const OUStringLiteral XMLTextParagraphExport::gsPositionEndOfDoc("PositionEndOfDoc"); +const OUStringLiteral XMLTextParagraphExport::gsPrefix("Prefix"); +static const OUStringLiteral gsRedline("Redline"); +const OUStringLiteral XMLTextParagraphExport::gsReferenceId("ReferenceId"); +static const OUStringLiteral gsReferenceMark("ReferenceMark"); +static const OUStringLiteral gsRelativeHeight("RelativeHeight"); +static const OUStringLiteral gsRelativeWidth("RelativeWidth"); +static const OUStringLiteral gsRuby("Ruby"); +static const OUStringLiteral gsRubyCharStyleName("RubyCharStyleName"); +static const OUStringLiteral gsRubyText("RubyText"); +static const OUStringLiteral gsServerMap("ServerMap"); +static const OUStringLiteral gsShapeService("com.sun.star.drawing.Shape"); +static const OUStringLiteral gsSizeType("SizeType"); +static const OUStringLiteral gsSoftPageBreak( "SoftPageBreak" ); +const OUStringLiteral XMLTextParagraphExport::gsStartAt("StartAt"); +const OUStringLiteral XMLTextParagraphExport::gsSuffix("Suffix"); +static const OUStringLiteral gsTableService("com.sun.star.text.TextTable"); +static const OUStringLiteral gsText("Text"); +static const OUStringLiteral gsTextContentService("com.sun.star.text.TextContent"); +static const OUStringLiteral gsTextEmbeddedService("com.sun.star.text.TextEmbeddedObject"); +const OUStringLiteral XMLTextParagraphExport::gsTextEndnoteService("com.sun.star.text.Endnote"); +static const OUStringLiteral gsTextField("TextField"); +static const OUStringLiteral gsTextFieldService("com.sun.star.text.TextField"); +static const OUStringLiteral gsTextFrameService("com.sun.star.text.TextFrame"); +static const OUStringLiteral gsTextGraphicService("com.sun.star.text.TextGraphicObject"); +static const OUStringLiteral gsTextPortionType("TextPortionType"); +const OUStringLiteral XMLTextParagraphExport::gsTextSection("TextSection"); +static const OUStringLiteral gsUnvisitedCharStyleName("UnvisitedCharStyleName"); +static const OUStringLiteral gsVertOrient("VertOrient"); +static const OUStringLiteral gsVertOrientPosition("VertOrientPosition"); +static const OUStringLiteral gsVisitedCharStyleName("VisitedCharStyleName"); +static const OUStringLiteral gsWidth("Width"); +static const OUStringLiteral gsWidthType( "WidthType" ); +static const OUStringLiteral gsTextFieldStart( "TextFieldStart" ); +static const OUStringLiteral gsTextFieldEnd( "TextFieldEnd" ); +static const OUStringLiteral gsTextFieldStartEnd( "TextFieldStartEnd" ); + +const OUStringLiteral XMLTextParagraphExport::gsFrameStyleName("FrameStyleName"); + namespace { class TextContentSet @@ -492,17 +570,17 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, switch( nFamily ) { case XML_STYLE_FAMILY_TEXT_PARAGRAPH: - if( xPropSetInfo->hasPropertyByName( sParaStyleName ) ) + if( xPropSetInfo->hasPropertyByName( gsParaStyleName ) ) { - rPropSet->getPropertyValue( sParaStyleName ) >>= sParent; + rPropSet->getPropertyValue( gsParaStyleName ) >>= sParent; } - if( xPropSetInfo->hasPropertyByName( sParaConditionalStyleName ) ) + if( xPropSetInfo->hasPropertyByName( gsParaConditionalStyleName ) ) { - rPropSet->getPropertyValue( sParaConditionalStyleName ) >>= sCondParent; + rPropSet->getPropertyValue( gsParaConditionalStyleName ) >>= sCondParent; } - if( xPropSetInfo->hasPropertyByName( sNumberingRules ) ) + if( xPropSetInfo->hasPropertyByName( gsNumberingRules ) ) { - Reference < XIndexReplace > xNumRule(rPropSet->getPropertyValue( sNumberingRules ), uno::UNO_QUERY); + Reference < XIndexReplace > xNumRule(rPropSet->getPropertyValue( gsNumberingRules ), uno::UNO_QUERY); if( xNumRule.is() && xNumRule->getCount() ) { Reference < XNamed > xNamed( xNumRule, UNO_QUERY ); @@ -566,9 +644,9 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, } break; case XML_STYLE_FAMILY_TEXT_FRAME: - if( xPropSetInfo->hasPropertyByName( sFrameStyleName ) ) + if( xPropSetInfo->hasPropertyByName( gsFrameStyleName ) ) { - rPropSet->getPropertyValue( sFrameStyleName ) >>= sParent; + rPropSet->getPropertyValue( gsFrameStyleName ) >>= sParent; } break; case XML_STYLE_FAMILY_TEXT_SECTION: @@ -1176,83 +1254,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( mpTextListsHelper( nullptr ), maTextListsHelperStack(), mbCollected(false), - // Implement Title/Description Elements UI (#i73249#) - sTitle("Title"), - sDescription("Description"), - sAnchorCharStyleName("AnchorCharStyleName"), - sAnchorPageNo("AnchorPageNo"), - sAnchorType("AnchorType"), - sBeginNotice("BeginNotice"), - sBookmark("Bookmark"), - sCategory("Category"), - sChainNextName("ChainNextName"), - sCharStyleName("CharStyleName"), - sCharStyleNames("CharStyleNames"), - sContourPolyPolygon("ContourPolyPolygon"), - sDocumentIndexMark("DocumentIndexMark"), - sEndNotice("EndNotice"), - sFootnote("Footnote"), - sFootnoteCounting("FootnoteCounting"), - sFrame("Frame"), - sGraphicFilter("GraphicFilter"), - sGraphicRotation("GraphicRotation"), - sHeight("Height"), - sHoriOrient("HoriOrient"), - sHoriOrientPosition("HoriOrientPosition"), - sHyperLinkName("HyperLinkName"), - sHyperLinkTarget("HyperLinkTarget"), - sHyperLinkURL("HyperLinkURL"), - sIsAutomaticContour("IsAutomaticContour"), - sIsCollapsed("IsCollapsed"), - sIsPixelContour("IsPixelContour"), - sIsStart("IsStart"), - sIsSyncHeightToWidth("IsSyncHeightToWidth"), - sIsSyncWidthToHeight("IsSyncWidthToHeight"), - sNumberingRules("NumberingRules"), - sNumberingType("NumberingType"), - sPageDescName("PageDescName"), - sPageStyleName("PageStyleName"), - sParaConditionalStyleName("ParaConditionalStyleName"), - sParagraphService("com.sun.star.text.Paragraph"), - sParaStyleName("ParaStyleName"), - sPositionEndOfDoc("PositionEndOfDoc"), - sPrefix("Prefix"), - sRedline("Redline"), - sReferenceId("ReferenceId"), - sReferenceMark("ReferenceMark"), - sRelativeHeight("RelativeHeight"), - sRelativeWidth("RelativeWidth"), - sRuby("Ruby"), - sRubyCharStyleName("RubyCharStyleName"), - sRubyText("RubyText"), - sServerMap("ServerMap"), - sShapeService("com.sun.star.drawing.Shape"), - sSizeType("SizeType"), - sSoftPageBreak( "SoftPageBreak" ), - sStartAt("StartAt"), - sSuffix("Suffix"), - sTableService("com.sun.star.text.TextTable"), - sText("Text"), - sTextContentService("com.sun.star.text.TextContent"), - sTextEmbeddedService("com.sun.star.text.TextEmbeddedObject"), - sTextEndnoteService("com.sun.star.text.Endnote"), - sTextField("TextField"), - sTextFieldService("com.sun.star.text.TextField"), - sTextFrameService("com.sun.star.text.TextFrame"), - sTextGraphicService("com.sun.star.text.TextGraphicObject"), - sTextPortionType("TextPortionType"), - sTextSection("TextSection"), - sUnvisitedCharStyleName("UnvisitedCharStyleName"), - sVertOrient("VertOrient"), - sVertOrientPosition("VertOrientPosition"), - sVisitedCharStyleName("VisitedCharStyleName"), - sWidth("Width"), - sWidthType( "WidthType" ), - sTextFieldStart( "TextFieldStart" ), - sTextFieldEnd( "TextFieldEnd" ), - sTextFieldStartEnd( "TextFieldStartEnd" ), - sFrameStyleName("FrameStyleName"), - aCharStyleNamesPropInfoCache( sCharStyleNames ) + aCharStyleNamesPropInfoCache( gsCharStyleNames ) { rtl::Reference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TextPropMap::PARA, true )); xParaPropMapper = new XMLTextExportPropertySetMapper( xPropMapper, @@ -1550,7 +1552,7 @@ void XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress ) if(xTxtCntnt.is()) { Reference<XServiceInfo> xServiceInfo(xTxtCntnt, UNO_QUERY); - if( xServiceInfo->supportsService(sShapeService)) + if( xServiceInfo->supportsService(gsShapeService)) exportShape(xTxtCntnt, true); } } @@ -1667,9 +1669,9 @@ void XMLTextParagraphExport::exportText( if( xInfo.is() ) { - if (xInfo->hasPropertyByName( sTextSection )) + if (xInfo->hasPropertyByName( gsTextSection )) { - xPropertySet->getPropertyValue(sTextSection) >>= xBaseSection ; + xPropertySet->getPropertyValue(gsTextSection) >>= xBaseSection ; } } } @@ -1756,7 +1758,7 @@ void XMLTextParagraphExport::exportTextContentEnumeration( } Reference<XServiceInfo> xServiceInfo( xTxtCntnt, UNO_QUERY ); - if( xServiceInfo->supportsService( sParagraphService ) ) + if( xServiceInfo->supportsService( gsParagraphService ) ) { if( bAutoStyles ) { @@ -1806,7 +1808,7 @@ void XMLTextParagraphExport::exportTextContentEnumeration( bExportParagraph, aPropSetHelper, eExtensionNS ); bHasContent = true; } - else if( xServiceInfo->supportsService( sTableService ) ) + else if( xServiceInfo->supportsService( gsTableService ) ) { if( !bAutoStyles ) { @@ -1836,19 +1838,19 @@ void XMLTextParagraphExport::exportTextContentEnumeration( bHasContent = true; } - else if( xServiceInfo->supportsService( sTextFrameService ) ) + else if( xServiceInfo->supportsService( gsTextFrameService ) ) { exportTextFrame( xTxtCntnt, bAutoStyles, bIsProgress, true, pRangePropSet ); } - else if( xServiceInfo->supportsService( sTextGraphicService ) ) + else if( xServiceInfo->supportsService( gsTextGraphicService ) ) { exportTextGraphic( xTxtCntnt, bAutoStyles, pRangePropSet ); } - else if( xServiceInfo->supportsService( sTextEmbeddedService ) ) + else if( xServiceInfo->supportsService( gsTextEmbeddedService ) ) { exportTextEmbedded( xTxtCntnt, bAutoStyles, pRangePropSet ); } - else if( xServiceInfo->supportsService( sShapeService ) ) + else if( xServiceInfo->supportsService( gsShapeService ) ) { exportShape( xTxtCntnt, bAutoStyles, pRangePropSet ); } @@ -2084,7 +2086,7 @@ void XMLTextParagraphExport::exportParagraph( Reference < XEnumeration> xContentEnum; Reference < XContentEnumerationAccess > xCEA( rTextContent, UNO_QUERY ); if( xCEA.is() ) - xContentEnum.set(xCEA->createContentEnumeration( sTextContentService )); + xContentEnum.set(xCEA->createContentEnumeration( gsTextContentService )); const bool bHasContentEnum = xContentEnum.is() && xContentEnum->hasMoreElements(); @@ -2097,9 +2099,9 @@ void XMLTextParagraphExport::exportParagraph( // we always retrieve the style names even if they are not required. if( bAutoStyles ) { - if( xPropSet->getPropertySetInfo()->hasPropertyByName( sTextSection ) ) + if( xPropSet->getPropertySetInfo()->hasPropertyByName( gsTextSection ) ) { - xSection.set(xPropSet->getPropertyValue( sTextSection ), uno::UNO_QUERY); + xSection.set(xPropSet->getPropertyValue( gsTextSection ), uno::UNO_QUERY); } } else @@ -2157,17 +2159,17 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( Reference < XTextRange > xTxtRange(xPropSet, uno::UNO_QUERY); Reference<XPropertySetInfo> xPropInfo(xPropSet->getPropertySetInfo()); - if (xPropInfo->hasPropertyByName(sTextPortionType)) + if (xPropInfo->hasPropertyByName(gsTextPortionType)) { OUString sType; - xPropSet->getPropertyValue(sTextPortionType) >>= sType; + xPropSet->getPropertyValue(gsTextPortionType) >>= sType; - if( sType == sText) + if( sType == gsText) { exportTextRange( xTxtRange, bAutoStyles, rPrevCharIsSpace, openFieldMark); } - else if( sType == sTextField) + else if( sType == gsTextField) { exportTextField(xTxtRange, bAutoStyles, bIsProgress, &rPrevCharIsSpace); } @@ -2179,7 +2181,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( { if (!bAutoStyles) { - Reference<XNamed> xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY); + Reference<XNamed> xBookmark(xPropSet->getPropertyValue(gsBookmark), UNO_QUERY); const OUString& rName = xBookmark->getName(); if (!rName.isEmpty()) { @@ -2188,14 +2190,14 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_OFFICE, XML_ANNOTATION_END, false, false ); } } - else if( sType == sFrame ) + else if( sType == gsFrame ) { Reference < XEnumeration> xContentEnum; Reference < XContentEnumerationAccess > xCEA( xTxtRange, UNO_QUERY ); if( xCEA.is() ) xContentEnum.set(xCEA->createContentEnumeration( - sTextContentService )); + gsTextContentService )); // frames are never in sections Reference<XTextSection> xSection; if( xContentEnum.is() ) @@ -2205,36 +2207,36 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( &xPropSet ); } - else if (sType == sFootnote) + else if (sType == gsFootnote) { exportTextFootnote(xPropSet, xTxtRange->getString(), bAutoStyles, bIsProgress ); } - else if (sType == sBookmark) + else if (sType == gsBookmark) { exportTextMark(xPropSet, - sBookmark, + gsBookmark, lcl_XmlBookmarkElements, bAutoStyles); } - else if (sType == sReferenceMark) + else if (sType == gsReferenceMark) { exportTextMark(xPropSet, - sReferenceMark, + gsReferenceMark, lcl_XmlReferenceElements, bAutoStyles); } - else if (sType == sDocumentIndexMark) + else if (sType == gsDocumentIndexMark) { pIndexMarkExport->ExportIndexMark(xPropSet, bAutoStyles); } - else if (sType == sRedline) + else if (sType == gsRedline) { if (nullptr != pRedlineExport) pRedlineExport->ExportChange(xPropSet, bAutoStyles); } - else if (sType == sRuby) + else if (sType == gsRuby) { exportRuby(xPropSet, bAutoStyles); } @@ -2242,16 +2244,16 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( { exportMeta(xPropSet, bAutoStyles, bIsProgress, rPrevCharIsSpace); } - else if (sType == sTextFieldStart) + else if (sType == gsTextFieldStart) { - Reference< css::text::XFormField > xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY); + Reference< css::text::XFormField > xFormField(xPropSet->getPropertyValue(gsBookmark), UNO_QUERY); /* As of now, textmarks are a proposed extension to the OpenDocument standard. */ if (!bAutoStyles) { if (GetExport().getDefaultVersion() > SvtSaveOptions::ODFVER_012) { - Reference<XNamed> xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY); + Reference<XNamed> xBookmark(xPropSet->getPropertyValue(gsBookmark), UNO_QUERY); if (xBookmark.is()) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, xBookmark->getName()); @@ -2309,11 +2311,11 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( } } } - else if (sType == sTextFieldEnd) + else if (sType == gsTextFieldEnd) { if (!bAutoStyles) { - Reference< css::text::XFormField > xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY); + Reference< css::text::XFormField > xFormField(xPropSet->getPropertyValue(gsBookmark), UNO_QUERY); if ( GetExport().getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) { @@ -2347,18 +2349,18 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( } } } - else if (sType == sTextFieldStartEnd) + else if (sType == gsTextFieldStartEnd) { if (!bAutoStyles) { if (GetExport().getDefaultVersion() > SvtSaveOptions::ODFVER_012) { - Reference<XNamed> xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY); + Reference<XNamed> xBookmark(xPropSet->getPropertyValue(gsBookmark), UNO_QUERY); if (xBookmark.is()) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, xBookmark->getName()); } - Reference< css::text::XFormField > xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY); + Reference< css::text::XFormField > xFormField(xPropSet->getPropertyValue(gsBookmark), UNO_QUERY); if (xFormField.is()) { GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_TYPE, xFormField->getFieldType()); @@ -2372,7 +2374,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( } else { - Reference<XNamed> xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY); + Reference<XNamed> xBookmark(xPropSet->getPropertyValue(gsBookmark), UNO_QUERY); if (xBookmark.is()) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, xBookmark->getName()); @@ -2383,7 +2385,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( } } } - else if (sType == sSoftPageBreak) + else if (sType == gsSoftPageBreak) { exportSoftPageBreak(); } @@ -2394,7 +2396,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( else { Reference<XServiceInfo> xServiceInfo( xTxtRange, UNO_QUERY ); - if( xServiceInfo->supportsService( sTextFieldService ) ) + if( xServiceInfo->supportsService( gsTextFieldService ) ) { exportTextField(xTxtRange, bAutoStyles, bIsProgress, &rPrevCharIsSpace); } @@ -2422,9 +2424,9 @@ void XMLTextParagraphExport::exportTextField( { Reference < XPropertySet > xPropSet( rTextRange, UNO_QUERY ); // non-Writer apps need not support Property TextField, so test first - if (xPropSet->getPropertySetInfo()->hasPropertyByName( sTextField )) + if (xPropSet->getPropertySetInfo()->hasPropertyByName( gsTextField )) { - Reference < XTextField > xTxtFld(xPropSet->getPropertyValue( sTextField ), uno::UNO_QUERY); + Reference < XTextField > xTxtFld(xPropSet->getPropertyValue( gsTextField ), uno::UNO_QUERY); SAL_WARN_IF( !xTxtFld.is(), "xmloff", "text field missing" ); if( xTxtFld.is() ) { @@ -2485,13 +2487,13 @@ void XMLTextParagraphExport::exportTextMark( // start, end, or point-reference? sal_Int8 nElement; - if( *o3tl::doAccess<bool>(rPropSet->getPropertyValue(sIsCollapsed)) ) + if( *o3tl::doAccess<bool>(rPropSet->getPropertyValue(gsIsCollapsed)) ) { nElement = 0; } else { - nElement = *o3tl::doAccess<bool>(rPropSet->getPropertyValue(sIsStart)) ? 1 : 2; + nElement = *o3tl::doAccess<bool>(rPropSet->getPropertyValue(gsIsStart)) ? 1 : 2; } // bookmark, bookmark-start: xml:id and RDFa for RDF metadata @@ -2579,7 +2581,7 @@ XMLShapeExportFlags XMLTextParagraphExport::addTextFrameAttributes( // text:anchor-type TextContentAnchorType eAnchor = TextContentAnchorType_AT_PARAGRAPH; - rPropSet->getPropertyValue( sAnchorType ) >>= eAnchor; + rPropSet->getPropertyValue( gsAnchorType ) >>= eAnchor; { XMLAnchorTypePropHdl aAnchorTypeHdl; OUString sTmp; @@ -2592,7 +2594,7 @@ XMLShapeExportFlags XMLTextParagraphExport::addTextFrameAttributes( if( TextContentAnchorType_AT_PAGE == eAnchor ) { sal_Int16 nPage = 0; - rPropSet->getPropertyValue( sAnchorPageNo ) >>= nPage; + rPropSet->getPropertyValue( gsAnchorPageNo ) >>= nPage; SAL_WARN_IF(nPage <= 0, "xmloff", "ERROR: writing invalid anchor-page-number 0"); GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_ANCHOR_PAGE_NUMBER, @@ -2610,11 +2612,11 @@ XMLShapeExportFlags XMLTextParagraphExport::addTextFrameAttributes( { // svg:x sal_Int16 nHoriOrient = HoriOrientation::NONE; - rPropSet->getPropertyValue( sHoriOrient ) >>= nHoriOrient; + rPropSet->getPropertyValue( gsHoriOrient ) >>= nHoriOrient; if( HoriOrientation::NONE == nHoriOrient ) { sal_Int32 nPos = 0; - rPropSet->getPropertyValue( sHoriOrientPosition ) >>= nPos; + rPropSet->getPropertyValue( gsHoriOrientPosition ) >>= nPos; GetExport().GetMM100UnitConverter().convertMeasureToXML( sValue, nPos ); GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_X, @@ -2633,11 +2635,11 @@ XMLShapeExportFlags XMLTextParagraphExport::addTextFrameAttributes( { // svg:y sal_Int16 nVertOrient = VertOrientation::NONE; - rPropSet->getPropertyValue( sVertOrient ) >>= nVertOrient; + rPropSet->getPropertyValue( gsVertOrient ) >>= nVertOrient; if( VertOrientation::NONE == nVertOrient ) { sal_Int32 nPos = 0; - rPropSet->getPropertyValue( sVertOrientPosition ) >>= nPos; + rPropSet->getPropertyValue( gsVertOrientPosition ) >>= nPos; GetExport().GetMM100UnitConverter().convertMeasureToXML( sValue, nPos ); GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_Y, @@ -2656,17 +2658,17 @@ XMLShapeExportFlags XMLTextParagraphExport::addTextFrameAttributes( // svg:width sal_Int16 nWidthType = SizeType::FIX; - if( xPropSetInfo->hasPropertyByName( sWidthType ) ) + if( xPropSetInfo->hasPropertyByName( gsWidthType ) ) { - rPropSet->getPropertyValue( sWidthType ) >>= nWidthType; + rPropSet->getPropertyValue( gsWidthType ) >>= nWidthType; } - if( xPropSetInfo->hasPropertyByName( sWidth ) ) + if( xPropSetInfo->hasPropertyByName( gsWidth ) ) { sal_Int32 nWidth = 0; // VAR size will be written as zero min-size if( SizeType::VARIABLE != nWidthType ) { - rPropSet->getPropertyValue( sWidth ) >>= nWidth; + rPropSet->getPropertyValue( gsWidth ) >>= nWidth; } GetExport().GetMM100UnitConverter().convertMeasureToXML(sValue, nWidth); if( SizeType::FIX != nWidthType ) @@ -2689,17 +2691,17 @@ XMLShapeExportFlags XMLTextParagraphExport::addTextFrameAttributes( } } bool bSyncWidth = false; - if( xPropSetInfo->hasPropertyByName( sIsSyncWidthToHeight ) ) + if( xPropSetInfo->hasPropertyByName( gsIsSyncWidthToHeight ) ) { - bSyncWidth = *o3tl::doAccess<bool>(rPropSet->getPropertyValue( sIsSyncWidthToHeight )); + bSyncWidth = *o3tl::doAccess<bool>(rPropSet->getPropertyValue( gsIsSyncWidthToHeight )); if( bSyncWidth ) GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REL_WIDTH, XML_SCALE ); } - if( !bSyncWidth && xPropSetInfo->hasPropertyByName( sRelativeWidth ) ) + if( !bSyncWidth && xPropSetInfo->hasPropertyByName( gsRelativeWidth ) ) { sal_Int16 nRelWidth = 0; - rPropSet->getPropertyValue( sRelativeWidth ) >>= nRelWidth; + rPropSet->getPropertyValue( gsRelativeWidth ) >>= nRelWidth; SAL_WARN_IF( nRelWidth < 0 || nRelWidth > 254, "xmloff", "Got illegal relative width from API" ); if( nRelWidth > 0 ) @@ -2712,26 +2714,26 @@ XMLShapeExportFlags XMLTextParagraphExport::addTextFrameAttributes( // svg:height, fo:min-height or style:rel-height sal_Int16 nSizeType = SizeType::FIX; - if( xPropSetInfo->hasPropertyByName( sSizeType ) ) + if( xPropSetInfo->hasPropertyByName( gsSizeType ) ) { - rPropSet->getPropertyValue( sSizeType ) >>= nSizeType; + rPropSet->getPropertyValue( gsSizeType ) >>= nSizeType; } bool bSyncHeight = false; - if( xPropSetInfo->hasPropertyByName( sIsSyncHeightToWidth ) ) + if( xPropSetInfo->hasPropertyByName( gsIsSyncHeightToWidth ) ) { - bSyncHeight = *o3tl::doAccess<bool>(rPropSet->getPropertyValue( sIsSyncHeightToWidth )); + bSyncHeight = *o3tl::doAccess<bool>(rPropSet->getPropertyValue( gsIsSyncHeightToWidth )); } sal_Int16 nRelHeight = 0; - if( !bSyncHeight && xPropSetInfo->hasPropertyByName( sRelativeHeight ) ) + if( !bSyncHeight && xPropSetInfo->hasPropertyByName( gsRelativeHeight ) ) { - rPropSet->getPropertyValue( sRelativeHeight ) >>= nRelHeight; + rPropSet->getPropertyValue( gsRelativeHeight ) >>= nRelHeight; } - if( xPropSetInfo->hasPropertyByName( sHeight ) ) + if( xPropSetInfo->hasPropertyByName( gsHeight ) ) { sal_Int32 nHeight = 0; if( SizeType::VARIABLE != nSizeType ) { - rPropSet->getPropertyValue( sHeight ) >>= nHeight; + rPropSet->getPropertyValue( gsHeight ) >>= nHeight; } GetExport().GetMM100UnitConverter().convertMeasureToXML( sValue, nHeight ); @@ -2860,7 +2862,7 @@ void XMLTextParagraphExport::exportAnyTextFrame( XMLTextCharStyleNamesElementExport aCharStylesExport( GetExport(), bDoSomething, bHasAutoStyle, bDoSomething ? *pRangePropSet : Reference<XPropertySet>(), - sCharStyleNames ); + gsCharStyleNames ); if( !sStyle.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, @@ -2910,9 +2912,9 @@ void XMLTextParagraphExport::_exportTextFrame( Reference < XText > xTxt(xTxtFrame->getText()); OUString sStyle; - if( rPropSetInfo->hasPropertyByName( sFrameStyleName ) ) + if( rPropSetInfo->hasPropertyByName( gsFrameStyleName ) ) { - rPropSet->getPropertyValue( sFrameStyleName ) >>= sStyle; + rPropSet->getPropertyValue( gsFrameStyleName ) >>= sStyle; } OUString sAutoStyle( sStyle ); @@ -2938,10 +2940,10 @@ void XMLTextParagraphExport::_exportTextFrame( } // draw:chain-next-name - if( rPropSetInfo->hasPropertyByName( sChainNextName ) ) + if( rPropSetInfo->hasPropertyByName( gsChainNextName ) ) { OUString sNext; - if( (rPropSet->getPropertyValue( sChainNextName ) >>= sNext) && !sNext.isEmpty() ) + if( (rPropSet->getPropertyValue( gsChainNextName ) >>= sNext) && !sNext.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_CHAIN_NEXT_NAME, sNext ); @@ -2972,13 +2974,13 @@ void XMLTextParagraphExport::exportContour( const Reference < XPropertySet > & rPropSet, const Reference < XPropertySetInfo > & rPropSetInfo ) { - if( !rPropSetInfo->hasPropertyByName( sContourPolyPolygon ) ) + if( !rPropSetInfo->hasPropertyByName( gsContourPolyPolygon ) ) { return; } PointSequenceSequence aSourcePolyPolygon; - rPropSet->getPropertyValue( sContourPolyPolygon ) >>= aSourcePolyPolygon; + rPropSet->getPropertyValue( gsContourPolyPolygon ) >>= aSourcePolyPolygon; const basegfx::B2DPolyPolygon aPolyPolygon( basegfx::utils::UnoPointSequenceSequenceToB2DPolyPolygon( aSourcePolyPolygon)); @@ -2992,9 +2994,9 @@ void XMLTextParagraphExport::exportContour( const basegfx::B2DRange aPolyPolygonRange(aPolyPolygon.getB2DRange()); bool bPixel(false); - if( rPropSetInfo->hasPropertyByName( sIsPixelContour ) ) + if( rPropSetInfo->hasPropertyByName( gsIsPixelContour ) ) { - bPixel = *o3tl::doAccess<bool>(rPropSet->getPropertyValue( sIsPixelContour )); + bPixel = *o3tl::doAccess<bool>(rPropSet->getPropertyValue( gsIsPixelContour )); } // svg: width @@ -3054,10 +3056,10 @@ void XMLTextParagraphExport::exportContour( eElem = XML_CONTOUR_PATH; } - if( rPropSetInfo->hasPropertyByName( sIsAutomaticContour ) ) + if( rPropSetInfo->hasPropertyByName( gsIsAutomaticContour ) ) { bool bTmp = *o3tl::doAccess<bool>(rPropSet->getPropertyValue( - sIsAutomaticContour )); + gsIsAutomaticContour )); GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_RECREATE_ON_EDIT, bTmp ? XML_TRUE : XML_FALSE ); } @@ -3072,9 +3074,9 @@ void XMLTextParagraphExport::_exportTextGraphic( const Reference < XPropertySetInfo > & rPropSetInfo ) { OUString sStyle; - if( rPropSetInfo->hasPropertyByName( sFrameStyleName ) ) + if( rPropSetInfo->hasPropertyByName( gsFrameStyleName ) ) { - rPropSet->getPropertyValue( sFrameStyleName ) >>= sStyle; + rPropSet->getPropertyValue( gsFrameStyleName ) >>= sStyle; } OUString sAutoStyle( sStyle ); @@ -3085,7 +3087,7 @@ void XMLTextParagraphExport::_exportTextGraphic( // check if we need to use svg:transform sal_Int16 nRotation(0); - rPropSet->getPropertyValue( sGraphicRotation ) >>= nRotation; + rPropSet->getPropertyValue( gsGraphicRotation ) >>= nRotation; const bool bUseRotation(0 != nRotation); basegfx::B2DPoint aCenter(0.0, 0.0); @@ -3158,7 +3160,7 @@ void XMLTextParagraphExport::_exportTextGraphic( // draw:filter-name OUString sGrfFilter; - rPropSet->getPropertyValue( sGraphicFilter ) >>= sGrfFilter; + rPropSet->getPropertyValue( gsGraphicFilter ) >>= sGrfFilter; if( !sGrfFilter.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_FILTER_NAME, sGrfFilter ); @@ -3275,10 +3277,10 @@ void XMLTextParagraphExport::exportTitleAndDescription( const Reference < XPropertySetInfo > & rPropSetInfo ) { // svg:title - if( rPropSetInfo->hasPropertyByName( sTitle ) ) + if( rPropSetInfo->hasPropertyByName( gsTitle ) ) { OUString sObjTitle; - rPropSet->getPropertyValue( sTitle ) >>= sObjTitle; + rPropSet->getPropertyValue( gsTitle ) >>= sObjTitle; if( !sObjTitle.isEmpty() ) { SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_SVG, @@ -3288,10 +3290,10 @@ void XMLTextParagraphExport::exportTitleAndDescription( } // svg:description - if( rPropSetInfo->hasPropertyByName( sDescription ) ) + if( rPropSetInfo->hasPropertyByName( gsDescription ) ) { OUString sObjDesc; - rPropSet->getPropertyValue( sDescription ) >>= sObjDesc; + rPropSet->getPropertyValue( gsDescription ) >>= sObjDesc; if( !sObjDesc.isEmpty() ) { SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_SVG, @@ -3310,11 +3312,11 @@ bool XMLTextParagraphExport::addHyperlinkAttributes( OUString sHRef, sName, sTargetFrame, sUStyleName, sVStyleName; bool bServerMap = false; - if( rPropSetInfo->hasPropertyByName( sHyperLinkURL ) && + if( rPropSetInfo->hasPropertyByName( gsHyperLinkURL ) && ( !rPropState.is() || PropertyState_DIRECT_VALUE == - rPropState->getPropertyState( sHyperLinkURL ) ) ) + rPropState->getPropertyState( gsHyperLinkURL ) ) ) { - rPropSet->getPropertyValue( sHyperLinkURL ) >>= sHRef; + rPropSet->getPropertyValue( gsHyperLinkURL ) >>= sHRef; if( !sHRef.isEmpty() ) bExport = true; @@ -3327,47 +3329,47 @@ bool XMLTextParagraphExport::addHyperlinkAttributes( return false; } - if ( rPropSetInfo->hasPropertyByName( sHyperLinkName ) + if ( rPropSetInfo->hasPropertyByName( gsHyperLinkName ) && ( !rPropState.is() - || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( sHyperLinkName ) ) ) + || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( gsHyperLinkName ) ) ) { - rPropSet->getPropertyValue( sHyperLinkName ) >>= sName; + rPropSet->getPropertyValue( gsHyperLinkName ) >>= sName; if( !sName.isEmpty() ) bExport = true; } - if ( rPropSetInfo->hasPropertyByName( sHyperLinkTarget ) + if ( rPropSetInfo->hasPropertyByName( gsHyperLinkTarget ) && ( !rPropState.is() - || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( sHyperLinkTarget ) ) ) + || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( gsHyperLinkTarget ) ) ) { - rPropSet->getPropertyValue( sHyperLinkTarget ) >>= sTargetFrame; + rPropSet->getPropertyValue( gsHyperLinkTarget ) >>= sTargetFrame; if( !sTargetFrame.isEmpty() ) bExport = true; } - if ( rPropSetInfo->hasPropertyByName( sServerMap ) + if ( rPropSetInfo->hasPropertyByName( gsServerMap ) && ( !rPropState.is() - || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( sServerMap ) ) ) + || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( gsServerMap ) ) ) { - bServerMap = *o3tl::doAccess<bool>(rPropSet->getPropertyValue( sServerMap )); + bServerMap = *o3tl::doAccess<bool>(rPropSet->getPropertyValue( gsServerMap )); if ( bServerMap ) bExport = true; } - if ( rPropSetInfo->hasPropertyByName( sUnvisitedCharStyleName ) + if ( rPropSetInfo->hasPropertyByName( gsUnvisitedCharStyleName ) && ( !rPropState.is() - || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( sUnvisitedCharStyleName ) ) ) + || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( gsUnvisitedCharStyleName ) ) ) { - rPropSet->getPropertyValue( sUnvisitedCharStyleName ) >>= sUStyleName; + rPropSet->getPropertyValue( gsUnvisitedCharStyleName ) >>= sUStyleName; if( !sUStyleName.isEmpty() ) bExport = true; } - if ( rPropSetInfo->hasPropertyByName( sVisitedCharStyleName ) + if ( rPropSetInfo->hasPropertyByName( gsVisitedCharStyleName ) && ( !rPropState.is() - || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( sVisitedCharStyleName ) ) ) + || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( gsVisitedCharStyleName ) ) ) { - rPropSet->getPropertyValue( sVisitedCharStyleName ) >>= sVStyleName; + rPropSet->getPropertyValue( gsVisitedCharStyleName ) >>= sVStyleName; if( !sVStyleName.isEmpty() ) bExport = true; } @@ -3419,7 +3421,7 @@ void XMLTextParagraphExport::exportTextRangeSpan( bIsUICharStyle && aCharStyleNamesPropInfoCache.hasProperty( xPropSet, xPropSetInfo ), bHasAutoStyle, xPropSet, - sCharStyleNames ); + gsCharStyleNames ); if ( !sStyle.isEmpty() ) { @@ -3711,11 +3713,11 @@ void XMLTextParagraphExport::exportRuby( bool bAutoStyles ) { // early out: a collapsed ruby makes no sense - if (*o3tl::doAccess<bool>(rPropSet->getPropertyValue(sIsCollapsed))) + if (*o3tl::doAccess<bool>(rPropSet->getPropertyValue(gsIsCollapsed))) return; // start value ? - bool bStart = *o3tl::doAccess<bool>(rPropSet->getPropertyValue(sIsStart)); + bool bStart = *o3tl::doAccess<bool>(rPropSet->getPropertyValue(gsIsStart)); if (bAutoStyles) { @@ -3735,8 +3737,8 @@ void XMLTextParagraphExport::exportRuby( return; // save ruby text + ruby char style - rPropSet->getPropertyValue(sRubyText) >>= sOpenRubyText; - rPropSet->getPropertyValue(sRubyCharStyleName) >>= sOpenRubyCharStyle; + rPropSet->getPropertyValue(gsRubyText) >>= sOpenRubyText; + rPropSet->getPropertyValue(gsRubyCharStyleName) >>= sOpenRubyCharStyle; // ruby style GetExport().CheckAttrList(); diff --git a/xmloff/source/text/txtsecte.cxx b/xmloff/source/text/txtsecte.cxx index 6c9e9e5a0eab..1ac0f8eef0f7 100644 --- a/xmloff/source/text/txtsecte.cxx +++ b/xmloff/source/text/txtsecte.cxx @@ -60,9 +60,9 @@ void XMLTextParagraphExport::exportListAndSectionChange( Reference<XPropertySet> xPropSet(rNextSectionContent, UNO_QUERY); if (xPropSet.is()) { - if (xPropSet->getPropertySetInfo()->hasPropertyByName(sTextSection)) + if (xPropSet->getPropertySetInfo()->hasPropertyByName(gsTextSection)) { - xPropSet->getPropertyValue(sTextSection) >>= xNextSection; + xPropSet->getPropertyValue(gsTextSection) >>= xNextSection; } // else: no current section } diff --git a/xmloff/source/text/txtstyle.cxx b/xmloff/source/text/txtstyle.cxx index eefa1d2fca6a..99f894cebbb5 100644 --- a/xmloff/source/text/txtstyle.cxx +++ b/xmloff/source/text/txtstyle.cxx @@ -50,10 +50,10 @@ void XMLTextParagraphExport::exportStyleAttributes( Reference< XPropertySet > xPropSet( rStyle, UNO_QUERY ); Reference< XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo()); - if( xPropSetInfo->hasPropertyByName( sCategory ) ) + if( xPropSetInfo->hasPropertyByName( gsCategory ) ) { sal_Int16 nCategory = 0; - xPropSet->getPropertyValue( sCategory ) >>= nCategory; + xPropSet->getPropertyValue( gsCategory ) >>= nCategory; enum XMLTokenEnum eValue = XML_TOKEN_INVALID; if( -1 != nCategory ) { @@ -82,13 +82,13 @@ void XMLTextParagraphExport::exportStyleAttributes( if( eValue != XML_TOKEN_INVALID ) GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_CLASS, eValue); } - if( xPropSetInfo->hasPropertyByName( sPageDescName ) ) + if( xPropSetInfo->hasPropertyByName( gsPageDescName ) ) { Reference< XPropertyState > xPropState( xPropSet, uno::UNO_QUERY ); if( PropertyState_DIRECT_VALUE == - xPropState->getPropertyState( sPageDescName ) ) + xPropState->getPropertyState( gsPageDescName ) ) { - xPropSet->getPropertyValue( sPageDescName ) >>= sName; + xPropSet->getPropertyValue( gsPageDescName ) >>= sName; // fix for #i5551# if( sName.getLength() > 0 ) GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_MASTER_PAGE_NAME, |