summaryrefslogtreecommitdiff
path: root/svx/source/core/graphichelper.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2017-06-12 15:27:16 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-07-15 11:01:29 +0200
commit5868745db74ae930edb0058490076d82aaeafbe9 (patch)
tree78bea29cb44b770d9e3affef2a303d0d38722d85 /svx/source/core/graphichelper.cxx
parent83535a28c57ffb59f795dd35332d6b3426071e32 (diff)
emfplus: make VectorFormats Emf/Wmf/Svg work
make complete turn around and internal buffering for Emf/Wmf/Svg work, including images in ODF and re-save from UI. The correct FileType has to be determined. It has shown that *.wmf exist that really contain *.emf, so this turn around will not alter the binary data, but may change the mimetype Change-Id: I4fd92629236c12114f7b7c30234a3d3a9917dfaf
Diffstat (limited to 'svx/source/core/graphichelper.cxx')
-rw-r--r--svx/source/core/graphichelper.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/svx/source/core/graphichelper.cxx b/svx/source/core/graphichelper.cxx
index 3a6df2b9e7f5..632c6b03efa6 100644
--- a/svx/source/core/graphichelper.cxx
+++ b/svx/source/core/graphichelper.cxx
@@ -63,6 +63,27 @@ namespace drawing = com::sun::star::drawing;
void GraphicHelper::GetPreferredExtension( OUString& rExtension, const Graphic& rGraphic )
{
OUString aExtension = "png";
+ const VectorGraphicDataPtr& aVectorGraphicDataPtr(rGraphic.getVectorGraphicData());
+
+ if (aVectorGraphicDataPtr.get() && aVectorGraphicDataPtr->getVectorGraphicDataArrayLength())
+ {
+ switch (aVectorGraphicDataPtr->getVectorGraphicDataType())
+ {
+ case VectorGraphicDataType::Wmf:
+ aExtension = "wmf";
+ break;
+ case VectorGraphicDataType::Emf:
+ aExtension = "emf";
+ break;
+ default: // case VectorGraphicDataType::Svg:
+ aExtension = "svg";
+ break;
+ }
+
+ rExtension = aExtension;
+ return;
+ }
+
switch( rGraphic.GetLink().GetType() )
{
case GfxLinkType::NativeGif: