sw/source/filter/ww8/wrtww8.cxx   |   15 ---------------
 sw/source/filter/ww8/wrtww8gr.cxx |   17 +++++++++++++++++
 2 files changed, 17 insertions(+), 15 deletions(-)

New commits:
commit c13e5bf98cb0373d4cf9ac346fb3beb003441673
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Wed Feb 5 16:19:54 2025 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Wed Feb 5 20:17:30 2025 +0100

    defer getting SvtFilterOptions until its needed
    
    which might be never
    
    Change-Id: I72c71efd754f40371ce77dd507bdd530ec376855
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181189
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index cad075e97d8b..da7e708aa570 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3443,21 +3443,6 @@ ErrCode MSWordExportBase::ExportDocument( bool bWriteAll 
)
     m_pRedlAuthors = nullptr;
     m_aTOXArr.clear();
 
-    if ( !m_oOLEExp )
-    {
-        sal_uInt32 nSvxMSDffOLEConvFlags = 0;
-        if 
(officecfg::Office::Common::Filter::Microsoft::Export::MathToMathType::get())
-            nSvxMSDffOLEConvFlags |= OLE_STARMATH_2_MATHTYPE;
-        if 
(officecfg::Office::Common::Filter::Microsoft::Export::WriterToWinWord::get())
-            nSvxMSDffOLEConvFlags |= OLE_STARWRITER_2_WINWORD;
-        if 
(officecfg::Office::Common::Filter::Microsoft::Export::CalcToExcel::get())
-            nSvxMSDffOLEConvFlags |= OLE_STARCALC_2_EXCEL;
-        if 
(officecfg::Office::Common::Filter::Microsoft::Export::ImpressToPowerPoint::get())
-            nSvxMSDffOLEConvFlags |= OLE_STARIMPRESS_2_POWERPOINT;
-
-        m_oOLEExp.emplace( nSvxMSDffOLEConvFlags );
-    }
-
     if ( !m_pOCXExp && m_rDoc.GetDocShell() )
         m_pOCXExp.reset(new SwMSConvertControls(m_rDoc.GetDocShell(), 
m_pCurPam.get()));
 
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx 
b/sw/source/filter/ww8/wrtww8gr.cxx
index 721cd574be08..f56074685a3a 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -61,6 +61,7 @@
 #include <IDocumentDrawModelAccess.hxx>
 #include <drawdoc.hxx>
 #include <o3tl/string_view.hxx>
+#include <officecfg/Office/Common.hxx>
 
 using namespace ::com::sun::star;
 
@@ -237,6 +238,22 @@ void WW8Export::OutputOLENode( const SwOLENode& rOLENode )
     {
         sal_Int64 nAspect = rOLENode.GetAspect();
         svt::EmbeddedObjectRef aObjRef( xObj, nAspect );
+
+        if ( !m_oOLEExp )
+        {
+            sal_uInt32 nSvxMSDffOLEConvFlags = 0;
+            if 
(officecfg::Office::Common::Filter::Microsoft::Export::MathToMathType::get())
+                nSvxMSDffOLEConvFlags |= OLE_STARMATH_2_MATHTYPE;
+            if 
(officecfg::Office::Common::Filter::Microsoft::Export::WriterToWinWord::get())
+                nSvxMSDffOLEConvFlags |= OLE_STARWRITER_2_WINWORD;
+            if 
(officecfg::Office::Common::Filter::Microsoft::Export::CalcToExcel::get())
+                nSvxMSDffOLEConvFlags |= OLE_STARCALC_2_EXCEL;
+            if 
(officecfg::Office::Common::Filter::Microsoft::Export::ImpressToPowerPoint::get())
+                nSvxMSDffOLEConvFlags |= OLE_STARIMPRESS_2_POWERPOINT;
+
+            m_oOLEExp.emplace( nSvxMSDffOLEConvFlags );
+        }
+
         m_oOLEExp->ExportOLEObject( aObjRef, *xOleStg );
         if ( nAspect == embed::Aspects::MSOLE_ICON )
         {

Reply via email to