summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAttila Bakos (NISZ) <bakos.attilakaroly@nisz.hu>2020-12-22 15:20:23 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-01-15 10:03:34 +0100
commit1d1bd898e21bd56fff467b785d7c2c801064ed83 (patch)
treecf541bdcbd3029b5dc2f9cf5a19d275b577ce8cb
parentsw: fix layout loop due to a keep-with-next vs 100% image height conflict (diff)
downloadcore-1d1bd898e21bd56fff467b785d7c2c801064ed83.tar.gz
core-1d1bd898e21bd56fff467b785d7c2c801064ed83.zip
tdf#138739 sw: fix regression of first paragraph
First paragraph of the document lost its formatting from commit 056933bc55608d0ca061539ae124d7b9386cdb62. (tdf#137802 sw: fix crash on deleting last paragraph). This reverts commit 056933bc55608d0ca061539ae124d7b9386cdb62. Note: last take went wrong so this is a follow up for commit 25ca25ee25278536c56a2ac4a63af91100ce4d2e (tdf#138739 sw: fix regression of first paragraph). Hopefuly it will be fine. Change-Id: Id8a19c47f172b25cd5559f5823f19b3faf38cfd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108196 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 7957123a144bfe66a99aa0d30a47900b6b621a70) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109010 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rwxr-xr-xsw/qa/extras/ooxmlexport/data/tdf138739.docxbin0 -> 16780 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport15.cxx7
-rw-r--r--sw/source/core/doc/textboxhelper.cxx7
3 files changed, 8 insertions, 6 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf138739.docx b/sw/qa/extras/ooxmlexport/data/tdf138739.docx
new file mode 100755
index 000000000000..7b5bb302bfa1
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf138739.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 7dd4feae324a..c875d560e592 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -240,6 +240,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf136404, "tdf136404.fodt")
CPPUNIT_ASSERT_EQUAL(OUString("8"), xEnumerationAccess7->getPresentation(false).trim());
}
+DECLARE_OOXMLEXPORT_TEST(testTdf138739, "tdf138739.docx")
+{
+ uno::Reference<beans::XPropertySet> xParaProps(getParagraph(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Font type name does not match!", OUString("Comic Sans MS"),
+ xParaProps->getPropertyValue("CharFontName").get<OUString>());
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf123390, "tdf123390.fodt")
{
uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx
index 5457b8b5d317..4d44d1c35ff8 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -92,12 +92,7 @@ void SwTextBoxHelper::create(SwFrameFormat* pShape, bool bCopyText)
}
catch (uno::Exception&)
{
- // Before the textframe was appended now it is inserted to the begin of the doc in order
- // to prevent crash when someone removes the para where the textframe anchored:
- uno::Reference<text::XTextCursor> xCursor = xTextDocument->getText()->createTextCursor();
- xCursor->gotoStart(false);
- xTextContentAppend->insertTextContentWithProperties(
- xTextFrame, uno::Sequence<beans::PropertyValue>(), xCursor->getStart());
+ xTextContentAppend->appendTextContent(xTextFrame, uno::Sequence<beans::PropertyValue>());
}
// Link FLY and DRAW formats, so it becomes a text box (needed for syncProperty calls).
uno::Reference<text::XTextFrame> xRealTextFrame(xTextFrame, uno::UNO_QUERY);