[Libreoffice-commits] core.git: sw/qa sw/source
Attila Bakos (NISZ) (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jan 8 12:20:44 UTC 2021
sw/qa/extras/ooxmlexport/data/tdf138739.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 7 +++++++
sw/source/core/doc/textboxhelper.cxx | 7 +------
3 files changed, 8 insertions(+), 6 deletions(-)
New commits:
commit 7957123a144bfe66a99aa0d30a47900b6b621a70
Author: Attila Bakos (NISZ) <bakos.attilakaroly at nisz.hu>
AuthorDate: Tue Dec 22 15:20:23 2020 +0100
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Fri Jan 8 13:20:05 2021 +0100
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 at numbertext.org>
Reviewed-by: László Németh <nemeth at numbertext.org>
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
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf138739.docx 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);
More information about the Libreoffice-commits
mailing list