tdf#138739 sw: fix regression of first paragraph
First paragraph of the document lost its formatting from commit056933bc55
. (tdf#137802 sw: fix crash on deleting last paragraph). This reverts commit056933bc55
. Change-Id: I7d42c9a22b456ce3faa9cf08c6c73a2878636c8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107427 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
This commit is contained in:
committed by
László Németh
parent
ad8485ebe1
commit
25ca25ee25
BIN
sw/qa/extras/ooxmlexport/data/tdf138739.docx
Executable file
BIN
sw/qa/extras/ooxmlexport/data/tdf138739.docx
Executable file
Binary file not shown.
@@ -425,6 +425,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf98000_changePageStyle, "tdf98000_changePageStyle
|
|||||||
CPPUNIT_ASSERT_MESSAGE("Different page1/page2 styles", sPageOneStyle != sPageTwoStyle);
|
CPPUNIT_ASSERT_MESSAGE("Different page1/page2 styles", sPageOneStyle != sPageTwoStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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(testTdf135216_evenOddFooter, "tdf135216_evenOddFooter.odt")
|
DECLARE_OOXMLEXPORT_TEST(testTdf135216_evenOddFooter, "tdf135216_evenOddFooter.odt")
|
||||||
{
|
{
|
||||||
uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
|
uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
|
||||||
|
@@ -83,23 +83,8 @@ void SwTextBoxHelper::create(SwFrameFormat* pShape, bool bCopyText)
|
|||||||
pShape->GetDoc()->GetDocShell()->GetBaseModel(), uno::UNO_QUERY);
|
pShape->GetDoc()->GetDocShell()->GetBaseModel(), uno::UNO_QUERY);
|
||||||
uno::Reference<text::XTextContentAppend> xTextContentAppend(xTextDocument->getText(),
|
uno::Reference<text::XTextContentAppend> xTextContentAppend(xTextDocument->getText(),
|
||||||
uno::UNO_QUERY);
|
uno::UNO_QUERY);
|
||||||
try
|
xTextContentAppend->appendTextContent(xTextFrame, uno::Sequence<beans::PropertyValue>());
|
||||||
{
|
|
||||||
SdrObject* pSourceSDRShape = pShape->FindRealSdrObject();
|
|
||||||
uno::Reference<text::XTextContent> XSourceShape(pSourceSDRShape->getUnoShape(),
|
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
xTextContentAppend->insertTextContentWithProperties(
|
|
||||||
xTextFrame, uno::Sequence<beans::PropertyValue>(), XSourceShape->getAnchor());
|
|
||||||
}
|
|
||||||
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());
|
|
||||||
}
|
|
||||||
// Link FLY and DRAW formats, so it becomes a text box (needed for syncProperty calls).
|
// Link FLY and DRAW formats, so it becomes a text box (needed for syncProperty calls).
|
||||||
uno::Reference<text::XTextFrame> xRealTextFrame(xTextFrame, uno::UNO_QUERY);
|
uno::Reference<text::XTextFrame> xRealTextFrame(xTextFrame, uno::UNO_QUERY);
|
||||||
auto pTextFrame = dynamic_cast<SwXTextFrame*>(xRealTextFrame.get());
|
auto pTextFrame = dynamic_cast<SwXTextFrame*>(xRealTextFrame.get());
|
||||||
|
Reference in New Issue
Block a user