sw/source/filter/ww8/docxattributeoutput.cxx |   15 +--------------
 sw/source/filter/ww8/docxattributeoutput.hxx |   15 +++++++--------
 2 files changed, 8 insertions(+), 22 deletions(-)

New commits:
commit 2f93dfc468c5d841155021160823ec8254a9ce49
Author:     Justin Luth <[email protected]>
AuthorDate: Fri Feb 13 20:17:31 2026 -0500
Commit:     Miklos Vajna <[email protected]>
CommitDate: Fri Feb 20 09:24:36 2026 +0100

    tdf#170602 docx export: remove obsolete bCloseEarlierSdt
    
    I need to remove this in order to change
    when the SdtBlockHelper should be cleared/cached.
    
    This just doesn't look right anyway.
    It says "if not-richText-but-something, then close it later"
    Everywhere else that checks for a to-be-written-grabbagged-SDT
    also checks Id and DataBinding.
    Any why should this situation be different,
    and why would richText not be included when everything else is?
    
    Plus, even the markings (which I admittedly don't understand)
    don't seem very convincing.
    
    In any case, grabbagged runSdt's are not very common now
    (perhaps only citations are left?)
    so if there is a problem with grabbagged runSdt's
    it would probably be better just to fully implement them.
    (Google says w:citation has no special fields,
    so it should be super simple to round-trip as a real control.)
    
    The unit test accompanying the original patch still passes
    because it tests against real content controls now.
    The only m_aRunSdt's I saw in existing unit tests were citations.
    
    Change-Id: I97de5971ea8789017b7e7ce90d86d5f824130a72
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199641
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Justin Luth <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 0cc5ee795df7..fa98e73bad46 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1871,7 +1871,6 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, 
sal_Int32 nPos, sal_In
     // level down, to be able to prepend the actual run start attribute (just
     // before "postponed run start")
     m_pSerializer->mark(Tag_EndRun_1); // let's call it "actual run start"
-    bool bCloseEarlierSDT = false;
 
     if (m_bEndCharSdt)
     {
@@ -1879,12 +1878,7 @@ void DocxAttributeOutput::EndRun(const SwTextNode* 
pNode, sal_Int32 nPos, sal_In
         // This is NOT common anymore. Hardly any runSdt's are grabbagged 
nowadays,
         // but yes, if is is grabbagged, then this is the common way that it 
is closed.
 
-        // if another sdt starts in this run, then wait
-        // as closing the sdt now, might cause nesting of sdts
-        if (m_aRunSdt.m_oSdtPrToken.has_value())
-            bCloseEarlierSDT = true;
-        else
-            m_aRunSdt.EndSdtBlock(m_pSerializer);
+        m_aRunSdt.EndSdtBlock(m_pSerializer);
         m_bEndCharSdt = false;
     }
 
@@ -2131,13 +2125,6 @@ void DocxAttributeOutput::EndRun(const SwTextNode* 
pNode, sal_Int32 nPos, sal_In
         m_aRunSdt.clearGrabbagValues();
     }
 
-    if (bCloseEarlierSDT)
-    {
-        m_pSerializer->mark(Tag_EndRun_2);
-        m_aRunSdt.EndSdtBlock(m_pSerializer);
-        m_pSerializer->mergeTopMarks(Tag_EndRun_2, 
sax_fastparser::MergeMarks::PREPEND);
-    }
-
     m_pSerializer->mergeTopMarks(Tag_StartRun_1);
 
     // XML_r node should be surrounded with permission-begin and 
permission-end nodes if it has permission.
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx 
b/sw/source/filter/ww8/docxattributeoutput.hxx
index b69ad436fe61..b37547aac8f2 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -1170,14 +1170,13 @@ public:
     static const sal_Int32 Tag_StartRun_2 = 7;
     static const sal_Int32 Tag_StartRun_3 = 8;
     static const sal_Int32 Tag_EndRun_1 = 9;
-    static const sal_Int32 Tag_EndRun_2 = 10;
-    static const sal_Int32 Tag_StartRunProperties = 11;
-    static const sal_Int32 Tag_InitCollectedRunProperties = 12;
-    static const sal_Int32 Tag_Redline_1 = 13;
-    static const sal_Int32 Tag_Redline_2 = 14;
-    static const sal_Int32 Tag_TableDefinition = 15;
-    static const sal_Int32 Tag_OutputFlyFrame = 16;
-    static const sal_Int32 Tag_StartSection = 17;
+    static const sal_Int32 Tag_StartRunProperties = 10;
+    static const sal_Int32 Tag_InitCollectedRunProperties = 11;
+    static const sal_Int32 Tag_Redline_1 = 12;
+    static const sal_Int32 Tag_Redline_2 = 13;
+    static const sal_Int32 Tag_TableDefinition = 14;
+    static const sal_Int32 Tag_OutputFlyFrame = 15;
+    static const sal_Int32 Tag_StartSection = 16;
 };
 
 /**

Reply via email to