diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-07-20 22:01:31 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-07-21 09:01:51 +0200 |
commit | d449da36086409e3cc440036193c4fc8a10a37a1 (patch) | |
tree | 13f9447777c838129250c5902645964f429a9e49 /svx/source | |
parent | 6c24f112ad86df77f2de27a31742bca01ed56bdf (diff) |
tdf#123983 fix loading graphic that is in root folder + test
We need to detect that the storage name is empty, so in that case
the root storage needs to be set as the current storage.
Change-Id: Ibe3287ccf1f1513a3531dcf4d540a456cca8dfb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137276
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/xml/xmlgrhlp.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 6c5c76bfce73..6c12aa4bee2b 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -390,7 +390,7 @@ bool SvXMLGraphicHelper::ImplGetStreamNames( const OUString& rURLStr, if( !aURLStr.isEmpty() && aURLStr.indexOf('/')<0 ) // just one token? { - rPictureStorageName = XML_GRAPHICSTORAGE_NAME; + rPictureStorageName = OUString(); rPictureStreamName = aURLStr; } else @@ -439,7 +439,10 @@ SvxGraphicHelperStream_Impl SvXMLGraphicHelper::ImplGetGraphicStream( const OUSt const OUString& rPictureStreamName ) { SvxGraphicHelperStream_Impl aRet; - aRet.xStorage = ImplGetGraphicStorage( rPictureStorageName ); + if (!rPictureStorageName.isEmpty()) + aRet.xStorage = ImplGetGraphicStorage(rPictureStorageName); + else + aRet.xStorage = mxRootStorage; sal_Int32 nMode = embed::ElementModes::READ; if (SvXMLGraphicHelperMode::Write == meCreateMode) |