[Libreoffice-commits] core.git: chart2/qa oox/source

PriyankaGaikwad priyanka.gaikwad at synerzip.com
Sun Mar 2 13:22:15 PST 2014


 chart2/qa/extras/chart2import.cxx        |   10 +++++++---
 chart2/qa/extras/data/docx/barChart.docx |binary
 oox/source/helper/propertymap.cxx        |    7 +++++--
 3 files changed, 12 insertions(+), 5 deletions(-)

New commits:
commit 0b6a1f2afa7954afcf1f27b066169455ed6cff7a
Author: PriyankaGaikwad <priyanka.gaikwad at synerzip.com>
Date:   Wed Feb 19 17:08:02 2014 +0530

    fdo#75200:Libreoffice crash while opening the file
    
    Conflicts:
    	chart2/qa/extras/chart2import.cxx
    
    Change-Id: Icb2a5bc43ef5fd0f307b43bbe8aaf892a043dc5b
    Reviewed-on: https://gerrit.libreoffice.org/8127
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 2d4259b..17940fe 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -34,6 +34,7 @@ public:
     void testPPTChartSeries();
     void testODPChartSeries();
     void testBnc864396();
+    void testChartFileOpen();
 
     CPPUNIT_TEST_SUITE(Chart2ImportTest);
     CPPUNIT_TEST(Fdo60083);
@@ -45,6 +46,7 @@ public:
     CPPUNIT_TEST(testODTChartSeries);
     CPPUNIT_TEST(testDOCChartSeries);
     CPPUNIT_TEST(testDOCXChartSeries);
+    CPPUNIT_TEST(testChartFileOpen);
 /*
  *  Disabling Impress Uts.
  *  ChartTest::tearDown() calls dispose of mxComponent
@@ -260,7 +262,6 @@ void Chart2ImportTest::testPPTChartSeries()
     CPPUNIT_ASSERT_EQUAL(OUString("Column 1"), seriesList[0]);
     CPPUNIT_ASSERT_EQUAL(OUString("Column 2"), seriesList[1]);
     CPPUNIT_ASSERT_EQUAL(OUString("Column 3"), seriesList[2]);
-
 }
 
 void Chart2ImportTest::testPPTXChartSeries()
@@ -270,7 +271,6 @@ void Chart2ImportTest::testPPTXChartSeries()
     CPPUNIT_ASSERT_EQUAL(OUString("Column 1"), seriesList[1]);
     CPPUNIT_ASSERT_EQUAL(OUString("Column 2"), seriesList[2]);
     CPPUNIT_ASSERT_EQUAL(OUString("Column 3"), seriesList[3]);
-
 }
 
 void Chart2ImportTest::testODPChartSeries()
@@ -280,7 +280,6 @@ void Chart2ImportTest::testODPChartSeries()
     CPPUNIT_ASSERT_EQUAL(OUString("Column 1"), seriesList[0]);
     CPPUNIT_ASSERT_EQUAL(OUString("Column 2"), seriesList[1]);
     CPPUNIT_ASSERT_EQUAL(OUString("Column 3"), seriesList[2]);
-
 }
 
 void Chart2ImportTest::testBnc864396()
@@ -298,6 +297,11 @@ void Chart2ImportTest::testBnc864396()
     }
 }
 
+void Chart2ImportTest::testChartFileOpen()
+{
+    load("/chart2/qa/extras/data/docx/", "barChart.docx");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/docx/barChart.docx b/chart2/qa/extras/data/docx/barChart.docx
new file mode 100644
index 0000000..9b9152b
Binary files /dev/null and b/chart2/qa/extras/data/docx/barChart.docx differ
diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx
index ab37dd3..cd84da0 100644
--- a/oox/source/helper/propertymap.cxx
+++ b/oox/source/helper/propertymap.cxx
@@ -243,8 +243,11 @@ void PropertyMap::fillSequences( Sequence< OUString >& rNames, Sequence< Any >&
         for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt, ++pNames, ++pValues )
         {
             OSL_ENSURE( (0 <= aIt->first) && (aIt->first < PROP_COUNT), "PropertyMap::fillSequences - invalid property identifier" );
-            *pNames = (*mpPropNames)[ aIt->first ];
-            *pValues = aIt->second;
+            if((sal_uInt32)aIt->first <= mpPropNames->size())
+            {
+               *pNames = (*mpPropNames)[ aIt->first ];
+               *pValues = aIt->second;
+            }
         }
     }
 }


More information about the Libreoffice-commits mailing list