[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/txtimp.hxx |2 - include/xmloff/xmlimp.hxx |1 xmloff/source/core/xmlimp.cxx |9 + xmloff/source/text/txtimp.cxx | 65 ++ 4 files changed, 70 insertions(+), 7 deletions(-) New commits: commit 7cf5faec6fdbc27dd77d2d36fb2ff205322cba0d Author: Michael Stahl AuthorDate: Tue Sep 26 15:03:58 2023 +0200 Commit: Thorsten Behrens CommitDate: Thu Sep 28 22:52:50 2023 +0200 tdf#156146 xmloff: ODF import: add backward compatibility hack As a follow-up to ade0a153f453500f15343380ac937252992733e0 "tdf#114287 xmloff: ODF import: fix text:list override of list style", add some ugly compatibility hack to preserve the visual layout of documents produced by LO versions before 7.6. Override the left/first-line margin of the applied numbering rules with what is in the paragraph or paragraph style, and try to do this only in the specific situation where the list style is the same. Change-Id: I1f4520c9bf9d2257d2e3864e4ddb2d28451bbd2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157284 Tested-by: Jenkins Tested-by: Gabor Kelemen Reviewed-by: Thorsten Behrens diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx index 218db6fa7acd..24caf36e53d7 100644 --- a/include/xmloff/txtimp.hxx +++ b/include/xmloff/txtimp.hxx @@ -170,7 +170,7 @@ public: // Add parameter (#i73509#) // Add parameter in order to suppress the handling of the list attributes (#i80724#) OUString SetStyleAndAttrs( -SvXMLImport const & rImport, +SvXMLImport & rImport, const css::uno::Reference< css::text::XTextCursor >& rCursor, const OUString& rStyleName, bool bPara, diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 04a46be4c10a..922b211341c7 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -554,6 +554,7 @@ public: static const sal_uInt16 LO_6x = 60 | LO_flag; static const sal_uInt16 LO_63x = 63 | LO_flag; static const sal_uInt16 LO_7x = 70 | LO_flag; +static const sal_uInt16 LO_76 = 76 | LO_flag; static const sal_uInt16 LO_New = 100 | LO_flag; static const sal_uInt16 ProductVersionUnknown = SAL_MAX_UINT16; diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 24264a77460b..209c141fb0d4 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -219,7 +219,14 @@ public: } else if ('7' == loVersion[0]) { -mnGeneratorVersion = SvXMLImport::LO_7x; +if (loVersion.getLength() > 2 && loVersion[2] == '6') +{ +mnGeneratorVersion = SvXMLImport::LO_76; // 7.6 +} +else +{ +mnGeneratorVersion = SvXMLImport::LO_7x; +} } else { diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index fa43e44e2b22..647d6943a856 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -1003,8 +1003,40 @@ static bool lcl_HasListStyle( const OUString& sStyleName, return bRet; } + +namespace { + +auto IsPropertySet(uno::Reference const& rxParaStyles, +uno::Reference const& rxPropSet, +OUString const& rProperty) +{ +uno::Reference const xPropState(rxPropSet, uno::UNO_QUERY); +// note: this is true only if it is set in automatic style +if (xPropState->getPropertyState(rProperty) == beans::PropertyState_DIRECT_VALUE) +{ +return true; +} +// check if it is set by any parent common style +OUString style; +rxPropSet->getPropertyValue("ParaStyleName") >>= style; +while (!style.isEmpty() && rxParaStyles.is() && rxParaStyles->hasByName(style)) +{ +uno::Reference const xStyle(rxParaStyles->getByName(style), uno::UNO_QUERY); +assert(xStyle.is()); +uno::Reference const xStyleProps(xStyle, uno::UNO_QUERY); +if (xStyleProps->getPropertyState(rProperty) == beans::PropertyState_DIRECT_VALUE) +{ +return true; +} +style = xStyle->getParentStyle(); +} +return false; +}; + +} // namespace + OUString XMLTextImportHelper::SetStyleAndAttrs( -SvXMLImport const & rImport, +SvXMLImport & rImport, const Reference < XTextCursor >& rCursor, const OUString& rStyleName, bool bPara, @@ -1086,13 +1118,16 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( bool bNumberingIsNumber(true); // Assure that list style of automatic paragraph style is applied at paragraph. (#i101349#)
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/XMLTextShapeImportHelper.hxx |2 include/xmloff/XMLTextShapeStyleContext.hxx |4 - include/xmloff/numehelp.hxx | 18 ++-- include/xmloff/txtimppr.hxx |4 - xmloff/source/style/numehelp.cxx| 88 xmloff/source/text/XMLTextShapeImportHelper.cxx |6 - xmloff/source/text/XMLTextShapeStyleContext.cxx | 16 ++-- xmloff/source/text/txtimppr.cxx | 24 +++--- 8 files changed, 81 insertions(+), 81 deletions(-) New commits: commit 423d09bd237ac92382d0f7ff451c5025320823e7 Author: Miklos Vajna AuthorDate: Mon Jun 12 08:14:57 2023 +0200 Commit: Miklos Vajna CommitDate: Mon Jun 12 11:01:41 2023 +0200 xmloff: prefix members of XMLNumberFormatAttributesExportHelper, ... ... XMLTextImportPropertyMapper, XMLTextShapeImportHelper and XMLTextShapeStyleContext. See tdf#94879 for motivation. Change-Id: I03e663811f3c7b0208c50a07806a4ba41e82ad29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152892 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/xmloff/XMLTextShapeImportHelper.hxx b/include/xmloff/XMLTextShapeImportHelper.hxx index f02e566afbec..be5d179bb735 100644 --- a/include/xmloff/XMLTextShapeImportHelper.hxx +++ b/include/xmloff/XMLTextShapeImportHelper.hxx @@ -26,7 +26,7 @@ class XMLOFF_DLLPUBLIC XMLTextShapeImportHelper : public XMLShapeImportHelper { -SvXMLImport& rImport; +SvXMLImport& m_rImport; public: diff --git a/include/xmloff/XMLTextShapeStyleContext.hxx b/include/xmloff/XMLTextShapeStyleContext.hxx index 43cd9807a8dc..4425cb85f7e0 100644 --- a/include/xmloff/XMLTextShapeStyleContext.hxx +++ b/include/xmloff/XMLTextShapeStyleContext.hxx @@ -26,9 +26,9 @@ class XMLOFF_DLLPUBLIC XMLTextShapeStyleContext final : public XMLShapeStyleContext { -bool bAutoUpdate : 1; +bool m_bAutoUpdate : 1; -rtl::Reference xEventContext; +rtl::Reference m_xEventContext; virtual void SetAttribute( sal_Int32 nElement, const OUString& rValue ) override; diff --git a/include/xmloff/numehelp.hxx b/include/xmloff/numehelp.hxx index 41d2ddaf29e4..1e71a6a15ac8 100644 --- a/include/xmloff/numehelp.hxx +++ b/include/xmloff/numehelp.hxx @@ -61,15 +61,15 @@ typedef std::set XMLNumberFormatSet; class XMLOFF_DLLPUBLIC XMLNumberFormatAttributesExportHelper { -css::uno::Reference< css::util::XNumberFormats > xNumberFormats; -SvXMLExport*pExport; -const OUString sAttrValue; -const OUString sAttrDateValue; -const OUString sAttrTimeValue; -const OUString sAttrBooleanValue; -const OUString sAttrStringValue; -const OUString sAttrCurrency; -XMLNumberFormatSet aNumberFormats; +css::uno::Reference< css::util::XNumberFormats > m_xNumberFormats; +SvXMLExport*m_pExport; +const OUString m_sAttrValue; +const OUString m_sAttrDateValue; +const OUString m_sAttrTimeValue; +const OUString m_sAttrBooleanValue; +const OUString m_sAttrStringValue; +const OUString m_sAttrCurrency; +XMLNumberFormatSet m_aNumberFormats; public: XMLNumberFormatAttributesExportHelper(css::uno::Reference< css::util::XNumberFormatsSupplier > const & xNumberFormatsSupplier); XMLNumberFormatAttributesExportHelper(css::uno::Reference< css::util::XNumberFormatsSupplier > const & xNumberFormatsSupplier, diff --git a/include/xmloff/txtimppr.hxx b/include/xmloff/txtimppr.hxx index 860c869611ab..89f8b369fdea 100644 --- a/include/xmloff/txtimppr.hxx +++ b/include/xmloff/txtimppr.hxx @@ -25,8 +25,8 @@ class XMLOFF_DLLPUBLIC XMLTextImportPropertyMapper final : public SvXMLImportPropertyMapper { -sal_Int32 nSizeTypeIndex; -sal_Int32 nWidthTypeIndex; +sal_Int32 m_nSizeTypeIndex; +sal_Int32 m_nWidthTypeIndex; static void FontFinished( XMLPropertyState *pFontFamilyNameState, diff --git a/xmloff/source/style/numehelp.cxx b/xmloff/source/style/numehelp.cxx index c375fe3e69e3..da33b500741c 100644 --- a/xmloff/source/style/numehelp.cxx +++ b/xmloff/source/style/numehelp.cxx @@ -45,22 +45,22 @@ constexpr OUStringLiteral gsCurrencyAbbreviation(u"CurrencyAbbreviation"); XMLNumberFormatAttributesExportHelper::XMLNumberFormatAttributesExportHelper( css::uno::Reference< css::util::XNumberFormatsSupplier > const & xTempNumberFormatsSupplier) -: xNumberFormats(xTempNumberFormatsSupplier.is() ? xTempNumberFormatsSupplier->getNumberFormats() : css::uno::Reference< css::util::XNumberFormats > ()), -pExport(nullptr) +: m_xNumberFormats(xTempNumberFormatsSupplier.is() ? xTempNumberFormatsSupplier->getNumberFormats() : css::uno::Reference< css::util::XNumberFormats > ()), +m_pExport(nullptr) { } XMLNumberFormatAttributesExportHelper::XMLNumberFormatAttributesExportHelper(
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/XMLConstantsPropertyHandler.hxx |6 - include/xmloff/XMLTextMasterPageContext.hxx | 24 +++ include/xmloff/xmlnume.hxx |4 - include/xmloff/xmlnumi.hxx | 10 +- xmloff/source/style/XMLConstantsPropertyHandler.cxx |4 - xmloff/source/style/xmlnume.cxx |2 xmloff/source/style/xmlnumi.cxx | 38 +-- xmloff/source/text/XMLTextMasterPageContext.cxx | 68 ++-- 8 files changed, 78 insertions(+), 78 deletions(-) New commits: commit 5841f73d516201576b1841c38fb3eb2a9c7295ea Author: Miklos Vajna AuthorDate: Mon Jun 5 08:25:01 2023 +0200 Commit: Miklos Vajna CommitDate: Mon Jun 5 09:16:26 2023 +0200 xmloff: prefix members of SvxXMLListStyleContext, SvxXMLNumRuleExport, ... ... XMLConstantsPropertyHandler and XMLTextMasterPageContext See tdf#94879 for motivation. Change-Id: I739c9d4f7e551f84e7a55c6c5eb5109af596f055 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152598 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/xmloff/XMLConstantsPropertyHandler.hxx b/include/xmloff/XMLConstantsPropertyHandler.hxx index 5db0aa63f675..7152c7180932 100644 --- a/include/xmloff/XMLConstantsPropertyHandler.hxx +++ b/include/xmloff/XMLConstantsPropertyHandler.hxx @@ -34,14 +34,14 @@ struct SvXMLEnumMapEntry; */ class XMLOFF_DLLPUBLIC XMLConstantsPropertyHandler: public XMLPropertyHandler { -const SvXMLEnumMapEntry *pMap; -const enum ::xmloff::token::XMLTokenEnum eDefault; +const SvXMLEnumMapEntry *m_pMap; +const enum ::xmloff::token::XMLTokenEnum m_eDefault; public: template XMLConstantsPropertyHandler( const SvXMLEnumMapEntry *pM, enum ::xmloff::token::XMLTokenEnum eDflt) - : pMap(reinterpret_cast*>(pM)), eDefault(eDflt) {} + : m_pMap(reinterpret_cast*>(pM)), m_eDefault(eDflt) {} // Just needed for virtual destruction virtual ~XMLConstantsPropertyHandler() override; diff --git a/include/xmloff/XMLTextMasterPageContext.hxx b/include/xmloff/XMLTextMasterPageContext.hxx index d39159890788..36243d6005b5 100644 --- a/include/xmloff/XMLTextMasterPageContext.hxx +++ b/include/xmloff/XMLTextMasterPageContext.hxx @@ -31,24 +31,24 @@ namespace com::sun::star { class XMLOFF_DLLPUBLIC XMLTextMasterPageContext : public SvXMLStyleContext { -OUString sFollow; -OUString sPageMasterName; +OUString m_sFollow; +OUString m_sPageMasterName; OUString m_sDrawingPageStyle; -css::uno::Reference < css::style::XStyle > xStyle; +css::uno::Reference < css::style::XStyle > m_xStyle; -bool bInsertHeader; -bool bInsertFooter; -bool bInsertHeaderLeft; -bool bInsertFooterLeft; -bool bInsertHeaderFirst; -bool bInsertFooterFirst; -bool bHeaderInserted; -bool bFooterInserted; +bool m_bInsertHeader; +bool m_bInsertFooter; +bool m_bInsertHeaderLeft; +bool m_bInsertFooterLeft; +bool m_bInsertHeaderFirst; +bool m_bInsertFooterFirst; +bool m_bHeaderInserted; +bool m_bFooterInserted; SAL_DLLPRIVATE css::uno::Reference< css::style::XStyle > Create(); protected: -const css::uno::Reference< css::style::XStyle >& GetStyle() const { return xStyle; } +const css::uno::Reference< css::style::XStyle >& GetStyle() const { return m_xStyle; } public: diff --git a/include/xmloff/xmlnume.hxx b/include/xmloff/xmlnume.hxx index 85f78047ee80..705af6e78d0c 100644 --- a/include/xmloff/xmlnume.hxx +++ b/include/xmloff/xmlnume.hxx @@ -37,7 +37,7 @@ class XMLTextListAutoStylePool; class XMLOFF_DLLPUBLIC SvxXMLNumRuleExport final { -SvXMLExport& rExport; +SvXMLExport& m_rExport; // Boolean indicating, if properties for position-and-space-mode LABEL_ALIGNMENT // are exported or not. (#i89178#) // These properties have been introduced in ODF 1.2. Thus, its export have @@ -52,7 +52,7 @@ class XMLOFF_DLLPUBLIC SvxXMLNumRuleExport final SAL_DLLPRIVATE void exportStyle( const css::uno::Reference< css::style::XStyle >& rStyle ); SAL_DLLPRIVATE void exportOutline(); -SvXMLExport& GetExport() { return rExport; } +SvXMLExport& GetExport() { return m_rExport; } public: diff --git a/include/xmloff/xmlnumi.hxx b/include/xmloff/xmlnumi.hxx index 4adfd437b95d..e79978f2e77d 100644 --- a/include/xmloff/xmlnumi.hxx +++ b/include/xmloff/xmlnumi.hxx @@ -36,12 +36,12 @@ typedef std::vector> SvxXMLList class XMLOFF_DLLPUBLIC SvxXMLListStyleContext final : public SvXMLStyleContext { -css::uno::Reference< css::container::XIndexReplace > xNumRules; +css::uno::Reference< css::container::XIndexReplace > m_xNumRules; -std::unique_ptr pLevelStyles; +std::unique_ptr m_pLevelStyles; -boolbConsecutive : 1; -bool
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/MarkerStyle.hxx |4 ++-- include/xmloff/XMLEventsImportContext.hxx |4 ++-- include/xmloff/XMLFontStylesContext.hxx | 20 ++-- xmloff/source/forms/eventimport.cxx |4 ++-- xmloff/source/script/XMLEventsImportContext.cxx | 22 +++--- xmloff/source/style/MarkerStyle.cxx | 20 ++-- xmloff/source/style/XMLFontStylesContext.cxx| 10 +- 7 files changed, 42 insertions(+), 42 deletions(-) New commits: commit 385d3323ce23833e8706b0d21f6df07e1927b8e0 Author: Miklos Vajna AuthorDate: Tue May 30 08:15:55 2023 +0200 Commit: Miklos Vajna CommitDate: Tue May 30 09:19:09 2023 +0200 sw: prefix members of XMLEventsImportContext, XMLFontStylesContext, ... ... XMLMarkerStyleExport and XMLMarkerStyleImport See tdf#94879 for motivation. Change-Id: Ief48236f16c5525c6bd49d78e6ba4f9643ef1214 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152376 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/xmloff/MarkerStyle.hxx b/include/xmloff/MarkerStyle.hxx index ce1ae3080a00..8159a40cea50 100644 --- a/include/xmloff/MarkerStyle.hxx +++ b/include/xmloff/MarkerStyle.hxx @@ -35,7 +35,7 @@ namespace com::sun::star { class XMLOFF_DLLPUBLIC XMLMarkerStyleImport { -SvXMLImport& rImport; +SvXMLImport& m_rImport; public: XMLMarkerStyleImport( SvXMLImport& rImport ); @@ -48,7 +48,7 @@ public: class XMLOFF_DLLPUBLIC XMLMarkerStyleExport { -SvXMLExport& rExport; +SvXMLExport& m_rExport; public: XMLMarkerStyleExport( SvXMLExport& rExport ); diff --git a/include/xmloff/XMLEventsImportContext.hxx b/include/xmloff/XMLEventsImportContext.hxx index dc03d91a61ab..910a12e55079 100644 --- a/include/xmloff/XMLEventsImportContext.hxx +++ b/include/xmloff/XMLEventsImportContext.hxx @@ -51,11 +51,11 @@ typedef ::std::pair< class XMLOFF_DLLPUBLIC XMLEventsImportContext : public SvXMLImportContext { // the event XNameReplace; may be empty -css::uno::Reference xEvents; +css::uno::Reference m_xEvents; protected: // if no XNameReplace is given, use this vector to collect events -std::vector< EventNameValuesPair > aCollectEvents; +std::vector< EventNameValuesPair > m_aCollectEvents; public: diff --git a/include/xmloff/XMLFontStylesContext.hxx b/include/xmloff/XMLFontStylesContext.hxx index 6768ca43b970..13bfb0545325 100644 --- a/include/xmloff/XMLFontStylesContext.hxx +++ b/include/xmloff/XMLFontStylesContext.hxx @@ -35,12 +35,12 @@ class XMLFontEncodingPropHdl; class XMLOFF_DLLPUBLIC XMLFontStylesContext final : public SvXMLStylesContext { -std::unique_ptrpFamilyNameHdl; -std::unique_ptrpFamilyHdl; -std::unique_ptr pPitchHdl; -std::unique_ptr pEncHdl; +std::unique_ptrm_pFamilyNameHdl; +std::unique_ptrm_pFamilyHdl; +std::unique_ptr m_pPitchHdl; +std::unique_ptr m_pEncHdl; -rtl_TextEncodingeDfltEncoding; +rtl_TextEncodingm_eDefaultEncoding; using SvXMLStylesContext::CreateStyleChildContext; virtual SvXMLStyleContext *CreateStyleChildContext( sal_Int32 nElement, @@ -60,12 +60,12 @@ public: sal_Int32 nPitchIdx, sal_Int32 nCharsetIdx ) const; -rtl_TextEncoding GetDfltCharset() const { return eDfltEncoding; } +rtl_TextEncoding GetDfltCharset() const { return m_eDefaultEncoding; } -XMLFontFamilyNamePropHdl& GetFamilyNameHdl() const { return *pFamilyNameHdl; } -XMLFontFamilyPropHdl& GetFamilyHdl() const { return *pFamilyHdl; } -XMLFontPitchPropHdl& GetPitchHdl() const { return *pPitchHdl; } -XMLFontEncodingPropHdl& GetEncodingHdl() const { return *pEncHdl; } +XMLFontFamilyNamePropHdl& GetFamilyNameHdl() const { return *m_pFamilyNameHdl; } +XMLFontFamilyPropHdl& GetFamilyHdl() const { return *m_pFamilyHdl; } +XMLFontPitchPropHdl& GetPitchHdl() const { return *m_pPitchHdl; } +XMLFontEncodingPropHdl& GetEncodingHdl() const { return *m_pEncHdl; } }; diff --git a/xmloff/source/forms/eventimport.cxx b/xmloff/source/forms/eventimport.cxx index 02bfe7764a6b..ae909fd9e9c0 100644 --- a/xmloff/source/forms/eventimport.cxx +++ b/xmloff/source/forms/eventimport.cxx @@ -40,12 +40,12 @@ namespace xmloff void OFormEventsImportContext::endFastElement(sal_Int32 ) { -Sequence< ScriptEventDescriptor > aTranslated(aCollectEvents.size()); +Sequence< ScriptEventDescriptor > aTranslated(m_aCollectEvents.size()); ScriptEventDescriptor* pTranslated = aTranslated.getArray(); // loop through the collected events and translate them sal_Int32 nSeparatorPos = -1; -for ( const auto& rEvent : aCollectEvents ) +for ( const auto& rEvent : m_aCollectEvents ) { // the name of the event is
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/GradientStyle.hxx |4 +- include/xmloff/HatchStyle.hxx |4 +- xmloff/source/style/GradientStyle.cxx | 50 +- xmloff/source/style/HatchStyle.cxx| 26 - 4 files changed, 42 insertions(+), 42 deletions(-) New commits: commit a97374fca86e4073c83a8e539d97462c23dd32b8 Author: Miklos Vajna AuthorDate: Mon May 22 08:27:57 2023 +0200 Commit: Miklos Vajna CommitDate: Mon May 22 10:34:57 2023 +0200 sw: prefix members of XMLGradientStyleExport, XMLGradientStyleImport, ... ... XMLHatchStyleExport and XMLHatchStyleImport See tdf#94879 for motivation. Change-Id: I2dd4c97c6e234447190e46bd6f6a6354e16911bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152077 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/xmloff/GradientStyle.hxx b/include/xmloff/GradientStyle.hxx index 04ad2832d997..58975644fb3d 100644 --- a/include/xmloff/GradientStyle.hxx +++ b/include/xmloff/GradientStyle.hxx @@ -37,7 +37,7 @@ namespace com::sun::star { class XMLOFF_DLLPUBLIC XMLGradientStyleImport { -SvXMLImport& rImport; +SvXMLImport& m_rImport; public: XMLGradientStyleImport( SvXMLImport& rImport ); @@ -60,7 +60,7 @@ public: class XMLOFF_DLLPUBLIC XMLGradientStyleExport { -SvXMLExport& rExport; +SvXMLExport& m_rExport; public: XMLGradientStyleExport( SvXMLExport& rExport ); diff --git a/include/xmloff/HatchStyle.hxx b/include/xmloff/HatchStyle.hxx index 9ded654e53e2..73c07e643a2c 100644 --- a/include/xmloff/HatchStyle.hxx +++ b/include/xmloff/HatchStyle.hxx @@ -35,7 +35,7 @@ namespace com::sun::star { class XMLOFF_DLLPUBLIC XMLHatchStyleImport { -SvXMLImport& rImport; +SvXMLImport& m_rImport; public: XMLHatchStyleImport( SvXMLImport& rImport ); @@ -48,7 +48,7 @@ public: class XMLOFF_DLLPUBLIC XMLHatchStyleExport { -SvXMLExport& rExport; +SvXMLExport& m_rExport; public: XMLHatchStyleExport( SvXMLExport& rExport ); diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx index 3ab6c422b2c8..fcc371c89ffb 100644 --- a/xmloff/source/style/GradientStyle.cxx +++ b/xmloff/source/style/GradientStyle.cxx @@ -52,7 +52,7 @@ SvXMLEnumMapEntry const pXML_GradientStyle_Enum[] = // Import XMLGradientStyleImport::XMLGradientStyleImport( SvXMLImport& rImp ) -: rImport(rImp) +: m_rImport(rImp) { } @@ -114,14 +114,14 @@ void XMLGradientStyleImport::importXML( break; case XML_ELEMENT(DRAW, XML_GRADIENT_ANGLE): { -auto const cmp12(rImport.GetODFVersion().compareTo(ODFVER_012_TEXT)); +auto const cmp12(m_rImport.GetODFVersion().compareTo(ODFVER_012_TEXT)); bool const bSuccess = ::sax::Converter::convertAngle(aGradient.Angle, aIter.toView(), // tdf#89475 try to detect borked OOo angles (cmp12 < 0) || (cmp12 == 0 -&& (rImport.isGeneratorVersionOlderThan(SvXMLImport::AOO_4x, SvXMLImport::LO_7x) +&& (m_rImport.isGeneratorVersionOlderThan(SvXMLImport::AOO_4x, SvXMLImport::LO_7x) // also for AOO 4.x, assume there won't ever be a 4.2 -|| rImport.getGeneratorVersion() == SvXMLImport::AOO_4x))); +|| m_rImport.getGeneratorVersion() == SvXMLImport::AOO_4x))); SAL_INFO_IF(!bSuccess, "xmloff.style", "failed to import draw:angle"); } break; @@ -139,7 +139,7 @@ void XMLGradientStyleImport::importXML( if( !aDisplayName.isEmpty() ) { -rImport.AddStyleDisplayName( XmlStyleFamily::SD_GRADIENT_ID, rStrName, +m_rImport.AddStyleDisplayName( XmlStyleFamily::SD_GRADIENT_ID, rStrName, aDisplayName ); rStrName = aDisplayName; } @@ -211,7 +211,7 @@ XMLGradientStopContext::~XMLGradientStopContext() XMLGradientStyleExport::XMLGradientStyleExport( SvXMLExport& rExp ) -: rExport(rExp) +: m_rExport(rExp) { } @@ -236,15 +236,15 @@ void XMLGradientStyleExport::exportXML( // Name bool bEncoded = false; -rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, - rExport.EncodeStyleName( rStrName, +m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, + m_rExport.EncodeStyleName( rStrName, ) ); if( bEncoded ) -rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME, +m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME, rStrName ); aStrValue = aOut.makeStringAndClear(); -rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue ); +
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/DashStyle.hxx|4 +-- include/xmloff/XMLEventExport.hxx |8 +++--- include/xmloff/xmlcnimp.hxx |2 - xmloff/source/core/xmlcnimp.cxx | 42 xmloff/source/script/XMLEventExport.cxx | 40 +++--- xmloff/source/style/DashStyle.cxx | 30 +++--- 6 files changed, 63 insertions(+), 63 deletions(-) New commits: commit d75f4673ac6e51ae341a3d87dc9b16c4ed0c1cdf Author: Miklos Vajna AuthorDate: Mon May 15 08:10:09 2023 +0200 Commit: Miklos Vajna CommitDate: Mon May 15 11:17:39 2023 +0200 sw: prefix members of SvXMLAttrContainerData, XMLDashStyleExport, ... ... XMLDashStyleImport and XMLEventExport See tdf#94879 for motivation. Change-Id: I203cc1c789a1a33721b27754412da35c3ca8a56a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151755 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/xmloff/DashStyle.hxx b/include/xmloff/DashStyle.hxx index c27234124556..2a378261ab98 100644 --- a/include/xmloff/DashStyle.hxx +++ b/include/xmloff/DashStyle.hxx @@ -34,7 +34,7 @@ namespace com::sun::star { class XMLOFF_DLLPUBLIC XMLDashStyleImport { -SvXMLImport& rImport; +SvXMLImport& m_rImport; public: XMLDashStyleImport( SvXMLImport& rImport ); @@ -48,7 +48,7 @@ public: class XMLOFF_DLLPUBLIC XMLDashStyleExport { -SvXMLExport& rExport; +SvXMLExport& m_rExport; public: XMLDashStyleExport( SvXMLExport& rExport ); diff --git a/include/xmloff/XMLEventExport.hxx b/include/xmloff/XMLEventExport.hxx index ad83390b6dc9..53864b9e5e63 100644 --- a/include/xmloff/XMLEventExport.hxx +++ b/include/xmloff/XMLEventExport.hxx @@ -60,12 +60,12 @@ typedef ::std::map< OUString, XMLEventName > NameMap; */ class XMLOFF_DLLPUBLIC XMLEventExport { -SvXMLExport& rExport; +SvXMLExport& m_rExport; -HandlerMap aHandlerMap; -NameMap aNameTranslationMap; +HandlerMap m_aHandlerMap; +NameMap m_aNameTranslationMap; -bool bExtNamespace; +bool m_bExtNamespace; public: XMLEventExport(SvXMLExport& rExport); diff --git a/include/xmloff/xmlcnimp.hxx b/include/xmloff/xmlcnimp.hxx index 614a8cae742f..8ccdc9948a4d 100644 --- a/include/xmloff/xmlcnimp.hxx +++ b/include/xmloff/xmlcnimp.hxx @@ -30,7 +30,7 @@ class SvXMLAttrCollection; class XMLOFF_DLLPUBLIC SvXMLAttrContainerData { private: -std::unique_ptr pimpl; +std::unique_ptr m_pImpl; public: SvXMLAttrContainerData(); diff --git a/xmloff/source/core/xmlcnimp.cxx b/xmloff/source/core/xmlcnimp.cxx index 0a7ab2018475..8208f9200f4b 100644 --- a/xmloff/source/core/xmlcnimp.cxx +++ b/xmloff/source/core/xmlcnimp.cxx @@ -21,24 +21,24 @@ #include #include -SvXMLAttrContainerData::SvXMLAttrContainerData() : pimpl( new SvXMLAttrCollection ) +SvXMLAttrContainerData::SvXMLAttrContainerData() : m_pImpl( new SvXMLAttrCollection ) { } SvXMLAttrContainerData::SvXMLAttrContainerData(const SvXMLAttrContainerData ) : -pimpl( new SvXMLAttrCollection( *(rCopy.pimpl) ) ) +m_pImpl( new SvXMLAttrCollection( *(rCopy.m_pImpl) ) ) { } SvXMLAttrContainerData& SvXMLAttrContainerData::operator=(const SvXMLAttrContainerData ) { -pimpl.reset( new SvXMLAttrCollection( *rCopy.pimpl ) ); +m_pImpl.reset( new SvXMLAttrCollection( *rCopy.m_pImpl ) ); return *this; } SvXMLAttrContainerData& SvXMLAttrContainerData::operator=(SvXMLAttrContainerData&& rCopy) noexcept { -pimpl = std::move( rCopy.pimpl ); +m_pImpl = std::move( rCopy.m_pImpl ); return *this; } @@ -50,7 +50,7 @@ SvXMLAttrContainerData::~SvXMLAttrContainerData() bool SvXMLAttrContainerData::operator ==( const SvXMLAttrContainerData& rCmp ) const { -return ( *(rCmp.pimpl) == *pimpl ); +return ( *(rCmp.m_pImpl) == *m_pImpl ); } bool SvXMLAttrContainerData::AddAttr( const OUString& rLName, @@ -58,7 +58,7 @@ bool SvXMLAttrContainerData::AddAttr( const OUString& rLName, { assert( !rLName.isEmpty() && "empty attribute name is invalid"); assert( rLName.indexOf(':') == -1 && "colon in name?"); -return pimpl->AddAttr(rLName, rValue); +return m_pImpl->AddAttr(rLName, rValue); } bool SvXMLAttrContainerData::AddAttr( const OUString& rPrefix, @@ -69,7 +69,7 @@ bool SvXMLAttrContainerData::AddAttr( const OUString& rPrefix, assert( !rLName.isEmpty() && "empty attribute name is invalid"); assert( rPrefix.indexOf(':') == -1 && "colon in prefix?"); assert( rLName.indexOf(':') == -1 && "colon in name?"); -return pimpl->AddAttr(rPrefix, rNamespace, rLName, rValue); +return m_pImpl->AddAttr(rPrefix, rNamespace, rLName, rValue); } bool SvXMLAttrContainerData::AddAttr( const OUString& rPrefix, @@ -79,7 +79,7 @@ bool SvXMLAttrContainerData::AddAttr( const OUString& rPrefix, assert( !rLName.isEmpty() && "empty attribute name is invalid"); assert(
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/maptype.hxx |4 ++-- xmloff/source/text/txtprmap.cxx | 20 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) New commits: commit b7affedf9c281d6329ac87c5f3cd0fd0f617acbb Author: Mike Kaganski AuthorDate: Tue May 9 19:14:41 2023 +0300 Commit: Mike Kaganski CommitDate: Tue May 9 19:51:27 2023 +0200 const -> constexpr Change-Id: Ibeeba1862d84e43fa659cb2a97ef3498674f0d40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151590 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/include/xmloff/maptype.hxx b/include/xmloff/maptype.hxx index 942f7c46279a..5102b899b11e 100644 --- a/include/xmloff/maptype.hxx +++ b/include/xmloff/maptype.hxx @@ -102,7 +102,7 @@ struct XMLPropertyMapEntry static constexpr OUStringLiteral EMPTY{u""}; template -XMLPropertyMapEntry( +constexpr XMLPropertyMapEntry( const OUStringLiteral& sApiName, sal_uInt16 nNameSpace, enum ::xmloff::token::XMLTokenEnum eXMLName, @@ -118,7 +118,7 @@ struct XMLPropertyMapEntry {} /// used to mark the end of the array -XMLPropertyMapEntry(std::nullptr_t) +constexpr XMLPropertyMapEntry(std::nullptr_t) : msApiName(EMPTY), meXMLName(xmloff::token::XML_TOKEN_INVALID), mnNameSpace(0), mnType(0), diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index c3b7403de1d7..0c2a04a1eec4 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -87,7 +87,7 @@ using namespace ::xmloff::token; #define MAP_(name,prefix,token,type,context) { name, prefix, token, type, context, SvtSaveOptions::ODFSVER_010, false } #define GMAP(name,prefix,token,type,context) MAP_(name,prefix,token,static_cast(type|XML_TYPE_PROP_GRAPHIC),context) -XMLPropertyMapEntry const aXMLParaPropMap[] = +XMLPropertyMapEntry constexpr aXMLParaPropMap[] = { // RES_UNKNOWNATR_CONTAINER MP_E( PROP_ParaUserDefinedAttributes, TEXT, XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ), @@ -467,7 +467,7 @@ XMLPropertyMapEntry const aXMLParaPropMap[] = }; -XMLPropertyMapEntry const aXMLAdditionalTextDefaultsMap[] = +XMLPropertyMapEntry constexpr aXMLAdditionalTextDefaultsMap[] = { // RES_FOLLOW_TEXT_FLOW - DVO #i18732# MG_ED( PROP_IsFollowingTextFlow, STYLE, FLOW_WITH_TEXT, XML_TYPE_BOOL, 0 ), @@ -478,7 +478,7 @@ XMLPropertyMapEntry const aXMLAdditionalTextDefaultsMap[] = M_END() }; -XMLPropertyMapEntry const aXMLTextPropMap[] = +XMLPropertyMapEntry constexpr aXMLTextPropMap[] = { // RES_CHRATR_CASEMAP MT_E( PROP_CharCaseMap,FO, FONT_VARIANT, XML_TYPE_TEXT_CASEMAP_VAR, 0 ), @@ -682,7 +682,7 @@ XMLPropertyMapEntry const aXMLTextPropMap[] = M_END() }; -XMLPropertyMapEntry const aXMLFramePropMap[] = +XMLPropertyMapEntry constexpr aXMLFramePropMap[] = { // RES_FILL_ORDER // TODO: not required??? @@ -894,7 +894,7 @@ XMLPropertyMapEntry const aXMLFramePropMap[] = M_END() }; -XMLPropertyMapEntry const aXMLShapePropMap[] = +XMLPropertyMapEntry constexpr aXMLShapePropMap[] = { // RES_LR_SPACE MG_E( PROP_LeftMargin, FO, MARGIN_LEFT, XML_TYPE_MEASURE, 0), @@ -943,7 +943,7 @@ XMLPropertyMapEntry const aXMLShapePropMap[] = M_END() }; -XMLPropertyMapEntry const aXMLSectionPropMap[] = +XMLPropertyMapEntry constexpr aXMLSectionPropMap[] = { // RES_COL MS_E( PROP_TextColumns,STYLE, COLUMNS, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_COLUMNS, CTF_TEXTCOLUMNS ), @@ -989,7 +989,7 @@ XMLPropertyMapEntry const aXMLSectionPropMap[] = M_END() }; -XMLPropertyMapEntry const aXMLRubyPropMap[] = +XMLPropertyMapEntry constexpr aXMLRubyPropMap[] = { MR_E( PROP_RubyAdjust, STYLE, RUBY_ALIGN, XML_TYPE_TEXT_RUBY_ADJUST, 0 ), MR_E( PROP_RubyIsAbove,STYLE, RUBY_POSITION, XML_TYPE_TEXT_RUBY_IS_ABOVE, 0 ), @@ -998,7 +998,7 @@ XMLPropertyMapEntry const aXMLRubyPropMap[] = }; -XMLPropertyMapEntry const aXMLTableDefaultsMap[] = +XMLPropertyMapEntry constexpr aXMLTableDefaultsMap[] = { // RES_COLLAPSING_BORDERS: only occurs in tables, but we need to // read/write the default for this item @@ -1007,7 +1007,7 @@ XMLPropertyMapEntry const aXMLTableDefaultsMap[] = M_END() }; -XMLPropertyMapEntry const aXMLTableRowDefaultsMap[] = +XMLPropertyMapEntry constexpr aXMLTableRowDefaultsMap[] = { // RES_ROW_SPLIT: only occurs in table rows, but we need to // read/write the default for this item @@ -1016,7 +1016,7 @@ XMLPropertyMapEntry const aXMLTableRowDefaultsMap[] = M_END() }; -XMLPropertyMapEntry const aXMLCellPropMap[] = +XMLPropertyMapEntry constexpr aXMLCellPropMap[] = { MC_E( PROP_BackColor,FO,BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), MC_E( PROP_LeftBorder, FO,BORDER_LEFT,
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/ProgressBarHelper.hxx | 32 ++--- include/xmloff/XMLBase64ImportContext.hxx |2 include/xmloff/i18nmap.hxx| 14 ++--- include/xmloff/xmlerror.hxx |2 xmloff/source/core/ProgressBarHelper.cxx | 64 +- xmloff/source/core/XMLBase64ImportContext.cxx |6 +- xmloff/source/core/xmlerror.cxx |6 +- 7 files changed, 63 insertions(+), 63 deletions(-) New commits: commit d9a276bc6aaf66241e3a0b5d53b1e8d2dd238d7e Author: Miklos Vajna AuthorDate: Mon May 8 06:01:13 2023 +0200 Commit: Miklos Vajna CommitDate: Mon May 8 08:53:18 2023 +0200 sw: prefix members of ProgressBarHelper, SvI18NMapEntry_Key, ... ... XMLBase64ImportContext and XMLErrors See tdf#94879 for motivation. Change-Id: Ic8d1b3515727981c50d8f3a64fe6bf030f0521fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151491 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/include/xmloff/ProgressBarHelper.hxx b/include/xmloff/ProgressBarHelper.hxx index 770cf7986604..1fc42c96db60 100644 --- a/include/xmloff/ProgressBarHelper.hxx +++ b/include/xmloff/ProgressBarHelper.hxx @@ -31,37 +31,37 @@ inline constexpr OUStringLiteral XML_PROGRESSREPEAT = u"ProgressRepeat"; class XMLOFF_DLLPUBLIC ProgressBarHelper { -css::uno::Reference < css::task::XStatusIndicator > xStatusIndicator; -sal_Int32 nRange; -sal_Int32 nReference; -sal_Int32 nValue; -doublefOldPercent; -bool bStrict; +css::uno::Reference < css::task::XStatusIndicator > m_xStatusIndicator; +sal_Int32 m_nRange; +sal_Int32 m_nReference; +sal_Int32 m_nValue; +double m_fOldPercent; +bool m_bStrict; // #96469#; if the value goes over the Range the progressbar starts again -bool bRepeat; +bool m_bRepeat; #ifdef DBG_UTIL -bool bFailure; +bool m_bFailure; #endif public: ProgressBarHelper(css::uno::Reference < css::task::XStatusIndicator> xStatusIndicator, const bool bStrict); ~ProgressBarHelper(); -void SetRange(sal_Int32 nVal) { nRange = nVal; } -void SetReference(sal_Int32 nVal) { nReference = nVal; } +void SetRange(sal_Int32 nVal) { m_nRange = nVal; } +void SetReference(sal_Int32 nVal) { m_nReference = nVal; } void SetValue(sal_Int32 nValue); -void SetRepeat(bool bValue) { bRepeat = bValue; } -void Increment(sal_Int32 nInc = 1) { SetValue( nValue+nInc ); } -void End() { if (xStatusIndicator.is()) xStatusIndicator->end(); } +void SetRepeat(bool bValue) { m_bRepeat = bValue; } +void Increment(sal_Int32 nInc = 1) { SetValue( m_nValue+nInc ); } +void End() { if (m_xStatusIndicator.is()) m_xStatusIndicator->end(); } // set the new reference and returns the new value which gives the // Progress Bar the same position as before void ChangeReference(sal_Int32 nNewReference); -sal_Int32 GetReference() const { return nReference; } -sal_Int32 GetValue() const { return nValue; } -bool GetRepeat() const { return bRepeat; } +sal_Int32 GetReference() const { return m_nReference; } +sal_Int32 GetValue() const { return m_nValue; } +bool GetRepeat() const { return m_bRepeat; } }; #endif diff --git a/include/xmloff/XMLBase64ImportContext.hxx b/include/xmloff/XMLBase64ImportContext.hxx index e2b62abea1a4..053ec8cec56c 100644 --- a/include/xmloff/XMLBase64ImportContext.hxx +++ b/include/xmloff/XMLBase64ImportContext.hxx @@ -30,7 +30,7 @@ namespace com::sun::star::io { class XOutputStream; } class XMLOFF_DLLPUBLIC XMLBase64ImportContext final : public SvXMLImportContext { -css::uno::Reference< css::io::XOutputStream > xOut; +css::uno::Reference< css::io::XOutputStream > m_xOut; OUStringBuffer maCharBuffer; public: diff --git a/include/xmloff/i18nmap.hxx b/include/xmloff/i18nmap.hxx index 91aed83eddf5..31dd07692a87 100644 ---
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx|2 include/xmloff/xmlimppr.hxx |4 include/xmloff/xmlnumfi.hxx | 74 +++--- xmloff/source/core/xmlimp.cxx|4 xmloff/source/style/xmlimppr.cxx | 10 xmloff/source/style/xmlnumfi.cxx | 450 +++ 6 files changed, 272 insertions(+), 272 deletions(-) New commits: commit 41e3d2c936f008d010a64c00904539eed2392551 Author: Miklos Vajna AuthorDate: Tue May 2 08:22:40 2023 +0200 Commit: Miklos Vajna CommitDate: Tue May 2 10:51:55 2023 +0200 sw: prefix members of SvXMLImport, SvXMLImportPropertyMapper, ... ... SvXMLNumFmtHelper and SvXMLNumFormatContext See tdf#94879 for motivation. Change-Id: I1942fae05f2df1f23e0b05f8cb0eaa1f6df73f18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151252 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 3e1d8966b47b..3287911f1112 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -227,7 +227,7 @@ class XMLOFF_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") SvXMLImport : public c SAL_DLLPRIVATE void InitCtor_(); SvXMLImportFlags mnImportFlags; -std::set< OUString > embeddedFontUrlsKnown; +std::set< OUString > m_embeddedFontUrlsKnown; css::uno::Reference< css::xml::sax::XFastParser > mxParser; rtl::Reference< SvXMLImportFastNamespaceHandler > maNamespaceHandler; rtl::Reference < comphelper::AttributeList > maNamespaceAttrList; diff --git a/include/xmloff/xmlimppr.hxx b/include/xmloff/xmlimppr.hxx index 4419c91783a2..adfba4eadc60 100644 --- a/include/xmloff/xmlimppr.hxx +++ b/include/xmloff/xmlimppr.hxx @@ -65,7 +65,7 @@ class XMLOFF_DLLPUBLIC SvXMLImportPropertyMapper : public salhelper::SimpleRefer { rtl::Reference< SvXMLImportPropertyMapper> mxNextMapper; -SvXMLImport& rImport; // access to error handling +SvXMLImport& m_rImport; // access to error handling SvXMLImportPropertyMapper(SvXMLImportPropertyMapper const &) = delete; SvXMLImportPropertyMapper& operator =(SvXMLImportPropertyMapper const &) = delete; @@ -73,7 +73,7 @@ class XMLOFF_DLLPUBLIC SvXMLImportPropertyMapper : public salhelper::SimpleRefer protected: rtl::Reference< XMLPropertySetMapper > maPropMapper; -SvXMLImport& GetImport() const { return rImport;} +SvXMLImport& GetImport() const { return m_rImport;} public: diff --git a/include/xmloff/xmlnumfi.hxx b/include/xmloff/xmlnumfi.hxx index 9a18893df3c6..bebc580a937b 100644 --- a/include/xmloff/xmlnumfi.hxx +++ b/include/xmloff/xmlnumfi.hxx @@ -69,7 +69,7 @@ class LocaleDataWrapper; class SvXMLNumFmtHelper { -std::unique_ptr pData; +std::unique_ptr m_pData; public: SvXMLNumFmtHelper( @@ -87,7 +87,7 @@ public: const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList, SvXMLStylesContext& rStyles); -SvXMLNumImpData* getData() { return pData.get(); } +SvXMLNumImpData* getData() { return m_pData.get(); } LanguageType GetLanguageForKey(sal_Int32 nKey) const; @@ -127,40 +127,40 @@ public: private: -SvXMLNumImpData*pData; -SvXMLStylesContext* pStyles; -std::vectoraMyConditions; -SvXMLStylesTokens nType; -sal_Int32 nKey; +SvXMLNumImpData*m_pData; +SvXMLStylesContext* m_pStyles; +std::vectorm_aMyConditions; +SvXMLStylesTokens m_nType; +sal_Int32 m_nKey; // OUString sFormatName; -OUString sFormatTitle; +OUString m_sFormatTitle; // OUString sMapName; -OUString sCalendar; -OUString aImplicitCalendar[2]; -ImplicitCalendar eImplicitCalendar; -LanguageType nFormatLang; -boolbAutoOrder; -boolbFromSystem; -boolbTruncate; -boolbAutoDec; // set in AddNumber -boolbAutoInt; // set in AddNumber -boolbHasExtraText; -boolbHasTrailingEmptyText; -OUStringBuffer aFormatCode{64}; -OUStringBuffer aConditions{32}; -boolbHasLongDoW; -boolbHasDateTime; -boolbRemoveAfterUse; +OUString m_sCalendar; +OUString m_aImplicitCalendar[2]; +ImplicitCalendar m_eImplicitCalendar; +LanguageType m_nFormatLang; +boolm_bAutoOrder; +boolm_bFromSystem; +boolm_bTruncate; +boolm_bAutoDec; // set in AddNumber +boolm_bAutoInt; // set in AddNumber +boolm_bHasExtraText; +boolm_bHasTrailingEmptyText; +OUStringBuffer m_aFormatCode{64}; +OUStringBuffer m_aConditions{32}; +boolm_bHasLongDoW; +boolm_bHasDateTime; +boolm_bRemoveAfterUse; //
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlstyle.hxx |8 xmloff/source/style/prstylei.cxx |4 +--- xmloff/source/text/txtstyli.cxx |4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) New commits: commit a6aa71f6f3357f4fcd06c2307882733606af37ca Author: Mike Kaganski AuthorDate: Mon May 1 18:34:31 2023 +0300 Commit: Mike Kaganski CommitDate: Mon May 1 19:28:23 2023 +0200 AutoName is only used as Any, no need to extract into intermediate string Change-Id: I00b0d647946e3943852098ff96cc09b7a2fd49ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151233 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/include/xmloff/xmlstyle.hxx b/include/xmloff/xmlstyle.hxx index 04a74b841a15..7e09259c7443 100644 --- a/include/xmloff/xmlstyle.hxx +++ b/include/xmloff/xmlstyle.hxx @@ -41,7 +41,7 @@ class XMLOFF_DLLPUBLIC SvXMLStyleContext : public SvXMLImportContext { OUString maName; OUString maDisplayName; -OUString maAutoName; +css::uno::Any maAutoName; OUString maParentName;// Will be moved to XMLPropStyle soon OUString maFollow;// Will be moved to XMLPropStyle soon OUString maLinked; @@ -51,7 +51,7 @@ class XMLOFF_DLLPUBLIC SvXMLStyleContext : public SvXMLImportContext bool mbValid : 1; // Set this to false in CreateAndInsert // if the style shouldn't be processed - // by Finish() or si somehow invalid. + // by Finish() or is somehow invalid. bool mbNew : 1; // Set this to false in CreateAnsInsert // if the style is already existing. bool mbDefaultStyle : 1; @@ -61,7 +61,7 @@ protected: virtual void SetAttribute( sal_Int32 nElement, const OUString& rValue ); void SetFamily( XmlStyleFamily nSet ) { mnFamily = nSet; } -void SetAutoName( const OUString& rName ) { maAutoName = rName; } +void SetAutoName( const css::uno::Any& rName ) { maAutoName = rName; } public: @@ -77,7 +77,7 @@ public: const OUString& GetName() const { return maName; } const OUString& GetDisplayName() const { return maDisplayName.getLength() ? maDisplayName : maName; } -const OUString& GetAutoName() const { return maAutoName; } +const css::uno::Any& GetAutoName() const { return maAutoName; } const OUString& GetParentName() const { return maParentName; } const OUString& GetFollow() const { return maFollow; } const OUString& GetLinked() const { return maLinked; } diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index 3dc8fc7087a3..c688a3a24b31 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -341,9 +341,7 @@ void XMLPropStyleContext::CreateAndInsert( bool bOverwrite ) Sequence< Any > aAny = xAutoStyle->getPropertyValues( aPropNames ); if( aAny.hasElements() ) { -OUString aName; -aAny[0] >>= aName; -SetAutoName( aName ); +SetAutoName(aAny[0]); } } } diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index 01a0deab4e4b..bd21e35ad6a2 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -431,7 +431,7 @@ void XMLTextStyleContext::FillPropertySet( { bAutomatic = true; -if( !GetAutoName().isEmpty() ) +if( GetAutoName().hasValue() ) { OUString sAutoProp = ( GetFamily() == XmlStyleFamily::TEXT_TEXT ) ? OUString( "CharAutoStyleName" ): @@ -446,7 +446,7 @@ void XMLTextStyleContext::FillPropertySet( if ( xInfo->hasPropertyByName( sAutoProp ) ) { -rPropSet->setPropertyValue( sAutoProp, Any(GetAutoName()) ); +rPropSet->setPropertyValue( sAutoProp, GetAutoName() ); } else {
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/XMLFontAutoStylePool.hxx |4 - include/xmloff/XMLPageExport.hxx| 14 ++--- include/xmloff/XMLTextListAutoStylePool.hxx |8 +-- include/xmloff/styleexp.hxx |8 +-- xmloff/source/style/XMLFontAutoStylePool.cxx|2 xmloff/source/style/XMLPageExport.cxx | 62 xmloff/source/style/styleexp.cxx|8 +-- xmloff/source/text/XMLTextListAutoStylePool.cxx | 44 - 8 files changed, 75 insertions(+), 75 deletions(-) New commits: commit 95aa39749b4dcc9cf06350dcb8c9a96373de5999 Author: Miklos Vajna AuthorDate: Mon Apr 24 07:40:01 2023 +0200 Commit: Miklos Vajna CommitDate: Mon Apr 24 09:23:37 2023 +0200 sw: prefix members of XMLFontAutoStylePool, XMLPageExport, ... ... XMLStyleExport and XMLTextListAutoStylePool See tdf#94879 for motivation. Change-Id: If49190233b87bf86c83d56f02eedb1c010ef119c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150896 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/include/xmloff/XMLFontAutoStylePool.hxx b/include/xmloff/XMLFontAutoStylePool.hxx index 2354bcf8ce7d..569f1443ab14 100644 --- a/include/xmloff/XMLFontAutoStylePool.hxx +++ b/include/xmloff/XMLFontAutoStylePool.hxx @@ -36,7 +36,7 @@ class SvXMLExport; class XMLOFF_DLLPUBLIC XMLFontAutoStylePool : public salhelper::SimpleReferenceObject { private: -SvXMLExport& rExport; +SvXMLExport& m_rExport; std::unique_ptr m_pFontAutoStylePool; std::set m_aNames; @@ -53,7 +53,7 @@ protected: bool m_bEmbedAsianScript; bool m_bEmbedComplexScript; -SvXMLExport& GetExport() { return rExport; } +SvXMLExport& GetExport() { return m_rExport; } public: XMLFontAutoStylePool( SvXMLExport& rExport, bool tryToEmbedFonts = false ); diff --git a/include/xmloff/XMLPageExport.hxx b/include/xmloff/XMLPageExport.hxx index 4553c9b61217..ba06efc38e08 100644 --- a/include/xmloff/XMLPageExport.hxx +++ b/include/xmloff/XMLPageExport.hxx @@ -50,21 +50,21 @@ struct XMLPageExportNameEntry class XMLOFF_DLLPUBLIC XMLPageExport : public salhelper::SimpleReferenceObject { -SvXMLExport& rExport; +SvXMLExport& m_rExport; -css::uno::Reference< css::container::XNameAccess > xPageStyles; +css::uno::Reference< css::container::XNameAccess > m_xPageStyles; -::std::vector< XMLPageExportNameEntry > aNameVector; +::std::vector< XMLPageExportNameEntry > m_aNameVector; -rtl::Reference < XMLPropertyHandlerFactory > xPageMasterPropHdlFactory; -rtl::Reference < XMLPropertySetMapper > xPageMasterPropSetMapper; -rtl::Reference < SvXMLExportPropertyMapper > xPageMasterExportPropMapper; +rtl::Reference < XMLPropertyHandlerFactory > m_xPageMasterPropHdlFactory; +rtl::Reference < XMLPropertySetMapper > m_xPageMasterPropSetMapper; +rtl::Reference < SvXMLExportPropertyMapper > m_xPageMasterExportPropMapper; rtl::Reference m_xPageMasterDrawingPagePropSetMapper; rtl::Reference m_xPageMasterDrawingPageExportPropMapper; protected: -SvXMLExport& GetExport() { return rExport; } +SvXMLExport& GetExport() { return m_rExport; } void collectPageMasterAutoStyle( const css::uno::Reference< css::beans::XPropertySet > & rPropSet, diff --git a/include/xmloff/XMLTextListAutoStylePool.hxx b/include/xmloff/XMLTextListAutoStylePool.hxx index 6237cda709e7..0835ffc49fd5 100644 --- a/include/xmloff/XMLTextListAutoStylePool.hxx +++ b/include/xmloff/XMLTextListAutoStylePool.hxx @@ -39,13 +39,13 @@ class SvXMLExport; class XMLOFF_DLLPUBLIC XMLTextListAutoStylePool { -SvXMLExport& rExport; +SvXMLExport& m_rExport; -OUString sPrefix; +OUString m_sPrefix; -std::unique_ptr pPool; +std::unique_ptr m_pPool; XMLTextListAutoStylePoolNames_Impl m_aNames; -sal_uInt32 nName; +sal_uInt32 m_nName; /** this is an optional NumRule compare component for applications where the NumRules don't have names */ diff --git a/include/xmloff/styleexp.hxx b/include/xmloff/styleexp.hxx index 66bfc42dc4d0..deb03f179953 100644 --- a/include/xmloff/styleexp.hxx +++ b/include/xmloff/styleexp.hxx @@ -52,12 +52,12 @@ enum class XmlStyleFamily; class XMLOFF_DLLPUBLIC XMLStyleExport : public salhelper::SimpleReferenceObject { -SvXMLExport& rExport; -SvXMLAutoStylePoolP *pAutoStylePool; +SvXMLExport& m_rExport; +SvXMLAutoStylePoolP *m_pAutoStylePool; protected: -SvXMLExport& GetExport() { return rExport; } -const SvXMLExport& GetExport() const { return rExport; } +SvXMLExport& GetExport() { return m_rExport; } +const SvXMLExport& GetExport() const { return m_rExport; } bool exportStyle( const css::uno::Reference< css::style::XStyle > & rStyle, diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx index
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/shapeexport.hxx | 114 +++--- xmloff/source/draw/shapeexport.cxx | 292 ++--- xmloff/source/draw/ximpshap.cxx| 16 +- 3 files changed, 211 insertions(+), 211 deletions(-) New commits: commit ac30e6bfb653490003d04f30bf2d5f8f857e572b Author: Noel Grandin AuthorDate: Mon Apr 17 19:11:29 2023 +0200 Commit: Noel Grandin CommitDate: Tue Apr 18 09:43:04 2023 +0200 convert XmlShapeType to scoped enum Change-Id: I1fd3d995508eed507d07de11c4f60f05d075b84f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150528 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/shapeexport.hxx b/include/xmloff/shapeexport.hxx index 34abaf37547e..5313fe9e48f9 100644 --- a/include/xmloff/shapeexport.hxx +++ b/include/xmloff/shapeexport.hxx @@ -67,63 +67,63 @@ namespace o3tl #define SEF_DEFAULT XMLShapeExportFlags::POSITION|XMLShapeExportFlags::SIZE -enum XmlShapeType +enum class XmlShapeType { -XmlShapeTypeUnknown,// not known - -XmlShapeTypeDrawRectangleShape, // "com.sun.star.drawing.RectangleShape" -XmlShapeTypeDrawEllipseShape, // "com.sun.star.drawing.EllipseShape" -XmlShapeTypeDrawControlShape, // "com.sun.star.drawing.ControlShape" -XmlShapeTypeDrawConnectorShape, // "com.sun.star.drawing.ConnectorShape" -XmlShapeTypeDrawMeasureShape, // "com.sun.star.drawing.MeasureShape" -XmlShapeTypeDrawLineShape, // "com.sun.star.drawing.LineShape" -XmlShapeTypeDrawPolyPolygonShape, // "com.sun.star.drawing.PolyPolygonShape" -XmlShapeTypeDrawPolyLineShape, // "com.sun.star.drawing.PolyLineShape" -XmlShapeTypeDrawOpenBezierShape,// "com.sun.star.drawing.OpenBezierShape" -XmlShapeTypeDrawClosedBezierShape, // "com.sun.star.drawing.ClosedBezierShape" -XmlShapeTypeDrawGraphicObjectShape, // "com.sun.star.drawing.GraphicObjectShape" -XmlShapeTypeDrawGroupShape, // "com.sun.star.drawing.GroupShape" -XmlShapeTypeDrawTextShape, // "com.sun.star.drawing.TextShape" -XmlShapeTypeDrawOLE2Shape, // "com.sun.star.drawing.OLE2Shape" -XmlShapeTypeDrawChartShape, // embedded com.sun.star.chart -XmlShapeTypeDrawSheetShape, // embedded com.sun.star.sheet -XmlShapeTypeDrawPageShape, // "com.sun.star.drawing.PageShape" -XmlShapeTypeDrawFrameShape, // "com.sun.star.drawing.FrameShape" -XmlShapeTypeDrawCaptionShape, // "com.sun.star.drawing.CaptionShape" -XmlShapeTypeDrawAppletShape,// "com.sun.star.drawing.AppletShape" -XmlShapeTypeDrawPluginShape,// "com.sun.star.drawing.PlugginShape" - -XmlShapeTypeDraw3DSceneObject, // "com.sun.star.drawing.Shape3DSceneObject" -XmlShapeTypeDraw3DCubeObject, // "com.sun.star.drawing.Shape3DCubeObject" -XmlShapeTypeDraw3DSphereObject, // "com.sun.star.drawing.Shape3DSphereObject" -XmlShapeTypeDraw3DLatheObject, // "com.sun.star.drawing.Shape3DLatheObject" -XmlShapeTypeDraw3DExtrudeObject,// "com.sun.star.drawing.Shape3DExtrudeObject" - -XmlShapeTypePresTitleTextShape, // "com.sun.star.presentation.TitleTextShape" -XmlShapeTypePresOutlinerShape, // "com.sun.star.presentation.OutlinerShape" -XmlShapeTypePresSubtitleShape, // "com.sun.star.presentation.SubtitleShape" -XmlShapeTypePresGraphicObjectShape, // "com.sun.star.presentation.GraphicObjectShape" -XmlShapeTypePresPageShape, // "com.sun.star.presentation.PageShape" -XmlShapeTypePresOLE2Shape, // "com.sun.star.presentation.OLE2Shape" -XmlShapeTypePresChartShape, // "com.sun.star.presentation.ChartShape" -XmlShapeTypePresSheetShape, // "com.sun.star.presentation.CalcShape" -XmlShapeTypePresTableShape, // "com.sun.star.presentation.TableShape" -XmlShapeTypePresOrgChartShape, // "com.sun.star.presentation.OrgChartShape" -XmlShapeTypePresNotesShape, // "com.sun.star.presentation.NotesShape" -XmlShapeTypeHandoutShape, // "com.sun.star.presentation.HandoutShape" - -XmlShapeTypePresHeaderShape,// "com.sun.star.presentation.HeaderShape" -XmlShapeTypePresFooterShape,// "com.sun.star.presentation.FooterShape" -XmlShapeTypePresSlideNumberShape, //
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlnumfe.hxx | 14 - xmloff/source/style/xmlnumfe.cxx | 282 +++ 2 files changed, 148 insertions(+), 148 deletions(-) New commits: commit 17071b079dcae1bb20dc7af11852ac2ffd8525d5 Author: Miklos Vajna AuthorDate: Mon Apr 17 08:15:09 2023 +0200 Commit: Miklos Vajna CommitDate: Mon Apr 17 09:10:04 2023 +0200 xmloff: prefix members of SvXMLNumFmtExport See tdf#94879 for motivation. Change-Id: I8aa01371f310bf928cb78f149ea25bf0835cd6aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150465 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/xmloff/xmlnumfe.hxx b/include/xmloff/xmlnumfe.hxx index 61836f534245..fd0711b3a0c3 100644 --- a/include/xmloff/xmlnumfe.hxx +++ b/include/xmloff/xmlnumfe.hxx @@ -47,13 +47,13 @@ class SvXMLEmbeddedTextEntryArr; class XMLOFF_DLLPUBLIC SvXMLNumFmtExport final { private: -SvXMLExport&rExport; -OUStringsPrefix; -SvNumberFormatter* pFormatter; -OUStringBuffer sTextContent; -boolbHasText; -std::unique_ptr pUsedList; -std::unique_ptr pLocaleData; +SvXMLExport&m_rExport; +OUStringm_sPrefix; +SvNumberFormatter* m_pFormatter; +OUStringBuffer m_sTextContent; +boolm_bHasText; +std::unique_ptr m_pUsedList; +std::unique_ptr m_pLocaleData; SAL_DLLPRIVATE void AddCalendarAttr_Impl( const OUString& rCalendar ); SAL_DLLPRIVATE void AddStyleAttr_Impl( bool bLong ); diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index a335f79ae23a..b01c7bd8e597 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -210,60 +210,60 @@ void SvXMLNumUsedList_Impl::SetWasUsed(const uno::Sequence& rWasUsed) SvXMLNumFmtExport::SvXMLNumFmtExport( SvXMLExport& rExp, const uno::Reference< util::XNumberFormatsSupplier >& rSupp ) : -rExport( rExp ), -sPrefix( OUString("N") ), -pFormatter( nullptr ), -bHasText( false ) +m_rExport( rExp ), +m_sPrefix( OUString("N") ), +m_pFormatter( nullptr ), +m_bHasText( false ) { // supplier must be SvNumberFormatsSupplierObj SvNumberFormatsSupplierObj* pObj = comphelper::getFromUnoTunnel( rSupp ); if (pObj) -pFormatter = pObj->GetNumberFormatter(); +m_pFormatter = pObj->GetNumberFormatter(); -if ( pFormatter ) +if ( m_pFormatter ) { -pLocaleData.reset( new LocaleDataWrapper( pFormatter->GetComponentContext(), -pFormatter->GetLanguageTag() ) ); +m_pLocaleData.reset( new LocaleDataWrapper( m_pFormatter->GetComponentContext(), +m_pFormatter->GetLanguageTag() ) ); } else { LanguageTag aLanguageTag( MsLangId::getConfiguredSystemLanguage() ); -pLocaleData.reset( new LocaleDataWrapper( rExport.getComponentContext(), std::move(aLanguageTag) ) ); +m_pLocaleData.reset( new LocaleDataWrapper( m_rExport.getComponentContext(), std::move(aLanguageTag) ) ); } -pUsedList.reset(new SvXMLNumUsedList_Impl); +m_pUsedList.reset(new SvXMLNumUsedList_Impl); } SvXMLNumFmtExport::SvXMLNumFmtExport( SvXMLExport& rExp, const css::uno::Reference< css::util::XNumberFormatsSupplier >& rSupp, OUString aPrefix ) : -rExport( rExp ), -sPrefix(std::move( aPrefix )), -pFormatter( nullptr ), -bHasText( false ) +m_rExport( rExp ), +m_sPrefix(std::move( aPrefix )), +m_pFormatter( nullptr ), +m_bHasText( false ) { // supplier must be SvNumberFormatsSupplierObj SvNumberFormatsSupplierObj* pObj = comphelper::getFromUnoTunnel( rSupp ); if (pObj) -pFormatter = pObj->GetNumberFormatter(); +m_pFormatter = pObj->GetNumberFormatter(); -if ( pFormatter ) +if ( m_pFormatter ) { -pLocaleData.reset( new LocaleDataWrapper( pFormatter->GetComponentContext(), -pFormatter->GetLanguageTag() ) ); +m_pLocaleData.reset( new LocaleDataWrapper( m_pFormatter->GetComponentContext(), +m_pFormatter->GetLanguageTag() ) ); } else { LanguageTag aLanguageTag( MsLangId::getConfiguredSystemLanguage() ); -pLocaleData.reset( new LocaleDataWrapper( rExport.getComponentContext(), std::move(aLanguageTag) ) ); +m_pLocaleData.reset( new LocaleDataWrapper( m_rExport.getComponentContext(), std::move(aLanguageTag) ) ); } -pUsedList.reset(new SvXMLNumUsedList_Impl); +m_pUsedList.reset(new SvXMLNumUsedList_Impl); } SvXMLNumFmtExport::~SvXMLNumFmtExport() @@ -284,7 +284,7 @@ void
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/txtparae.hxx |2 +- xmloff/source/text/txtparae.cxx | 14 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) New commits: commit 7d6e1eccf742664fc7487f1b73ac233e1d2674d3 Author: Caolán McNamara AuthorDate: Fri Apr 14 17:00:27 2023 +0100 Commit: Caolán McNamara CommitDate: Sat Apr 15 20:52:24 2023 +0200 just use a reference instead of an always dereferenced pointer Change-Id: I105873fc890d67b39b796864f8eae4bd12aecd26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150425 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx index 5314a85c0cb2..36d554be2a20 100644 --- a/include/xmloff/txtparae.hxx +++ b/include/xmloff/txtparae.hxx @@ -206,7 +206,7 @@ protected: void exportPageFrames( bool bProgress ); void exportFrameFrames( bool bAutoStyles, bool bProgress, -const css::uno::Reference< css::text::XTextFrame > *pParentTxtFrame ); +const css::uno::Reference< css::text::XTextFrame >& rParentTxtFrame ); void exportNumStyles( bool bUsed ); diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 5ae853b239ab..aaf47ddd4b71 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -1498,27 +1498,27 @@ void XMLTextParagraphExport::exportPageFrames( bool bIsProgress ) void XMLTextParagraphExport::exportFrameFrames( bool bAutoStyles, bool bIsProgress, -const Reference < XTextFrame > *pParentTxtFrame ) +const Reference < XTextFrame >& rParentTxtFrame ) { -const TextContentSet* const pTexts = m_pBoundFrameSets->GetTexts()->GetFrameBoundContents(*pParentTxtFrame); +const TextContentSet* const pTexts = m_pBoundFrameSets->GetTexts()->GetFrameBoundContents(rParentTxtFrame); if(pTexts) for(TextContentSet::const_iterator_t it = pTexts->getBegin(); it != pTexts->getEnd(); ++it) exportTextFrame(*it, bAutoStyles, bIsProgress, true); -const TextContentSet* const pGraphics = m_pBoundFrameSets->GetGraphics()->GetFrameBoundContents(*pParentTxtFrame); +const TextContentSet* const pGraphics = m_pBoundFrameSets->GetGraphics()->GetFrameBoundContents(rParentTxtFrame); if(pGraphics) for(TextContentSet::const_iterator_t it = pGraphics->getBegin(); it != pGraphics->getEnd(); ++it) exportTextGraphic(*it, bAutoStyles); -const TextContentSet* const pEmbeddeds = m_pBoundFrameSets->GetEmbeddeds()->GetFrameBoundContents(*pParentTxtFrame); +const TextContentSet* const pEmbeddeds = m_pBoundFrameSets->GetEmbeddeds()->GetFrameBoundContents(rParentTxtFrame); if(pEmbeddeds) for(TextContentSet::const_iterator_t it = pEmbeddeds->getBegin(); it != pEmbeddeds->getEnd(); ++it) exportTextEmbedded(*it, bAutoStyles); -const TextContentSet* const pShapes = m_pBoundFrameSets->GetShapes()->GetFrameBoundContents(*pParentTxtFrame); +const TextContentSet* const pShapes = m_pBoundFrameSets->GetShapes()->GetFrameBoundContents(rParentTxtFrame); if(pShapes) for(TextContentSet::const_iterator_t it = pShapes->getBegin(); it != pShapes->getEnd(); @@ -3055,7 +3055,7 @@ void XMLTextParagraphExport::exportAnyTextFrame( { Reference < XTextFrame > xTxtFrame( rTxtCntnt, UNO_QUERY ); Reference < XText > xTxt(xTxtFrame->getText()); -exportFrameFrames( true, bIsProgress, ); +exportFrameFrames( true, bIsProgress, xTxtFrame ); exportText( xTxt, bAutoStyles, bIsProgress, true ); } } @@ -3185,7 +3185,7 @@ void XMLTextParagraphExport::_exportTextFrame( XML_TEXT_BOX, true, true ); // frames bound to frame -exportFrameFrames( false, bIsProgress, ); +exportFrameFrames( false, bIsProgress, xTxtFrame ); exportText( xTxt, false, bIsProgress, true ); }
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/txtparae.hxx | 60 ++--- xmloff/source/text/txtftne.cxx |2 xmloff/source/text/txtparae.cxx | 182 xmloff/source/text/txtsecte.cxx | 22 ++-- xmloff/source/text/txtstyle.cxx | 10 +- 5 files changed, 138 insertions(+), 138 deletions(-) New commits: commit 9996b7aba68b2e8a84701d7643c4376ed6c34554 Author: Miklos Vajna AuthorDate: Mon Apr 3 08:10:49 2023 +0200 Commit: Miklos Vajna CommitDate: Mon Apr 3 11:06:41 2023 +0200 xmloff: prefix members of XMLTextParagraphExport See tdf#94879 for motivation. Change-Id: I894665f1af47cf1e5f0f191bfdf3100e426fa6d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149946 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx index e474a9c5b763..8a8bc37c1cf5 100644 --- a/include/xmloff/txtparae.hxx +++ b/include/xmloff/txtparae.hxx @@ -80,32 +80,32 @@ class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public XMLStyleExport std::unique_ptr m_xImpl; // SvXMLExport& rExport; -SvXMLAutoStylePoolP& rAutoStylePool; -rtl::Reference < SvXMLExportPropertyMapper > xParaPropMapper; -rtl::Reference < SvXMLExportPropertyMapper > xTextPropMapper; -rtl::Reference < SvXMLExportPropertyMapper > xFramePropMapper; -rtl::Reference < SvXMLExportPropertyMapper > xAutoFramePropMapper; -rtl::Reference < SvXMLExportPropertyMapper > xSectionPropMapper; -rtl::Reference < SvXMLExportPropertyMapper > xRubyPropMapper; - -const ::std::unique_ptr< ::xmloff::BoundFrameSets > pBoundFrameSets; -std::unique_ptr pFieldExport; +SvXMLAutoStylePoolP& m_rAutoStylePool; +rtl::Reference < SvXMLExportPropertyMapper > m_xParaPropMapper; +rtl::Reference < SvXMLExportPropertyMapper > m_xTextPropMapper; +rtl::Reference < SvXMLExportPropertyMapper > m_xFramePropMapper; +rtl::Reference < SvXMLExportPropertyMapper > m_xAutoFramePropMapper; +rtl::Reference < SvXMLExportPropertyMapper > m_xSectionPropMapper; +rtl::Reference < SvXMLExportPropertyMapper > m_xRubyPropMapper; + +const ::std::unique_ptr< ::xmloff::BoundFrameSets > m_pBoundFrameSets; +std::unique_ptr m_pFieldExport; std::vectormaListElements; XMLTextListAutoStylePool maListAutoPool; -std::unique_ptrpSectionExport; -std::unique_ptr pIndexMarkExport; +std::unique_ptrm_pSectionExport; +std::unique_ptr m_pIndexMarkExport; /// may be NULL (if no redlines should be exported; e.g. in block mode) -std::unique_ptr pRedlineExport; +std::unique_ptr m_pRedlineExport; -boolbProgress; +boolm_bProgress; -boolbBlock; +boolm_bBlock; // keep track of open rubies -OUStringsOpenRubyText; -OUStringsOpenRubyCharStyle; -boolbOpenRuby; +OUStringm_sOpenRubyText; +OUStringm_sOpenRubyCharStyle; +boolm_bOpenRuby; XMLTextListsHelper* mpTextListsHelper; ::std::vector< std::unique_ptr > maTextListsHelperStack; @@ -153,33 +153,33 @@ private: protected: static constexpr OUStringLiteral gsFrameStyleName = u"FrameStyleName"; -SinglePropertySetInfoCache aCharStyleNamesPropInfoCache; +SinglePropertySetInfoCache m_aCharStyleNamesPropInfoCache; -SvXMLAutoStylePoolP& GetAutoStylePool() { return rAutoStylePool; } -const SvXMLAutoStylePoolP& GetAutoStylePool() const { return rAutoStylePool; } +SvXMLAutoStylePoolP& GetAutoStylePool() { return m_rAutoStylePool; } +const SvXMLAutoStylePoolP& GetAutoStylePool() const { return m_rAutoStylePool; } public: const rtl::Reference < SvXMLExportPropertyMapper >& GetParaPropMapper() const { -return xParaPropMapper; +return m_xParaPropMapper; } const rtl::Reference < SvXMLExportPropertyMapper >& GetTextPropMapper() const { -return xTextPropMapper; +return m_xTextPropMapper; } const rtl::Reference < SvXMLExportPropertyMapper >& GetAutoFramePropMapper() const { -return xAutoFramePropMapper; +return m_xAutoFramePropMapper; } const rtl::Reference < SvXMLExportPropertyMapper >& GetSectionPropMapper() const { -return xSectionPropMapper; +return m_xSectionPropMapper; } const rtl::Reference < SvXMLExportPropertyMapper >& GetRubyPropMapper() const { -return xRubyPropMapper; +return m_xRubyPropMapper; } OUString FindTextStyle( @@ -500,13 +500,13 @@ public: } inline const XMLTextListAutoStylePool& GetListAutoStylePool() const; -void SetBlockMode( bool bSet ) {
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/namespacemap.hxx | 13 +++- xmloff/source/core/namespacemap.cxx | 54 ++-- 2 files changed, 38 insertions(+), 29 deletions(-) New commits: commit a86818c15a6b4773ddd012db37d55b5204163c24 Author: Noel Grandin AuthorDate: Tue May 24 13:12:24 2022 +0200 Commit: Noel Grandin CommitDate: Tue May 24 16:37:43 2022 +0200 reduce space needed for NameSpaceMap no need to store the key twice. Also rename related fields and typedefs to make the code easier to read. Change-Id: Ib76dea7fd683d024e8c9d8091d85cfec14829359 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134871 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/namespacemap.hxx b/include/xmloff/namespacemap.hxx index 81edfc52e25d..51e741fb85d8 100644 --- a/include/xmloff/namespacemap.hxx +++ b/include/xmloff/namespacemap.hxx @@ -54,6 +54,15 @@ public: } }; +class KeyToNameSpaceMapEntry final +{ +public: +// sName refers to the full namespace name +OUString sName; +// sPrefix is the prefix used to declare a given item to be from a given namespace +OUString sPrefix; +}; + typedef ::std::pair < sal_uInt16, OUString > QNamePair; struct QNamePairHash @@ -69,7 +78,7 @@ struct QNamePairHash typedef std::unordered_map < QNamePair, OUString, QNamePairHash > QNameCache; typedef std::unordered_map < OUString, NameSpaceEntry > NameSpaceHash; -typedef std::unordered_map < sal_uInt16, NameSpaceEntry > NameSpaceMap; +typedef std::unordered_map < sal_uInt16, KeyToNameSpaceMapEntry > KeyToNameSpaceMap; class XMLOFF_DLLPUBLIC SvXMLNamespaceMap { @@ -77,7 +86,7 @@ class XMLOFF_DLLPUBLIC SvXMLNamespaceMap NameSpaceHash aNameHash; mutable NameSpaceHash aNameCache; -NameSpaceMapaNameMap; +KeyToNameSpaceMap maKeyToNamespaceMap; mutable QNameCache aQNameCache; SAL_DLLPRIVATE sal_uInt16 Add_( const OUString& rPrefix, const OUString , sal_uInt16 nKey ); diff --git a/xmloff/source/core/namespacemap.cxx b/xmloff/source/core/namespacemap.cxx index 4ef226e2a2f6..c6fbb1d5d845 100644 --- a/xmloff/source/core/namespacemap.cxx +++ b/xmloff/source/core/namespacemap.cxx @@ -54,20 +54,20 @@ SvXMLNamespaceMap::SvXMLNamespaceMap() { // approx worst-case size aNameHash.reserve(20); -aNameMap.reserve(20); +maKeyToNamespaceMap.reserve(20); } SvXMLNamespaceMap::SvXMLNamespaceMap( const SvXMLNamespaceMap& rMap ) : sXMLNS( GetXMLToken ( XML_XMLNS ) ) { aNameHash = rMap.aNameHash; -aNameMap = rMap.aNameMap; +maKeyToNamespaceMap = rMap.maKeyToNamespaceMap; } SvXMLNamespaceMap& SvXMLNamespaceMap::operator=( const SvXMLNamespaceMap& rMap ) { aNameHash = rMap.aNameHash; -aNameMap = rMap.aNameMap; +maKeyToNamespaceMap = rMap.maKeyToNamespaceMap; return *this; } @@ -79,7 +79,7 @@ void SvXMLNamespaceMap::Clear() { aNameHash.clear(); aNameCache.clear(); -aNameMap.clear(); +maKeyToNamespaceMap.clear(); aQNameCache.clear(); } @@ -97,15 +97,15 @@ sal_uInt16 SvXMLNamespaceMap::Add_( const OUString& rPrefix, const OUString nKey = XML_NAMESPACE_UNKNOWN_FLAG; do { -NameSpaceMap::const_iterator aIter = aNameMap.find ( nKey ); -if( aIter == aNameMap.end() ) +auto aIter = maKeyToNamespaceMap.find ( nKey ); +if( aIter == maKeyToNamespaceMap.end() ) break; nKey++; } while ( true ); } aNameHash.insert_or_assign( rPrefix, NameSpaceEntry{ rName, rPrefix, nKey} ); -aNameMap.insert_or_assign( nKey, NameSpaceEntry{ rName, rPrefix, nKey} ); +maKeyToNamespaceMap.insert_or_assign( nKey, KeyToNameSpaceMapEntry{ rName, rPrefix} ); return nKey; } @@ -170,20 +170,20 @@ sal_uInt16 SvXMLNamespaceMap::GetKeyByName( const OUString& rName ) const const OUString& SvXMLNamespaceMap::GetPrefixByKey( sal_uInt16 nKey ) const { -NameSpaceMap::const_iterator aIter = aNameMap.find (nKey); -return (aIter != aNameMap.end()) ? (*aIter).second.sPrefix : sEmpty; +auto aIter = maKeyToNamespaceMap.find (nKey); +return (aIter != maKeyToNamespaceMap.end()) ? (*aIter).second.sPrefix : sEmpty; } const OUString& SvXMLNamespaceMap::GetNameByKey( sal_uInt16 nKey ) const { -NameSpaceMap::const_iterator aIter = aNameMap.find (nKey); -return (aIter != aNameMap.end()) ? (*aIter).second.sName : sEmpty; +auto aIter = maKeyToNamespaceMap.find (nKey); +return (aIter != maKeyToNamespaceMap.end()) ? (*aIter).second.sName : sEmpty; } OUString SvXMLNamespaceMap::GetAttrNameByKey( sal_uInt16 nKey ) const { -NameSpaceMap::const_iterator aIter = aNameMap.find ( nKey ); -if (aIter == aNameMap.end()) +auto aIter = maKeyToNamespaceMap.find ( nKey ); +if (aIter == maKeyToNamespaceMap.end()) return
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/namespacemap.hxx |2 ++ xmloff/source/core/namespacemap.cxx |9 + xmloff/source/core/xmlexp.cxx |2 +- 3 files changed, 12 insertions(+), 1 deletion(-) New commits: commit d01f8813084b245492c83cf750bb59bcd2659621 Author: Noel Grandin AuthorDate: Thu May 12 15:19:27 2022 +0200 Commit: Noel Grandin CommitDate: Fri May 13 14:00:06 2022 +0200 tdf#121740 cheaper to clear namespacemap rather than allocating a new one Change-Id: I413de3a61744400f5582f7e090c161ea21bf0b0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134267 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/namespacemap.hxx b/include/xmloff/namespacemap.hxx index c9f4e71fd876..361ddfb7311d 100644 --- a/include/xmloff/namespacemap.hxx +++ b/include/xmloff/namespacemap.hxx @@ -122,6 +122,8 @@ public: This might be replaced by a better interface later. */ const NameSpaceHash& GetAllEntries() const { return aNameHash; } +void Clear(); + static bool NormalizeOasisURN( OUString& rName ); static bool NormalizeW3URI( OUString& rName ); static bool NormalizeURI( OUString& rName ); diff --git a/xmloff/source/core/namespacemap.cxx b/xmloff/source/core/namespacemap.cxx index 9fdce6e3cc16..3e28a4437cc2 100644 --- a/xmloff/source/core/namespacemap.cxx +++ b/xmloff/source/core/namespacemap.cxx @@ -75,6 +75,15 @@ SvXMLNamespaceMap::~SvXMLNamespaceMap() { } +void SvXMLNamespaceMap::Clear() +{ +aNameHash.clear(); +aNameCache.clear(); +aNameMap.clear(); +aQNameCache.clear(); +} + + bool SvXMLNamespaceMap::operator ==( const SvXMLNamespaceMap& rCmp ) const { return aNameHash == rCmp.aNameHash; diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 22b55d7565f5..7c2291156852 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1406,7 +1406,7 @@ ErrCode SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) void SvXMLExport::ResetNamespaceMap() { -mpNamespaceMap.reset( new SvXMLNamespaceMap ); +mpNamespaceMap->Clear(); } OUString const & SvXMLExport::GetSourceShellID() const
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx |3 - xmloff/source/core/xmlimp.cxx | 11 --- xmloff/source/script/XMLScriptContextFactory.cxx| 12 +--- xmloff/source/script/XMLStarBasicContextFactory.cxx | 16 ++--- xmloff/source/style/prstylei.cxx| 10 ++- xmloff/source/style/xmlimppr.cxx|5 - xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx | 17 ++--- xmloff/source/text/txtflde.cxx | 29 -- 8 files changed, 38 insertions(+), 65 deletions(-) New commits: commit 4477baeba5aec71098f374cf0b4bd4591e048809 Author: Julien Nabet AuthorDate: Sun Oct 17 11:37:25 2021 +0200 Commit: Julien Nabet CommitDate: Sun Oct 17 12:51:09 2021 +0200 Simplify Sequences in xmloff (+ merge 2 SetError) Change-Id: If4055bbeb858b1b87ecb3f8c0b87da4b008e3c16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123716 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index f8387cc8f81c..caa5f738aba5 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -482,9 +482,8 @@ public: void SetError( sal_Int32 nId, -const css::uno::Sequence< OUString> & rMsgParams); +const css::uno::Sequence< OUString> & rMsgParams = {}); -void SetError( sal_Int32 nId ); void SetError( sal_Int32 nId, const OUString& rMsg1 ); virtual void DisposingModel(); diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 7ba2c127fb3b..0d47a7a813ef 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -1042,9 +1042,7 @@ void SAL_CALL SvXMLImport::initialize( const uno::Sequence< uno::Any >& aArgumen } uno::Reference const xInit(mxParser, uno::UNO_QUERY_THROW); -uno::Sequence args(1); -args[0] <<= OUString("IgnoreMissingNSDecl"); -xInit->initialize( args ); +xInit->initialize( { makeAny(OUString("IgnoreMissingNSDecl")) }); } // XServiceInfo @@ -1744,13 +1742,6 @@ void SvXMLImport::SetError( SetError( nId, rMsgParams, "", nullptr ); } -void SvXMLImport::SetError( -sal_Int32 nId) -{ -Sequence aSeq(0); -SetError( nId, aSeq ); -} - void SvXMLImport::SetError( sal_Int32 nId, const OUString& rMsg1) diff --git a/xmloff/source/script/XMLScriptContextFactory.cxx b/xmloff/source/script/XMLScriptContextFactory.cxx index 3b535771470f..c5d7cb2d0d05 100644 --- a/xmloff/source/script/XMLScriptContextFactory.cxx +++ b/xmloff/source/script/XMLScriptContextFactory.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include #include #include #include @@ -52,15 +53,8 @@ SvXMLImportContext* XMLScriptContextFactory::CreateContext( // else: ignore } -Sequence aValues(2); - -// EventType -aValues[0].Name = gsEventType; -aValues[0].Value <<= OUString(gsScript); - -// URL -aValues[1].Name = gsURL; -aValues[1].Value <<= sURLVal; +Sequence aValues{ comphelper::makePropertyValue(gsEventType, OUString(gsScript)), + comphelper::makePropertyValue(gsURL, sURLVal) }; // add values for event now rEvents->AddEventValues(rApiEventName, aValues); diff --git a/xmloff/source/script/XMLStarBasicContextFactory.cxx b/xmloff/source/script/XMLStarBasicContextFactory.cxx index a0c9d7b0c193..73d6482daa9f 100644 --- a/xmloff/source/script/XMLStarBasicContextFactory.cxx +++ b/xmloff/source/script/XMLStarBasicContextFactory.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include #include #include #include @@ -79,15 +80,12 @@ SvXMLImportContext* XMLStarBasicContextFactory::CreateContext( sMacroNameVal = sMacroNameVal.copy( rDoc.getLength()+1 ); } -Sequence aValues(3); - -// EventType -aValues[0].Name = gsEventType; -aValues[0].Value <<= OUString(gsStarBasic); - -// library name -aValues[1].Name = gsLibrary; -aValues[1].Value <<= sLibraryVal; +Sequence aValues +{ +comphelper::makePropertyValue(gsEventType, OUString(gsStarBasic)), +comphelper::makePropertyValue(gsLibrary, sLibraryVal), +comphelper::makePropertyValue(gsMacroName, sMacroNameVal) +}; // macro name aValues[2].Name = gsMacroName; diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index 5cd856b209e8..016204277b54 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -332,10 +332,12 @@ void XMLPropStyleContext::CreateAndInsert( bool bOverwrite ) Reference < XAutoStyle > xAutoStyle = xAutoFamily->insertStyle( aValues ); if( xAutoStyle.is() ) { -
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlnumfe.hxx |1 - xmloff/source/style/xmlnumfe.cxx |9 + 2 files changed, 1 insertion(+), 9 deletions(-) New commits: commit ed9c39da0a90ecd4677a4d80a541ca64493994ce Author: Noel Grandin AuthorDate: Fri Sep 17 15:13:07 2021 +0200 Commit: Eike Rathke CommitDate: Fri Sep 17 20:14:25 2021 +0200 no need to store a CharClass in SvXMLNumFmtExport we only use it at one site, and at that site we can use the CharClass inside the formatter whose locale we just updated. Spotted by erack. Change-Id: I049c6fc399e62cfe83f3ae396ea8d0e7497e673f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122250 Tested-by: Jenkins Reviewed-by: Eike Rathke diff --git a/include/xmloff/xmlnumfe.hxx b/include/xmloff/xmlnumfe.hxx index 28bfe8d1a2ad..2949aed76679 100644 --- a/include/xmloff/xmlnumfe.hxx +++ b/include/xmloff/xmlnumfe.hxx @@ -53,7 +53,6 @@ private: OUStringBuffer sTextContent; boolbHasText; std::unique_ptr pUsedList; -std::unique_ptr pCharClass; std::unique_ptr pLocaleData; SAL_DLLPRIVATE void AddCalendarAttr_Impl( const OUString& rCalendar ); diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index 42a918df4573..1f0639febaa5 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -221,8 +221,6 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( if ( pFormatter ) { -pCharClass.reset( new CharClass( pFormatter->GetComponentContext(), -pFormatter->GetLanguageTag() ) ); pLocaleData.reset( new LocaleDataWrapper( pFormatter->GetComponentContext(), pFormatter->GetLanguageTag() ) ); } @@ -230,7 +228,6 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( { LanguageTag aLanguageTag( MsLangId::getSystemLanguage() ); -pCharClass.reset( new CharClass( rExport.getComponentContext(), aLanguageTag ) ); pLocaleData.reset( new LocaleDataWrapper( rExport.getComponentContext(), aLanguageTag ) ); } @@ -254,8 +251,6 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( if ( pFormatter ) { -pCharClass.reset( new CharClass( pFormatter->GetComponentContext(), -pFormatter->GetLanguageTag() ) ); pLocaleData.reset( new LocaleDataWrapper( pFormatter->GetComponentContext(), pFormatter->GetLanguageTag() ) ); } @@ -263,7 +258,6 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( { LanguageTag aLanguageTag( MsLangId::getSystemLanguage() ); -pCharClass.reset( new CharClass( rExport.getComponentContext(), aLanguageTag ) ); pLocaleData.reset( new LocaleDataWrapper( rExport.getComponentContext(), aLanguageTag ) ); } @@ -895,8 +889,7 @@ bool SvXMLNumFmtExport::WriteTextWithCurrency_Impl( const OUString& rString, OUString sCurString, sDummy; pFormatter->GetCompatibilityCurrency( sCurString, sDummy ); -pCharClass.reset( new CharClass( pFormatter->GetComponentContext(), aLanguageTag ) ); -OUString sUpperStr = pCharClass->uppercase(rString); +OUString sUpperStr = pFormatter->GetCharClass()->uppercase(rString); sal_Int32 nPos = lcl_FindSymbol( sUpperStr, sCurString ); if ( nPos >= 0 ) {
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlnumfe.hxx |3 ++- include/xmloff/xmlnumfi.hxx |2 ++ xmloff/source/style/xmlnumfe.cxx | 16 +--- xmloff/source/style/xmlnumfi.cxx | 20 4 files changed, 37 insertions(+), 4 deletions(-) New commits: commit c6f15d228489ccfd0628ca80b45a5c2faaacc7d3 Author: Eike Rathke AuthorDate: Sun Aug 22 22:13:23 2021 +0200 Commit: Eike Rathke CommitDate: Sun Aug 22 23:12:57 2021 +0200 Resolves: tdf#143979 Write and read empty text element in number formats ... as they may be significant as separators between keywords of same letters. Also strip trailing empty text as meaningless, except if the only element. >General;General< earlier both General were written as for which now is not. Change-Id: I4809b1c784667994303b49d8e4ab0e857367e2cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120856 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/include/xmloff/xmlnumfe.hxx b/include/xmloff/xmlnumfe.hxx index 98584ac93873..28bfe8d1a2ad 100644 --- a/include/xmloff/xmlnumfe.hxx +++ b/include/xmloff/xmlnumfe.hxx @@ -50,7 +50,8 @@ private: SvXMLExport&rExport; OUStringsPrefix; SvNumberFormatter* pFormatter; -OUStringBuffer sTextContent; +OUStringBuffer sTextContent; +boolbHasText; std::unique_ptr pUsedList; std::unique_ptr pCharClass; std::unique_ptr pLocaleData; diff --git a/include/xmloff/xmlnumfi.hxx b/include/xmloff/xmlnumfi.hxx index 0f6384f3b785..8026b4e1846b 100644 --- a/include/xmloff/xmlnumfi.hxx +++ b/include/xmloff/xmlnumfi.hxx @@ -145,6 +145,7 @@ private: boolbAutoDec; // set in AddNumber boolbAutoInt; // set in AddNumber boolbHasExtraText; +boolbHasTrailingEmptyText; OUStringBuffer aFormatCode{64}; OUStringBuffer aConditions{32}; boolbHasLongDoW; @@ -189,6 +190,7 @@ public: bool HasLongDoW() const { return bHasLongDoW; } void SetHasLongDoW(bool bSet) { bHasLongDoW = bSet; } +void SetHasTrailingEmptyText(bool bSet) { bHasTrailingEmptyText = bSet; } void UpdateCalendar( const OUString& rNewCalendar ); ImplicitCalendar GetImplicitCalendarState() const { return eImplicitCalendar; } diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index 2695a84fa38b..caba160252f3 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -210,7 +210,8 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( const uno::Reference< util::XNumberFormatsSupplier >& rSupp ) : rExport( rExp ), sPrefix( OUString("N") ), -pFormatter( nullptr ) +pFormatter( nullptr ), +bHasText( false ) { // supplier must be SvNumberFormatsSupplierObj SvNumberFormatsSupplierObj* pObj = @@ -242,7 +243,8 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( const OUString& rPrefix ) : rExport( rExp ), sPrefix( rPrefix ), -pFormatter( nullptr ) +pFormatter( nullptr ), +bHasText( false ) { // supplier must be SvNumberFormatsSupplierObj SvNumberFormatsSupplierObj* pObj = @@ -320,16 +322,21 @@ void SvXMLNumFmtExport::AddToTextElement_Impl( std::u16string_view rString ) // to avoid several text elements following each other sTextContent.append( rString ); +// Also empty string leads to a number:text element as it may separate +// keywords of the same letter (e.g. MM""MMM) that otherwise would be +// concatenated when reading back in. +bHasText = true; } void SvXMLNumFmtExport::FinishTextElement_Impl(bool bUseExtensionNS) { -if ( !sTextContent.isEmpty() ) +if ( bHasText ) { sal_uInt16 nNS = bUseExtensionNS ? XML_NAMESPACE_LO_EXT : XML_NAMESPACE_NUMBER; SvXMLElementExport aElem( rExport, nNS, XML_TEXT, true, false ); rExport.Characters( sTextContent.makeStringAndClear() ); +bHasText = false; } } @@ -1415,6 +1422,8 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt { case 0: bEnd = true;// end of format reached +if (bHasText && sTextContent.isEmpty()) +bHasText = false; // don't write trailing empty text break; case NF_SYMBOLTYPE_STRING: case NF_SYMBOLTYPE_DATESEP: @@ -1463,6 +1472,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt break; case NF_KEY_GENERAL :
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx |2 +- xmloff/source/core/xmlimp.cxx |8 2 files changed, 5 insertions(+), 5 deletions(-) New commits: commit 0ae13b5df161ec7e12477d5818c70909575c0aa7 Author: Noel Grandin AuthorDate: Mon Aug 9 18:19:17 2021 +0200 Commit: Noel Grandin CommitDate: Tue Aug 10 09:16:22 2021 +0200 no need to use unique_ptr for NamespaceDefine here Change-Id: I61ac177fab102c83d72337f608dc5ca8238e7819 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120215 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 12020802c329..f8387cc8f81c 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -136,7 +136,7 @@ private: NamespaceDefine( const OUString& rPrefix, const OUString& rNamespaceURI ) : m_aPrefix( rPrefix ), m_aNamespaceURI( rNamespaceURI ) {} }; -std::vector< std::unique_ptr< NamespaceDefine > > m_aNamespaceDefines; +std::vector< NamespaceDefine > m_aNamespaceDefines; public: SvXMLImportFastNamespaceHandler(); diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 48a83f7d1b9f..23e7807c7157 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -2102,8 +2102,8 @@ void SvXMLImportFastNamespaceHandler::addNSDeclAttributes( rtl::Reference < comp { for(const auto& aNamespaceDefine : m_aNamespaceDefines) { -OUString& rPrefix = aNamespaceDefine->m_aPrefix; -OUString& rNamespaceURI = aNamespaceDefine->m_aNamespaceURI; +const OUString& rPrefix = aNamespaceDefine.m_aPrefix; +const OUString& rNamespaceURI = aNamespaceDefine.m_aNamespaceURI; OUString sDecl; if ( rPrefix.isEmpty() ) sDecl = "xmlns"; @@ -2119,10 +2119,10 @@ void SvXMLImportFastNamespaceHandler::registerNamespace( const OUString& rNamesp // Elements with default namespace parsed by FastParser have namespace prefix. // A default namespace needs to be registered with the prefix, to maintain the compatibility. if ( rNamespacePrefix.isEmpty() ) -m_aNamespaceDefines.push_back( std::make_unique( +m_aNamespaceDefines.push_back( NamespaceDefine( SvXMLImport::getNamespacePrefixFromURI( rNamespaceURI ), rNamespaceURI) ); -m_aNamespaceDefines.push_back( std::make_unique( +m_aNamespaceDefines.push_back( NamespaceDefine( rNamespacePrefix, rNamespaceURI) ); }
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlcnimp.hxx |2 +- xmloff/source/core/xmlcnimp.cxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit 58ddacdb4be78dd00e05a46459ed0bcbe7531632 Author: Stephan Bergmann AuthorDate: Fri Jul 23 09:08:37 2021 +0200 Commit: Stephan Bergmann CommitDate: Fri Jul 23 10:40:41 2021 +0200 loplugin:noexceptmove (macOS, libc++) Change-Id: Ic587957fe0bf871b587375a68758a537de910de5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119399 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/include/xmloff/xmlcnimp.hxx b/include/xmloff/xmlcnimp.hxx index 8b09f5ed79cd..614a8cae742f 100644 --- a/include/xmloff/xmlcnimp.hxx +++ b/include/xmloff/xmlcnimp.hxx @@ -38,7 +38,7 @@ public: ~SvXMLAttrContainerData(); SvXMLAttrContainerData& operator=( const SvXMLAttrContainerData& rCmp ); -SvXMLAttrContainerData& operator=( SvXMLAttrContainerData&& rCmp ); +SvXMLAttrContainerData& operator=( SvXMLAttrContainerData&& rCmp ) noexcept; bool operator ==( const SvXMLAttrContainerData& rCmp ) const; diff --git a/xmloff/source/core/xmlcnimp.cxx b/xmloff/source/core/xmlcnimp.cxx index 34010568bd19..0a7ab2018475 100644 --- a/xmloff/source/core/xmlcnimp.cxx +++ b/xmloff/source/core/xmlcnimp.cxx @@ -36,7 +36,7 @@ SvXMLAttrContainerData& SvXMLAttrContainerData::operator=(const SvXMLAttrContain return *this; } -SvXMLAttrContainerData& SvXMLAttrContainerData::operator=(SvXMLAttrContainerData&& rCopy) +SvXMLAttrContainerData& SvXMLAttrContainerData::operator=(SvXMLAttrContainerData&& rCopy) noexcept { pimpl = std::move( rCopy.pimpl ); return *this; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source xmlsecurity/source
include/xmloff/xmlictxt.hxx |8 - include/xmloff/xmlimp.hxx| 11 +- xmloff/source/core/xmlimp.cxx| 100 +-- xmlsecurity/source/helper/ooxmlsecparser.cxx | 117 +++--- xmlsecurity/source/helper/ooxmlsecparser.hxx |3 xmlsecurity/source/helper/xsecparser.cxx | 141 +-- xmlsecurity/source/helper/xsecparser.hxx |3 7 files changed, 192 insertions(+), 191 deletions(-) New commits: commit bebb1a3f2dc3e131f95a078f8a9c40d0491af7cd Author: Noel Grandin AuthorDate: Wed Jul 21 09:34:10 2021 +0200 Commit: Noel Grandin CommitDate: Thu Jul 22 10:16:20 2021 +0200 pass SvXMLNamespaceMap around by value in SvXMLImport. Remove an assert in XSecParser because std::move on std::optional does not make the optional empty, unlike it's effect on std::unique_ptr. Change-Id: Ie94d01423bf694a37e4bd7f2c0235c5f79a44efe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119302 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/xmlictxt.hxx b/include/xmloff/xmlictxt.hxx index 3a83ff4527ff..885be2ead5ab 100644 --- a/include/xmloff/xmlictxt.hxx +++ b/include/xmloff/xmlictxt.hxx @@ -27,7 +27,7 @@ #include #include #include -#include +#include namespace com::sun::star::xml::sax { class XAttributeList; } @@ -49,10 +49,10 @@ class XMLOFF_DLLPUBLIC SvXMLImportContext : public css::xml::sax::XFastContextHa SvXMLImport& mrImport; oslInterlockedCountm_nRefCount; -std::unique_ptr m_pRewindMap; +std::optional m_xRewindMap; -SAL_DLLPRIVATE std::unique_ptr TakeRewindMap() { return std::move(m_pRewindMap); } -SAL_DLLPRIVATE void PutRewindMap(std::unique_ptr p) { m_pRewindMap = std::move(p); } +SAL_DLLPRIVATE std::optional TakeRewindMap() { return std::move(m_xRewindMap); } +SAL_DLLPRIVATE void PutRewindMap(std::optional p) { m_xRewindMap = std::move(p); } protected: diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index dc01b88ed9ef..12020802c329 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -48,6 +48,7 @@ #include #include #include +#include namespace com::sun::star::beans { class XPropertySet; } namespace com::sun::star::beans { struct NamedValue; } @@ -214,7 +215,7 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public cppu::WeakImplHelper< std::unique_ptr mpImpl;// dummy -std::unique_ptrmpNamespaceMap; +std::optional mxNamespaceMap; std::unique_ptr mpUnitConv; std::stack> maContexts; @@ -240,8 +241,8 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public cppu::WeakImplHelper< static void initializeNamespaceMaps(); void registerNamespaces(); public: -static std::unique_ptr processNSAttributes( -std::unique_ptr & rpNamespaceMap, +static std::optional processNSAttributes( +std::optional & rpNamespaceMap, SvXMLImport *const pImport, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList); private: @@ -394,8 +395,8 @@ public: static OUString getNamespacePrefixFromURI( const OUString& rURI ); static sal_Int32 getTokenFromName(const OUString& sName); -SvXMLNamespaceMap& GetNamespaceMap() { return *mpNamespaceMap; } -const SvXMLNamespaceMap& GetNamespaceMap() const { return *mpNamespaceMap; } +SvXMLNamespaceMap& GetNamespaceMap() { return *mxNamespaceMap; } +const SvXMLNamespaceMap& GetNamespaceMap() const { return *mxNamespaceMap; } const SvXMLUnitConverter& GetMM100UnitConverter() const { return *mpUnitConv; } SvXMLUnitConverter& GetMM100UnitConverter() { return *mpUnitConv; } const css::uno::Reference< css::xml::sax::XLocator > & GetLocator() const { return mxLocator; } diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index d3973c87e16c..48a83f7d1b9f 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -354,42 +354,42 @@ void SvXMLImport::InitCtor_() if( mnImportFlags != SvXMLImportFlags::NONE ) { // implicit "xml" namespace prefix -mpNamespaceMap->Add( GetXMLToken(XML_XML), GetXMLToken(XML_N_XML), XML_NAMESPACE_XML ); -mpNamespaceMap->Add( "_office", GetXMLToken(XML_N_OFFICE), XML_NAMESPACE_OFFICE ); -mpNamespaceMap->Add( "_office_ooo", GetXMLToken(XML_N_OFFICE_EXT), XML_NAMESPACE_OFFICE_EXT ); -mpNamespaceMap->Add( "_ooo", GetXMLToken(XML_N_OOO), XML_NAMESPACE_OOO ); -mpNamespaceMap->Add( "_style", GetXMLToken(XML_N_STYLE), XML_NAMESPACE_STYLE ); -mpNamespaceMap->Add( "_text", GetXMLToken(XML_N_TEXT), XML_NAMESPACE_TEXT ); -mpNamespaceMap->Add( "_table", GetXMLToken(XML_N_TABLE), XML_NAMESPACE_TABLE ); -mpNamespaceMap->Add( "_table_ooo",
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/txtparae.hxx |2 +- xmloff/source/text/txtparae.cxx | 28 2 files changed, 13 insertions(+), 17 deletions(-) New commits: commit ea1daffc097025c9969f76119d3864cbef203c34 Author: Noel Grandin AuthorDate: Sun May 30 10:42:19 2021 +0200 Commit: Noel Grandin CommitDate: Sun May 30 12:28:43 2021 +0200 no need to allocate this separately Change-Id: Iae6b212c9114c0a5384fc8b7033fa80fa687c638 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116402 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx index 3a7ca544d358..a3464b814333 100644 --- a/include/xmloff/txtparae.hxx +++ b/include/xmloff/txtparae.hxx @@ -90,7 +90,7 @@ class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public XMLStyleExport const ::std::unique_ptr< ::xmloff::BoundFrameSets > pBoundFrameSets; std::unique_ptr pFieldExport; -std::unique_ptr> pListElements; +std::vectormaListElements; XMLTextListAutoStylePool maListAutoPool; std::unique_ptrpSectionExport; std::unique_ptr pIndexMarkExport; diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index cd715f15e599..51a6a3a32bc3 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -870,14 +870,13 @@ void XMLTextParagraphExport::exportListChange( } if ( nListLevelsToBeClosed > 0 && - pListElements && - pListElements->size() >= sal::static_int_cast< sal_uInt32 >( 2 * nListLevelsToBeClosed ) ) + maListElements.size() >= sal::static_int_cast< sal_uInt32 >( 2 * nListLevelsToBeClosed ) ) { do { for(size_t j = 0; j < 2; ++j) { -OUString aElem(pListElements->back()); -pListElements->pop_back(); +OUString aElem(maListElements.back()); +maListElements.pop_back(); GetExport().EndElement(aElem, true); } @@ -1046,9 +1045,7 @@ void XMLTextParagraphExport::exportListChange( GetExport().IgnorableWhitespace(); GetExport().StartElement(aElem, false); -if(!pListElements) -pListElements.reset( new std::vector ); -pListElements->push_back(aElem); +maListElements.push_back(aElem); mpTextListsHelper->PushListOnStack( sListId, sListStyleName ); @@ -1083,7 +1080,7 @@ void XMLTextParagraphExport::exportListChange( GetXMLToken(eLName) ); GetExport().IgnorableWhitespace(); GetExport().StartElement(aElem, false); -pListElements->push_back(aElem); +maListElements.push_back(aElem); // export of element for last opened , if requested if ( GetExport().exportTextNumberElement() && @@ -,25 +1108,25 @@ void XMLTextParagraphExport::exportListChange( rPrevInfo.BelongsToSameList( rNextInfo ) && rPrevInfo.GetLevel() >= rNextInfo.GetLevel() ) { -assert(pListElements && pListElements->size() >= 2 && "list elements missing"); -bEndElement = pListElements && pListElements->size() >= 2; +assert(maListElements.size() >= 2 && "list elements missing"); +bEndElement = maListElements.size() >= 2; } if (!bEndElement) return; // close previous list-item -GetExport().EndElement(pListElements->back(), true ); -pListElements->pop_back(); +GetExport().EndElement(maListElements.back(), true ); +maListElements.pop_back(); // Only for sub lists (#i103745#) if ( rNextInfo.IsRestart() && !rNextInfo.HasStartValue() && rNextInfo.GetLevel() != 1 ) { // start new sub list respectively list on same list level -GetExport().EndElement(pListElements->back(), true ); +GetExport().EndElement(maListElements.back(), true ); GetExport().IgnorableWhitespace(); -GetExport().StartElement(pListElements->back(), false); +GetExport().StartElement(maListElements.back(), false); } // open new list-item @@ -1166,7 +1163,7 @@ void XMLTextParagraphExport::exportListChange( GetXMLToken(XML_LIST_ITEM) ) ); GetExport().IgnorableWhitespace(); GetExport().StartElement(aElem, false ); -pListElements->push_back(aElem); +maListElements.push_back(aElem); // export of element for , if requested if ( GetExport().exportTextNumberElement() && @@ -1294,7 +1291,6 @@ XMLTextParagraphExport::~XMLTextParagraphExport() pIndexMarkExport.reset(); pSectionExport.reset();
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlnumfi.hxx | 17 +++- xmloff/source/style/xmlnumfi.cxx | 82 ++- 2 files changed, 80 insertions(+), 19 deletions(-) New commits: commit 010d6d1562f309a2aee728f8e5590385cc6ce8fd Author: Eike Rathke AuthorDate: Tue Mar 16 21:12:29 2021 +0100 Commit: Eike Rathke CommitDate: Sun Mar 21 12:36:02 2021 +0100 ODF load: suppress calendar modifiers in format codes if possible ... for switching to/from implicit secondary calendar, like ja-JP explicit [~gengou] and [~gregorian] most times are superfluous and GE or are used. In preparation for https://gerrit.libreoffice.org/c/core/+/108532 Change-Id: I8eb412c0fbba0927741bb305f91eb575b5f1bb13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112596 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/include/xmloff/xmlnumfi.hxx b/include/xmloff/xmlnumfi.hxx index 1bf6c9228ed6..c863304bc293 100644 --- a/include/xmloff/xmlnumfi.hxx +++ b/include/xmloff/xmlnumfi.hxx @@ -115,6 +115,18 @@ struct MyCondition class XMLOFF_DLLPUBLIC SvXMLNumFormatContext : public SvXMLStyleContext { +public: +enum ImplicitCalendar +{ +DEFAULT, +SECONDARY, +OTHER, +DEFAULT_FROM_OTHER, +SECONDARY_FROM_OTHER +}; + +private: + SvXMLNumImpData*pData; SvXMLStylesContext* pStyles; std::vectoraMyConditions; @@ -124,6 +136,8 @@ class XMLOFF_DLLPUBLIC SvXMLNumFormatContext : public SvXMLStyleContext OUString sFormatTitle; // OUString sMapName; OUString sCalendar; +OUString aImplicitCalendar[2]; +ImplicitCalendar eImplicitCalendar; LanguageType nFormatLang; boolbAutoOrder; boolbFromSystem; @@ -178,7 +192,8 @@ public: void SetHasLongDoW(bool bSet) { bHasLongDoW = bSet; } bool HasEra() const { return bHasEra; } -void UpdateCalendar( const OUString& rNewCalendar, bool bImplicitSecondaryCalendarEC = false ); +void UpdateCalendar( const OUString& rNewCalendar ); +ImplicitCalendar GetImplicitCalendarState() const { return eImplicitCalendar; } const LocaleDataWrapper& GetLocaleData() const; diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 734f572608b1..28dbe6574336 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -929,25 +929,17 @@ void SvXMLNumFmtElementContext::endFastElement(sal_Int32 ) // Do not replace for default calendar. // Also replace Y by E if we're switching to the secondary // calendar of a locale if it is known to implicitly use E. -bool bImplicitEC = (!sCalendar.isEmpty() && -rParent.GetLocaleData().doesSecondaryCalendarUseEC( sCalendar)); -if (bImplicitEC || (!sCalendar.isEmpty() && rParent.HasEra() -&& sCalendar != rParent.GetLocaleData().getDefaultCalendar()->Name)) +rParent.UpdateCalendar( sCalendar); +const SvXMLNumFormatContext::ImplicitCalendar eCal = rParent.GetImplicitCalendarState(); +if (eCal == SvXMLNumFormatContext::ImplicitCalendar::SECONDARY +|| eCal == SvXMLNumFormatContext::ImplicitCalendar::SECONDARY_FROM_OTHER) { -// If E or EE is the first format keyword, passing -// bImplicitEC=true suppresses the superfluous calendar -// modifier for this format. This does not help for -// something like [~cal]DD/MM/EE but so far only YMD order -// is used with such calendars. Live with the modifier if -// other keywords precede this. -rParent.UpdateCalendar( sCalendar, bImplicitEC); rParent.AddNfKeyword( sal::static_int_cast< sal_uInt16 >( bEffLong ? NF_KEY_EEC : NF_KEY_EC ) ); } else { -rParent.UpdateCalendar( sCalendar ); rParent.AddNfKeyword( sal::static_int_cast< sal_uInt16 >( bEffLong ? NF_KEY_ : NF_KEY_YY ) ); @@ -1118,6 +1110,7 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, aMyConditions(), nType( nNewType ), nKey(-1), +eImplicitCalendar(ImplicitCalendar::DEFAULT), nFormatLang( LANGUAGE_SYSTEM ), bAutoOrder( false ), bFromSystem( false ), @@ -1254,6 +1247,7 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, aMyConditions(), nType( SvXMLStylesTokens::NUMBER_STYLE ), nKey(nTempKey), +eImplicitCalendar(ImplicitCalendar::DEFAULT),
[Libreoffice-commits] core.git: include/xmloff xmloff/source xmlsecurity/source
include/xmloff/xmlimp.hxx|6 include/xmloff/xmlnamespace.hxx |7 include/xmloff/xmltoken.hxx | 13 xmloff/source/core/xmlimp.cxx| 23 xmloff/source/core/xmltoken.cxx | 13 xmloff/source/token/tokens.txt | 10 xmlsecurity/source/helper/xsecparser.cxx | 1630 --- xmlsecurity/source/helper/xsecparser.hxx | 71 - 8 files changed, 1426 insertions(+), 347 deletions(-) New commits: commit 12b15be8f4f930a04d8056b9219ac969b42a9784 Author: Michael Stahl AuthorDate: Fri Feb 12 16:42:51 2021 +0100 Commit: Michael Stahl CommitDate: Wed Mar 3 12:43:36 2021 +0100 xmlsecurity: replace XSecParser implementation Implement Namespaces in XML and follow xmldsig-core and XAdES schemas. Change-Id: I03537b51bb757ecbfa63a826b38de543c70ba032 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110833 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 2d5013e2fe4f..12a81a32888f 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -239,8 +239,12 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public cppu::WeakImplHelper< static void initializeNamespaceMaps(); void registerNamespaces(); -std::unique_ptr processNSAttributes( +public: +static std::unique_ptr processNSAttributes( +std::unique_ptr & rpNamespaceMap, +SvXMLImport *const pImport, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList); +private: css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator; diff --git a/include/xmloff/xmlnamespace.hxx b/include/xmloff/xmlnamespace.hxx index d45832f02d81..cabdcc7578e2 100644 --- a/include/xmloff/xmlnamespace.hxx +++ b/include/xmloff/xmlnamespace.hxx @@ -69,6 +69,13 @@ constexpr sal_uInt16 XML_NAMESPACE_TCD = 34; // text conversion di constexpr sal_uInt16 XML_NAMESPACE_DLG = 35; constexpr sal_uInt16 XML_NAMESPACE_REPORT = 36; constexpr sal_uInt16 XML_NAMESPACE_VERSIONS_LIST = 37; +// OOo extension digital signatures, used in ODF 1.1 +constexpr sal_uInt16 XML_NAMESPACE_DSIG_OOO =38; +// ODF 1.2 digital signature namespaces +constexpr sal_uInt16 XML_NAMESPACE_DSIG =39; +constexpr sal_uInt16 XML_NAMESPACE_DS = 40; +constexpr sal_uInt16 XML_NAMESPACE_XADES132 =41; +constexpr sal_uInt16 XML_NAMESPACE_XADES141 =42; // namespaces for ODF extended formats constexpr sal_uInt16 XML_NAMESPACE_EXT_BASE = 50; diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index bc18f6230293..12a0632a5af7 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -135,6 +135,19 @@ namespace xmloff::token { XML_NP_GRDDL, XML_N_GRDDL, +// OOo extension digital signatures, used in ODF 1.1 +XML_NP_DSIG_OOO, +XML_N_DSIG_OOO, +// ODF 1.2 digital signatures +XML_NP_DSIG, +XML_N_DSIG, +XML_NP_DS, +XML_N_DS, +XML_NP_XADES132, +XML_N_XADES132, +XML_NP_XADES141, +XML_N_XADES141, + // ODF Enhanced namespaces XML_NP_OFFICE_EXT, XML_N_OFFICE_EXT, diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 8c4b02f50754..6d7b0805ddfb 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -671,6 +671,8 @@ void SAL_CALL SvXMLImport::endDocument() } std::unique_ptr SvXMLImport::processNSAttributes( +std::unique_ptr & rpNamespaceMap, +SvXMLImport *const pImport, // TODO??? const uno::Reference< xml::sax::XAttributeList >& xAttrList) { std::unique_ptr pRewindMap; @@ -678,12 +680,13 @@ std::unique_ptr SvXMLImport::processNSAttributes( for( sal_Int16 i=0; i < nAttrCount; i++ ) { const OUString& rAttrName = xAttrList->getNameByIndex( i ); -if ( rAttrName == "office:version" && !mpImpl->mxODFVersion ) +if (pImport && rAttrName == "office:version" && !pImport->mpImpl->mxODFVersion) { -mpImpl->mxODFVersion = xAttrList->getValueByIndex( i ); +pImport->mpImpl->mxODFVersion = xAttrList->getValueByIndex( i ); // the ODF version in content.xml and manifest.xml must be the same starting from ODF1.2 -if ( mpImpl->mStreamName == "content.xml" && !IsODFVersionConsistent( *mpImpl->mxODFVersion ) ) +if (pImport->mpImpl->mStreamName == "content.xml" +&& !pImport->IsODFVersionConsistent(*pImport->mpImpl->mxODFVersion)) { throw xml::sax::SAXException("Inconsistent ODF versions in content.xml and manifest.xml!", uno::Reference< uno::XInterface >(), @@ -697,8 +700,8 @@ std::unique_ptr SvXMLImport::processNSAttributes( {
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlictxt.hxx |4 xmloff/source/core/XMLEmbeddedObjectImportContext.cxx |3 +-- xmloff/source/core/xmlimp.cxx | 11 ++- 3 files changed, 15 insertions(+), 3 deletions(-) New commits: commit e5f436bc53e0d07654901ef7cc8ff56d04f0686e Author: Noel AuthorDate: Fri Feb 12 13:02:25 2021 +0200 Commit: Noel Grandin CommitDate: Wed Feb 24 07:26:23 2021 +0100 restore namespace unwinding in SvXMLImport accidentally lost during the fastparser conversion Change-Id: I7d53e9f32dd8cff650b9ffb6dae493419ce8461f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110813 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/xmlictxt.hxx b/include/xmloff/xmlictxt.hxx index 1fee33fce666..7216105fcd1f 100644 --- a/include/xmloff/xmlictxt.hxx +++ b/include/xmloff/xmlictxt.hxx @@ -50,6 +50,10 @@ class XMLOFF_DLLPUBLIC SvXMLImportContext : public css::xml::sax::XFastContextHa SvXMLImport& mrImport; oslInterlockedCountm_nRefCount; +std::unique_ptr m_pRewindMap; + +SAL_DLLPRIVATE std::unique_ptr TakeRewindMap() { return std::move(m_pRewindMap); } +SAL_DLLPRIVATE void PutRewindMap(std::unique_ptr p) { m_pRewindMap = std::move(p); } protected: diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx index f190a4a18c75..79705901cf2d 100644 --- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx +++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx @@ -82,8 +82,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLEmbeddedObjectImpor sal_Int32 , const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) { -// we have no state, so avoid allocation cost, and just use a single instance -return this; +return new XMLEmbeddedObjectImportContext_Impl(GetImport(), mxFastHandler); } void XMLEmbeddedObjectImportContext_Impl::startFastElement( diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 33cca656fb1f..8c4b02f50754 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -768,7 +768,7 @@ void SAL_CALL SvXMLImport::startFastElement (sal_Int32 Element, maNamespaceAttrList->Clear(); maNamespaceHandler->addNSDeclAttributes( maNamespaceAttrList ); -processNSAttributes( maNamespaceAttrList ); +std::unique_ptr pRewindMap = processNSAttributes( maNamespaceAttrList ); SvXMLImportContextRef xContext; const bool bRootContext = maContexts.empty(); @@ -793,6 +793,10 @@ void SAL_CALL SvXMLImport::startFastElement (sal_Int32 Element, if ( !xContext ) xContext.set( new SvXMLImportContext( *this ) ); +// Remember old namespace map. +if( pRewindMap ) +xContext->PutRewindMap(std::move(pRewindMap)); + // Call a startElement at the new context. xContext->startFastElement( Element, Attribs ); @@ -847,8 +851,13 @@ void SAL_CALL SvXMLImport::endFastElement (sal_Int32 Element) return; } SvXMLImportContextRef xContext = std::move(maContexts.top()); +// Get a namespace map to rewind. +std::unique_ptr pRewindMap = xContext->TakeRewindMap(); maContexts.pop(); xContext->endFastElement( Element ); +// Rewind a namespace map. +if (pRewindMap) +mpNamespaceMap = std::move(pRewindMap); } void SAL_CALL SvXMLImport::endUnknownElement (const OUString & rPrefix, const OUString & rLocalName) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/shapeimport.hxx|2 - xmloff/source/chart/SchXMLPlotAreaContext.cxx |3 -- xmloff/source/draw/ximp3dscene.cxx| 33 +- 3 files changed, 19 insertions(+), 19 deletions(-) New commits: commit 97e2bd837841368e5c64d7c2fed0d423b0ad4606 Author: Noel AuthorDate: Tue Dec 15 15:05:35 2020 +0200 Commit: Noel Grandin CommitDate: Wed Dec 16 08:42:53 2020 +0100 use views to parse Change-Id: I4cdf09f4ce8dc399fa5ae4620191a2ad2e7f78da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107759 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/shapeimport.hxx b/include/xmloff/shapeimport.hxx index 4dc7634b651c..f40ae8eaa803 100644 --- a/include/xmloff/shapeimport.hxx +++ b/include/xmloff/shapeimport.hxx @@ -102,7 +102,7 @@ public: SvXMLImportContext * create3DLightContext( const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList); /** this should be called for each scene attribute */ -void processSceneAttribute( sal_Int32 nAttributeToken, const OUString& rValue ); +void processSceneAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & aIter ); /** this sets the scene attributes at this propertyset */ void setSceneAttributes( const css::uno::Reference< css::beans::XPropertySet >& xPropSet ); diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index 2d870e9b2f8e..b336b8b56aa1 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -214,7 +214,6 @@ void SchXMLPlotAreaContext::startFastElement (sal_Int32 /*nElement*/, for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) ) { -OUString aValue = aIter.toString(); switch( aIter.getToken() ) { case XML_ELEMENT(SVG, XML_X): @@ -256,7 +255,7 @@ void SchXMLPlotAreaContext::startFastElement (sal_Int32 /*nElement*/, case XML_ELEMENT(DR3D, XML_SHADE_MODE): case XML_ELEMENT(DR3D, XML_AMBIENT_COLOR): case XML_ELEMENT(DR3D, XML_LIGHTING_MODE): -maSceneImportHelper.processSceneAttribute( aIter.getToken(), aValue ); +maSceneImportHelper.processSceneAttribute( aIter ); break; default: XMLOFF_WARN_UNKNOWN("xmloff", aIter); diff --git a/xmloff/source/draw/ximp3dscene.cxx b/xmloff/source/draw/ximp3dscene.cxx index 29a13ba961b3..a925759ed4de 100644 --- a/xmloff/source/draw/ximp3dscene.cxx +++ b/xmloff/source/draw/ximp3dscene.cxx @@ -127,7 +127,7 @@ void SdXML3DSceneShapeContext::startFastElement( // read attributes for the 3DScene for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) ) -processSceneAttribute( aIter.getToken(), aIter.toString() ); +processSceneAttribute( aIter ); // #91047# call parent function is missing here, added it if(mxShape.is()) @@ -216,8 +216,9 @@ SvXMLImportContext * SdXML3DSceneAttributesHelper::create3DLightContext( const c } /** this should be called for each scene attribute */ -void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_Int32 nAttributeToken, const OUString& rValue ) +void SdXML3DSceneAttributesHelper::processSceneAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & aIter ) { +auto nAttributeToken = aIter.getToken(); if( !IsTokenInNamespace(nAttributeToken, XML_NAMESPACE_DR3D) ) return; @@ -225,7 +226,7 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_Int32 nAttributeTo { case XML_TRANSFORM: { -SdXMLImExTransform3D aTransform(rValue, mrImport.GetMM100UnitConverter()); +SdXMLImExTransform3D aTransform(aIter.toString(), mrImport.GetMM100UnitConverter()); if(aTransform.NeedsAction()) mbSetTransform = aTransform.GetFullHomogenTransform(mxHomMat); return; @@ -233,7 +234,7 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_Int32 nAttributeTo case XML_VRP: { ::basegfx::B3DVector aNewVec; -SvXMLUnitConverter::convertB3DVector(aNewVec, rValue); +SvXMLUnitConverter::convertB3DVector(aNewVec, aIter.toView()); if(aNewVec != maVRP) { @@ -245,7 +246,7 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_Int32 nAttributeTo case XML_VPN: { ::basegfx::B3DVector aNewVec; -SvXMLUnitConverter::convertB3DVector(aNewVec, rValue); +SvXMLUnitConverter::convertB3DVector(aNewVec, aIter.toView()); if(aNewVec != maVPN) { @@ -257,7 +258,7 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_Int32 nAttributeTo case XML_VUP: {
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/XMLFontStylesContext.hxx |8 xmloff/source/style/XMLFontStylesContext.cxx | 22 -- 2 files changed, 30 deletions(-) New commits: commit 085468767e04db71b7f458b8f5dc1f03d2e4ad17 Author: Noel AuthorDate: Tue Dec 8 09:44:00 2020 +0200 Commit: Noel Grandin CommitDate: Tue Dec 8 11:26:35 2020 +0100 remove unused SvXMLTokenMap from XMLFontStylesContext Change-Id: I0e75bd2a65259659c31bbc721649b266fbaa3c8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107369 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/XMLFontStylesContext.hxx b/include/xmloff/XMLFontStylesContext.hxx index 3094ac191365..6768ca43b970 100644 --- a/include/xmloff/XMLFontStylesContext.hxx +++ b/include/xmloff/XMLFontStylesContext.hxx @@ -28,7 +28,6 @@ #include struct XMLPropertyState; -class SvXMLTokenMap; class XMLFontFamilyNamePropHdl; class XMLFontFamilyPropHdl; class XMLFontPitchPropHdl; @@ -41,8 +40,6 @@ class XMLOFF_DLLPUBLIC XMLFontStylesContext final : public SvXMLStylesContext std::unique_ptr pPitchHdl; std::unique_ptr pEncHdl; -std::unique_ptr pFontStyleAttrTokenMap; - rtl_TextEncodingeDfltEncoding; using SvXMLStylesContext::CreateStyleChildContext; @@ -55,11 +52,6 @@ public: ~XMLFontStylesContext() override; -const SvXMLTokenMap& GetFontStyleAttrTokenMap() const -{ -return *pFontStyleAttrTokenMap; -} - bool FillProperties( const OUString& rName, ::std::vector< XMLPropertyState > , sal_Int32 nFamilyNameIdx, diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx index db22711e039c..6d58300989fd 100644 --- a/xmloff/source/style/XMLFontStylesContext.cxx +++ b/xmloff/source/style/XMLFontStylesContext.cxx @@ -62,27 +62,6 @@ enum XMLFontStyleAttrTokens } -static const SvXMLTokenMapEntry* lcl_getFontStyleAttrTokenMap() -{ -static const SvXMLTokenMapEntry aFontStyleAttrTokenMap[] = -{ -{ XML_NAMESPACE_SVG, XML_FONT_FAMILY, -XML_TOK_FONT_STYLE_ATTR_FAMILY }, -{ XML_NAMESPACE_STYLE, XML_FONT_FAMILY_GENERIC, -XML_TOK_FONT_STYLE_ATTR_FAMILY_GENERIC }, -{ XML_NAMESPACE_STYLE, XML_FONT_ADORNMENTS, -XML_TOK_FONT_STYLE_ATTR_STYLENAME }, -{ XML_NAMESPACE_STYLE, XML_FONT_PITCH, -XML_TOK_FONT_STYLE_ATTR_PITCH }, -{ XML_NAMESPACE_STYLE, XML_FONT_CHARSET, -XML_TOK_FONT_STYLE_ATTR_CHARSET }, - -XML_TOKEN_MAP_END -}; -return aFontStyleAttrTokenMap; -} - - XMLFontStyleContextFontFace::XMLFontStyleContextFontFace( SvXMLImport& rImport, XMLFontStylesContext& rStyles ) : SvXMLStyleContext( rImport, XML_STYLE_FAMILY_FONT ), @@ -361,7 +340,6 @@ XMLFontStylesContext::XMLFontStylesContext( SvXMLImport& rImport, pFamilyHdl( new XMLFontFamilyPropHdl ), pPitchHdl( new XMLFontPitchPropHdl ), pEncHdl( new XMLFontEncodingPropHdl ), -pFontStyleAttrTokenMap( new SvXMLTokenMap(lcl_getFontStyleAttrTokenMap()) ), eDfltEncoding( eDfltEnc ) { } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/txtimp.hxx|6 ++ xmloff/source/text/XMLChangeElementImportContext.cxx | 16 +++ xmloff/source/text/XMLChangeElementImportContext.hxx |9 +-- xmloff/source/text/XMLChangeInfoContext.cxx |4 - xmloff/source/text/XMLChangeInfoContext.hxx |2 xmloff/source/text/txtimp.cxx| 43 +++ 6 files changed, 60 insertions(+), 20 deletions(-) New commits: commit 4d7ad433c6ebd9fbcac480ebdd00af933a437df5 Author: Noel AuthorDate: Wed Dec 2 09:07:49 2020 +0200 Commit: Noel Grandin CommitDate: Wed Dec 2 08:58:50 2020 +0100 fastparser in XMLChangeElementImportContext with the help of a fallback method for CreateTextChildContext Change-Id: Ic74ad8e74a4763906ae58a9064ecd54c5b9075ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107043 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx index 94d1d6580ab2..bdd0e169c9d1 100644 --- a/include/xmloff/txtimp.hxx +++ b/include/xmloff/txtimp.hxx @@ -59,6 +59,7 @@ namespace frame { class XModel; } namespace container { class XNameContainer; class XIndexReplace; } namespace beans { class XPropertySet; } namespace xml::sax { class XAttributeList; } +namespace xml::sax { class XFastAttributeList; } namespace util { struct DateTime; } } @@ -395,6 +396,11 @@ public: void SetAutoStyles( SvXMLStylesContext *pStyles ); +SvXMLImportContext *CreateTextChildContext( +SvXMLImport& rImport, +sal_Int32 nElement, +const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList, +XMLTextType eType = XMLTextType::Shape ); SvXMLImportContext *CreateTextChildContext( SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName, diff --git a/xmloff/source/text/XMLChangeElementImportContext.cxx b/xmloff/source/text/XMLChangeElementImportContext.cxx index a3bce265ae43..4fc81a755eda 100644 --- a/xmloff/source/text/XMLChangeElementImportContext.cxx +++ b/xmloff/source/text/XMLChangeElementImportContext.cxx @@ -44,17 +44,15 @@ XMLChangeElementImportContext::XMLChangeElementImportContext( { } -SvXMLImportContextRef XMLChangeElementImportContext::CreateChildContext( -sal_uInt16 nPrefix, -const OUString& rLocalName, -const Reference & xAttrList) +css::uno::Reference< css::xml::sax::XFastContextHandler > XMLChangeElementImportContext::createFastChildContext( +sal_Int32 nElement, +const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) { SvXMLImportContextRef xContext; -if ( (XML_NAMESPACE_OFFICE == nPrefix) && - IsXMLToken( rLocalName, XML_CHANGE_INFO) ) +if ( nElement == XML_ELEMENT(OFFICE, XML_CHANGE_INFO) ) { -xContext = new XMLChangeInfoContext(GetImport(), nPrefix, rLocalName, +xContext = new XMLChangeInfoContext(GetImport(), rChangedRegion, maType); } else @@ -63,7 +61,7 @@ SvXMLImportContextRef XMLChangeElementImportContext::CreateChildContext( rChangedRegion.UseRedlineText(); xContext = GetImport().GetTextImport()->CreateTextChildContext( -GetImport(), nPrefix, rLocalName, xAttrList, +GetImport(), nElement, xAttrList, XMLTextType::ChangedRegion); if (!xContext) @@ -74,7 +72,7 @@ SvXMLImportContextRef XMLChangeElementImportContext::CreateChildContext( } } -return xContext; +return xContext.get(); } void XMLChangeElementImportContext::startFastElement( sal_Int32, const Reference< css::xml::sax::XFastAttributeList >& ) diff --git a/xmloff/source/text/XMLChangeElementImportContext.hxx b/xmloff/source/text/XMLChangeElementImportContext.hxx index e43e86248224..fb7bef4aa13f 100644 --- a/xmloff/source/text/XMLChangeElementImportContext.hxx +++ b/xmloff/source/text/XMLChangeElementImportContext.hxx @@ -37,7 +37,7 @@ class XMLChangedRegionImportContext; * Import and elements contained in a * element. */ -class XMLChangeElementImportContext : public SvXMLImportContext + class XMLChangeElementImportContext : public SvXMLImportContext { /** * accept text content (paragraphs) in element as redline content? @@ -60,7 +60,6 @@ class XMLChangeElementImportContext : public SvXMLImportContext public: - XMLChangeElementImportContext( SvXMLImport& rImport, /// accept text content (paragraphs) in element as redline content? @@ -69,10 +68,8 @@ public: XMLChangedRegionImportContext& rParent, OUString const & rType); -virtual SvXMLImportContextRef CreateChildContext( -sal_uInt16 nPrefix, -const OUString& rLocalName, -const css::uno::Reference & xAttrList) override; +virtual css::uno::Reference< css::xml::sax::XFastContextHandler >
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/shapeimport.hxx |2 xmloff/source/chart/SchXMLChartContext.cxx |2 xmloff/source/chart/SchXMLPlotAreaContext.cxx | 254 ++--- xmloff/source/chart/SchXMLPlotAreaContext.hxx | 24 - xmloff/source/chart/SchXMLPropertyMappingContext.cxx | 27 - xmloff/source/chart/SchXMLPropertyMappingContext.hxx |6 xmloff/source/chart/SchXMLRegressionCurveObjectContext.cxx | 53 +- xmloff/source/chart/SchXMLRegressionCurveObjectContext.hxx |7 xmloff/source/chart/SchXMLSeries2Context.cxx | 33 - xmloff/source/chart/SchXMLSeries2Context.hxx |4 xmloff/source/chart/SchXMLTableContext.cxx | 107 ++--- xmloff/source/chart/SchXMLTableContext.hxx | 28 - xmloff/source/draw/ximp3dobject.cxx| 36 + xmloff/source/draw/ximp3dobject.hxx| 24 - xmloff/source/draw/ximp3dscene.cxx | 186 - xmloff/source/draw/ximp3dscene.hxx |6 xmloff/source/draw/ximpgrp.cxx |3 xmloff/source/draw/ximpgrp.hxx |4 xmloff/source/draw/ximpshap.cxx| 106 +++-- xmloff/source/draw/ximpshap.hxx| 84 +++- 20 files changed, 529 insertions(+), 467 deletions(-) New commits: commit d05a4cfbdcece491f7385dbeaa7eca03f2fdc1d5 Author: Noel AuthorDate: Mon Nov 30 10:52:22 2020 +0200 Commit: Noel Grandin CommitDate: Mon Nov 30 12:09:54 2020 +0100 fastparser in shapeimport Change-Id: I11227424647313ff5c5d54126bdc27a17da3932e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106851 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/shapeimport.hxx b/include/xmloff/shapeimport.hxx index b4bc6bf44c3a..dacd947a66d2 100644 --- a/include/xmloff/shapeimport.hxx +++ b/include/xmloff/shapeimport.hxx @@ -186,7 +186,7 @@ public: SvXMLImportContext * create3DLightContext( const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList); /** this should be called for each scene attribute */ -void processSceneAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ); +void processSceneAttribute( sal_Int32 nAttributeToken, const OUString& rValue ); /** this sets the scene attributes at this propertyset */ void setSceneAttributes( const css::uno::Reference< css::beans::XPropertySet >& xPropSet ); diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index 968bf0cfa76a..02c4df000d36 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -1073,7 +1073,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SchXMLChartContext::cr case XML_ELEMENT(TABLE, XML_TABLE): { SchXMLTableContext * pTableContext = -new SchXMLTableContext( mrImportHelper, GetImport(), maTable ); +new SchXMLTableContext( GetImport(), maTable ); m_bHasTableElement = true; // #i85913# take into account column- and row- mapping for // charts with own data only for those which were not copied diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index 0391b4f4a8d3..2fe188eab45f 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -206,37 +206,32 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext( SchXMLPlotAreaContext::~SchXMLPlotAreaContext() {} -void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList ) +void SchXMLPlotAreaContext::startFastElement (sal_Int32 /*nElement*/, +const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList) { // parse attributes -sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0; -const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetPlotAreaAttrTokenMap(); uno::Reference< chart2::XChartDocument > xNewDoc( GetImport().GetModel(), uno::UNO_QUERY ); -for( sal_Int16 i = 0; i < nAttrCount; i++ ) +for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) ) { -OUString sAttrName = xAttrList->getNameByIndex( i ); -OUString aLocalName; -OUString aValue = xAttrList->getValueByIndex( i ); -sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, ); - -switch( rAttrTokenMap.Get( nPrefix, aLocalName )) +OUString aValue = aIter.toString(); +switch( aIter.getToken() ) { -case XML_TOK_PA_X: -case XML_TOK_PA_Y: -case XML_TOK_PA_WIDTH: -
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/shapeimport.hxx |3 - xmloff/source/draw/shapeimport.cxx | 58 +++ xmloff/source/draw/ximp3dobject.cxx | 24 ++--- xmloff/source/draw/ximp3dobject.hxx | 17 ++ xmloff/source/draw/ximp3dscene.cxx |4 - xmloff/source/draw/ximp3dscene.hxx |2 xmloff/source/draw/ximpgrp.cxx |3 - xmloff/source/draw/ximpgrp.hxx |2 xmloff/source/draw/ximplink.cxx |4 - xmloff/source/draw/ximplink.hxx |2 xmloff/source/draw/ximpshap.cxx | 89 ++-- xmloff/source/draw/ximpshap.hxx | 61 12 files changed, 94 insertions(+), 175 deletions(-) New commits: commit fc828fb382cc187ab645b00b8f780fbdab2ceed3 Author: Noel Grandin AuthorDate: Sat Nov 21 11:55:28 2020 +0200 Commit: Noel Grandin CommitDate: Sat Nov 21 15:22:08 2020 +0100 remove some prefix and local params from constructors Change-Id: Iaffbefe98ced97610b99a00b1b3011c6a79a7859 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106300 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/shapeimport.hxx b/include/xmloff/shapeimport.hxx index 1dcb16ebe4e6..b4bc6bf44c3a 100644 --- a/include/xmloff/shapeimport.hxx +++ b/include/xmloff/shapeimport.hxx @@ -201,8 +201,7 @@ protected: OUString msHyperlink; public: -SvXMLShapeContext( SvXMLImport& rImp, sal_uInt16 nPrfx, -const OUString& rLName, bool bTemporaryShape ) : SvXMLImportContext( rImp, nPrfx, rLName ), mbTemporaryShape(bTemporaryShape) {} +SvXMLShapeContext( SvXMLImport& rImp, bool bTemporaryShape ) : SvXMLImportContext( rImp ), mbTemporaryShape(bTemporaryShape) {} const css::uno::Reference< css::drawing::XShape >& getShape() const { return mxShape; } diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index 47309a3ab28f..2a2d5e137eb4 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -359,31 +359,31 @@ SvXMLShapeContext* XMLShapeImportHelper::Create3DSceneChildContext( case XML_TOK_3DSCENE_3DSCENE: { // dr3d:3dscene inside dr3d:3dscene context -pContext = new SdXML3DSceneShapeContext( rImport, p_nPrefix, rLocalName, xAttrList, rShapes, false); +pContext = new SdXML3DSceneShapeContext( rImport, xAttrList, rShapes, false); break; } case XML_TOK_3DSCENE_3DCUBE: { // dr3d:3dcube inside dr3d:3dscene context -pContext = new SdXML3DCubeObjectShapeContext( rImport, p_nPrefix, rLocalName, xAttrList, rShapes); +pContext = new SdXML3DCubeObjectShapeContext( rImport, xAttrList, rShapes); break; } case XML_TOK_3DSCENE_3DSPHERE: { // dr3d:3dsphere inside dr3d:3dscene context -pContext = new SdXML3DSphereObjectShapeContext( rImport, p_nPrefix, rLocalName, xAttrList, rShapes); +pContext = new SdXML3DSphereObjectShapeContext( rImport, xAttrList, rShapes); break; } case XML_TOK_3DSCENE_3DLATHE: { // dr3d:3dlathe inside dr3d:3dscene context -pContext = new SdXML3DLatheObjectShapeContext( rImport, p_nPrefix, rLocalName, xAttrList, rShapes); +pContext = new SdXML3DLatheObjectShapeContext( rImport, xAttrList, rShapes); break; } case XML_TOK_3DSCENE_3DEXTRUDE: { // dr3d:3dextrude inside dr3d:3dscene context -pContext = new SdXML3DExtrudeObjectShapeContext( rImport, p_nPrefix, rLocalName, xAttrList, rShapes); +pContext = new SdXML3DExtrudeObjectShapeContext( rImport, xAttrList, rShapes); break; } } @@ -435,104 +435,104 @@ SvXMLShapeContext* XMLShapeImportHelper::CreateGroupChildContext( case XML_TOK_GROUP_GROUP: { // draw:g inside group context (RECURSIVE) -pContext = new SdXMLGroupShapeContext( rImport, p_nPrefix, rLocalName, xAttrList, rShapes, bTemporaryShape); +pContext = new SdXMLGroupShapeContext( rImport, xAttrList, rShapes, bTemporaryShape); break; } case XML_TOK_GROUP_3DSCENE: { // dr3d:3dscene inside group context -pContext = new SdXML3DSceneShapeContext( rImport, p_nPrefix, rLocalName, xAttrList, rShapes, bTemporaryShape); +pContext = new SdXML3DSceneShapeContext( rImport, xAttrList, rShapes, bTemporaryShape); break; } case XML_TOK_GROUP_RECT: { // draw:rect inside group context -pContext = new SdXMLRectShapeContext( rImport,
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/table/XMLTableImport.hxx |3 +-- xmloff/source/draw/ximpshap.cxx |2 +- xmloff/source/table/XMLTableImport.cxx | 10 +- 3 files changed, 7 insertions(+), 8 deletions(-) New commits: commit bfaa753ae459a6eab8a216b1541faa8a805f3f50 Author: Noel AuthorDate: Thu Nov 19 15:53:00 2020 +0200 Commit: Noel Grandin CommitDate: Fri Nov 20 07:22:26 2020 +0100 simplify CreateTableContext Change-Id: I1700d17d6f3aa29fcc4a1ea33d8d797e67c301d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106168 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/table/XMLTableImport.hxx b/include/xmloff/table/XMLTableImport.hxx index cb6e2da7b48c..c0f702b5caaa 100644 --- a/include/xmloff/table/XMLTableImport.hxx +++ b/include/xmloff/table/XMLTableImport.hxx @@ -46,8 +46,7 @@ public: XMLTableImport( SvXMLImport& rImport, const rtl::Reference< XMLPropertySetMapper >& xCellPropertySetMapper, const rtl::Reference< XMLPropertyHandlerFactory >& xFactoryRef ); virtual ~XMLTableImport() override; -SvXMLImportContext* CreateTableContext( sal_uInt16 nPrfx, const OUString& rLName, -css::uno::Reference< css::table::XColumnRowRange > const & xColumnRowRange ); +SvXMLImportContext* CreateTableContext( css::uno::Reference< css::table::XColumnRowRange > const & xColumnRowRange ); SvXMLStyleContext* CreateTableTemplateContext( sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ); diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index dd46ab98a164..7558ff5e0c62 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -3981,7 +3981,7 @@ void SdXMLTableShapeContext::StartElement( const css::uno::Reference< css::xml:: xProps->getPropertyValue("Model"), uno::UNO_QUERY ); if( xColumnRowRange.is() ) -mxTableImportContext = xTableImport->CreateTableContext( GetPrefix(), GetLocalName(), xColumnRowRange ); +mxTableImportContext = xTableImport->CreateTableContext( xColumnRowRange ); if( mxTableImportContext.is() ) mxTableImportContext->StartElement( xAttrList ); diff --git a/xmloff/source/table/XMLTableImport.cxx b/xmloff/source/table/XMLTableImport.cxx index 8eb7a22f7be4..aa89732a4c81 100644 --- a/xmloff/source/table/XMLTableImport.cxx +++ b/xmloff/source/table/XMLTableImport.cxx @@ -96,7 +96,7 @@ typedef std::vector< std::shared_ptr< MergeInfo > > MergeInfoVector; class XMLTableImportContext : public SvXMLImportContext { public: -XMLTableImportContext( const rtl::Reference< XMLTableImport >& xThis, sal_uInt16 nPrfx, const OUString& rLName, Reference< XColumnRowRange > const & xColumnRowRange ); +XMLTableImportContext( const rtl::Reference< XMLTableImport >& xThis, Reference< XColumnRowRange > const & xColumnRowRange ); virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) override; @@ -227,10 +227,10 @@ XMLTableImport::~XMLTableImport() { } -SvXMLImportContext* XMLTableImport::CreateTableContext( sal_uInt16 nPrfx, const OUString& rLName, Reference< XColumnRowRange > const & xColumnRowRange ) +SvXMLImportContext* XMLTableImport::CreateTableContext( Reference< XColumnRowRange > const & xColumnRowRange ) { rtl::Reference< XMLTableImport > xThis( this ); -return new XMLTableImportContext( xThis, nPrfx, rLName, xColumnRowRange ); +return new XMLTableImportContext( xThis, xColumnRowRange ); } SvXMLStyleContext* XMLTableImport::CreateTableTemplateContext( sal_Int32 /*nElement*/, const Reference< XFastAttributeList >& /*xAttrList*/ ) @@ -358,8 +358,8 @@ void XMLTableImport::finishStyles() } -XMLTableImportContext::XMLTableImportContext( const rtl::Reference< XMLTableImport >& xImporter, sal_uInt16 nPrfx, const OUString& rLName, Reference< XColumnRowRange > const & xColumnRowRange ) -: SvXMLImportContext( xImporter->mrImport, nPrfx, rLName ) +XMLTableImportContext::XMLTableImportContext( const rtl::Reference< XMLTableImport >& xImporter, Reference< XColumnRowRange > const & xColumnRowRange ) +: SvXMLImportContext( xImporter->mrImport ) , mxTable( xColumnRowRange, UNO_QUERY ) , mxColumns( xColumnRowRange->getColumns() ) , mxRows( xColumnRowRange->getRows() ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/shapeimport.hxx|6 -- xmloff/source/chart/SchXMLAxisContext.cxx |4 - xmloff/source/chart/SchXMLAxisContext.hxx |2 xmloff/source/chart/SchXMLPlotAreaContext.cxx | 62 +++--- xmloff/source/chart/SchXMLPlotAreaContext.hxx | 13 + xmloff/source/chart/SchXMLSeries2Context.cxx |4 - xmloff/source/chart/SchXMLSeries2Context.hxx |2 xmloff/source/draw/ximp3dscene.cxx| 62 +++--- xmloff/source/draw/ximp3dscene.hxx|3 + 9 files changed, 79 insertions(+), 79 deletions(-) New commits: commit fecb0bbb7f7d899b8465c6e785c0a45496141b6e Author: Noel Grandin AuthorDate: Wed Nov 18 20:09:42 2020 +0200 Commit: Noel Grandin CommitDate: Thu Nov 19 09:55:37 2020 +0100 fastparser in SchXMLPlotAreaContext Change-Id: I77eab3ebacaca4c3327f60fac0970330fc9fe10b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106072 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/shapeimport.hxx b/include/xmloff/shapeimport.hxx index 810665d354ec..1dcb16ebe4e6 100644 --- a/include/xmloff/shapeimport.hxx +++ b/include/xmloff/shapeimport.hxx @@ -142,9 +142,7 @@ class SdXML3DLightContext final : public SvXMLImportContext public: SdXML3DLightContext( SvXMLImport& rImport, -sal_uInt16 nPrfx, -const OUString& rLName, -const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList); +const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList); virtual ~SdXML3DLightContext() override; sal_Int32 GetDiffuseColor() const { return maDiffuseColor; } @@ -185,7 +183,7 @@ public: SdXML3DSceneAttributesHelper( SvXMLImport& rImporter ); /** creates a 3d light context and adds it to the internal list for later processing */ -SvXMLImportContext * create3DLightContext( sal_uInt16 nPrfx, const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList); +SvXMLImportContext * create3DLightContext( const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList); /** this should be called for each scene attribute */ void processSceneAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ); diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx index ff4bd8d1066c..b4a6490e5a8d 100644 --- a/xmloff/source/chart/SchXMLAxisContext.cxx +++ b/xmloff/source/chart/SchXMLAxisContext.cxx @@ -101,7 +101,7 @@ private: } SchXMLAxisContext::SchXMLAxisContext( SchXMLImportHelper& rImpHelper, - SvXMLImport& rImport, const OUString& rLocalName, + SvXMLImport& rImport, Reference< chart::XDiagram > const & xDiagram, std::vector< SchXMLAxis >& rAxes, OUString & rCategoriesAddress, @@ -109,7 +109,7 @@ SchXMLAxisContext::SchXMLAxisContext( SchXMLImportHelper& rImpHelper, bool bAdaptWrongPercentScaleValues, bool bAdaptXAxisOrientationForOld2DBarCharts, bool& rbAxisPositionAttributeImported ) : -SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ), +SvXMLImportContext( rImport ), m_rImportHelper( rImpHelper ), m_xDiagram( xDiagram ), m_rAxes( rAxes ), diff --git a/xmloff/source/chart/SchXMLAxisContext.hxx b/xmloff/source/chart/SchXMLAxisContext.hxx index 4c2ab3d07539..8cb8f78098e9 100644 --- a/xmloff/source/chart/SchXMLAxisContext.hxx +++ b/xmloff/source/chart/SchXMLAxisContext.hxx @@ -31,7 +31,7 @@ class SchXMLAxisContext : public SvXMLImportContext { public: SchXMLAxisContext( SchXMLImportHelper& rImpHelper, - SvXMLImport& rImport, const OUString& rLocalName, + SvXMLImport& rImport, css::uno::Reference< css::chart::XDiagram > const & xDiagram, std::vector< SchXMLAxis >& aAxes, OUString& rCategoriesAddress, diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index 7c0f8e5add61..4da56fd0f43b 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -399,24 +399,22 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri } } -SvXMLImportContextRef SchXMLPlotAreaContext::CreateChildContext( -sal_uInt16 nPrefix, -const OUString& rLocalName, -const uno::Reference< xml::sax::XAttributeList >& xAttrList ) +css::uno::Reference< css::xml::sax::XFastContextHandler > SchXMLPlotAreaContext::createFastChildContext( +sal_Int32
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/SchXMLImportHelper.hxx |4 +--- xmloff/source/chart/SchXMLChartContext.cxx |4 ++-- xmloff/source/chart/SchXMLChartContext.hxx |2 +- xmloff/source/chart/SchXMLImport.cxx |6 ++ xmloff/source/chart/contexts.cxx |5 + xmloff/source/draw/ximpshap.cxx|2 +- 6 files changed, 8 insertions(+), 15 deletions(-) New commits: commit d828901d92c5c74627018dd84400d5de87b153af Author: Noel AuthorDate: Mon Nov 16 10:58:18 2020 +0200 Commit: Noel Grandin CommitDate: Mon Nov 16 12:18:37 2020 +0100 simplify CreateChartContext, remove unused params Change-Id: I91db68fa20e00ac6b7ec0c991016f4155c6ed70c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105915 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/SchXMLImportHelper.hxx b/include/xmloff/SchXMLImportHelper.hxx index 09031b2ccc21..f60c222cba50 100644 --- a/include/xmloff/SchXMLImportHelper.hxx +++ b/include/xmloff/SchXMLImportHelper.hxx @@ -83,9 +83,7 @@ public: */ SvXMLImportContext* CreateChartContext( SvXMLImport& rImport, -sal_uInt16 nPrefix, const OUString& rLocalName, -const css::uno::Reference< css::frame::XModel >& rChartModel, -const css::uno::Reference< css::xml::sax::XAttributeList >& rAttrList ); +const css::uno::Reference< css::frame::XModel >& rChartModel ); /** set the auto-style context that will be used to retrieve auto-styles used inside the following element to parse diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index b8ec262621f4..cbef46fa0ab0 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -221,8 +221,8 @@ uno::Sequence< sal_Int32 > lcl_getNumberSequenceFromString( const OUString& rStr } // anonymous namespace SchXMLChartContext::SchXMLChartContext( SchXMLImportHelper& rImpHelper, -SvXMLImport& rImport, const OUString& rLocalName ) : -SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ), +SvXMLImport& rImport ) : +SvXMLImportContext( rImport ), mrImportHelper( rImpHelper ), m_bHasRangeAtPlotArea( false ), m_bHasTableElement( false ), diff --git a/xmloff/source/chart/SchXMLChartContext.hxx b/xmloff/source/chart/SchXMLChartContext.hxx index 5081decd2412..afc15a16f12e 100644 --- a/xmloff/source/chart/SchXMLChartContext.hxx +++ b/xmloff/source/chart/SchXMLChartContext.hxx @@ -76,7 +76,7 @@ class SchXMLChartContext : public SvXMLImportContext { public: SchXMLChartContext( SchXMLImportHelper& rImpHelper, -SvXMLImport& rImport, const OUString& rLocalName ); +SvXMLImport& rImport ); virtual ~SchXMLChartContext() override; virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index 58a53724ed9e..53d10e349756 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -85,9 +85,7 @@ SchXMLImportHelper::SchXMLImportHelper() : SvXMLImportContext* SchXMLImportHelper::CreateChartContext( SvXMLImport& rImport, -sal_uInt16 /*nPrefix*/, const OUString& rLocalName, -const Reference< frame::XModel >& rChartModel, -const Reference< xml::sax::XAttributeList >& ) +const Reference< frame::XModel >& rChartModel ) { SvXMLImportContext* pContext = nullptr; @@ -95,7 +93,7 @@ SvXMLImportContext* SchXMLImportHelper::CreateChartContext( if( xDoc.is()) { mxChartDoc = xDoc; -pContext = new SchXMLChartContext( *this, rImport, rLocalName ); +pContext = new SchXMLChartContext( *this, rImport ); } else { diff --git a/xmloff/source/chart/contexts.cxx b/xmloff/source/chart/contexts.cxx index b39ba4efbfae..af016b4bfde2 100644 --- a/xmloff/source/chart/contexts.cxx +++ b/xmloff/source/chart/contexts.cxx @@ -170,10 +170,7 @@ SvXMLImportContextRef SchXMLBodyContext::CreateChildContext( if( nPrefix == XML_NAMESPACE_CHART && IsXMLToken( rLocalName, XML_CHART ) ) { -xContext = mrImportHelper.CreateChartContext( GetImport(), - nPrefix, rLocalName, - GetImport().GetModel(), - xAttrList ); +xContext = mrImportHelper.CreateChartContext( GetImport(), GetImport().GetModel() ); } else if(nPrefix == XML_NAMESPACE_TABLE && IsXMLToken( rLocalName, XML_CALCULATION_SETTINGS )) diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index cc75d01b80c6..dd46ab98a164 100644 ---
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/attrlist.hxx | 15 ++--- xmloff/source/core/attrlist.cxx | 110 +--- 2 files changed, 44 insertions(+), 81 deletions(-) New commits: commit 8523fb2b37a2cdd2c3743795bb33cf30a57c5385 Author: Noel Grandin AuthorDate: Wed Nov 4 08:04:24 2020 +0200 Commit: Noel Grandin CommitDate: Tue Nov 10 17:10:31 2020 +0100 remove pimpl from SvXMLAttributeList and add some asserts to catch bad index params Change-Id: I3551358282da2218a5a1a39eed63f8d358a6a118 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105278 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/attrlist.hxx b/include/xmloff/attrlist.hxx index d7993062f60f..7f4fef2b9544 100644 --- a/include/xmloff/attrlist.hxx +++ b/include/xmloff/attrlist.hxx @@ -28,17 +28,19 @@ #include #include -#include - -struct SvXMLAttributeList_Impl; +#include class XMLOFF_DLLPUBLIC SvXMLAttributeList final : public ::cppu::WeakImplHelper< css::xml::sax::XAttributeList, css::util::XCloneable, css::lang::XUnoTunnel> { -std::unique_ptr m_pImpl; - +struct SvXMLTagAttribute_Impl +{ +OUString sName; +OUString sValue; +}; +std::vector vecAttribute; public: SvXMLAttributeList(); SvXMLAttributeList( const SvXMLAttributeList& ); @@ -69,9 +71,6 @@ public: void RemoveAttributeByIndex( sal_Int16 i ); void RenameAttributeByIndex( sal_Int16 i, const OUString& rNewName ); sal_Int16 GetIndexByName( const OUString& rName ) const; - - private: -const OUString sType; // "CDATA" }; diff --git a/xmloff/source/core/attrlist.cxx b/xmloff/source/core/attrlist.cxx index 7a673bcdaad2..0a1956db8775 100644 --- a/xmloff/source/core/attrlist.cxx +++ b/xmloff/source/core/attrlist.cxx @@ -31,90 +31,58 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; -namespace { - -struct SvXMLTagAttribute_Impl -{ -SvXMLTagAttribute_Impl( const OUString , - const OUString ) -: sName(rName), -sValue(rValue) -{ -} - -OUString sName; -OUString sValue; -}; - -} - -struct SvXMLAttributeList_Impl -{ -SvXMLAttributeList_Impl() -{ -// performance improvement during adding -vecAttribute.reserve(20); -} - -::std::vector vecAttribute; -typedef ::std::vector::size_type size_type; -}; - - sal_Int16 SAL_CALL SvXMLAttributeList::getLength() { -return sal::static_int_cast< sal_Int16 >(m_pImpl->vecAttribute.size()); +return sal::static_int_cast< sal_Int16 >(vecAttribute.size()); } SvXMLAttributeList::SvXMLAttributeList( const SvXMLAttributeList ) : cppu::WeakImplHelper(r), -m_pImpl( new SvXMLAttributeList_Impl( *r.m_pImpl ) ) +vecAttribute( r.vecAttribute ) { } -SvXMLAttributeList::SvXMLAttributeList( const uno::Reference< -xml::sax::XAttributeList> & rAttrList ) -: m_pImpl( new SvXMLAttributeList_Impl), - sType( GetXMLToken(XML_CDATA) ) +SvXMLAttributeList::SvXMLAttributeList( const uno::Reference< xml::sax::XAttributeList> & rAttrList ) { - SvXMLAttributeList* pImpl = comphelper::getUnoTunnelImplementation( rAttrList ); if( pImpl ) -*m_pImpl = *(pImpl->m_pImpl); +vecAttribute = pImpl->vecAttribute; else AppendAttributeList( rAttrList ); } OUString SAL_CALL SvXMLAttributeList::getNameByIndex(sal_Int16 i) { -return ( o3tl::make_unsigned( i ) < m_pImpl->vecAttribute.size() ) ? m_pImpl->vecAttribute[i].sName : OUString(); +assert( o3tl::make_unsigned(i) < vecAttribute.size() ); +return ( o3tl::make_unsigned( i ) < vecAttribute.size() ) ? vecAttribute[i].sName : OUString(); } OUString SAL_CALL SvXMLAttributeList::getTypeByIndex(sal_Int16) { -return sType; +return "CDATA"; } OUString SAL_CALL SvXMLAttributeList::getValueByIndex(sal_Int16 i) { -return ( o3tl::make_unsigned( i ) < m_pImpl->vecAttribute.size() ) ? m_pImpl->vecAttribute[i].sValue : OUString(); +assert( o3tl::make_unsigned(i) < vecAttribute.size() ); +return ( o3tl::make_unsigned( i ) < vecAttribute.size() ) ? vecAttribute[i].sValue : OUString(); } OUString SAL_CALL SvXMLAttributeList::getTypeByName( const OUString& ) { -return sType; +return "CDATA"; } OUString SAL_CALL SvXMLAttributeList::getValueByName(const OUString& sName) { -auto ii = std::find_if(m_pImpl->vecAttribute.begin(), m_pImpl->vecAttribute.end(), -[](struct SvXMLTagAttribute_Impl& rAttr) { return rAttr.sName == sName; }); +auto ii = std::find_if(vecAttribute.begin(), vecAttribute.end(), +[](SvXMLTagAttribute_Impl& rAttr) { return rAttr.sName == sName; }); -if (ii != m_pImpl->vecAttribute.end()) +if (ii != vecAttribute.end()) return (*ii).sValue; return OUString(); @@ -129,9 +97,8 @@ uno::Reference< css::util::XCloneable >
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx |2 -- xmloff/source/core/xmlimp.cxx | 14 -- 2 files changed, 16 deletions(-) New commits: commit 3a2338ca6202525de958bc958b4e8531c96955a1 Author: Noel Grandin AuthorDate: Thu Oct 22 18:33:10 2020 +0200 Commit: Noel Grandin CommitDate: Fri Oct 23 08:49:19 2020 +0200 remove debug code from SvXMLImport accidentally committed in commit fe2b4e7dc6533535736a8f08496f316427386179 Date: Tue Oct 6 18:27:27 2020 +0200 make SvXMLImport fast-parser only Change-Id: I5fb46399f6e562cc289859ef13998dfafaae6a7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104693 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 43a5b5ca729a..bfc2cbeb028f 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -301,8 +301,6 @@ public: virtual ~SvXMLImport() throw() override; -virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& _rType ) override; - void startElement(const OUString& aName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttribs); void endElement(const OUString& aName); diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index fc79f79992b7..5a6bddd4192a 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -2162,20 +2162,6 @@ void SvXMLImport::NotifyMacroEventRead() mbNotifyMacroEventRead = true; } -css::uno::Any SvXMLImport::queryInterface(css::uno::Type const & aType) -{ -assert( aType != cppu::UnoType::get() ); -assert( aType != cppu::UnoType::get() ); -return cppu::WeakImplHelper< - css::xml::sax::XFastDocumentHandler, - css::lang::XServiceInfo, - css::lang::XInitialization, - css::document::XImporter, - css::document::XFilter, - css::lang::XUnoTunnel, - css::xml::sax::XFastParser>::queryInterface(aType); -} - SvXMLImportFastNamespaceHandler::SvXMLImportFastNamespaceHandler() { } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx |2 +- xmloff/source/core/xmlimp.cxx | 18 +- 2 files changed, 10 insertions(+), 10 deletions(-) New commits: commit 7b2d10068d43bf14efbe3ad18a15e0536e03a15e Author: Noel AuthorDate: Thu Oct 22 10:53:49 2020 +0200 Commit: Noel Grandin CommitDate: Thu Oct 22 18:58:12 2020 +0200 only need to check the version once Change-Id: Ie02ce5e7823a7564da919525f9cbdf4fc92072dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104649 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index edb437b8fa94..43a5b5ca729a 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -460,7 +460,7 @@ public: bool IsTableShapeSupported() const { return mbIsTableShapeSupported; } -OUString const & GetODFVersion() const; +OUString GetODFVersion() const; bool IsOOoXML() const; // legacy non-ODF format? /** diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 40d947bb87cf..fc79f79992b7 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -274,7 +274,7 @@ public: /// name of stream in package, e.g., "content.xml" OUString mStreamName; -OUString aODFVersion; +std::optional mxODFVersion; bool mbIsOOoXML; @@ -669,12 +669,12 @@ std::unique_ptr SvXMLImport::processNSAttributes( for( sal_Int16 i=0; i < nAttrCount; i++ ) { const OUString& rAttrName = xAttrList->getNameByIndex( i ); -if ( rAttrName == "office:version" ) +if ( rAttrName == "office:version" && !mpImpl->mxODFVersion ) { -mpImpl->aODFVersion = xAttrList->getValueByIndex( i ); +mpImpl->mxODFVersion = xAttrList->getValueByIndex( i ); // the ODF version in content.xml and manifest.xml must be the same starting from ODF1.2 -if ( mpImpl->mStreamName == "content.xml" && !IsODFVersionConsistent( mpImpl->aODFVersion ) ) +if ( mpImpl->mStreamName == "content.xml" && !IsODFVersionConsistent( *mpImpl->mxODFVersion ) ) { throw xml::sax::SAXException("Inconsistent ODF versions in content.xml and manifest.xml!", uno::Reference< uno::XInterface >(), @@ -844,17 +844,17 @@ void SAL_CALL SvXMLImport::setDocumentLocator( const uno::Reference< xml::sax::X void SAL_CALL SvXMLImport::startFastElement (sal_Int32 Element, const uno::Reference< xml::sax::XFastAttributeList > & Attribs) { -if ( Attribs.is() ) +if ( Attribs.is() && !mpImpl->mxODFVersion) { sax_fastparser::FastAttributeList& rAttribList = sax_fastparser::castToFastAttributeList( Attribs ); auto aIter( rAttribList.find( XML_ELEMENT( OFFICE, XML_VERSION ) ) ); if( aIter != rAttribList.end() ) { -mpImpl->aODFVersion = aIter.toString(); +mpImpl->mxODFVersion = aIter.toString(); // the ODF version in content.xml and manifest.xml must be the same starting from ODF1.2 -if ( mpImpl->mStreamName == "content.xml" && !IsODFVersionConsistent( mpImpl->aODFVersion ) ) +if ( mpImpl->mStreamName == "content.xml" && !IsODFVersionConsistent( *mpImpl->mxODFVersion ) ) { throw xml::sax::SAXException("Inconsistent ODF versions in content.xml and manifest.xml!", uno::Reference< uno::XInterface >(), @@ -1925,9 +1925,9 @@ bool SvXMLImport::isGeneratorVersionOlderThan( } -OUString const & SvXMLImport::GetODFVersion() const +OUString SvXMLImport::GetODFVersion() const { -return mpImpl->aODFVersion; +return mpImpl->mxODFVersion ? *mpImpl->mxODFVersion : OUString(); } bool SvXMLImport::IsOOoXML() const ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/txtimp.hxx |1 - xmloff/source/core/xmltkmap.cxx| 12 +--- xmloff/source/text/XMLTextFrameContext.cxx |6 +- xmloff/source/text/txtimp.cxx |1 - 4 files changed, 10 insertions(+), 10 deletions(-) New commits: commit e628b94ccf062c2f3161acef11012ae2f5fbc5a3 Author: Noel Grandin AuthorDate: Thu Sep 10 10:36:59 2020 +0200 Commit: Noel Grandin CommitDate: Fri Sep 11 14:35:23 2020 +0200 remove duplicate XML_TOK_TEXT_FRAME_FILTER_NAME which has been there ever since commit fd069bee7e57ad529c3c0974559fd2d84ec3151a Date: Mon Sep 18 16:07:07 2000 + initial import And add assert to prevent more duplicates Change-Id: I371a117896c1ab36fabf69da41229a7bcf5459d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102366 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx index 0eb09e6f580c..f2585b4259eb 100644 --- a/include/xmloff/txtimp.hxx +++ b/include/xmloff/txtimp.hxx @@ -291,7 +291,6 @@ enum XMLTextFrameAttrTokens XML_TOK_TEXT_FRAME_REL_HEIGHT, XML_TOK_TEXT_FRAME_NEXT_CHAIN_NAME, XML_TOK_TEXT_FRAME_HREF, -XML_TOK_TEXT_FRAME_FILTER_NAME, XML_TOK_TEXT_FRAME_Z_INDEX, XML_TOK_TEXT_FRAME_TRANSFORM, XML_TOK_TEXT_FRAME_CLASS_ID, diff --git a/xmloff/source/core/xmltkmap.cxx b/xmloff/source/core/xmltkmap.cxx index d89eb9621638..bf61a37488f4 100644 --- a/xmloff/source/core/xmltkmap.cxx +++ b/xmloff/source/core/xmltkmap.cxx @@ -52,10 +52,16 @@ public: void SvXMLTokenMap_Impl::insert( const SvXMLTokenMapEntry& rEntry ) { -m_aPrefixAndNameToTokenMap.insert( std::make_pair( std::make_pair( rEntry.nPrefixKey, - GetXMLToken( rEntry.eLocalName ) ), rEntry.nToken ) ); +bool inserted = m_aPrefixAndNameToTokenMap.insert( std::make_pair( std::make_pair( rEntry.nPrefixKey, + GetXMLToken( rEntry.eLocalName ) ), rEntry.nToken ) ).second; +assert(inserted && "duplicate token"); +(void)inserted; if( rEntry.nFastToken ) -m_aFastTokenToTokenMap.insert( std::make_pair( rEntry.nFastToken, rEntry.nToken ) ); +{ +bool inserted2 = m_aFastTokenToTokenMap.insert( std::make_pair( rEntry.nFastToken, rEntry.nToken ) ).second; +assert(inserted2 && "duplicate token"); +(void)inserted2; +} } sal_uInt16 SvXMLTokenMap_Impl::get( sal_uInt16 nKeyPrefix, const OUString& rLName ) const diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index 58988bae259c..7ab210dbd938 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -355,7 +355,6 @@ class XMLTextFrameContext_Impl : public SvXMLImportContext OUString sStyleName; OUString sNextName; OUString sHRef; -OUString sFilterName; OUString sCode; OUString sMimeType; OUString sFrameName; @@ -689,7 +688,7 @@ void XMLTextFrameContext_Impl::Create() xPropSet->setPropertyValue("Graphic", Any(xGraphic)); // filter name -xPropSet->setPropertyValue( "GraphicFilter", Any(sFilterName) ); +xPropSet->setPropertyValue( "GraphicFilter", Any(OUString()) ); // rotation xPropSet->setPropertyValue( "GraphicRotation", Any(nRotation) ); @@ -1015,9 +1014,6 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( case XML_TOK_TEXT_FRAME_HREF: sHRef = rValue; break; -case XML_TOK_TEXT_FRAME_FILTER_NAME: -sFilterName = rValue; -break; case XML_TOK_TEXT_FRAME_TRANSFORM: { // RotateFlyFrameFix: im/export full 'draw:transform' using existing tooling diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 73e6b61d853d..75e73c899171 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -372,7 +372,6 @@ const SvXMLTokenMapEntry aTextFrameAttrTokenMap[] = { XML_NAMESPACE_STYLE, XML_REL_HEIGHT, XML_TOK_TEXT_FRAME_REL_HEIGHT }, { XML_NAMESPACE_DRAW, XML_CHAIN_NEXT_NAME, XML_TOK_TEXT_FRAME_NEXT_CHAIN_NAME }, { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_TEXT_FRAME_HREF }, -{ XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_TEXT_FRAME_FILTER_NAME }, { XML_NAMESPACE_DRAW, XML_ZINDEX, XML_TOK_TEXT_FRAME_Z_INDEX }, { XML_NAMESPACE_DRAW, XML_TRANSFORM, XML_TOK_TEXT_FRAME_TRANSFORM }, { XML_NAMESPACE_DRAW, XML_CLASS_ID, XML_TOK_TEXT_FRAME_CLASS_ID }, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/contextid.hxx |5 - xmloff/source/style/xmlimppr.cxx | 137 ++- 2 files changed, 64 insertions(+), 78 deletions(-) New commits: commit 17d6ee0c45dcaff8aa12f7b975587820be62b7c8 Author: Noel Grandin AuthorDate: Tue Sep 1 15:57:02 2020 +0200 Commit: Noel Grandin CommitDate: Wed Sep 2 08:28:34 2020 +0200 remove dead CTF_ALIEN_ATTRIBUTE_IMPORT ever since commit 9a081484321b3f42bee3b43d18c4bd75b9603b01 Date: Fri Sep 14 13:42:47 2012 +0200 fdo#49571: ODF import: ignore "text:enable-numbering" attribute Change-Id: Id90b9aa0feafc3d7427558d3a2394c4958111434 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101849 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/contextid.hxx b/include/xmloff/contextid.hxx index bf6cb1e4c134..654641f320e8 100644 --- a/include/xmloff/contextid.hxx +++ b/include/xmloff/contextid.hxx @@ -38,11 +38,6 @@ #define CTF_FORMS_DATA_STYLE( XML_FORM_CTF_START + 0 ) -/** use together with MID_FLAG_NO_PROPERTY to import the specified -attribute into the alien attribute container */ - -#define CTF_ALIEN_ATTRIBUTE_IMPORT 0x7fff - #endif // INCLUDED_XMLOFF_CONTEXTID_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx index adc23848b542..8607e9c9fa2d 100644 --- a/xmloff/source/style/xmlimppr.cxx +++ b/xmloff/source/style/xmlimppr.cxx @@ -183,7 +183,6 @@ void SvXMLImportPropertyMapper::importXMLAttribute( // for better error reporting: this should be set true if no // warning is needed bool bNoWarning = false; -bool bAlienImport = false; do { @@ -196,100 +195,92 @@ void SvXMLImportPropertyMapper::importXMLAttribute( // 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) ) +if( ( nFlags & MID_FLAG_ELEMENT_ITEM_IMPORT ) == 0 ) { -bAlienImport = true; -nIndex = -1; -} -else -{ -if( ( nFlags & MID_FLAG_ELEMENT_ITEM_IMPORT ) == 0 ) -{ -XMLPropertyState aNewProperty( nIndex ); -sal_Int32 nReference = -1; +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 ) +// 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++ ) { -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 )) { -sal_Int32 nRefIdx = rProperties[nReference].mnIndex; -if( (nRefIdx != -1) && (nIndex != nRefIdx) && -(maPropMapper->GetEntryAPIName( nRefIdx ) == aAPIName )) -{ -aNewProperty = rProperties[nReference]; -aNewProperty.mnIndex = nIndex; -break; -} +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( sValue, aNewProperty, -
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/formlayerimport.hxx |4 ++-- xmloff/source/forms/formlayerimport.cxx |4 ++-- xmloff/source/forms/layerimport.cxx |6 +++--- xmloff/source/forms/layerimport.hxx |2 +- 4 files changed, 8 insertions(+), 8 deletions(-) New commits: commit 0edc370ac57860513a80992157f70aeea7a3b229 Author: Andrea Gelmini AuthorDate: Mon Aug 31 16:03:19 2020 +0200 Commit: Julien Nabet CommitDate: Tue Sep 1 15:28:58 2020 +0200 Fix typo in code It passed "make check" on Linux Change-Id: I8bcc1598c7b885a025dd990eb2f75551e15b5c13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101794 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/include/xmloff/formlayerimport.hxx b/include/xmloff/formlayerimport.hxx index 5d3b25948ae6..4834f85d19d9 100644 --- a/include/xmloff/formlayerimport.hxx +++ b/include/xmloff/formlayerimport.hxx @@ -109,12 +109,12 @@ namespace xmloff /** sets the given number style on the given control @param _rxControlModel the control model which's style is to be set -@param _rControlNumerStyleName +@param _rControlNumberStyleName the style name for the control's number style */ void applyControlNumberStyle( const css::uno::Reference< css::beans::XPropertySet >& _rxControlModel, -const OUString& _rControlNumerStyleName +const OUString& _rControlNumberStyleName ); /** to be called when the document has been completely imported diff --git a/xmloff/source/forms/formlayerimport.cxx b/xmloff/source/forms/formlayerimport.cxx index a8d8848a1df8..848b815f6703 100644 --- a/xmloff/source/forms/formlayerimport.cxx +++ b/xmloff/source/forms/formlayerimport.cxx @@ -73,9 +73,9 @@ namespace xmloff return m_pImpl->createContext(_nPrefix, _rLocalName, _rxAttribs); } -void OFormLayerXMLImport::applyControlNumberStyle(const Reference< XPropertySet >& _rxControlModel, const OUString& _rControlNumerStyleName) +void OFormLayerXMLImport::applyControlNumberStyle(const Reference< XPropertySet >& _rxControlModel, const OUString& _rControlNumberStyleName) { -m_pImpl->applyControlNumberStyle(_rxControlModel, _rControlNumerStyleName); +m_pImpl->applyControlNumberStyle(_rxControlModel, _rControlNumberStyleName); } void OFormLayerXMLImport::documentDone( ) diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx index 90b9c018e11a..39b862c9bb92 100644 --- a/xmloff/source/forms/layerimport.cxx +++ b/xmloff/source/forms/layerimport.cxx @@ -222,9 +222,9 @@ void OFormLayerXMLImport_Impl::setAutoStyleContext(SvXMLStylesContext* _pNewCont m_xAutoStyles.set(_pNewContext); } -void OFormLayerXMLImport_Impl::applyControlNumberStyle(const Reference< XPropertySet >& _rxControlModel, const OUString& _rControlNumerStyleName) +void OFormLayerXMLImport_Impl::applyControlNumberStyle(const Reference< XPropertySet >& _rxControlModel, const OUString& _rControlNumberStyleName) { -OSL_ENSURE(_rxControlModel.is() && (!_rControlNumerStyleName.isEmpty()), +OSL_ENSURE(_rxControlModel.is() && (!_rControlNumberStyleName.isEmpty()), "OFormLayerXMLImport_Impl::applyControlNumberStyle: invalid arguments (this will crash)!"); OSL_ENSURE(m_xAutoStyles.is(), "OFormLayerXMLImport_Impl::applyControlNumberStyle: have no auto style context!"); @@ -236,7 +236,7 @@ void OFormLayerXMLImport_Impl::applyControlNumberStyle(const Reference< XPropert if (!m_xAutoStyles.is()) return; -const SvXMLStyleContext* pStyle = m_xAutoStyles->FindStyleChildContext(XmlStyleFamily::DATA_STYLE, _rControlNumerStyleName); +const SvXMLStyleContext* pStyle = m_xAutoStyles->FindStyleChildContext(XmlStyleFamily::DATA_STYLE, _rControlNumberStyleName); if (pStyle) { const SvXMLNumFormatContext* pDataStyle = static_cast(pStyle); diff --git a/xmloff/source/forms/layerimport.hxx b/xmloff/source/forms/layerimport.hxx index 6913803384af..c21523054d1c 100644 --- a/xmloff/source/forms/layerimport.hxx +++ b/xmloff/source/forms/layerimport.hxx @@ -99,7 +99,7 @@ namespace xmloff voidleaveEventContext(); voidapplyControlNumberStyle( const css::uno::Reference< css::beans::XPropertySet >& _rxControlModel, -const OUString& _rControlNumerStyleName +const OUString& _rControlNumberStyleName ); voidregisterCellValueBinding( const css::uno::Reference< css::beans::XPropertySet >& _rxControlModel, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/SettingsExportHelper.hxx|2 +- xmloff/source/core/DocumentSettingsContext.cxx |4 ++-- xmloff/source/core/SettingsExportHelper.cxx|8 3 files changed, 7 insertions(+), 7 deletions(-) New commits: commit 139f06fb3bc559f7773ddd8ccf15c133eeac7317 Author: Andrea Gelmini AuthorDate: Mon Aug 31 15:48:24 2020 +0200 Commit: Julien Nabet CommitDate: Tue Sep 1 08:50:38 2020 +0200 Fix typo in code It passed "make check" on Linux Change-Id: I5aff28a8d241441335d4cede12a013384945aa9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101789 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/include/xmloff/SettingsExportHelper.hxx b/include/xmloff/SettingsExportHelper.hxx index 0937935a9c39..784c8dd67075 100644 --- a/include/xmloff/SettingsExportHelper.hxx +++ b/include/xmloff/SettingsExportHelper.hxx @@ -45,7 +45,7 @@ class XMLOFF_DLLPUBLIC XMLSettingsExportHelper { ::xmloff::XMLSettingsExportContext& m_rContext; -css::uno::Reference< css::util::XStringSubstitution > mxStringSubsitution; +css::uno::Reference< css::util::XStringSubstitution > mxStringSubstitution; void ManipulateSetting( css::uno::Any& rAny, const OUString& rName ) const; diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx index c91499e75605..96313067a491 100644 --- a/xmloff/source/core/DocumentSettingsContext.cxx +++ b/xmloff/source/core/DocumentSettingsContext.cxx @@ -517,11 +517,11 @@ void XMLConfigItemContext::ManipulateConfigItem() try { uno::Reference< uno::XComponentContext > xContext( GetImport().GetComponentContext() ); -uno::Reference< util::XStringSubstitution > xStringSubsitution( util::PathSubstitution::create(xContext) ); +uno::Reference< util::XStringSubstitution > xStringSubstitution( util::PathSubstitution::create(xContext) ); OUString aURL; mrAny >>= aURL; -aURL = xStringSubsitution->substituteVariables( aURL, false ); +aURL = xStringSubstitution->substituteVariables( aURL, false ); mrAny <<= aURL; } catch( uno::Exception& ) diff --git a/xmloff/source/core/SettingsExportHelper.cxx b/xmloff/source/core/SettingsExportHelper.cxx index 853db459e374..fbabfe5df775 100644 --- a/xmloff/source/core/SettingsExportHelper.cxx +++ b/xmloff/source/core/SettingsExportHelper.cxx @@ -491,11 +491,11 @@ void XMLSettingsExportHelper::ManipulateSetting( uno::Any& rAny, const OUString& else if( (rName == gsColorTableURL) || (rName == gsLineEndTableURL) || (rName == gsHatchTableURL) || (rName == gsDashTableURL) || (rName == gsGradientTableURL) || (rName == gsBitmapTableURL ) ) { -if( !mxStringSubsitution.is() ) +if( !mxStringSubstitution.is() ) { try { -const_cast< XMLSettingsExportHelper* >(this)->mxStringSubsitution = +const_cast< XMLSettingsExportHelper* >(this)->mxStringSubstitution = util::PathSubstitution::create( m_rContext.GetComponentContext() ); } catch( uno::Exception& ) @@ -504,11 +504,11 @@ void XMLSettingsExportHelper::ManipulateSetting( uno::Any& rAny, const OUString& } } -if( mxStringSubsitution.is() ) +if( mxStringSubstitution.is() ) { OUString aURL; rAny >>= aURL; -aURL = mxStringSubsitution->reSubstituteVariables( aURL ); +aURL = mxStringSubstitution->reSubstituteVariables( aURL ); rAny <<= aURL; } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx|1 + include/xmloff/xmlnumfi.hxx |5 ++--- xmloff/source/core/xmlimp.cxx| 23 --- xmloff/source/style/xmlnumfi.cxx |8 4 files changed, 19 insertions(+), 18 deletions(-) New commits: commit 5c38aa445986ee8650324412b2a78e68014101ac Author: Noel Grandin AuthorDate: Fri Aug 28 11:46:26 2020 +0200 Commit: Noel Grandin CommitDate: Fri Aug 28 21:03:49 2020 +0200 use more fast-parser in SvXMLNumFormatContext Change-Id: Ib0389fa53ce2516cdd1f9ad8e68d9209455b4359 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101534 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 3b4cc7969be9..0f40ef548ceb 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -397,6 +397,7 @@ public: static OUString getNamespacePrefixFromToken(sal_Int32 nToken, const SvXMLNamespaceMap* pMap); static OUString getNamespaceURIFromToken( sal_Int32 nToken ); static OUString getNamespacePrefixFromURI( const OUString& rURI ); +static sal_Int32 getTokenFromName(const OUString& sName); SvXMLNamespaceMap& GetNamespaceMap() { return *mpNamespaceMap; } const SvXMLNamespaceMap& GetNamespaceMap() const { return *mpNamespaceMap; } diff --git a/include/xmloff/xmlnumfi.hxx b/include/xmloff/xmlnumfi.hxx index f0eb16b728fa..2e0b258fd24c 100644 --- a/include/xmloff/xmlnumfi.hxx +++ b/include/xmloff/xmlnumfi.hxx @@ -159,9 +159,8 @@ public: const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList, SvXMLStylesContext& rStyles ); SvXMLNumFormatContext( SvXMLImport& rImport, -sal_uInt16 nPrfx, -const OUString& rLName, -const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList, +const OUString& rName, +const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList, const sal_Int32 nKey, LanguageType nLang, SvXMLStylesContext& rStyles ); diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 8fbc4a9d5d8c..cf8b32c054e2 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -1637,7 +1637,7 @@ void SvXMLImport::SetAutoStyles( SvXMLStylesContext *pAutoStyles ) { if (pAutoStyles && mxNumberStyles.is()) { -uno::Reference xAttrList; +uno::Reference xAttrList = new sax_fastparser::FastAttributeList(nullptr); const uno::Sequence aStyleNames = mxNumberStyles->getElementNames(); for (const auto& name : aStyleNames) { @@ -1646,7 +1646,7 @@ void SvXMLImport::SetAutoStyles( SvXMLStylesContext *pAutoStyles ) if (aAny >>= nKey) { SvXMLStyleContext* pContext = new SvXMLNumFormatContext( -*this, XML_NAMESPACE_NUMBER, name, xAttrList, nKey, +*this, name, xAttrList, nKey, GetDataStylesImport()->GetLanguageForKey(nKey), *pAutoStyles); pAutoStyles->AddStyle(*pContext); } @@ -2080,6 +2080,13 @@ OUString SvXMLImport::getNamespacePrefixFromURI( const OUString& rURI ) return OUString(); } +sal_Int32 SvXMLImport::getTokenFromName( const OUString& rName ) +{ +Sequence< sal_Int8 > aLocalNameSeq( reinterpret_cast( +OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ).getStr()), rName.getLength() ); +return xTokenHandler->getTokenFromUTF8( aLocalNameSeq ); +} + void SvXMLImport::initializeNamespaceMaps() { auto mapTokenToNamespace = [&]( sal_Int32 nToken, sal_Int32 nPrefix, sal_Int32 nNamespace ) @@ -2255,9 +2262,7 @@ void SAL_CALL SvXMLLegacyToFastDocHandler::startElement( const OUString& rName, mrImport->processNSAttributes(xAttrList); OUString aLocalName; sal_uInt16 nPrefix = mrImport->mpNamespaceMap->GetKeyByAttrName( rName, ); -Sequence< sal_Int8 > aLocalNameSeq( reinterpret_cast( -OUStringToOString( aLocalName, RTL_TEXTENCODING_UTF8 ).getStr()), aLocalName.getLength() ); -sal_Int32 mnElement = NAMESPACE_TOKEN( nPrefix ) | SvXMLImport::xTokenHandler->getTokenFromUTF8( aLocalNameSeq ); +sal_Int32 mnElement = NAMESPACE_TOKEN( nPrefix ) | SvXMLImport::getTokenFromName( aLocalName ); mxFastAttributes->clear(); sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; @@ -2271,9 +2276,7 @@ void SAL_CALL SvXMLLegacyToFastDocHandler::startElement( const OUString& rName, rAttrName, nullptr, , )); if( XML_NAMESPACE_XMLNS != nAttrPrefix ) { -
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/XMLShapeStyleContext.hxx |7 include/xmloff/XMLTextShapeStyleContext.hxx |4 -- xmloff/source/draw/XMLShapeStyleContext.cxx | 12 xmloff/source/draw/ximpstyl.cxx | 35 +--- xmloff/source/draw/ximpstyl.hxx |3 -- xmloff/source/text/XMLTextShapeStyleContext.cxx | 10 -- 6 files changed, 8 insertions(+), 63 deletions(-) New commits: commit 5f691db859b277fb7f185cddeace981169e1180e Author: Noel Grandin AuthorDate: Wed Aug 26 10:02:56 2020 +0200 Commit: Noel Grandin CommitDate: Wed Aug 26 11:46:12 2020 +0200 use more fastparser in SdXMLMasterPageContext and drop some unused code Change-Id: I4ed57ab843759e2214ad2b679003fcc329c073ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101382 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/XMLShapeStyleContext.hxx b/include/xmloff/XMLShapeStyleContext.hxx index 4a7eef147b36..93e0ffa72031 100644 --- a/include/xmloff/XMLShapeStyleContext.hxx +++ b/include/xmloff/XMLShapeStyleContext.hxx @@ -42,13 +42,6 @@ protected: const OUString& rValue ) override; public: -XMLShapeStyleContext( -SvXMLImport& rImport, -sal_uInt16 nPrfx, -const OUString& rLName, -const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, -SvXMLStylesContext& rStyles, -XmlStyleFamily nFamily); XMLShapeStyleContext( SvXMLImport& rImport, sal_Int32 nElement, diff --git a/include/xmloff/XMLTextShapeStyleContext.hxx b/include/xmloff/XMLTextShapeStyleContext.hxx index 2e21c1846309..531e81da0377 100644 --- a/include/xmloff/XMLTextShapeStyleContext.hxx +++ b/include/xmloff/XMLTextShapeStyleContext.hxx @@ -36,10 +36,6 @@ class XMLOFF_DLLPUBLIC XMLTextShapeStyleContext final : public XMLShapeStyleCont public: -XMLTextShapeStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, -const OUString& rLName, -const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, -SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ); XMLTextShapeStyleContext( SvXMLImport& rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList, SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ); diff --git a/xmloff/source/draw/XMLShapeStyleContext.cxx b/xmloff/source/draw/XMLShapeStyleContext.cxx index beddcb202321..b10ef865ec2d 100644 --- a/xmloff/source/draw/XMLShapeStyleContext.cxx +++ b/xmloff/source/draw/XMLShapeStyleContext.cxx @@ -48,18 +48,6 @@ using ::xmloff::token::XML_GRAPHIC_PROPERTIES; using ::xmloff::token::XML_PARAGRAPH_PROPERTIES; -XMLShapeStyleContext::XMLShapeStyleContext( -SvXMLImport& rImport, -sal_uInt16 nPrfx, -const OUString& rLName, -const uno::Reference< xml::sax::XAttributeList >& xAttrList, -SvXMLStylesContext& rStyles, -XmlStyleFamily nFamily) -: XMLPropStyleContext(rImport, nPrfx, rLName, xAttrList, rStyles, nFamily ), -m_bIsNumRuleAlreadyConverted( false ) -{ -} - XMLShapeStyleContext::XMLShapeStyleContext( SvXMLImport& rImport, sal_Int32 nElement, diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index 82eac74740cd..66db57439674 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -825,48 +825,29 @@ void SdXMLMasterPageContext::endFastElement(sal_Int32 nElement) GetImport().GetShapeImport()->endPage(GetLocalShapesContext()); } -SvXMLImportContextRef SdXMLMasterPageContext::CreateChildContext( -sal_uInt16 nPrefix, -const OUString& rLocalName, -const uno::Reference< xml::sax::XAttributeList>& xAttrList ) +css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLMasterPageContext::createFastChildContext( +sal_Int32 nElement, +const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) { -SvXMLImportContextRef xContext; -const SvXMLTokenMap& rTokenMap = GetSdImport().GetMasterPageElemTokenMap(); - -// some special objects inside style:masterpage context -switch(rTokenMap.Get(nPrefix, rLocalName)) +switch (nElement) { -case XML_TOK_MASTERPAGE_STYLE: +// some special objects inside style:masterpage context +case XML_ELEMENT(STYLE, XML_STYLE): { if(GetSdImport().GetShapeImport()->GetStylesContext()) { // style:style inside master-page context -> presentation style XMLShapeStyleContext* pNew = new XMLShapeStyleContext( -GetSdImport(), nPrefix, rLocalName, xAttrList, +GetSdImport(), nElement, xAttrList, *GetSdImport().GetShapeImport()->GetStylesContext(), XmlStyleFamily::SD_PRESENTATION_ID); // add
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/XMLDrawingPageStyleContext.hxx |5 ++ include/xmloff/XMLShapeStyleContext.hxx |6 ++ xmloff/source/draw/XMLShapeStyleContext.cxx | 11 xmloff/source/draw/ximpstyl.cxx | 58 +- xmloff/source/draw/ximpstyl.hxx | 12 ++--- 5 files changed, 57 insertions(+), 35 deletions(-) New commits: commit 2501bb3a9a142f62903cd0f20bafd96e2cea45fe Author: Noel Grandin AuthorDate: Tue Aug 25 15:31:46 2020 +0200 Commit: Noel Grandin CommitDate: Wed Aug 26 07:52:52 2020 +0200 use fastparser in SdXMLStylesContext Change-Id: I5cf46f6ba8366c92a18d1cc00eb7eebf8ae82be6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101343 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/XMLDrawingPageStyleContext.hxx b/include/xmloff/XMLDrawingPageStyleContext.hxx index ffc0a62998a5..22fa6f88f041 100644 --- a/include/xmloff/XMLDrawingPageStyleContext.hxx +++ b/include/xmloff/XMLDrawingPageStyleContext.hxx @@ -32,6 +32,11 @@ public: SvXMLStylesContext& rStyles, ContextID_Index_Pair const pContextIDs[], XmlStyleFamily const pFamilies[]); +XMLDrawingPageStyleContext( +SvXMLImport& rImport, sal_Int32 nElement, +css::uno::Reference const& xAttrList, +SvXMLStylesContext& rStyles, ContextID_Index_Pair const pContextIDs[], +XmlStyleFamily const pFamilies[]); virtual void FillPropertySet(css::uno::Reference const& rPropSet) override; diff --git a/include/xmloff/XMLShapeStyleContext.hxx b/include/xmloff/XMLShapeStyleContext.hxx index 96ae15ce8cde..4a7eef147b36 100644 --- a/include/xmloff/XMLShapeStyleContext.hxx +++ b/include/xmloff/XMLShapeStyleContext.hxx @@ -49,6 +49,12 @@ public: const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, SvXMLStylesContext& rStyles, XmlStyleFamily nFamily); +XMLShapeStyleContext( +SvXMLImport& rImport, +sal_Int32 nElement, +const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList, +SvXMLStylesContext& rStyles, +XmlStyleFamily nFamily); virtual ~XMLShapeStyleContext() override; SvXMLImportContextRef CreateChildContext( diff --git a/xmloff/source/draw/XMLShapeStyleContext.cxx b/xmloff/source/draw/XMLShapeStyleContext.cxx index bcde133252bb..beddcb202321 100644 --- a/xmloff/source/draw/XMLShapeStyleContext.cxx +++ b/xmloff/source/draw/XMLShapeStyleContext.cxx @@ -60,6 +60,17 @@ XMLShapeStyleContext::XMLShapeStyleContext( { } +XMLShapeStyleContext::XMLShapeStyleContext( +SvXMLImport& rImport, +sal_Int32 nElement, +const uno::Reference< xml::sax::XFastAttributeList >& xAttrList, +SvXMLStylesContext& rStyles, +XmlStyleFamily nFamily) +: XMLPropStyleContext(rImport, nElement, xAttrList, rStyles, nFamily ), +m_bIsNumRuleAlreadyConverted( false ) +{ +} + XMLShapeStyleContext::~XMLShapeStyleContext() { } diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index 6e9bdeb94e29..82eac74740cd 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -137,9 +137,8 @@ public: SdXMLDrawingPageStyleContext( SvXMLImport& rImport, -sal_uInt16 nPrfx, -const OUString& rLName, -const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, +sal_Int32 nElement, +const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList, SvXMLStylesContext& rStyles); SvXMLImportContextRef CreateChildContext( @@ -192,13 +191,28 @@ XMLDrawingPageStyleContext::XMLDrawingPageStyleContext( std::memcpy(m_pContextIDs.get(), pContextIDs, size * sizeof(ContextID_Index_Pair)); } +XMLDrawingPageStyleContext::XMLDrawingPageStyleContext( +SvXMLImport& rImport, +sal_Int32 nElement, +const uno::Reference< xml::sax::XFastAttributeList >& xAttrList, +SvXMLStylesContext& rStyles, +ContextID_Index_Pair const pContextIDs[], +XmlStyleFamily const pFamilies[]) +: XMLPropStyleContext(rImport, nElement, xAttrList, rStyles, XmlStyleFamily::SD_DRAWINGPAGE_ID) +, m_pFamilies(pFamilies) +{ +size_t size(1); // for the -1 entry +for (ContextID_Index_Pair const* pTemp(pContextIDs); pTemp->nContextID != -1; ++size, ++pTemp); +m_pContextIDs.reset(new ContextID_Index_Pair[size]); +std::memcpy(m_pContextIDs.get(), pContextIDs, size * sizeof(ContextID_Index_Pair)); +} + SdXMLDrawingPageStyleContext::SdXMLDrawingPageStyleContext( SvXMLImport& rImport, -sal_uInt16 nPrfx, -const OUString& rLName, -const uno::Reference< xml::sax::XAttributeList >& xAttrList, +sal_Int32 nElement, +const uno::Reference< xml::sax::XFastAttributeList >& xAttrList, SvXMLStylesContext& rStyles) -:
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/XMLFontStylesContext.hxx |5 - xmloff/source/style/XMLFontStylesContext.cxx | 95 ++ xmloff/source/style/XMLFontStylesContext_impl.hxx | 46 -- 3 files changed, 68 insertions(+), 78 deletions(-) New commits: commit 9f514aae04933b6bc677c178e982cabb9be7ab14 Author: Noel Grandin AuthorDate: Tue Aug 25 08:35:28 2020 +0200 Commit: Noel Grandin CommitDate: Tue Aug 25 11:17:38 2020 +0200 use fastparser in XMLFontStylesContext Change-Id: I122216400ae5f97bc2a757146f84f146ba92afb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101303 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/XMLFontStylesContext.hxx b/include/xmloff/XMLFontStylesContext.hxx index 3aad7826bcc3..3094ac191365 100644 --- a/include/xmloff/XMLFontStylesContext.hxx +++ b/include/xmloff/XMLFontStylesContext.hxx @@ -46,9 +46,8 @@ class XMLOFF_DLLPUBLIC XMLFontStylesContext final : public SvXMLStylesContext rtl_TextEncodingeDfltEncoding; using SvXMLStylesContext::CreateStyleChildContext; -virtual SvXMLStyleContext *CreateStyleChildContext( sal_uInt16 nPrefix, -const OUString& rLocalName, -const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; +virtual SvXMLStyleContext *CreateStyleChildContext( sal_Int32 nElement, +const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override; public: diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx index e17b79bd6ecb..7a9d36a7cac5 100644 --- a/xmloff/source/style/XMLFontStylesContext.cxx +++ b/xmloff/source/style/XMLFontStylesContext.cxx @@ -85,10 +85,10 @@ static const SvXMLTokenMapEntry* lcl_getFontStyleAttrTokenMap() XMLFontStyleContextFontFace::XMLFontStyleContextFontFace( SvXMLImport& rImport, -sal_uInt16 nPrfx, const OUString& rLName, -const Reference< XAttributeList > & xAttrList, +sal_Int32 nElement, +const Reference< XFastAttributeList > & xAttrList, XMLFontStylesContext& rStyles ) : -SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, XML_STYLE_FAMILY_FONT ), +SvXMLStyleContext( rImport, nElement, xAttrList, XML_STYLE_FAMILY_FONT ), xStyles( ) { aFamilyName <<= OUString(); @@ -176,13 +176,15 @@ void XMLFontStyleContextFontFace::FillProperties( } } -SvXMLImportContextRef XMLFontStyleContextFontFace::CreateChildContext( -sal_uInt16 nPrefix, -const OUString& rLocalName, -const css::uno::Reference< css::xml::sax::XAttributeList > & ) +css::uno::Reference< css::xml::sax::XFastContextHandler > XMLFontStyleContextFontFace::createFastChildContext( +sal_Int32 nElement, +const css::uno::Reference< css::xml::sax::XFastAttributeList > & ) { -if( nPrefix == XML_NAMESPACE_SVG && IsXMLToken( rLocalName, XML_FONT_FACE_SRC )) -return new XMLFontStyleContextFontFaceSrc( GetImport(), nPrefix, rLocalName, *this ); +if( nElement == XML_ELEMENT(SVG, XML_FONT_FACE_SRC) || +nElement == XML_ELEMENT(SVG_COMPAT, XML_FONT_FACE_SRC) ) +return new XMLFontStyleContextFontFaceSrc( GetImport(), *this ); +else +SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement)); return nullptr; } @@ -195,10 +197,10 @@ OUString XMLFontStyleContextFontFace::familyName() const XMLFontStyleContextFontFaceFormat::XMLFontStyleContextFontFaceFormat( SvXMLImport& rImport, -sal_uInt16 nPrfx, const OUString& rLName, -const css::uno::Reference< css::xml::sax::XAttributeList > , +sal_Int32 nElement, +const css::uno::Reference< css::xml::sax::XFastAttributeList > , XMLFontStyleContextFontFaceUri& _uri ) -: SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList) +: SvXMLStyleContext( rImport, nElement, xAttrList) , uri(_uri) { } @@ -214,46 +216,51 @@ void XMLFontStyleContextFontFaceFormat::SetAttribute( sal_uInt16 nPrefixKey, con XMLFontStyleContextFontFaceSrc::XMLFontStyleContextFontFaceSrc( SvXMLImport& rImport, -sal_uInt16 nPrfx, const OUString& rLName, const XMLFontStyleContextFontFace& _font ) -: SvXMLImportContext( rImport, nPrfx, rLName ) +: SvXMLImportContext( rImport ) , font( _font ) { } -SvXMLImportContextRef XMLFontStyleContextFontFaceSrc::CreateChildContext( -sal_uInt16 nPrefix, -const OUString& rLocalName, -const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) +css::uno::Reference< css::xml::sax::XFastContextHandler > XMLFontStyleContextFontFaceSrc::createFastChildContext( +sal_Int32 nElement, +const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) { -if( nPrefix == XML_NAMESPACE_SVG && IsXMLToken( rLocalName, XML_FONT_FACE_URI )) -return new
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/XMLBase64ImportContext.hxx |9 - xmloff/source/core/XMLBase64ImportContext.cxx | 18 ++ xmloff/source/style/FillStyleContext.cxx | 13 ++--- xmloff/source/style/FillStyleContext.hxx |6 ++ 4 files changed, 34 insertions(+), 12 deletions(-) New commits: commit 4d6aeea85c87c7b4ea3227d03982988d6e4c87c4 Author: Noel Grandin AuthorDate: Fri Aug 21 13:31:02 2020 +0200 Commit: Noel Grandin CommitDate: Sat Aug 22 22:18:20 2020 +0200 use fastparser in XMLBitmapStyleContext Change-Id: Ic5764083c10a30b5d31c197a92bcfb7a4333aa42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101172 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/XMLBase64ImportContext.hxx b/include/xmloff/XMLBase64ImportContext.hxx index 298158db1329..6777ce10c296 100644 --- a/include/xmloff/XMLBase64ImportContext.hxx +++ b/include/xmloff/XMLBase64ImportContext.hxx @@ -40,10 +40,17 @@ public: const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, const css::uno::Reference< css::io::XOutputStream >& rOut ); +XMLBase64ImportContext( SvXMLImport& rImport, +const css::uno::Reference< css::io::XOutputStream >& rOut ); + virtual ~XMLBase64ImportContext() override; -virtual void EndElement() override; +virtual void SAL_CALL startFastElement( sal_Int32 /*nElement*/, +const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override {} +virtual void SAL_CALL endFastElement(sal_Int32) override; +virtual void SAL_CALL characters( const OUString& rChars ) override; +virtual void EndElement() override; virtual void Characters( const OUString& rChars ) override; }; diff --git a/xmloff/source/core/XMLBase64ImportContext.cxx b/xmloff/source/core/XMLBase64ImportContext.cxx index 4e46b81811b0..b9049e577d1c 100644 --- a/xmloff/source/core/XMLBase64ImportContext.cxx +++ b/xmloff/source/core/XMLBase64ImportContext.cxx @@ -38,11 +38,24 @@ XMLBase64ImportContext::XMLBase64ImportContext( { } +XMLBase64ImportContext::XMLBase64ImportContext( +SvXMLImport& rImport, +const Reference< XOutputStream >& rOut ) : +SvXMLImportContext( rImport ), +xOut( rOut ) +{ +} + XMLBase64ImportContext::~XMLBase64ImportContext() { } void XMLBase64ImportContext::EndElement() +{ +endFastElement(0); +} + +void XMLBase64ImportContext::endFastElement(sal_Int32 ) { OUString sChars = maCharBuffer.makeStringAndClear().trim(); if( !sChars.isEmpty() ) @@ -55,6 +68,11 @@ void XMLBase64ImportContext::EndElement() } void XMLBase64ImportContext::Characters( const OUString& rChars ) +{ +characters(rChars); +} + +void XMLBase64ImportContext::characters( const OUString& rChars ) { maCharBuffer.append(rChars); } diff --git a/xmloff/source/style/FillStyleContext.cxx b/xmloff/source/style/FillStyleContext.cxx index 58ae6cd6786a..1d219083d5af 100644 --- a/xmloff/source/style/FillStyleContext.cxx +++ b/xmloff/source/style/FillStyleContext.cxx @@ -128,10 +128,11 @@ XMLBitmapStyleContext::~XMLBitmapStyleContext() { } -SvXMLImportContextRef XMLBitmapStyleContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) +css::uno::Reference< css::xml::sax::XFastContextHandler > XMLBitmapStyleContext::createFastChildContext( +sal_Int32 nElement, +const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) { -SvXMLImportContext *pContext = nullptr; -if( (XML_NAMESPACE_OFFICE == nPrefix) && xmloff::token::IsXMLToken( rLocalName, xmloff::token::XML_BINARY_DATA ) ) +if( nElement == XML_ELEMENT(OFFICE, xmloff::token::XML_BINARY_DATA) ) { OUString sURL; maAny >>= sURL; @@ -139,13 +140,11 @@ SvXMLImportContextRef XMLBitmapStyleContext::CreateChildContext( sal_uInt16 nPre { mxBase64Stream = GetImport().GetStreamForGraphicObjectURLFromBase64(); if( mxBase64Stream.is() ) -pContext = new XMLBase64ImportContext( GetImport(), nPrefix, -rLocalName, xAttrList, -mxBase64Stream ); +return new XMLBase64ImportContext( GetImport(), mxBase64Stream ); } } -return pContext; +return nullptr; } void XMLBitmapStyleContext::endFastElement(sal_Int32 ) diff --git a/xmloff/source/style/FillStyleContext.hxx b/xmloff/source/style/FillStyleContext.hxx index 51e751075be4..026754ac6402 100644 --- a/xmloff/source/style/FillStyleContext.hxx +++ b/xmloff/source/style/FillStyleContext.hxx @@ -81,10 +81,8 @@ public: const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ); virtual ~XMLBitmapStyleContext() override; -virtual SvXMLImportContextRef
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlstyle.hxx |9 ++ xmloff/source/draw/ximpbody.cxx | 27 -- xmloff/source/draw/ximpbody.hxx |4 -- xmloff/source/draw/ximpstyl.cxx | 56 +++ xmloff/source/draw/ximpstyl.hxx |8 + xmloff/source/style/xmlstyle.cxx | 32 ++ 6 files changed, 112 insertions(+), 24 deletions(-) New commits: commit 7b83a28f1eb7d0687d07cfaaf8cfaaf9a8eea8c1 Author: Noel Grandin AuthorDate: Wed Aug 19 20:23:26 2020 +0200 Commit: Noel Grandin CommitDate: Thu Aug 20 09:38:13 2020 +0200 use fastparser in SdXMLHeaderFooterDeclContext actually, it can do both fast and slow parser paths for now, because it is used in a place fast-parser doesn't reach yet. Which means that I had to make SvXMLStyleContext also capable of handling both fast and slow parser paths. Change-Id: I24fd5bfb6603e93a5f752365c246ce47dabea8bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101017 Tested-by: Noel Grandin Reviewed-by: Noel Grandin diff --git a/include/xmloff/xmlstyle.hxx b/include/xmloff/xmlstyle.hxx index 017b2c56af47..6ddf51d8872a 100644 --- a/include/xmloff/xmlstyle.hxx +++ b/include/xmloff/xmlstyle.hxx @@ -98,11 +98,20 @@ public: XmlStyleFamily nFamily=XmlStyleFamily::DATA_STYLE, bool bDefaultStyle = false ); +// Fast-parser constructor +SvXMLStyleContext( SvXMLImport& rImport, + XmlStyleFamily nFamily=XmlStyleFamily::DATA_STYLE, + bool bDefaultStyle = false ); + virtual ~SvXMLStyleContext() override; virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) final override; +virtual void SAL_CALL startFastElement( +sal_Int32 nElement, +const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override; + const OUString& GetName() const { return maName; } const OUString& GetDisplayName() const { return maDisplayName.getLength() ? maDisplayName : maName; } const OUString& GetAutoName() const { return maAutoName; } diff --git a/xmloff/source/draw/ximpbody.cxx b/xmloff/source/draw/ximpbody.cxx index 87acc84f18d6..7e7325018cba 100644 --- a/xmloff/source/draw/ximpbody.cxx +++ b/xmloff/source/draw/ximpbody.cxx @@ -331,30 +331,17 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLBodyContext::crea } break; } -} -return nullptr; -} - -SvXMLImportContextRef SdXMLBodyContext::CreateChildContext( -sal_uInt16 nPrefix, -const OUString& rLocalName, -const uno::Reference< xml::sax::XAttributeList>& xAttrList ) -{ -SvXMLImportContextRef xContext; -const SvXMLTokenMap& rTokenMap = GetSdImport().GetBodyElemTokenMap(); - -switch(rTokenMap.Get(nPrefix, rLocalName)) -{ -case XML_TOK_BODY_HEADER_DECL: -case XML_TOK_BODY_FOOTER_DECL: -case XML_TOK_BODY_DATE_TIME_DECL: +case XML_ELEMENT(PRESENTATION, XML_HEADER_DECL): +case XML_ELEMENT(PRESENTATION, XML_FOOTER_DECL): +case XML_ELEMENT(PRESENTATION, XML_DATE_TIME_DECL): { -xContext = new SdXMLHeaderFooterDeclContext( GetImport(), nPrefix, rLocalName, xAttrList ); +return new SdXMLHeaderFooterDeclContext( GetImport(), xAttrList ); break; } +default: +assert(false); } - -return xContext; +return nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/draw/ximpbody.hxx b/xmloff/source/draw/ximpbody.hxx index ac77bf5479aa..714c8f8ec07d 100644 --- a/xmloff/source/draw/ximpbody.hxx +++ b/xmloff/source/draw/ximpbody.hxx @@ -58,10 +58,6 @@ public: virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; - -virtual SvXMLImportContextRef CreateChildContext( -sal_uInt16 nPrefix, const OUString& rLocalName, -const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; }; #endif // INCLUDED_XMLOFF_SOURCE_DRAW_XIMPBODY_HXX diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index 6952d6b68562..51058a1f36d1 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -1512,11 +1512,62 @@ SdXMLHeaderFooterDeclContext::SdXMLHeaderFooterDeclContext(SvXMLImport& rImport, } } +SdXMLHeaderFooterDeclContext::SdXMLHeaderFooterDeclContext(SvXMLImport& rImport, +const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList) +: SvXMLStyleContext( rImport ) +, mbFixed(false) +{ +for (auto : sax_fastparser::castToFastAttributeList( xAttrList )) +{ +OUString sValue = aIter.toString(); +if(
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlstyle.hxx|2 +- xmloff/source/core/xmlimp.cxx | 28 ++-- xmloff/source/draw/shapeimport.cxx |4 ++-- xmloff/source/style/xmlstyle.cxx |8 xmloff/source/text/txtimp.cxx |2 +- 5 files changed, 22 insertions(+), 22 deletions(-) New commits: commit 528dc27c3d97846bd0d73ef30e1c9c66daba425a Author: Noel Grandin AuthorDate: Mon Aug 3 10:45:40 2020 +0200 Commit: Noel Grandin CommitDate: Mon Aug 3 13:52:18 2020 +0200 rename Clear() to dispose() in SvXMLStylesContext to make it "clearer" this is part of the memory cleanup on destruction process Change-Id: I789bdfa0323cf759ed4db2e2a657e73e581d9eed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/0 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/xmlstyle.hxx b/include/xmloff/xmlstyle.hxx index e6de64251f34..017b2c56af47 100644 --- a/include/xmloff/xmlstyle.hxx +++ b/include/xmloff/xmlstyle.hxx @@ -238,7 +238,7 @@ public: // This method must be called to release the references to all styles // that are stored in the context. -void Clear(); +void dispose(); bool IsAutomaticStyle() const; }; diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index e305e69bff5b..387b4a8de19a 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -433,13 +433,13 @@ void SvXMLImport::cleanup() throw () while (!maFastContexts.empty()) { if (SvXMLStylesContext* pStylesContext = dynamic_cast(maFastContexts.top().get())) -pStylesContext->Clear(); +pStylesContext->dispose(); maFastContexts.pop(); } while (!maContexts.empty()) { if (SvXMLStylesContext* pStylesContext = dynamic_cast(maContexts.top().get())) -pStylesContext->Clear(); +pStylesContext->dispose(); maContexts.pop(); } if( mxTextImport ) @@ -627,13 +627,13 @@ void SAL_CALL SvXMLImport::endDocument() } if( mxFontDecls.is() ) -static_cast(mxFontDecls.get())->Clear(); +static_cast(mxFontDecls.get())->dispose(); if( mxStyles.is() ) -static_cast(mxStyles.get())->Clear(); +static_cast(mxStyles.get())->dispose(); if( mxAutoStyles.is() ) -static_cast(mxAutoStyles.get())->Clear(); +static_cast(mxAutoStyles.get())->dispose(); if( mxMasterStyles.is() ) -static_cast(mxMasterStyles.get())->Clear(); +static_cast(mxMasterStyles.get())->dispose(); // possible form-layer related knittings which can only be done when // the whole document exists @@ -1622,14 +1622,14 @@ XMLEventImportHelper& SvXMLImport::GetEventImport() void SvXMLImport::SetFontDecls( XMLFontStylesContext *pFontDecls ) { if (mxFontDecls.is()) -static_cast(mxFontDecls.get())->Clear(); +static_cast(mxFontDecls.get())->dispose(); mxFontDecls = pFontDecls; } void SvXMLImport::SetStyles( SvXMLStylesContext *pStyles ) { if (mxStyles.is()) -static_cast(mxStyles.get())->Clear(); +static_cast(mxStyles.get())->dispose(); mxStyles = pStyles; } @@ -1653,7 +1653,7 @@ void SvXMLImport::SetAutoStyles( SvXMLStylesContext *pAutoStyles ) } } if (mxAutoStyles.is()) -static_cast(mxAutoStyles.get())->Clear(); +static_cast(mxAutoStyles.get())->dispose(); mxAutoStyles = pAutoStyles; GetTextImport()->SetAutoStyles( pAutoStyles ); GetShapeImport()->SetAutoStylesContext( pAutoStyles ); @@ -1664,7 +1664,7 @@ void SvXMLImport::SetAutoStyles( SvXMLStylesContext *pAutoStyles ) void SvXMLImport::SetMasterStyles( SvXMLStylesContext *pMasterStyles ) { if (mxMasterStyles.is()) -static_cast(mxMasterStyles.get())->Clear(); +static_cast(mxMasterStyles.get())->dispose(); mxMasterStyles = pMasterStyles; } @@ -1873,13 +1873,13 @@ void SvXMLImport::SetError( void SvXMLImport::DisposingModel() { if( mxFontDecls.is() ) -static_cast(mxFontDecls.get())->Clear(); +static_cast(mxFontDecls.get())->dispose(); if( mxStyles.is() ) -static_cast(mxStyles.get())->Clear(); +static_cast(mxStyles.get())->dispose(); if( mxAutoStyles.is() ) -static_cast(mxAutoStyles.get())->Clear(); +static_cast(mxAutoStyles.get())->dispose(); if( mxMasterStyles.is() ) -static_cast(mxMasterStyles.get())->Clear(); +static_cast(mxMasterStyles.get())->dispose(); mxModel.set(nullptr); mxEventListener.set(nullptr); diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index 83cfa3880485..9fcae5b8b6a4 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -166,10 +166,10 @@ XMLShapeImportHelper::~XMLShapeImportHelper() // Styles or AutoStyles context? if(mxStylesContext.is()) -
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/txtimp.hxx |2 ++ xmloff/source/core/xmlimp.cxx |2 ++ xmloff/source/text/txtimp.cxx |6 ++ 3 files changed, 10 insertions(+) New commits: commit 22fda7524385225d9264e48ee3f4811674f8239c Author: Noel Grandin AuthorDate: Mon Aug 3 10:31:42 2020 +0200 Commit: Noel Grandin CommitDate: Mon Aug 3 13:51:55 2020 +0200 fix leak in SvXMLImport caused by a ref-counting cycle. to reproduce the leak do make CppunitTest_editeng_core \ VALGRIND='memcheck --leak-check=full \ --suppressions=$$BUILDDIR/solenv/sanitizers/valgrind-suppressions' \ CPPUNIT_TEST_NAME="testBoldItalicCopyPaste" Change-Id: I94dca092a75db8ddfaae4a210e1158fa066ed609 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99989 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx index 96edbbee0dba..4258c4b73bfb 100644 --- a/include/xmloff/txtimp.hxx +++ b/include/xmloff/txtimp.hxx @@ -398,6 +398,8 @@ public: virtual ~XMLTextImportHelper() override; +void dispose(); + void SetCursor( const css::uno::Reference< css::text::XTextCursor >& rCursor ); void ResetCursor(); diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 9aca2c429b90..e305e69bff5b 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -442,6 +442,8 @@ void SvXMLImport::cleanup() throw () pStylesContext->Clear(); maContexts.pop(); } +if( mxTextImport ) +mxTextImport->dispose(); mxTextImport.clear(); // XMLRedlineImportHelper needs model DisposingModel(); } diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index d047942752e3..961cda1bfac7 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -1048,6 +1048,12 @@ XMLTextImportHelper::~XMLTextImportHelper() { } +void XMLTextImportHelper::dispose() +{ +if (m_xImpl->m_xAutoStyles) +static_cast(m_xImpl->m_xAutoStyles.get())->Clear(); +} + SvXMLImportPropertyMapper *XMLTextImportHelper::CreateShapeExtPropMapper(SvXMLImport& rImport) { XMLPropertySetMapper *pPropMapper = ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmltoken.hxx |3 ++- xmloff/source/core/xmltoken.cxx |3 ++- xmloff/source/token/tokens.txt |3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) New commits: commit acfd959f0b4069b74e76213e4118af9827005fff Author: himajin10 AuthorDate: Tue May 19 14:32:52 2020 +0200 Commit: Michael Stahl CommitDate: Wed May 20 11:08:28 2020 +0200 meta:non-whitespace-character-count attribute is known also, fixed a typo and re-positioned the item to the correct index. Change-Id: Ibac232a9e6851a0c59884bc82ead5de36ac2e391 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94454 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index 3911f61c2849..3650805e6015 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -1321,8 +1321,8 @@ namespace xmloff::token { XML_NOEMPTY, XML_NOHREF, XML_NOMATCH, +XML_NON_WHITESPACE_CHARACTER_COUNT, XML_NONE, -XML_NOPRTSUBSET, XML_NORMAL, XML_NORMALS_DIRECTION, XML_NORMALS_KIND, @@ -1332,6 +1332,7 @@ namespace xmloff::token { XML_NOTE, XML_NOTES, XML_NOTIN, +XML_NOTPRSUBSET, XML_NOTSUBSET, XML_NULL_DATE, XML_NULL_YEAR, diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 18275ebb5ec0..7d37edc78800 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -1327,8 +1327,8 @@ namespace xmloff::token { TOKEN( "!empty", XML_NOEMPTY ), TOKEN( "nohref", XML_NOHREF ), TOKEN( "!match", XML_NOMATCH ), +TOKEN( "non-whitespace-character-count", XML_NON_WHITESPACE_CHARACTER_COUNT ), TOKEN( "none",XML_NONE ), -TOKEN( "notprsubset", XML_NOPRTSUBSET ), TOKEN( "normal", XML_NORMAL ), TOKEN( "normals-direction", XML_NORMALS_DIRECTION ), TOKEN( "normals-kind",XML_NORMALS_KIND ), @@ -1338,6 +1338,7 @@ namespace xmloff::token { TOKEN( "note",XML_NOTE ), TOKEN( "notes", XML_NOTES ), TOKEN( "notin", XML_NOTIN ), +TOKEN( "notprsubset", XML_NOTPRSUBSET ), TOKEN( "notsubset", XML_NOTSUBSET ), TOKEN( "null-date", XML_NULL_DATE ), TOKEN( "null-year", XML_NULL_YEAR ), diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt index 42a83f7ae15a..e7e52379a740 100644 --- a/xmloff/source/token/tokens.txt +++ b/xmloff/source/token/tokens.txt @@ -1237,8 +1237,8 @@ no-wrap NOEMPTY_DUMMY nohref NOMATCH_DUMMY +non-whitespace-character-count none -notprsubset normal normals-direction normals-kind @@ -1248,6 +1248,7 @@ notation note notes notin +notprsubset notsubset null-date null-year ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx |1 + xmloff/source/core/xmlimp.cxx |4 2 files changed, 5 insertions(+) New commits: commit 96db6fb300473fc7ba2af22770f0a7bd7c4f780b Author: Tomoyuki Kubota AuthorDate: Sun May 17 04:31:01 2020 +0900 Commit: Michael Stahl CommitDate: Tue May 19 17:03:57 2020 +0200 xmloff: ODF import: Silence "unknown LO version: 7000" Change-Id: I56cf3b03274cc24f66bbfc9d3615fa57521a6cd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94368 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 39990af79d7a..351a05887ebd 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -558,6 +558,7 @@ public: /// @ATTENTION: when adding a new value more specific than "6x", grep for /// all current uses and adapt them!!! static const sal_uInt16 LO_6x = 60 | LO_flag; +static const sal_uInt16 LO_7x = 70 | LO_flag; static const sal_uInt16 ProductVersionUnknown = SAL_MAX_UINT16; /** depending on whether the generator version indicates LO, compare diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 78c967fa72fc..36550f1f8192 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -198,6 +198,10 @@ public: { mnGeneratorVersion = SvXMLImport::LO_6x; } +else if ('7' == loVersion[0]) +{ +mnGeneratorVersion = SvXMLImport::LO_7x; +} else { SAL_INFO("xmloff.core", "unknown LO version: " << loVersion); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/XMLPageExport.hxx |6 +- xmloff/source/style/XMLPageExport.cxx | 74 +- 2 files changed, 59 insertions(+), 21 deletions(-) New commits: commit 97e9b250426ff09bba4546835ee9138d91e03fbb Author: Michael Stahl AuthorDate: Thu May 7 18:28:08 2020 +0200 Commit: Michael Stahl CommitDate: Tue May 19 10:27:08 2020 +0200 tdf#103602 xmloff,sw: ODF 1.3 export: PageStyle with drawing-page style Associate a style of family "drawing-page" with a style:master-page. This fixes the small part of the draw:fill attribute problem that is covered by OFFICE-3937 in ODF 1.3. Exporting the "drawing-page" style is only allowed in ODF 1.3; all property map entries have ODFSVER_ODF013 and this causes no style to be exported for earlier versions. Continue to export the invalid draw:fill attributes on the style:page-layout for now, until the import of this is more widely deployed. This only works with Writer, because Calc doesn't implement FillStyle properties on its page styles. Change-Id: I4b24ae3eaf332723e24671e594eca5e36d48f525 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93671 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/include/xmloff/XMLPageExport.hxx b/include/xmloff/XMLPageExport.hxx index 9800502f60a5..73a60ef1c5f0 100644 --- a/include/xmloff/XMLPageExport.hxx +++ b/include/xmloff/XMLPageExport.hxx @@ -44,6 +44,7 @@ class SvXMLExportPropertyMapper; struct XMLPageExportNameEntry { OUString sPageMasterName; +OUString sDrawingPageStyleName; OUString sStyleName; }; @@ -55,11 +56,12 @@ class XMLOFF_DLLPUBLIC XMLPageExport : public salhelper::SimpleReferenceObject css::uno::Reference< css::container::XNameAccess > xPageStyles; ::std::vector< XMLPageExportNameEntry > aNameVector; -SAL_DLLPRIVATE bool findPageMasterName( const OUString& rStyleName, OUString& rPMName ) const; rtl::Reference < XMLPropertyHandlerFactory > xPageMasterPropHdlFactory; rtl::Reference < XMLPropertySetMapper > xPageMasterPropSetMapper; rtl::Reference < SvXMLExportPropertyMapper > xPageMasterExportPropMapper; +rtl::Reference m_xPageMasterDrawingPagePropSetMapper; +rtl::Reference m_xPageMasterDrawingPageExportPropMapper; protected: @@ -67,7 +69,7 @@ protected: void collectPageMasterAutoStyle( const css::uno::Reference< css::beans::XPropertySet > & rPropSet, -OUString& rPageMasterName ); +XMLPageExportNameEntry & rEntry); virtual void exportMasterPageContent( const css::uno::Reference< css::beans::XPropertySet > & rPropSet, diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx index 56f7bf7dae22..c0d416d5592b 100644 --- a/xmloff/source/style/XMLPageExport.cxx +++ b/xmloff/source/style/XMLPageExport.cxx @@ -44,23 +44,29 @@ using namespace ::xmloff::token; static const OUStringLiteral gsIsPhysical( "IsPhysical" ); static const OUStringLiteral gsFollowStyle( "FollowStyle" ); -bool XMLPageExport::findPageMasterName( const OUString& rStyleName, OUString& rPMName ) const +namespace { + +bool findPageMasterNameEntry( +::std::vector const& aNameVector, +const OUString& rStyleName, XMLPageExportNameEntry & o_rEntry) { auto pEntry = std::find_if(aNameVector.cbegin(), aNameVector.cend(), [](const XMLPageExportNameEntry& rEntry) { return rEntry.sStyleName == rStyleName; }); if( pEntry != aNameVector.cend() ) { -rPMName = pEntry->sPageMasterName; +o_rEntry = *pEntry; return true; } return false; } +} // namespace + void XMLPageExport::collectPageMasterAutoStyle( const Reference < XPropertySet > & rPropSet, -OUString& rPageMasterName ) +XMLPageExportNameEntry & rEntry) { SAL_WARN_IF( !xPageMasterPropSetMapper.is(), "xmloff", "page master family/XMLPageMasterPropSetMapper not found" ); if( xPageMasterPropSetMapper.is() ) @@ -69,9 +75,23 @@ void XMLPageExport::collectPageMasterAutoStyle( if( !aPropStates.empty()) { OUString sParent; -rPageMasterName = rExport.GetAutoStylePool()->Find( XmlStyleFamily::PAGE_MASTER, sParent, aPropStates ); -if (rPageMasterName.isEmpty()) -rPageMasterName = rExport.GetAutoStylePool()->Add(XmlStyleFamily::PAGE_MASTER, sParent, aPropStates); +rEntry.sPageMasterName = rExport.GetAutoStylePool()->Find( XmlStyleFamily::PAGE_MASTER, sParent, aPropStates ); +if (rEntry.sPageMasterName.isEmpty()) +{ +rEntry.sPageMasterName = rExport.GetAutoStylePool()->Add(XmlStyleFamily::PAGE_MASTER, sParent, aPropStates); +} +} +} +assert(m_xPageMasterDrawingPageExportPropMapper.is()); +
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlexp.hxx |3 --- xmloff/source/core/xmlexp.cxx | 10 -- 2 files changed, 13 deletions(-) New commits: commit bb6af185cb7a88dfc73ad067d928625f0a2ed590 Author: Michael Stahl AuthorDate: Tue Apr 28 15:03:42 2020 +0200 Commit: Tor Lillqvist CommitDate: Fri May 15 17:54:17 2020 +0200 xmloff: remove unused SvXMLExport::getDefaultVersion() Change-Id: I52e904ca32f46ec50c3045260be7824aa782cc9c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93090 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index 58ff24299cec..f20409ad90c0 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -534,9 +534,6 @@ public: /// returns value of ODF version attribute char const* GetODFVersionAttributeValue() const; -/// returns the currently configured default version for odf export -SvtSaveOptions::ODFDefaultVersion getDefaultVersion() const; - /// returns the deterministic version for odf export SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const; diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index a9e49a5a8e34..3d3e8d93f455 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -2305,16 +2305,6 @@ uno::Reference< embed::XStorage > const & SvXMLExport::GetTargetStorage() const return mpImpl->mxTargetStorage; } -/// returns the currently configured default version for ODF export -SvtSaveOptions::ODFDefaultVersion SvXMLExport::getDefaultVersion() const -{ -if( mpImpl ) -return mpImpl->maSaveOptions.GetODFDefaultVersion(); - -// fatal error, use current version as default -return SvtSaveOptions::ODFVER_012; -} - SvtSaveOptions::ODFSaneDefaultVersion SvXMLExport::getSaneDefaultVersion() const { if( mpImpl ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlexp.hxx |3 ++ xmloff/source/core/xmlexp.cxx | 34 + xmloff/source/meta/MetaExportComponent.cxx | 13 --- 3 files changed, 24 insertions(+), 26 deletions(-) New commits: commit 86cd3af48f8c00300d9826f3b7364e8447adb34e Author: Michael Stahl AuthorDate: Tue Apr 28 15:02:08 2020 +0200 Commit: Michael Stahl CommitDate: Fri May 15 17:52:10 2020 +0200 xmloff: ODF export: produce office:version="1.3" Change-Id: I422743c6eacf112046141e017d42d78165c36cf2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93089 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index 75595d35ea29..58ff24299cec 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -531,6 +531,9 @@ public: css::uno::Reference< css::embed::XStorage > const & GetTargetStorage() const; +/// returns value of ODF version attribute +char const* GetODFVersionAttributeValue() const; + /// returns the currently configured default version for odf export SvtSaveOptions::ODFDefaultVersion getDefaultVersion() const; diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index b22b7b58b5c4..a9e49a5a8e34 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -107,8 +107,6 @@ using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::io; using namespace ::xmloff::token; -char const sXML_1_2[] = "1.2"; - #define XML_MODEL_SERVICE_WRITER"com.sun.star.text.TextDocument" #define XML_MODEL_SERVICE_CALC "com.sun.star.sheet.SpreadsheetDocument" #define XML_MODEL_SERVICE_DRAW "com.sun.star.drawing.DrawingDocument" @@ -1229,6 +1227,25 @@ void SvXMLExport::addChaffWhenEncryptedStorage() } } +auto SvXMLExport::GetODFVersionAttributeValue() const -> char const* +{ +char const* pVersion(nullptr); +switch (getSaneDefaultVersion()) +{ +case SvtSaveOptions::ODFSVER_013_EXTENDED: [[fallthrough]]; +case SvtSaveOptions::ODFSVER_013: pVersion = "1.3"; break; +case SvtSaveOptions::ODFSVER_012_EXTENDED: [[fallthrough]]; +case SvtSaveOptions::ODFSVER_012_EXT_COMPAT: [[fallthrough]]; +case SvtSaveOptions::ODFSVER_012: pVersion = "1.2"; break; +case SvtSaveOptions::ODFSVER_011: pVersion = "1.1"; break; +case SvtSaveOptions::ODFSVER_010: break; + +default: +assert(!"xmloff::SvXMLExport::exportDoc(), unexpected odf default version!"); +} +return pVersion; +} + ErrCode SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) { bool bOwnGraphicResolver = false; @@ -1323,18 +1340,7 @@ ErrCode SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) } // office:version = ... -const char* pVersion = nullptr; -switch (getDefaultVersion()) -{ -case SvtSaveOptions::ODFVER_LATEST: pVersion = sXML_1_2; break; -case SvtSaveOptions::ODFVER_012_EXT_COMPAT: pVersion = sXML_1_2; break; -case SvtSaveOptions::ODFVER_012: pVersion = sXML_1_2; break; -case SvtSaveOptions::ODFVER_011: pVersion = "1.1"; break; -case SvtSaveOptions::ODFVER_010: break; - -default: -SAL_WARN("xmloff.core", "xmloff::SvXMLExport::exportDoc(), unexpected odf default version!"); -} +const char*const pVersion = GetODFVersionAttributeValue(); if (pVersion) { diff --git a/xmloff/source/meta/MetaExportComponent.cxx b/xmloff/source/meta/MetaExportComponent.cxx index 44620578f1c7..61b6e9a85629 100644 --- a/xmloff/source/meta/MetaExportComponent.cxx +++ b/xmloff/source/meta/MetaExportComponent.cxx @@ -134,18 +134,7 @@ ErrCode XMLMetaExportComponent::exportDoc( enum XMLTokenEnum ) nPos = GetNamespaceMap().GetNextKey( nPos ); } -const char* pVersion = nullptr; -switch( getDefaultVersion() ) -{ -case SvtSaveOptions::ODFVER_LATEST: pVersion = "1.2"; break; -case SvtSaveOptions::ODFVER_012_EXT_COMPAT: pVersion = "1.2"; break; -case SvtSaveOptions::ODFVER_012: pVersion = "1.2"; break; -case SvtSaveOptions::ODFVER_011: pVersion = "1.1"; break; -case SvtSaveOptions::ODFVER_010: break; - -default: -OSL_FAIL("xmloff::XMLMetaExportComponent::exportDoc(), unexpected odf default version!"); -} +const char*const pVersion = GetODFVersionAttributeValue(); if( pVersion ) AddAttribute( XML_NAMESPACE_OFFICE, XML_VERSION, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlprmap.hxx |3 +-- xmloff/source/style/xmlexppr.cxx |5 ++--- xmloff/source/style/xmlprmap.cxx |8 +++- 3 files changed, 6 insertions(+), 10 deletions(-) New commits: commit e43ad1a8ae20cbd00c5c3346e1810196af6669a6 Author: Michael Stahl AuthorDate: Wed Apr 22 16:18:10 2020 +0200 Commit: Michael Stahl CommitDate: Fri May 8 18:38:01 2020 +0200 xmloff: GetEarliestODFVersionForExport(-1) is impossible Remove defensive programming nonsense to deal with situation that has apparently never been possible in git history. Change-Id: I3788cdcec5e1b4afa27e294ed91825bb33e8e633 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92729 Reviewed-by: Michael Stahl Tested-by: Jenkins diff --git a/include/xmloff/xmlprmap.hxx b/include/xmloff/xmlprmap.hxx index 9d85bbdbf632..2b53f2e83d53 100644 --- a/include/xmloff/xmlprmap.hxx +++ b/include/xmloff/xmlprmap.hxx @@ -25,7 +25,6 @@ #include #include -#include #include namespace rtl { template class Reference; } @@ -83,7 +82,7 @@ public: sal_Int16 GetEntryContextId( sal_Int32 nIndex ) const; /** returns the earliest odf version for which this property should be exported. */ -std::optional GetEarliestODFVersionForExport(sal_Int32 nIndex) const; +SvtSaveOptions::ODFSaneDefaultVersion GetEarliestODFVersionForExport(sal_Int32 nIndex) const; /** Returns the index of an entry with the given XML-name and namespace If there is no matching entry the method returns -1 */ diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index 2ca0e49df077..e94f6744b12d 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -586,10 +586,9 @@ vector SvXMLExportPropertyMapper::Filter_( ( (0 != (nFlags & MID_FLAG_MUST_EXIST)) || xInfo->hasPropertyByName( rAPIName ) ) ) { -const std::optional oEarliestODFVersionForExport( +const SvtSaveOptions::ODFSaneDefaultVersion nEarliestODFVersionForExport( mpImpl->mxPropMapper->GetEarliestODFVersionForExport(i)); -if (!oEarliestODFVersionForExport -|| nCurrentVersion >= *oEarliestODFVersionForExport) +if (nEarliestODFVersionForExport <= nCurrentVersion) { pFilterInfo->AddProperty(rAPIName, i); } diff --git a/xmloff/source/style/xmlprmap.cxx b/xmloff/source/style/xmlprmap.cxx index 905b068dff01..b3111441ef6a 100644 --- a/xmloff/source/style/xmlprmap.cxx +++ b/xmloff/source/style/xmlprmap.cxx @@ -192,13 +192,11 @@ sal_Int16 XMLPropertySetMapper::GetEntryContextId( sal_Int32 nIndex ) const return nIndex == -1 ? 0 : mpImpl->maMapEntries[nIndex].nContextId; } -std::optional +SvtSaveOptions::ODFSaneDefaultVersion XMLPropertySetMapper::GetEarliestODFVersionForExport(sal_Int32 const nIndex) const { -assert((-1 <= nIndex) && (nIndex < static_cast(mpImpl->maMapEntries.size(; -return nIndex == -1 -? std::optional() -: std::optional(mpImpl->maMapEntries[nIndex].nEarliestODFVersionForExport); +assert((0 <= nIndex) && (nIndex < static_cast(mpImpl->maMapEntries.size(; +return mpImpl->maMapEntries[nIndex].nEarliestODFVersionForExport; } const XMLPropertyHandler* XMLPropertySetMapper::GetPropertyHandler( sal_Int32 nIndex ) const ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmltoken.hxx|2 ++ xmloff/source/core/xmltoken.cxx|2 ++ xmloff/source/draw/animationimport.cxx |1 + xmloff/source/token/tokens.txt |2 ++ 4 files changed, 7 insertions(+) New commits: commit dc7f4b0002769308d38e6c6e9b714ef7766d2ae7 Author: Noel Grandin AuthorDate: Sun Mar 29 08:59:43 2020 +0200 Commit: Noel Grandin CommitDate: Sun Mar 29 14:21:39 2020 +0200 tdf#131632 animation effects are missing features regression from commit 5352d45dd4a04f8f02cf7f6ad4169126d3b3586a Date: Tue Feb 18 15:45:08 2020 +0200 convert AnimationImport to fast-parser APIs Change-Id: I7227b122213c877b8ea5db25239eae8151597a8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91320 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index a40aa974d327..5892f1e50e03 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -1873,6 +1873,7 @@ namespace xmloff { namespace token { XML_TEXT_INPUT, XML_TEXT_JUSTIFY, XML_TEXT_OUTLINE, +XML_TEXT_ONLY, XML_TEXT_POSITION, XML_TEXT_ROTATION_ANGLE, XML_TEXT_ROTATION_SCALE, @@ -2972,6 +2973,7 @@ namespace xmloff { namespace token { XML_PRESET_ID, XML_PRESET_SUB_TYPE, XML_PRESET_CLASS, +XML_PRESET_PROPERTY, XML_CUSTOM, XML_ENTRANCE, XML_EXIT, diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 92abc4cef73e..a9cf682e7d5d 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -1878,6 +1878,7 @@ namespace xmloff::token { TOKEN( "text-input", XML_TEXT_INPUT ), TOKEN( "text-justify",XML_TEXT_JUSTIFY ), TOKEN( "text-outline",XML_TEXT_OUTLINE ), +TOKEN( "text-only", XML_TEXT_ONLY ), TOKEN( "text-position", XML_TEXT_POSITION ), TOKEN( "text-rotation-angle", XML_TEXT_ROTATION_ANGLE ), TOKEN( "text-rotation-scale", XML_TEXT_ROTATION_SCALE ), @@ -2972,6 +2973,7 @@ namespace xmloff::token { TOKEN( "preset-id", XML_PRESET_ID ), TOKEN( "preset-sub-type", XML_PRESET_SUB_TYPE ), TOKEN( "preset-class", XML_PRESET_CLASS ), +TOKEN( "preset-property", XML_PRESET_PROPERTY ), TOKEN( "custom",XML_CUSTOM ), TOKEN( "entrance", XML_ENTRANCE ), TOKEN( "exit", XML_EXIT ), diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index 00e67ab20f20..e2a6c012e9a3 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -1142,6 +1142,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: // push all unknown attributes within the presentation namespace as user data if (nNamespace == NAMESPACE_TOKEN(XML_NAMESPACE_PRESENTATION) || nNamespace == NAMESPACE_TOKEN(XML_NAMESPACE_PRESENTATION_SO52) +|| nNamespace == NAMESPACE_TOKEN(XML_NAMESPACE_PRESENTATION_OASIS) || nNamespace == NAMESPACE_TOKEN(XML_NAMESPACE_PRESENTATION_OOO)) { aUserData.emplace_back( SvXMLImport::getNameFromToken(aIter.getToken()), makeAny( rValue ) ); diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt index 5d14dd65c820..cd94bd5228d6 100644 --- a/xmloff/source/token/tokens.txt +++ b/xmloff/source/token/tokens.txt @@ -1791,6 +1791,7 @@ text-indent text-input text-justify text-outline +text-only text-position text-rotation-angle text-rotation-scale @@ -2790,6 +2791,7 @@ node-type preset-id preset-sub-type preset-class +preset-property custom entrance exit ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlnmspe.hxx| 24 xmloff/source/core/xmlimp.cxx | 24 xmloff/source/xforms/XFormsBindContext.cxx |2 +- 3 files changed, 25 insertions(+), 25 deletions(-) New commits: commit 336949c4f104b977541c74b25244d3b4f0ed5b18 Author: Noel Grandin AuthorDate: Tue Feb 18 13:54:20 2020 +0200 Commit: Noel Grandin CommitDate: Tue Feb 18 14:44:40 2020 +0100 rename XML_OLD_NAMESPACE_ constants so I can use them with the XML_ELEMENT macro, which expects them to start with "XML_NAMESPACE" Change-Id: If8098448f451675aaff8ca2dcf9544e765cda965 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88928 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/xmlnmspe.hxx b/include/xmloff/xmlnmspe.hxx index b61e5581e381..40cdabbc6825 100644 --- a/include/xmloff/xmlnmspe.hxx +++ b/include/xmloff/xmlnmspe.hxx @@ -100,18 +100,18 @@ constexpr sal_uInt16 XML_NAMESPACE_REPORT_OASIS = XML_NAMESPACE_OASIS_BASE + // namespaces used in the technical preview (SO 5.2) constexpr sal_uInt16 XML_OLD_NAMESPACE_BASE = 62; -constexpr sal_uInt16 XML_OLD_NAMESPACE_FO = XML_OLD_NAMESPACE_BASE + 0; -constexpr sal_uInt16 XML_OLD_NAMESPACE_XLINK = XML_OLD_NAMESPACE_BASE + 1; -constexpr sal_uInt16 XML_OLD_NAMESPACE_OFFICE = XML_OLD_NAMESPACE_BASE + 2; -constexpr sal_uInt16 XML_OLD_NAMESPACE_STYLE = XML_OLD_NAMESPACE_BASE + 3; -constexpr sal_uInt16 XML_OLD_NAMESPACE_TEXT = XML_OLD_NAMESPACE_BASE + 4; -constexpr sal_uInt16 XML_OLD_NAMESPACE_TABLE = XML_OLD_NAMESPACE_BASE + 5; -constexpr sal_uInt16 XML_OLD_NAMESPACE_META = XML_OLD_NAMESPACE_BASE + 6; -constexpr sal_uInt16 XML_OLD_NAMESPACE_DRAW = XML_OLD_NAMESPACE_BASE + 7; -constexpr sal_uInt16 XML_OLD_NAMESPACE_NUMBER = XML_OLD_NAMESPACE_BASE + 8; -constexpr sal_uInt16 XML_OLD_NAMESPACE_PRESENTATION = XML_OLD_NAMESPACE_BASE + 9; -constexpr sal_uInt16 XML_OLD_NAMESPACE_CHART = XML_OLD_NAMESPACE_BASE + 10; -constexpr sal_uInt16 XML_OLD_NAMESPACE_SMIL = XML_OLD_NAMESPACE_BASE + 11; +constexpr sal_uInt16 XML_NAMESPACE_FO_SO52 = XML_OLD_NAMESPACE_BASE + 0; +constexpr sal_uInt16 XML_NAMESPACE_XLINK_SO52 = XML_OLD_NAMESPACE_BASE + 1; +constexpr sal_uInt16 XML_NAMESPACE_OFFICE_SO52 = XML_OLD_NAMESPACE_BASE + 2; +constexpr sal_uInt16 XML_NAMESPACE_STYLE_SO52 = XML_OLD_NAMESPACE_BASE + 3; +constexpr sal_uInt16 XML_NAMESPACE_TEXT_SO52 = XML_OLD_NAMESPACE_BASE + 4; +constexpr sal_uInt16 XML_NAMESPACE_TABLE_SO52 = XML_OLD_NAMESPACE_BASE + 5; +constexpr sal_uInt16 XML_NAMESPACE_META_SO52 = XML_OLD_NAMESPACE_BASE + 6; +constexpr sal_uInt16 XML_NAMESPACE_DRAW_SO52 = XML_OLD_NAMESPACE_BASE + 7; +constexpr sal_uInt16 XML_NAMESPACE_NUMBER_SO52 = XML_OLD_NAMESPACE_BASE + 8; +constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION_SO52 = XML_OLD_NAMESPACE_BASE + 9; +constexpr sal_uInt16 XML_NAMESPACE_CHART_SO52 = XML_OLD_NAMESPACE_BASE + 10; +constexpr sal_uInt16 XML_NAMESPACE_SMIL_SO52 = XML_OLD_NAMESPACE_BASE + 11; // experimental namespaces constexpr sal_uInt16 XML_NAMESPACE_FIELD = 100; diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index cf783b4fc8c8..9165f7c18e15 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -2081,39 +2081,39 @@ void SvXMLImport::initializeNamespaceMaps() }; mapTokenToNamespace( XML_NAMESPACE_OFFICE, XML_NP_OFFICE, XML_N_OFFICE ); -mapTokenToNamespace( XML_OLD_NAMESPACE_OFFICE, XML_NP_OFFICE, XML_N_OFFICE_OLD ); +mapTokenToNamespace( XML_NAMESPACE_OFFICE_SO52, XML_NP_OFFICE, XML_N_OFFICE_OLD ); mapTokenToNamespace( XML_NAMESPACE_OFFICE_OOO, XML_NP_OFFICE, XML_N_OFFICE_OOO ); mapTokenToNamespace( XML_NAMESPACE_STYLE,XML_NP_STYLE, XML_N_STYLE); -mapTokenToNamespace( XML_OLD_NAMESPACE_STYLE,XML_NP_STYLE, XML_N_STYLE_OLD); +mapTokenToNamespace( XML_NAMESPACE_STYLE_SO52, XML_NP_STYLE, XML_N_STYLE_OLD); mapTokenToNamespace( XML_NAMESPACE_STYLE_OOO,XML_NP_STYLE, XML_N_STYLE_OOO); mapTokenToNamespace( XML_NAMESPACE_TEXT, XML_NP_TEXT, XML_N_TEXT ); -mapTokenToNamespace( XML_OLD_NAMESPACE_TEXT, XML_NP_TEXT, XML_N_TEXT_OLD ); +mapTokenToNamespace( XML_NAMESPACE_TEXT_SO52,XML_NP_TEXT, XML_N_TEXT_OLD ); mapTokenToNamespace( XML_NAMESPACE_TEXT_OOO, XML_NP_TEXT, XML_N_TEXT_OOO ); mapTokenToNamespace( XML_NAMESPACE_TABLE,XML_NP_TABLE, XML_N_TABLE); -
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/shapeimport.hxx |4 xmloff/source/draw/eventimp.cxx| 30 +- xmloff/source/draw/eventimp.hxx| 25 + xmloff/source/draw/shapeimport.cxx | 23 +++ 4 files changed, 53 insertions(+), 29 deletions(-) New commits: commit 03edebda393ea684803b7a0da72f33655bdc24d1 Author: Caolán McNamara AuthorDate: Tue Nov 12 13:25:44 2019 + Commit: Caolán McNamara CommitDate: Tue Nov 12 20:51:21 2019 +0100 tdf#127791 defer import of group shape events until the group is popped otherwise the group shape import applies the events over the children it has when it reads the events which is 0. We already push and pop groups for sorting so reuse that to store and apply the events to groups Change-Id: I3f31796f9e8d3d11df6f3ba12a32be920a228155 Reviewed-on: https://gerrit.libreoffice.org/82516 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/xmloff/shapeimport.hxx b/include/xmloff/shapeimport.hxx index 4412d26e07d6..a20154a70387 100644 --- a/include/xmloff/shapeimport.hxx +++ b/include/xmloff/shapeimport.hxx @@ -215,6 +215,7 @@ public: struct XMLShapeImportHelperImpl; struct XMLShapeImportPageContextImpl; +struct SdXMLEventContextData; class XMLOFF_DLLPUBLIC XMLShapeImportHelper : public salhelper::SimpleReferenceObject { @@ -307,6 +308,9 @@ public: const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, css::uno::Reference< css::drawing::XShapes >& rShapes); +// tdf#127791 help function for group shape events +void addShapeEvents(SdXMLEventContextData& rData); + // helper functions for z-order sorting void pushGroupForSorting( css::uno::Reference< css::drawing::XShapes >& rShapes ); void popGroupAndSort(); diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx index ccb93c379aba..f9e10c11cf7d 100644 --- a/xmloff/source/draw/eventimp.cxx +++ b/xmloff/source/draw/eventimp.cxx @@ -21,8 +21,6 @@ #include #include #include -#include -#include #include #include #include @@ -35,7 +33,6 @@ #include #include #include "eventimp.hxx" -#include using namespace ::std; using namespace ::cppu; @@ -70,31 +67,6 @@ SvXMLEnumMapEntry const aXML_EventActions_EnumMap[] = { XML_TOKEN_INVALID, ClickAction(0) } }; -class SdXMLEventContextData -{ -private: -css::uno::Reference< css::drawing::XShape > mxShape; - -public: -SdXMLEventContextData(const Reference< XShape >& rxShape); - -void ApplyProperties(); - -bool mbValid; -bool mbScript; -ClickAction meClickAction; -XMLEffect meEffect; -XMLEffectDirection meDirection; -sal_Int16 mnStartScale; -AnimationSpeed meSpeed; -sal_Int32 mnVerb; -OUString msSoundURL; -bool mbPlayFull; -OUString msMacroName; -OUString msBookmark; -OUString msLanguage; -}; - SdXMLEventContextData::SdXMLEventContextData(const Reference< XShape >& rxShape) : mxShape(rxShape), mbValid(false), mbScript(false) , meClickAction(ClickAction_NONE), meEffect(EK_none) @@ -268,7 +240,7 @@ SvXMLImportContextRef SdXMLEventContext::CreateChildContext( sal_uInt16 nPrefix, void SdXMLEventContext::EndElement() { -maData.ApplyProperties(); +GetImport().GetShapeImport()->addShapeEvents(maData); } void SdXMLEventContextData::ApplyProperties() diff --git a/xmloff/source/draw/eventimp.hxx b/xmloff/source/draw/eventimp.hxx index 5f7937a529b3..7388407058d0 100644 --- a/xmloff/source/draw/eventimp.hxx +++ b/xmloff/source/draw/eventimp.hxx @@ -22,6 +22,9 @@ #include #include +#include +#include +#include // office:events inside a shape @@ -43,6 +46,28 @@ public: const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; }; +struct SdXMLEventContextData +{ +SdXMLEventContextData(const css::uno::Reference& rxShape); +void ApplyProperties(); + +css::uno::Reference mxShape; + +bool mbValid; +bool mbScript; +css::presentation::ClickAction meClickAction; +XMLEffect meEffect; +XMLEffectDirection meDirection; +sal_Int16 mnStartScale; +css::presentation::AnimationSpeed meSpeed; +sal_Int32 mnVerb; +OUString msSoundURL; +bool mbPlayFull; +OUString msMacroName; +OUString msBookmark; +OUString msLanguage; +}; + #endif // INCLUDED_XMLOFF_SOURCE_DRAW_EVENTIMP_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index 6708e48e73dc..2f8faf02ae30 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -35,6 +35,7 @@ #include #include #include +#include "eventimp.hxx" #include "ximpshap.hxx" #include "sdpropls.hxx" #include @@ -708,6 +709,7 @@ class ShapeSortContext { public: uno::Reference< drawing::XShapes >
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlictxt.hxx | 32 xmloff/source/core/xmlictxt.cxx | 30 -- 2 files changed, 52 insertions(+), 10 deletions(-) New commits: commit ef0e7e146f86999b04d7274688d72fadcaf53a36 Author: Noel Grandin AuthorDate: Wed Nov 6 20:08:56 2019 +0200 Commit: Noel Grandin CommitDate: Wed Nov 6 20:28:52 2019 +0100 tdf#125688 removing XWeak support from SvXMLImportContext shaves 2% off the load time Change-Id: Icac00389dfcc3339fe4faf1731e9eeb3ff8d0f0c Reviewed-on: https://gerrit.libreoffice.org/82139 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/xmlictxt.hxx b/include/xmloff/xmlictxt.hxx index 9cf531b4eef5..8dc67dac0227 100644 --- a/include/xmloff/xmlictxt.hxx +++ b/include/xmloff/xmlictxt.hxx @@ -24,8 +24,8 @@ #include #include #include +#include #include -#include #include #include @@ -37,15 +37,20 @@ class SvXMLImportContext; typedef rtl::Reference SvXMLImportContextRef; -class XMLOFF_DLLPUBLIC SvXMLImportContext : public cppu::WeakImplHelper< css::xml::sax::XFastContextHandler > +/** +This class deliberately does not support XWeak, to improve performance when loading +large documents. +*/ +class XMLOFF_DLLPUBLIC SvXMLImportContext : public css::xml::sax::XFastContextHandler, +public css::lang::XTypeProvider + { friend class SvXMLImport; -SvXMLImport& mrImport; - -sal_uInt16 const mnPrefix; -OUString const maLocalName; - +oslInterlockedCountm_nRefCount; +SvXMLImport& mrImport; +sal_uInt16 mnPrefix; +OUString maLocalName; std::unique_ptr m_pRewindMap; SAL_DLLPRIVATE std::unique_ptr TakeRewindMap() { return std::move(m_pRewindMap); } @@ -74,7 +79,7 @@ public: * ends. By default, nothing is done. * Note that virtual methods cannot be used inside destructors. Use * EndElement instead if this is required. */ -virtual ~SvXMLImportContext() override; +virtual ~SvXMLImportContext(); /** Create a children element context. By default, the import's * CreateContext method is called to create a new default context. */ @@ -115,6 +120,17 @@ public: const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs) override; virtual void SAL_CALL characters(const OUString & aChars) override; + +// XInterface +virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) final override; +virtual void SAL_CALL acquire() throw () final override +{ osl_atomic_increment(_nRefCount); } +virtual void SAL_CALL release() throw () final override +{ if (osl_atomic_decrement(_nRefCount) == 0) delete this; } + +// XTypeProvider +virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) final override; +virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) final override; }; #endif // INCLUDED_XMLOFF_XMLICTXT_HXX diff --git a/xmloff/source/core/xmlictxt.cxx b/xmloff/source/core/xmlictxt.cxx index fb4e64ef8719..8e31d497ab8e 100644 --- a/xmloff/source/core/xmlictxt.cxx +++ b/xmloff/source/core/xmlictxt.cxx @@ -22,19 +22,22 @@ #include #include #include +#include using namespace ::com::sun::star; SvXMLImportContext::SvXMLImportContext( SvXMLImport& rImp, sal_uInt16 nPrfx, const OUString& rLName ) -: mrImport(rImp) +: m_nRefCount(0) +, mrImport(rImp) , mnPrefix(nPrfx) , maLocalName(rLName) { } SvXMLImportContext::SvXMLImportContext( SvXMLImport& rImp ) -: mrImport(rImp) +: m_nRefCount(0) +, mrImport(rImp) , mnPrefix(0) { } @@ -143,4 +146,27 @@ void SAL_CALL SvXMLImportContext::characters(const OUString ) mrImport.Characters( rChars ); } +// XInterface +css::uno::Any SAL_CALL SvXMLImportContext::queryInterface( const css::uno::Type& aType ) +{ +css::uno::Any a = ::cppu::queryInterface( +aType, +static_cast< XFastContextHandler* >(this), +static_cast< XTypeProvider* >(this)); + +return a; +} + +// XTypeProvider +css::uno::Sequence< css::uno::Type > SAL_CALL SvXMLImportContext::getTypes() +{ +return { cppu::UnoType::get(), + cppu::UnoType::get() }; +} + +css::uno::Sequence< sal_Int8 > SAL_CALL SvXMLImportContext::getImplementationId() +{ +return css::uno::Sequence(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx |1 + xmloff/source/core/xmlimp.cxx |9 ++--- xmloff/source/transform/MutableAttrList.cxx |9 ++--- xmloff/source/transform/MutableAttrList.hxx |1 + xmloff/source/transform/OOo2Oasis.cxx | 15 --- xmloff/source/transform/OOo2Oasis.hxx |1 + xmloff/source/transform/Oasis2OOo.cxx | 15 --- xmloff/source/transform/Oasis2OOo.hxx |1 + 8 files changed, 32 insertions(+), 20 deletions(-) New commits: commit 5c4ba7cb99a7d4e4eefaa132e64d08fdc82ba759 Author: Arkadiy Illarionov AuthorDate: Sat Sep 7 16:03:28 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Sat Sep 14 09:57:48 2019 +0200 tdf#39593 use isUnoTunnelId in xmloff Add getUnoTunnelId methods. Change-Id: I80d3568e65ac66ee65ad589755a20270a27e62a7 Reviewed-on: https://gerrit.libreoffice.org/78744 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index d609ae099888..78bc26a7c234 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -343,6 +343,7 @@ public: virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; // XUnoTunnel +static const css::uno::Sequence& getUnoTunnelId() throw(); virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; // XServiceInfo diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 6c832c7bc8d5..ba715329736a 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -449,12 +449,15 @@ namespace class theSvXMLImportUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSvXMLImportUnoTunnelId> {}; } +const css::uno::Sequence& SvXMLImport::getUnoTunnelId() throw() +{ +return theSvXMLImportUnoTunnelId::get().getSeq(); +} + // XUnoTunnel sal_Int64 SAL_CALL SvXMLImport::getSomething( const uno::Sequence< sal_Int8 >& rId ) { -if( rId.getLength() == 16 && -0 == memcmp( theSvXMLImportUnoTunnelId::get().getSeq().getConstArray(), - rId.getConstArray(), 16 ) ) +if( isUnoTunnelId(rId) ) { return sal::static_int_cast(reinterpret_cast(this)); } diff --git a/xmloff/source/transform/MutableAttrList.cxx b/xmloff/source/transform/MutableAttrList.cxx index ae06de27d3c0..38c500ce23f2 100644 --- a/xmloff/source/transform/MutableAttrList.cxx +++ b/xmloff/source/transform/MutableAttrList.cxx @@ -66,13 +66,16 @@ namespace class theXMLMutableAttributeListUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theXMLMutableAttributeListUnoTunnelId> {}; } +const css::uno::Sequence& XMLMutableAttributeList::getUnoTunnelId() throw() +{ +return theXMLMutableAttributeListUnoTunnelId::get().getSeq(); +} + // XUnoTunnel sal_Int64 SAL_CALL XMLMutableAttributeList::getSomething( const Sequence< sal_Int8 >& rId ) { -if( rId.getLength() == 16 && -0 == memcmp( theXMLMutableAttributeListUnoTunnelId::get().getSeq().getConstArray(), - rId.getConstArray(), 16 ) ) +if( isUnoTunnelId(rId) ) { return sal::static_int_cast(reinterpret_cast(this)); } diff --git a/xmloff/source/transform/MutableAttrList.hxx b/xmloff/source/transform/MutableAttrList.hxx index dd311560c655..ed8950042bee 100644 --- a/xmloff/source/transform/MutableAttrList.hxx +++ b/xmloff/source/transform/MutableAttrList.hxx @@ -47,6 +47,7 @@ public: virtual ~XMLMutableAttributeList() override; // XUnoTunnel +static const css::uno::Sequence& getUnoTunnelId() throw(); virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; // css::xml::sax::XAttributeList diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx index d2c2ea35f23c..e5060c3846cd 100644 --- a/xmloff/source/transform/OOo2Oasis.cxx +++ b/xmloff/source/transform/OOo2Oasis.cxx @@ -1934,19 +1934,20 @@ namespace class theOOo2OasisTransformerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theOOo2OasisTransformerUnoTunnelId> {}; } +const css::uno::Sequence& OOo2OasisTransformer::getUnoTunnelId() throw() +{ +return theOOo2OasisTransformerUnoTunnelId::get().getSeq(); +} + // XUnoTunnel sal_Int64 SAL_CALL OOo2OasisTransformer::getSomething( const Sequence< sal_Int8 >& rId ) { -if( rId.getLength() == 16 -&& 0 == memcmp( theOOo2OasisTransformerUnoTunnelId::get().getSeq().getConstArray(), -rId.getConstArray(), 16 ) ) +if( isUnoTunnelId(rId) ) { return reinterpret_cast< sal_Int64 >( this ); } -else -{ -return sal_Int64(0); -} + +return sal_Int64(0); } // XServiceInfo diff --git a/xmloff/source/transform/OOo2Oasis.hxx b/xmloff/source/transform/OOo2Oasis.hxx index
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/nmspmap.hxx | 11 +-- xmloff/source/core/nmspmap.cxx | 33 +++-- 2 files changed, 24 insertions(+), 20 deletions(-) New commits: commit 787525a314de9c8178d0fedcd71ddbd08ec41a55 Author: Noel Grandin AuthorDate: Thu May 16 13:10:44 2019 +0200 Commit: Noel Grandin CommitDate: Sat May 18 15:10:52 2019 +0200 tdf#125254 Performance: A spreadsheet opens too slow, NameSpaceEntry NameSpaceEntry does not need to be a weak object, it is sufficient to be ref-counted. The empty string in SvXMLNamespaceMap can be statically allocated. Don't allocate a NameSpaceEntry in GetKeyByAttrName_ if we don't intend to cache it. Takes the load time from 39.5s to 38.5s. Change-Id: I4a9a1296af84c12d44e9b3ff354297f37d29f1e8 Reviewed-on: https://gerrit.libreoffice.org/72515 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/nmspmap.hxx b/include/xmloff/nmspmap.hxx index 1eb0f8f15b95..9c4c57393200 100644 --- a/include/xmloff/nmspmap.hxx +++ b/include/xmloff/nmspmap.hxx @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include @@ -39,7 +39,7 @@ const sal_uInt16 XML_NAMESPACE_NONE = USHRT_MAX-1; const sal_uInt16 XML_NAMESPACE_UNKNOWN = USHRT_MAX; const sal_uInt16 XML_NAMESPACE_UNKNOWN_FLAG = 0x8000; -class NameSpaceEntry : public cppu::OWeakObject +class NameSpaceEntry : public salhelper::SimpleReferenceObject { public: // sName refers to the full namespace name @@ -47,7 +47,7 @@ public: // sPrefix is the prefix used to declare a given item to be from a given namespace OUString sPrefix; // nKey is the unique identifier of a namespace -sal_uInt16 nKey; +sal_uInt16 nKey; }; typedef ::std::pair < sal_uInt16, OUString > QNamePair; @@ -65,12 +65,11 @@ struct QNamePairHash typedef std::unordered_map < QNamePair, OUString, QNamePairHash > QNameCache; typedef std::unordered_map < OUString, ::rtl::Reference > NameSpaceHash; -typedef std::map < sal_uInt16, ::rtl::Reference < NameSpaceEntry > > NameSpaceMap; +typedef std::unordered_map < sal_uInt16, ::rtl::Reference < NameSpaceEntry > > NameSpaceMap; class XMLOFF_DLLPUBLIC SvXMLNamespaceMap { -const OUString sXMLNS; -const OUString sEmpty; +OUStringsXMLNS; NameSpaceHash aNameHash; mutable NameSpaceHash aNameCache; diff --git a/xmloff/source/core/nmspmap.cxx b/xmloff/source/core/nmspmap.cxx index 248a36213ee4..669d0cc9f727 100644 --- a/xmloff/source/core/nmspmap.cxx +++ b/xmloff/source/core/nmspmap.cxx @@ -46,6 +46,8 @@ using namespace ::xmloff::token; * Martin 13/06/01 */ +static const OUString sEmpty; + SvXMLNamespaceMap::SvXMLNamespaceMap() : sXMLNS( GetXMLToken ( XML_XMLNS ) ) { @@ -302,47 +304,50 @@ sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName_( const OUString& rAttrName, } else { -rtl::Reference xEntry(new NameSpaceEntry); +OUString sEntryPrefix, sEntryName; sal_Int32 nColonPos = rAttrName.indexOf( ':' ); if( -1 == nColonPos ) { // case: no ':' found -> default namespace -xEntry->sPrefix.clear(); -xEntry->sName = rAttrName; +sEntryName = rAttrName; } else { // normal case: ':' found -> get prefix/suffix -xEntry->sPrefix = rAttrName.copy( 0L, nColonPos ); -xEntry->sName = rAttrName.copy( nColonPos + 1 ); +sEntryPrefix = rAttrName.copy( 0L, nColonPos ); +sEntryName = rAttrName.copy( nColonPos + 1 ); } if( pPrefix ) -*pPrefix = xEntry->sPrefix; +*pPrefix = sEntryPrefix; if( pLocalName ) -*pLocalName = xEntry->sName; +*pLocalName = sEntryName; -NameSpaceHash::const_iterator aIter = aNameHash.find( xEntry->sPrefix ); +NameSpaceHash::const_iterator aIter = aNameHash.find( sEntryPrefix ); if ( aIter != aNameHash.end() ) { // found: retrieve namespace key -nKey = xEntry->nKey = (*aIter).second->nKey; +nKey = (*aIter).second->nKey; if ( pNamespace ) *pNamespace = (*aIter).second->sName; } -else if ( xEntry->sPrefix == sXMLNS ) +else if ( sEntryPrefix == sXMLNS ) // not found, but xmlns prefix: return xmlns 'namespace' -nKey = xEntry->nKey = XML_NAMESPACE_XMLNS; +nKey = XML_NAMESPACE_XMLNS; else if( nColonPos == -1 ) // not found, and no namespace: 'namespace' none -nKey = xEntry->nKey = XML_NAMESPACE_NONE; +nKey = XML_NAMESPACE_NONE; else -nKey = xEntry->nKey = XML_NAMESPACE_UNKNOWN; +nKey = XML_NAMESPACE_UNKNOWN; if
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/AutoStyleEntry.hxx |2 include/xmloff/animexp.hxx |2 include/xmloff/shapeexport.hxx |2 include/xmloff/xmlimp.hxx |2 xmloff/source/chart/SchXMLExport.cxx| 10 - xmloff/source/core/xmlimp.cxx | 11 - xmloff/source/draw/animationexport.cxx | 188 +--- xmloff/source/draw/animexp.cxx |4 xmloff/source/draw/sdxmlexp.cxx |4 xmloff/source/draw/shapeexport.cxx |5 xmloff/source/draw/ximpshap.cxx | 10 - xmloff/source/draw/ximpshap.hxx |4 xmloff/source/forms/formattributes.cxx |1 xmloff/source/forms/formattributes.hxx |1 xmloff/source/style/impastpl.cxx|2 xmloff/source/transform/TransformerBase.cxx |3 xmloff/source/transform/TransformerBase.hxx |1 17 files changed, 94 insertions(+), 158 deletions(-) New commits: commit da3f4786959a972d2f1e3d4fa132a2627b4a462a Author: Noel Grandin AuthorDate: Thu Feb 21 09:51:36 2019 +0200 Commit: Noel Grandin CommitDate: Thu Mar 14 14:04:54 2019 +0100 loplugin:unusedfields in xmloff Change-Id: I96de7fa324e3d2e3f0f133c93cf73776f4615ed3 Reviewed-on: https://gerrit.libreoffice.org/68134 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/AutoStyleEntry.hxx b/include/xmloff/AutoStyleEntry.hxx index c961e09f107a..e56cf5924da3 100644 --- a/include/xmloff/AutoStyleEntry.hxx +++ b/include/xmloff/AutoStyleEntry.hxx @@ -22,8 +22,6 @@ namespace xmloff { struct XMLOFF_DLLPUBLIC AutoStyleEntry { -OUString m_aParentName; -OUString m_aName; std::vector> m_aXmlProperties; }; diff --git a/include/xmloff/animexp.hxx b/include/xmloff/animexp.hxx index 9dfdbc6bdccf..1c8035658cbf 100644 --- a/include/xmloff/animexp.hxx +++ b/include/xmloff/animexp.hxx @@ -35,7 +35,7 @@ class XMLAnimationsExporter : public salhelper::SimpleReferenceObject std::unique_ptr mpImpl; public: -XMLAnimationsExporter( XMLShapeExport* pShapeExp ); +XMLAnimationsExporter(); virtual ~XMLAnimationsExporter() override; static void prepare( const css::uno::Reference< css::drawing::XShape >& xShape ); diff --git a/include/xmloff/shapeexport.hxx b/include/xmloff/shapeexport.hxx index 13cd97505fab..cec87720ca88 100644 --- a/include/xmloff/shapeexport.hxx +++ b/include/xmloff/shapeexport.hxx @@ -158,14 +158,12 @@ class XMLOFF_DLLPUBLIC XMLShapeExport : public salhelper::SimpleReferenceObject private: SvXMLExport&mrExport; -rtl::Reference< XMLPropertyHandlerFactory > mxSdPropHdlFactory; rtl::Reference< SvXMLExportPropertyMapper > mxPropertySetMapper; rtl::Reference< XMLAnimationsExporter > mxAnimationsExporter; ShapesInfos maShapesInfos; ShapesInfos::iterator maCurrentShapesIter; boolmbExportLayer; ImplXMLShapeExportInfoVectormaShapeInfos; -ImplXMLShapeExportInfoVector::iterator maCurrentInfo; OUStringmsPresentationStylePrefix; // #88546# possibility to switch progress bar handling on/off diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 6e5210939105..6cbb0293dfc7 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -208,12 +208,10 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public cppu::WeakImplHelper< std::unique_ptr mpEventImportHelper; std::unique_ptr mpXMLErrors; rtl::ReferencempStyleMap; -OUStringmsPackageProtocol; SAL_DLLPRIVATE void InitCtor_(); SvXMLImportFlags const mnImportFlags; -SvXMLErrorFlags mnErrorFlags; std::set< OUString > embeddedFontUrlsKnown; bool isFastContext; css::uno::Reference< css::xml::sax::XFastParser > mxParser; diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 4c267354a693..fb22ca058d95 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -161,8 +161,6 @@ public: void SetChartRangeAddress( const OUString& rAddress ) { msChartAddress = rAddress; } -void SetTableNumberList( const OUString& rList ) -{ msTableNumberList = rList; } void InitRangeSegmentationProperties( const css::uno::Reference< css::chart2::XChartDocument > & xChartDoc ); @@ -259,7 +257,6 @@ public: bool mbHasCategoryLabels; //if the categories are only automatically generated this will be false bool mbRowSourceColumns; OUString msChartAddress; -OUString msTableNumberList; css::uno::Sequence< sal_Int32 > maSequenceMapping; OUString const msCLSID; @@ -3610,11 +3607,6 @@ void SchXMLExport::ExportContent_()
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/XMLTextListAutoStylePool.hxx |2 +- xmloff/source/text/XMLPropertyBackpatcher.cxx |9 - xmloff/source/text/XMLPropertyBackpatcher.hxx |6 -- xmloff/source/text/XMLTextListAutoStylePool.cxx |2 +- 4 files changed, 2 insertions(+), 17 deletions(-) New commits: commit ebd164d8a70657216d653a71cb31d872a14e Author: Noel Grandin AuthorDate: Wed Jan 23 09:09:02 2019 +0200 Commit: Noel Grandin CommitDate: Wed Jan 23 10:44:16 2019 +0100 loplugin:constparams in xmloff Change-Id: I8874c9204b8bf8f422fb5bb826a340b787589360 Reviewed-on: https://gerrit.libreoffice.org/66768 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/XMLTextListAutoStylePool.hxx b/include/xmloff/XMLTextListAutoStylePool.hxx index dc3690802b2a..9f40ac48de60 100644 --- a/include/xmloff/XMLTextListAutoStylePool.hxx +++ b/include/xmloff/XMLTextListAutoStylePool.hxx @@ -52,7 +52,7 @@ class XMLOFF_DLLPUBLIC XMLTextListAutoStylePool the NumRules don't have names */ css::uno::Reference< css::ucb::XAnyCompare > mxNumRuleCompare; -SAL_DLLPRIVATE sal_uInt32 Find( XMLTextListAutoStylePoolEntry_Impl* pEntry ) +SAL_DLLPRIVATE sal_uInt32 Find( const XMLTextListAutoStylePoolEntry_Impl* pEntry ) const; public: diff --git a/xmloff/source/text/XMLPropertyBackpatcher.cxx b/xmloff/source/text/XMLPropertyBackpatcher.cxx index a9f245d7229e..e5f18a7b25c3 100644 --- a/xmloff/source/text/XMLPropertyBackpatcher.cxx +++ b/xmloff/source/text/XMLPropertyBackpatcher.cxx @@ -80,15 +80,6 @@ void XMLPropertyBackpatcher::SetProperty( const Reference & xPropSet, const OUString& sName) { -Reference xNonConstPropSet(xPropSet); -SetProperty(xNonConstPropSet, sName); -} - -template -void XMLPropertyBackpatcher::SetProperty( -Reference & xPropSet, -const OUString& sName) -{ if (aIDMap.count(sName)) { // we know this ID -> set property diff --git a/xmloff/source/text/XMLPropertyBackpatcher.hxx b/xmloff/source/text/XMLPropertyBackpatcher.hxx index 029f25e66e4a..9cdda65f11d6 100644 --- a/xmloff/source/text/XMLPropertyBackpatcher.hxx +++ b/xmloff/source/text/XMLPropertyBackpatcher.hxx @@ -88,15 +88,9 @@ public: /// Set property with the proper value for this name. If the value /// is not yet known, store the XPropertySet in the backpatch list. /// Use this whenever the value should be set, even if it is not yet known. -/// const version void SetProperty( const css::uno::Reference & xPropSet, const OUString& sName); - -/// non-const version of SetProperty -void SetProperty( -css::uno::Reference & xPropSet, -const OUString& sName); }; #endif diff --git a/xmloff/source/text/XMLTextListAutoStylePool.cxx b/xmloff/source/text/XMLTextListAutoStylePool.cxx index 3736a201ca74..d77ad5e8e7c3 100644 --- a/xmloff/source/text/XMLTextListAutoStylePool.cxx +++ b/xmloff/source/text/XMLTextListAutoStylePool.cxx @@ -164,7 +164,7 @@ void XMLTextListAutoStylePool::RegisterName( const OUString& rName ) m_aNames.insert(rName); } -sal_uInt32 XMLTextListAutoStylePool::Find( XMLTextListAutoStylePoolEntry_Impl* pEntry ) const +sal_uInt32 XMLTextListAutoStylePool::Find( const XMLTextListAutoStylePoolEntry_Impl* pEntry ) const { if( !pEntry->IsNamed() && mxNumRuleCompare.is() ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/XMLEventExport.hxx |8 ++-- xmloff/source/core/xmlexp.cxx |5 +++-- xmloff/source/script/XMLEventExport.cxx | 13 +++-- 3 files changed, 12 insertions(+), 14 deletions(-) New commits: commit 35e1658e7275777ee94902b5014fd93b8daf975c Author: Noel Grandin AuthorDate: Mon Sep 17 09:39:45 2018 +0200 Commit: Noel Grandin CommitDate: Thu Sep 20 15:15:58 2018 +0200 loplugin:useuniqueptr in XMLEventExport Change-Id: I29a7c565db576afa4dbd0e0fbd1dfd99f9c989fc Reviewed-on: https://gerrit.libreoffice.org/60618 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/XMLEventExport.hxx b/include/xmloff/XMLEventExport.hxx index 797fc4a6dde3..8dba84465ace 100644 --- a/include/xmloff/XMLEventExport.hxx +++ b/include/xmloff/XMLEventExport.hxx @@ -29,6 +29,7 @@ #include #include +#include class SvXMLExport; namespace com { namespace sun { namespace star { @@ -38,7 +39,7 @@ namespace com { namespace sun { namespace star { namespace beans { struct PropertyValue; } } } } -typedef ::std::map< OUString, XMLEventExportHandler* > HandlerMap; +typedef ::std::map< OUString, std::unique_ptr > HandlerMap; typedef ::std::map< OUString, XMLEventName > NameMap; /** @@ -69,13 +70,16 @@ public: XMLEventExport(SvXMLExport& rExport); ~XMLEventExport(); +XMLEventExport& operator=( XMLEventExport const & ) = delete; // MSVC2017 workaround +XMLEventExport( XMLEventExport const & ) = delete; // MSVC2017 workaround + /// register an EventExportHandler for a particular script type /// /// The handlers will be deleted when the object is destroyed, hence /// no pointers to a handler registered with AddHandler() should be /// held by anyone. void AddHandler( const OUString& rName, - XMLEventExportHandler* rHandler ); + std::unique_ptr pHandler ); /// register additional event names void AddTranslationTable( const XMLEventNameTranslation* pTransTable ); diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index fc30db7b8bb2..c3b82f214246 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -95,6 +95,7 @@ #include #include +#include using namespace ::osl; using namespace ::com::sun::star; @@ -2010,8 +2011,8 @@ XMLEventExport& SvXMLExport::GetEventExport() mpEventExport.reset( new XMLEventExport(*this) ); // and register standard handlers + names -mpEventExport->AddHandler("StarBasic", new XMLStarBasicExportHandler()); -mpEventExport->AddHandler("Script", new XMLScriptExportHandler()); +mpEventExport->AddHandler("StarBasic", o3tl::make_unique()); +mpEventExport->AddHandler("Script", o3tl::make_unique()); mpEventExport->AddTranslationTable(aStandardEventTable); } diff --git a/xmloff/source/script/XMLEventExport.cxx b/xmloff/source/script/XMLEventExport.cxx index 64e47a45919c..72d550527bd1 100644 --- a/xmloff/source/script/XMLEventExport.cxx +++ b/xmloff/source/script/XMLEventExport.cxx @@ -52,21 +52,14 @@ XMLEventExport::XMLEventExport(SvXMLExport& rExp) : XMLEventExport::~XMLEventExport() { // delete all handlers -for( auto& rEntry : aHandlerMap ) -{ -delete rEntry.second; -} aHandlerMap.clear(); } void XMLEventExport::AddHandler( const OUString& rName, - XMLEventExportHandler* pHandler ) + std::unique_ptr pHandler ) { -DBG_ASSERT(pHandler != nullptr, "Need EventExportHandler"); -if (pHandler != nullptr) -{ -aHandlerMap[rName] = pHandler; -} +assert(pHandler); +aHandlerMap[rName] = std::move(pHandler); } void XMLEventExport::AddTranslationTable( ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/maptype.hxx |2 -- xmloff/source/core/attrlist.cxx |5 - 2 files changed, 7 deletions(-) New commits: commit e0e1a2d756498d8e00a94bf7535d964f8df3e6ec Author: Stephan Bergmann AuthorDate: Thu Jul 26 11:13:10 2018 +0200 Commit: Stephan Bergmann CommitDate: Thu Jul 26 14:43:03 2018 +0200 xmloff: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9) ...by removing explicitly user-provided functions that do the same as their implicitly-defined counterparts, but may prevent implicitly declared copy functions from being defined as non-deleted in the future Change-Id: Idd25cd86db429b0f3391e359bb2617863b29eb67 Reviewed-on: https://gerrit.libreoffice.org/58053 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/include/xmloff/maptype.hxx b/include/xmloff/maptype.hxx index 8a292008183e..0e944656f716 100644 --- a/include/xmloff/maptype.hxx +++ b/include/xmloff/maptype.hxx @@ -110,8 +110,6 @@ struct XMLPropertyState : mnIndex( nIndex ) {} XMLPropertyState( sal_Int32 nIndex, const css::uno::Any& rValue ) : mnIndex( nIndex ), maValue( rValue ) {} -XMLPropertyState( const XMLPropertyState& rPropState ) -: mnIndex( rPropState.mnIndex ), maValue( rPropState.maValue ) {} }; #endif // INCLUDED_XMLOFF_MAPTYPE_HXX diff --git a/xmloff/source/core/attrlist.cxx b/xmloff/source/core/attrlist.cxx index 5985ef2159be..5673d66f9d93 100644 --- a/xmloff/source/core/attrlist.cxx +++ b/xmloff/source/core/attrlist.cxx @@ -58,11 +58,6 @@ struct SvXMLAttributeList_Impl vecAttribute.reserve(20); } -SvXMLAttributeList_Impl( const SvXMLAttributeList_Impl& r ) : -vecAttribute( r.vecAttribute ) -{ -} - ::std::vector vecAttribute; typedef ::std::vector::size_type size_type; }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/txtimp.hxx |5 + include/xmloff/txtparae.hxx |2 ++ xmloff/source/text/XMLTextMarkImportContext.cxx | 13 + xmloff/source/text/txtimp.cxx | 20 xmloff/source/text/txtparae.cxx |2 ++ 5 files changed, 42 insertions(+) New commits: commit 412b1f8d2b03687a13784e3055c5b0f2507dfef2 Author: Serge Krot Date: Thu Mar 1 13:00:33 2018 +0100 tdf#101856 Backport parsing of bookmark properties Change-Id: I7654aa93d4d86a5d36201832ac3609b9f4c30e03 Reviewed-on: https://gerrit.libreoffice.org/50565 Reviewed-by: Thorsten Behrens Tested-by: Thorsten Behrens (cherry picked from commit 88b6b1a8c149163d226eb3295930e3407bcb8b5b) Reviewed-on: https://gerrit.libreoffice.org/56958 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx index 287413ba7f5c..c8e060f15d9c 100644 --- a/include/xmloff/txtimp.hxx +++ b/include/xmloff/txtimp.hxx @@ -711,6 +711,11 @@ public: void AddCrossRefHeadingMapping(OUString const& rFrom, OUString const& rTo); void MapCrossRefHeadingFieldsHorribly(); + +void setBookmarkAttributes(bool hidden, OUString const& condition); +bool getBookmarkHidden(); +const OUString& getBookmarkCondition(); + }; #endif diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx index 8fb299cae511..d06a335f1f83 100644 --- a/include/xmloff/txtparae.hxx +++ b/include/xmloff/txtparae.hxx @@ -204,6 +204,8 @@ private: const OUString sTextFieldStart; const OUString sTextFieldEnd; const OUString sTextFieldStartEnd; +const OUString m_sBookmarkHidden; +const OUString m_sBookmarkCondition; protected: const OUString sFrameStyleName; diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx index 3854f6c7e2da..62695a15c2f1 100644 --- a/xmloff/source/text/XMLTextMarkImportContext.cxx +++ b/xmloff/source/text/XMLTextMarkImportContext.cxx @@ -170,6 +170,13 @@ void XMLTextMarkImportContext::StartElement( } m_rHelper.pushFieldCtx( m_sBookmarkName, m_sFieldName ); } + +if (IsXMLToken(GetLocalName(), XML_BOOKMARK_START)) +{ +OUString sHidden = xAttrList->getValueByName("loext:hidden"); +OUString sCondition = xAttrList->getValueByName("loext:condition"); +m_rHelper.setBookmarkAttributes(sHidden == "true", sCondition); +} } void XMLTextMarkImportContext::EndElement() @@ -346,6 +353,12 @@ void XMLTextMarkImportContext::EndElement() GetImport().GetRDFaImportHelper().AddRDFa( xMeta, xRDFaAttributes); } +const Reference xPropertySet(xContent, UNO_QUERY); +if (xPropertySet.is()) +{ + xPropertySet->setPropertyValue("BookmarkHidden", uno::Any(m_rHelper.getBookmarkHidden())); + xPropertySet->setPropertyValue("BookmarkCondition", uno::Any(m_rHelper.getBookmarkCondition())); +} } if (nTmp==TypeFieldmarkEnd) { diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 7dadde85e2a2..bc5aba285195 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -547,6 +547,9 @@ struct XMLTextImportHelper::Impl // Used for frame deduplication, the name of the last frame imported directly before the current one OUString msLastImportedFrameName; +bool m_bBookmarkHidden; +OUString m_sBookmarkCondition; + uno::Reference m_xText; uno::Reference m_xCursor; uno::Reference m_xCursorAsRange; @@ -592,6 +595,7 @@ struct XMLTextImportHelper::Impl bool const bProgress, bool const bBlockMode, bool const bOrganizerMode) : m_xTextListsHelper( new XMLTextListsHelper() ) +, m_bBookmarkHidden( false ) // XML import: reconstrution of assignment of paragraph style to outline levels (#i69629#) , m_xServiceFactory( rModel, UNO_QUERY ) , m_rSvXMLImport( rImport ) @@ -2951,4 +2955,20 @@ void XMLTextImportHelper::MapCrossRefHeadingFieldsHorribly() } } +void XMLTextImportHelper::setBookmarkAttributes(bool hidden, OUString const& condition) +{ +m_xImpl->m_bBookmarkHidden = hidden; +m_xImpl->m_sBookmarkCondition = condition; +} + +bool XMLTextImportHelper::getBookmarkHidden() +{ +return m_xImpl->m_bBookmarkHidden; +} + +const OUString& XMLTextImportHelper::getBookmarkCondition() +{ +return m_xImpl->m_sBookmarkCondition; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/XMLFontAutoStylePool.hxx |5 + xmloff/source/style/XMLFontAutoStylePool.cxx | 80 +++ 2 files changed, 75 insertions(+), 10 deletions(-) New commits: commit b262e6e5da0c2e66e00cd6d68d7c2df11a34ff5c Author: Tomaž Vajngerl Date: Tue Jun 26 20:06:40 2018 +0200 xmloff: prevent embedding same font files with checksumming When embedding fonts to ODF documents we can get into a situation where the same font is embedded multiple times and this wastes space. To prevent this we calculate the checksum of the font first and track the fonts that are embedded. When the font has the same checksum, the path to already embedded font is returned. Change-Id: I087c42d9a63b1697b9b4ea985dbce2fda760a996 Reviewed-on: https://gerrit.libreoffice.org/56507 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/xmloff/XMLFontAutoStylePool.hxx b/include/xmloff/XMLFontAutoStylePool.hxx index e747bb8b20d8..530d05b2762a 100644 --- a/include/xmloff/XMLFontAutoStylePool.hxx +++ b/include/xmloff/XMLFontAutoStylePool.hxx @@ -26,6 +26,7 @@ #include #include #include +#include #include class XMLFontAutoStylePool_Impl; @@ -33,13 +34,15 @@ class SvXMLExport; class XMLOFF_DLLPUBLIC XMLFontAutoStylePool : public salhelper::SimpleReferenceObject { +private: SvXMLExport& rExport; std::unique_ptr m_pFontAutoStylePool; std::set m_aNames; bool m_bTryToEmbedFonts; +std::unordered_map m_aEmbeddedFontFiles; -OUString embedFontFile( const OUString& fontUrl ); +OUString embedFontFile(OUString const & rFileUrl, OUString const & rFamilyName); protected: diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx index 1c13ea75cff4..1fb06598f841 100644 --- a/xmloff/source/style/XMLFontAutoStylePool.cxx +++ b/xmloff/source/style/XMLFontAutoStylePool.cxx @@ -34,6 +34,7 @@ #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -367,7 +368,7 @@ void XMLFontAutoStylePool::exportXML() if (!fontFilesMap.count(sFileUrl)) { const OUString docUrl = bExportFlat ? -lcl_checkFontFile(sFileUrl) : embedFontFile(sFileUrl); +lcl_checkFontFile(sFileUrl) : embedFontFile(sFileUrl, pEntry->GetFamilyName()); if (!docUrl.isEmpty()) fontFilesMap[sFileUrl] = docUrl; else @@ -429,10 +430,72 @@ void XMLFontAutoStylePool::exportXML() } } -OUString XMLFontAutoStylePool::embedFontFile( const OUString& fileUrl ) +OUString getFreeFontName(uno::Reference const & rxStorage, OUString const & rFamilyName) +{ +OUString sName; +int nIndex = 1; +do +{ +sName = "Font_" + +rFamilyName.replaceAll(" ", "_") + "_" + +OUString::number(nIndex) + ".ttf"; +nIndex++; +} while (rxStorage->hasByName(sName)); + +return sName; +} + +OString convertToHashString(std::vector const & rHash) +{ +std::stringstream aStringStream; +for (auto const & rByte : rHash) +{ +aStringStream << std::setw(2) << std::setfill('0') << std::hex << int(rByte); +} + +return OString(aStringStream.str().c_str()); +} + +OString getFileHash(OUString const & rFileUrl) +{ +OString aHash; +osl::File aFile(rFileUrl); +if (aFile.open(osl_File_OpenFlag_Read) != osl::File::E_None) +return aHash; + +comphelper::Hash aHashEngine(comphelper::HashType::SHA512); +for (;;) +{ +sal_Int8 aBuffer[4096]; +sal_uInt64 nReadSize; +sal_Bool bEof; +if (aFile.isEndOfFile() != osl::File::E_None) +{ +SAL_WARN("xmloff", "Error reading font file " << rFileUrl); +return aHash; +} +if (bEof) +break; +if (aFile.read(aBuffer, 4096, nReadSize) != osl::File::E_None) +{ +SAL_WARN("xmloff", "Error reading font file " << rFileUrl); +return aHash; +} +if (nReadSize == 0) +break; +aHashEngine.update(reinterpret_cast(aBuffer), nReadSize); +} +return convertToHashString(aHashEngine.finalize()); +} + +OUString XMLFontAutoStylePool::embedFontFile(OUString const & fileUrl, OUString const & rFamilyName) { try { +OString sHashString = getFileHash(fileUrl); +if (m_aEmbeddedFontFiles.find(sHashString) != m_aEmbeddedFontFiles.end()) +return m_aEmbeddedFontFiles.at(sHashString); + osl::File file( fileUrl ); if( file.open( osl_File_OpenFlag_Read ) != osl::File::E_None ) return OUString(); @@ -443,12 +506,9 @@ OUString XMLFontAutoStylePool::embedFontFile( const OUString& fileUrl ) uno::Reference<
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/XMLFontAutoStylePool.hxx |4 +-- xmloff/source/style/XMLFontAutoStylePool.cxx | 28 +-- 2 files changed, 16 insertions(+), 16 deletions(-) New commits: commit 8db2426f36133d5e709f57be31e0c8630c30ed53 Author: Tomaž Vajngerl Date: Sat Jun 16 14:41:49 2018 +0200 xmloff: add m_ prefix to instance vars in XMLFontAutoStylePool Change-Id: I42bb50f3857392ffb15741942bbe8cef255a41f7 Reviewed-on: https://gerrit.libreoffice.org/55930 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/xmloff/XMLFontAutoStylePool.hxx b/include/xmloff/XMLFontAutoStylePool.hxx index dabb3e5759ff..e747bb8b20d8 100644 --- a/include/xmloff/XMLFontAutoStylePool.hxx +++ b/include/xmloff/XMLFontAutoStylePool.hxx @@ -35,9 +35,9 @@ class XMLOFF_DLLPUBLIC XMLFontAutoStylePool : public salhelper::SimpleReferenceO { SvXMLExport& rExport; -std::unique_ptr pPool; +std::unique_ptr m_pFontAutoStylePool; std::set m_aNames; -bool tryToEmbedFonts; +bool m_bTryToEmbedFonts; OUString embedFontFile( const OUString& fontUrl ); diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx index c33956a591b5..9af923bc3036 100644 --- a/xmloff/source/style/XMLFontAutoStylePool.cxx +++ b/xmloff/source/style/XMLFontAutoStylePool.cxx @@ -137,10 +137,10 @@ public: } }; -XMLFontAutoStylePool::XMLFontAutoStylePool( SvXMLExport& rExp, bool _tryToEmbedFonts ) : +XMLFontAutoStylePool::XMLFontAutoStylePool(SvXMLExport& rExp, bool bTryToEmbedFonts) : rExport( rExp ), -pPool( new XMLFontAutoStylePool_Impl ), -tryToEmbedFonts( _tryToEmbedFonts ) +m_pFontAutoStylePool( new XMLFontAutoStylePool_Impl ), +m_bTryToEmbedFonts( bTryToEmbedFonts ) { } @@ -158,8 +158,8 @@ OUString XMLFontAutoStylePool::Add( OUString sPoolName; XMLFontAutoStylePoolEntry_Impl aTmp( rFamilyName, rStyleName, nFamily, nPitch, eEnc ); -XMLFontAutoStylePool_Impl::const_iterator it = pPool->find( ); -if( it != pPool->end() ) +XMLFontAutoStylePool_Impl::const_iterator it = m_pFontAutoStylePool->find( ); +if( it != m_pFontAutoStylePool->end() ) { sPoolName = (*it)->GetName(); } @@ -195,8 +195,9 @@ OUString XMLFontAutoStylePool::Add( XMLFontAutoStylePoolEntry_Impl *pEntry = new XMLFontAutoStylePoolEntry_Impl( sName, rFamilyName, rStyleName, nFamily, nPitch, eEnc ); -pPool->insert( pEntry ); +m_pFontAutoStylePool->insert( pEntry ); m_aNames.insert(sName); +printf ("%s\n", sName.toUtf8().getStr()); } return sPoolName; @@ -212,8 +213,8 @@ OUString XMLFontAutoStylePool::Find( OUString sName; XMLFontAutoStylePoolEntry_Impl aTmp( rFamilyName, rStyleName, nFamily, nPitch, eEnc ); -XMLFontAutoStylePool_Impl::const_iterator it = pPool->find( ); -if( it != pPool->end() ) +XMLFontAutoStylePool_Impl::const_iterator it = m_pFontAutoStylePool->find( ); +if( it != m_pFontAutoStylePool->end() ) { sName = (*it)->GetName(); } @@ -299,10 +300,10 @@ void XMLFontAutoStylePool::exportXML() const SvXMLUnitConverter& rUnitConv = GetExport().GetMM100UnitConverter(); std::map< OUString, OUString > fontFilesMap; // our url to document url -sal_uInt32 nCount = pPool->size(); +sal_uInt32 nCount = m_pFontAutoStylePool->size(); for( sal_uInt32 i=0; iGetName() ); @@ -337,16 +338,15 @@ void XMLFontAutoStylePool::exportXML() XML_FONT_FACE, true, true ); -if( tryToEmbedFonts ) +if (m_bTryToEmbedFonts) { const bool bExportFlat( GetExport().getExportFlags() & SvXMLExportFlags::EMBEDDED ); std::vector< EmbeddedFontInfo > aEmbeddedFonts; static const FontWeight weight[] = { WEIGHT_NORMAL, WEIGHT_BOLD, WEIGHT_NORMAL, WEIGHT_BOLD }; static const FontItalic italic[] = { ITALIC_NONE, ITALIC_NONE, ITALIC_NORMAL, ITALIC_NORMAL }; assert( SAL_N_ELEMENTS( weight ) == SAL_N_ELEMENTS( italic )); -for( unsigned int j = 0; - j < SAL_N_ELEMENTS( weight ); - ++j ) + +for (unsigned int j = 0; j < SAL_N_ELEMENTS(weight); ++j) { // Embed font if at least viewing is allowed (in which case the opening app must check // the font license rights too and open either read-only or not use the font for editing). ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/controlpropertyhdl.hxx |2 ++ xmloff/source/forms/controlpropertyhdl.cxx | 10 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) New commits: commit fa47856e51c2c1102b3df0adead2c0701bd4cbde Author: Michael StahlDate: Tue Apr 10 10:26:44 2018 +0200 xmloff: fix leak in XMLPropertySetMapperEntry_Impl The XMLNamedBoolPropertyHdl should be owned by OControlPropertyHandlerFactory like all the other handlers created in that function. Thanks to Julien Nabet for pointing out the problem. Change-Id: Id474b2fdb84ca74f686d0c888fbedbee623c31bb Reviewed-on: https://gerrit.libreoffice.org/52666 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/include/xmloff/controlpropertyhdl.hxx b/include/xmloff/controlpropertyhdl.hxx index edcbd476f915..dd7010cc0f8f 100644 --- a/include/xmloff/controlpropertyhdl.hxx +++ b/include/xmloff/controlpropertyhdl.hxx @@ -30,6 +30,7 @@ #include #include #include +#include template struct SvXMLEnumMapEntry; class Color; @@ -119,6 +120,7 @@ namespace xmloff mutable std::unique_ptr m_pFontWidthHandler; mutable std::unique_ptr m_pFontEmphasisHandler; mutable std::unique_ptr m_pFontReliefHandler; +mutable std::unique_ptr m_pTextLineModeHandler; public: OControlPropertyHandlerFactory(); diff --git a/xmloff/source/forms/controlpropertyhdl.cxx b/xmloff/source/forms/controlpropertyhdl.cxx index ba5a27f8661d..839789167e9e 100644 --- a/xmloff/source/forms/controlpropertyhdl.cxx +++ b/xmloff/source/forms/controlpropertyhdl.cxx @@ -99,9 +99,13 @@ namespace xmloff pHandler = m_pFontReliefHandler.get(); break; case XML_TYPE_TEXT_LINE_MODE: -pHandler = new XMLNamedBoolPropertyHdl( - ::xmloff::token::XML_SKIP_WHITE_SPACE, -::xmloff::token::XML_CONTINUOUS); +if (!m_pTextLineModeHandler) +{ +m_pTextLineModeHandler = o3tl::make_unique( +::xmloff::token::XML_SKIP_WHITE_SPACE, +::xmloff::token::XML_CONTINUOUS); +} +pHandler = m_pTextLineModeHandler.get(); break; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmltoken.hxx|7 +++ xmloff/source/core/xmltoken.cxx|7 +++ xmloff/source/draw/shapeexport.cxx | 20 ++-- xmloff/source/token/tokens.txt |7 +++ 4 files changed, 31 insertions(+), 10 deletions(-) New commits: commit ecb20d71ff6bd6e6230c06a2c50ee71d35c88949 Author: Samuel MehrbrodtDate: Mon Mar 19 11:33:53 2018 +0100 Signatureline ODF export: Use tokens instead of plain strings Change-Id: I80eca35b03be2a7f288705295a355f08fbc757be Reviewed-on: https://gerrit.libreoffice.org/51542 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index ddd50ab9e6a0..bb76cbf48678 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -368,6 +368,7 @@ namespace xmloff { namespace token { XML_CALCULATION_SETTINGS, XML_CALENDAR, XML_CAPITALIZE_ENTRIES, +XML_CAN_ADD_COMMENT, XML_CAPTION, XML_CAPTION_POINT_X, XML_CAPTION_POINT_Y, @@ -1942,8 +1943,14 @@ namespace xmloff { namespace token { XML_DOT_DASH, XML_DOT_DOT_DASH, XML_LONG_DASH, +XML_SHOW_SIGN_DATE, +XML_SIGNATURELINE, +XML_SIGNING_INSTRUCTIONS, XML_SINGLE, XML_SMALL_WAVE, +XML_SUGGESTED_SIGNER_EMAIL, +XML_SUGGESTED_SIGNER_NAME, +XML_SUGGESTED_SIGNER_TITLE, XML_WAVE, XML_UNFORMATTED_TEXT, XML_UNION, diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 4893fade61ab..1475d4f99b19 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -368,6 +368,7 @@ namespace xmloff { namespace token { TOKEN( "calculation-settings",XML_CALCULATION_SETTINGS ), TOKEN( "calendar",XML_CALENDAR ), TOKEN( "capitalize-entries", XML_CAPITALIZE_ENTRIES ), +TOKEN( "can-add-comment", XML_CAN_ADD_COMMENT ), TOKEN( "caption", XML_CAPTION ), TOKEN( "caption-point-x", XML_CAPTION_POINT_X ), TOKEN( "caption-point-y", XML_CAPTION_POINT_Y ), @@ -1943,8 +1944,14 @@ namespace xmloff { namespace token { TOKEN( "dot-dash",XML_DOT_DASH ), TOKEN( "dot-dot-dash",XML_DOT_DOT_DASH ), TOKEN( "long-dash", XML_LONG_DASH ), +TOKEN( "show-sign-date", XML_SHOW_SIGN_DATE ), +TOKEN( "signatureline", XML_SIGNATURELINE ), +TOKEN( "signing-instructions",XML_SIGNING_INSTRUCTIONS ), TOKEN( "single", XML_SINGLE ), TOKEN( "small-wave", XML_SMALL_WAVE ), +TOKEN( "suggested-signer-email", XML_SUGGESTED_SIGNER_EMAIL ), +TOKEN( "suggested-signer-name", XML_SUGGESTED_SIGNER_NAME ), +TOKEN( "suggested-signer-title", XML_SUGGESTED_SIGNER_TITLE ), TOKEN( "wave",XML_WAVE ), TOKEN( "unformatted-text",XML_UNFORMATTED_TEXT ), TOKEN( "union", XML_UNION ), diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 3a685ac3697a..a670d6dad8ec 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -1269,39 +1269,39 @@ void XMLShapeExport::ImpExportSignatureLine(const uno::ReferencegetPropertyValue("SignatureLineId") >>= aSignatureLineId; -mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "id", aSignatureLineId); +mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_ID, aSignatureLineId); OUString aSuggestedSignerName; xPropSet->getPropertyValue("SignatureLineSuggestedSignerName") >>= aSuggestedSignerName; if (!aSuggestedSignerName.isEmpty()) -mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "suggested-signer-name", aSuggestedSignerName); +mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_SUGGESTED_SIGNER_NAME, aSuggestedSignerName); OUString aSuggestedSignerTitle; xPropSet->getPropertyValue("SignatureLineSuggestedSignerTitle") >>= aSuggestedSignerTitle; if (!aSuggestedSignerTitle.isEmpty()) -mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "suggested-signer-title", aSuggestedSignerTitle); +mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_SUGGESTED_SIGNER_TITLE, aSuggestedSignerTitle); OUString aSuggestedSignerEmail; xPropSet->getPropertyValue("SignatureLineSuggestedSignerEmail") >>= aSuggestedSignerEmail; if (!aSuggestedSignerEmail.isEmpty()) -mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "suggested-signer-email", aSuggestedSignerEmail); +
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlexp.hxx |4 --- xmloff/source/core/xmlexp.cxx | 31 -- xmloff/source/forms/propertyexport.cxx | 39 ++--- 3 files changed, 32 insertions(+), 42 deletions(-) New commits: commit 0d1479cbd442c3ec3bdd20333c341ea24dcca21e Author: Tomaž VajngerlDate: Sat Mar 10 00:42:20 2018 +0900 xmloff: modify code relying on Graph.Object URL and cleanup code Change-Id: Id08ee261ae06673809fcf8581e2490ecd957891f Reviewed-on: https://gerrit.libreoffice.org/51011 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index b225a932dd86..cf132192bc39 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -137,7 +137,6 @@ class XMLOFF_DLLPUBLIC SvXMLExport : public cppu::WeakImplHelper< rtl::Reference mxAttrList;// a common attribute list OUString msOrigFileName; // the original URL -OUString msGraphicObjectProtocol; OUString msEmbeddedObjectProtocol; OUString msFilterName; OUString msImgFilterName; @@ -460,9 +459,6 @@ public: /// get the export for image maps XMLImageMapExport& GetImageMapExport(); -OUString AddEmbeddedGraphicObject( -const OUString& rGraphicObjectURL ); - OUString AddEmbeddedXGraphic(css::uno::Reference const & rxGraphic, OUString & rOutMimeType, OUString const & rRequestedName = OUString()); bool AddEmbeddedXGraphicAsBase64(css::uno::Reference const & rxGraphic); bool GetGraphicMimeTypeFromStream(css::uno::Reference const & rxGraphic, OUString & rOutMimeType); diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index a3a41b31443e..c0be7c830a09 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -396,7 +396,6 @@ void SvXMLExport::InitCtor_() GetXMLToken(XML_NP_CSS3TEXT), GetXMLToken(XML_N_CSS3TEXT), XML_NAMESPACE_CSS3TEXT ); } -msGraphicObjectProtocol = "vnd.sun.star.GraphicObject:"; msEmbeddedObjectProtocol = "vnd.sun.star.EmbeddedObject:"; if (mxModel.is() && !mxEventListener.is()) @@ -1867,23 +1866,6 @@ sal_Int32 SvXMLExport::dataStyleForceSystemLanguage(sal_Int32 nFormat) const ? mpNumExport->ForceSystemLanguage( nFormat ) : nFormat; } -OUString SvXMLExport::AddEmbeddedGraphicObject( const OUString& rGraphicObjectURL ) -{ -OUString sRet( rGraphicObjectURL ); -if( rGraphicObjectURL.startsWith( msGraphicObjectProtocol ) && -mxGraphicResolver.is() ) -{ -if( !(getExportFlags() & SvXMLExportFlags::EMBEDDED) ) -sRet = mxGraphicResolver->resolveGraphicObjectURL( rGraphicObjectURL ); -else -sRet.clear(); -} -else -sRet = GetRelativeReference( sRet ); - -return sRet; -} - OUString SvXMLExport::AddEmbeddedXGraphic(uno::Reference const & rxGraphic, OUString & rOutMimeType, OUString const & rRequestedName) { OUString sURL; @@ -1951,12 +1933,10 @@ bool SvXMLExport::AddEmbeddedXGraphicAsBase64(uno::Reference OUString SvXMLExport::AddEmbeddedObject( const OUString& rEmbeddedObjectURL ) { OUString sRet; -if( (rEmbeddedObjectURL.startsWith( msEmbeddedObjectProtocol ) || - rEmbeddedObjectURL.startsWith( msGraphicObjectProtocol ) ) && -mxEmbeddedResolver.is() ) +if (rEmbeddedObjectURL.startsWith(msEmbeddedObjectProtocol) && +mxEmbeddedResolver.is()) { -sRet = -mxEmbeddedResolver->resolveEmbeddedObjectURL( rEmbeddedObjectURL ); +sRet = mxEmbeddedResolver->resolveEmbeddedObjectURL(rEmbeddedObjectURL); } else sRet = GetRelativeReference( rEmbeddedObjectURL ); @@ -1967,9 +1947,8 @@ OUString SvXMLExport::AddEmbeddedObject( const OUString& rEmbeddedObjectURL ) bool SvXMLExport::AddEmbeddedObjectAsBase64( const OUString& rEmbeddedObjectURL ) { bool bRet = false; -if( (rEmbeddedObjectURL.startsWith( msEmbeddedObjectProtocol ) || - rEmbeddedObjectURL.startsWith( msGraphicObjectProtocol ) ) && -mxEmbeddedResolver.is() ) +if (rEmbeddedObjectURL.startsWith(msEmbeddedObjectProtocol) && +mxEmbeddedResolver.is()) { Reference < XNameAccess > xNA( mxEmbeddedResolver, UNO_QUERY ); if( xNA.is() ) diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx index 2f611bc61f8b..df34513b94a4 100644 --- a/xmloff/source/forms/propertyexport.cxx +++ b/xmloff/source/forms/propertyexport.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -46,6 +47,7 @@ namespace xmloff { +using namespace css; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmltoken.hxx |1 + xmloff/source/core/xmltoken.cxx |1 + xmloff/source/token/tokens.txt |1 + 3 files changed, 3 insertions(+) New commits: commit 5222383c29d190218108c7c9e362a5a55af73a2f Author: Julien NabetDate: Mon Feb 5 14:07:06 2018 +0100 tdf#115429: declare fill-rule Change-Id: I5eb93d08b1dd56db19038132b560ddf7ba174bc6 Reviewed-on: https://gerrit.libreoffice.org/49242 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index 531c81889742..242a93f28d48 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -777,6 +777,7 @@ namespace xmloff { namespace token { XML_FILL_IMAGE_REF_POINT_X, XML_FILL_IMAGE_REF_POINT_Y, XML_FILL_IMAGE_WIDTH, +XML_FILL_RULE, XML_FILTER, XML_FILTER_AND, XML_FILTER_CONDITION, diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 26ca52d0966e..e4718637eace 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -777,6 +777,7 @@ namespace xmloff { namespace token { TOKEN( "fill-image-ref-point-x", XML_FILL_IMAGE_REF_POINT_X ), TOKEN( "fill-image-ref-point-y", XML_FILL_IMAGE_REF_POINT_Y ), TOKEN( "fill-image-width",XML_FILL_IMAGE_WIDTH ), +TOKEN( "fill-rule", XML_FILL_RULE ), TOKEN( "filter", XML_FILTER ), TOKEN( "filter-and", XML_FILTER_AND ), TOKEN( "filter-condition",XML_FILTER_CONDITION ), diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt index 4e58356c7c07..cc0b35ad084c 100644 --- a/xmloff/source/token/tokens.txt +++ b/xmloff/source/token/tokens.txt @@ -700,6 +700,7 @@ fill-image-ref-point fill-image-ref-point-x fill-image-ref-point-y fill-image-width +fill-rule filter filter-and filter-condition ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlexp.hxx |1 + xmloff/source/core/xmlexp.cxx | 17 + 2 files changed, 18 insertions(+) New commits: commit 233a6332500a30ba4bd44d09635ac7cbfe91beb7 Author: Tomaž VajngerlDate: Sat Feb 17 08:34:48 2018 +0900 GetEmbeddedXGraphicStream to read XGraphic as stream This is an alternative to GetEmbeddedGraphicObjectStream which uses URL as parameter and will be removed soon. Change-Id: I3c7431bdeed0bd4ed3c7f48517a52846d0944ed2 Reviewed-on: https://gerrit.libreoffice.org/49893 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index 6024d9f877ca..2d367b433935 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -465,6 +465,7 @@ public: OUString AddEmbeddedXGraphic(css::uno::Reference const & rxGraphic, OUString const & rRequestedName = OUString()); bool AddEmbeddedXGraphicAsBase64(css::uno::Reference const & rxGraphic); +css::uno::Reference GetEmbeddedXGraphicStream(css::uno::Reference const & rxGraphic); css::uno::Reference GetEmbeddedGraphicObjectStream( const OUString& rGraphicObjectURL); diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 7f5df92e5875..4d3533ae4c09 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1926,6 +1926,23 @@ Reference< XInputStream > SvXMLExport::GetEmbeddedGraphicObjectStream( const OUS return nullptr; } +uno::Reference SvXMLExport::GetEmbeddedXGraphicStream(uno::Reference const & rxGraphic) +{ +uno::Reference xInputStream; + +if ((getExportFlags() & SvXMLExportFlags::EMBEDDED) && mxGraphicResolver.is()) +{ +uno::Reference xGraphicStorageHandler(mxGraphicResolver, uno::UNO_QUERY); + +if (xGraphicStorageHandler.is()) +{ +xInputStream = xGraphicStorageHandler->createInputStream(rxGraphic); +} +} + +return xInputStream; +} + bool SvXMLExport::AddEmbeddedXGraphicAsBase64(uno::Reference const & rxGraphic) { if ((getExportFlags() & SvXMLExportFlags::EMBEDDED) && ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlexp.hxx |2 +- xmloff/source/core/xmlexp.cxx |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) New commits: commit 1fa153966332f57d23ee31fe97a24fd73317af9c Author: Tomaž VajngerlDate: Sun Feb 11 14:28:55 2018 +0900 AddEmbeddedXGraphic: add parameter for requested name Change-Id: Id5f028d3286513b468bc0637484507a34b2188a2 Reviewed-on: https://gerrit.libreoffice.org/49644 Reviewed-by: Tomaž Vajngerl Tested-by: Tomaž Vajngerl diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index 203be8fdfd0f..6024d9f877ca 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -463,7 +463,7 @@ public: OUString AddEmbeddedGraphicObject( const OUString& rGraphicObjectURL ); -OUString AddEmbeddedXGraphic(css::uno::Reference const & rxGraphic); +OUString AddEmbeddedXGraphic(css::uno::Reference const & rxGraphic, OUString const & rRequestedName = OUString()); bool AddEmbeddedXGraphicAsBase64(css::uno::Reference const & rxGraphic); css::uno::Reference GetEmbeddedGraphicObjectStream( diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index cfee78ca7762..a3015b8903ef 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1882,7 +1882,7 @@ OUString SvXMLExport::AddEmbeddedGraphicObject( const OUString& rGraphicObjectUR return sRet; } -OUString SvXMLExport::AddEmbeddedXGraphic(uno::Reference const & rxGraphic) +OUString SvXMLExport::AddEmbeddedXGraphic(uno::Reference const & rxGraphic, OUString const & rRequestedName) { OUString sInternalURL; @@ -1892,7 +1892,7 @@ OUString SvXMLExport::AddEmbeddedXGraphic(uno::Reference cons { if (!(getExportFlags() & SvXMLExportFlags::EMBEDDED)) { -sInternalURL = xGraphicStorageHandler->saveGraphic(rxGraphic); +sInternalURL = xGraphicStorageHandler->saveGraphicByName(rxGraphic, rRequestedName); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/unointerfacetouniqueidentifiermapper.hxx |2 +- xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit 05e3feb495ff3078c80b1af6aad7c33ac5340b01 Author: Caolán McNamaraDate: Fri Feb 9 11:30:10 2018 + ofz#6180 Integer-overflow Change-Id: I6339a6ebb188dc9e7bccfa629a40af8e67c13feb Reviewed-on: https://gerrit.libreoffice.org/49487 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/xmloff/unointerfacetouniqueidentifiermapper.hxx b/include/xmloff/unointerfacetouniqueidentifiermapper.hxx index 50b70eee5346..8a715a398dd8 100644 --- a/include/xmloff/unointerfacetouniqueidentifiermapper.hxx +++ b/include/xmloff/unointerfacetouniqueidentifiermapper.hxx @@ -75,7 +75,7 @@ private: void insertReference( const OUString& rIdentifier, const css::uno::Reference< css::uno::XInterface >& rInterface ); IdMap_t maEntries; -sal_Int32 mnNextId; +sal_uInt32 mnNextId; }; } diff --git a/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx b/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx index 795aa5838218..5e144d7f7053 100644 --- a/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx +++ b/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx @@ -166,7 +166,7 @@ void UnoInterfaceToUniqueIdentifierMapper::insertReference( const OUString& rIde // so we make sure we will never generate // an integer value like this one sal_Int32 nId = rIdentifier.copy(2).toInt32(); -if( mnNextId <= nId ) +if (nId > 0 && mnNextId <= static_cast(nId)) mnNextId = nId + 1; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlexp.hxx | 14 +++--- xmloff/source/core/xmlexp.cxx | 42 +- 2 files changed, 28 insertions(+), 28 deletions(-) New commits: commit a8c1083553ee4c0d85bacef4ea4cdef0de8927d3 Author: Noel GrandinDate: Wed Jan 17 11:08:46 2018 +0200 loplugin:useuniqueptr in SvXMLExport Change-Id: I8ce26b7cddeb74fd86f60896c84bf3574ccbc9bc Reviewed-on: https://gerrit.libreoffice.org/48421 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index ad934e1f612a..fe73d0d6ab5d 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -140,10 +140,10 @@ class XMLOFF_DLLPUBLIC SvXMLExport : public cppu::WeakImplHelper< OUString msEmbeddedObjectProtocol; OUString msFilterName; OUString msImgFilterName; -SvXMLNamespaceMap *mpNamespaceMap;// the namepspace map +std::unique_ptr mpNamespaceMap;// the namepspace map SvXMLUnitConverter maUnitConv;// the unit converter -SvXMLNumFmtExport *mpNumExport; -ProgressBarHelper *mpProgressBarHelper; +std::unique_ptr mpNumExport; +std::unique_ptr mpProgressBarHelper; rtl::Reference< XMLTextParagraphExport > mxTextParagraphExport; rtl::Reference< XMLShapeExport > mxShapeExport; @@ -152,9 +152,9 @@ class XMLOFF_DLLPUBLIC SvXMLExport : public cppu::WeakImplHelper< rtl::Reference< XMLPageExport > mxPageExport; rtl::Reference< XMLFontAutoStylePool > mxFontAutoStylePool; rtl::Reference< xmloff::OFormLayerXMLExport > mxFormExport; -XMLEventExport* mpEventExport; -XMLImageMapExport* mpImageMapExport; -XMLErrors* mpXMLErrors; +std::unique_ptr mpEventExport; +std::unique_ptr mpImageMapExport; +std::unique_ptr mpXMLErrors; const enum ::xmloff::token::XMLTokenEnum meClass; SAL_DLLPRIVATE void InitCtor_(); @@ -420,7 +420,7 @@ public: { mxNumberFormatsSupplier = _xNumberFormatSupplier; if ( mxNumberFormatsSupplier.is() && mxHandler.is() ) -mpNumExport = new SvXMLNumFmtExport(*this, mxNumberFormatsSupplier); +mpNumExport.reset( new SvXMLNumFmtExport(*this, mxNumberFormatsSupplier) ); } // get export helper for text diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 796390f2b1e1..d06eb49da770 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -258,7 +258,7 @@ public: /// stack of backed up namespace maps /// long: depth at which namespace map has been backed up into the stack -::std::stack< ::std::pair< SvXMLNamespaceMap *, long > > mNamespaceMaps; +::std::stack< ::std::pair< std::unique_ptr, long > > mNamespaceMaps; /// counts depth (number of open elements/start tags) long mDepth; @@ -480,7 +480,7 @@ SvXMLExport::SvXMLExport( InitCtor_(); if (mxNumberFormatsSupplier.is()) -mpNumExport = new SvXMLNumFmtExport(*this, mxNumberFormatsSupplier); +mpNumExport.reset( new SvXMLNumFmtExport(*this, mxNumberFormatsSupplier) ); } SvXMLExport::SvXMLExport( @@ -519,15 +519,15 @@ SvXMLExport::SvXMLExport( InitCtor_(); if (mxNumberFormatsSupplier.is()) -mpNumExport = new SvXMLNumFmtExport(*this, mxNumberFormatsSupplier); +mpNumExport.reset( new SvXMLNumFmtExport(*this, mxNumberFormatsSupplier) ); } SvXMLExport::~SvXMLExport() { -delete mpXMLErrors; -delete mpImageMapExport; -delete mpEventExport; -delete mpNamespaceMap; +mpXMLErrors.reset(); +mpImageMapExport.reset(); +mpEventExport.reset(); +mpNamespaceMap.reset(); if (mpProgressBarHelper || mpNumExport) { if (mxExportInfo.is()) @@ -561,8 +561,8 @@ SvXMLExport::~SvXMLExport() } } } -delete mpProgressBarHelper; -delete mpNumExport; +mpProgressBarHelper.reset(); +mpNumExport.reset(); } if (mxEventListener.is() && mxModel.is()) @@ -585,7 +585,7 @@ void SAL_CALL SvXMLExport::setSourceDocument( const uno::Reference< lang::XCompo { mxNumberFormatsSupplier.set(mxModel, css::uno::UNO_QUERY); if(mxNumberFormatsSupplier.is() && mxHandler.is()) -mpNumExport = new SvXMLNumFmtExport(*this, mxNumberFormatsSupplier); +mpNumExport.reset( new SvXMLNumFmtExport(*this, mxNumberFormatsSupplier) ); } if (mxExportInfo.is()) { @@ -692,7 +692,7 @@ void SAL_CALL SvXMLExport::initialize( const uno::Sequence< uno::Any >& aArgumen *pAny >>= mxExtHandler; if (mxNumberFormatsSupplier.is() && mpNumExport == nullptr) -mpNumExport = new SvXMLNumFmtExport(*this, mxNumberFormatsSupplier); +
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/txtparae.hxx|6 +++ xmloff/source/text/XMLTextFrameContext.cxx | 17 ++-- xmloff/source/text/txtparae.cxx| 57 - 3 files changed, 68 insertions(+), 12 deletions(-) New commits: commit ced59c16a850a9e4c87dd779b7130e8322d87493 Author: Armin Le GrandDate: Wed Jan 10 18:13:41 2018 +0100 RotateFlyFrameFix: Add RotCenter info to ODF export Since the WriterFlyFrames are implicitly rotated around their center in the Writer UI this has to be added to the transformation in ODF expressing this. The saved data now contains the shape data in svg:x/y/width/height statements (and thus back-compatible AFAP) and a draw:transform statement (that is to be applied to the defined shape) containing the rotation around the object's center. Change-Id: Iccfc70924364f1d58995fce180bce9b6e7643ff4 Reviewed-on: https://gerrit.libreoffice.org/47719 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx index c62a25d0b6f3..6e65e1082e03 100644 --- a/include/xmloff/txtparae.hxx +++ b/include/xmloff/txtparae.hxx @@ -64,6 +64,11 @@ namespace xmloff } +namespace basegfx +{ +class B2DPoint; +} + enum class TextPNS { ODF, @@ -253,6 +258,7 @@ protected: XMLShapeExportFlags addTextFrameAttributes( const css::uno::Reference< css::beans::XPropertySet >& rPropSet, bool bShape, +basegfx::B2DPoint* pCenter = nullptr, OUString *pMinHeightValue = nullptr, OUString *pMinWidthValue = nullptr ); diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index bad29d974fa3..f286d6468622 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -990,7 +990,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( SdXMLImExTransform2D aSdXMLImExTransform2D; basegfx::B2DHomMatrix aFullTransform; -// use SdXMLImExTransform2D to convert to transformation +// Use SdXMLImExTransform2D to convert to transformation // Note: using GetTwipUnitConverter instead of GetMM100UnitConverter may be needed, // but is not generally available (as it should be, a 'current' UnitConverter should // be available at GetExport() - and maybe was once). May have to be addressed as soon @@ -1002,13 +1002,22 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( { const basegfx::utils::B2DHomMatrixBufferedDecompose aDecomposedTransform(aFullTransform); -// currently we *only* use rotation, so warn if *any* of the other transform parts is used +// currently we *only* use rotation (and translation indirectly), so warn if *any* +// of the other transform parts is used SAL_WARN_IF(!basegfx::fTools::equal(1.0, aDecomposedTransform.getScale().getX()), "xmloff.text", "draw:transform uses scaleX" ); SAL_WARN_IF(!basegfx::fTools::equal(1.0, aDecomposedTransform.getScale().getY()), "xmloff.text", "draw:transform uses scaleY" ); - SAL_WARN_IF(!basegfx::fTools::equalZero(aDecomposedTransform.getTranslate().getX()), "xmloff.text", "draw:transform uses translateX" ); - SAL_WARN_IF(!basegfx::fTools::equalZero(aDecomposedTransform.getTranslate().getY()), "xmloff.text", "draw:transform uses translateY" ); SAL_WARN_IF(!basegfx::fTools::equalZero(aDecomposedTransform.getShearX()), "xmloff.text", "draw:transform uses shearX" ); +// Translation comes from the translate to RotCenter, rot and BackTranslate. +// This means that it represents the translation between unrotated TopLeft +// and rotated TopLeft. This may be checked here now, but currently we only +// use rotation around center and assume that this *was* a rotation around +// center. The check would compare the object's center with the RotCenter +// that can be extracted from the transformation in aFullTransform. +// The definition contains implicitely the RotationCenter absolute +// to the scaled and translated object, so this may be used if needed (see +// _exportTextGraphic how the -trans/rot/trans is composed) + if(!basegfx::fTools::equalZero(aDecomposedTransform.getRotate())) { // rotation is used, set it. Convert from deg to 10th degree integer diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/shapeexport.hxx |1 xmloff/source/draw/shapeexport.cxx | 48 + 2 files changed, 49 insertions(+) New commits: commit bfd613a4628c8827168f64fc2a97685785d04a84 Author: Samuel MehrbrodtDate: Thu Nov 23 15:06:08 2017 +0100 tdf#83877 ODF extension to write signature lines This adds a element to draw:image if the image is a signatureline. Example: Change-Id: I4d77acec528175fba66556661ab74462f5bd875f Reviewed-on: https://gerrit.libreoffice.org/45153 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/include/xmloff/shapeexport.hxx b/include/xmloff/shapeexport.hxx index c883886126a5..1865210d5bde 100644 --- a/include/xmloff/shapeexport.hxx +++ b/include/xmloff/shapeexport.hxx @@ -217,6 +217,7 @@ private: SAL_DLLPRIVATE void ImpExportEvents( const css::uno::Reference< css::drawing::XShape >& xShape ); SAL_DLLPRIVATE void ImpExportDescription( const css::uno::Reference< css::drawing::XShape >& xShape ); // #i68101# SAL_DLLPRIVATE void ImpExportGluePoints( const css::uno::Reference< css::drawing::XShape >& xShape ); +SAL_DLLPRIVATE void ImpExportSignatureLine(const css::uno::Reference& xShape); // single shape exporters SAL_DLLPRIVATE void ImpExportGroupShape( const css::uno::Reference< css::drawing::XShape >& xShape, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr ); diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 887f5ecfd372..86b4f621b182 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -1256,6 +1256,53 @@ void XMLShapeExport::ImpExportGluePoints( const uno::Reference< drawing::XShape } } +void XMLShapeExport::ImpExportSignatureLine(const uno::Reference& xShape) +{ +uno::Reference xPropSet(xShape, uno::UNO_QUERY); + +bool bIsSignatureLine = false; +xPropSet->getPropertyValue("IsSignatureLine") >>= bIsSignatureLine; +if (!bIsSignatureLine) +return; + +OUString aSignatureLineId; +xPropSet->getPropertyValue("SignatureLineId") >>= aSignatureLineId; +mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "id", aSignatureLineId); + +OUString aSuggestedSignerName; +xPropSet->getPropertyValue("SignatureLineSuggestedSignerName") >>= aSuggestedSignerName; +if (!aSuggestedSignerName.isEmpty()) +mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "suggested-signer-name", aSuggestedSignerName); + +OUString aSuggestedSignerTitle; +xPropSet->getPropertyValue("SignatureLineSuggestedSignerTitle") >>= aSuggestedSignerTitle; +if (!aSuggestedSignerTitle.isEmpty()) +mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "suggested-signer-title", aSuggestedSignerTitle); + +OUString aSuggestedSignerEmail; +xPropSet->getPropertyValue("SignatureLineSuggestedSignerEmail") >>= aSuggestedSignerEmail; +if (!aSuggestedSignerEmail.isEmpty()) +mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "suggested-signer-email", aSuggestedSignerEmail); + +OUString aSigningInstructions; +xPropSet->getPropertyValue("SignatureLineSigningInstructions") >>= aSigningInstructions; +if (!aSigningInstructions.isEmpty()) +mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "signing-instructions", aSigningInstructions); + +bool bShowSignDate = false; +xPropSet->getPropertyValue("SignatureLineShowSignDate") >>= bShowSignDate; +mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "show-sign-date", + bShowSignDate ? OUString("true") : OUString("false")); + +bool bCanAddComment = false; +xPropSet->getPropertyValue("SignatureLineCanAddComment") >>= bCanAddComment; +mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "can-add-comment", + bCanAddComment ? OUString("true") : OUString("false")); + +SvXMLElementExport aSignatureLineElement(mrExport, XML_NAMESPACE_LO_EXT, "signatureline", true, + true); +} + void XMLShapeExport::ExportGraphicDefaults() { rtl::Reference aStEx(new XMLStyleExport(mrExport, mrExport.GetAutoStylePool().get())); @@ -2364,6 +2411,7 @@ void XMLShapeExport::ImpExportGraphicObjectShape( GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, "mime-type", aMimeType); SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, XML_IMAGE, true, true); +ImpExportSignatureLine( xShape ); if( !sImageURL.isEmpty() ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmltoken.hxx |9 + xmloff/source/core/fasttokenhandler.cxx |2 +- xmloff/source/core/xmltoken.cxx |9 + xmloff/source/token/tokens.txt |9 + 4 files changed, 28 insertions(+), 1 deletion(-) New commits: commit 931c84e697dc69745d1c07c40f810638f9f71eda Author: Mohammed Abdul AzeemDate: Sat Oct 21 16:24:50 2017 +0530 tdf#110431: Fixed losing listbos entries on opening .ods file For some reason, XML_TOKEN_INVALID was taking wrong value in windows, causing to fail imports with unknown entries. I've also added some of the tokens I found from several test files to the list. Change-Id: Idd2e7db165b9b4b5a2d8c7a837786fde252fe938 Reviewed-on: https://gerrit.libreoffice.org/43677 Tested-by: Jenkins Reviewed-by: Michael Meeks diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index e1c0c4d58aac..175187ae6897 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -267,6 +267,7 @@ namespace xmloff { namespace token { XML_AUTHOR_INITIALS, XML_AUTHOR_NAME, XML_AUTO, +XML_AUTO_COMPLETE, XML_AUTO_GROW_HEIGHT, XML_AUTO_GROW_WIDTH, XML_AUTO_RELOAD, @@ -349,6 +350,7 @@ namespace xmloff { namespace token { XML_BOTTOM_VALUES, XML_BOTTOMARC, XML_BOTTOMCIRCLE, +XML_BOUND_COLUMN, XML_BREAK_AFTER, XML_BREAK_BEFORE, XML_BREAK_INSIDE, @@ -606,6 +608,7 @@ namespace xmloff { namespace token { XML_DEFAULT_STYLE_NAME, XML_DEGREE, XML_DELAY, +XML_DELAY_FOR_REPEAT, XML_DELETE_COLUMNS, XML_DELETE_ROWS, XML_DELETION, @@ -669,6 +672,7 @@ namespace xmloff { namespace token { XML_DRAWING, XML_DRAWINGS, XML_DRAWPOOL, +XML_DROPDOWN, XML_DROP_CAP, XML_DYNAMIC, XML_EDGE_ROUNDING, @@ -1136,6 +1140,7 @@ namespace xmloff { namespace token { XML_LINENUMBERING_SEPARATOR, XML_LINES, XML_LINES_USED, +XML_LINKED_CELL, XML_LINK_TO_SOURCE_DATA, XML_LIST, XML_LIST_BLOCK, @@ -1146,6 +1151,7 @@ namespace xmloff { namespace token { XML_LIST_LEVEL_STYLE_BULLET, XML_LIST_LEVEL_STYLE_IMAGE, XML_LIST_LEVEL_STYLE_NUMBER, +XML_LIST_LINKAGE_TYPE, XML_LIST_NAME, XML_LIST_STYLE, XML_LIST_STYLE_NAME, @@ -1355,6 +1361,7 @@ namespace xmloff { namespace token { XML_OPERATION, XML_OPERATOR, XML_OPTIMAL, +XML_OPTION, XML_OR, XML_ORDER, XML_ORDERED_LIST, @@ -1752,6 +1759,7 @@ namespace xmloff { namespace token { XML_STDEV, XML_STDEVP, XML_STEPS, +XML_STEP_SIZE, XML_STOCK, XML_STOCK_UPDOWN_BARS, XML_STOCK_WITH_VOLUME, @@ -1831,6 +1839,7 @@ namespace xmloff { namespace token { XML_TAN, XML_TANH, XML_TARGET_CELL_ADDRESS, +XML_TARGET_FRAME, XML_TARGET_FRAME_NAME, XML_TARGET_RANGE_ADDRESS, XML_TB_RL, diff --git a/xmloff/source/core/fasttokenhandler.cxx b/xmloff/source/core/fasttokenhandler.cxx index b5fa379c9de7..e7eeb0803717 100644 --- a/xmloff/source/core/fasttokenhandler.cxx +++ b/xmloff/source/core/fasttokenhandler.cxx @@ -60,7 +60,7 @@ TokenMap::~TokenMap() sal_Int32 TokenMap::getTokenPerfectHash( const char *pStr, sal_Int32 nLength ) { const struct xmltoken *pToken = Perfect_Hash::in_word_set( pStr, nLength ); -return pToken ? pToken->nToken : XML_TOKEN_INVALID; +return pToken ? pToken->nToken : xmloff::XML_TOKEN_INVALID; } FastTokenHandler::FastTokenHandler() : diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 521e304cf3e1..3d33a489493a 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -267,6 +267,7 @@ namespace xmloff { namespace token { TOKEN( "author-initials", XML_AUTHOR_INITIALS ), TOKEN( "author-name", XML_AUTHOR_NAME ), TOKEN( "auto",XML_AUTO ), +TOKEN( "auto-complete", XML_AUTO_COMPLETE ), TOKEN( "auto-grow-height",XML_AUTO_GROW_HEIGHT ), TOKEN( "auto-grow-width", XML_AUTO_GROW_WIDTH ), TOKEN( "auto-reload", XML_AUTO_RELOAD ), @@ -349,6 +350,7 @@ namespace xmloff { namespace token { TOKEN( "bottom values", XML_BOTTOM_VALUES ), TOKEN( "bottom-arc", XML_BOTTOMARC ), TOKEN( "bottom-circle", XML_BOTTOMCIRCLE ), +TOKEN( "bound-column",XML_BOUND_COLUMN ), TOKEN(
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx |5 +++-- xmloff/source/core/xmlimp.cxx | 11 +-- xmloff/source/draw/sdxmlexp.cxx |8 +++- xmloff/source/draw/ximpshow.cxx |8 ++-- 4 files changed, 21 insertions(+), 11 deletions(-) New commits: commit 58ccac44f7df4273db31e4bbe9043bfb4af4d08a Author: Samuel MehrbrodtDate: Tue Jul 18 19:58:06 2017 +0200 tdf#108824 Honor ODF default for "Mouse pointer visible" property Change-Id: I6b4c431d66835b6affe834a23b900fa61830d87f Reviewed-on: https://gerrit.libreoffice.org/40159 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 1521dd93b0cd..3a38ec1919fc 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -540,9 +540,10 @@ public: static const sal_uInt16 LO_42x = 42 | LO_flag; static const sal_uInt16 LO_43x = 43 | LO_flag; static const sal_uInt16 LO_44x = 44 | LO_flag; -/// @ATTENTION: when adding a new value more specific than "5x", grep for -/// all current uses and adapt them!!! static const sal_uInt16 LO_5x = 50 | LO_flag; +/// @ATTENTION: when adding a new value more specific than "6x", grep for +/// all current uses and adapt them!!! +static const sal_uInt16 LO_6x = 60 | LO_flag; static const sal_uInt16 ProductVersionUnknown = SAL_MAX_UINT16; /** depending on whether the generator version indicates LO, compare diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 16fcb5791baf..10f31883f236 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -175,11 +175,18 @@ public: mnGeneratorVersion = SvXMLImport::LO_44x; // 4.4 } } -else +else if ('5' == loVersion[0]) { -SAL_INFO_IF('5' != loVersion[0], "xmloff.core", "unknown LO version: " << loVersion); mnGeneratorVersion = SvXMLImport::LO_5x; } +else if ('6' == loVersion[0]) +{ +mnGeneratorVersion = SvXMLImport::LO_6x; +} +else +{ +SAL_WARN("xmloff.core", "unknown LO version: " << loVersion); +} return; // ignore buildIds } } diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 3172188a747b..19ac452fb2a7 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -1985,12 +1985,10 @@ void SdXMLExport::exportPresentationSettings() bHasAttr = true; } +// We need to always export this attribute, because the import had the wrong default (tdf#108824) xPresProps->getPropertyValue("IsMouseVisible") >>= bTemp; -if( bTemp ) -{ -AddAttribute(XML_NAMESPACE_PRESENTATION, XML_MOUSE_VISIBLE, XML_TRUE ); -bHasAttr = true; -} +AddAttribute(XML_NAMESPACE_PRESENTATION, XML_MOUSE_VISIBLE, bTemp ? XML_TRUE : XML_FALSE); +bHasAttr = true; xPresProps->getPropertyValue("StartWithNavigator") >>= bTemp; if( bTemp ) diff --git a/xmloff/source/draw/ximpshow.cxx b/xmloff/source/draw/ximpshow.cxx index c24228673bb1..caed5664e6ef 100644 --- a/xmloff/source/draw/ximpshow.cxx +++ b/xmloff/source/draw/ximpshow.cxx @@ -81,6 +81,10 @@ SdXMLShowsContext::SdXMLShowsContext( SdXMLImport& rImport, sal_uInt16 nPrfx, c { bool bAll = true; uno::Any aAny; +// Per ODF this is default, but we did it wrong before LO 6.0 (tdf#108824) +bool bIsMouseVisible = true; +if (rImport.getGeneratorVersion() < SvXMLImport::LO_6x) +bIsMouseVisible = false; // read attributes const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; @@ -141,8 +145,7 @@ SdXMLShowsContext::SdXMLShowsContext( SdXMLImport& rImport, sal_uInt16 nPrfx, c } else if( IsXMLToken( aLocalName, XML_MOUSE_VISIBLE ) ) { -aAny <<= IsXMLToken( sValue, XML_TRUE ); -mpImpl->mxPresProps->setPropertyValue("IsMouseVisible", aAny ); +bIsMouseVisible = IsXMLToken( sValue, XML_TRUE ); } else if( IsXMLToken( aLocalName, XML_START_WITH_NAVIGATOR ) ) { @@ -167,6 +170,7 @@ SdXMLShowsContext::SdXMLShowsContext( SdXMLImport& rImport, sal_uInt16 nPrfx, c } } mpImpl->mxPresProps->setPropertyValue("IsShowAll", Any(bAll) ); +mpImpl->mxPresProps->setPropertyValue("IsMouseVisible", Any(bIsMouseVisible) ); } }
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/txtstyli.hxx | 38 +- xmloff/source/text/txtstyli.cxx | 84 2 files changed, 62 insertions(+), 60 deletions(-) New commits: commit f99ff13fd10fe0dfd0875a725264b0e685c42326 Author: Michael StahlDate: Mon Jul 3 15:16:46 2017 +0200 xmloff: prefix members of XMLTextStyleContext Change-Id: I9db514a20aad0e82a99a02334dfd5910b66e3a01 diff --git a/include/xmloff/txtstyli.hxx b/include/xmloff/txtstyli.hxx index 7015a616ea3c..0588e52aa004 100644 --- a/include/xmloff/txtstyli.hxx +++ b/include/xmloff/txtstyli.hxx @@ -28,11 +28,11 @@ class XMLEventsImportContext; class XMLOFF_DLLPUBLIC XMLTextStyleContext : public XMLPropStyleContext { -OUString sListStyleName; -OUString sCategoryVal; -OUString sDropCapTextStyleName; -OUString sMasterPageName; -OUString sDataStyleName; // for grid columns only +OUString m_sListStyleName; +OUString m_sCategoryVal; +OUString m_sDropCapTextStyleName; +OUString m_sMasterPageName; +OUString m_sDataStyleName; // for grid columns only const OUString sIsAutoUpdate; const OUString sCategory; const OUString sNumberingStyleName; @@ -43,17 +43,17 @@ public: private: const OUString sPageDescName; -sal_Int8nOutlineLevel; +sal_Int8m_nOutlineLevel; -boolbAutoUpdate : 1; -boolbHasMasterPageName : 1; +boolm_isAutoUpdate : 1; +boolm_bHasMasterPageName : 1; -boolbHasCombinedCharactersLetter : 1; +boolm_bHasCombinedCharactersLetter : 1; // Introduce import of empty list style (#i69523#) -boolmbListStyleSet : 1; +boolm_bListStyleSet : 1; -rtl::Reference mxEventContext; +rtl::Reference m_xEventContext; protected: @@ -79,17 +79,17 @@ public: const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; -const OUString& GetListStyle() const { return sListStyleName; } -// XML import: reconstrution of assignment of paragraph style to outline levels (#i69629#) +const OUString& GetListStyle() const { return m_sListStyleName; } +// XML import: reconstruction of assignment of paragraph style to outline levels (#i69629#) bool IsListStyleSet() const { -return mbListStyleSet; +return m_bListStyleSet; } -const OUString& GetMasterPageName() const { return sMasterPageName; } -bool HasMasterPageName() const { return bHasMasterPageName; } -const OUString& GetDropCapStyleName() const { return sDropCapTextStyleName; } -const OUString& GetDataStyleName() const { return sDataStyleName; } +const OUString& GetMasterPageName() const { return m_sMasterPageName; } +bool HasMasterPageName() const { return m_bHasMasterPageName; } +const OUString& GetDropCapStyleName() const { return m_sDropCapTextStyleName; } +const OUString& GetDataStyleName() const { return m_sDataStyleName; } virtual void CreateAndInsert( bool bOverwrite ) override; virtual void Finish( bool bOverwrite ) override; @@ -100,7 +100,7 @@ public: const css::uno::Reference< css::beans::XPropertySet > & rPropSet ) override; bool HasCombinedCharactersLetter() -{ return bHasCombinedCharactersLetter; } +{ return m_bHasCombinedCharactersLetter; } const ::std::vector< XMLPropertyState > & GetProperties_() { return GetProperties(); } }; diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index be36e6cfc75a..345bd60c0889 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -85,33 +85,35 @@ void XMLTextStyleContext::SetAttribute( sal_uInt16 nPrefixKey, if( IsXMLToken( rLocalName, XML_AUTO_UPDATE ) ) { if( IsXMLToken( rValue, XML_TRUE ) ) -bAutoUpdate = true; +m_isAutoUpdate = true; } else if( IsXMLToken( rLocalName, XML_LIST_STYLE_NAME ) ) { -sListStyleName = rValue; +m_sListStyleName = rValue; // Inherited paragraph style lost information about unset numbering (#i69523#) -mbListStyleSet = true; +m_bListStyleSet = true; } else if( IsXMLToken( rLocalName, XML_MASTER_PAGE_NAME ) ) { -sMasterPageName = rValue; -bHasMasterPageName = true; +m_sMasterPageName = rValue; +m_bHasMasterPageName = true; } else if( IsXMLToken( rLocalName, XML_DATA_STYLE_NAME ) ) { -sDataStyleName = rValue; +m_sDataStyleName = rValue; } else if( IsXMLToken( rLocalName, XML_CLASS )
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx | 14 +- include/xmloff/xmlnmspe.hxx | 81 xmloff/source/core/xmlictxt.cxx | 12 +- xmloff/source/core/xmlimp.cxx | 199 4 files changed, 199 insertions(+), 107 deletions(-) New commits: commit ffc2e936c6a9f3fd597b64b88785edb0f78d7564 Author: Mohammed Abdul AzeemDate: Mon Jun 12 22:56:10 2017 +0530 Reverse mapping fastToken to NamespaceURI: Made those methods static, so that it is easy to use them outside the module. Also updated the Namespace-constants list. Change-Id: Id0bf501457c53d1420a00ce58c9bcedfcba17908 Reviewed-on: https://gerrit.libreoffice.org/38708 Tested-by: Jenkins Reviewed-by: Michael Meeks diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 37b1d1589d88..8ac87d820c88 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -225,12 +225,12 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public cppu::WeakImplHelper< rtl::Reference < comphelper::AttributeList > maAttrList; rtl::Reference < comphelper::AttributeList > maNamespaceAttrList; css::uno::Reference< css::xml::sax::XFastDocumentHandler > mxFastDocumentHandler; -css::uno::Reference< css::xml::sax::XFastTokenHandler > mxTokenHandler; -std::unordered_map< sal_Int32, OUString > maNamespaceMap; -const OUString getNameFromToken( sal_Int32 nToken ); -const OUString getNamespacePrefixFromToken( sal_Int32 nToken ); +static css::uno::Reference< css::xml::sax::XFastTokenHandler > xTokenHandler; +static std::unordered_map< sal_Int32, std::pair< OUString, OUString > > aNamespaceMap; +static bool bIsNSMapsInitialized; + +static void initializeNamespaceMaps(); void registerNamespaces(); -void registerNSHelper(sal_Int32 nToken, sal_Int32 nPrefix, sal_Int32 nNamespace ); std::unique_ptr processNSAttributes( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList); void Characters(const OUString& aChars); @@ -375,6 +375,10 @@ public: // get import helper for events XMLEventImportHelper& GetEventImport(); +static const OUString getNameFromToken( sal_Int32 nToken ); +static const OUString getNamespacePrefixFromToken( sal_Int32 nToken ); +static const OUString getNamespaceURIFromToken( sal_Int32 nToken ); + SvXMLNamespaceMap& GetNamespaceMap() { return *mpNamespaceMap; } const SvXMLNamespaceMap& GetNamespaceMap() const { return *mpNamespaceMap; } const SvXMLUnitConverter& GetMM100UnitConverter() const { return *mpUnitConv; } diff --git a/include/xmloff/xmlnmspe.hxx b/include/xmloff/xmlnmspe.hxx index 7675b556ed5c..3153ad0f83fd 100644 --- a/include/xmloff/xmlnmspe.hxx +++ b/include/xmloff/xmlnmspe.hxx @@ -27,6 +27,8 @@ const sal_uInt16 XML_NAMESPACE_##prefix = key; \ const sal_uInt16 XML_NAMESPACE_##prefix##_IDX = key; #define XML_OLD_NAMESPACE( prefix, index ) \ +const sal_uInt16 XML_OLD_NAMESPACE_##prefix = \ +(XML_OLD_NAMESPACE_BASE+index); \ const sal_uInt16 XML_OLD_NAMESPACE_##prefix##_IDX = \ (XML_OLD_NAMESPACE_BASE+index); @@ -70,30 +72,75 @@ XML_NAMESPACE( REPORT, 33U ) XML_NAMESPACE( OF, 34U ) // OpenFormula aka ODFF XML_NAMESPACE( XHTML, 35U ) XML_NAMESPACE( GRDDL, 36U ) +XML_NAMESPACE( VERSIONS_LIST, 37U ) // namespaces for odf extended formats -#define XML_NAMESPACE_EXT( prefix, key ) \ -const sal_uInt16 XML_NAMESPACE_##prefix##_EXT = key; \ -const sal_uInt16 XML_NAMESPACE_##prefix##_EXT_IDX = key; +#define XML_NAMESPACE_EXT_BASE 38U +#define XML_NAMESPACE_EXT( prefix, index ) \ +const sal_uInt16 XML_NAMESPACE_##prefix##_EXT = (XML_NAMESPACE_EXT_BASE+index); \ +const sal_uInt16 XML_NAMESPACE_##prefix##_EXT_IDX = (XML_NAMESPACE_EXT_BASE+index); -XML_NAMESPACE_EXT( OFFICE, 37U ) -XML_NAMESPACE_EXT( TABLE, 38U ) -XML_NAMESPACE_EXT( CHART, 39U ) -XML_NAMESPACE_EXT( DRAW,40U ) -XML_NAMESPACE_EXT( CALC,41U ) -XML_NAMESPACE_EXT( LO, 42U ) +XML_NAMESPACE_EXT( OFFICE, 0U ) +XML_NAMESPACE_EXT( TABLE,1U ) +XML_NAMESPACE_EXT( CHART,2U ) +XML_NAMESPACE_EXT( DRAW, 3U ) +XML_NAMESPACE_EXT( CALC, 4U ) +XML_NAMESPACE_EXT( LO, 5U ) -#define XML_OLD_NAMESPACE_BASE 43U +// namespaces for OOo formats + +#define XML_NAMESPACE_OOO_BASE 44U +#define XML_NAMESPACE_OOO( prefix, index ) \ +const sal_uInt16 XML_NAMESPACE_##prefix##_OOO = (XML_NAMESPACE_OOO_BASE+index); \ +const sal_uInt16 XML_NAMESPACE_##prefix##_OOO_IDX = (XML_NAMESPACE_OOO_BASE+index); + +XML_NAMESPACE_OOO( OFFICE, 0U ) +XML_NAMESPACE_OOO( META, 1U ) +XML_NAMESPACE_OOO( STYLE, 2U ) +XML_NAMESPACE_OOO( NUMBER, 3U ) +XML_NAMESPACE_OOO( TEXT, 4U ) +XML_NAMESPACE_OOO( TABLE,
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx |2 ++ xmloff/source/core/xmlictxt.cxx | 16 +++- xmloff/source/core/xmlimp.cxx | 10 +++--- 3 files changed, 20 insertions(+), 8 deletions(-) New commits: commit a7bfced28c526ca603cde3c1ac74ea842320bd7c Author: Mohammed Abdul AzeemDate: Sat Feb 11 01:50:34 2017 +0530 Optimizations: This avoids a lot of repeated allocation and freeing of memory for AttributeList. Change-Id: I97e44e633ed9880f37665f71e4dec3e74085cb09 Reviewed-on: https://gerrit.libreoffice.org/34134 Tested-by: Jenkins Reviewed-by: Michael Meeks Tested-by: Michael Meeks diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index f7137715ced3..37b1d1589d88 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -222,6 +222,8 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public cppu::WeakImplHelper< bool isFastContext; css::uno::Reference< css::xml::sax::XFastParser > mxParser; rtl::Reference< SvXMLImportFastNamespaceHandler > maNamespaceHandler; +rtl::Reference < comphelper::AttributeList > maAttrList; +rtl::Reference < comphelper::AttributeList > maNamespaceAttrList; css::uno::Reference< css::xml::sax::XFastDocumentHandler > mxFastDocumentHandler; css::uno::Reference< css::xml::sax::XFastTokenHandler > mxTokenHandler; std::unordered_map< sal_Int32, OUString > maNamespaceMap; diff --git a/xmloff/source/core/xmlictxt.cxx b/xmloff/source/core/xmlictxt.cxx index 63025083d78f..9a1d5bc0ea62 100644 --- a/xmloff/source/core/xmlictxt.cxx +++ b/xmloff/source/core/xmlictxt.cxx @@ -78,8 +78,14 @@ void SAL_CALL SvXMLImportContext::startUnknownElement(const OUString & rPrefix, const uno::Reference< xml::sax::XFastAttributeList > & Attribs) { OUString elementName; -rtl::Reference < comphelper::AttributeList > rAttrList = new comphelper::AttributeList; -mrImport.maNamespaceHandler->addNSDeclAttributes( rAttrList ); + +if ( mrImport.maAttrList.is() ) +mrImport.maAttrList->Clear(); +else +mrImport.maAttrList = new comphelper::AttributeList; + +mrImport.maNamespaceHandler->addNSDeclAttributes( mrImport.maAttrList ); + if ( !rPrefix.isEmpty() ) elementName = rPrefix + ":" + rLocalName; else @@ -102,7 +108,7 @@ void SAL_CALL SvXMLImportContext::startUnknownElement(const OUString & rPrefix, if ( !rAttrNamespacePrefix.isEmpty() ) sAttrName = rAttrNamespacePrefix + ":" + sAttrName; -rAttrList->AddAttribute( sAttrName, "CDATA", rAttrValue ); +mrImport.maAttrList->AddAttribute( sAttrName, "CDATA", rAttrValue ); } uno::Sequence< xml::Attribute > unknownAttribs = Attribs->getUnknownAttributes(); @@ -115,11 +121,11 @@ void SAL_CALL SvXMLImportContext::startUnknownElement(const OUString & rPrefix, if ( !rAttrNamespacePrefix.isEmpty() ) sAttrName = rAttrNamespacePrefix + ":" + sAttrName; -rAttrList->AddAttribute( sAttrName, "CDATA", rAttrValue ); +mrImport.maAttrList->AddAttribute( sAttrName, "CDATA", rAttrValue ); } } -mrImport.startElement( elementName, rAttrList.get() ); +mrImport.startElement( elementName, mrImport.maAttrList.get() ); } void SAL_CALL SvXMLImportContext::endFastElement(sal_Int32 nElement) diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index eba9d2ad21b6..2d489bc1cdb4 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -818,10 +818,14 @@ void SAL_CALL SvXMLImport::startFastElement (sal_Int32 Element, if ( isFastContext ) { -rtl::Reference < comphelper::AttributeList > rAttrList = new comphelper::AttributeList; -maNamespaceHandler->addNSDeclAttributes( rAttrList ); +if ( maNamespaceAttrList.is() ) +maNamespaceAttrList->Clear(); +else +maNamespaceAttrList = new comphelper::AttributeList; + +maNamespaceHandler->addNSDeclAttributes( maNamespaceAttrList ); std::unique_ptr pRewindMap( -processNSAttributes(rAttrList.get())); +processNSAttributes( maNamespaceAttrList.get() )); SvXMLImportContext *pContext = dynamic_cast ( xContext.get() ); if( pContext && pRewindMap ) pContext->PutRewindMap(std::move(pRewindMap)); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlement.hxx |2 +- include/xmloff/xmluconv.hxx |2 +- xmloff/source/forms/elementexport.cxx|2 +- xmloff/source/forms/formattributes.hxx |4 ++-- xmloff/source/forms/formenums.cxx|2 +- xmloff/source/forms/formenums.hxx|2 +- xmloff/source/forms/gridcolumnproptranslator.cxx |8 xmloff/source/style/adjushdl.cxx |2 +- 8 files changed, 12 insertions(+), 12 deletions(-) New commits: commit 9a165a86795c65c42a94bf6f7f48545c797f2db3 Author: Noel GrandinDate: Thu Mar 30 16:02:15 2017 +0200 use actual UNO enums in xmloff Change-Id: I585825ad3faf972acde548817187183029856971 Reviewed-on: https://gerrit.libreoffice.org/35914 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/xmlement.hxx b/include/xmloff/xmlement.hxx index 5879324701bf..5a149f6335ad 100644 --- a/include/xmloff/xmlement.hxx +++ b/include/xmloff/xmlement.hxx @@ -37,7 +37,7 @@ private: sal_uInt16 nValue; public: SvXMLEnumMapEntry(::xmloff::token::XMLTokenEnum eToken_, EnumT nValue_) -: eToken(eToken_), nValue(nValue_) {} +: eToken(eToken_), nValue(static_cast(nValue_)) {} ::xmloff::token::XMLTokenEnum GetToken() const { return eToken; } }; diff --git a/include/xmloff/xmluconv.hxx b/include/xmloff/xmluconv.hxx index e71880be867e..8eb234289011 100644 --- a/include/xmloff/xmluconv.hxx +++ b/include/xmloff/xmluconv.hxx @@ -161,7 +161,7 @@ public: enum ::xmloff::token::XMLTokenEnum eDefault = ::xmloff::token::XML_TOKEN_INVALID ) { -return convertEnumImpl(rBuffer, nValue, +return convertEnumImpl(rBuffer, static_cast(nValue), reinterpret_cast*>(pMap), eDefault); } diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index a2a1b10fc580..0048db73e6c1 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -663,7 +663,7 @@ namespace xmloff OAttributeMetaData::getCommonControlAttributeName( CCAFlags::Orientation ), PROPERTY_ORIENTATION, aOrientationMap, -(sal_uInt16)ScrollBarOrientation::HORIZONTAL +ScrollBarOrientation::HORIZONTAL ); #if OSL_DEBUG_LEVEL > 0 // reset the bit for later checking diff --git a/xmloff/source/forms/formattributes.hxx b/xmloff/source/forms/formattributes.hxx index a5dd78959604..04575930942b 100644 --- a/xmloff/source/forms/formattributes.hxx +++ b/xmloff/source/forms/formattributes.hxx @@ -378,10 +378,10 @@ namespace xmloff template voidaddEnumProperty( const sal_Char* _pAttributeName, const OUString& _rPropertyName, -const sal_uInt16 _nAttributeDefault, const SvXMLEnumMapEntry* _pValueMap, +const EnumT _nAttributeDefault, const SvXMLEnumMapEntry* _pValueMap, const css::uno::Type* _pType = nullptr) { -addEnumPropertyImpl(_pAttributeName, _rPropertyName, _nAttributeDefault, +addEnumPropertyImpl(_pAttributeName, _rPropertyName, static_cast(_nAttributeDefault), reinterpret_cast*>(_pValueMap), _pType); } diff --git a/xmloff/source/forms/formenums.cxx b/xmloff/source/forms/formenums.cxx index 30b13cdb82e9..b0da002e7e60 100644 --- a/xmloff/source/forms/formenums.cxx +++ b/xmloff/source/forms/formenums.cxx @@ -150,7 +150,7 @@ const SvXMLEnumMapEntry aListLinkageMap[] = { XML_SELECTION_INDEXES,1 }, { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aOrientationMap[] = +const SvXMLEnumMapEntry aOrientationMap[] = { { XML_HORIZONTAL, ScrollBarOrientation::HORIZONTAL }, { XML_VERTICAL, ScrollBarOrientation::VERTICAL }, diff --git a/xmloff/source/forms/formenums.hxx b/xmloff/source/forms/formenums.hxx index 7ed7dcf8acac..cc63e961f270 100644 --- a/xmloff/source/forms/formenums.hxx +++ b/xmloff/source/forms/formenums.hxx @@ -45,7 +45,7 @@ extern const SvXMLEnumMapEntry aBorderTypeMap[]; extern const SvXMLEnumMapEntry aFontEmphasisMap[]; extern const SvXMLEnumMapEntry aFontReliefMap[]; extern const SvXMLEnumMapEntry aListLinkageMap[]; -extern const SvXMLEnumMapEntry aOrientationMap[]; +extern const SvXMLEnumMapEntry aOrientationMap[]; extern const SvXMLEnumMapEntry aVisualEffectMap[]; extern const SvXMLEnumMapEntry aImagePositionMap[]; extern const SvXMLEnumMapEntry aImageAlignMap[]; diff --git a/xmloff/source/forms/gridcolumnproptranslator.cxx b/xmloff/source/forms/gridcolumnproptranslator.cxx index b149d4f9665c..e1241a1e600b 100644 ---
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmltoken.hxx |2 ++ xmloff/source/core/xmlimp.cxx | 14 ++ xmloff/source/core/xmltoken.cxx |2 ++ xmloff/source/token/tokens.txt |2 ++ 4 files changed, 20 insertions(+) New commits: commit 0a0f205775807d63e7f6dd910de368bb12b11a49 Author: Mohammed Abdul AzeemDate: Sat Mar 18 23:24:26 2017 +0530 tdf#105686 - fixed wrongly imported named expressions: It is necessary to extract and set ODF version for fast events also. While debugging I found a couple of tokens which were not in the list, and added them (not needed for bug fix). Change-Id: I7aaab99688a067ee2fd2c9814deec1a359a758ab Reviewed-on: https://gerrit.libreoffice.org/35410 Reviewed-by: Michael Meeks Tested-by: Michael Meeks diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index 70b57d1b0f8d..4430d298d63b 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -245,6 +245,7 @@ namespace xmloff { namespace token { XML_APPLICATION_DATA, XML_APPLICATION_XML, XML_APPLY, +XML_APPLY_DESIGN_MODE, XML_APPLY_STYLE_NAME, XML_AQUA, XML_ARC, @@ -275,6 +276,7 @@ namespace xmloff { namespace token { XML_AUTO_UPDATE, XML_AUTOMATIC, XML_AUTOMATIC_FIND_LABELS, +XML_AUTOMATIC_FOCUS, XML_AUTOMATIC_ORDER, XML_AUTOMATIC_STYLES, XML_AUTOMATIC_UPDATE, diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 36de2638a874..c213c05b053a 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -783,6 +783,20 @@ void SAL_CALL SvXMLImport::setDocumentLocator( const uno::Reference< xml::sax::X void SAL_CALL SvXMLImport::startFastElement (sal_Int32 Element, const uno::Reference< xml::sax::XFastAttributeList > & Attribs) { +if ( Attribs.is() && Attribs->hasAttribute( NAMESPACE_TOKEN( XML_NAMESPACE_OFFICE ) | XML_VERSION ) ) +{ +mpImpl->aODFVersion = Attribs->getValue( NAMESPACE_TOKEN( XML_NAMESPACE_OFFICE ) | XML_VERSION ); + +// the ODF version in content.xml and manifest.xml must be the same starting from ODF1.2 +if ( mpImpl->mStreamName == "content.xml" && !IsODFVersionConsistent( mpImpl->aODFVersion ) ) +{ +throw xml::sax::SAXException("Inconsistent ODF versions in content.xml and manifest.xml!", +uno::Reference< uno::XInterface >(), +uno::makeAny( +packages::zip::ZipIOException("Inconsistent ODF versions in content.xml and manifest.xml!" ) ) ); +} +} + //Namespace handling is unnecessary. It is done by the fastparser itself. uno::Reference xContext; if (!maFastContexts.empty()) diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 813c864ca264..5ee0ce8dfa84 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -247,6 +247,7 @@ namespace xmloff { namespace token { TOKEN( "application-data",XML_APPLICATION_DATA ), TOKEN( "application-xml", XML_APPLICATION_XML ), TOKEN( "apply", XML_APPLY ), +TOKEN( "apply-design-mode", XML_APPLY_DESIGN_MODE ), TOKEN( "apply-style-name",XML_APPLY_STYLE_NAME ), TOKEN( "aqua",XML_AQUA ), TOKEN( "arc", XML_ARC ), @@ -277,6 +278,7 @@ namespace xmloff { namespace token { TOKEN( "auto-update", XML_AUTO_UPDATE ), TOKEN( "automatic", XML_AUTOMATIC ), TOKEN( "automatic-find-labels", XML_AUTOMATIC_FIND_LABELS ), +TOKEN( "automatic-focus", XML_AUTOMATIC_FOCUS ), TOKEN( "automatic-order", XML_AUTOMATIC_ORDER ), TOKEN( "automatic-styles",XML_AUTOMATIC_STYLES ), TOKEN( "automatic-update",XML_AUTOMATIC_UPDATE ), diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt index 3c9d08360b12..e8878d8ec6c1 100644 --- a/xmloff/source/token/tokens.txt +++ b/xmloff/source/token/tokens.txt @@ -169,6 +169,7 @@ applet-name application-data application-xml apply +apply-design-mode apply-style-name aqua arc @@ -199,6 +200,7 @@ auto-text-indent auto-update automatic automatic-find-labels +automatic-focus automatic-order automatic-styles automatic-update ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlnumfe.hxx |2 +- xmloff/source/core/xmlexp.cxx|4 +--- xmloff/source/style/xmlnumfe.cxx | 14 -- 3 files changed, 10 insertions(+), 10 deletions(-) New commits: commit 9734a6e1c3930c29aa3c7b80cb896d57c2bebe31 Author: Noel GrandinDate: Sun Jan 29 12:28:45 2017 +0200 GetWasUsed can return by value, no need to be a special snowflake Change-Id: I4ef22fa49ee883ff0bddb49d1711e8521905502f Reviewed-on: https://gerrit.libreoffice.org/33658 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/xmlnumfe.hxx b/include/xmloff/xmlnumfe.hxx index 905a6e3..b4792a8 100644 --- a/include/xmloff/xmlnumfe.hxx +++ b/include/xmloff/xmlnumfe.hxx @@ -114,7 +114,7 @@ public: // get the style name that was generated for a key OUString GetStyleName( sal_uInt32 nKey ); -void GetWasUsed(css::uno::Sequence& rWasUsed); +css::uno::Sequence GetWasUsed(); void SetWasUsed(const css::uno::Sequence& rWasUsed); diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index cd8a9c4..077cb4f 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -557,9 +557,7 @@ SvXMLExport::~SvXMLExport() OUString sWrittenNumberFormats(XML_WRITTENNUMBERSTYLES); if (xPropertySetInfo->hasPropertyByName(sWrittenNumberFormats)) { -uno::Sequence aWasUsed; -mpNumExport->GetWasUsed(aWasUsed); -mxExportInfo->setPropertyValue(sWrittenNumberFormats, Any(aWasUsed)); +mxExportInfo->setPropertyValue(sWrittenNumberFormats, Any(mpNumExport->GetWasUsed())); } } } diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index bb5db1b..07e4ac2 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -106,7 +106,7 @@ public: boolGetFirstUsed(sal_uInt32& nKey); boolGetNextUsed(sal_uInt32& nKey); -void GetWasUsed(uno::Sequence& rWasUsed); +uno::Sequence GetWasUsed(); void SetWasUsed(const uno::Sequence& rWasUsed); }; @@ -182,10 +182,10 @@ bool SvXMLNumUsedList_Impl::GetNextUsed(sal_uInt32& nKey) return bRet; } -void SvXMLNumUsedList_Impl::GetWasUsed(uno::Sequence& rWasUsed) +uno::Sequence SvXMLNumUsedList_Impl::GetWasUsed() { -rWasUsed.realloc(nWasUsedCount); -sal_Int32* pWasUsed = rWasUsed.getArray(); +uno::Sequence ret(nWasUsedCount); +sal_Int32* pWasUsed = ret.getArray(); if (pWasUsed) { SvXMLuInt32Set::const_iterator aItr = aWasUsed.begin(); @@ -196,6 +196,7 @@ void SvXMLNumUsedList_Impl::GetWasUsed(uno::Sequence& rWasUsed) ++pWasUsed; } } +return ret; } void SvXMLNumUsedList_Impl::SetWasUsed(const uno::Sequence& rWasUsed) @@ -1889,10 +1890,11 @@ void SvXMLNumFmtExport::SetUsed( sal_uInt32 nKey ) } } -void SvXMLNumFmtExport::GetWasUsed(uno::Sequence& rWasUsed) +uno::Sequence SvXMLNumFmtExport::GetWasUsed() { if (pUsedList) -pUsedList->GetWasUsed(rWasUsed); +return pUsedList->GetWasUsed(); +return uno::Sequence(); } void SvXMLNumFmtExport::SetWasUsed(const uno::Sequence& rWasUsed) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/XMLFontStylesContext.hxx |2 ++ include/xmloff/XMLTextTableContext.hxx |4 include/xmloff/txtstyli.hxx |2 ++ include/xmloff/xmlnumi.hxx |2 ++ xmloff/source/style/XMLFontStylesContext.cxx |2 ++ xmloff/source/style/xmlnumi.cxx |2 ++ xmloff/source/text/XMLTextTableContext.cxx |4 xmloff/source/text/txtstyli.cxx |3 +++ 8 files changed, 21 insertions(+) New commits: commit 936fd770facefa49019abcf30b241b694b3afac9 Author: Caolán McNamaraDate: Mon Jan 23 10:22:21 2017 + just for non exported things Change-Id: I448d0009d7c8ffec64fdab76897e8684afe7fcd7 diff --git a/include/xmloff/XMLFontStylesContext.hxx b/include/xmloff/XMLFontStylesContext.hxx index d671e65..cc6a2a7 100644 --- a/include/xmloff/XMLFontStylesContext.hxx +++ b/include/xmloff/XMLFontStylesContext.hxx @@ -59,6 +59,8 @@ public: const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, rtl_TextEncoding eDfltEnc ); +~XMLFontStylesContext() override; + const SvXMLTokenMap& GetFontStyleAttrTokenMap() const { return *pFontStyleAttrTokenMap; diff --git a/include/xmloff/XMLTextTableContext.hxx b/include/xmloff/XMLTextTableContext.hxx index 333716d..6077ccd 100644 --- a/include/xmloff/XMLTextTableContext.hxx +++ b/include/xmloff/XMLTextTableContext.hxx @@ -30,10 +30,14 @@ namespace com { namespace sun { namespace star { class XMLOFF_DLLPUBLIC XMLTextTableContext : public SvXMLImportContext { + public: + + XMLTextTableContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName ); +virtual ~XMLTextTableContext() override; }; #endif diff --git a/include/xmloff/txtstyli.hxx b/include/xmloff/txtstyli.hxx index 8eca3bd..a142e3d 100644 --- a/include/xmloff/txtstyli.hxx +++ b/include/xmloff/txtstyli.hxx @@ -63,11 +63,13 @@ protected: public: + XMLTextStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, SvXMLStylesContext& rStyles, sal_uInt16 nFamily, bool bDefaultStyle = false ); +~XMLTextStyleContext() override; virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, diff --git a/include/xmloff/xmlnumi.hxx b/include/xmloff/xmlnumi.hxx index ee7913a..b1a0687 100644 --- a/include/xmloff/xmlnumi.hxx +++ b/include/xmloff/xmlnumi.hxx @@ -66,6 +66,8 @@ public: const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, bool bOutl = false ); +~SvxXMLListStyleContext() override; + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx index 76aebf9..8303ee9 100644 --- a/xmloff/source/style/XMLFontStylesContext.cxx +++ b/xmloff/source/style/XMLFontStylesContext.cxx @@ -377,6 +377,8 @@ XMLFontStylesContext::XMLFontStylesContext( SvXMLImport& rImport, { } +XMLFontStylesContext::~XMLFontStylesContext() {} + bool XMLFontStylesContext::FillProperties( const OUString& rName, ::std::vector< XMLPropertyState > , sal_Int32 nFamilyNameIdx, diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index b6c4eab..cb130d8 100644 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -1018,6 +1018,8 @@ SvxXMLListStyleContext::SvxXMLListStyleContext( SvXMLImport& rImport, { } +SvxXMLListStyleContext::~SvxXMLListStyleContext() {} + SvXMLImportContext *SvxXMLListStyleContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, diff --git a/xmloff/source/text/XMLTextTableContext.cxx b/xmloff/source/text/XMLTextTableContext.cxx index 2a5f652..5fcfd88 100644 --- a/xmloff/source/text/XMLTextTableContext.cxx +++ b/xmloff/source/text/XMLTextTableContext.cxx @@ -31,4 +31,8 @@ XMLTextTableContext::XMLTextTableContext( { } +XMLTextTableContext::~XMLTextTableContext() +{ +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index 6a78c2d..8df44e2 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -149,6 +149,9 @@ XMLTextStyleContext::XMLTextStyleContext( SvXMLImport& rImport, { } +XMLTextStyleContext::~XMLTextStyleContext() +{} + SvXMLImportContext *XMLTextStyleContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/txtparae.hxx |6 -- include/xmloff/xmlimp.hxx |2 -- include/xmloff/xmlnumfe.hxx |1 - xmloff/source/chart/SchXMLPlotAreaContext.cxx | 11 ++- xmloff/source/chart/SchXMLPlotAreaContext.hxx |3 --- xmloff/source/core/xmlimp.cxx | 11 +++ xmloff/source/draw/sdxmlexp.cxx | 12 +++- xmloff/source/draw/sdxmlexp_impl.hxx |2 -- xmloff/source/style/xmlnumfe.cxx | 13 - xmloff/source/text/XMLTextNumRuleInfo.cxx |2 +- xmloff/source/text/XMLTextNumRuleInfo.hxx |5 - xmloff/source/text/txtparae.cxx |4 ++-- xmloff/source/transform/MutableAttrList.cxx | 10 ++ xmloff/source/transform/MutableAttrList.hxx |2 -- xmloff/source/transform/OOo2Oasis.cxx |9 ++--- xmloff/source/transform/OOo2Oasis.hxx |2 -- xmloff/source/transform/Oasis2OOo.cxx |9 ++--- xmloff/source/transform/Oasis2OOo.hxx |2 -- 18 files changed, 21 insertions(+), 85 deletions(-) New commits: commit a41ecf922771904cdebf17b29066389441716b2c Author: Noel GrandinDate: Mon Oct 24 13:35:09 2016 +0200 loplugin:expandablemethods in xmloff Change-Id: I995a4167ac4df5ca35d963dcf68ae802a997e1e1 diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx index 1c46342..7855fde 100644 --- a/include/xmloff/txtparae.hxx +++ b/include/xmloff/txtparae.hxx @@ -546,12 +546,6 @@ public: { exportPageFrames( bIsProgress ); } -void exportFramesBoundToFrame( -const css::uno::Reference< css::text::XTextFrame >& rParentTxtFrame, -bool bIsProgress ) -{ -exportFrameFrames( false, bIsProgress, ); -} inline const XMLTextListAutoStylePool& GetListAutoStylePool() const; void SetBlockMode( bool bSet ) { bBlock = bSet; } diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 8ba9695..84e1713 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -256,8 +256,6 @@ public: virtual ~SvXMLImport() throw() override; -static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); - // css::xml::sax::XDocumentHandler virtual void SAL_CALL startDocument() throw (css::xml::sax::SAXException, diff --git a/include/xmloff/xmlnumfe.hxx b/include/xmloff/xmlnumfe.hxx index c04b8e4..da27110 100644 --- a/include/xmloff/xmlnumfe.hxx +++ b/include/xmloff/xmlnumfe.hxx @@ -56,7 +56,6 @@ private: SAL_DLLPRIVATE void AddCalendarAttr_Impl( const OUString& rCalendar ); SAL_DLLPRIVATE void AddStyleAttr_Impl( bool bLong ); -SAL_DLLPRIVATE void AddTextualAttr_Impl( bool bText ); SAL_DLLPRIVATE void AddLanguageAttr_Impl( sal_Int32 nLang ); SAL_DLLPRIVATE void AddToTextElement_Impl( const OUString& rString ); diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index fe33c1b..48a5a9a 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -666,18 +666,11 @@ SchXMLPositionAttributesHelper::~SchXMLPositionAttributesHelper() { } -bool SchXMLPositionAttributesHelper::hasSize() const -{ -return m_bHasSizeWidth && m_bHasSizeHeight; -} -bool SchXMLPositionAttributesHelper::hasPosition() const -{ -return m_bHasPositionX && m_bHasPositionY; -} bool SchXMLPositionAttributesHelper::hasPosSize() const { -return hasPosition() && hasSize(); +return (m_bHasPositionX && m_bHasPositionY) && (m_bHasSizeWidth && m_bHasSizeHeight); } + bool SchXMLPositionAttributesHelper::isAutomatic() const { return m_bAutoSize || m_bAutoPosition; diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.hxx b/xmloff/source/chart/SchXMLPlotAreaContext.hxx index 17e1a64..612bdbb 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.hxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.hxx @@ -65,9 +65,6 @@ public: css::awt::Rectangle getRectangle() const { return css::awt::Rectangle( m_aPosition.X, m_aPosition.Y, m_aSize.Width, m_aSize.Height );} private: -bool hasSize() const; -bool hasPosition() const; - SvXMLImport& m_rImport; css::awt::Point m_aPosition; diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 638b519..efce026 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -456,18 +456,13 @@ namespace class theSvXMLImportUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSvXMLImportUnoTunnelId> {}; } -// XUnoTunnel & co -const uno::Sequence< sal_Int8 > & SvXMLImport::getUnoTunnelId() throw() -{ -return theSvXMLImportUnoTunnelId::get().getSeq(); -} - // XUnoTunnel sal_Int64 SAL_CALL SvXMLImport::getSomething( const uno::Sequence< sal_Int8 >& rId ) throw(
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/prstylei.hxx |1 - include/xmloff/txtparae.hxx |4 include/xmloff/xmlexp.hxx|3 --- xmloff/source/core/xmlexp.cxx|2 +- xmloff/source/style/prstylei.cxx |7 +-- xmloff/source/text/txtstyle.cxx |2 +- 6 files changed, 3 insertions(+), 16 deletions(-) New commits: commit f0ae4082ebe554146ac6fba9894cfe7d2978a4a0 Author: Noel GrandinDate: Thu Oct 20 15:25:50 2016 +0200 loplugin:expandablemethodds in include/xmloff Change-Id: I6b1430220adaf240ef873ff908e3a767dfc278bf Reviewed-on: https://gerrit.libreoffice.org/30106 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/prstylei.hxx b/include/xmloff/prstylei.hxx index 95a7357..57f451c 100644 --- a/include/xmloff/prstylei.hxx +++ b/include/xmloff/prstylei.hxx @@ -75,7 +75,6 @@ protected: static const OldFillStyleDefinitionSet& getStandardSet(); static const OldFillStyleDefinitionSet& getHeaderSet(); static const OldFillStyleDefinitionSet& getFooterSet(); -static const OldFillStyleDefinitionSet& getParaSet(); virtual void SetAttribute( sal_uInt16 nPrefixKey, const OUString& rLocalName, diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx index c4f391a..1c46342 100644 --- a/include/xmloff/txtparae.hxx +++ b/include/xmloff/txtparae.hxx @@ -218,10 +218,6 @@ public: return xTextPropMapper; } -const rtl::Reference < SvXMLExportPropertyMapper >& GetFramePropMapper() const -{ -return xFramePropMapper; -} const rtl::Reference < SvXMLExportPropertyMapper >& GetAutoFramePropMapper() const { return xAutoFramePropMapper; diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index a8d85af..2c9ed6d 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -517,9 +517,6 @@ public: sal_Int32 nId, const css::uno::Sequence< OUString> & rMsgParams); -/** return current error flags (logical 'or' of all error flags so far) */ -SvXMLErrorFlags GetErrorFlags() { return mnErrorFlags; } - virtual void DisposingModel(); ::comphelper::UnoInterfaceToUniqueIdentifierMapper& getInterfaceToIdentifierMapper(); diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 3bcbd91..e21998c 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -851,7 +851,7 @@ sal_Bool SAL_CALL SvXMLExport::filter( const uno::Sequence< beans::PropertyValue } // return true only if no error occurred -return (GetErrorFlags() & (SvXMLErrorFlags::DO_NOTHING|SvXMLErrorFlags::ERROR_OCCURRED)) == SvXMLErrorFlags::NO; +return (mnErrorFlags & (SvXMLErrorFlags::DO_NOTHING|SvXMLErrorFlags::ERROR_OCCURRED)) == SvXMLErrorFlags::NO; } void SAL_CALL SvXMLExport::cancel() throw(uno::RuntimeException, std::exception) diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index 2b34eec..387ca19 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -177,11 +177,6 @@ const OldFillStyleDefinitionSet& XMLPropStyleContext::getFooterSet() return theFooterSet::get(); } -const OldFillStyleDefinitionSet& XMLPropStyleContext::getParaSet() -{ -return theParaSet::get(); -} - SvXMLImportContext *XMLPropStyleContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, @@ -290,7 +285,7 @@ void XMLPropStyleContext::CreateAndInsert( bool bOverwrite ) if(doNewDrawingLayerFillStyleDefinitionsExist(s_FillStyle)) { -deactivateOldFillStyleDefinitions(getParaSet()); +deactivateOldFillStyleDefinitions(theParaSet::get()); bDrawingLayerFillStylesUsed = true; } } diff --git a/xmloff/source/text/txtstyle.cxx b/xmloff/source/text/txtstyle.cxx index ef5282d..c26c09b 100644 --- a/xmloff/source/text/txtstyle.cxx +++ b/xmloff/source/text/txtstyle.cxx @@ -145,7 +145,7 @@ void XMLTextParagraphExport::exportTextStyles( bool bUsed, bool bProg ) bUsed, XML_STYLE_FAMILY_TEXT_TEXT ); // get shape export to make sure the frame family is added correctly. GetExport().GetShapeExport(); -exportStyleFamily( "FrameStyles", OUString(XML_STYLE_FAMILY_SD_GRAPHICS_NAME), GetFramePropMapper(), +exportStyleFamily( "FrameStyles", OUString(XML_STYLE_FAMILY_SD_GRAPHICS_NAME), xFramePropMapper, bUsed, XML_STYLE_FAMILY_TEXT_FRAME); exportNumStyles( bUsed ); if( !IsBlockMode() ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlstyle.hxx |3 --- xmloff/source/style/xmlstyle.cxx | 12 2 files changed, 15 deletions(-) New commits: commit 198fabe0f2dcfa920eb975da11e9b45d010dcb3a Author: Markus MohrhardDate: Sat Sep 24 13:08:02 2016 +0200 soon is now Change-Id: Ib4b8b949f00609149f9134fb2f286cd7e0dc0255 Reviewed-on: https://gerrit.libreoffice.org/29254 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/include/xmloff/xmlstyle.hxx b/include/xmloff/xmlstyle.hxx index 0e7e516..975aa0c 100644 --- a/include/xmloff/xmlstyle.hxx +++ b/include/xmloff/xmlstyle.hxx @@ -67,9 +67,6 @@ class XMLOFF_DLLPUBLIC SvXMLStyleContext : public SvXMLImportContext OUString maFollow;// Will be moved to XMLPropStyle soon bool mbHidden; -OUString maHelpFile; // Will be removed very soon - -sal_uInt32 mnHelpId;// Will be removed very soon sal_uInt16 mnFamily; bool mbValid : 1; // Set this to false in CreateAndInsert diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx index a7b861e..0c25d38 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -123,17 +123,6 @@ void SvXMLStyleContext::SetAttribute( sal_uInt16 nPrefixKey, { maFollow = rValue; } -else if( IsXMLToken( rLocalName, XML_HELP_FILE_NAME ) ) -{ -maHelpFile = rValue; -} -else if( IsXMLToken( rLocalName, XML_HELP_ID ) ) -{ -sal_Int32 nTmp = rValue.toInt32(); -mnHelpId = -(nTmp < 0L) ? 0U : ( (nTmp > USHRT_MAX) ? USHRT_MAX -: (sal_uInt16)nTmp ); -} else if( IsXMLToken( rLocalName, XML_HIDDEN ) ) { mbHidden = rValue.toBoolean(); @@ -149,7 +138,6 @@ SvXMLStyleContext::SvXMLStyleContext( sal_uInt16 nFam, bool bDefault ) : SvXMLImportContext( rImp, nPrfx, rLName ), mbHidden( false ), -mnHelpId( UCHAR_MAX ), mnFamily( nFam ), mbValid( true ), mbNew( true ), ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx |1 + xmloff/source/core/xmlimp.cxx | 10 -- 2 files changed, 9 insertions(+), 2 deletions(-) New commits: commit 5678bc99fb685fe09191e8419a1121e565f97f80 Author: Mohammed Abdul AzeemDate: Sun Sep 25 11:06:32 2016 +0530 tdf#101935 and tdf#102201: This fixes both the bugs. Change-Id: I7a64abc0cb12b5195a3b955549ce4f72f3530d57 Reviewed-on: https://gerrit.libreoffice.org/29263 Reviewed-by: Noel Grandin Tested-by: Noel Grandin diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 87634e7..93c5f25 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -194,6 +194,7 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper8< bool isFastContext; css::uno::Reference< css::xml::sax::XFastParser > mxParser; rtl::Reference< SvXMLImportFastNamespaceHandler > maNamespaceHandler; +css::uno::Reference< css::xml::sax::XFastDocumentHandler > mxFastDocumentHandler; css::uno::Reference< css::xml::sax::XFastTokenHandler > mxTokenHandler; std::unordered_map< sal_Int32, OUString > maNamespaceMap; const OUString getNameFromToken( sal_Int32 nToken ); diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 715ddb9..66e6075 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -431,6 +431,7 @@ SvXMLImport::SvXMLImport( mnErrorFlags(SvXMLErrorFlags::NO), isFastContext( false ), maNamespaceHandler( new SvXMLImportFastNamespaceHandler() ), +mxFastDocumentHandler( nullptr ), mxTokenHandler( new FastTokenHandler() ), mbIsFormsSupported( true ), mbIsTableShapeSupported( false ), @@ -439,7 +440,6 @@ SvXMLImport::SvXMLImport( SAL_WARN_IF( !xContext.is(), "xmloff.core", "got no service manager" ); InitCtor_(); mxParser = xml::sax::FastParser::create( xContext ); -setFastDocumentHandler( this ); setNamespaceHandler( maNamespaceHandler.get() ); setTokenHandler( mxTokenHandler ); registerNamespaces(); @@ -478,13 +478,19 @@ sal_Int64 SAL_CALL SvXMLImport::getSomething( const uno::Sequence< sal_Int8 >& r void SAL_CALL SvXMLImport::parseStream( const xml::sax::InputSource& aInputSource ) throw (xml::sax::SAXException, io::IOException, uno::RuntimeException, std::exception) { +if ( mxFastDocumentHandler.is() ) +mxParser->setFastDocumentHandler( mxFastDocumentHandler ); +else +mxParser->setFastDocumentHandler( this ); + mxParser->parseStream( aInputSource ); +mxParser->setFastDocumentHandler( nullptr ); } void SAL_CALL SvXMLImport::setFastDocumentHandler( const uno::Reference< xml::sax::XFastDocumentHandler >& Handler ) throw (uno::RuntimeException, std::exception) { -mxParser->setFastDocumentHandler( Handler ); +mxFastDocumentHandler = Handler; } void SAL_CALL SvXMLImport::setTokenHandler( const uno::Reference< xml::sax::XFastTokenHandler >& Handler ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlictxt.hxx |6 +++--- include/xmloff/xmlimp.hxx |5 +++-- xmloff/source/core/xmlimp.cxx | 26 +- 3 files changed, 19 insertions(+), 18 deletions(-) New commits: commit dbf87d2124a0c01014b9e839804455d3be38831f Author: Michael StahlDate: Fri Sep 16 14:26:50 2016 +0200 coverity#1372990 xmloff: use unique_ptr for RewindMaps Change-Id: I51e67607d94a465ce39e822f01a0c60efbf1a0f0 diff --git a/include/xmloff/xmlictxt.hxx b/include/xmloff/xmlictxt.hxx index 6e064e2..6d24112 100644 --- a/include/xmloff/xmlictxt.hxx +++ b/include/xmloff/xmlictxt.hxx @@ -43,10 +43,10 @@ class XMLOFF_DLLPUBLIC SvXMLImportContext : public ::cppu::WeakImplHelper1< ::cs sal_uInt16 mnPrefix; OUString maLocalName; -std::unique_ptr mxRewindMap; +std::unique_ptr m_pRewindMap; -SAL_DLLPRIVATE SvXMLNamespaceMap *TakeRewindMap() { return mxRewindMap.release(); } -SAL_DLLPRIVATE void PutRewindMap( SvXMLNamespaceMap *p ) { mxRewindMap.reset(p); } +SAL_DLLPRIVATE std::unique_ptr TakeRewindMap() { return std::move(m_pRewindMap); } +SAL_DLLPRIVATE void PutRewindMap(std::unique_ptr p) { m_pRewindMap = std::move(p); } protected: diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index cc54fe1..87634e7 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -175,7 +175,7 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper8< std::unique_ptr mpImpl;// dummy -SvXMLNamespaceMap *mpNamespaceMap; +std::unique_ptr mpNamespaceMap; std::unique_ptr mpUnitConv; SvXMLImportContexts_ImplmaContexts; FastSvXMLImportContexts_ImplmaFastContexts; @@ -200,7 +200,8 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper8< const OUString getNamespacePrefixFromToken( sal_Int32 nToken ); void registerNamespaces(); void registerNSHelper(sal_Int32 nToken, sal_Int32 nPrefix, sal_Int32 nNamespace ); -SvXMLNamespaceMap* processNSAttributes(const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList); +std::unique_ptr processNSAttributes( +const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList); void Characters(const OUString& aChars); protected: diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 52df8ce..715ddb9 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -447,8 +447,6 @@ SvXMLImport::SvXMLImport( SvXMLImport::~SvXMLImport() throw () { -delete mpNamespaceMap; - if (mxEventListener.is() && mxModel.is()) mxModel->removeEventListener(mxEventListener); } @@ -659,9 +657,10 @@ void SAL_CALL SvXMLImport::endDocument() } } -SvXMLNamespaceMap* SvXMLImport::processNSAttributes(const uno::Reference< xml::sax::XAttributeList >& xAttrList) +std::unique_ptr SvXMLImport::processNSAttributes( +const uno::Reference< xml::sax::XAttributeList >& xAttrList) { -SvXMLNamespaceMap *pRewindMap = nullptr; +std::unique_ptr pRewindMap; sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { @@ -685,8 +684,8 @@ SvXMLNamespaceMap* SvXMLImport::processNSAttributes(const uno::Reference< xml::s { if( !pRewindMap ) { -pRewindMap = mpNamespaceMap; -mpNamespaceMap = new SvXMLNamespaceMap( *mpNamespaceMap ); +pRewindMap = std::move(mpNamespaceMap); +mpNamespaceMap.reset(new SvXMLNamespaceMap(*pRewindMap)); } const OUString& rAttrValue = xAttrList->getValueByIndex( i ); @@ -719,7 +718,7 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName, //SAL_INFO("svg", "startElement " << rName); // Process namespace attributes. This must happen before creating the // context, because namespace decaration apply to the element name itself. -SvXMLNamespaceMap *pRewindMap = processNSAttributes(xAttrList); +std::unique_ptr pRewindMap(processNSAttributes(xAttrList)); // Get element's namespace and local name. OUString aLocalName; @@ -759,7 +758,7 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName, // Remember old namespace map. if( pRewindMap ) -xContext->PutRewindMap( pRewindMap ); +xContext->PutRewindMap(std::move(pRewindMap)); // Call a startElement at the new context. xContext->StartElement( xAttrList ); @@ -782,7 +781,7 @@ rName return; } -SvXMLNamespaceMap * pRewindMap(nullptr); +std::unique_ptr pRewindMap; { // Get topmost context and remove it from the stack. @@ -808,8 +807,8 @@ rName // Rewind a namespace map. if (pRewindMap) { -delete mpNamespaceMap; -mpNamespaceMap = pRewindMap; +
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/XMLFontStylesContext.hxx |2 ++ xmloff/source/style/XMLFontStylesContext.cxx |2 ++ 2 files changed, 4 insertions(+) New commits: commit 7ed3e749f7b525bdbbbd353f85c765becb90daa6 Author: Stephan BergmannDate: Sat Sep 10 07:49:02 2016 +0200 Blind fix for MSVC Change-Id: I53e01f3c76cf1e52fbf5f95f525cfc3b643b9e77 diff --git a/include/xmloff/XMLFontStylesContext.hxx b/include/xmloff/XMLFontStylesContext.hxx index d671e65..cc6a2a7 100644 --- a/include/xmloff/XMLFontStylesContext.hxx +++ b/include/xmloff/XMLFontStylesContext.hxx @@ -59,6 +59,8 @@ public: const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, rtl_TextEncoding eDfltEnc ); +~XMLFontStylesContext() override; + const SvXMLTokenMap& GetFontStyleAttrTokenMap() const { return *pFontStyleAttrTokenMap; diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx index 28fb855..e6c1b66 100644 --- a/xmloff/source/style/XMLFontStylesContext.cxx +++ b/xmloff/source/style/XMLFontStylesContext.cxx @@ -377,6 +377,8 @@ XMLFontStylesContext::XMLFontStylesContext( SvXMLImport& rImport, { } +XMLFontStylesContext::~XMLFontStylesContext() {} + bool XMLFontStylesContext::FillProperties( const OUString& rName, ::std::vector< XMLPropertyState > , sal_Int32 nFamilyNameIdx, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlnumi.hxx |2 ++ xmloff/source/style/xmlnumi.cxx |2 ++ 2 files changed, 4 insertions(+) New commits: commit 9dc0f2b703d8fbc8698a3cf36949a981e55b68c6 Author: Stephan BergmannDate: Fri Sep 9 14:26:53 2016 +0200 Blind fix for MSVC Change-Id: I1b3e21e9fdf1ac14e095df203cb48fdd1b4fd028 diff --git a/include/xmloff/xmlnumi.hxx b/include/xmloff/xmlnumi.hxx index ee7913a..b1a0687 100644 --- a/include/xmloff/xmlnumi.hxx +++ b/include/xmloff/xmlnumi.hxx @@ -66,6 +66,8 @@ public: const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, bool bOutl = false ); +~SvxXMLListStyleContext() override; + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index dbe28d7..ce964ba 100644 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -1033,6 +1033,8 @@ SvxXMLListStyleContext::SvxXMLListStyleContext( SvXMLImport& rImport, { } +SvxXMLListStyleContext::~SvxXMLListStyleContext() {} + SvXMLImportContext *SvxXMLListStyleContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx |6 +++- include/xmloff/xmltkmap.hxx |2 - xmloff/source/core/xmlictxt.cxx | 60 xmloff/source/core/xmlimp.cxx | 47 ++- 4 files changed, 82 insertions(+), 33 deletions(-) New commits: commit 67ef208b2b586603e205105a384231645d7f6712 Author: Mohammed Abdul AzeemDate: Fri Sep 2 01:18:53 2016 +0530 Fixes for migrating SvXMLImport to use FastParser: These are necessary for implementing fast interfaces for the contexts. Change-Id: I37655c85c76b42782a49eeea3140490213047341 Reviewed-on: https://gerrit.libreoffice.org/28641 Tested-by: Jenkins Reviewed-by: Michael Meeks diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index c673dfc..415ca40 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -61,7 +61,7 @@ #include #include -#define NAMESPACE_TOKEN( prefixToken ) ( ( prefixToken + 1 ) << NMSP_SHIFT ) +#define NAMESPACE_TOKEN( prefixToken ) ( ( sal_Int32( prefixToken + 1 ) ) << NMSP_SHIFT ) const size_t NMSP_SHIFT = 16; const sal_Int32 TOKEN_MASK = 0x; @@ -191,6 +191,7 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper8< SvXMLImportFlags mnImportFlags; SvXMLErrorFlags mnErrorFlags; std::set< OUString > embeddedFontUrlsKnown; +bool isFastContext; css::uno::Reference< css::xml::sax::XFastParser > mxParser; rtl::Reference< SvXMLImportFastNamespaceHandler > maNamespaceHandler; css::uno::Reference< css::xml::sax::XFastTokenHandler > mxTokenHandler; @@ -199,6 +200,9 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper8< const OUString getNamespacePrefixFromToken( sal_Int32 nToken ); void registerNamespaces(); void registerNSHelper(sal_Int32 nToken, sal_Int32 nPrefix, sal_Int32 nNamespace ); +void processNSAttributes( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, +SvXMLNamespaceMap *pRewindMap ); +void Characters(const OUString& aChars); protected: diff --git a/include/xmloff/xmltkmap.hxx b/include/xmloff/xmltkmap.hxx index 89cfd65..c9f0bee 100644 --- a/include/xmloff/xmltkmap.hxx +++ b/include/xmloff/xmltkmap.hxx @@ -44,7 +44,7 @@ struct SvXMLTokenMapEntry nPrefixKey( nPrefix ), eLocalName( eName ), nToken( nTok ), -nFastToken( sal_uInt32( nPrefixKey + 1 ) << 16 | eLocalName ) +nFastToken( ( sal_Int32( nPrefixKey + 1 ) ) << 16 | eLocalName ) { if ( nFastTok ) // alternative value for duplicate/dummy tokens nFastToken = nFastTok; diff --git a/xmloff/source/core/xmlictxt.cxx b/xmloff/source/core/xmlictxt.cxx index f3e27e5..2fb80c5 100644 --- a/xmloff/source/core/xmlictxt.cxx +++ b/xmloff/source/core/xmlictxt.cxx @@ -25,6 +25,7 @@ #include #include #include +#include using namespace ::com::sun::star; @@ -69,6 +70,7 @@ void SvXMLImportContext::Characters( const OUString& ) void SAL_CALL SvXMLImportContext::startFastElement(sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList > & Attribs) throw (uno::RuntimeException, xml::sax::SAXException, std::exception) { +mrImport.isFastContext = false; startUnknownElement( mrImport.getNamespacePrefixFromToken( nElement ), mrImport.getNameFromToken( nElement ), Attribs ); } @@ -85,38 +87,47 @@ void SAL_CALL SvXMLImportContext::startUnknownElement(const OUString & rPrefix, else elementName = rLocalName; -uno::Sequence< xml::FastAttribute > fastAttribs = Attribs->getFastAttributes(); -sal_uInt16 len = fastAttribs.getLength(); -for (sal_uInt16 i = 0; i < len; i++) +if ( Attribs.is() ) { -OUString& rAttrValue = fastAttribs[i].Value; -sal_Int32 nToken = fastAttribs[i].Token; -const OUString& rAttrNamespacePrefix = mrImport.getNamespacePrefixFromToken( nToken ); -OUString sAttrName = mrImport.getNameFromToken( nToken ); -if ( !rAttrNamespacePrefix.isEmpty() ) -sAttrName = rAttrNamespacePrefix + ":" + sAttrName; - -rAttrList->AddAttribute( sAttrName, "CDATA", rAttrValue ); +sax_fastparser::FastAttributeList *pAttribList; +assert( dynamic_cast< sax_fastparser::FastAttributeList *>( Attribs.get() ) != nullptr ); +pAttribList = static_cast< sax_fastparser::FastAttributeList *>( Attribs.get() ); + +const std::vector< sal_Int32 >& rAttrTokenList = pAttribList->getFastAttributeTokens(); +for ( size_t i = 0; i < rAttrTokenList.size(); i++ ) +{ +const OUString& rAttrValue = OUString(pAttribList->getFastAttributeValue(i), + pAttribList->AttributeValueLength(i), RTL_TEXTENCODING_UTF8); +sal_Int32
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx |2 include/xmloff/xmltkmap.hxx| 11 +-- xmloff/source/core/xmltkmap.cxx| 95 + xmloff/source/style/GradientStyle.cxx |4 - xmloff/source/style/HatchStyle.cxx |4 - xmloff/source/style/TransGradientStyle.cxx |4 - xmloff/source/token/tokens.txt |2 7 files changed, 62 insertions(+), 60 deletions(-) New commits: commit 41b3fd8ca54eff7e71c69bb0b60e63016f1ac8c2 Author: Mohammed Abdul AzeemDate: Fri Aug 26 23:32:23 2016 +0530 Make SvXMLTokenMap compatible with FastTokens: Added seperate map for fastToken and Token, to get token using only fastToken. Default values are derived for fastTokens from prefixKey and localName. Duplicate/ dummy tokens need to be overidden with different values. Change-Id: I17268754d8fd1bac29dd7bae05706ff20b8314ae Reviewed-on: https://gerrit.libreoffice.org/28415 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index a1152c4..c673dfc 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -61,6 +61,8 @@ #include #include +#define NAMESPACE_TOKEN( prefixToken ) ( ( prefixToken + 1 ) << NMSP_SHIFT ) + const size_t NMSP_SHIFT = 16; const sal_Int32 TOKEN_MASK = 0x; const sal_Int32 NMSP_MASK = 0x; diff --git a/include/xmloff/xmltkmap.hxx b/include/xmloff/xmltkmap.hxx index c54d801..2953dac 100644 --- a/include/xmloff/xmltkmap.hxx +++ b/include/xmloff/xmltkmap.hxx @@ -28,7 +28,6 @@ class SvXMLTokenMap_Impl; -class SvXMLTokenMapEntry_Impl; #define XML_TOK_UNKNOWN 0xU #define XML_TOKEN_MAP_END { 0xU, xmloff::token::XML_TOKEN_INVALID, 0U, 0 } @@ -41,19 +40,21 @@ struct SvXMLTokenMapEntry sal_Int32 nFastToken; SvXMLTokenMapEntry( sal_uInt16 nPrefix, xmloff::token::XMLTokenEnum eName, -sal_uInt16 nTok = XML_TOK_UNKNOWN, sal_Int32 nFastTok = 0 ) : +sal_uInt16 nTok, sal_Int32 nFastTok = 0 ) : nPrefixKey( nPrefix ), eLocalName( eName ), nToken( nTok ), -nFastToken( nFastTok ) -{} +nFastToken( ( nPrefixKey + 1 ) << 16 | eLocalName ) +{ +if ( nFastTok ) // alternative value for duplicate/dummy tokens +nFastToken = nFastTok; +} }; class XMLOFF_DLLPUBLIC SvXMLTokenMap { private: std::unique_ptr m_pImpl; -sal_uInt16 Get( const SvXMLTokenMapEntry_Impl& rEntry ) const; public: diff --git a/xmloff/source/core/xmltkmap.cxx b/xmloff/source/core/xmltkmap.cxx index 6888b62..1aca389 100644 --- a/xmloff/source/core/xmltkmap.cxx +++ b/xmloff/source/core/xmltkmap.cxx @@ -21,52 +21,63 @@ #include #include -#include +#include +#include using namespace ::xmloff::token; -class SvXMLTokenMapEntry_Impl +class SvXMLTokenMap_Impl { -sal_uInt16 nPrefixKey; -OUStringsLocalName; -sal_uInt16 nToken; -sal_Int32 nFastToken; +private: +struct PairHash +{ +std::size_t operator()(const std::pair ) const +{ +return static_cast( pair.first | pair.second.hashCode() ); +} +}; +std::unordered_map< std::pair , +sal_uInt16, PairHash> m_aPrefixAndNameToTokenMap; +std::unordered_map< sal_Int32, sal_uInt16> m_aFastTokenToTokenMap; public: +void insert( const SvXMLTokenMapEntry& rEntry ); +sal_uInt16 get( sal_uInt16 nKeyPrefix, const OUString& rLName ) const; +sal_uInt16 get( sal_Int32 nFastTok ) const; +}; -sal_uInt16 GetToken() const { return nToken; } - -SvXMLTokenMapEntry_Impl( sal_uInt16 nPrefix, const OUString& rLName, - sal_uInt16 nTok = XML_TOK_UNKNOWN, sal_Int32 nFastTok = 0 ) : -nPrefixKey( nPrefix ), -sLocalName( rLName ), -nToken( nTok ), -nFastToken( nFastTok ) -{} - -explicit SvXMLTokenMapEntry_Impl( const SvXMLTokenMapEntry& rEntry ) : -nPrefixKey( rEntry.nPrefixKey ), -sLocalName( GetXMLToken( rEntry.eLocalName ) ), -nToken( rEntry.nToken ), -nFastToken( rEntry.nFastToken ) -{} +void SvXMLTokenMap_Impl::insert( const SvXMLTokenMapEntry& rEntry ) +{ +m_aPrefixAndNameToTokenMap.insert( std::make_pair( std::make_pair( rEntry.nPrefixKey, + GetXMLToken( rEntry.eLocalName ) ), rEntry.nToken ) ); +if( rEntry.nFastToken ) +m_aFastTokenToTokenMap.insert( std::make_pair( rEntry.nFastToken, rEntry.nToken ) ); +} -bool operator<( const SvXMLTokenMapEntry_Impl& r ) const -{ -return nPrefixKey < r.nPrefixKey || - ( nPrefixKey == r.nPrefixKey && - sLocalName < r.sLocalName); -} -}; +sal_uInt16
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmltkmap.hxx | 17 +++-- xmloff/source/core/xmltkmap.cxx | 30 ++ 2 files changed, 37 insertions(+), 10 deletions(-) New commits: commit e3b3c3fe41fde28b01ab1b2d8408d92dfa837dc5 Author: Daniel SikelerDate: Thu Aug 25 02:19:48 2016 +0530 Make SvXMLTokenMap compatible with FastTokens: Added new methods for the fasttokens and a lot of entries must be updated in later commits. Change-Id: I37de9c8d4bdeb75f678902a422a5961670480562 Reviewed-on: https://gerrit.libreoffice.org/28355 Reviewed-by: Noel Grandin Tested-by: Noel Grandin diff --git a/include/xmloff/xmltkmap.hxx b/include/xmloff/xmltkmap.hxx index 4cf6403..c54d801 100644 --- a/include/xmloff/xmltkmap.hxx +++ b/include/xmloff/xmltkmap.hxx @@ -28,20 +28,32 @@ class SvXMLTokenMap_Impl; +class SvXMLTokenMapEntry_Impl; #define XML_TOK_UNKNOWN 0xU -#define XML_TOKEN_MAP_END { 0xU, ::xmloff::token::XML_TOKEN_INVALID, 0U } +#define XML_TOKEN_MAP_END { 0xU, xmloff::token::XML_TOKEN_INVALID, 0U, 0 } struct SvXMLTokenMapEntry { sal_uInt16 nPrefixKey; -enum ::xmloff::token::XMLTokenEnum eLocalName; +enum xmloff::token::XMLTokenEnum eLocalName; sal_uInt16 nToken; +sal_Int32 nFastToken; + +SvXMLTokenMapEntry( sal_uInt16 nPrefix, xmloff::token::XMLTokenEnum eName, +sal_uInt16 nTok = XML_TOK_UNKNOWN, sal_Int32 nFastTok = 0 ) : +nPrefixKey( nPrefix ), +eLocalName( eName ), +nToken( nTok ), +nFastToken( nFastTok ) +{} }; class XMLOFF_DLLPUBLIC SvXMLTokenMap { +private: std::unique_ptr m_pImpl; +sal_uInt16 Get( const SvXMLTokenMapEntry_Impl& rEntry ) const; public: @@ -49,6 +61,7 @@ public: ~SvXMLTokenMap(); sal_uInt16 Get( sal_uInt16 nPrefix, const OUString& rLName ) const; +sal_uInt16 Get( sal_Int32 nFastTok ) const; }; #endif // INCLUDED_XMLOFF_XMLTKMAP_HXX diff --git a/xmloff/source/core/xmltkmap.cxx b/xmloff/source/core/xmltkmap.cxx index 1b5810f..6888b62 100644 --- a/xmloff/source/core/xmltkmap.cxx +++ b/xmloff/source/core/xmltkmap.cxx @@ -30,22 +30,25 @@ class SvXMLTokenMapEntry_Impl sal_uInt16 nPrefixKey; OUStringsLocalName; sal_uInt16 nToken; +sal_Int32 nFastToken; public: sal_uInt16 GetToken() const { return nToken; } SvXMLTokenMapEntry_Impl( sal_uInt16 nPrefix, const OUString& rLName, - sal_uInt16 nTok=XML_TOK_UNKNOWN ) : + sal_uInt16 nTok = XML_TOK_UNKNOWN, sal_Int32 nFastTok = 0 ) : nPrefixKey( nPrefix ), sLocalName( rLName ), -nToken( nTok ) +nToken( nTok ), +nFastToken( nFastTok ) {} explicit SvXMLTokenMapEntry_Impl( const SvXMLTokenMapEntry& rEntry ) : nPrefixKey( rEntry.nPrefixKey ), sLocalName( GetXMLToken( rEntry.eLocalName ) ), -nToken( rEntry.nToken ) +nToken( rEntry.nToken ), +nFastToken( rEntry.nFastToken ) {} bool operator<( const SvXMLTokenMapEntry_Impl& r ) const @@ -72,13 +75,10 @@ SvXMLTokenMap::~SvXMLTokenMap() { } -sal_uInt16 SvXMLTokenMap::Get( sal_uInt16 nKeyPrefix, - const OUString& rLName ) const +sal_uInt16 SvXMLTokenMap::Get( const SvXMLTokenMapEntry_Impl& rEntry ) const { SvXMLTokenMapEntry_Impl const* pEntry = nullptr; -SvXMLTokenMapEntry_Impl aTst( nKeyPrefix, rLName ); - -SvXMLTokenMap_Impl::iterator it = m_pImpl->find( aTst ); +SvXMLTokenMap_Impl::iterator it = m_pImpl->find( rEntry ); if (it != m_pImpl->end()) { pEntry = &*it; @@ -90,4 +90,18 @@ sal_uInt16 SvXMLTokenMap::Get( sal_uInt16 nKeyPrefix, return XML_TOK_UNKNOWN; } +sal_uInt16 SvXMLTokenMap::Get( sal_uInt16 nKeyPrefix, + const OUString& rLName ) const +{ +SvXMLTokenMapEntry_Impl aTst( nKeyPrefix, rLName ); +return( Get( aTst ) ); +} + +sal_uInt16 SvXMLTokenMap::Get( sal_Int32 nFastTok ) const +{ +static const OUString sEmptyString(""); +SvXMLTokenMapEntry_Impl aTst( 0, sEmptyString, XML_TOK_UNKNOWN, nFastTok ); +return( Get( aTst ) ); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx |2 +- xmloff/source/core/xmlimp.cxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit e353a8ffdd4dbf20dcfe3e8904848ce96deac5c5 Author: Stephan BergmannDate: Thu Aug 25 10:58:28 2016 +0200 cid#1371771 Uncaught exception Change-Id: I47105f30e702f9bc40cb711f862fb25796202d09 diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 740f313..a1152c4 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -244,7 +244,7 @@ public: SvXMLImport( const css::uno::Reference< css::uno::XComponentContext >& xContext, OUString const & implementationName, -SvXMLImportFlags nImportFlags = SvXMLImportFlags::ALL ) throw(); +SvXMLImportFlags nImportFlags = SvXMLImportFlags::ALL ); virtual ~SvXMLImport() throw(); diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 193acf6..b7db468 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -420,7 +420,7 @@ void SvXMLImport::InitCtor_() SvXMLImport::SvXMLImport( const css::uno::Reference< css::uno::XComponentContext >& xContext, -OUString const & implementationName, SvXMLImportFlags nImportFlags ) throw () +OUString const & implementationName, SvXMLImportFlags nImportFlags ) : mpImpl( new SvXMLImport_Impl(xContext, implementationName) ), mpNamespaceMap( new SvXMLNamespaceMap ), ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx | 55 +- xmloff/source/core/xmlictxt.cxx | 57 +- xmloff/source/core/xmlimp.cxx | 218 +++- 3 files changed, 318 insertions(+), 12 deletions(-) New commits: commit 4ccd991f6a6ca680ac2b7513ab3853e1ba9c71a3 Author: Mohammed Abdul AzeemDate: Tue Aug 16 23:37:28 2016 +0530 GSoC - First cut at migrating xmloff/ to use FastParser: This lays the foundation for using fast parser and contexts. Tokens are detokenized and made to emit events just like legacy parser interfaces. Change-Id: I11659be68026e112fdd06f8a847f3f2c876dae35 Reviewed-on: https://gerrit.libreoffice.org/28175 Reviewed-by: Noel Grandin Tested-by: Noel Grandin diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 97bbf6c..740f313 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -48,8 +49,9 @@ #include #include #include -#include +#include #include +#include #include @@ -59,6 +61,10 @@ #include #include +const size_t NMSP_SHIFT = 16; +const sal_Int32 TOKEN_MASK = 0x; +const sal_Int32 NMSP_MASK = 0x; + namespace com { namespace sun { namespace star { namespace frame { class XModel; } namespace io { class XOutputStream; } @@ -103,15 +109,39 @@ namespace o3tl template<> struct typed_flags : is_typed_flags {}; } +class SvXMLImportFastNamespaceHandler : public ::cppu::WeakImplHelper< css::xml::sax::XFastNamespaceHandler > +{ +private: +struct NamespaceDefine +{ +OUStringm_aPrefix; +OUStringm_aNamespaceURI; -class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper7< +NamespaceDefine( const OUString& rPrefix, const OUString& rNamespaceURI ) : m_aPrefix( rPrefix ), m_aNamespaceURI( rNamespaceURI ) {} +}; +std::vector< std::unique_ptr< NamespaceDefine > > m_aNamespaceDefines; + +public: +SvXMLImportFastNamespaceHandler(); +void addNSDeclAttributes( rtl::Reference < comphelper::AttributeList >& rAttrList ); + +//XFastNamespaceHandler +virtual void SAL_CALL registerNamespace( const OUString& rNamespacePrefix, const OUString& rNamespaceURI ) +throw (css::uno::RuntimeException, std::exception) override; +virtual OUString SAL_CALL getNamespaceURI( const OUString& rNamespacePrefix ) +throw (css::uno::RuntimeException, std::exception) override; +}; + + +class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper8< css::xml::sax::XExtendedDocumentHandler, css::xml::sax::XFastDocumentHandler, css::lang::XServiceInfo, css::lang::XInitialization, css::document::XImporter, css::document::XFilter, - css::lang::XUnoTunnel> + css::lang::XUnoTunnel, + css::xml::sax::XFastParser> { friend class SvXMLImportContext; @@ -159,6 +189,14 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper7< SvXMLImportFlags mnImportFlags; SvXMLErrorFlags mnErrorFlags; std::set< OUString > embeddedFontUrlsKnown; +css::uno::Reference< css::xml::sax::XFastParser > mxParser; +rtl::Reference< SvXMLImportFastNamespaceHandler > maNamespaceHandler; +css::uno::Reference< css::xml::sax::XFastTokenHandler > mxTokenHandler; +std::unordered_map< sal_Int32, OUString > maNamespaceMap; +const OUString getNameFromToken( sal_Int32 nToken ); +const OUString getNamespacePrefixFromToken( sal_Int32 nToken ); +void registerNamespaces(); +void registerNSHelper(sal_Int32 nToken, sal_Int32 nPrefix, sal_Int32 nNamespace ); protected: @@ -268,6 +306,17 @@ public: virtual void SAL_CALL unknown(const OUString& sString) throw( css::xml::sax::SAXException, css::uno::RuntimeException, std::exception ) override; +// XFastParser +virtual void SAL_CALL parseStream( const css::xml::sax::InputSource& aInputSource ) throw (css::xml::sax::SAXException, css::io::IOException, css::uno::RuntimeException, std::exception) override; +virtual void SAL_CALL setFastDocumentHandler( const css::uno::Reference< css::xml::sax::XFastDocumentHandler >& Handler ) throw (css::uno::RuntimeException, std::exception) override; +virtual void SAL_CALL setTokenHandler( const css::uno::Reference< css::xml::sax::XFastTokenHandler >& Handler ) throw (css::uno::RuntimeException, std::exception) override; +virtual void SAL_CALL registerNamespace( const OUString& NamespaceURL, sal_Int32 NamespaceToken ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; +virtual OUString SAL_CALL getNamespaceURL( const