[Libreoffice-commits] core.git: 3 commits - chart2/qa chart2/source sd/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Sat Feb 22 17:00:30 PST 2014
chart2/qa/extras/chart2import.cxx | 23 ++++++++++++++++++++---
chart2/qa/extras/charttest.hxx | 15 ++++++++++++---
chart2/qa/extras/data/pptx/bnc864396.pptx |binary
chart2/source/view/main/PropertyMapper.cxx | 6 +++---
sd/source/ui/unoidl/unomodel.cxx | 2 +-
5 files changed, 36 insertions(+), 10 deletions(-)
New commits:
commit 5071777ad3e4e86704b946d70381ade3900ed1fb
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Feb 23 00:19:03 2014 +0100
disable this performance improvement
Somehow there is a bug. Might be an internal OPropertySet problem as I
can't find it in my new code.
Change-Id: I6658fa82f4158ef114baf80b8d9ed9ec44793d35
diff --git a/chart2/source/view/main/PropertyMapper.cxx b/chart2/source/view/main/PropertyMapper.cxx
index edd74c1..05e874b 100644
--- a/chart2/source/view/main/PropertyMapper.cxx
+++ b/chart2/source/view/main/PropertyMapper.cxx
@@ -81,14 +81,14 @@ void PropertyMapper::getValueMap(
tPropertyNameMap::const_iterator aEnd( rNameMap.end() );
uno::Reference< beans::XMultiPropertySet > xMultiPropSet(xSourceProp, uno::UNO_QUERY);
- if(xMultiPropSet.is())
+ if(false && xMultiPropSet.is())
{
uno::Sequence< rtl::OUString > aPropSourceNames(rNameMap.size());
uno::Sequence< rtl::OUString > aPropTargetNames(rNameMap.size());
for(sal_Int32 i = 0; aIt != aEnd; ++aIt, ++i)
{
- aPropSourceNames[i] = aIt->first;
- aPropTargetNames[i] = aIt->second;
+ aPropTargetNames[i] = aIt->first;
+ aPropSourceNames[i] = aIt->second;
}
uno::Sequence< uno::Any > xValues = xMultiPropSet->getPropertyValues(aPropSourceNames);
commit 391220ef21d7d99a968437893ee1e783cdcdaf59
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Feb 22 21:14:22 2014 +0100
add test for bnc#864396
Change-Id: I38d77a11acf6684cb583ba3e5ffb80f30f3f2fdc
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 9ca95b6..2d4259b 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -33,6 +33,7 @@ public:
void testPPTXChartSeries();
void testPPTChartSeries();
void testODPChartSeries();
+ void testBnc864396();
CPPUNIT_TEST_SUITE(Chart2ImportTest);
CPPUNIT_TEST(Fdo60083);
@@ -50,9 +51,10 @@ public:
* this causes the UT to crash in sd.
* sd::DrawView::Notify tries to reset by calling sd::DrawViewShell::ResetActualPage
*/
-// CPPUNIT_TEST(testPPTChartSeries);
-// CPPUNIT_TEST(testPPTXChartSeries);
-// CPPUNIT_TEST(testODPChartSeries);
+ CPPUNIT_TEST(testPPTChartSeries);
+ CPPUNIT_TEST(testPPTXChartSeries);
+ CPPUNIT_TEST(testODPChartSeries);
+ CPPUNIT_TEST(testBnc864396);
CPPUNIT_TEST_SUITE_END();
private:
@@ -281,6 +283,21 @@ void Chart2ImportTest::testODPChartSeries()
}
+void Chart2ImportTest::testBnc864396()
+{
+ uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromImpress("/chart2/qa/extras/data/pptx/", "bnc864396.pptx"), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xChartDoc->hasInternalDataProvider());
+
+ uno::Reference< chart2::XInternalDataProvider > xDataProvider( xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW );
+ uno::Reference< chart::XChartDataArray > xChartDataArray(xDataProvider, uno::UNO_QUERY_THROW);
+ uno::Sequence< OUString > aRowLabels = xChartDataArray->getRowDescriptions();
+ for(sal_Int32 i = 0; i < aRowLabels.getLength(); ++i)
+ {
+ OUString aExpected = OUString("cat") + OUString::number(i+1);
+ CPPUNIT_ASSERT_EQUAL(aExpected, aRowLabels[i]);
+ }
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index def88c3..68b4c88 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -58,6 +58,8 @@ public:
uno::Sequence < OUString > getImpressChartColumnDescriptions( const char* pDir, const char* pName );
OUString getFileExtension( const OUString& rFileName );
+ uno::Reference< chart::XChartDocument > getChartDocFromImpress( const char* pDir, const char* pName );
+
void loadDocx(const char* pDir, const char* pName);
utl::TempFile reloadDocx();
virtual void setUp();
@@ -215,7 +217,7 @@ uno::Sequence < OUString > getWriterChartColumnDescriptions( Reference< lang::XC
return seriesList;
}
-uno::Sequence < OUString > ChartTest::getImpressChartColumnDescriptions( const char* pDir, const char* pName )
+uno::Reference< chart::XChartDocument > ChartTest::getChartDocFromImpress( const char* pDir, const char* pName )
{
mxComponent = loadFromDesktop(getURLFromSrc(pDir) + OUString::createFromAscii(pName), "com.sun.star.comp.Draw.PresentationDocument");
uno::Reference< drawing::XDrawPagesSupplier > xDoc(mxComponent, uno::UNO_QUERY_THROW );
@@ -228,8 +230,15 @@ uno::Sequence < OUString > ChartTest::getImpressChartColumnDescriptions( const c
uno::Reference< frame::XModel > xDocModel;
xShapeProps->getPropertyValue("Model") >>= xDocModel;
CPPUNIT_ASSERT(xDocModel.is());
- uno::Reference< chart::XChartDocument > xChart1Doc( xDocModel, uno::UNO_QUERY_THROW );
- uno::Reference< chart::XChartDataArray > xChartData ( xChart1Doc->getData(), uno::UNO_QUERY_THROW);
+ uno::Reference< chart::XChartDocument > xChartDoc( xDocModel, uno::UNO_QUERY_THROW );
+
+ return xChartDoc;
+}
+
+uno::Sequence < OUString > ChartTest::getImpressChartColumnDescriptions( const char* pDir, const char* pName )
+{
+ uno::Reference< chart::XChartDocument > xChartDoc = getChartDocFromImpress( pDir, pName );
+ uno::Reference< chart::XChartDataArray > xChartData ( xChartDoc->getData(), uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT(xChartData.is());
uno::Sequence < OUString > seriesList = xChartData->getColumnDescriptions();
return seriesList;
diff --git a/chart2/qa/extras/data/pptx/bnc864396.pptx b/chart2/qa/extras/data/pptx/bnc864396.pptx
new file mode 100644
index 0000000..e2e05c5
Binary files /dev/null and b/chart2/qa/extras/data/pptx/bnc864396.pptx differ
commit 599472a13e3c5ba669d995c913ad415bd674a16c
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Feb 22 21:06:05 2014 +0100
at least fix the crash when calling SdXImpressDocument::dispose for now
Can an experienced Impress developer please check the crash?
Change-Id: I84f532dde6aa61b997b949f6d7ef55026ced604c
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 36597d6..27b3236 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2250,8 +2250,8 @@ void SAL_CALL SdXImpressDocument::dispose() throw (::com::sun::star::uno::Runtim
// that dispose() is called again. It is important to forward this
// second dispose() to the base class, too.
// As a consequence the following code has to be able to be run twice.
- SfxBaseModel::dispose();
mbDisposed = true;
+ SfxBaseModel::dispose();
uno::Reference< container::XNameAccess > xStyles(mxStyleFamilies);
if( xStyles.is() )
More information about the Libreoffice-commits
mailing list