writerfilter/source/filter/RtfFilter.cxx    |    2 +-
 writerfilter/source/filter/WriterFilter.cxx |    8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 7157cf5dee03a8a62033025521a68eec2a08d1f4
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sun Apr 23 20:15:44 2023 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sun Jun 4 20:58:31 2023 +0200

    Use getXWeak in writerfilter
    
    Change-Id: I3e0e68c44750f30bd1998c79dc74a13f2c9ade9b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150886
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/writerfilter/source/filter/RtfFilter.cxx 
b/writerfilter/source/filter/RtfFilter.cxx
index 69c27585cd51..8f80b85353b2 100644
--- a/writerfilter/source/filter/RtfFilter.cxx
+++ b/writerfilter/source/filter/RtfFilter.cxx
@@ -167,7 +167,7 @@ sal_Bool RtfFilter::filter(const 
uno::Sequence<beans::PropertyValue>& rDescripto
     {
         css::uno::Any anyEx = cppu::getCaughtException();
         // cannot throw WrongFormatException directly :(
-        throw lang::WrappedTargetRuntimeException("", 
static_cast<OWeakObject*>(this), anyEx);
+        throw lang::WrappedTargetRuntimeException("", getXWeak(), anyEx);
     }
     catch (const uno::Exception&)
     {
diff --git a/writerfilter/source/filter/WriterFilter.cxx 
b/writerfilter/source/filter/WriterFilter.cxx
index 3ac82d766c6a..1cfb0bee5387 100644
--- a/writerfilter/source/filter/WriterFilter.cxx
+++ b/writerfilter/source/filter/WriterFilter.cxx
@@ -211,15 +211,13 @@ sal_Bool WriterFilter::filter(const 
uno::Sequence<beans::PropertyValue>& rDescri
         {
             // note: SfxObjectShell checks for WrongFormatException
             io::WrongFormatException wfe(lcl_GetExceptionMessage(e));
-            throw lang::WrappedTargetRuntimeException("", 
static_cast<OWeakObject*>(this),
-                                                      uno::Any(wfe));
+            throw lang::WrappedTargetRuntimeException("", getXWeak(), 
uno::Any(wfe));
         }
         catch (xml::sax::SAXException const& e)
         {
             // note: SfxObjectShell checks for WrongFormatException
             io::WrongFormatException wfe(lcl_GetExceptionMessage(e));
-            throw lang::WrappedTargetRuntimeException("", 
static_cast<OWeakObject*>(this),
-                                                      uno::Any(wfe));
+            throw lang::WrappedTargetRuntimeException("", getXWeak(), 
uno::Any(wfe));
         }
         catch (uno::RuntimeException const&)
         {
@@ -230,7 +228,7 @@ sal_Bool WriterFilter::filter(const 
uno::Sequence<beans::PropertyValue>& rDescri
             css::uno::Any anyEx = cppu::getCaughtException();
             SAL_WARN("writerfilter",
                      "WriterFilter::filter(): failed with " << 
exceptionToString(anyEx));
-            throw lang::WrappedTargetRuntimeException("", 
static_cast<OWeakObject*>(this), anyEx);
+            throw lang::WrappedTargetRuntimeException("", getXWeak(), anyEx);
         }
 
         // Adding some properties to the document's grab bag for 
interoperability purposes:

Reply via email to