diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-29 08:45:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-29 16:15:04 +0200 |
commit | b25e82b903135421fbcfff646bc92e03cce366b7 (patch) | |
tree | 5bb0b53ae075bb7b17e2dd61ca3491aae7fa64f2 /xmloff | |
parent | 9814c1f2edf56ecc0f31001db9234ef335488879 (diff) |
loplugin:unusedmethods
Change-Id: I2be47d2faf883b519f693e2d5ad58a5ab111849f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101629
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/sdxmlimp.cxx | 114 | ||||
-rw-r--r-- | xmloff/source/draw/sdxmlimp_impl.hxx | 9 | ||||
-rw-r--r-- | xmloff/source/style/xmlimppr.cxx | 215 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumfi.cxx | 28 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumi.cxx | 11 | ||||
-rw-r--r-- | xmloff/source/style/xmlstyle.cxx | 9 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 10 |
7 files changed, 0 insertions, 396 deletions
diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx index 1a191743fc9a..fcd4871fcf85 100644 --- a/xmloff/source/draw/sdxmlimp.cxx +++ b/xmloff/source/draw/sdxmlimp.cxx @@ -430,120 +430,6 @@ void SAL_CALL SdXMLImport::initialize( const uno::Sequence< uno::Any >& aArgumen } } -const SvXMLTokenMap& SdXMLImport::GetBodyElemTokenMap() -{ - if(!mpBodyElemTokenMap) - { - static const SvXMLTokenMapEntry aBodyElemTokenMap[] = - { - { XML_NAMESPACE_DRAW, XML_PAGE, XML_TOK_BODY_PAGE }, - { XML_NAMESPACE_PRESENTATION, XML_SETTINGS, XML_TOK_BODY_SETTINGS }, - { XML_NAMESPACE_PRESENTATION, XML_HEADER_DECL, XML_TOK_BODY_HEADER_DECL }, - { XML_NAMESPACE_PRESENTATION, XML_FOOTER_DECL, XML_TOK_BODY_FOOTER_DECL }, - { XML_NAMESPACE_PRESENTATION, XML_DATE_TIME_DECL,XML_TOK_BODY_DATE_TIME_DECL }, - - XML_TOKEN_MAP_END - }; - - mpBodyElemTokenMap = std::make_unique<SvXMLTokenMap>(aBodyElemTokenMap); - } - - return *mpBodyElemTokenMap; -} - -const SvXMLTokenMap& SdXMLImport::GetStylesElemTokenMap() -{ - if(!mpStylesElemTokenMap) - { - static const SvXMLTokenMapEntry aStylesElemTokenMap[] = - { - { XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT, XML_TOK_STYLES_PAGE_MASTER }, - { XML_NAMESPACE_STYLE, XML_PRESENTATION_PAGE_LAYOUT, XML_TOK_STYLES_PRESENTATION_PAGE_LAYOUT }, - { XML_NAMESPACE_STYLE, XML_STYLE, XML_TOK_STYLES_STYLE }, - XML_TOKEN_MAP_END - }; - - mpStylesElemTokenMap = std::make_unique<SvXMLTokenMap>(aStylesElemTokenMap); - } - - return *mpStylesElemTokenMap; -} - -const SvXMLTokenMap& SdXMLImport::GetMasterPageElemTokenMap() -{ - if(!mpMasterPageElemTokenMap) - { - static const SvXMLTokenMapEntry aMasterPageElemTokenMap[] = - { - { XML_NAMESPACE_STYLE, XML_STYLE, XML_TOK_MASTERPAGE_STYLE }, - { XML_NAMESPACE_PRESENTATION, XML_NOTES, XML_TOK_MASTERPAGE_NOTES }, - XML_TOKEN_MAP_END - }; - - mpMasterPageElemTokenMap = std::make_unique<SvXMLTokenMap>(aMasterPageElemTokenMap); - } - - return *mpMasterPageElemTokenMap; -} - -const SvXMLTokenMap& SdXMLImport::GetPageMasterAttrTokenMap() -{ - if(!mpPageMasterAttrTokenMap) - { - static const SvXMLTokenMapEntry aPageMasterAttrTokenMap[] = - { - { XML_NAMESPACE_STYLE, XML_NAME, XML_TOK_PAGEMASTER_NAME }, - XML_TOKEN_MAP_END - }; - - mpPageMasterAttrTokenMap = std::make_unique<SvXMLTokenMap>(aPageMasterAttrTokenMap); - } - - return *mpPageMasterAttrTokenMap; -} - -const SvXMLTokenMap& SdXMLImport::GetPageMasterStyleAttrTokenMap() -{ - if(!mpPageMasterStyleAttrTokenMap) - { - static const SvXMLTokenMapEntry aPageMasterStyleAttrTokenMap[] = - { - { XML_NAMESPACE_FO, XML_MARGIN_TOP, XML_TOK_PAGEMASTERSTYLE_MARGIN_TOP }, - { XML_NAMESPACE_FO, XML_MARGIN_BOTTOM, XML_TOK_PAGEMASTERSTYLE_MARGIN_BOTTOM }, - { XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TOK_PAGEMASTERSTYLE_MARGIN_LEFT }, - { XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TOK_PAGEMASTERSTYLE_MARGIN_RIGHT }, - { XML_NAMESPACE_FO, XML_PAGE_WIDTH, XML_TOK_PAGEMASTERSTYLE_PAGE_WIDTH }, - { XML_NAMESPACE_FO, XML_PAGE_HEIGHT, XML_TOK_PAGEMASTERSTYLE_PAGE_HEIGHT }, - { XML_NAMESPACE_STYLE, XML_PRINT_ORIENTATION, XML_TOK_PAGEMASTERSTYLE_PAGE_ORIENTATION }, - XML_TOKEN_MAP_END - }; - - mpPageMasterStyleAttrTokenMap = std::make_unique<SvXMLTokenMap>(aPageMasterStyleAttrTokenMap); - } - - return *mpPageMasterStyleAttrTokenMap; -} - -const SvXMLTokenMap& SdXMLImport::GetPresentationPlaceholderAttrTokenMap() -{ - if(!mpPresentationPlaceholderAttrTokenMap) - { - static const SvXMLTokenMapEntry aPresentationPlaceholderAttrTokenMap[] = - { - { XML_NAMESPACE_PRESENTATION, XML_OBJECT, XML_TOK_PRESENTATIONPLACEHOLDER_OBJECTNAME }, - { XML_NAMESPACE_SVG, XML_X, XML_TOK_PRESENTATIONPLACEHOLDER_X }, - { XML_NAMESPACE_SVG, XML_Y, XML_TOK_PRESENTATIONPLACEHOLDER_Y }, - { XML_NAMESPACE_SVG, XML_WIDTH, XML_TOK_PRESENTATIONPLACEHOLDER_WIDTH }, - { XML_NAMESPACE_SVG, XML_HEIGHT, XML_TOK_PRESENTATIONPLACEHOLDER_HEIGHT }, - XML_TOKEN_MAP_END - }; - - mpPresentationPlaceholderAttrTokenMap = std::make_unique<SvXMLTokenMap>(aPresentationPlaceholderAttrTokenMap); - } - - return *mpPresentationPlaceholderAttrTokenMap; -} - SvXMLImportContext *SdXMLImport::CreateFastContext( sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList ) { diff --git a/xmloff/source/draw/sdxmlimp_impl.hxx b/xmloff/source/draw/sdxmlimp_impl.hxx index 8d4f3e7407fd..d314caa0c576 100644 --- a/xmloff/source/draw/sdxmlimp_impl.hxx +++ b/xmloff/source/draw/sdxmlimp_impl.hxx @@ -158,15 +158,6 @@ public: SvXMLImportContext* CreateMasterStylesContext(); SvXMLImportContext *CreateFontDeclsContext(); - // Styles and AutoStyles contexts - - const SvXMLTokenMap& GetBodyElemTokenMap(); - const SvXMLTokenMap& GetStylesElemTokenMap(); - const SvXMLTokenMap& GetMasterPageElemTokenMap(); - const SvXMLTokenMap& GetPageMasterAttrTokenMap(); - const SvXMLTokenMap& GetPageMasterStyleAttrTokenMap(); - const SvXMLTokenMap& GetPresentationPlaceholderAttrTokenMap(); - // export local parameters concerning page access and similar const css::uno::Reference< css::container::XNameAccess >& GetLocalDocStyleFamilies() const { return mxDocStyleFamilies; } const css::uno::Reference< css::container::XIndexAccess >& GetLocalMasterPages() const { return mxDocMasterPages; } diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx index a3600aa09890..adc23848b542 100644 --- a/xmloff/source/style/xmlimppr.cxx +++ b/xmloff/source/style/xmlimppr.cxx @@ -106,221 +106,6 @@ void SvXMLImportPropertyMapper::ChainImportMapper( /** fills the given itemset with the attributes in the given list */ void SvXMLImportPropertyMapper::importXML( vector< XMLPropertyState >& rProperties, - const Reference< XAttributeList >& xAttrList, - const SvXMLUnitConverter& rUnitConverter, - const SvXMLNamespaceMap& rNamespaceMap, - sal_uInt32 nPropType, - sal_Int32 nStartIdx, - sal_Int32 nEndIdx ) const -{ - sal_Int16 nAttr = xAttrList->getLength(); - - Reference< XNameContainer > xAttrContainer; - - if( -1 == nStartIdx ) - nStartIdx = 0; - if( -1 == nEndIdx ) - nEndIdx = maPropMapper->GetEntryCount(); - for( sal_Int16 i=0; i < nAttr; i++ ) - { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); - OUString aLocalName, aPrefix, aNamespace; - sal_uInt16 nPrefix = rNamespaceMap.GetKeyByAttrName( rAttrName, &aPrefix, - &aLocalName, &aNamespace ); - - if( XML_NAMESPACE_XMLNS == nPrefix ) - continue; - - const OUString& rValue = xAttrList->getValueByIndex( i ); - - // index of actual property map entry - // This looks very strange, but it works well: - // If the start index is 0, the new value will become -1, and - // GetEntryIndex will start searching with position 0. - // Otherwise GetEntryIndex will start with the next position specified. - sal_Int32 nIndex = nStartIdx - 1; - sal_uInt32 nFlags = 0; // flags of actual property map entry - bool bFound = false; - - // for better error reporting: this should be set true if no - // warning is needed - bool bNoWarning = false; - bool bAlienImport = false; - - do - { - // find an entry for this attribute - nIndex = maPropMapper->GetEntryIndex( nPrefix, aLocalName, - nPropType, nIndex ); - - if( nIndex > -1 && nIndex < nEndIdx ) - { - // create a XMLPropertyState with an empty value - - nFlags = maPropMapper->GetEntryFlags( nIndex ); - if( (( nFlags & MID_FLAG_NO_PROPERTY ) == MID_FLAG_NO_PROPERTY) && (maPropMapper->GetEntryContextId( nIndex ) == CTF_ALIEN_ATTRIBUTE_IMPORT) ) - { - bAlienImport = true; - nIndex = -1; - } - else - { - if( ( nFlags & MID_FLAG_ELEMENT_ITEM_IMPORT ) == 0 ) - { - XMLPropertyState aNewProperty( nIndex ); - sal_Int32 nReference = -1; - - // if this is a multi attribute check if another attribute already set - // this any. If so use this as an initial value - if( ( nFlags & MID_FLAG_MERGE_PROPERTY ) != 0 ) - { - const OUString aAPIName( maPropMapper->GetEntryAPIName( nIndex ) ); - const sal_Int32 nSize = rProperties.size(); - for( nReference = 0; nReference < nSize; nReference++ ) - { - sal_Int32 nRefIdx = rProperties[nReference].mnIndex; - if( (nRefIdx != -1) && (nIndex != nRefIdx) && - (maPropMapper->GetEntryAPIName( nRefIdx ) == aAPIName )) - { - aNewProperty = rProperties[nReference]; - aNewProperty.mnIndex = nIndex; - break; - } - } - - if( nReference == nSize ) - nReference = -1; - } - - bool bSet = false; - if( ( nFlags & MID_FLAG_SPECIAL_ITEM_IMPORT ) == 0 ) - { - // let the XMLPropertySetMapper decide how to import the value - bSet = maPropMapper->importXML( rValue, aNewProperty, - rUnitConverter ); - } - else - { - sal_uInt32 nOldSize = rProperties.size(); - - bSet = handleSpecialItem( aNewProperty, rProperties, - rValue, rUnitConverter, - rNamespaceMap ); - - // no warning if handleSpecialItem added properties - bNoWarning |= ( nOldSize != rProperties.size() ); - } - - // no warning if we found could set the item. This - // 'remembers' bSet across multi properties. - bNoWarning |= bSet; - - // store the property in the given vector - if( bSet ) - { - if( nReference == -1 ) - rProperties.push_back( aNewProperty ); - else - rProperties[nReference] = aNewProperty; - } - else - { - // warn about unknown value. Unless it's a - // multi property: Then we get another chance - // to set the value. - if( !bNoWarning && - ((nFlags & MID_FLAG_MULTI_PROPERTY) == 0) ) - { - Sequence<OUString> aSeq(2); - aSeq[0] = rAttrName; - aSeq[1] = rValue; - rImport.SetError( XMLERROR_FLAG_WARNING | - XMLERROR_STYLE_ATTR_VALUE, - aSeq ); - } - } - } - bFound = true; - continue; - } - } - - if( !bFound ) - { - SAL_INFO_IF((XML_NAMESPACE_NONE != nPrefix) && - !(XML_NAMESPACE_UNKNOWN_FLAG & nPrefix) && - !bAlienImport, "xmloff.style", - "unknown attribute: \"" << rAttrName << "\""); - if( (XML_NAMESPACE_UNKNOWN_FLAG & nPrefix) || (XML_NAMESPACE_NONE == nPrefix) || bAlienImport ) - { - if( !xAttrContainer.is() ) - { - // add an unknown attribute container to the properties - Reference< XNameContainer > xNew( SvUnoAttributeContainer_CreateInstance(), UNO_QUERY ); - xAttrContainer = xNew; - - // find map entry and create new property state - if( -1 == nIndex ) - { - switch( nPropType ) - { - case XML_TYPE_PROP_CHART: - nIndex = maPropMapper->FindEntryIndex( "ChartUserDefinedAttributes", XML_NAMESPACE_TEXT, GetXMLToken(XML_XMLNS) ); - break; - case XML_TYPE_PROP_PARAGRAPH: - nIndex = maPropMapper->FindEntryIndex( "ParaUserDefinedAttributes", XML_NAMESPACE_TEXT, GetXMLToken(XML_XMLNS) ); - break; - case XML_TYPE_PROP_TEXT: - nIndex = maPropMapper->FindEntryIndex( "TextUserDefinedAttributes", XML_NAMESPACE_TEXT, GetXMLToken(XML_XMLNS) ); - break; - default: - break; - } - // other property type or property not found - if( -1 == nIndex ) - nIndex = maPropMapper->FindEntryIndex( "UserDefinedAttributes", XML_NAMESPACE_TEXT, GetXMLToken(XML_XMLNS) ); - } - - // #106963#; use userdefined attribute only if it is in the specified property range - if( nIndex != -1 && nIndex >= nStartIdx && nIndex < nEndIdx) - { - XMLPropertyState aNewProperty( nIndex, Any(xAttrContainer) ); - - // push it on our stack so we export it later - rProperties.push_back( aNewProperty ); - } - } - - if( xAttrContainer.is() ) - { - AttributeData aData; - aData.Type = GetXMLToken( XML_CDATA ); - aData.Value = rValue; - - OUStringBuffer sName; - if( XML_NAMESPACE_NONE != nPrefix ) - { - sName.append( aPrefix ); - sName.append( ':' ); - aData.Namespace = aNamespace; - } - - sName.append( aLocalName ); - - xAttrContainer->insertByName( sName.makeStringAndClear(), Any(aData) ); - } - } - } - } - while( ( nIndex >= 0 && nIndex + 1 < nEndIdx ) && (( nFlags & MID_FLAG_MULTI_PROPERTY ) != 0 ) ); - } - - finished( rProperties, nStartIdx, nEndIdx ); -} - -/** fills the given itemset with the attributes in the given list */ -void SvXMLImportPropertyMapper::importXML( - vector< XMLPropertyState >& rProperties, const Reference< XFastAttributeList >& xAttrList, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 81bd3c001f4b..2c32e4745ab1 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -77,7 +77,6 @@ public: const uno::Reference<uno::XComponentContext>& rxContext ); SvNumberFormatter* GetNumberFormatter() const { return pFormatter; } - const SvXMLTokenMap& GetStylesElemTokenMap(); const LocaleDataWrapper& GetLocaleData( LanguageType nLang ); sal_uInt32 GetKeyForName( const OUString& rName ); void AddKey( sal_uInt32 nKey, const OUString& rName, bool bRemoveAfterUse ); @@ -372,28 +371,6 @@ void SvXMLNumImpData::RemoveVolatileFormats() } } -const SvXMLTokenMap& SvXMLNumImpData::GetStylesElemTokenMap() -{ - if( !pStylesElemTokenMap ) - { - static const SvXMLTokenMapEntry aStylesElemMap[] = - { - // style elements - { XML_NAMESPACE_NUMBER, XML_NUMBER_STYLE, static_cast<sal_uInt16>(SvXMLStylesTokens::NUMBER_STYLE) }, - { XML_NAMESPACE_NUMBER, XML_CURRENCY_STYLE, static_cast<sal_uInt16>(SvXMLStylesTokens::CURRENCY_STYLE) }, - { XML_NAMESPACE_NUMBER, XML_PERCENTAGE_STYLE, static_cast<sal_uInt16>(SvXMLStylesTokens::PERCENTAGE_STYLE) }, - { XML_NAMESPACE_NUMBER, XML_DATE_STYLE, static_cast<sal_uInt16>(SvXMLStylesTokens::DATE_STYLE) }, - { XML_NAMESPACE_NUMBER, XML_TIME_STYLE, static_cast<sal_uInt16>(SvXMLStylesTokens::TIME_STYLE) }, - { XML_NAMESPACE_NUMBER, XML_BOOLEAN_STYLE, static_cast<sal_uInt16>(SvXMLStylesTokens::BOOLEAN_STYLE) }, - { XML_NAMESPACE_NUMBER, XML_TEXT_STYLE, static_cast<sal_uInt16>(SvXMLStylesTokens::TEXT_STYLE) }, - XML_TOKEN_MAP_END - }; - - pStylesElemTokenMap = std::make_unique<SvXMLTokenMap>( aStylesElemMap ); - } - return *pStylesElemTokenMap; -} - const LocaleDataWrapper& SvXMLNumImpData::GetLocaleData( LanguageType nLang ) { if ( !pLocaleData ) @@ -2172,11 +2149,6 @@ SvXMLStyleContext* SvXMLNumFmtHelper::CreateChildContext( SvXMLImport& rImport, pData.get(), nStyleToken, xAttrList, rStyles ); } -const SvXMLTokenMap& SvXMLNumFmtHelper::GetStylesElemTokenMap() -{ - return pData->GetStylesElemTokenMap(); -} - LanguageType SvXMLNumFmtHelper::GetLanguageForKey(sal_Int32 nKey) { if (pData->GetNumberFormatter()) diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index eb500be374a5..e0d09cebd366 100644 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -1018,17 +1018,6 @@ const OUStringLiteral sNumberingRules( u"NumberingRules" ); const OUStringLiteral sIsContinuousNumbering( u"IsContinuousNumbering" ); SvxXMLListStyleContext::SvxXMLListStyleContext( SvXMLImport& rImport, - sal_uInt16 nPrfx, - const OUString& rLName, - const Reference< xml::sax::XAttributeList > & xAttrList, - bool bOutl ) -: SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, bOutl ? XmlStyleFamily::TEXT_OUTLINE : XmlStyleFamily::TEXT_LIST ) -, bConsecutive( false ) -, bOutline( bOutl ) -{ -} - -SvxXMLListStyleContext::SvxXMLListStyleContext( SvXMLImport& rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList, bool bOutl ) diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx index 458dda8030e8..b93f50d74d8f 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -82,15 +82,6 @@ const SvXMLTokenMapEntry aStyleStylesElemTokenMap[] = const OUStringLiteral gsParaStyleServiceName( u"com.sun.star.style.ParagraphStyle" ); const OUStringLiteral gsTextStyleServiceName( u"com.sun.star.style.CharacterStyle" ); -const SvXMLTokenMap& SvXMLStylesContext::GetStyleStylesElemTokenMap() -{ - if( !mpStyleStylesElemTokenMap ) - mpStyleStylesElemTokenMap.reset( - new SvXMLTokenMap( aStyleStylesElemTokenMap ) ); - - return *mpStyleStylesElemTokenMap; -} - void SvXMLStyleContext::SetAttribute( sal_uInt16 nPrefixKey, const OUString& rLocalName, const OUString& rValue ) diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index a1380ac7f57b..06c997fe980a 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -819,16 +819,6 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextHyperlinkAttrTokenMap() return *m_xImpl->m_xTextHyperlinkAttrTokenMap; } -const SvXMLTokenMap& XMLTextImportHelper::GetTextMasterPageElemTokenMap() -{ - if (!m_xImpl->m_xTextMasterPageElemTokenMap) - { - m_xImpl->m_xTextMasterPageElemTokenMap.reset( - new SvXMLTokenMap( aTextMasterPageElemTokenMap )); - } - return *m_xImpl->m_xTextMasterPageElemTokenMap; -} - const SvXMLTokenMap& XMLTextImportHelper::GetTextFieldAttrTokenMap() { if (!m_xImpl->m_xTextFieldAttrTokenMap) |