diff options
author | Justin Luth <justin.luth@collabora.com> | 2022-12-12 11:08:19 -0500 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2022-12-13 13:19:10 +0000 |
commit | 136ee63e37358e94c28b5d8c56f2b244a7a740de (patch) | |
tree | 249e68fd06da689abe3f98032d5c0043eb3bc4ae /writerfilter | |
parent | a2969884af71e88d2541bd2bfdebea222876fef4 (diff) |
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 <jluth@mail.com>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
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); |