diff options
-rw-r--r-- | chart2/source/controller/main/PositionAndSizeHelper.cxx | 1 | ||||
-rw-r--r-- | chart2/source/view/main/VLegend.cxx | 36 | ||||
-rw-r--r-- | sw/qa/extras/layout/data/tdf115630.docx | bin | 0 -> 26224 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 25 |
4 files changed, 43 insertions, 19 deletions
diff --git a/chart2/source/controller/main/PositionAndSizeHelper.cxx b/chart2/source/controller/main/PositionAndSizeHelper.cxx index 40972d47c3f4..d9100c839a14 100644 --- a/chart2/source/controller/main/PositionAndSizeHelper.cxx +++ b/chart2/source/controller/main/PositionAndSizeHelper.cxx @@ -72,7 +72,6 @@ bool PositionAndSizeHelper::moveObject( ObjectType eObjectType } else if(eObjectType==OBJECTTYPE_LEGEND) { - xObjectProp->setPropertyValue( "AnchorPosition", uno::Any(LegendPosition_CUSTOM)); xObjectProp->setPropertyValue( "Expansion", uno::Any(css::chart::ChartLegendExpansion_CUSTOM)); chart2::RelativePosition aRelativePosition; chart2::RelativeSize aRelativeSize; diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx index c8edeeed00a0..df5ca49cea74 100644 --- a/chart2/source/view/main/VLegend.cxx +++ b/chart2/source/view/main/VLegend.cxx @@ -701,29 +701,29 @@ awt::Point lcl_calculatePositionAndRemainingSpace( switch( ePos ) { case LegendPosition_LINE_START: - { - sal_Int32 nExtent = aLegendSize.Width; - rRemainingSpace.Width -= ( nExtent + nXDistance ); - rRemainingSpace.X += ( nExtent + nXDistance ); - } + { + sal_Int32 nExtent = aLegendSize.Width; + rRemainingSpace.Width -= ( nExtent + nXDistance ); + rRemainingSpace.X += ( nExtent + nXDistance ); + } break; case LegendPosition_LINE_END: - { - rRemainingSpace.Width -= ( aLegendSize.Width + nXDistance ); - } - break; + { + rRemainingSpace.Width -= ( aLegendSize.Width + nXDistance ); + } + break; case LegendPosition_PAGE_START: - { - sal_Int32 nExtent = aLegendSize.Height; - rRemainingSpace.Height -= ( nExtent + nYDistance ); - rRemainingSpace.Y += ( nExtent + nYDistance ); - } + { + sal_Int32 nExtent = aLegendSize.Height; + rRemainingSpace.Height -= ( nExtent + nYDistance ); + rRemainingSpace.Y += ( nExtent + nYDistance ); + } break; case LegendPosition_PAGE_END: - { - rRemainingSpace.Height -= ( aLegendSize.Height + nYDistance ); - } - break; + { + rRemainingSpace.Height -= ( aLegendSize.Height + nYDistance ); + } + break; default: // nothing diff --git a/sw/qa/extras/layout/data/tdf115630.docx b/sw/qa/extras/layout/data/tdf115630.docx Binary files differnew file mode 100644 index 000000000000..e9f6339a1242 --- /dev/null +++ b/sw/qa/extras/layout/data/tdf115630.docx diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 89df9aa18d90..d1517323b581 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -2285,6 +2285,31 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf75659) // These failed, if the legend names are empty strings. } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf115630) +{ + SwDoc* pDoc = createDoc("tdf115630.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; + xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + CPPUNIT_ASSERT(pXmlDoc); + + // Test wide of inner chart area. + sal_Int32 nXRight + = getXPath(pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[3]/polyline[1]/point[1]", + "x") + .toInt32(); + sal_Int32 nXLeft + = getXPath(pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[3]/polyline[1]/point[2]", + "x") + .toInt32(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2886), nXRight - nXLeft); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf108021) { SwDoc* pDoc = createDoc("tdf108021.odt"); |