Kaydet (Commit) 57d4cd80 authored tarafından Vasily Melenchuk's avatar Vasily Melenchuk Kaydeden (comit) Katarina Behrens

tdf#121205: Convert <a:br> to newline chars in chart title

Change-Id: I43d14025c48878c5bc035d492623f4fc52426e5e
Reviewed-on: https://gerrit.libreoffice.org/62752
Tested-by: Jenkins
Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst db601f69
......@@ -111,6 +111,7 @@ public:
void testTdf115107_2(); // import complex data point labels in cobo charts with multiple data series
void testTdf116163();
void testTdf121205();
CPPUNIT_TEST_SUITE(Chart2ImportTest);
CPPUNIT_TEST(Fdo60083);
......@@ -176,6 +177,7 @@ public:
CPPUNIT_TEST(testTdf115107_2);
CPPUNIT_TEST(testTdf116163);
CPPUNIT_TEST(testTdf121205);
CPPUNIT_TEST_SUITE_END();
......@@ -1583,6 +1585,20 @@ void Chart2ImportTest::testTdf116163()
CPPUNIT_ASSERT_EQUAL(OUString("Dddd..."), xLabel3->getString());
}
void Chart2ImportTest::testTdf121205()
{
load("/chart2/qa/extras/data/pptx/", "tdf121205.pptx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
uno::Reference<chart2::XTitled> xTitled(xChartDoc, uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("chart doc does not have title", xTitled.is());
OUString aTitle = getTitleString(xTitled);
// We expect title splitted in 3 lines
CPPUNIT_ASSERT_EQUAL(OUString("Firstline\nSecondline\nThirdline"), aTitle);
}
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
......
......@@ -41,6 +41,7 @@ public:
const TextCharacterProperties& getTextCharacterProperties() const { return maTextCharacterProperties; }
void setLineBreak() { mbIsLineBreak = true; }
bool isLineBreak() const { return mbIsLineBreak; }
virtual sal_Int32 insertAt(
const ::oox::core::XmlFilterBase& rFilterBase,
......
......@@ -85,7 +85,7 @@ Sequence< Reference< XFormattedString > > TextConverter::createStringSequence(
for( TextRunVector::const_iterator aRIt = rTextPara.getRuns().begin(), aREnd = rTextPara.getRuns().end(); aRIt != aREnd; ++aRIt )
{
const TextRun& rTextRun = **aRIt;
bool bAddNewLine = (aRIt + 1 == aREnd) && (aPIt + 1 != aPEnd);
bool bAddNewLine = ((aRIt + 1 == aREnd) && (aPIt + 1 != aPEnd)) || rTextRun.isLineBreak();
Reference< XFormattedString > xFmtStr = appendFormattedString( aStringVec, rTextRun.getText(), bAddNewLine );
PropertySet aPropSet( xFmtStr );
TextCharacterProperties aRunProps( rParaProps );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment