[Libreoffice-commits] .: 4 commits - sw/source xmloff/inc

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Dec 14 13:02:34 PST 2012


 sw/source/filter/basflt/fltini.cxx |    1 -
 sw/source/filter/inc/fltini.hxx    |    1 -
 sw/source/filter/xml/xmlimp.cxx    |   11 +++++++++++
 sw/source/filter/xml/xmltexti.cxx  |   10 ----------
 sw/source/ui/uno/unotxdoc.cxx      |   10 ++++++++--
 xmloff/inc/xmloff/xmlimp.hxx       |    1 +
 6 files changed, 20 insertions(+), 14 deletions(-)

New commits:
commit 3a9e1e71d9a28b2c6bc96757e629b231d2276d9d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Dec 14 21:46:49 2012 +0100

    Do not defer ~XMLRedlineImportHelper activity to ~SwXMLImport
    
    At least with one Clang build, executing sw_unoapi test aborts at shutdown of
    soffice.bin with
    
    20 __cxxabiv1::__cxa_call_unexpected
    21 XMLRedlineImportHelper::~XMLRedlineImportHelper
    22 XMLRedlineImportHelper::~XMLRedlineImportHelper
    23 SwXMLTextImportHelper::~SwXMLTextImportHelper
    24 SwXMLTextImportHelper::~SwXMLTextImportHelper
    25 UniRefBase::release
    26 UniReference<XMLTextImportHelper>::~UniReference
    27 UniReference<XMLTextImportHelper>::~UniReference
    28 SvXMLImport::~SvXMLImport
    29 SwXMLImport::~SwXMLImport
    30 SwXMLImport::~SwXMLImport
    31 cppu::OWeakObject::release
    [...]
    79 binaryurp::Bridge::dispose
    [...]
    98 desktop::Desktop::DeregisterServices
    99 desktop::Desktop::doShutdown
    100 desktop::Desktop::Main
    
    due to ~XMLRedlineImportHelper calling setPropertyValue on an SwXTextDocument
    that is !IsValid() and thus throws a RuntimeException.  SwXMLImport::endOocument
    already contains ClearShapeImport with a comment that indicates it is necessary
    for a similar reason, so add a ClearTextImport that ensures any
    ~XMLRedlineImportHelper activity is done before the SwXTextDocument becomes
    invalid, and not only at shutdown of the remote bridge that still holds a (Java)
    reference to SwXMLImport.
    
    Change-Id: I9891879c91bfea79fa9e22691be1826f61fdd70a

diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 8e79e98..240439e 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -936,6 +936,7 @@ void SwXMLImport::endDocument( void )
 
     // delegate to parent: takes care of error handling
     SvXMLImport::endDocument();
+    ClearTextImport();
 }
 
 
diff --git a/xmloff/inc/xmloff/xmlimp.hxx b/xmloff/inc/xmloff/xmlimp.hxx
index 125728f..4fac737 100644
--- a/xmloff/inc/xmloff/xmlimp.hxx
+++ b/xmloff/inc/xmloff/xmlimp.hxx
@@ -155,6 +155,7 @@ protected:
                                                const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
 
     virtual XMLTextImportHelper* CreateTextImport();
+    inline void ClearTextImport() { mxTextImport = 0; }
     virtual XMLShapeImportHelper* CreateShapeImport();
     inline sal_Bool HasShapeImport() const { return mxShapeImport.is(); }
     inline void ClearShapeImport() { mxShapeImport = 0; }
commit da07b237caa815540405e9e4980beb16403ecd30
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Dec 14 18:41:12 2012 +0100

    Add exception messages
    
    Change-Id: I17dc1673d5126e00328baa1e7a8ed9b59572f08d

diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 2c26127..be2a5d6 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -1830,7 +1830,10 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
 {
     SolarMutexGuard aGuard;
     if(!IsValid())
-        throw RuntimeException();
+        throw RuntimeException(
+            "invalid SwXTextDocument",
+            static_cast< cppu::OWeakObject * >(
+                static_cast< SwXTextDocumentBaseClass * >(this)));
     const SfxItemPropertySimpleEntry*  pEntry = pPropSet->getPropertyMap().getByName( rPropertyName);
 
     if(!pEntry)
@@ -1842,7 +1845,10 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
         case  WID_DOC_CHAR_COUNT     :
         case  WID_DOC_PARA_COUNT     :
         case  WID_DOC_WORD_COUNT     :
-            throw RuntimeException();
+            throw RuntimeException(
+                "bad WID",
+                static_cast< cppu::OWeakObject * >(
+                    static_cast< SwXTextDocumentBaseClass * >(this)));
         case  WID_DOC_WORD_SEPARATOR :
         {
             OUString sDelim;
commit b25f4796a3c2d81d5af16183b162eb98e9f9d549
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Dec 14 18:19:04 2012 +0100

    SwXMLImport::CreateTextImport -> xmlimp.cxx
    
    Change-Id: Iea502cbe8becaf460f50e1ec954cf2cb6c18e252

diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 637ef88..8e79e98 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -43,6 +43,7 @@
 #include <ndtxt.hxx>
 #include <editsh.hxx>
 #include "xmlimp.hxx"
+#include "xmltexti.hxx"
 #include <xmloff/DocumentSettingsContext.hxx>
 #include <docsh.hxx>
 #include <editeng/unolingu.hxx>
@@ -990,6 +991,15 @@ SvTextShapeImportHelper::~SvTextShapeImportHelper()
 }
 
 
+XMLTextImportHelper* SwXMLImport::CreateTextImport()
+{
+    return new SwXMLTextImportHelper( GetModel(), *this, getImportInfo(),
+                                      IsInsertMode(),
+                                      IsStylesOnlyMode(), bShowProgress,
+                                      IsBlockMode(), IsOrganizerMode(),
+                                      bPreserveRedlineMode );
+}
+
 XMLShapeImportHelper* SwXMLImport::CreateShapeImport()
 {
     return new SvTextShapeImportHelper( *this );
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index 35c2836..ef6b102 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -958,16 +958,6 @@ void SwXMLTextImportHelper::endAppletOrPlugin(
     }
 }
 
-XMLTextImportHelper* SwXMLImport::CreateTextImport()
-{
-    return new SwXMLTextImportHelper( GetModel(), *this, getImportInfo(),
-                                      IsInsertMode(),
-                                      IsStylesOnlyMode(), bShowProgress,
-                                      IsBlockMode(), IsOrganizerMode(),
-                                      bPreserveRedlineMode );
-}
-
-
 // redlining helper methods
 // (override to provide the real implementation)
 
commit 56f1f4512dbe366d5ba55a2363d1cf1a47f7be56
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Dec 14 14:06:24 2012 +0100

    -Werror,-Wunused-private-field
    
    Change-Id: I7a65695e8ccca57cf3bd0fd3495ecbd6fe147fa9

diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx
index 7e64eb8..8d42f30 100644
--- a/sw/source/filter/basflt/fltini.cxx
+++ b/sw/source/filter/basflt/fltini.cxx
@@ -312,7 +312,6 @@ void StgReader::SetFltName( const String& rFltNm )
 
 
 SwRelNumRuleSpaces::SwRelNumRuleSpaces( SwDoc& rDoc, sal_Bool bNDoc )
-        : bNewDoc( bNDoc )
 {
         pNumRuleTbl = new SwNumRuleTbl();
         pNumRuleTbl->reserve(8);
diff --git a/sw/source/filter/inc/fltini.hxx b/sw/source/filter/inc/fltini.hxx
index 55c9f88..115ed36 100644
--- a/sw/source/filter/inc/fltini.hxx
+++ b/sw/source/filter/inc/fltini.hxx
@@ -71,7 +71,6 @@ void GetWW8Writer( const String&, const String&, WriterRef& );
 class SW_DLLPUBLIC SwRelNumRuleSpaces
 {
     SwNumRuleTbl* pNumRuleTbl;  // Liste aller benannten NumRules
-    sal_Bool bNewDoc;
 
 public:
     SwRelNumRuleSpaces( SwDoc& rDoc, sal_Bool bNewDoc );


More information about the Libreoffice-commits mailing list