[Libreoffice-commits] core.git: include/sax sax/source xmloff/source

Noel (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 16 17:08:31 UTC 2020


 include/sax/fastattribs.hxx           |    6 +++++-
 sax/source/tools/fastattribs.cxx      |    4 ++++
 xmloff/source/forms/elementimport.cxx |    7 ++-----
 3 files changed, 11 insertions(+), 6 deletions(-)

New commits:
commit d52f83c7dbeba243aa9cb0f8f129df2fe543a7d3
Author:     Noel <noelgrandin at gmail.com>
AuthorDate: Mon Nov 16 15:18:15 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Nov 16 18:07:50 2020 +0100

    tdf#138144 Form wizard fails to save
    
    fallout from
        commit 3de38e95561ab7ca114d9f3307702ba89c4e3e9a
        Date:   Tue Nov 10 19:20:06 2020 +0200
        use fastparser in forms
    
    Change-Id: I4691786525132ef0cf98b6b177a2c022c4d7d032
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105932
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/sax/fastattribs.hxx b/include/sax/fastattribs.hxx
index a9bb67e62841..e00452b0aa14 100644
--- a/include/sax/fastattribs.hxx
+++ b/include/sax/fastattribs.hxx
@@ -22,6 +22,7 @@
 
 #include <com/sun/star/xml/sax/XFastAttributeList.hpp>
 #include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
+#include <com/sun/star/util/XCloneable.hpp>
 
 #include <cppuhelper/implbase.hxx>
 #include <sax/saxdllapi.h>
@@ -69,7 +70,7 @@ class SAX_DLLPUBLIC FastTokenHandlerBase :
 };
 
 
-class SAX_DLLPUBLIC FastAttributeList final : public cppu::WeakImplHelper< css::xml::sax::XFastAttributeList >
+class SAX_DLLPUBLIC FastAttributeList final : public cppu::WeakImplHelper< css::xml::sax::XFastAttributeList, css::util::XCloneable >
 {
 public:
     FastAttributeList( FastTokenHandlerBase *pTokenHandler );
@@ -113,6 +114,9 @@ public:
     virtual css::uno::Sequence< css::xml::Attribute > SAL_CALL getUnknownAttributes(  ) override;
     virtual css::uno::Sequence< css::xml::FastAttribute > SAL_CALL getFastAttributes() override;
 
+    // XCloneable
+    virtual ::css::uno::Reference< ::css::util::XCloneable > SAL_CALL createClone() override;
+
     sal_Int32 getAttributeIndex( ::sal_Int32 Token )
     {
         for (size_t i=0; i<maAttributeTokens.size(); ++i)
diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx
index a8c3e57cae86..161f9f11bba0 100644
--- a/sax/source/tools/fastattribs.cxx
+++ b/sax/source/tools/fastattribs.cxx
@@ -75,6 +75,10 @@ FastAttributeList::FastAttributeList( const css::uno::Reference< css::xml::sax::
     maUnknownAttributes = rOther.maUnknownAttributes;
 }
 
+css::uno::Reference< ::css::util::XCloneable > FastAttributeList::createClone()
+{
+    return new FastAttributeList(this);
+}
 
 FastAttributeList::~FastAttributeList()
 {
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index 3ebd9b765a95..1fac083e463c 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -1763,11 +1763,8 @@ namespace xmloff
         OSL_ENSURE(!m_xOwnAttributes.is(), "OColumnWrapperImport::StartElement: already have the cloned list!");
 
         // clone the attributes
-        Reference< XCloneable > xCloneList(_rxAttrList, UNO_QUERY);
-        OSL_ENSURE(xCloneList.is(), "OColumnWrapperImport::StartElement: AttributeList not clonable!");
-        if ( xCloneList.is() )
-            m_xOwnAttributes.set(xCloneList->createClone(), UNO_QUERY);
-        OSL_ENSURE(m_xOwnAttributes.is(), "OColumnWrapperImport::StartElement: no cloned list!");
+        Reference< XCloneable > xCloneList(_rxAttrList, UNO_QUERY_THROW);
+        m_xOwnAttributes.set(xCloneList->createClone(), UNO_QUERY_THROW);
     }
 
     OControlImport* OColumnWrapperImport::implCreateChildContext(


More information about the Libreoffice-commits mailing list