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

New commits:
commit f5fea90d3e0cbabb87706a3ffb82464ac2bf3c84
Author:     Justin Luth <[email protected]>
AuthorDate: Thu Feb 5 11:03:00 2026 -0500
Commit:     Miklos Vajna <[email protected]>
CommitDate: Thu Feb 19 14:10:25 2026 +0100

    NFC docx export: rename DeleteAndResetLists to clearGrabbagValues
    
    No Functional Change intended
    
    The name was confusing.
    It sounded like it only has to do with lists or special things,
    but actually it erases approximately everything.
    
    The only value not reset is m_bStartedSdt.
    
    Additionally, there is nothing special about m_nSdtPrToken,
    and since it was being reset to zero every time
    that SdtBlockHelper was being cleared,
    just move it inside the clear function.
    
    Change-Id: Ifc730515210642385b7232850ed1951a43338b1a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198853
    Reviewed-by: Justin Luth <[email protected]>
    Tested-by: Jenkins
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199639
    Tested-by: Jenkins CollaboraOffice <[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 6281d2849c96..f5d852e9b190 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -751,7 +751,7 @@ bool FramePrHelper::UseFrameTextDirection(sal_Int32 
nTableDepth)
     return m_bUseFrameTextDirection;
 }
 
-void SdtBlockHelper::DeleteAndResetTheLists()
+void SdtBlockHelper::clearGrabbagValues()
 {
     if (m_pTokenChildren.is() )
         m_pTokenChildren.clear();
@@ -773,6 +773,7 @@ void SdtBlockHelper::DeleteAndResetTheLists()
         m_aAppearance.clear();
     m_bShowingPlaceHolder = false;
     m_nId = 0;
+    m_nSdtPrToken = 0;
     m_nTabIndex = 0;
 }
 
@@ -832,8 +833,7 @@ void SdtBlockHelper::WriteSdtBlock(const 
::sax_fastparser::FSHelperPtr& pSeriali
     m_bStartedSdt = true;
 
     // clear sdt status
-    m_nSdtPrToken = 0;
-    DeleteAndResetTheLists();
+    clearGrabbagValues();
 }
 
 void SdtBlockHelper::WriteExtraParams(const ::sax_fastparser::FSHelperPtr& 
pSerializer)
@@ -1274,8 +1274,7 @@ void DocxAttributeOutput::EndParagraph( const 
ww8::WW8TableNodeInfoInner::Pointe
     {
         //These should be written out to the actual Node and not to the anchor.
         //Clear them as they will be repopulated when the node is processed.
-        m_aParagraphSdt.m_nSdtPrToken = 0;
-        m_aParagraphSdt.DeleteAndResetTheLists();
+        m_aParagraphSdt.clearGrabbagValues();
     }
 
     m_pSerializer->mark(Tag_StartParagraph_2);
@@ -2113,8 +2112,7 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, 
sal_Int32 nPos, sal_In
     {
         //These should be written out to the actual Node and not to the anchor.
         //Clear them as they will be repopulated when the node is processed.
-        m_aRunSdt.m_nSdtPrToken = 0;
-        m_aRunSdt.DeleteAndResetTheLists();
+        m_aRunSdt.clearGrabbagValues();
     }
 
     if (bCloseEarlierSDT)
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx 
b/sw/source/filter/ww8/docxattributeoutput.hxx
index a1e699efef92..291dfa947ab1 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -185,7 +185,7 @@ public:
     OUString m_aLock;
     sal_Int32 m_nSdtPrToken; // 0 means either not set, or richText
 
-    void DeleteAndResetTheLists();
+    void clearGrabbagValues();
 
     void WriteSdtBlock(const ::sax_fastparser::FSHelperPtr& pSerializer, bool 
bRunTextIsOn, bool bParagraphHasDrawing);
     void WriteExtraParams(const ::sax_fastparser::FSHelperPtr& pSerializer);

Reply via email to