summaryrefslogtreecommitdiff
path: root/vcl/source/filter/wmf/wmf.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/filter/wmf/wmf.cxx')
-rw-r--r--vcl/source/filter/wmf/wmf.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/vcl/source/filter/wmf/wmf.cxx b/vcl/source/filter/wmf/wmf.cxx
index ccff80c20339..ee1ce77e4185 100644
--- a/vcl/source/filter/wmf/wmf.cxx
+++ b/vcl/source/filter/wmf/wmf.cxx
@@ -88,13 +88,15 @@ bool ConvertGraphicToWMF(const Graphic& rGraphic, SvStream& rTargetStream,
FilterConfigItem const* pConfigItem, bool bPlaceable)
{
GfxLink aLink = rGraphic.GetGfxLink();
- if (aLink.IsEMF() && aLink.GetData() && aLink.GetDataSize())
+ if (aLink.GetType() == GfxLinkType::NativeWmf && aLink.GetData() && aLink.GetDataSize())
{
- // This may be an EMF+ file, converting that to WMF is better done by re-parsing EMF+ as EMF
- // and converting that to WMF.
+ // This may be an EMF+ file or WMF file with EMF+ embedded. In EmfReader::ReadEnhWMF()
+ // we normally drop non-EMF commands when reading EMF+, so converting that to WMF
+ // is better done by re-parsing with EMF+ disabled.
auto & rDataContainer = aLink.getDataContainer();
auto aVectorGraphicData
- = std::make_shared<VectorGraphicData>(rDataContainer, VectorGraphicDataType::Emf);
+ = std::make_shared<VectorGraphicData>(rDataContainer,
+ aLink.IsEMF() ? VectorGraphicDataType::Emf : VectorGraphicDataType::Wmf);
aVectorGraphicData->setEnableEMFPlus(false);
Graphic aGraphic(aVectorGraphicData);
bool bRet = ConvertGDIMetaFileToWMF(aGraphic.GetGDIMetaFile(), rTargetStream, pConfigItem,