writerfilter/source/dmapper/DomainMapper_Impl.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 136ee63e37358e94c28b5d8c56f2b244a7a740de
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Mon Dec 12 11:08:19 2022 -0500
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Tue Dec 13 13:19:10 2022 +0000

    tdf#148035 sw content controls: cursor-move for runSdt only
    
    For normal documents, just doing a Push/PopSdt on a block SDT
    seems to work out-of-the-box for checkbox/dropdown/date content controls.
    Apparently that is not the right way to do it though.
    
    When I was trying it, the first control was always "lost".
    This patch takes care of that. At the moment it does nothing
    since only runSdt's even call push/pop, but at least
    it might save some trouble later on when block SDTs are
    turned into content controls.
    
    Change-Id: I6bf68f296ca919dc09dec660c052ddbdb59d56bb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144007
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 5365b302c6d2..064bb5b15da6 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -882,7 +882,8 @@ void DomainMapper_Impl::PopSdt()
         // DomainMapper_Impl::AddDummyParaForTableInSection() would make our 
range multi-paragraph,
         // while the intention is to keep start/end inside the same paragraph 
for run SDTs.
         uno::Reference<text::XParagraphCursor> xParagraphCursor(xCursor, 
uno::UNO_QUERY);
-        if (xParagraphCursor.is())
+        if (xParagraphCursor.is()
+            && m_pSdtHelper->GetSdtType() == NS_ooxml::LN_CT_SdtRun_sdtContent)
         {
             xCursor->gotoRange(xEnd, /*bExpand=*/false);
             xParagraphCursor->gotoStartOfParagraph(/*bExpand=*/false);

Reply via email to