sw/source/filter/ww8/wrtww8.cxx | 10 +++++++--- sw/source/filter/ww8/wrtww8.hxx | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-)
New commits: commit a3f58f83558d76ae5b32b17d31e2ba0ee39fd2dd Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Feb 5 19:25:04 2025 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Wed Feb 5 21:55:03 2025 +0100 defer creating SwMSConvertControls until its needed which might be never Change-Id: I9b1baf2098e092020aa8d10b55622c645e15e745 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181196 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 da7e708aa570..40c3c9a20867 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3443,9 +3443,6 @@ ErrCode MSWordExportBase::ExportDocument( bool bWriteAll ) m_pRedlAuthors = nullptr; m_aTOXArr.clear(); - if ( !m_pOCXExp && m_rDoc.GetDocShell() ) - m_pOCXExp.reset(new SwMSConvertControls(m_rDoc.GetDocShell(), m_pCurPam.get())); - // #i81405# - Collect anchored objects before changing the redline mode. m_aFrames = GetFrames( m_rDoc, bWriteAll? nullptr : m_pOrigPam ); @@ -4033,6 +4030,13 @@ MSWordSections& WW8Export::Sections() const return *m_pSepx; } +SwMSConvertControls& WW8Export::GetOCXExp() +{ + if (!m_pOCXExp) + m_pOCXExp.reset(new SwMSConvertControls(m_rDoc.GetDocShell(), m_pCurPam.get())); + return *m_pOCXExp; +} + SwWW8Writer::SwWW8Writer(std::u16string_view rFltName, const OUString& rBaseURL) : m_pExport( nullptr ), mpMedium( nullptr ) diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 89999b4a90e3..20288160c1af 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -1067,7 +1067,7 @@ public: bool MiserableFormFieldExportHack(const SwFrameFormat& rFrameFormat); - SwMSConvertControls& GetOCXExp() { return *m_pOCXExp; } + SwMSConvertControls& GetOCXExp(); void ExportDopTypography(WW8DopTypography &rTypo); sal_uInt16 AddRedlineAuthor( std::size_t nId );