summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2014-05-20 17:53:25 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2014-05-21 08:59:59 +0300
commitc354deac3c6174b0e725c9bb6aab10b65a95fa0d (patch)
treefca3e79710b9564f4c06bb9dfd5ab4a5cedf94d4 /xmloff
parent005fae2bddf4e43cb361bbdb9fc2cfb961693ffd (diff)
fdo#78921 Don't crash when there is no storage specified
Not sure it's a good idea to get here at all when exporting as flat xml, but anyway it shouldn't crash. Change-Id: Ib2ce6b044b4395222a394312d49f5a01d157f9f3
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/XMLFontAutoStylePool.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx
index ff95ad6143e5..4800c0506675 100644
--- a/xmloff/source/style/XMLFontAutoStylePool.cxx
+++ b/xmloff/source/style/XMLFontAutoStylePool.cxx
@@ -325,6 +325,10 @@ OUString XMLFontAutoStylePool::embedFontFile( const OUString& fileUrl )
osl::File file( fileUrl );
if( file.open( osl_File_OpenFlag_Read ) != osl::File::E_None )
return OUString();
+
+ if ( !GetExport().GetTargetStorage().is() )
+ return OUString();
+
uno::Reference< embed::XStorage > storage;
storage.set( GetExport().GetTargetStorage()->openStorageElement( OUString( "Fonts" ),
::embed::ElementModes::WRITE ), uno::UNO_QUERY_THROW );