Kaydet (Commit) 83535a28 authored tarafından Armin Le Grand's avatar Armin Le Grand Kaydeden (comit) Thorsten Behrens

emfplus: create a wmf/emf/emf+ primitive based importer

First steps to organize an importer that can read/interpret
wmf/emf/emf+ and deliver a primitive representation for
the content by parsing it. Use the same mechanisms as
already applied for Svg, so to reuse abilities to keep
original binary data to allow save again and embedding in
files and have an implemented replacement bitmap based
representation. For this, unify the used helper classes
to handle more than just Svg. For 1st try, add test code
and static bool switches

Change-Id: I6e0a82943541d811a8f8d65a84115569fcd8cee7
üst 79f5cb62
......@@ -406,6 +406,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
storagefd \
$(call gb_Helper_optional,SCRIPTING,stringresource) \
svgio \
emfio \
svl \
svt \
svx \
......
......@@ -77,6 +77,7 @@ $(eval $(call gb_Module_add_moduledirs,cross_toolset,\
sfx2 \
sot \
svgio \
emfio \
svl \
svtools \
svx \
......
......@@ -126,6 +126,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
svl \
svtools \
svgio \
emfio \
svx \
sw \
swext \
......
......@@ -144,7 +144,7 @@
#include <vcl/seleng.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#include <vcl/svgdata.hxx>
#include <vcl/vectorgraphicdata.hxx>
#include <vcl/syswin.hxx>
#include <vcl/timer.hxx>
#include <vcl/unohelp2.hxx>
......
......@@ -168,7 +168,7 @@
#include <vcl/spinfld.hxx>
#include <vcl/status.hxx>
#include <vcl/svapp.hxx>
#include <vcl/svgdata.hxx>
#include <vcl/vectorgraphicdata.hxx>
#include <vcl/syswin.hxx>
#include <vcl/timer.hxx>
#include <vcl/vclenum.hxx>
......
......@@ -102,6 +102,7 @@ DEFAULTS = \
'sot.sot' : ( 5, EXCLUDE, EXCLUDE, INCLUDE), # 3.1
'starmath.sm' : ( 5, EXCLUDE, EXCLUDE, INCLUDE), # 10.9
'svgio.svgio' : ( 8, EXCLUDE, EXCLUDE, INCLUDE), # 4.3
'emfio.emfio' : ( 8, EXCLUDE, EXCLUDE, INCLUDE), # 4.3
'svl.svl' : ( 6, EXCLUDE, EXCLUDE, EXCLUDE), # 7.6
'svtools.svt' : ( 4, EXCLUDE, INCLUDE, EXCLUDE), # 17.6
'svx.svx' : ( 3, EXCLUDE, EXCLUDE, INCLUDE), # 20.7
......
......@@ -155,7 +155,7 @@
#include <vcl/settings.hxx>
#include <vcl/spinfld.hxx>
#include <vcl/svapp.hxx>
#include <vcl/svgdata.hxx>
#include <vcl/vectorgraphicdata.hxx>
#include <vcl/syswin.hxx>
#include <vcl/tabctrl.hxx>
#include <vcl/tabdlg.hxx>
......
......@@ -121,7 +121,7 @@
#include <vcl/scheduler.hxx>
#include <vcl/scopedbitmapaccess.hxx>
#include <vcl/settings.hxx>
#include <vcl/svgdata.hxx>
#include <vcl/vectorgraphicdata.hxx>
#include <vcl/timer.hxx>
#include <vcl/vclenum.hxx>
#include <vcl/vclevent.hxx>
......
......@@ -164,7 +164,7 @@
#include <vcl/settings.hxx>
#include <vcl/spinfld.hxx>
#include <vcl/svapp.hxx>
#include <vcl/svgdata.hxx>
#include <vcl/vectorgraphicdata.hxx>
#include <vcl/syswin.hxx>
#include <vcl/timer.hxx>
#include <vcl/vclenum.hxx>
......
......@@ -129,7 +129,7 @@
#include <vcl/salnativewidgets.hxx>
#include <vcl/scheduler.hxx>
#include <vcl/scopedbitmapaccess.hxx>
#include <vcl/svgdata.hxx>
#include <vcl/vectorgraphicdata.hxx>
#include <vcl/timer.hxx>
#include <vcl/vclenum.hxx>
#include <vcl/vclptr.hxx>
......
......@@ -125,7 +125,7 @@
#include <vcl/scheduler.hxx>
#include <vcl/scopedbitmapaccess.hxx>
#include <vcl/settings.hxx>
#include <vcl/svgdata.hxx>
#include <vcl/vectorgraphicdata.hxx>
#include <vcl/timer.hxx>
#include <vcl/vclenum.hxx>
#include <vcl/vclevent.hxx>
......
......@@ -148,7 +148,7 @@
#include <vcl/scheduler.hxx>
#include <vcl/scopedbitmapaccess.hxx>
#include <vcl/settings.hxx>
#include <vcl/svgdata.hxx>
#include <vcl/vectorgraphicdata.hxx>
#include <vcl/syswin.hxx>
#include <vcl/timer.hxx>
#include <vcl/vclenum.hxx>
......
......@@ -78,7 +78,7 @@ namespace drawinglayer
const GraphicObject& rGraphicObject = getGraphicObject();
Graphic aTransformedGraphic(rGraphicObject.GetGraphic());
const bool isBitmap(GraphicType::Bitmap == aTransformedGraphic.GetType() && !aTransformedGraphic.getSvgData().get());
const bool isBitmap(GraphicType::Bitmap == aTransformedGraphic.GetType() && !aTransformedGraphic.getVectorGraphicData().get());
const bool isAdjusted(getGraphicAttr().IsAdjusted());
const bool isDrawMode(GraphicDrawMode::Standard != getGraphicAttr().GetDrawMode());
......
......@@ -473,31 +473,31 @@ namespace drawinglayer
rGraphic,
rTransform);
}
else if(rGraphic.getSvgData().get())
else if(rGraphic.getVectorGraphicData().get())
{
// embedded Svg fill, create embed transform
const basegfx::B2DRange& rSvgRange(rGraphic.getSvgData()->getRange());
// embedded Vector Graphic Data fill, create embed transform
const basegfx::B2DRange& rSvgRange(rGraphic.getVectorGraphicData()->getRange());
if(basegfx::fTools::more(rSvgRange.getWidth(), 0.0) && basegfx::fTools::more(rSvgRange.getHeight(), 0.0))
{
// translate back to origin, scale to unit coordinates
basegfx::B2DHomMatrix aEmbedSvg(
basegfx::B2DHomMatrix aEmbedVectorGraphic(
basegfx::tools::createTranslateB2DHomMatrix(
-rSvgRange.getMinX(),
-rSvgRange.getMinY()));
aEmbedSvg.scale(
aEmbedVectorGraphic.scale(
1.0 / rSvgRange.getWidth(),
1.0 / rSvgRange.getHeight());
// apply created object transformation
aEmbedSvg = rTransform * aEmbedSvg;
aEmbedVectorGraphic = rTransform * aEmbedVectorGraphic;
// add Svg primitives embedded
// add Vector Graphic Data primitives embedded
aRetval.resize(1);
aRetval[0] = new TransformPrimitive2D(
aEmbedSvg,
rGraphic.getSvgData()->getPrimitive2DSequence());
aEmbedVectorGraphic,
rGraphic.getVectorGraphicData()->getPrimitive2DSequence());
}
}