summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorAttila Bakos (NISZ) <bakos.attilakaroly@nisz.hu>2020-12-22 15:20:23 +0100
committerLászló Németh <nemeth@numbertext.org>2021-01-08 13:20:05 +0100
commit7957123a144bfe66a99aa0d30a47900b6b621a70 (patch)
treecc66a8597f21fb887897868e099384ceb4e19e7a /sw
parent8e4d220d346fc08bc669f8cff967693c39674906 (diff)
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>
Diffstat (limited to 'sw')
-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 b5f5493b9557..5b0d0e00a025 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -238,6 +238,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 a9859266e21f..848a8916e293 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -93,12 +93,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);