[Libreoffice-commits] core.git: writerfilter/source

Caolán McNamara caolanm at redhat.com
Fri Jan 23 02:19:49 PST 2015


 writerfilter/source/ooxml/Handler.cxx                 |    8 ++++----
 writerfilter/source/ooxml/Handler.hxx                 |    6 ++++--
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |    2 ++
 3 files changed, 10 insertions(+), 6 deletions(-)

New commits:
commit a4f97070bdb6172c684ec175c3e6e2a550eb9630
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jan 23 10:17:37 2015 +0000

    avoid terminate on loading fdo73574-3.docx
    
    by moving work done in dtor to an explicit method
    
    Change-Id: I99b3843819ea78f2a91a2784ae0243430dacb3d9

diff --git a/writerfilter/source/ooxml/Handler.cxx b/writerfilter/source/ooxml/Handler.cxx
index 519f297..89d7cdb 100644
--- a/writerfilter/source/ooxml/Handler.cxx
+++ b/writerfilter/source/ooxml/Handler.cxx
@@ -165,11 +165,11 @@ void OOXMLEmbeddedFontHandler::sprm(Sprm & /*sprm*/)
   class OOXMLFooterHandler
  */
 OOXMLFooterHandler::OOXMLFooterHandler(OOXMLFastContextHandler * pContext)
-: mpFastContext(pContext), msStreamId(), mnType(0)
+    : mpFastContext(pContext), msStreamId(), mnType(0)
 {
 }
 
-OOXMLFooterHandler::~OOXMLFooterHandler()
+void OOXMLFooterHandler::finalize()
 {
     mpFastContext->resolveFooter(mnType, msStreamId);
 }
@@ -197,11 +197,11 @@ void OOXMLFooterHandler::sprm(Sprm & /*sprm*/)
   class OOXMLHeaderHandler
  */
 OOXMLHeaderHandler::OOXMLHeaderHandler(OOXMLFastContextHandler * pContext)
-: mpFastContext(pContext), msStreamId(), mnType(0)
+    : mpFastContext(pContext), msStreamId(), mnType(0)
 {
 }
 
-OOXMLHeaderHandler::~OOXMLHeaderHandler()
+void OOXMLHeaderHandler::finalize()
 {
     mpFastContext->resolveHeader(mnType, msStreamId);
 }
diff --git a/writerfilter/source/ooxml/Handler.hxx b/writerfilter/source/ooxml/Handler.hxx
index 642de8c..2b470a6 100644
--- a/writerfilter/source/ooxml/Handler.hxx
+++ b/writerfilter/source/ooxml/Handler.hxx
@@ -55,7 +55,8 @@ class OOXMLFooterHandler : public Properties
     sal_Int32 mnType;
 public:
     OOXMLFooterHandler(OOXMLFastContextHandler * pContext);
-    virtual ~OOXMLFooterHandler();
+    virtual ~OOXMLFooterHandler() {}
+    void finalize();
     virtual void attribute(Id name, Value & val) SAL_OVERRIDE;
     virtual void sprm(Sprm & sprm) SAL_OVERRIDE;
 };
@@ -67,7 +68,8 @@ class OOXMLHeaderHandler : public Properties
     sal_Int32 mnType;
 public:
     OOXMLHeaderHandler(OOXMLFastContextHandler * pContext);
-    virtual ~OOXMLHeaderHandler();
+    virtual ~OOXMLHeaderHandler() {}
+    void finalize();
     virtual void attribute(Id name, Value & val) SAL_OVERRIDE;
     virtual void sprm(Sprm & sprm) SAL_OVERRIDE;
 };
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 9a56d0b..c87e981 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -1048,12 +1048,14 @@ void OOXMLFastContextHandlerProperties::handleHdrFtr()
         {
             OOXMLFooterHandler aFooterHandler(this);
             mpPropertySet->resolve(aFooterHandler);
+            aFooterHandler.finalize();
         }
         break;
     case W_TOKEN(headerReference):
         {
             OOXMLHeaderHandler aHeaderHandler(this);
             mpPropertySet->resolve(aHeaderHandler);
+            aHeaderHandler.finalize();
         }
         break;
     default:


More information about the Libreoffice-commits mailing list