diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2022-03-14 20:25:42 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2022-03-14 21:48:09 +0100 |
commit | 9aae749e99a92e6622fe18539e186e5cb07fa721 (patch) | |
tree | e530f6f7dea2648b679c080d2939c2344fe14499 /xmloff | |
parent | 9e73fa6661af591d98a262da0e7f32b346570281 (diff) |
Return early if empty ref (xmloff/xmlimp)
+ fix a comment, the function uses "bool" not old "sal_Bool"
Change-Id: I777dc93450a56eb826d15691d56c23cb051a4afb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131561
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 9c68c2be6da1..a710e87b3bb7 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -1627,7 +1627,7 @@ OUString SvXMLImport::GetAbsoluteReference(const OUString& rValue) const bool SvXMLImport::IsODFVersionConsistent( const OUString& aODFVersion ) { - // the check returns sal_False only if the storage version could be retrieved + // the check returns false only if the storage version could be retrieved bool bResult = true; if ( !aODFVersion.isEmpty() && aODFVersion.compareTo( ODFVER_012_TEXT ) >= 0 ) @@ -1637,6 +1637,8 @@ bool SvXMLImport::IsODFVersionConsistent( const OUString& aODFVersion ) try { // don't use getDocumentStorage(), it's temporary and latest version uno::Reference<embed::XStorage> const xStor(GetSourceStorage()); + if (!xStor.is()) + return bResult; uno::Reference< beans::XPropertySet > xStorProps( xStor, uno::UNO_QUERY_THROW ); // the check should be done only for OASIS format |