compilerplugins/clang/unusedenumconstants.readonly.results | 6 -- include/xmloff/shapeexport.hxx | 2 include/xmloff/xmlexppr.hxx | 7 -- sw/source/filter/xml/xmlexpit.cxx | 33 +++---------- sw/source/filter/xml/xmlexpit.hxx | 4 - xmloff/source/style/xmlexppr.cxx | 1 6 files changed, 11 insertions(+), 42 deletions(-)
New commits: commit aaad3500b3d558836a776b162184cb0556850940 Author: Noel Grandin <[email protected]> AuthorDate: Mon Nov 26 10:14:58 2018 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Mon Nov 26 10:41:14 2018 +0100 remove some unused enum values in xmloff (*) also make it more obvious what XMLShapeExportFlags::SIZE represents Change-Id: Ie63edf0f2827f171542037b819ebe7d55e090275 Reviewed-on: https://gerrit.libreoffice.org/63948 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/compilerplugins/clang/unusedenumconstants.readonly.results b/compilerplugins/clang/unusedenumconstants.readonly.results index 3a5f2fc378cd..327ddeb57286 100644 --- a/compilerplugins/clang/unusedenumconstants.readonly.results +++ b/compilerplugins/clang/unusedenumconstants.readonly.results @@ -1102,12 +1102,6 @@ include/xmloff/shapeexport.hxx:53 enum XMLShapeExportFlags WIDTH include/xmloff/shapeexport.hxx:54 enum XMLShapeExportFlags HEIGHT -include/xmloff/xmlexppr.hxx:35 - enum SvXmlExportFlags DEFAULTS -include/xmloff/xmlexppr.hxx:36 - enum SvXmlExportFlags DEEP -include/xmloff/xmlexppr.hxx:38 - enum SvXmlExportFlags EMPTY include/xmloff/xmlimp.hxx:108 enum SvXMLImportFlags EMBEDDED o3tl/qa/test-enumarray.cxx:30 diff --git a/include/xmloff/shapeexport.hxx b/include/xmloff/shapeexport.hxx index def1bd936536..d9cb574deadc 100644 --- a/include/xmloff/shapeexport.hxx +++ b/include/xmloff/shapeexport.hxx @@ -52,7 +52,7 @@ enum class XMLShapeExportFlags { POSITION = 0x0003, WIDTH = 0x0004, HEIGHT = 0x0008, - SIZE = 0x000c, + SIZE = WIDTH | HEIGHT, // when you set this flag a chart does NOT export its own data as table element NO_CHART_DATA = 0x0010, // When setting the flag below no ignorableWhiteSpace will be called around diff --git a/include/xmloff/xmlexppr.hxx b/include/xmloff/xmlexppr.hxx index b2f564e186ec..770572c3bd99 100644 --- a/include/xmloff/xmlexppr.hxx +++ b/include/xmloff/xmlexppr.hxx @@ -32,16 +32,11 @@ enum class SvXmlExportFlags { NONE = 0x0000, - DEFAULTS = 0x0001, // export also default items - DEEP = 0x0002, // export also items from - // parent item sets - EMPTY = 0x0004, // export attribs element - // even if its empty IGN_WS = 0x0008 }; namespace o3tl { - template<> struct typed_flags<SvXmlExportFlags> : is_typed_flags<SvXmlExportFlags, 0xf> {}; + template<> struct typed_flags<SvXmlExportFlags> : is_typed_flags<SvXmlExportFlags, 0x08> {}; } class SvXMLUnitConverter; diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index 70172d3c6bf3..862066b8c0c5 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -66,7 +66,6 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport, const SfxItemSet& rSet, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, - SvXmlExportFlags nFlags, std::vector<sal_uInt16> *pIndexArray ) const { const sal_uInt16 nCount = mrMapEntries->getCount(); @@ -79,8 +78,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport, // we have a valid map entry here, so lets use it... if( 0 == (rEntry.nMemberId & MID_SW_FLAG_NO_ITEM_EXPORT) ) { - const SfxPoolItem* pItem = GetItem( rSet, rEntry.nWhichId, - nFlags ); + const SfxPoolItem* pItem = GetItem( rSet, rEntry.nWhichId ); // do we have an item? if(pItem) { @@ -232,7 +230,7 @@ void SvXMLExportItemMapper::exportElementItems( OSL_ENSURE( 0 != (rEntry.nMemberId & MID_SW_FLAG_ELEMENT_ITEM_EXPORT), "wrong mid flag!" ); - const SfxPoolItem* pItem = GetItem( rSet, rEntry.nWhichId, nFlags ); + const SfxPoolItem* pItem = GetItem( rSet, rEntry.nWhichId ); // do we have an item? if(pItem) { @@ -248,30 +246,19 @@ void SvXMLExportItemMapper::exportElementItems( } /** returns the item with the given WhichId from the given ItemSet if its - set or its default item if it's not set and the SvXmlExportFlags::DEEP - is set in the flags + set */ const SfxPoolItem* SvXMLExportItemMapper::GetItem( const SfxItemSet& rSet, - sal_uInt16 nWhichId, - SvXmlExportFlags nFlags ) + sal_uInt16 nWhichId) { // first get item from itemset const SfxPoolItem* pItem; - SfxItemState eState = - rSet.GetItemState( nWhichId, - bool( nFlags & SvXmlExportFlags::DEEP ), - &pItem ); + SfxItemState eState = rSet.GetItemState( nWhichId, false, &pItem ); if( SfxItemState::SET == eState ) { return pItem; } - else if( (nFlags & SvXmlExportFlags::DEFAULTS) && - SfxItemPool::IsWhich(nWhichId)) - { - // if it's not set, try the pool if we export defaults - return &rSet.GetPool()->GetDefaultItem(nWhichId); - } else { return nullptr; @@ -293,22 +280,18 @@ void SvXMLExportItemMapper::exportXML( SvXMLExport& rExport, XMLTokenEnum ePropToken ) const { std::vector<sal_uInt16> aIndexArray; - const SvXmlExportFlags nFlags = SvXmlExportFlags::IGN_WS; exportXML( rExport, rExport.GetAttrList(), rSet, rUnitConverter, - rExport.GetNamespaceMap(), nFlags, &aIndexArray ); + rExport.GetNamespaceMap(), &aIndexArray ); if( rExport.GetAttrList().getLength() > 0 || !aIndexArray.empty() ) { - if( nFlags & SvXmlExportFlags::IGN_WS ) - { - rExport.IgnorableWhitespace(); - } + rExport.IgnorableWhitespace(); SvXMLElementExport aElem( rExport, XML_NAMESPACE_STYLE, ePropToken, false, false ); exportElementItems( rExport, rUnitConverter, - rSet, nFlags, aIndexArray ); + rSet, SvXmlExportFlags::IGN_WS, aIndexArray ); } } diff --git a/sw/source/filter/xml/xmlexpit.hxx b/sw/source/filter/xml/xmlexpit.hxx index 21be616c0145..a7d290a2d640 100644 --- a/sw/source/filter/xml/xmlexpit.hxx +++ b/sw/source/filter/xml/xmlexpit.hxx @@ -43,7 +43,6 @@ protected: const SfxItemSet& rSet, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, - SvXmlExportFlags nFlags, std::vector<sal_uInt16> *pIndexArray ) const; void exportXML( const SvXMLExport& rExport, @@ -61,8 +60,7 @@ protected: const std::vector<sal_uInt16> &rIndexArray ) const; static const SfxPoolItem* GetItem( const SfxItemSet &rSet, - sal_uInt16 nWhichId, - SvXmlExportFlags nFlags ); + sal_uInt16 nWhichId ); public: explicit SvXMLExportItemMapper( SvXMLItemMapEntriesRef rMapEntries ); diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index fc05262c9845..67e41bc60a21 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -759,7 +759,6 @@ void SvXMLExportPropertyMapper::exportXML( nPropMapStartIdx, nPropMapEndIdx ); if( rExport.GetAttrList().getLength() > 0 || - (nFlags & SvXmlExportFlags::EMPTY) || !aIndexArray.empty() ) { SvXMLElementExport aElem( rExport, nNamespace, _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
