tdf#148565 sw ms export: a new run can't be postponed-started

This fixes a LO 7.4 regression from
commit 46b62f7777.

A make check with an assert indicated the following
existing unit tests matched - but they had no noticable
char run content to test against.
ooxmlexport6's testShapeThemePreservation
ooxmlexport7's testBnc884615
ooxmlexport9's testTdf90789
ooxmlexport10's testTdf90153
ooxmlexport11's testTdf137655
ooxmlexport14's testTdf131539
ooxmlexport15's testTdf138739
ooxmlexport17's testTdf126287

Change-Id: Iae89ff1f6de06bfe37b886e1e39e8457157ae240
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133187
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
This commit is contained in:
Justin Luth
2022-04-19 15:29:14 +02:00
committed by Justin Luth
parent c7ed23137f
commit 76de78c338
2 changed files with 6 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
#include <swmodeltestbase.hxx>
#include <com/sun/star/awt/FontWeight.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
@@ -268,6 +269,9 @@ 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>());
// tdf#148565: text at anchor point should be bold, Comic Sanc MS font
CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(getRun(getParagraph(5), 3), "CharWeight"));
}
DECLARE_OOXMLEXPORT_TEST(testTdf123390, "tdf123390.fodt")

View File

@@ -2772,6 +2772,8 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
if (FLY_PROCESSED == nStateOfFlyFrame || FLY_NONE == nStateOfFlyFrame)
{
AttrOutput().EndRun(&rNode, nCurrentPos, /*bLastRun=*/false);
if (!aSavedSnippet.isEmpty())
bStartedPostponedRunProperties = false;
AttrOutput().StartRun( pRedlineData, nCurrentPos, bSingleEmptyRun );
AttrOutput().SetAnchorIsLinkedToNode( false );