diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2018-01-29 23:47:39 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-30 09:28:27 +0100 |
commit | 85a7a319bfffb1f709ed504cfadea3bbef077ec1 (patch) | |
tree | bf64a7551bd0fd2905538144f1449cf5c265b539 | |
parent | 7655001a65a250ea7cd70f2efcc78037b5a9813f (diff) |
Revert "tdf#114821 calculate correct label position"
This reverts commit 1ede9f7ff6f2250fa2c75bc4dc099246a59dcec0, because it
caused division-by-zero errors, see comment at
<https://gerrit.libreoffice.org/#/c/48242/6> "tdf#114821 calculate
correct label position".
Change-Id: Ifca811bda04721898387b4799de2d2da31290fa0
Reviewed-on: https://gerrit.libreoffice.org/48860
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | oox/source/drawingml/chart/seriesconverter.cxx | 4 | ||||
-rw-r--r-- | sd/qa/unit/data/pptx/tdf114821.pptx | bin | 50178 -> 0 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 38 |
3 files changed, 2 insertions, 40 deletions
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index 7c53c712bd88..08f716e514f0 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -260,8 +260,8 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat csscd::BOTTOM_LEFT, csscd::BOTTOM, csscd::BOTTOM_RIGHT }; const double nMax=std::max( - fabs(mrModel.mxLayout->mfW), - fabs(mrModel.mxLayout->mfH)); + fabs(mrModel.mxLayout->mfX), + fabs(mrModel.mxLayout->mfY)); const int simplifiedX=lclSgn(mrModel.mxLayout->mfX/nMax); const int simplifiedY=lclSgn(mrModel.mxLayout->mfY/nMax); aPropSet.setProperty( PROP_LabelPlacement, diff --git a/sd/qa/unit/data/pptx/tdf114821.pptx b/sd/qa/unit/data/pptx/tdf114821.pptx Binary files differdeleted file mode 100644 index 3399b31313e7..000000000000 --- a/sd/qa/unit/data/pptx/tdf114821.pptx +++ /dev/null diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 71b18c2e3a4a..3993d0bf33bc 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -56,7 +56,6 @@ #include <com/sun/star/animations/XAnimationNode.hpp> #include <com/sun/star/animations/XAnimate.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/chart/DataLabelPlacement.hpp> #include <com/sun/star/chart/XChartDocument.hpp> #include <com/sun/star/chart2/XChartDocument.hpp> #include <com/sun/star/chart2/XDataSeriesContainer.hpp> @@ -173,7 +172,6 @@ public: void testTdf90626(); void testTdf114488(); void testTdf114913(); - void testTdf114821(); bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected); void testPatternImport(); @@ -250,7 +248,6 @@ public: CPPUNIT_TEST(testTdf90626); CPPUNIT_TEST(testTdf114488); CPPUNIT_TEST(testTdf114913); - CPPUNIT_TEST(testTdf114821); CPPUNIT_TEST_SUITE_END(); }; @@ -2333,41 +2330,6 @@ void SdImportTest::testTdf114913() xDocShRef->DoClose(); } -void SdImportTest::testTdf114821() -{ - css::uno::Any aAny; - sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc( "/sd/qa/unit/data/pptx/tdf114821.pptx" ), PPTX ); - - uno::Reference< beans::XPropertySet > xPropSet( getShapeFromPage( 0, 0, xDocShRef ) ); - aAny = xPropSet->getPropertyValue( "Model" ); - CPPUNIT_ASSERT_MESSAGE( "The shape doesn't have the property", aAny.hasValue() ); - - uno::Reference< chart::XChartDocument > xChartDoc; - aAny >>= xChartDoc; - CPPUNIT_ASSERT_MESSAGE( "failed to load chart", xChartDoc.is() ); - uno::Reference< chart2::XChartDocument > xChart2Doc( xChartDoc, uno::UNO_QUERY ); - CPPUNIT_ASSERT_MESSAGE( "failed to load chart", xChart2Doc.is() ); - - uno::Reference< chart2::XCoordinateSystemContainer > xBCooSysCnt( xChart2Doc->getFirstDiagram(), uno::UNO_QUERY ); - uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysSeq( xBCooSysCnt->getCoordinateSystems() ); - uno::Reference< chart2::XChartTypeContainer > xCTCnt( aCooSysSeq[0], uno::UNO_QUERY ); - - uno::Reference< chart2::XDataSeriesContainer > xDSCnt( xCTCnt->getChartTypes()[0], uno::UNO_QUERY ); - CPPUNIT_ASSERT_MESSAGE( "failed to load data series", xDSCnt.is() ); - uno::Sequence< uno::Reference< chart2::XDataSeries > > aSeriesSeq( xDSCnt->getDataSeries() ); - CPPUNIT_ASSERT_EQUAL_MESSAGE( "Invalid Series count", static_cast<sal_Int32>( 1 ), aSeriesSeq.getLength() ); - - const css::uno::Reference< css::beans::XPropertySet >& rPropSet0( aSeriesSeq[0]->getDataPointByIndex( 0 ) ); - CPPUNIT_ASSERT( rPropSet0.is() ); - - // Check the first label - sal_Int32 aPlacement; - rPropSet0->getPropertyValue( "LabelPlacement" ) >>= aPlacement; - CPPUNIT_ASSERT_EQUAL( css::chart::DataLabelPlacement::TOP_LEFT, aPlacement ); - - xDocShRef->DoClose(); -} - CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |