sw/source/writerfilter/dmapper/DomainMapper.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 47c06be9a4bf1a784bf6c98f56557cf98ed22df2
Author:     Justin Luth <[email protected]>
AuthorDate: Fri Feb 20 09:32:23 2026 -0500
Commit:     Justin Luth <[email protected]>
CommitDate: Tue Feb 24 13:18:59 2026 +0100

    RunSDT: SetSdtType AFTER it might be cleared
    
    During the cleanup of some outstanding text,
    a content control might be created.
    At the end of that process, it clear()s m_pSdtHelper
    so clearly setting m_pSdtHelper variables
    should come at the end of that cleanup.
    
    Right?
    
    This change was triggered by
    sdt-run-in-para.docx
    and the assert I added to PopSdt's
    assert(m_pSdtHelper->GetSdtType() == NS_ooxml::LN_CT_SdtRun_sdtContent)
    
    Change-Id: If3458fc8255c328bb3921093c10d6521ee94f930
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199882
    Reviewed-by: Justin Luth <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/source/writerfilter/dmapper/DomainMapper.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper.cxx
index 6763e91adbd6..261a5c0f10bb 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx
@@ -1267,8 +1267,6 @@ void DomainMapper::lcl_attribute(Id nName, const Value & 
val)
         case NS_ooxml::LN_CT_SdtBlock_sdtContent:
         case NS_ooxml::LN_CT_SdtRun_sdtContent:
         {
-            m_pImpl->m_pSdtHelper->SetSdtType(nName);
-
             if (m_pImpl->m_pSdtHelper->getControlType() == 
SdtControlType::unknown)
             {
                 // If the SdtControlType is not defined, it really OUGHT to be 
richText
@@ -1335,10 +1333,12 @@ void DomainMapper::lcl_attribute(Id nName, const Value 
& val)
                     m_pImpl->clearDeferredBreaks();
                 }
 
+                m_pImpl->m_pSdtHelper->SetSdtType(nName);
                 
m_pImpl->m_pSdtHelper->setControlType(SdtControlType::richText);
                 m_pImpl->PushSdt();
                 break;
             }
+            m_pImpl->m_pSdtHelper->SetSdtType(nName);
             m_pImpl->SetSdt(true);
         }
         break;

Reply via email to