diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2019-05-10 09:34:30 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-05-13 13:16:10 +0200 |
commit | b2fc2ad7beceaff660de684435a5c37d69cf8ae9 (patch) | |
tree | 2e6275aab58021da702c37fdbe93939902ac0c88 /oox | |
parent | fed7c693de1def5211992bac288c3e9936e863bc (diff) |
tdf#100084 XLSX import: fix missing charts
caused by case-sensitive path handling of relationship files.
OOXML documents contain case-insensitive file paths, for example,
uppercase "Sheet.xml" can have a lowercase "sheet.xml.rels" in the ZIP
archive, as in the case of the XLSX documents generated by IBM Cognos.
Change-Id: I4210e3b96fb512d61e1687ec8d41a3c77292ec0c
Reviewed-on: https://gerrit.libreoffice.org/72100
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
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 |