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 8a2d938e2dc9a8f080c96961489c0233d19ddc89
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sun Jul 27 16:54:43 2025 +0500
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Aug 11 12:13: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/+/188432
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189307

diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx 
b/sw/source/filter/ww8/attributeoutputbase.hxx
index 4472a156a72a..a05f4fe221f7 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -160,7 +160,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 544227f9712f..58d4338ac682 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3687,7 +3687,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.
@@ -3726,7 +3726,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 af72cd3315d0..5a00c9838b11 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 5f831ed7e65b..a63ad0011bd2 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -474,11 +474,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
@@ -3453,9 +3452,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 3871b21547ff..289773a1477d 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 9d8595c3da27..8f9b00c5998d 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 521aed8f8b23..113c086f7828 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;

Reply via email to