diff options
author | Justin Luth <justin.luth@collabora.com> | 2023-10-05 07:24:56 -0400 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-10-05 16:26:13 +0200 |
commit | 32102e559eed6eadf2ea146e212a330a3bc897ca (patch) | |
tree | 7f70dcaecbedcaff266a1e095a7832c3694387d4 | |
parent | d7e70203e0246830ed30b1b765c1fc3fab716b9b (diff) |
This reverts 7.6 commit 828fde37632a5bb0542b6925454690a5287d6490.
and also reverts the dependent parts of the follow-up test from
commit 828fde37632a5bb0542b6925454690a5287d6490
(although the patch itself is fine to remain in place)
and also reverts followup "cid#1522030 Uninitialized scalar field"
commit 9a123a6e63600ba3998d22bbc300ac4b65b3da2c.
The commit in general is fine. However, it fails in case
of an empty paragraph (with only anchors).
Unfortunately, there is no way of knowing ahead of time,
so either everything needs to be processed after a delay,
or else the paragraph needs to be split and then re-joined
in case it is not an empty paragraph.
Both options are extremely non-trivial - I don't know how
to do either of them.
Change-Id: I9e98d825ad0008e822172b6797116ad16e90b871
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157593
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf153613_textboxAfterPgBreak3.docx | bin | 7037 -> 0 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport18.cxx | 15 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 5 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 13 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.hxx | 3 |
5 files changed, 1 insertions, 35 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf153613_textboxAfterPgBreak3.docx b/sw/qa/extras/ooxmlexport/data/tdf153613_textboxAfterPgBreak3.docx Binary files differdeleted file mode 100644 index a282deaa0ad7..000000000000 --- a/sw/qa/extras/ooxmlexport/data/tdf153613_textboxAfterPgBreak3.docx +++ /dev/null diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index 066eb3647cb5..bbcc40dde073 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -193,11 +193,6 @@ DECLARE_OOXMLEXPORT_TEST(testTdf146984_anchorInShape, "tdf146984_anchorInShape.d { // This was only one page b/c the page break was missing. CPPUNIT_ASSERT_EQUAL(2, getPages()); - - const auto& pLayout = parseLayoutDump(); - // There are shapes on both pages - these should be non-zero numbers - assertXPath(pLayout, "//page[1]//anchored", 3); - assertXPath(pLayout, "//page[2]//anchored", 2); } DECLARE_OOXMLEXPORT_TEST(testTdf127622_framePr, "tdf127622_framePr.docx") @@ -379,16 +374,6 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153613_textboxAfterPgBreak2, "tdf153613_textboxA assertXPathContent(pLayout, "//page[2]/body/txt", "There should be no prior carriage return."); } -DECLARE_OOXMLEXPORT_TEST(testTdf153613_textboxAfterPgBreak3, "tdf153613_textboxAfterPgBreak3.docx") -{ - // All anchored TO-character shapes stay on the first page, before the page break. - CPPUNIT_ASSERT_EQUAL(2, getPages()); - CPPUNIT_ASSERT_EQUAL(3, getParagraphs()); - - const auto& pLayout = parseLayoutDump(); - assertXPath(pLayout, "//page[2]//anchored", 0); -} - DECLARE_OOXMLEXPORT_TEST(testTdf153613_sdtAfterPgBreak, "tdf153613_sdtAfterPgBreak.docx") { CPPUNIT_ASSERT_EQUAL(2, getPages()); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 5b5647be8bae..726730ad3076 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3741,7 +3741,7 @@ void DomainMapper::lcl_startShape(uno::Reference<drawing::XShape> const& xShape) { // If there is a deferred page break, handle it now, so that the // started shape will be on the correct page. - if (m_pImpl->isBreakDeferred(PAGE_BREAK) && !m_pImpl->IsBreakDeferredByAnchor()) + if (m_pImpl->isBreakDeferred(PAGE_BREAK)) { // RTF doesn't properly report IsFirstRun, so in order to prevent regressions // always split the paragraph for RTF since that is the way it has been done lately. @@ -3751,9 +3751,6 @@ void DomainMapper::lcl_startShape(uno::Reference<drawing::XShape> const& xShape) finishParagraph(); lcl_startParagraphGroup(); } - else - m_pImpl->SetIsBreakDeferredByAnchor(); - } m_pImpl->PushShapeContext( xShape ); lcl_startParagraphGroup(); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 36a0f6c178f9..4d91790ade4c 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -334,7 +334,6 @@ DomainMapper_Impl::DomainMapper_Impl( m_bIsColumnBreakDeferred( false ), m_bIsPageBreakDeferred( false ), m_nLineBreaksDeferred( 0 ), - m_bIsBreakDeferredByAnchor(false), m_bSdtEndDeferred(false), m_bParaSdtEndDeferred(false), m_bStartTOC(false), @@ -1592,7 +1591,6 @@ void DomainMapper_Impl::clearDeferredBreak(BreakType deferredBreakType) break; case PAGE_BREAK: m_bIsPageBreakDeferred = false; - m_bIsBreakDeferredByAnchor = false; break; default: break; @@ -1604,17 +1602,6 @@ void DomainMapper_Impl::clearDeferredBreaks() m_nLineBreaksDeferred = 0; m_bIsColumnBreakDeferred = false; m_bIsPageBreakDeferred = false; - m_bIsBreakDeferredByAnchor = false; -} - -bool DomainMapper_Impl::IsBreakDeferredByAnchor() -{ - return m_bIsBreakDeferredByAnchor; -} - -void DomainMapper_Impl::SetIsBreakDeferredByAnchor() -{ - m_bIsBreakDeferredByAnchor = true; } void DomainMapper_Impl::setSdtEndDeferred(bool bSdtEndDeferred) diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 676a0d3196d9..82d7ca06824e 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -472,7 +472,6 @@ private: bool m_bIsColumnBreakDeferred; bool m_bIsPageBreakDeferred; sal_Int32 m_nLineBreaksDeferred; - bool m_bIsBreakDeferredByAnchor; /// If we want to set "sdt end" on the next character context. bool m_bSdtEndDeferred; /// If we want to set "paragraph sdt end" on the next paragraph context. @@ -743,8 +742,6 @@ public: bool isBreakDeferred( BreakType deferredBreakType ); void clearDeferredBreaks(); void clearDeferredBreak(BreakType deferredBreakType); - bool IsBreakDeferredByAnchor(); - void SetIsBreakDeferredByAnchor(); void setSdtEndDeferred(bool bSdtEndDeferred); bool isSdtEndDeferred() const; |