[Libreoffice-commits] core.git: oox/source sd/qa

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 21 20:22:39 UTC 2018


 oox/source/drawingml/diagram/diagramlayoutatoms.cxx |    6 ++++--
 sd/qa/unit/data/pptx/smartart-accent-process.pptx   |binary
 sd/qa/unit/import-tests-smartart.cxx                |    4 +++-
 3 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit cfa76f538a44d4396574ece59e8a3953c22c6eb7
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Nov 21 17:40:36 2018 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Nov 21 21:22:14 2018 +0100

    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 at collabora.com>
    Tested-by: Jenkins

diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index bb5ed2ad7704..52a05ccdb53d 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -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());
             }
diff --git a/sd/qa/unit/data/pptx/smartart-accent-process.pptx b/sd/qa/unit/data/pptx/smartart-accent-process.pptx
index de556bdc6066..8710e7f170a9 100644
Binary files a/sd/qa/unit/data/pptx/smartart-accent-process.pptx and b/sd/qa/unit/data/pptx/smartart-accent-process.pptx differ
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index f431cdddfa03..7c46270015ee 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -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;


More information about the Libreoffice-commits mailing list