summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chart2/qa/extras/chart2import.cxx12
-rwxr-xr-xchart2/qa/extras/data/xlsx/tdf100084.xlsxbin0 -> 10070 bytes
-rw-r--r--oox/source/core/xmlfilterbase.cxx14
3 files changed, 25 insertions, 1 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 4510ac447487..affab028f46e 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -70,6 +70,7 @@ public:
void testTdf105517();
void testTdf106217();
void testTdf108021();
+ void testTdf100084();
void testAutoBackgroundXLSX();
void testAutoChartAreaBorderPropXLSX();
void testChartAreaStyleBackgroundXLSX();
@@ -158,6 +159,7 @@ public:
CPPUNIT_TEST(testTdf105517);
CPPUNIT_TEST(testTdf106217);
CPPUNIT_TEST(testTdf108021);
+ CPPUNIT_TEST(testTdf100084);
CPPUNIT_TEST(testAutoBackgroundXLSX);
CPPUNIT_TEST(testAutoChartAreaBorderPropXLSX);
CPPUNIT_TEST(testChartAreaStyleBackgroundXLSX);
@@ -883,6 +885,16 @@ void Chart2ImportTest::testTdf108021()
CPPUNIT_ASSERT(bTextBreak);
}
+void Chart2ImportTest::testTdf100084()
+{
+ // The test file was created with IBM Cognos, so just check there is a diagram.
+ load("/chart2/qa/extras/data/xlsx/", "tdf100084.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+ Reference<beans::XPropertySet> xDiagram(xChartDoc->getFirstDiagram(), UNO_QUERY);
+ CPPUNIT_ASSERT_MESSAGE("There should be a Diagram.", xDiagram.is());
+}
+
void Chart2ImportTest::testTransparentBackground(OUString const & filename)
{
load("/chart2/qa/extras/data/xlsx/", filename);
diff --git a/chart2/qa/extras/data/xlsx/tdf100084.xlsx b/chart2/qa/extras/data/xlsx/tdf100084.xlsx
new file mode 100755
index 000000000000..5f03f39244e5
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/tdf100084.xlsx
Binary files differ
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 738412fb182c..be9b2261c272 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -342,7 +342,7 @@ bool XmlFilterBase::importFragment( const rtl::Reference<FragmentHandler>& rxHan
return false;
// fragment handler must contain path to fragment stream
- const OUString aFragmentPath = rxHandler->getFragmentPath();
+ OUString aFragmentPath = rxHandler->getFragmentPath();
OSL_ENSURE( !aFragmentPath.isEmpty(), "XmlFilterBase::importFragment - missing fragment path" );
if( aFragmentPath.isEmpty() )
return false;
@@ -385,6 +385,18 @@ bool XmlFilterBase::importFragment( const rtl::Reference<FragmentHandler>& rxHan
handler to create specialized input streams, e.g. VML streams that
have to preprocess the raw input data. */
Reference< XInputStream > xInStrm = rxHandler->openFragmentStream();
+ // Check again the aFragmentPath route if there is no any file with lowercase letter. (tdf#100084)
+ if ( !xInStrm.is() )
+ {
+ sal_Int32 nPathLen = aFragmentPath.lastIndexOf('/') + 1;
+ OUString fileName = aFragmentPath.copy(nPathLen);
+ if ( fileName != fileName.toAsciiLowerCase() )
+ {
+ fileName = fileName.toAsciiLowerCase();
+ aFragmentPath = OUStringBuffer(aFragmentPath.copy(0, nPathLen)).append(fileName).makeStringAndClear();
+ xInStrm = openInputStream(aFragmentPath);
+ }
+ }
// own try/catch block for showing parser failure assertion with fragment path
if( xInStrm.is() ) try