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

New commits:
commit b4ca1c5a274069a180e9c15c13d312e29045cf4b
Author:     Justin Luth <[email protected]>
AuthorDate: Thu Feb 5 11:03:00 2026 -0500
Commit:     Justin Luth <[email protected]>
CommitDate: Fri Feb 6 21:45:02 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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index b288b1ec37f7..5096ce73c761 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -753,7 +753,7 @@ bool FramePrHelper::UseFrameTextDirection(sal_Int32 
nTableDepth)
     return m_bUseFrameTextDirection;
 }
 
-void SdtBlockHelper::DeleteAndResetTheLists()
+void SdtBlockHelper::clearGrabbagValues()
 {
     if (m_pTokenChildren.is() )
         m_pTokenChildren.clear();
@@ -775,6 +775,7 @@ void SdtBlockHelper::DeleteAndResetTheLists()
         m_aAppearance.clear();
     m_bShowingPlaceHolder = false;
     m_nId = 0;
+    m_nSdtPrToken = 0;
     m_nTabIndex = 0;
 }
 
@@ -834,8 +835,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)
@@ -1276,8 +1276,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);
@@ -2111,8 +2110,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