[Libreoffice-commits] core.git: Branch 'libreoffice-7-3-1' - sw/qa sw/source

2022-02-23 Thread Caolán McNamara (via logerrit)
 sw/qa/core/data/ooxml/fail/LIBREOFFICE-DBDAZAEC.docx |binary
 sw/source/core/unocore/unodraw.cxx   |2 ++
 2 files changed, 2 insertions(+)

New commits:
commit cd1393acfc0065a8e8cbe85bb7b29dab64bc8d89
Author: Caolán McNamara 
AuthorDate: Thu Feb 17 09:57:34 2022 +
Commit: Christian Lohmaier 
CommitDate: Wed Feb 23 13:27:38 2022 +0100

Refetch in case SwTextNode::InsertItem causes it to be deleted

Change-Id: Ie189ae4d37ffc33e58bb405f2521d1ae02a9997b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130025
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 780842b6fba24b753f33015bd5c2ad46ced4771c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130147
Reviewed-by: Xisco Fauli 
Reviewed-by: Thorsten Behrens 
Reviewed-by: Christian Lohmaier 
Tested-by: Christian Lohmaier 

diff --git a/sw/qa/core/data/ooxml/fail/LIBREOFFICE-DBDAZAEC.docx 
b/sw/qa/core/data/ooxml/fail/LIBREOFFICE-DBDAZAEC.docx
new file mode 100755
index ..add554ae9596
Binary files /dev/null and 
b/sw/qa/core/data/ooxml/fail/LIBREOFFICE-DBDAZAEC.docx differ
diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index 4d04857e7199..e61a66850001 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1141,6 +1141,8 @@ void SwXShape::setPropertyValue(const OUString& 
rPropertyName, const uno::Any& a
 SwFormatFlyCnt aFormat( pFormat );
 pNd->InsertItem(aFormat, pInternalPam->GetPoint()
 ->nContent.GetIndex(), 0 );
+//Refetch in case SwTextNode::InsertItem causes it to be 
deleted
+pFormat = GetFrameFormat();
 }
 else
 {


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3-1' - sw/qa sw/source

2022-02-23 Thread Attila Szűcs (via logerrit)
 sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt |binary
 sw/qa/extras/layout/layout.cxx  |9 +
 sw/source/core/layout/findfrm.cxx   |3 ++-
 3 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 76ff5c9dc5a4525067da3de485ac9d0924ab6172
Author: Attila Szűcs 
AuthorDate: Mon Feb 14 08:43:08 2022 +0100
Commit: Christian Lohmaier 
CommitDate: Wed Feb 23 12:49:37 2022 +0100

tdf#146704 sw: fix regression of endnote layout in sections

Endnotes collected at the end of sections moved to a new page.

Regression from commit 4c31b4ef2083087a822c3ae648fd09acc67d2f88
"tdf#139336 sw: fix extra pages of multicolumn sections with footnotes".

Co-authored-by: Tibor Nagy (NISZ)

Change-Id: I36568e33b04ba8024ceef6b3ea84b71fb375e2a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129896
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 9a457c24ab2731c99f1a5fa1d28f68788e6977f3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129936
Tested-by: Jenkins
(cherry picked from commit dbfa2662a6d9a9b53f95198313374f5529978836)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129941
Reviewed-by: Michael Stahl 
Reviewed-by: Xisco Fauli 
Reviewed-by: Christian Lohmaier 
Tested-by: Christian Lohmaier 

diff --git a/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt 
b/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt
new file mode 100644
index ..660dcb70df0b
Binary files /dev/null and 
b/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 3ef61970f5ae..85a685ff2b44 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3719,6 +3719,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf135035)
 CPPUNIT_ASSERT_GREATER(nParentWidth, nFly3Width);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf146704_EndnoteInSection)
+{
+SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, 
"tdf146704_EndnoteInSection.odt");
+CPPUNIT_ASSERT(pDoc);
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+// Without the fix, the endnote placed to 2. page
+assertXPath(pXmlDoc, "/root/page", 1);
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, 
testTdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage)
 {
 SwDoc* pDoc
diff --git a/sw/source/core/layout/findfrm.cxx 
b/sw/source/core/layout/findfrm.cxx
index 445d3e29dcd6..d100e24526a4 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -458,8 +458,9 @@ SwFootnoteBossFrame* SwFrame::FindFootnoteBossFrame( bool 
bFootnotes )
 // similar case can be reached with a page break + FootnoteAtEnd 
setting
 SwSectionFrame* pSectframe = pRet->FindSctFrame();
 bool bMoveToPageFrame = false;
+// tdf146704: only if it is really a footnote, not an endnote.
 // tdf54465: compatibility flag to make old odt files keep these full page 
sections.
-if (pSectframe
+if (bFootnotes && pSectframe
 && pSectframe->GetFormat()->getIDocumentSettingAccess().get(
 DocumentSettingId::FOOTNOTE_IN_COLUMN_TO_PAGEEND))
 {