chart2/source/view/main/ShapeFactory.cxx | 5 ++++- sw/qa/extras/layout/data/tdf122014.docx |binary sw/qa/extras/layout/layout.cxx | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-)
New commits: commit 7f347ba951cb6ddc7933de25007864e0f6d2d53e Author: Tünde Tóth <tund...@gmail.com> AuthorDate: Tue Jul 7 10:50:24 2020 +0200 Commit: Gabor Kelemen <kelemen.gab...@nisz.hu> CommitDate: Fri Jul 31 13:27:43 2020 +0200 tdf#122014 Chart OOXML import: set chart title alignment to center Regression from commit: d4190685ac208677bc77f66976287dda0360c42d (tdf#114836, only set changed SfxItemSet properties) Change-Id: If33fa39019bbd36632d15eb3cc0606727e58b111 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98241 Tested-by: Jenkins Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> (cherry picked from commit f6fc6ab2a2792c22a3e74cce83ac7d19c820c9b4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98753 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 944892091ad30c5da192b20d189c7a4388b0c91d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99840 Tested-by: Gabor Kelemen <kelemen.gab...@nisz.hu> Reviewed-by: Gabor Kelemen <kelemen.gab...@nisz.hu> diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index 8716550d1810..9627fd5bf98f 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -43,6 +43,7 @@ #include <com/sun/star/graphic/XGraphic.hpp> #include <com/sun/star/drawing/XShapes.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/text/XText.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/uno/Any.hxx> @@ -2406,7 +2407,7 @@ uno::Reference< drawing::XShape > aValueMap.insert( { "TextVerticalAdjust", uno::Any(drawing::TextVerticalAdjust_CENTER) } ); //drawing::TextVerticalAdjust aValueMap.insert( { "TextAutoGrowHeight", uno::Any(true) } ); // sal_Bool aValueMap.insert( { "TextAutoGrowWidth", uno::Any(true) } ); // sal_Bool - aValueMap.insert({ "TextMaximumFrameWidth", uno::Any(nTextMaxWidth) }); // sal_Int32 + aValueMap.insert( { "TextMaximumFrameWidth", uno::Any(nTextMaxWidth) } ); // sal_Int32 //set name/classified ObjectID (CID) if( !aName.isEmpty() ) @@ -2506,6 +2507,8 @@ uno::Reference< drawing::XShape > aM.rotate( -basegfx::deg2rad(nRotation) );//#i78696#->#i80521# aM.translate( nXPos, nYPos ); xShapeProp->setPropertyValue( "Transformation", uno::Any( B2DHomMatrixToHomogenMatrix3(aM) ) ); + + xShapeProp->setPropertyValue( "ParaAdjust", uno::Any( style::ParagraphAdjust_CENTER ) ); } catch( const uno::Exception& ) { diff --git a/sw/qa/extras/layout/data/tdf122014.docx b/sw/qa/extras/layout/data/tdf122014.docx new file mode 100644 index 000000000000..400939495984 Binary files /dev/null and b/sw/qa/extras/layout/data/tdf122014.docx differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index f7d534e2aa69..c5de691dc49e 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -2676,6 +2676,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf132956) "Category 1"); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122014) +{ + SwDoc* pDoc = createDoc("tdf122014.docx"); + SwDocShell* pShell = pDoc->GetDocShell(); + + // Dump the rendering of the first page as an XML file. + std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); + MetafileXmlDump dumper; + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + CPPUNIT_ASSERT(pXmlDoc); + + // This failed, if the chart title is aligned to left. + sal_Int32 nX1 = getXPath(pXmlDoc, "//textarray[13]", "x").toInt32(); + sal_Int32 nX2 = getXPath(pXmlDoc, "//textarray[14]", "x").toInt32(); + CPPUNIT_ASSERT_GREATER(nX1 + 100, nX2); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf134235) { SwDoc* pDoc = createDoc("tdf134235.docx"); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits