oox smartart, accent process: handle multiple runs from a data point

Multiple paragraphs indeed are impossible for those containers, but
multiple runs can happen.

Change-Id: I47a2f72cae4cbb822f31a5b7cd0169a663e2a6a8
Reviewed-on: https://gerrit.libreoffice.org/63732
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Miklos Vajna 2018-11-21 17:40:36 +01:00
parent 67e062aa5e
commit cfa76f538a
3 changed files with 7 additions and 3 deletions

View file

@ -875,8 +875,10 @@ bool LayoutNode::setupShape( const ShapePtr& rShape, const dgm::Point* pPresNode
if( aVecIter->second != -1 )
rPara.getProperties().setLevel(aVecIter->second);
rPara.addRun(
aDataNode2->second->mpShape->getTextBody()->getParagraphs().front()->getRuns().front());
std::shared_ptr<TextParagraph> pSourceParagraph
= aDataNode2->second->mpShape->getTextBody()->getParagraphs().front();
for (const auto& pRun : pSourceParagraph->getRuns())
rPara.addRun(pRun);
rPara.getProperties().apply(
aDataNode2->second->mpShape->getTextBody()->getParagraphs().front()->getProperties());
}

View file

@ -494,7 +494,9 @@ void SdImportTestSmartArt::testAccentProcess()
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), xSecondPair->getCount());
uno::Reference<text::XText> xSecondParentText(xSecondPair->getByIndex(1), uno::UNO_QUERY);
CPPUNIT_ASSERT(xFirstParentText.is());
CPPUNIT_ASSERT_EQUAL(OUString("c"), xSecondParentText->getString());
// Without the accompanying fix in place, this test would have failed with
// 'Expected: cc; Actual : c', i.e. non-first runs on data points were ignored.
CPPUNIT_ASSERT_EQUAL(OUString("cc"), xSecondParentText->getString());
uno::Reference<drawing::XShape> xSecondParent(xSecondParentText, uno::UNO_QUERY);
CPPUNIT_ASSERT(xSecondParent.is());
int nSecondParentLeft = xSecondParent->getPosition().X;