[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sw/qa
oox/source/export/drawingml.cxx | 10 +++--- sw/qa/extras/ooxmlexport/data/tdf127085.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport13.cxx |7 +++ 3 files changed, 14 insertions(+), 3 deletions(-) New commits: commit 136ab631a3d2f7cfa22ca7b657e1c54c9d022b66 Author: Tamás Zolnai AuthorDate: Thu Aug 22 15:57:41 2019 +0200 Commit: Xisco Faulí CommitDate: Mon Sep 2 08:49:25 2019 +0200 tdf#127085: FILESAVE: Transparency is lost after RT Reviewed-on: https://gerrit.libreoffice.org/77963 Tested-by: Jenkins Reviewed-by: Tamás Zolnai (cherry picked from commit 505cbb9c3d2771a12c989515663cc1eb73dd0c2f) Change-Id: I22ba83b5cc00f84112a3755898ee2be58337afd6 Reviewed-on: https://gerrit.libreoffice.org/78263 Tested-by: Jenkins Reviewed-by: Xisco Faulí diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 0f4f75c155cc..b8598b36030b 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1194,14 +1194,18 @@ void DrawingML::WriteImageBrightnessContrastTransparence(uno::Reference(); if (GetProperty(rXPropSet, "AdjustContrast")) nContrast = mAny.get(); -if (GetProperty(rXPropSet, "Transparency")) -nTransparence = mAny.get(); +// Used for shapes with picture fill +if (GetProperty(rXPropSet, "FillTransparence")) +nTransparence = mAny.get(); +// Used for pictures +if (nTransparence == 0 && GetProperty(rXPropSet, "Transparency")) +nTransparence = static_cast(mAny.get()); if (nBright || nContrast) diff --git a/sw/qa/extras/ooxmlexport/data/tdf127085.docx b/sw/qa/extras/ooxmlexport/data/tdf127085.docx new file mode 100644 index ..65556fe38abd Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf127085.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index a3a7184b34e0..4942409a78d5 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -124,6 +124,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf125324, "tdf125324.docx") assertXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/tab/infos/bounds", "top", "4193"); } +DECLARE_OOXMLEXPORT_TEST(tdf127085, "tdf127085.docx") +{ +// Fill transparency was lost during export +uno::Reference xShape(getShape(1), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(sal_Int16(50), getProperty(xShape, "FillTransparence")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source
oox/source/helper/graphichelper.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit f88d51e1f27896e5339033671bac158d2436abcf Author: Gabor Kelemen AuthorDate: Sun Jul 14 20:21:08 2019 +0200 Commit: Xisco Faulí CommitDate: Mon Jul 15 14:14:03 2019 +0200 tdf#126310 Disable lazy loading of WMF images Change-Id: I70d271e29bedc640cbfeab187ddb9ffce3e779e6 Reviewed-on: https://gerrit.libreoffice.org/75599 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit 184a4771dad448a37f80b29bc62ad62e0a6a4bb6) Reviewed-on: https://gerrit.libreoffice.org/75614 Reviewed-by: Xisco Faulí (cherry picked from commit 1c04b5c97ca3b12e52ec55572da77f7b6636e34c) Reviewed-on: https://gerrit.libreoffice.org/75623 Reviewed-by: Michael Stahl diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx index bb8d0d9a1929..00b805d61803 100644 --- a/oox/source/helper/graphichelper.cxx +++ b/oox/source/helper/graphichelper.cxx @@ -343,9 +343,9 @@ Reference< XGraphic > GraphicHelper::importEmbeddedGraphic( const OUString& rStr EmbeddedGraphicMap::const_iterator aIt = maEmbeddedGraphics.find( rStreamName ); if( aIt == maEmbeddedGraphics.end() ) { -// Lazy-loading doesn't work with TIFF at the moment. +// Lazy-loading doesn't work with TIFF or WMF at the moment. WmfExternal aHeader; -if (rStreamName.endsWith(".tiff") && !pExtHeader) +if ( (rStreamName.endsWith(".tiff") || rStreamName.endsWith(".wmf") ) && !pExtHeader) pExtHeader = xGraphic = importGraphic(mxStorage->openInputStream(rStreamName), pExtHeader); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sd/qa
oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 78 sd/qa/unit/import-tests-smartart.cxx| 10 +- 2 files changed, 54 insertions(+), 34 deletions(-) New commits: commit 55e531de9c1fecc73b8a42e18dda34aa4de02f8b Author: Grzegorz Araminowicz AuthorDate: Thu May 30 13:29:08 2019 +0200 Commit: Miklos Vajna CommitDate: Mon Jun 3 14:15:55 2019 +0200 SmartArt: more constraints used in linear algorithm * both width and height of children and space is taken from constraints * better handling of space between children (not lost in some cases) * children centered in the other axis Change-Id: I25b8360790de0292b2b5c313dfa55e58dc042193 Reviewed-on: https://gerrit.libreoffice.org/73201 Tested-by: Jenkins Reviewed-by: Miklos Vajna Reviewed-on: https://gerrit.libreoffice.org/73259 diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index e27c573b3d28..d7d6fda1e1e0 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -788,7 +788,8 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, const sal_Int32 nIncY = nDir==XML_fromT ? 1 : (nDir==XML_fromB ? -1 : 0); sal_Int32 nCount = rShape->getChildren().size(); -double fSpace = 0.3; + +awt::Size aSpaceSize; // Find out which constraint is relevant for which (internal) name. LayoutPropertyMap aProperties; @@ -800,17 +801,25 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, LayoutProperty& rProperty = aProperties[rConstraint.msForName]; if (rConstraint.mnType == XML_w) rProperty[XML_w] = rShape->getSize().Width * rConstraint.mfFactor; +if (rConstraint.mnType == XML_h) +rProperty[XML_h] = rShape->getSize().Height * rConstraint.mfFactor; // TODO: get values from differently named constraints as well -if (rConstraint.msForName == "sibTrans" && rConstraint.mnType == XML_w) -fSpace = rConstraint.mfFactor; +if (rConstraint.msForName == "sp" || rConstraint.msForName == "space" || rConstraint.msForName == "sibTrans") +{ +if (rConstraint.mnType == XML_w) +aSpaceSize.Width = rShape->getSize().Width * rConstraint.mfFactor; +if (rConstraint.mnType == XML_h) +aSpaceSize.Height = rShape->getSize().Height * rConstraint.mfFactor; +} } +// first approximation of children size awt::Size aChildSize = rShape->getSize(); if (nDir == XML_fromL || nDir == XML_fromR) -aChildSize.Width /= (nCount + (nCount-1)*fSpace); +aChildSize.Width /= nCount; else if (nDir == XML_fromT || nDir == XML_fromB) -aChildSize.Height /= (nCount + (nCount-1)*fSpace); +aChildSize.Height /= nCount; awt::Point aCurrPos(0, 0); if (nIncX == -1) @@ -820,51 +829,58 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, // See if children requested more than 100% space in total: scale // down in that case. -sal_Int32 nTotalWidth = 0; -bool bSpaceFromConstraints = false; +awt::Size aTotalSize; for (auto & aCurrShape : rShape->getChildren()) { -oox::OptValue oWidth -= findProperty(aProperties, aCurrShape->getInternalName(), XML_w); - +oox::OptValue oWidth = findProperty(aProperties, aCurrShape->getInternalName(), XML_w); +oox::OptValue oHeight = findProperty(aProperties, aCurrShape->getInternalName(), XML_h); awt::Size aSize = aChildSize; if (oWidth.has()) -{ aSize.Width = oWidth.get(); -bSpaceFromConstraints = true; -} -if (nDir == XML_fromL || nDir == XML_fromR) -nTotalWidth += aSize.Width; +if (oHeight.has()) +aSize.Height = oHeight.get(); +aTotalSize.Width += aSize.Width; +aTotalSize.Height += aSize.Height; } -double fWidthScale = 1.0; -if (nTotalWidth > rShape->getSize().Width && nTotalWidth) -{ -fWidthScale = rShape->getSize().Width; -fWidthScale /= nTotalWidth; -} +aTotalSize.Width += (nCount-1) * aSpaceSize.Width; +aTotalSize.Height += (nCount-1) * aSpaceSize.Height; -// Don't add automatic space if we take space from constraints. -if (bSpaceFromConstraints) -
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source
oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 22 ++-- oox/source/drawingml/diagram/layoutatomvisitors.cxx |6 - 2 files changed, 8 insertions(+), 20 deletions(-) New commits: commit 83d101158ef3726d005ae7bd47437ab22ad2a036 Author: Grzegorz Araminowicz AuthorDate: Tue May 28 17:37:19 2019 +0200 Commit: Miklos Vajna CommitDate: Mon Jun 3 14:15:38 2019 +0200 SmartArt: keep parent constraints instead of merging every time currently for every node we were additionaly loading constraints from parent node, merging them and then deleting it makes more sense just to keep already loaded constraints from parent node Change-Id: I3fcd669547f24eeeac0b77876950ff7436bd5cb3 Reviewed-on: https://gerrit.libreoffice.org/73116 Tested-by: Jenkins Reviewed-by: Miklos Vajna Reviewed-on: https://gerrit.libreoffice.org/73258 diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index 808960093f29..e27c573b3d28 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -499,24 +499,8 @@ void AlgAtom::accept( LayoutAtomVisitor& rVisitor ) } void AlgAtom::layoutShape( const ShapePtr& rShape, - const std::vector& rOwnConstraints ) + const std::vector& rConstraints ) { -// Algorithm result may depend on the parent constraints as well. -std::vector aMergedConstraints; -const LayoutNode* pParent = getLayoutNode().getParentLayoutNode(); -if (pParent) -{ -for (const auto& pChild : pParent->getChildren()) -{ -auto pConstraintAtom = dynamic_cast(pChild.get()); -if (pConstraintAtom) -pConstraintAtom->parseConstraint(aMergedConstraints, /*bRequireForName=*/true); -} -} -aMergedConstraints.insert(aMergedConstraints.end(), rOwnConstraints.begin(), - rOwnConstraints.end()); -const std::vector& rConstraints = aMergedConstraints; - switch(mnType) { case XML_composite: @@ -629,7 +613,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, { // There is no shape type "conn", replace it by an arrow based // on the direction of the parent linear layout. -sal_Int32 nType = getConnectorType(pParent); +sal_Int32 nType = getConnectorType(getLayoutNode().getParentLayoutNode()); rShape->setSubType(nType); rShape->getCustomShapeProperties()->setShapePresetType(nType); @@ -759,7 +743,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, sal_Int32 nXOffset = 0; double fWidthScale = 1.0; if (mnType == XML_hierChild) -calculateHierChildOffsetScale(rShape, pParent, nXOffset, fWidthScale); +calculateHierChildOffsetScale(rShape, getLayoutNode().getParentLayoutNode(), nXOffset, fWidthScale); awt::Size aChildSize = rShape->getSize(); if (nDir == XML_fromT) diff --git a/oox/source/drawingml/diagram/layoutatomvisitors.cxx b/oox/source/drawingml/diagram/layoutatomvisitors.cxx index 602130b6b3e3..4e1a3689e3e4 100644 --- a/oox/source/drawingml/diagram/layoutatomvisitors.cxx +++ b/oox/source/drawingml/diagram/layoutatomvisitors.cxx @@ -291,14 +291,18 @@ void ShapeLayoutingVisitor::visit(LayoutNode& rAtom) if (meLookFor != LAYOUT_NODE) return; +size_t nParentConstraintsNumber = maConstraints.size(); + // process alg atoms first, nested layout nodes afterwards meLookFor = CONSTRAINT; defaultVisit(rAtom); meLookFor = ALGORITHM; defaultVisit(rAtom); -maConstraints.clear(); meLookFor = LAYOUT_NODE; defaultVisit(rAtom); + +// delete added constraints, keep parent constraints +maConstraints.erase(maConstraints.begin() + nParentConstraintsNumber, maConstraints.end()); } void ShapeLayoutingVisitor::visit(ShapeAtom& /*rAtom*/) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sd/qa
oox/source/drawingml/diagram/diagram.cxx | 42 + oox/source/drawingml/diagram/layoutatomvisitors.cxx| 32 sd/qa/unit/data/pptx/smartart-vertical-block-list.pptx |binary sd/qa/unit/import-tests-smartart.cxx | 41 4 files changed, 83 insertions(+), 32 deletions(-) New commits: commit 8fce4133bd427351ac269c50e02e305d9eb34321 Author: Grzegorz Araminowicz AuthorDate: Tue May 28 13:36:59 2019 +0200 Commit: Miklos Vajna CommitDate: Mon Jun 3 09:48:49 2019 +0200 SmartArt: sort shapes by Z order after layout algorithms so that they are laid out in correct order Change-Id: I82baa61311197880654d09f356decc666e6fa4c7 Reviewed-on: https://gerrit.libreoffice.org/73094 Tested-by: Jenkins Reviewed-by: Miklos Vajna Reviewed-on: https://gerrit.libreoffice.org/73255 diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx index 8efefe139dbf..be49c85d40aa 100644 --- a/oox/source/drawingml/diagram/diagram.cxx +++ b/oox/source/drawingml/diagram/diagram.cxx @@ -134,6 +134,46 @@ static sal_Int32 calcDepth( const OUString& rNodeName, return 0; } +static void sortChildrenByZOrder(const ShapePtr& pShape) +{ +std::vector& rChildren = pShape->getChildren(); + +// Offset the children from their default z-order stacking, if necessary. +for (size_t i = 0; i < rChildren.size(); ++i) +rChildren[i]->setZOrder(i); + +for (size_t i = 0; i < rChildren.size(); ++i) +{ +const ShapePtr& pChild = rChildren[i]; +sal_Int32 nZOrderOff = pChild->getZOrderOff(); +if (nZOrderOff <= 0) +continue; + +// Increase my ZOrder by nZOrderOff. +pChild->setZOrder(pChild->getZOrder() + nZOrderOff); +pChild->setZOrderOff(0); + +for (sal_Int32 j = 0; j < nZOrderOff; ++j) +{ +size_t nIndex = i + j + 1; +if (nIndex >= rChildren.size()) +break; + +// Decrease the ZOrder of the next nZOrderOff elements by one. +const ShapePtr& pNext = rChildren[nIndex]; +pNext->setZOrder(pNext->getZOrder() - 1); +} +} + +// Now that the ZOrders are adjusted, sort the children. +std::sort(rChildren.begin(), rChildren.end(), + [](const ShapePtr& a, const ShapePtr& b) { return a->getZOrder() < b->getZOrder(); }); + +// Apply also for children. +for (auto& rChild : rChildren) +sortChildrenByZOrder(rChild); +} + void Diagram::build( ) { // build name-object maps @@ -317,6 +357,8 @@ void Diagram::addTo( const ShapePtr & pParentShape ) // layout shapes - now all shapes are created ShapeLayoutingVisitor aLayoutingVisitor; mpLayout->getNode()->accept(aLayoutingVisitor); + +sortChildrenByZOrder(pParentShape); } ShapePtr pBackground(new Shape("com.sun.star.drawing.CustomShape")); diff --git a/oox/source/drawingml/diagram/layoutatomvisitors.cxx b/oox/source/drawingml/diagram/layoutatomvisitors.cxx index a45317f9ffe4..602130b6b3e3 100644 --- a/oox/source/drawingml/diagram/layoutatomvisitors.cxx +++ b/oox/source/drawingml/diagram/layoutatomvisitors.cxx @@ -187,38 +187,6 @@ void ShapeCreationVisitor::visit(LayoutNode& rAtom) std::remove_if(pCurrParent->getChildren().begin(), pCurrParent->getChildren().end(), [] (const ShapePtr & aChild) { return aChild->getServiceName() == "com.sun.star.drawing.GroupShape" && aChild->getChildren().empty(); }), pCurrParent->getChildren().end()); - -// Offset the children from their default z-order stacking, if necessary. -std::vector& rChildren = pCurrParent->getChildren(); -for (size_t i = 0; i < rChildren.size(); ++i) -rChildren[i]->setZOrder(i); - -for (size_t i = 0; i < rChildren.size(); ++i) -{ -const ShapePtr& pChild = rChildren[i]; -sal_Int32 nZOrderOff = pChild->getZOrderOff(); -if (nZOrderOff <= 0) -continue; - -// Increase my ZOrder by nZOrderOff. -pChild->setZOrder(pChild->getZOrder() + nZOrderOff); -pChild->setZOrderOff(0); - -for (sal_Int32 j = 0; j < nZOrderOff; ++j) -{ -size_t nIndex = i + j + 1; -if (nIndex >= rChildren.size()) -break; - -// Decrease the ZOrder of the next nZOrderOff elements by one. -const ShapePtr& pNext = rChildren[nIndex]; -pNext->setZOrder(pNext->getZOrder() - 1); -} -} - -// Now that the ZOrders are adjusted, sort the children. -std::sort(rChildren.begin(), rChildren.end(), - [](const ShapePtr& a, const ShapePtr& b) { return a->getZOrder() < b->getZOrder(); }); } void ShapeCreationVisitor::visit(ShapeAtom& /*rAtom*/) diff --git a/sd/qa/unit/data/pptx/smartart-vertical-block-list.pptx
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sd/qa
oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 16 - sd/qa/unit/data/pptx/smartart-font-size.pptx|binary sd/qa/unit/import-tests-smartart.cxx| 34 3 files changed, 49 insertions(+), 1 deletion(-) New commits: commit 9b4cb15e41618fb1943c6c2cb150582dccc5c96c Author: Grzegorz Araminowicz AuthorDate: Mon May 27 20:00:42 2019 +0200 Commit: Miklos Vajna CommitDate: Mon Jun 3 09:48:01 2019 +0200 SmartArt: adjust text size to fit shapes up to maximal size of primFontSz constraint. Do not override text size changed by user. Change-Id: If7ea6bbb96cb839831d877edc274a1b0eefdaf21 Reviewed-on: https://gerrit.libreoffice.org/73050 Tested-by: Jenkins Reviewed-by: Miklos Vajna Reviewed-on: https://gerrit.libreoffice.org/73251 diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index bc30ec38e219..808960093f29 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -31,6 +31,7 @@ #include #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -1105,6 +1106,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, // adjust text alignment // Parse constraints, only self margins as a start. +double fFontSize = 0; for (const auto& rConstr : rConstraints) { if (rConstr.mnRefType == XML_w) @@ -1124,9 +1126,10 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, rShape->getShapeProperties().setProperty(nProperty, nValue); } +if (rConstr.mnType == XML_primFontSz) +fFontSize = rConstr.mfValue; } -// TODO: adjust text size to fit shape TextBodyPtr pTextBody = rShape->getTextBody(); if (!pTextBody || pTextBody->getParagraphs().empty() || @@ -1135,6 +1138,17 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, break; } +// adjust text size to fit shape +if (fFontSize != 0) +{ +for (auto& aParagraph : pTextBody->getParagraphs()) +for (auto& aRun : aParagraph->getRuns()) +if (!aRun->getTextCharacterProperties().moHeight.has()) +aRun->getTextCharacterProperties().moHeight = fFontSize * 100; +} + pTextBody->getTextProperties().maPropertyMap.setProperty(PROP_TextFitToSize, drawing::TextFitToSizeType_AUTOFIT); + +// ECMA-376-1:2016 21.4.7.5 ST_AutoTextRotation (Auto Text Rotation) const sal_Int32 nautoTxRot = maMap.count(XML_autoTxRot) ? maMap.find(XML_autoTxRot)->second : XML_upr; switch(nautoTxRot) diff --git a/sd/qa/unit/data/pptx/smartart-font-size.pptx b/sd/qa/unit/data/pptx/smartart-font-size.pptx new file mode 100644 index ..253cd4c73b65 Binary files /dev/null and b/sd/qa/unit/data/pptx/smartart-font-size.pptx differ diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index 682c775b80fe..624205c5380a 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -10,6 +10,8 @@ #include "sdmodeltestbase.hxx" #include +#include +#include #include #include #include @@ -71,6 +73,7 @@ public: void testInteropGrabBag(); void testBackground(); void testBackgroundDrawingmlFallback(); +void testFontSize(); CPPUNIT_TEST_SUITE(SdImportTestSmartArt); @@ -106,6 +109,7 @@ public: CPPUNIT_TEST(testInteropGrabBag); CPPUNIT_TEST(testBackground); CPPUNIT_TEST(testBackgroundDrawingmlFallback); +CPPUNIT_TEST(testFontSize); CPPUNIT_TEST_SUITE_END(); }; @@ -997,6 +1001,36 @@ void SdImportTestSmartArt::testBackgroundDrawingmlFallback() xDocShRef->DoClose(); } +void SdImportTestSmartArt::testFontSize() +{ +sd::DrawDocShellRef xDocShRef = loadURL( + m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-font-size.pptx"), PPTX); + +uno::Reference xGroup1(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY); +uno::Reference xShape1(xGroup1->getByIndex(1), uno::UNO_QUERY); +uno::Reference xParagraph1(getParagraphFromShape(0, xShape1)); +uno::Reference xRun1(getRunFromParagraph(0, xParagraph1)); +uno::Reference xPropSet1(xRun1, uno::UNO_QUERY); +double fFontSize1 = xPropSet1->getPropertyValue("CharHeight").get(); +CPPUNIT_ASSERT_DOUBLES_EQUAL(65.0, fFontSize1, 0.01); + +uno::Reference xGroup2(getShapeFromPage(1, 0, xDocShRef), uno::UNO_QUERY); +uno::Reference xShape2(xGroup2->getByIndex(1), uno::UNO_QUERY); +uno::Reference xParagraph2(getParagraphFromShape(0, xShape2)); +
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source
oox/source/export/drawingml.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 2045a84c9fa89fdd1a59807ddfae17d95fe4256c Author: Miklos Vajna AuthorDate: Tue Feb 5 09:32:35 2019 +0100 Commit: Xisco Faulí CommitDate: Wed May 22 12:30:24 2019 +0200 tdf#123106: oox: disable gradient fill grab-bag for PPTX This was added in commit 2fcf3a871c94feeca11619ef5c8c0466ce61eb74 (ooxml: preserve gradient shape fill, 2014-01-31), and assumes that the theme colors can be preserved, as the theme definition is grab-bagged as well. But the theme is grab-bagged only for DOCX, not for PPTX, so skip gradient grab-bag for PPTX, otherwise the gradient would refer to incorrect colors in the theme. Change-Id: I98e1c67d4b10e68916f81dd7fc508eb4146d506b Reviewed-on: https://gerrit.libreoffice.org/67386 Reviewed-by: Miklos Vajna Tested-by: Jenkins Reviewed-on: https://gerrit.libreoffice.org/72681 Reviewed-by: Xisco Faulí diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 7d0aca3c3899..0f4f75c155cc 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -442,7 +442,9 @@ void DrawingML::WriteGradientFill( const Reference< XPropertySet >& rXPropSet ) } // check if an ooxml gradient had been imported and if the user has modified it -if( EqualGradients( aOriginalGradient, aGradient ) ) +// Gradient grab-bag depends on theme grab-bag, which is implemented +// only for DOCX. +if( EqualGradients( aOriginalGradient, aGradient ) && GetDocumentType() == DOCUMENT_DOCX) { // If we have no gradient stops that means original gradient were defined by a theme. if( aGradientStops.hasElements() ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sw/qa
oox/source/drawingml/shape.cxx |5 - oox/source/shape/WpgContext.cxx |6 +- sw/qa/extras/ooxmlimport/data/tdf124398.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport2.cxx| 12 4 files changed, 21 insertions(+), 2 deletions(-) New commits: commit 9baed128acbbac24ef85a8470d721e8ee59b776f Author: Miklos Vajna AuthorDate: Mon Apr 29 08:35:29 2019 +0200 Commit: Caolán McNamara CommitDate: Fri May 17 13:25:59 2019 +0200 tdf#124398 DOCX drawingML import: handle charts in group shapes Regression from commit 8c73b16f5f18f3bc1dbf9ff6c1475db56b44d304 (DOCX import: declare wpg as a supported feature, 2013-12-05), the problem was that did not forward to to the relevant oox context, and also Writer had no idea how to create a com.sun.star.drawing.OLE2Shape. Fix the later by using the same service name that's in use for the non-groupshape case. (cherry picked from commit fdf4aaa3dc5cc1d2e7a112e6c32d7845f13caef8) Change-Id: Id3536854da7c1f01525bb38d801496ecebd4c161 Reviewed-on: https://gerrit.libreoffice.org/71524 Tested-by: Xisco Faulí Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index ba3e8d7fdb5d..d45a88a692cf 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -218,7 +218,10 @@ ChartShapeInfo& Shape::setChartType( bool bEmbedShapes ) { OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setChartType - multiple frame types" ); meFrameType = FRAMETYPE_CHART; -msServiceName = "com.sun.star.drawing.OLE2Shape"; +if (mbWps) +msServiceName = "com.sun.star.drawing.temporaryForXMLImportOLE2Shape"; +else +msServiceName = "com.sun.star.drawing.OLE2Shape"; mxChartShapeInfo.reset( new ChartShapeInfo( bEmbedShapes ) ); return *mxChartShapeInfo; } diff --git a/oox/source/shape/WpgContext.cxx b/oox/source/shape/WpgContext.cxx index 95264e53ce15..75ff0422bcf2 100644 --- a/oox/source/shape/WpgContext.cxx +++ b/oox/source/shape/WpgContext.cxx @@ -57,7 +57,11 @@ oox::core::ContextHandlerRef WpgContext::onCreateContext(sal_Int32 nElementToken return new oox::drawingml::ShapeGroupContext(*this, mpShape, std::make_shared("com.sun.star.drawing.GroupShape")); } case XML_graphicFrame: -break; +{ +auto pShape = std::make_shared("com.sun.star.drawing.GraphicObjectShape"); +pShape->setWps(true); +return new oox::drawingml::GraphicalObjectFrameContext(*this, mpShape, pShape, /*bEmbedShapesInChart=*/true); +} default: SAL_WARN("oox", "WpgContext::createFastChildContext: unhandled element: " << getBaseToken(nElementToken)); break; diff --git a/sw/qa/extras/ooxmlimport/data/tdf124398.docx b/sw/qa/extras/ooxmlimport/data/tdf124398.docx new file mode 100644 index ..4d1855347fd6 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf124398.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index 57c7f7ef4245..e5c6e182a02e 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -235,6 +235,18 @@ DECLARE_OOXMLIMPORT_TEST(testTdf112443, "tdf112443.docx") // and as result only one page should be generated. DECLARE_OOXMLIMPORT_TEST(testTdf113182, "tdf113182.docx") { CPPUNIT_ASSERT_EQUAL(1, getPages()); } +DECLARE_OOXMLIMPORT_TEST(testTdf124398, "tdf124398.docx") +{ +uno::Reference xGroup(getShape(1), uno::UNO_QUERY); +CPPUNIT_ASSERT(xGroup.is()); +// Without the accompanying fix in place, this test would have failed with 'Expected: 2; Actual: +// 1', i.e. the chart children of the group shape was lost. +CPPUNIT_ASSERT_EQUAL(static_cast(2), xGroup->getCount()); + +uno::Reference xShape(xGroup->getByIndex(1), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.OLE2Shape"), xShape->getShapeType()); +} + DECLARE_OOXMLIMPORT_TEST(testTdf113946, "tdf113946.docx") { OUString aTop = parseDump("/root/page/body/txt/anchored/SwAnchoredDrawObject/bounds", "top"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sw/qa
oox/source/shape/WpsContext.cxx |8 +++- sw/qa/extras/ooxmlimport/data/tdf124754.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport2.cxx| 15 +++ 3 files changed, 22 insertions(+), 1 deletion(-) New commits: commit 1b1caaf4bce6b60c4c1af7dfc6f90dbdf4c3f817 Author: Serge Krot AuthorDate: Mon May 13 15:43:44 2019 +0200 Commit: Michael Stahl CommitDate: Tue May 14 18:31:22 2019 +0200 tdf#124754 sw docx import: do not override text color with -1 (auto) color Change-Id: Id821b0d8bef69a7124ee41558e822cf8b025df9d Reviewed-on: https://gerrit.libreoffice.org/72232 Tested-by: Jenkins Reviewed-by: Thorsten Behrens Reviewed-on: https://gerrit.libreoffice.org/72293 Reviewed-by: Michael Stahl diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx index e196449ec7ed..2b2ad8b2b1b7 100644 --- a/oox/source/shape/WpsContext.cxx +++ b/oox/source/shape/WpsContext.cxx @@ -151,7 +151,13 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken if (ePropertyState == beans::PropertyState_DEFAULT_VALUE) { uno::Reference xTextBoxPropertySet(xTextCursor, uno::UNO_QUERY); -xTextBoxPropertySet->setPropertyValue("CharColor", xPropertySet->getPropertyValue("CharColor")); +uno::Any xCharColor = xPropertySet->getPropertyValue("CharColor"); +Color aColor = COL_AUTO; +if (xCharColor >>= aColor) +{ +if (aColor != COL_AUTO) +xTextBoxPropertySet->setPropertyValue("CharColor", xCharColor); +} } return this; } diff --git a/sw/qa/extras/ooxmlimport/data/tdf124754.docx b/sw/qa/extras/ooxmlimport/data/tdf124754.docx new file mode 100644 index ..2f7f4e14bda5 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf124754.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index a74501cd708c..57c7f7ef4245 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -197,6 +197,7 @@ DECLARE_OOXMLIMPORT_TEST(testTdf117843, "tdf117843.docx") getProperty(getParagraphOfText(1, xHeaderText), "ParaTopMargin")); } +// related tdf#124754 DECLARE_OOXMLIMPORT_TEST(testTdf43017, "tdf43017.docx") { uno::Reference xParagraph = getParagraph(1); @@ -207,6 +208,20 @@ DECLARE_OOXMLIMPORT_TEST(testTdf43017, "tdf43017.docx") getProperty(xText, "CharColor")); } +// related tdf#43017 +DECLARE_OOXMLIMPORT_TEST(testTdf124754, "tdf124754.docx") +{ +uno::Reference textbox(getShape(1), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(1, getParagraphs(textbox)); + +uno::Reference xParagraph = getParagraphOfText(1, textbox); +uno::Reference xText = getRun(xParagraph, 2); + +// Ensure that hyperlink text color is not black +CPPUNIT_ASSERT_EQUAL_MESSAGE("Hyperlink color should be not black!", sal_Int32(353217), + getProperty(xText, "CharColor")); +} + DECLARE_OOXMLIMPORT_TEST(testTdf112443, "tdf112443.docx") { // the position of the flying text frame should be off page ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sd/qa
oox/source/drawingml/fillproperties.cxx|5 + oox/source/export/drawingml.cxx|6 +++--- sd/qa/unit/data/odp/image_transparency.odp |binary sd/qa/unit/export-tests-ooxml1.cxx | 26 ++ 4 files changed, 34 insertions(+), 3 deletions(-) New commits: commit dc75d3cc5f2797dd5a8675004302a52bda1210c6 Author: Tamás Zolnai AuthorDate: Thu May 9 13:03:13 2019 +0200 Commit: Andras Timar CommitDate: Sat May 11 10:07:06 2019 +0200 PPTX: Fix import / export of image transparency Reviewed-on: https://gerrit.libreoffice.org/71916 Tested-by: Jenkins Reviewed-by: Tamás Zolnai (cherry picked from commit ae3aabdb951643af8d2f7aee9c9f900245e5b384) Change-Id: Ib07c606083b833389fcb82aac57ca8535d6e861f Reviewed-on: https://gerrit.libreoffice.org/72051 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index b255116b4a7b..a2fb6ee7a6c6 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -755,6 +755,11 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe rPropMap.setProperty(PROP_GraphicCrop, aGraphCrop); } } + +if ( maBlipProps.moAlphaModFix.has() ) +{ +rPropMap.setProperty(PROP_Transparency, static_cast(100 - (maBlipProps.moAlphaModFix.get() / PER_PERCENT))); +} } rPropMap.setProperty(PROP_GraphicColorMode, eColorMode); diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index a797adbc1f1e..23065ec67678 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1154,14 +1154,14 @@ void DrawingML::WriteImageBrightnessContrastTransparence(uno::Reference(); if (GetProperty(rXPropSet, "AdjustContrast")) nContrast = mAny.get(); -if (GetProperty(rXPropSet, "FillTransparence")) -nTransparence = mAny.get(); +if (GetProperty(rXPropSet, "Transparency")) +nTransparence = mAny.get(); if (nBright || nContrast) diff --git a/sd/qa/unit/data/odp/image_transparency.odp b/sd/qa/unit/data/odp/image_transparency.odp new file mode 100644 index ..6d3f6c232d91 Binary files /dev/null and b/sd/qa/unit/data/odp/image_transparency.odp differ diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index f649d2723044..7cc50e21f963 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -101,6 +101,7 @@ public: void testTdf111884(); void testTdf112633(); void testCustomXml(); +void testPictureTransparency(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest1); @@ -131,6 +132,7 @@ public: CPPUNIT_TEST(testTdf111884); CPPUNIT_TEST(testTdf112633); CPPUNIT_TEST(testCustomXml); +CPPUNIT_TEST(testPictureTransparency); CPPUNIT_TEST_SUITE_END(); @@ -853,6 +855,30 @@ void SdOOXMLExportTest1::testCustomXml() CPPUNIT_ASSERT(pStream); } +void SdOOXMLExportTest1::testPictureTransparency() +{ +// Load document and export it to a temporary file. +::sd::DrawDocShellRef xDocShRef += loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/image_transparency.odp"), ODP); +utl::TempFile tempFile; +xDocShRef = saveAndReload(xDocShRef.get(), PPTX, ); +uno::Reference xDoc(xDocShRef->GetDoc()->getUnoModel(), + uno::UNO_QUERY); +CPPUNIT_ASSERT(xDoc.is()); + +uno::Reference xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY); +CPPUNIT_ASSERT(xPage.is()); + +uno::Reference xGraphicShape(getShape(0, xPage)); +CPPUNIT_ASSERT(xGraphicShape.is()); + +sal_Int16 nTransparency = 0; +CPPUNIT_ASSERT(xGraphicShape->getPropertyValue("Transparency") >>= nTransparency); +CPPUNIT_ASSERT_EQUAL(static_cast(51), nTransparency); + +xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest1); CPPUNIT_PLUGIN_IMPLEMENT(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sw/qa
oox/source/drawingml/diagram/diagramlayoutatoms.cxx |6 ++ sw/qa/core/data/ooxml/fail/ofz14422-1.docx |binary 2 files changed, 6 insertions(+) New commits: commit b7662cffb5e12935ffaa4252c081659165600ada Author: Caolán McNamara AuthorDate: Wed Apr 24 11:38:53 2019 +0100 Commit: Michael Stahl CommitDate: Fri Apr 26 11:32:49 2019 +0200 ofz#14422 null deref Change-Id: Icd00e2aaa5932564668cd12ce4ee63aecc34419a Reviewed-on: https://gerrit.libreoffice.org/71305 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index 1832183d298a..bc30ec38e219 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -1277,6 +1277,12 @@ bool LayoutNode::setupShape( const ShapePtr& rShape, const dgm::Point* pPresNode continue; } +if (!aDataNode2->second->mpShape) +{ +//busted, skip it +continue; +} + rShape->setDataNodeType(aDataNode2->second->mnType); if( rItem.mnDepth == 0 ) diff --git a/sw/qa/core/data/ooxml/fail/ofz14422-1.docx b/sw/qa/core/data/ooxml/fail/ofz14422-1.docx new file mode 100644 index ..8284f6afc4b3 Binary files /dev/null and b/sw/qa/core/data/ooxml/fail/ofz14422-1.docx differ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sd/qa
oox/source/ppt/pptshapegroupcontext.cxx | 26 -- sd/qa/unit/data/pptx/tdf123684.pptx |binary sd/qa/unit/import-tests.cxx | 16 3 files changed, 36 insertions(+), 6 deletions(-) New commits: commit 1d0729a5b7a96c6fb962b60a51eddf773773e379 Author: Miklos Vajna AuthorDate: Tue Apr 23 09:09:21 2019 +0200 Commit: Caolán McNamara CommitDate: Tue Apr 23 15:42:02 2019 +0200 tdf#123684 PPTX import: fix wrong background color for Regression from commit 59339dec1ce56213dc74a06af2f0d35ac1c534d7 (tdf#105150 PPTX import: try harder to handle , 2017-01-06), the problem was that we gave a white solid fill to a shape which is meant to be transparent. Fix the problem by limiting the scope of the mentioned commit to solid colors only, and also extend to code to look for background fill from the masterpage as well. This allows not hardcoding the white solid fill and leaves the fill style of shapes as transparent where the slide background is a bitmap or other more complex fill type. (cherry picked from commit 943a534ac7cb3df513583e226c986dafd8ba246b) Change-Id: I0063e88d510250652d2b14856df3bd431681422d Reviewed-on: https://gerrit.libreoffice.org/71115 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx index 4caa76b1c1c7..1180af3f10fb 100644 --- a/oox/source/ppt/pptshapegroupcontext.cxx +++ b/oox/source/ppt/pptshapegroupcontext.cxx @@ -103,13 +103,27 @@ ContextHandlerRef PPTShapeGroupContext::onCreateContext( sal_Int32 aElementToken oox::drawingml::FillPropertiesPtr pBackgroundPropertiesPtr = mpSlidePersistPtr->getBackgroundProperties(); if (!pBackgroundPropertiesPtr) { -// The shape wants a background, but the slide doesn't have -// one: default to white. -pBackgroundPropertiesPtr.reset(new oox::drawingml::FillProperties); -pBackgroundPropertiesPtr->moFillType = XML_solidFill; -pBackgroundPropertiesPtr->maFillColor.setSrgbClr(0xFF); +// The shape wants a background, but the slide doesn't have one. +SlidePersistPtr pMaster = mpSlidePersistPtr->getMasterPersist(); +if (pMaster) +{ +oox::drawingml::FillPropertiesPtr pMasterBackground += pMaster->getBackgroundProperties(); +if (pMasterBackground) +{ +if (pMasterBackground->moFillType.has() +&& pMasterBackground->moFillType.get() == XML_solidFill) +{ +// Master has a solid background, use that. +pBackgroundPropertiesPtr = pMasterBackground; +} +} +} +} +if (pBackgroundPropertiesPtr) +{ + pShape->getFillProperties().assignUsed(*pBackgroundPropertiesPtr); } -pShape->getFillProperties().assignUsed( *pBackgroundPropertiesPtr ); } pShape->setModelId(rAttribs.getString( XML_modelId ).get()); return new PPTShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, pShape ); diff --git a/sd/qa/unit/data/pptx/tdf123684.pptx b/sd/qa/unit/data/pptx/tdf123684.pptx new file mode 100644 index ..87243422753b Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf123684.pptx differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 2c5295abcd36..879e13d8f90f 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -166,6 +166,7 @@ public: void testTdf104445(); void testTdf105150(); void testTdf105150PPT(); +void testTdf123684(); void testTdf100926(); void testTdf89064(); void testTdf108925(); @@ -252,6 +253,7 @@ public: CPPUNIT_TEST(testTdf104445); CPPUNIT_TEST(testTdf105150); CPPUNIT_TEST(testTdf105150PPT); +CPPUNIT_TEST(testTdf123684); CPPUNIT_TEST(testTdf100926); CPPUNIT_TEST(testPatternImport); CPPUNIT_TEST(testTdf89064); @@ -1768,6 +1770,20 @@ void SdImportTest::testTdf105150() xDocShRef->DoClose(); } +void SdImportTest::testTdf123684() +{ +sd::DrawDocShellRef xDocShRef += loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf123684.pptx"), PPTX); +const SdrPage* pPage = GetPage(1, xDocShRef); +const SdrObject* pObj = pPage->GetObj(0); +auto& rFillStyleItem += dynamic_cast(pObj->GetMergedItem(XATTR_FILLSTYLE)); +// Without the accompanying fix in
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sd/qa
oox/source/drawingml/diagram/diagram.cxx| 11 +- oox/source/drawingml/diagram/diagram.hxx|8 + oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 71 --- oox/source/drawingml/diagram/diagramlayoutatoms.hxx |4 oox/source/drawingml/diagram/layoutnodecontext.cxx | 16 ++- sd/qa/unit/data/pptx/smartart-cycle-matrix.pptx |binary sd/qa/unit/import-tests-smartart.cxx| 93 7 files changed, 181 insertions(+), 22 deletions(-) New commits: commit a6d9ccf26910e35f22ccec8a75472e2fa947abe1 Author: Miklos Vajna AuthorDate: Thu Feb 7 16:26:31 2019 +0100 Commit: Andras Timar CommitDate: Thu Feb 21 22:32:44 2019 +0100 Related: tdf#117761 oox smartart: backport fixes related to cycle matrix This is a combination of 6 commits. This is the 1st commit: oox smartart, cycle matrix: fix counting presentation children The markup is: Where PowerPoint evaluated the condition to true, but Impress evaluated to false. This means that the undocumented relation between the child lists is "OR" (not "AND"). Also, our code assumed that "node" has to be a data node (not presentation node), but it seems the only way this condition can be true if presentation children is also counted. (The presentation node in question is not a presentation of anything.) (cherry picked from commit e3c6f249c10f7f1bcc528e643f5723288c514b29) This is the commit #2: oox smartart, cycle matrix: handle left/bottom constraint in composite algo The bugdoc has 3 shapes in the "outer" circle which have a position where either x or y is not 0. But these are defined using constraints talking about the right or bottom edge of the shape. Map that to top/left, given that we already know the shape size. (cherry picked from commit b9b4e9223b6c0d6e0b48b694c9aabbe54a250660) This is the commit #3: oox smartart, cycle matrix: fix too large height in composite algo The user-level problem was that the height of the entire smartart was too large. The reason for this was that: - composite algorithm gets the constraint height should be 77% of width, this means 6096000 -> 4693920 EMUs - at the same time the parent container is already smaller, 4064000 EMUs - a few lines later we already limit the max height with std::min(), but in the meantime an incorrect y position is calculated, exactly due to the lack of early limited height Solve the problem by making sure composite algorithm never works with a height (even when using it to calculate vertical center) that exceeds the height of the parent. (cherry picked from commit 5b2e38e0cfc7006d6982f741cf158a8a98dc8630) This is the commit #4: oox smartart, cycle matrix: handle aspect ratio in composite algo This way the 4 quadrant shapes in the center of the SmartArt form a circle, as width is shrinking. It's not height growing, as OOXML spec clearly says "ar" always just shrinks one axis. (>1 and <1 "ar" is to be handled when they are seen in action in an actual document.) (cherry picked from commit 34383064ac061497b0c46c449313877c6b6a2087) This is the commit #5: oox smartart, cycle matrix: handle destination order in connections It is possible to have connections from multiple data nodes to the same presentation node with a presOf type. We use to order these based on as they appear in the data XML, but we need to order them according to the destOrd attribute. Introduce an std::map for that, so get ordering automatically as we iterate. Turn the std::pair into a struct to make the code a bit more readable. (cherry picked from commit ecb733da58b74714eb66d2063a2835ce5c471870) Conflicts: oox/source/drawingml/diagram/diagramlayoutatoms.cxx This is the commit #6: oox smartart, cycle matrix: fix fill and line props of shape The topmost shape may not have 0 depth, but something larger. In that case at least it's safe to still use fill & line properties. The B1 quadrant of the test file now has the proper orange background, and B2's border is also properly orange. (cherry picked from commit 8193e697d286595aa62859011761adeb002244e3) Conflicts: oox/source/drawingml/diagram/diagramlayoutatoms.cxx Change-Id: Iccc5f6993693a0f1cf8f50d163003c24d3ad690e Reviewed-on: https://gerrit.libreoffice.org/68144 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx index 64dc5dde6d91..d1de1c72f94d 100644 --- a/oox/source/drawingml/diagram/diagram.cxx +++
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sd/qa svx/source
oox/source/drawingml/table/tableproperties.cxx | 77 +++-- sd/qa/unit/data/pptx/tdf123090.pptx|binary sd/qa/unit/import-tests.cxx| 31 +- svx/source/table/cellcursor.cxx|1 svx/source/table/tablecontroller.cxx |1 5 files changed, 91 insertions(+), 19 deletions(-) New commits: commit 7f54846b9836ea9a9ee1644e90982eac9c75b7df Author: Gülşah Köse AuthorDate: Wed Feb 20 19:06:33 2019 +0300 Commit: Andras Timar CommitDate: Thu Feb 21 16:05:28 2019 +0100 tdf#123090 Handle removed column with gridSpan. This is a combination of 3 commits. (cherry picked from commit 48ef20f2039d1a300a4324072e9b712c9994b406) (cherry picked from commit 00e89430a2f8cd1f9ec702a7583a1e4c886a2b46) (cherry picked from commit 1f0206d940cd8f7fb627a59cfe4165c0bfebaf46) Change-Id: Ic6fa6f335623e2114fc8bea76dc54833284d2a02 Reviewed-on: https://gerrit.libreoffice.org/68150 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx index e0afeb7c8246..b7b25a0e7886 100644 --- a/oox/source/drawingml/table/tableproperties.cxx +++ b/oox/source/drawingml/table/tableproperties.cxx @@ -270,33 +270,76 @@ const TableStyle& TableProperties::getUsedTableStyle( const ::oox::core::XmlFilt return *pTableStyle; } -void TableProperties::pushToPropSet( const ::oox::core::XmlFilterBase& rFilterBase, -const Reference < XPropertySet >& xPropSet, const TextListStylePtr& pMasterTextListStyle ) +void TableProperties::pushToPropSet(const ::oox::core::XmlFilterBase& rFilterBase, +const Reference& xPropSet, +const TextListStylePtr& pMasterTextListStyle) { -uno::Reference< XColumnRowRange > xColumnRowRange( - xPropSet->getPropertyValue("Model"), uno::UNO_QUERY_THROW ); +uno::Reference xColumnRowRange(xPropSet->getPropertyValue("Model"), +uno::UNO_QUERY_THROW); -CreateTableColumns( xColumnRowRange->getColumns(), mvTableGrid ); -CreateTableRows( xColumnRowRange->getRows(), mvTableRows ); +CreateTableColumns(xColumnRowRange->getColumns(), mvTableGrid); +CreateTableRows(xColumnRowRange->getRows(), mvTableRows); std::unique_ptr xTableStyleToDelete; -const TableStyle& rTableStyle( getUsedTableStyle( rFilterBase, xTableStyleToDelete ) ); +const TableStyle& rTableStyle(getUsedTableStyle(rFilterBase, xTableStyleToDelete)); sal_Int32 nRow = 0; -for (auto & tableRow : mvTableRows) + +for (auto& tableRow : mvTableRows) { sal_Int32 nColumn = 0; -for (auto & tableCell : tableRow.getTableCells()) +sal_Int32 nColumnSize = tableRow.getTableCells().size(); +sal_Int32 nRemovedColumn = 0; // + +for (sal_Int32 nColIndex = 0; nColIndex < nColumnSize; nColIndex++) { -TableCell& rTableCell(tableCell); -if ( !rTableCell.getvMerge() && !rTableCell.gethMerge() ) +TableCell& rTableCell(tableRow.getTableCells().at(nColIndex)); + +if (!rTableCell.getvMerge() && !rTableCell.gethMerge()) { -uno::Reference< XTable > xTable( xColumnRowRange, uno::UNO_QUERY_THROW ); -if ( ( rTableCell.getRowSpan() > 1 ) || ( rTableCell.getGridSpan() > 1 ) ) -MergeCells( xTable, nColumn, nRow, rTableCell.getGridSpan(), rTableCell.getRowSpan() ); +uno::Reference xTable(xColumnRowRange, uno::UNO_QUERY_THROW); +bool bMerged = false; -Reference< XCellRange > xCellRange( xTable, UNO_QUERY_THROW ); -rTableCell.pushToXCell( rFilterBase, pMasterTextListStyle, xCellRange->getCellByPosition( nColumn, nRow ), *this, rTableStyle, -nColumn, tableRow.getTableCells().size()-1, nRow, mvTableRows.size()-1 ); +if ((rTableCell.getRowSpan() > 1) || (rTableCell.getGridSpan() > 1)) +{ +MergeCells(xTable, nColumn, nRow, rTableCell.getGridSpan(), + rTableCell.getRowSpan()); + +if (rTableCell.getGridSpan() > 1) +{ +nRemovedColumn = (rTableCell.getGridSpan() - 1); +// MergeCells removes columns. Our loop does not know about those +// removed columns and we skip handling those removed columns. +nColIndex += nRemovedColumn; +// It will adjust new column number after push current column's +// props with pushToXCell. +bMerged = true; +} +} + +Reference xCellRange(xTable, UNO_QUERY_THROW); +
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source
oox/source/vml/vmlshape.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 5a5c54b755f09984ecc38bf1f800d185456128b3 Author: Caolán McNamara AuthorDate: Wed Feb 6 12:09:27 2019 + Commit: Michael Stahl CommitDate: Thu Feb 7 10:52:23 2019 +0100 fix assert seen on opening attachment from tdf#123163 I imagine it should have been seqPos-(idPos+2) seems to be like this since the initial commit of commit 091fe76b6329b4bb974987554369cbfadd8f2401 Date: Tue Jun 30 12:55:18 2015 +0300 tdf#87348 implement mso-next-textbox vml-style textbox chaining import Change-Id: Ic2f527ede2102c01c8589d58d8c705d59b0a6ffe Reviewed-on: https://gerrit.libreoffice.org/67453 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 4e48d2a015f9..b70edfc9102b 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -366,7 +366,8 @@ Reference< XShape > ShapeBase::convertAndInsert( const Reference< XShapes >& rxS sal_Int32 seqPos = sLinkChainName.indexOf("_s",idPos); if (idPos < seqPos) { -id = sLinkChainName.copy(idPos+2,seqPos-idPos+2).toInt32(); +auto idPosEnd = idPos+2; +id = sLinkChainName.copy(idPosEnd, seqPos - idPosEnd).toInt32(); seq = sLinkChainName.copy(seqPos+2).toInt32(); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sw/qa
oox/source/vml/vmlshapecontext.cxx |4 +++- sw/qa/extras/ooxmlexport/data/tdf122563.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport12.cxx | 11 +++ 3 files changed, 14 insertions(+), 1 deletion(-) New commits: commit d55cc244aba92f4e9fbdd7d51c65112075c6e8a8 Author: László Németh AuthorDate: Wed Jan 9 22:15:26 2019 +0100 Commit: Miklos Vajna CommitDate: Mon Jan 28 15:00:41 2019 +0100 tdf#122563 DOCX import: fix OLE size after roundtrip Embedded XLSX spreadsheets and other OLE objects became small in Writer after a roundtrip between LibO and MSO, caused by the empty drawing path of OLE shapes. Change-Id: I4cd39d4bcd6707cc5a3b8e40dde8c6148a20cabc Reviewed-on: https://gerrit.libreoffice.org/66053 Tested-by: Jenkins Reviewed-by: László Németh (cherry picked from commit bdb0177b550d27a541cdfc0668714b2e9ac28540) Reviewed-on: https://gerrit.libreoffice.org/66689 Reviewed-by: Miklos Vajna diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index f5f4bf884e31..621f20d29895 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -240,7 +240,9 @@ ContextHandlerRef ShapeContextBase::createShapeContext( ContextHandler2Helper co case VML_TOKEN( group ): return new GroupShapeContext( rParent, rShapes.createShape< GroupShape >(), rAttribs ); case VML_TOKEN( shape ): -if (rAttribs.hasAttribute(XML_path)) +if (rAttribs.hasAttribute(XML_path) && +// tdf#122563 skip in the case of empty path +!rAttribs.getString(XML_path, "").isEmpty()) return new ShapeContext( rParent, rShapes.createShape< BezierShape >(), rAttribs ); else return new ShapeContext( rParent, rShapes.createShape< ComplexShape >(), rAttribs ); diff --git a/sw/qa/extras/ooxmlexport/data/tdf122563.docx b/sw/qa/extras/ooxmlexport/data/tdf122563.docx new file mode 100644 index ..69168a382623 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf122563.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index 3e90ed1b4d9d..a91fe0c3b67b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -936,6 +936,17 @@ DECLARE_OOXMLEXPORT_TEST(testTdf99631, "tdf99631.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:object[1]", "dyaOrig", "768"); } +DECLARE_OOXMLEXPORT_TEST(testTdf122563, "tdf122563.docx") +{ +xmlDocPtr pXmlDoc = parseExport("word/document.xml"); +if (!pXmlDoc) +return; +assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object", 1); +// Size of the embedded OLE spreadsheet was the bad "width:28.35pt;height:28.35pt" +assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:object/v:shape", "style", +"width:255.75pt;height:63.75pt"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sw/qa
oox/source/drawingml/textcharacterpropertiescontext.cxx | 11 + sw/qa/extras/ooxmlimport/data/tdf121804.docx|binary sw/qa/extras/ooxmlimport/ooxmlimport2.cxx | 18 3 files changed, 29 insertions(+) New commits: commit 248ecee4ea28a3873cdd0ef0c1ef501537be961d Author: Miklos Vajna AuthorDate: Mon Dec 17 21:13:00 2018 +0100 Commit: Mike Kaganski CommitDate: Wed Dec 19 15:32:27 2018 +0100 tdf#121804 DOCX import: handle sub/superscript inside group shapes Regression from commit d5c934d150cb6cea5f96cbbee4fb5e8312bf027e (n#792778 DOCX import: parse group shapes in oox only, 2012-12-14), where where manual wordprocessingML -> drawingML translation did not handle this character property. Change-Id: I87481bc9c26651fd15dd39a58a92f467e8311256 Reviewed-on: https://gerrit.libreoffice.org/65289 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit dafbc86037d63e938967c0f501bdfe3ae19fa992) Reviewed-on: https://gerrit.libreoffice.org/65413 Tested-by: Xisco Faulí Reviewed-by: Mike Kaganski diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx index 2b63f9f5237b..236219d844cf 100644 --- a/oox/source/drawingml/textcharacterpropertiescontext.cxx +++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx @@ -205,6 +205,17 @@ ContextHandlerRef TextCharacterPropertiesContext::onCreateContext( sal_Int32 aEl mrTextCharacterProperties.moCaseMap = XML_none; } break; +case W_TOKEN(vertAlign): +{ +// Map wordprocessingML to drawingML +// . +sal_Int32 nVal = rAttribs.getToken(W_TOKEN(val), 0); +if (nVal == XML_superscript) +mrTextCharacterProperties.moBaseline = 3; +else if (nVal == XML_subscript) +mrTextCharacterProperties.moBaseline = -25000; +break; +} case OOX_TOKEN(w14, glow): case OOX_TOKEN(w14, shadow): case OOX_TOKEN(w14, reflection): diff --git a/sw/qa/extras/ooxmlimport/data/tdf121804.docx b/sw/qa/extras/ooxmlimport/data/tdf121804.docx new file mode 100644 index ..af3f0d247952 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf121804.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index 877a645da288..c1e353a9243b 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -222,6 +222,24 @@ DECLARE_OOXMLIMPORT_TEST(testTdf113946, "tdf113946.docx") CPPUNIT_ASSERT_EQUAL(OUString("1695"), aTop); } +DECLARE_OOXMLIMPORT_TEST(testTdf121804, "tdf121804.docx") +{ +uno::Reference xGroup(getShape(1), uno::UNO_QUERY); +uno::Reference xShape(xGroup->getByIndex(0), uno::UNO_QUERY); +uno::Reference xFirstPara = getParagraphOfText(1, xShape->getText()); +uno::Reference xFirstRun = getRun(xFirstPara, 1); +CPPUNIT_ASSERT_EQUAL(static_cast(0), + getProperty(xFirstRun, "CharEscapement")); +// This failed with a NoSuchElementException, super/subscript property was +// lost on import, so the whole paragraph was a single run. +uno::Reference xSecondRun = getRun(xFirstPara, 2); +CPPUNIT_ASSERT_EQUAL(static_cast(30), + getProperty(xSecondRun, "CharEscapement")); +uno::Reference xThirdRun = getRun(xFirstPara, 3); +CPPUNIT_ASSERT_EQUAL(static_cast(-25), + getProperty(xThirdRun, "CharEscapement")); +} + DECLARE_OOXMLIMPORT_TEST(testTdf114217, "tdf114217.docx") { uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sd/qa
oox/source/drawingml/diagram/layoutatomvisitors.cxx | 14 ++ oox/source/drawingml/diagram/layoutatomvisitors.hxx |2 ++ sd/qa/unit/import-tests-smartart.cxx|3 ++- 3 files changed, 18 insertions(+), 1 deletion(-) New commits: commit 467a2ab7e52be376ee7f0dee9bd44f7a4ed38267 Author: Miklos Vajna AuthorDate: Tue Nov 27 17:41:05 2018 +0100 Commit: Miklos Vajna CommitDate: Mon Dec 17 13:35:08 2018 +0100 oox smartart, accent process: handle followSib axis of forEach Currently the accept process document creates 0 connectors. Instead, it creates empty custom shapes: this commit fixes the loop, so that only one of them is created. The whole purpose of the follow sibling axis is that N - 1 connectors are created for N shapes, not N connectors. Change-Id: I54244c7615b83f607ef53a4ff8d01d3c9594856e Reviewed-on: https://gerrit.libreoffice.org/64122 Reviewed-by: Miklos Vajna Tested-by: Jenkins (cherry picked from commit aedc5427e4b6645ff3257e523c33190cf5e1934d) Reviewed-on: https://gerrit.libreoffice.org/65250 diff --git a/oox/source/drawingml/diagram/layoutatomvisitors.cxx b/oox/source/drawingml/diagram/layoutatomvisitors.cxx index 700b48080bc6..ced94784aff4 100644 --- a/oox/source/drawingml/diagram/layoutatomvisitors.cxx +++ b/oox/source/drawingml/diagram/layoutatomvisitors.cxx @@ -48,6 +48,14 @@ void ShapeCreationVisitor::visit(AlgAtom& rAtom) void ShapeCreationVisitor::visit(ForEachAtom& rAtom) { +if (rAtom.iterator().mnAxis == XML_followSib) +{ +// If the axis is the follow sibling, then the last atom should not be +// visited. +if (mnCurrIdx + mnCurrStep >= mnCurrCnt) +return; +} + const std::vector& rChildren=rAtom.getChildren(); sal_Int32 nChildren=1; @@ -67,7 +75,11 @@ void ShapeCreationVisitor::visit(ForEachAtom& rAtom) rAtom.iterator().mnCnt==-1 ? nChildren : rAtom.iterator().mnCnt); const sal_Int32 nOldIdx=mnCurrIdx; +const sal_Int32 nOldStep = mnCurrStep; +const sal_Int32 nOldCnt = mnCurrCnt; const sal_Int32 nStep=rAtom.iterator().mnStep; +mnCurrStep = nStep; +mnCurrCnt = nCnt; for( mnCurrIdx=0; mnCurrIdx0; mnCurrIdx+=nStep ) { // TODO there is likely some conditions @@ -77,6 +89,8 @@ void ShapeCreationVisitor::visit(ForEachAtom& rAtom) // and restore idx mnCurrIdx = nOldIdx; +mnCurrStep = nOldStep; +mnCurrCnt = nOldCnt; } void ShapeCreationVisitor::visit(ConditionAtom& rAtom) diff --git a/oox/source/drawingml/diagram/layoutatomvisitors.hxx b/oox/source/drawingml/diagram/layoutatomvisitors.hxx index 299739186315..f395f6a68668 100644 --- a/oox/source/drawingml/diagram/layoutatomvisitors.hxx +++ b/oox/source/drawingml/diagram/layoutatomvisitors.hxx @@ -33,6 +33,8 @@ class ShapeCreationVisitor : public LayoutAtomVisitor ShapePtr mpParentShape; const Diagram& mrDgm; sal_Int32 mnCurrIdx; +sal_Int32 mnCurrStep = 0; +sal_Int32 mnCurrCnt = 0; const dgm::Point* mpCurrentNode; void defaultVisit(LayoutAtom const & rAtom); diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index 7c46270015ee..aa8498b73ce9 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -458,7 +458,8 @@ void SdImportTestSmartArt::testAccentProcess() m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-accent-process.pptx"), PPTX); uno::Reference xGroup(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY); CPPUNIT_ASSERT(xGroup.is()); -CPPUNIT_ASSERT_EQUAL(static_cast(4), xGroup->getCount()); +// 3 children: first pair, connector, second pair. +CPPUNIT_ASSERT_EQUAL(static_cast(3), xGroup->getCount()); uno::Reference xGroupShape(xGroup, uno::UNO_QUERY); CPPUNIT_ASSERT(xGroupShape.is()); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sd/qa
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 1571c42e1fe64c6146161b08585737d3ba288629 Author: Miklos Vajna AuthorDate: Wed Nov 21 17:40:36 2018 +0100 Commit: Miklos Vajna CommitDate: Mon Dec 17 13:33:27 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 Tested-by: Jenkins (cherry picked from commit cfa76f538a44d4396574ece59e8a3953c22c6eb7) Reviewed-on: https://gerrit.libreoffice.org/65249 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 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(3), xSecondPair->getCount()); uno::Reference 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 xSecondParent(xSecondParentText, uno::UNO_QUERY); CPPUNIT_ASSERT(xSecondParent.is()); int nSecondParentLeft = xSecondParent->getPosition().X; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sd/qa
oox/source/drawingml/diagram/diagramlayoutatoms.cxx |2 +- sd/qa/unit/import-tests-smartart.cxx| 17 - 2 files changed, 17 insertions(+), 2 deletions(-) New commits: commit 8d6e14765145ab7c9cb0cbf6956eaf07db10139a Author: Miklos Vajna AuthorDate: Wed Nov 21 16:17:42 2018 +0100 Commit: Miklos Vajna CommitDate: Mon Dec 17 13:33:07 2018 +0100 oox smartart, accent process: fix overlapping shape pairs Linear algorithm had an idea how to take width from constrains, but that was unused for embedded child algorithms. Change-Id: If4c497e053ea0d134a1ffc529f1d233ec4fc50db Reviewed-on: https://gerrit.libreoffice.org/63725 Reviewed-by: Miklos Vajna Tested-by: Jenkins (cherry picked from commit 67e062aa5e5946d4985921fe2b6f87766f363ddc) Reviewed-on: https://gerrit.libreoffice.org/65248 diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index c053aa4c441a..bb5ed2ad7704 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -523,7 +523,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, aSize.Width *= fWidthScale; aCurrShape->setSize(aSize); -aCurrShape->setChildSize(aChildSize); +aCurrShape->setChildSize(aSize); aCurrPos.X += nIncX * (aSize.Width + fSpace*aSize.Width); aCurrPos.Y += nIncY * (aChildSize.Height + fSpace*aChildSize.Height); } diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index edb64c3ba600..f431cdddfa03 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -472,7 +472,7 @@ void SdImportTestSmartArt::testAccentProcess() CPPUNIT_ASSERT(xFirstParentText.is()); CPPUNIT_ASSERT_EQUAL(OUString("a"), xFirstParentText->getString()); uno::Reference xFirstParent(xFirstParentText, uno::UNO_QUERY); -CPPUNIT_ASSERT(xFirstParentText.is()); +CPPUNIT_ASSERT(xFirstParent.is()); int nFirstParentTop = xFirstParent->getPosition().Y; uno::Reference xFirstChildText(xFirstPair->getByIndex(2), uno::UNO_QUERY); @@ -481,6 +481,7 @@ void SdImportTestSmartArt::testAccentProcess() uno::Reference xFirstChild(xFirstChildText, uno::UNO_QUERY); CPPUNIT_ASSERT(xFirstChildText.is()); int nFirstChildTop = xFirstChild->getPosition().Y; +int nFirstChildRight = xFirstChild->getPosition().X + xFirstChild->getSize().Width; // First child is below the first parent. // Without the accompanying fix in place, this test would have failed with @@ -488,6 +489,20 @@ void SdImportTestSmartArt::testAccentProcess() // below xFirstParent (a good position is 9081). CPPUNIT_ASSERT_LESS(nFirstChildTop, nFirstParentTop); +uno::Reference xSecondPair(xGroup->getByIndex(2), uno::UNO_QUERY); +CPPUNIT_ASSERT(xSecondPair.is()); +CPPUNIT_ASSERT_EQUAL(static_cast(3), xSecondPair->getCount()); +uno::Reference xSecondParentText(xSecondPair->getByIndex(1), uno::UNO_QUERY); +CPPUNIT_ASSERT(xFirstParentText.is()); +CPPUNIT_ASSERT_EQUAL(OUString("c"), xSecondParentText->getString()); +uno::Reference xSecondParent(xSecondParentText, uno::UNO_QUERY); +CPPUNIT_ASSERT(xSecondParent.is()); +int nSecondParentLeft = xSecondParent->getPosition().X; +// Without the accompanying fix in place, this test would have failed with +// 'Expected less than: 12700; Actual : 18540', i.e. the "b" and "c" +// shapes overlapped. +CPPUNIT_ASSERT_LESS(nSecondParentLeft, nFirstChildRight); + xDocShRef->DoClose(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source sw/qa
oox/source/export/drawingml.cxx| 25 +++--- sw/qa/extras/ooxmlexport/data/Chart_Plot_BorderLine_Style.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 14 + 3 files changed, 32 insertions(+), 7 deletions(-) New commits: commit bd4e761cde3d42dfa37501e7f0c49e94beb917bf Author: Adam Kovacs AuthorDate: Thu Nov 15 13:36:45 2018 +0100 Commit: László Németh CommitDate: Fri Nov 30 12:51:33 2018 +0100 tdf#121435 OOXML export: fixing linestyle export in charts Fixing linestyle export of chart wall (plot area) and chart page. Change-Id: Id5265110352d393d9c3e01ff55cea0770d4e0cef Reviewed-on: https://gerrit.libreoffice.org/63418 Tested-by: Jenkins Reviewed-by: László Németh Tested-by: László Németh (cherry picked from commit 5bdc78f65da36d65e94de1e2dde5659f0563f08f) Reviewed-on: https://gerrit.libreoffice.org/64322 diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 58164ba4065a..a797adbc1f1e 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -671,15 +671,26 @@ void DrawingML::WriteOutline( const Reference& rXPropSet, Referenc aAny >>= aLineDash; } } -bDashSet = true; -if (aLineDash.Style == DashStyle_ROUND || aLineDash.Style == DashStyle_ROUNDRELATIVE) -{ -cap = "rnd"; +} +else +{ +//export the linestyle of chart wall (plot area) and chart page +OUString aLineDashName; +GET(aLineDashName, LineDashName); +if (!aLineDashName.isEmpty() && xModel) { +css::uno::Any aAny = getLineDash(xModel, aLineDashName); +aAny >>= aLineDash; } - -SAL_INFO("oox.shape", "dash dots: " << aLineDash.Dots << " dashes: " << aLineDash.Dashes -<< " dotlen: " << aLineDash.DotLen << " dashlen: " << aLineDash.DashLen << " distance: " << aLineDash.Distance); } +bDashSet = true; +if (aLineDash.Style == DashStyle_ROUND || aLineDash.Style == DashStyle_ROUNDRELATIVE) +{ +cap = "rnd"; +} + +SAL_INFO("oox.shape", "dash dots: " << aLineDash.Dots << " dashes: " << aLineDash.Dashes +<< " dotlen: " << aLineDash.DotLen << " dashlen: " << aLineDash.DashLen << " distance: " << aLineDash.Distance); + SAL_FALLTHROUGH; case drawing::LineStyle_SOLID: default: diff --git a/sw/qa/extras/ooxmlexport/data/Chart_Plot_BorderLine_Style.docx b/sw/qa/extras/ooxmlexport/data/Chart_Plot_BorderLine_Style.docx new file mode 100755 index ..d1f0f97f1063 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/Chart_Plot_BorderLine_Style.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index c4a76e33ad92..e40a6bfc4cd6 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -736,6 +736,20 @@ DECLARE_OOXMLEXPORT_TEST(testChart_BorderLine_Style, "Chart_BorderLine_Style.doc assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[3]/c:spPr/a:ln/a:prstDash", "val", "dash"); } +DECLARE_OOXMLEXPORT_TEST(testChart_Plot_BorderLine_Style, "Chart_Plot_BorderLine_Style.docx") +{ +/* DOCX containing Chart wall (plot area) and Chart Page with BorderLine Style as Dash Type + * should get preserved inside an XML tag with value "dash", "sysDot, "lgDot", etc. + */ +xmlDocPtr pXmlDoc = parseExport("word/charts/chart1.xml"); +if (!pXmlDoc) +return; + +assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:ln/a:prstDash", "val", "lgDashDot"); +assertXPath(pXmlDoc, "/c:chartSpace/c:spPr/a:ln/a:prstDash", "val", "sysDash"); + +} + DECLARE_OOXMLEXPORT_TEST(testTrackChangesDeletedEmptyParagraph, "testTrackChangesDeletedEmptyParagraph.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source
oox/source/drawingml/chart/seriesconverter.cxx | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) New commits: commit ef921ee138d563706bd2f3edeb13f737fabe03ec Author: Markus Mohrhard AuthorDate: Fri Nov 30 00:45:57 2018 +0100 Commit: Markus Mohrhard CommitDate: Fri Nov 30 08:30:52 2018 +0100 tdf#121282, tdf#121279, set text properties also on complex data labels Change-Id: I2304b6050b786b6e4a9a8a968d7a4846d9da8be8 Reviewed-on: https://gerrit.libreoffice.org/64306 Tested-by: Jenkins Reviewed-by: Markus Mohrhard (cherry picked from commit 6a04b9298ae993881d20fc4b5aa91516d4df6695) Reviewed-on: https://gerrit.libreoffice.org/64308 diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index 241b8a4e506a..716a0b234bdd 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -124,6 +124,14 @@ Reference< XLabeledDataSequence > lclCreateLabeledDataSequence( return xLabeledSeq; } +void convertTextProperty(PropertySet& rPropSet, ObjectFormatter& rFormatter, +DataLabelModelBase::TextBodyRef xTextProps) +{ +rFormatter.convertTextFormatting( rPropSet, xTextProps, OBJECTTYPE_DATALABEL ); +ObjectFormatter::convertTextRotation( rPropSet, xTextProps, false ); +ObjectFormatter::convertTextWrap( rPropSet, xTextProps ); +} + void lclConvertLabelFormatting( PropertySet& rPropSet, ObjectFormatter& rFormatter, const DataLabelModelBase& rDataLabel, const TypeGroupConverter& rTypeGroup, bool bDataSeriesLabel, bool bMSO2007Doc, const PropertySet* pSeriesPropSet ) @@ -171,10 +179,7 @@ void lclConvertLabelFormatting( PropertySet& rPropSet, ObjectFormatter& rFormatt rFormatter.convertNumberFormat( rPropSet, rDataLabel.maNumberFormat, false, bShowPercent ); // data label text formatting (frame formatting not supported by Chart2) -rFormatter.convertTextFormatting( rPropSet, rDataLabel.mxTextProp, OBJECTTYPE_DATALABEL ); -ObjectFormatter::convertTextRotation( rPropSet, rDataLabel.mxTextProp, false ); -ObjectFormatter::convertTextWrap( rPropSet, rDataLabel.mxTextProp ); - +convertTextProperty(rPropSet, rFormatter, rDataLabel.mxTextProp); // data label separator (do not overwrite series separator, if no explicit point separator is present) if( bDataSeriesLabel || rDataLabel.moaSeparator.has() ) @@ -338,6 +343,7 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat } aPropSet.setProperty( PROP_CustomLabelFields, makeAny( aSequence ) ); +convertTextProperty(aPropSet, getFormatter(), mrModel.mxText->mxTextBody); } } catch( Exception& ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source
oox/source/drawingml/chart/seriesconverter.cxx |4 1 file changed, 4 insertions(+) New commits: commit 268364e35100b559f42d8c02b930c5cca1c84be7 Author: Markus Mohrhard AuthorDate: Mon Nov 19 00:13:36 2018 +0100 Commit: Markus Mohrhard CommitDate: Mon Nov 19 03:42:20 2018 +0100 tdf#104579, if no data point shape props are set take the series props Change-Id: Ia2c0d6b05385a0f3900e20ef807b869e4098654c Reviewed-on: https://gerrit.libreoffice.org/63541 Tested-by: Jenkins Reviewed-by: Markus Mohrhard (cherry picked from commit afe5e1f8de0a25364c8c98b453cfe831330c4eed) Reviewed-on: https://gerrit.libreoffice.org/63543 diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index 811ee06497b2..241b8a4e506a 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -639,6 +639,10 @@ void DataPointConverter::convertFromModel( const Reference< XDataSeries >& rxDat else getFormatter().convertFrameFormatting( aPropSet, mrModel.mxShapeProp, rTypeGroup.getSeriesObjectType(), rSeries.mnIndex ); } +else if (rSeries.mxShapeProp.is()) +{ +getFormatter().convertFrameFormatting( aPropSet, rSeries.mxShapeProp, rTypeGroup.getSeriesObjectType(), rSeries.mnIndex ); +} } catch( Exception& ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - oox/source
oox/source/drawingml/chart/seriescontext.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 388fd9918c0a2cf5f72bbb14aa8d22cc99681c0d Author: Markus Mohrhard AuthorDate: Sun Nov 18 04:37:02 2018 +0100 Commit: Markus Mohrhard CommitDate: Mon Nov 19 02:06:48 2018 +0100 tdf#102186, don't overwrite the deleted flag Change-Id: I3cc69a0baebc55ad52b64960657e9daa4be8f39d Reviewed-on: https://gerrit.libreoffice.org/63510 Tested-by: Jenkins Reviewed-by: Markus Mohrhard (cherry picked from commit 4bd2e57653ce22044ab984b06c84f22ef287cecf) Reviewed-on: https://gerrit.libreoffice.org/63512 diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx index a6763ad2fb74..10e3af70108f 100644 --- a/oox/source/drawingml/chart/seriescontext.cxx +++ b/oox/source/drawingml/chart/seriescontext.cxx @@ -93,6 +93,7 @@ void lclDataLabelSharedCharacters( ContextHandler2 const & rContext, const OUStr DataLabelContext::DataLabelContext( ContextHandler2Helper& rParent, DataLabelModel& rModel ) : ContextBase< DataLabelModel >( rParent, rModel ) { +mrModel.mbDeleted = false; } DataLabelContext::~DataLabelContext() @@ -101,7 +102,6 @@ DataLabelContext::~DataLabelContext() ContextHandlerRef DataLabelContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) { -mrModel.mbDeleted = false; if( isRootElement() ) switch( nElement ) { case C_TOKEN( idx ): @@ -124,6 +124,7 @@ void DataLabelContext::onCharacters( const OUString& rChars ) DataLabelsContext::DataLabelsContext( ContextHandler2Helper& rParent, DataLabelsModel& rModel ) : ContextBase< DataLabelsModel >( rParent, rModel ) { +mrModel.mbDeleted = false; } DataLabelsContext::~DataLabelsContext() @@ -132,7 +133,6 @@ DataLabelsContext::~DataLabelsContext() ContextHandlerRef DataLabelsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) { -mrModel.mbDeleted = false; bool bMSO2007Doc = getFilter().isMSO2007Document(); if( isRootElement() ) switch( nElement ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits