sw/source/filter/ww8/attributeoutputbase.hxx | 2 +- sw/source/filter/ww8/docxattributeoutput.cxx | 3 +-- sw/source/filter/ww8/docxattributeoutput.hxx | 2 +- sw/source/filter/ww8/rtfattributeoutput.cxx | 9 ++++----- sw/source/filter/ww8/rtfattributeoutput.hxx | 4 ++-- sw/source/filter/ww8/ww8atr.cxx | 3 +-- sw/source/filter/ww8/ww8attributeoutput.hxx | 2 +- 7 files changed, 11 insertions(+), 14 deletions(-)
New commits: commit 2905e78b33d7746c8b61b8bd279ee48e6cedec7e Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Sun Jul 27 16:54:43 2025 +0500 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon Jul 28 13:24:47 2025 +0200 tdf#165564: refactor the "Removes additional spaces in export" part Commit 90ce84a5dd371c804af19e97896a5e19a3ebf8ca (tdf#165564 RTF:Fix export and import of footnotes/endnotes, 2025-05-08) workarounded an extra space added after \super keyword, when EndRunProperties() didn't produce an output. To do that, it introduced a return value from EndRunProperties, checked in TextFootnote_Impl. This change simplifies this, reverting a part of the said commit, which added that return value, in favor of dropping an unnecessary space after {\super, which was retained for some reason in commit 49877dc91b2f91baa656facd462ac1b1e832f182 (sw:rtf - timely export of footnote char properties, 2017-08-24). There is no need in the space between keywords - only between the last keyword and text. Change-Id: If13bf760feb9cb42cb39fc7de39eed6944a869ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188433 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index 2328f2bda147..9ba7f85ee0bc 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -180,7 +180,7 @@ public: virtual void StartRunProperties() = 0; /// Called after we end outputting the attributes. - virtual bool EndRunProperties( const SwRedlineData* pRedlineData ) = 0; + virtual void EndRunProperties( const SwRedlineData* pRedlineData ) = 0; /// docx requires footnoteRef/endnoteRef tag at the beginning of each of them virtual bool FootnoteEndnoteRefTag() { return false; }; diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 861107206304..03fb72d5c0a3 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3689,7 +3689,7 @@ void DocxAttributeOutput::WriteCollectedRunProperties() } } -bool DocxAttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData ) +void DocxAttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData ) { // Call the 'Redline' function. This will add redline (change-tracking) information that regards to run properties. // This includes changes like 'Bold', 'Underline', 'Strikethrough' etc. @@ -3728,7 +3728,6 @@ bool DocxAttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData ) WritePostponedOLE(); WritePostponedActiveXControl(true); - return false; } void DocxAttributeOutput::GetSdtEndBefore(const SdrObject* pSdrObj) diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 8963f508b6d1..0f838a100988 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -232,7 +232,7 @@ public: virtual void StartRunProperties() override; /// Called after we end outputting the attributes. - virtual bool EndRunProperties( const SwRedlineData* pRedlineData ) override; + virtual void EndRunProperties( const SwRedlineData* pRedlineData ) override; virtual bool FootnoteEndnoteRefTag() override; diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 638f6729e989..509de495b896 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -470,11 +470,10 @@ void RtfAttributeOutput::StartRunProperties() "formatting is not empty"); } -bool RtfAttributeOutput::EndRunProperties(const SwRedlineData* /*pRedlineData*/) +void RtfAttributeOutput::EndRunProperties(const SwRedlineData* /*pRedlineData*/) { const OString aProperties = MoveProperties(ForRun); m_aRun->append(aProperties); - return !aProperties.isEmpty(); } // Very much like AttributeOutputBase::OutputItem @@ -3442,9 +3441,9 @@ void RtfAttributeOutput::TextFootnote_Impl(const SwFormatFootnote& rFootnote) { SAL_INFO("sw.rtf", __func__ << " start"); - m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_SUPER " "); - if (EndRunProperties(nullptr)) - m_aRun->append(' '); + m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_SUPER); + EndRunProperties(nullptr); + m_aRun->append(' '); WriteTextFootnoteNumStr(rFootnote); m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FOOTNOTE); if (rFootnote.IsEndNote() || m_rExport.m_rDoc.GetFootnoteInfo().m_ePos == FTNPOS_CHAPTER) diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx index 70d714ee90be..6bb09e0c7362 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.hxx +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -82,8 +82,8 @@ public: /// Called before we start outputting the attributes. void StartRunProperties() override; - /// Called after we end outputting the attributes, returns true if commands were added. - bool EndRunProperties(const SwRedlineData* pRedlineData) override; + /// Called after we end outputting the attributes. + void EndRunProperties(const SwRedlineData* pRedlineData) override; /// Output text (inside a run). void RunText(const OUString& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8, diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 83a635e7f3a2..b2b10826940b 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -1194,7 +1194,7 @@ void WW8AttributeOutput::EndRun( const SwTextNode* /*pNode*/, sal_Int32 nPos, sa } } -bool WW8AttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData ) +void WW8AttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData ) { Redline( pRedlineData ); @@ -1213,7 +1213,6 @@ bool WW8AttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData ) m_rWW8Export.m_pO->size(), m_rWW8Export.m_pO->data() ); } m_rWW8Export.m_pO->clear(); - return false; } void WW8AttributeOutput::RunText( const OUString& rText, rtl_TextEncoding eCharSet, const OUString& /*rSymbolFont*/ ) diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx index 17bc681276c4..0d210314836d 100644 --- a/sw/source/filter/ww8/ww8attributeoutput.hxx +++ b/sw/source/filter/ww8/ww8attributeoutput.hxx @@ -64,7 +64,7 @@ public: virtual void StartRunProperties() override; /// After we end outputting the attributes. - virtual bool EndRunProperties( const SwRedlineData* pRedlineData ) override; + virtual void EndRunProperties( const SwRedlineData* pRedlineData ) override; /// Output text. virtual void RunText( const OUString& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8, const OUString& rSymbolFont = OUString() ) override;