Kaydet (Commit) bec51fdb authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

cache location and mime type when saving a graphic to a storage

Change-Id: If27a5f617a103da235d6690ea0447d6c64538dea
Reviewed-on: https://gerrit.libreoffice.org/50810Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst e030fbbf
...@@ -63,7 +63,7 @@ private: ...@@ -63,7 +63,7 @@ private:
::std::set< OUString > maURLSet; ::std::set< OUString > maURLSet;
std::unordered_map<OUString, css::uno::Reference<css::graphic::XGraphic>> maGraphicObjects; std::unordered_map<OUString, css::uno::Reference<css::graphic::XGraphic>> maGraphicObjects;
std::unordered_map<Graphic, OUString> maExportGraphics; std::unordered_map<Graphic, std::pair<OUString, OUString>> maExportGraphics;
SvXMLGraphicHelperMode meCreateMode; SvXMLGraphicHelperMode meCreateMode;
OUString maOutputMimeType; OUString maOutputMimeType;
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include <algorithm> #include <algorithm>
#include <memory> #include <memory>
#include <utility>
using namespace com::sun::star; using namespace com::sun::star;
using namespace com::sun::star::uno; using namespace com::sun::star::uno;
...@@ -1070,7 +1071,9 @@ OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::X ...@@ -1070,7 +1071,9 @@ OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::X
auto aIterator = maExportGraphics.find(aGraphic); auto aIterator = maExportGraphics.find(aGraphic);
if (aIterator != maExportGraphics.end()) if (aIterator != maExportGraphics.end())
{ {
return aIterator->second; auto const & aURLAndMimePair = aIterator->second;
rOutSavedMimeType = aURLAndMimePair.second;
return aURLAndMimePair.first;
} }
GraphicObject aGraphicObject(aGraphic); GraphicObject aGraphicObject(aGraphic);
...@@ -1275,7 +1278,7 @@ OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::X ...@@ -1275,7 +1278,7 @@ OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::X
aStoragePath += rPictureStreamName; aStoragePath += rPictureStreamName;
// put into cache // put into cache
maExportGraphics[aGraphic] = aStoragePath; maExportGraphics[aGraphic] = std::make_pair(aStoragePath, rOutSavedMimeType);
return aStoragePath; return aStoragePath;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment