Kaydet (Commit) da9d85ae authored tarafından Noel Grandin's avatar Noel Grandin

use std::unique_ptr in wmfemfhelper::TargetHolder

Change-Id: I2fab3b9a111513ac711a6480eb240de99eea1991
Reviewed-on: https://gerrit.libreoffice.org/43486Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 159b26e4
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <vcl/font.hxx> #include <vcl/font.hxx>
#include <vcl/outdevstate.hxx> #include <vcl/outdevstate.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/matrix/b2dhommatrix.hxx>
#include <memory>
// predefines // predefines
namespace drawinglayer { namespace geometry { class ViewInformation2D; }} namespace drawinglayer { namespace geometry { class ViewInformation2D; }}
...@@ -42,13 +43,13 @@ namespace wmfemfhelper ...@@ -42,13 +43,13 @@ namespace wmfemfhelper
class TargetHolder class TargetHolder
{ {
private: private:
std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aTargets; std::vector< std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> > aTargets;
public: public:
TargetHolder(); TargetHolder();
~TargetHolder(); ~TargetHolder();
sal_uInt32 size() const; sal_uInt32 size() const;
void append(drawinglayer::primitive2d::BasePrimitive2D* pCandidate); void append(std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> pCandidate);
drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequence(const PropertyHolder& rPropertyHolder); drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequence(const PropertyHolder& rPropertyHolder);
}; };
} }
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <drawinglayer/attribute/fontattribute.hxx> #include <drawinglayer/attribute/fontattribute.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx>
#include <o3tl/make_unique.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <vcl/settings.hxx> #include <vcl/settings.hxx>
...@@ -421,7 +422,7 @@ namespace emfplushelper ...@@ -421,7 +422,7 @@ namespace emfplushelper
} }
mrTargetHolders.Current().append( mrTargetHolders.Current().append(
new drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D>(
polygon, polygon,
lineAttribute, lineAttribute,
aStrokeAttribute)); aStrokeAttribute));
...@@ -437,7 +438,7 @@ namespace emfplushelper ...@@ -437,7 +438,7 @@ namespace emfplushelper
} }
drawinglayer::attribute::StrokeAttribute strokeAttribute(aPattern); drawinglayer::attribute::StrokeAttribute strokeAttribute(aPattern);
mrTargetHolders.Current().append( mrTargetHolders.Current().append(
new drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D>(
polygon, polygon,
lineAttribute, lineAttribute,
strokeAttribute)); strokeAttribute));
...@@ -446,7 +447,7 @@ namespace emfplushelper ...@@ -446,7 +447,7 @@ namespace emfplushelper
else // no further line decoration, so use simple primitive else // no further line decoration, so use simple primitive
{ {
mrTargetHolders.Current().append( mrTargetHolders.Current().append(
new drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D>(
polygon, polygon,
lineAttribute)); lineAttribute));
} }
...@@ -466,7 +467,7 @@ namespace emfplushelper ...@@ -466,7 +467,7 @@ namespace emfplushelper
if (isColor) // use Color if (isColor) // use Color
{ {
mrTargetHolders.Current().append( mrTargetHolders.Current().append(
new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::PolyPolygonColorPrimitive2D>(
polygon, polygon,
::Color(0xff - (brushIndexOrColor >> 24), (brushIndexOrColor >> 16) & 0xff, (brushIndexOrColor >> 8) & 0xff, brushIndexOrColor & 0xff).getBColor())); ::Color(0xff - (brushIndexOrColor >> 24), (brushIndexOrColor >> 16) & 0xff, (brushIndexOrColor >> 8) & 0xff, brushIndexOrColor & 0xff).getBColor()));
...@@ -525,7 +526,7 @@ namespace emfplushelper ...@@ -525,7 +526,7 @@ namespace emfplushelper
// temporal solution: create a solid colored polygon // temporal solution: create a solid colored polygon
// TODO create a 'real' hatching primitive // TODO create a 'real' hatching primitive
mrTargetHolders.Current().append( mrTargetHolders.Current().append(
new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::PolyPolygonColorPrimitive2D>(
polygon, polygon,
fillColor.getBColor())); fillColor.getBColor()));
} }
...@@ -634,7 +635,7 @@ namespace emfplushelper ...@@ -634,7 +635,7 @@ namespace emfplushelper
// create the same one used for SVG // create the same one used for SVG
mrTargetHolders.Current().append( mrTargetHolders.Current().append(
new drawinglayer::primitive2d::SvgLinearGradientPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::SvgLinearGradientPrimitive2D>(
aTextureTransformation, aTextureTransformation,
polygon, polygon,
aVector, aVector,
...@@ -650,7 +651,7 @@ namespace emfplushelper ...@@ -650,7 +651,7 @@ namespace emfplushelper
// create the same one used for SVG // create the same one used for SVG
mrTargetHolders.Current().append( mrTargetHolders.Current().append(
new drawinglayer::primitive2d::SvgRadialGradientPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::SvgRadialGradientPrimitive2D>(
aTextureTransformation, aTextureTransformation,
polygon, polygon,
aVector, aVector,
...@@ -1130,7 +1131,7 @@ namespace emfplushelper ...@@ -1130,7 +1131,7 @@ namespace emfplushelper
if (aSize.Width() > 0 && aSize.Height() > 0) if (aSize.Width() > 0 && aSize.Height() > 0)
{ {
mrTargetHolders.Current().append( mrTargetHolders.Current().append(
new drawinglayer::primitive2d::BitmapPrimitive2D(aBmp, aTransformMatrix)); o3tl::make_unique<drawinglayer::primitive2d::BitmapPrimitive2D>(aBmp, aTransformMatrix));
} }
else else
{ {
...@@ -1142,7 +1143,7 @@ namespace emfplushelper ...@@ -1142,7 +1143,7 @@ namespace emfplushelper
GDIMetaFile aGDI(image.graphic.GetGDIMetaFile()); GDIMetaFile aGDI(image.graphic.GetGDIMetaFile());
aGDI.Clip(aSource); aGDI.Clip(aSource);
mrTargetHolders.Current().append( mrTargetHolders.Current().append(
new drawinglayer::primitive2d::MetafilePrimitive2D(aTransformMatrix, aGDI)); o3tl::make_unique<drawinglayer::primitive2d::MetafilePrimitive2D>(aTransformMatrix, aGDI));
} }
} }
else else
...@@ -1219,7 +1220,7 @@ namespace emfplushelper ...@@ -1219,7 +1220,7 @@ namespace emfplushelper
std::vector<double> emptyVector; std::vector<double> emptyVector;
mrTargetHolders.Current().append( mrTargetHolders.Current().append(
new drawinglayer::primitive2d::TextSimplePortionPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::TextSimplePortionPrimitive2D>(
transformMatrix, transformMatrix,
text, text,
0, // text always starts at 0 0, // text always starts at 0
...@@ -1619,7 +1620,7 @@ namespace emfplushelper ...@@ -1619,7 +1620,7 @@ namespace emfplushelper
//generate TextSimplePortionPrimitive2D //generate TextSimplePortionPrimitive2D
mrTargetHolders.Current().append( mrTargetHolders.Current().append(
new drawinglayer::primitive2d::TextSimplePortionPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::TextSimplePortionPrimitive2D>(
transformMatrix, transformMatrix,
text, text,
pos, // take character at current pos pos, // take character at current pos
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <drawinglayer/primitive2d/textlineprimitive2d.hxx> #include <drawinglayer/primitive2d/textlineprimitive2d.hxx>
#include <drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx> #include <drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx>
#include <drawinglayer/primitive2d/epsprimitive2d.hxx> #include <drawinglayer/primitive2d/epsprimitive2d.hxx>
#include <o3tl/make_unique.hxx>
#include <tools/fract.hxx> #include <tools/fract.hxx>
#include <vcl/gradient.hxx> #include <vcl/gradient.hxx>
#include <vcl/hatch.hxx> #include <vcl/hatch.hxx>
...@@ -313,12 +314,6 @@ namespace wmfemfhelper ...@@ -313,12 +314,6 @@ namespace wmfemfhelper
TargetHolder::~TargetHolder() TargetHolder::~TargetHolder()
{ {
const sal_uInt32 nCount(aTargets.size());
for (sal_uInt32 a(0); a < nCount; a++)
{
delete aTargets[a];
}
} }
sal_uInt32 TargetHolder::size() const sal_uInt32 TargetHolder::size() const
...@@ -326,11 +321,11 @@ namespace wmfemfhelper ...@@ -326,11 +321,11 @@ namespace wmfemfhelper
return aTargets.size(); return aTargets.size();
} }
void TargetHolder::append(drawinglayer::primitive2d::BasePrimitive2D* pCandidate) void TargetHolder::append(std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> pCandidate)
{ {
if (pCandidate) if (pCandidate)
{ {
aTargets.push_back(pCandidate); aTargets.push_back(std::move(pCandidate));
} }
} }
...@@ -341,13 +336,9 @@ namespace wmfemfhelper ...@@ -341,13 +336,9 @@ namespace wmfemfhelper
for (sal_uInt32 a(0); a < nCount; a++) for (sal_uInt32 a(0); a < nCount; a++)
{ {
xRetval[a] = aTargets[a]; xRetval[a] = aTargets[a].release();
} }
// Since we have released them from the list
// All Targets were pointers, but do not need to be deleted since they
// were converted to UNO API references now, so they stay as long as
// referenced. Do NOT delete the C++ implementation classes here, but clear
// the buffer to not delete them in the destructor.
aTargets.clear(); aTargets.clear();
if (!xRetval.empty() && rPropertyHolder.getClipPolyPolygonActive()) if (!xRetval.empty() && rPropertyHolder.getClipPolyPolygonActive())
...@@ -453,7 +444,7 @@ namespace wmfemfhelper ...@@ -453,7 +444,7 @@ namespace wmfemfhelper
if(rProperties.getTransformation().isIdentity()) if(rProperties.getTransformation().isIdentity())
{ {
rTarget.append( rTarget.append(
new drawinglayer::primitive2d::PointArrayPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::PointArrayPrimitive2D>(
rPositions, rPositions,
rBColor)); rBColor));
} }
...@@ -467,7 +458,7 @@ namespace wmfemfhelper ...@@ -467,7 +458,7 @@ namespace wmfemfhelper
} }
rTarget.append( rTarget.append(
new drawinglayer::primitive2d::PointArrayPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::PointArrayPrimitive2D>(
aPositions, aPositions,
rBColor)); rBColor));
} }
...@@ -485,7 +476,7 @@ namespace wmfemfhelper ...@@ -485,7 +476,7 @@ namespace wmfemfhelper
basegfx::B2DPolygon aLinePolygon(rLinePolygon); basegfx::B2DPolygon aLinePolygon(rLinePolygon);
aLinePolygon.transform(rProperties.getTransformation()); aLinePolygon.transform(rProperties.getTransformation());
rTarget.append( rTarget.append(
new drawinglayer::primitive2d::PolygonHairlinePrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::PolygonHairlinePrimitive2D>(
aLinePolygon, aLinePolygon,
rProperties.getLineColor())); rProperties.getLineColor()));
} }
...@@ -502,7 +493,7 @@ namespace wmfemfhelper ...@@ -502,7 +493,7 @@ namespace wmfemfhelper
basegfx::B2DPolyPolygon aFillPolyPolygon(rFillPolyPolygon); basegfx::B2DPolyPolygon aFillPolyPolygon(rFillPolyPolygon);
aFillPolyPolygon.transform(rProperties.getTransformation()); aFillPolyPolygon.transform(rProperties.getTransformation());
rTarget.append( rTarget.append(
new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::PolyPolygonColorPrimitive2D>(
aFillPolyPolygon, aFillPolyPolygon,
rProperties.getFillColor())); rProperties.getFillColor()));
} }
...@@ -555,7 +546,7 @@ namespace wmfemfhelper ...@@ -555,7 +546,7 @@ namespace wmfemfhelper
fAccumulated); fAccumulated);
rTarget.append( rTarget.append(
new drawinglayer::primitive2d::PolygonStrokePrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::PolygonStrokePrimitive2D>(
aLinePolygon, aLinePolygon,
aLineAttribute, aLineAttribute,
aStrokeAttribute)); aStrokeAttribute));
...@@ -563,7 +554,7 @@ namespace wmfemfhelper ...@@ -563,7 +554,7 @@ namespace wmfemfhelper
else else
{ {
rTarget.append( rTarget.append(
new drawinglayer::primitive2d::PolygonStrokePrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::PolygonStrokePrimitive2D>(
aLinePolygon, aLinePolygon,
aLineAttribute)); aLineAttribute));
} }
...@@ -630,7 +621,7 @@ namespace wmfemfhelper ...@@ -630,7 +621,7 @@ namespace wmfemfhelper
aPoint = rProperties.getTransformation() * aPoint; aPoint = rProperties.getTransformation() * aPoint;
rTarget.append( rTarget.append(
new drawinglayer::primitive2d::DiscreteBitmapPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::DiscreteBitmapPrimitive2D>(
rBitmapEx, rBitmapEx,
aPoint)); aPoint));
} }
...@@ -656,7 +647,7 @@ namespace wmfemfhelper ...@@ -656,7 +647,7 @@ namespace wmfemfhelper
aObjectTransform = rProperties.getTransformation() * aObjectTransform; aObjectTransform = rProperties.getTransformation() * aObjectTransform;
rTarget.append( rTarget.append(
new drawinglayer::primitive2d::BitmapPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::BitmapPrimitive2D>(
rBitmapEx, rBitmapEx,
aObjectTransform)); aObjectTransform));
} }
...@@ -853,7 +844,7 @@ namespace wmfemfhelper ...@@ -853,7 +844,7 @@ namespace wmfemfhelper
if(!aSubContent.empty()) if(!aSubContent.empty())
{ {
rTargetHolders.Current().append( rTargetHolders.Current().append(
new drawinglayer::primitive2d::GroupPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::GroupPrimitive2D>(
aSubContent)); aSubContent));
} }
} }
...@@ -900,7 +891,7 @@ namespace wmfemfhelper ...@@ -900,7 +891,7 @@ namespace wmfemfhelper
{ {
// force content to black // force content to black
rTargetHolders.Current().append( rTargetHolders.Current().append(
new drawinglayer::primitive2d::ModifiedColorPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::ModifiedColorPrimitive2D>(
aSubContent, aSubContent,
basegfx::BColorModifierSharedPtr( basegfx::BColorModifierSharedPtr(
new basegfx::BColorModifier_replace( new basegfx::BColorModifier_replace(
...@@ -910,7 +901,7 @@ namespace wmfemfhelper ...@@ -910,7 +901,7 @@ namespace wmfemfhelper
{ {
// invert content // invert content
rTargetHolders.Current().append( rTargetHolders.Current().append(
new drawinglayer::primitive2d::InvertPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::InvertPrimitive2D>(
aSubContent)); aSubContent));
} }
} }
...@@ -930,7 +921,7 @@ namespace wmfemfhelper ...@@ -930,7 +921,7 @@ namespace wmfemfhelper
/** helper to create needed data to emulate the VCL Wallpaper Metafile action. /** helper to create needed data to emulate the VCL Wallpaper Metafile action.
It is a quite mighty action. This helper is for simple color filled background. It is a quite mighty action. This helper is for simple color filled background.
*/ */
drawinglayer::primitive2d::BasePrimitive2D* CreateColorWallpaper( std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> CreateColorWallpaper(
const basegfx::B2DRange& rRange, const basegfx::B2DRange& rRange,
const basegfx::BColor& rColor, const basegfx::BColor& rColor,
PropertyHolder const & rPropertyHolder) PropertyHolder const & rPropertyHolder)
...@@ -938,7 +929,7 @@ namespace wmfemfhelper ...@@ -938,7 +929,7 @@ namespace wmfemfhelper
basegfx::B2DPolygon aOutline(basegfx::utils::createPolygonFromRect(rRange)); basegfx::B2DPolygon aOutline(basegfx::utils::createPolygonFromRect(rRange));
aOutline.transform(rPropertyHolder.getTransformation()); aOutline.transform(rPropertyHolder.getTransformation());
return new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( return o3tl::make_unique<drawinglayer::primitive2d::PolyPolygonColorPrimitive2D>(
basegfx::B2DPolyPolygon(aOutline), basegfx::B2DPolyPolygon(aOutline),
rColor); rColor);
} }
...@@ -946,7 +937,7 @@ namespace wmfemfhelper ...@@ -946,7 +937,7 @@ namespace wmfemfhelper
/** helper to create needed data to emulate the VCL Wallpaper Metafile action. /** helper to create needed data to emulate the VCL Wallpaper Metafile action.
It is a quite mighty action. This helper is for gradient filled background. It is a quite mighty action. This helper is for gradient filled background.
*/ */
drawinglayer::primitive2d::BasePrimitive2D* CreateGradientWallpaper( std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> CreateGradientWallpaper(
const basegfx::B2DRange& rRange, const basegfx::B2DRange& rRange,
const Gradient& rGradient, const Gradient& rGradient,
PropertyHolder const & rPropertyHolder) PropertyHolder const & rPropertyHolder)
...@@ -961,19 +952,19 @@ namespace wmfemfhelper ...@@ -961,19 +952,19 @@ namespace wmfemfhelper
else else
{ {
// really a gradient // really a gradient
drawinglayer::primitive2d::BasePrimitive2D* pRetval = std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> pRetval(
new drawinglayer::primitive2d::FillGradientPrimitive2D( new drawinglayer::primitive2d::FillGradientPrimitive2D(
rRange, rRange,
aAttribute); aAttribute));
if(!rPropertyHolder.getTransformation().isIdentity()) if(!rPropertyHolder.getTransformation().isIdentity())
{ {
const drawinglayer::primitive2d::Primitive2DReference xPrim(pRetval); const drawinglayer::primitive2d::Primitive2DReference xPrim(pRetval.release());
const drawinglayer::primitive2d::Primitive2DContainer xSeq { xPrim }; const drawinglayer::primitive2d::Primitive2DContainer xSeq { xPrim };
pRetval = new drawinglayer::primitive2d::TransformPrimitive2D( pRetval.reset(new drawinglayer::primitive2d::TransformPrimitive2D(
rPropertyHolder.getTransformation(), rPropertyHolder.getTransformation(),
xSeq); xSeq));
} }
return pRetval; return pRetval;
...@@ -1035,7 +1026,7 @@ namespace wmfemfhelper ...@@ -1035,7 +1026,7 @@ namespace wmfemfhelper
if(rProperty.getTransformation().isIdentity()) if(rProperty.getTransformation().isIdentity())
{ {
// add directly // add directly
rTarget.append(pBitmapWallpaperFill); rTarget.append(std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D>(pBitmapWallpaperFill));
} }
else else
{ {
...@@ -1043,7 +1034,7 @@ namespace wmfemfhelper ...@@ -1043,7 +1034,7 @@ namespace wmfemfhelper
const drawinglayer::primitive2d::Primitive2DReference xPrim(pBitmapWallpaperFill); const drawinglayer::primitive2d::Primitive2DReference xPrim(pBitmapWallpaperFill);
rTarget.append( rTarget.append(
new drawinglayer::primitive2d::TransformPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::TransformPrimitive2D>(
rProperty.getTransformation(), rProperty.getTransformation(),
drawinglayer::primitive2d::Primitive2DContainer { xPrim })); drawinglayer::primitive2d::Primitive2DContainer { xPrim }));
} }
...@@ -1297,7 +1288,7 @@ namespace wmfemfhelper ...@@ -1297,7 +1288,7 @@ namespace wmfemfhelper
// add created text primitive to target // add created text primitive to target
if(rProperty.getTransformation().isIdentity()) if(rProperty.getTransformation().isIdentity())
{ {
rTarget.append(pResult); rTarget.append(std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D>(pResult));
} }
else else
{ {
...@@ -1305,7 +1296,7 @@ namespace wmfemfhelper ...@@ -1305,7 +1296,7 @@ namespace wmfemfhelper
const drawinglayer::primitive2d::Primitive2DReference aReference(pResult); const drawinglayer::primitive2d::Primitive2DReference aReference(pResult);
rTarget.append( rTarget.append(
new drawinglayer::primitive2d::TransformPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::TransformPrimitive2D>(
rProperty.getTransformation(), rProperty.getTransformation(),
drawinglayer::primitive2d::Primitive2DContainer { aReference })); drawinglayer::primitive2d::Primitive2DContainer { aReference }));
} }
...@@ -1419,7 +1410,7 @@ namespace wmfemfhelper ...@@ -1419,7 +1410,7 @@ namespace wmfemfhelper
{ {
for(drawinglayer::primitive2d::BasePrimitive2D* a : aTargetVector) for(drawinglayer::primitive2d::BasePrimitive2D* a : aTargetVector)
{ {
rTarget.append(a); rTarget.append(std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D>(a));
} }
} }
else else
...@@ -1433,7 +1424,7 @@ namespace wmfemfhelper ...@@ -1433,7 +1424,7 @@ namespace wmfemfhelper
} }
rTarget.append( rTarget.append(
new drawinglayer::primitive2d::TransformPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::TransformPrimitive2D>(
rProperty.getTransformation(), rProperty.getTransformation(),
xTargets)); xTargets));
} }
...@@ -1986,7 +1977,7 @@ namespace wmfemfhelper ...@@ -1986,7 +1977,7 @@ namespace wmfemfhelper
{ {
// add with transformation // add with transformation
rTargetHolders.Current().append( rTargetHolders.Current().append(
new drawinglayer::primitive2d::TransformPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::TransformPrimitive2D>(
rPropertyHolders.Current().getTransformation(), rPropertyHolders.Current().getTransformation(),
xSubContent)); xSubContent));
} }
...@@ -2174,7 +2165,7 @@ namespace wmfemfhelper ...@@ -2174,7 +2165,7 @@ namespace wmfemfhelper
// when a MetaGradientAction is executed // when a MetaGradientAction is executed
aOutline.transform(rPropertyHolders.Current().getTransformation()); aOutline.transform(rPropertyHolders.Current().getTransformation());
rTargetHolders.Current().append( rTargetHolders.Current().append(
new drawinglayer::primitive2d::MaskPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::MaskPrimitive2D>(
aOutline, aOutline,
xGradient)); xGradient));
} }
...@@ -2204,7 +2195,7 @@ namespace wmfemfhelper ...@@ -2204,7 +2195,7 @@ namespace wmfemfhelper
aAttribute)); aAttribute));
rTargetHolders.Current().append( rTargetHolders.Current().append(
new drawinglayer::primitive2d::MaskPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::MaskPrimitive2D>(
aOutline, aOutline,
drawinglayer::primitive2d::Primitive2DContainer { aFillHatch })); drawinglayer::primitive2d::Primitive2DContainer { aFillHatch }));
} }
...@@ -2718,7 +2709,7 @@ namespace wmfemfhelper ...@@ -2718,7 +2709,7 @@ namespace wmfemfhelper
if(!aSubContent.empty()) if(!aSubContent.empty())
{ {
rTargetHolders.Current().append( rTargetHolders.Current().append(
new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::UnifiedTransparencePrimitive2D>(
aSubContent, aSubContent,
nTransparence * 0.01)); nTransparence * 0.01));
} }
...@@ -2752,7 +2743,7 @@ namespace wmfemfhelper ...@@ -2752,7 +2743,7 @@ namespace wmfemfhelper
// embed using EpsPrimitive // embed using EpsPrimitive
rTargetHolders.Current().append( rTargetHolders.Current().append(
new drawinglayer::primitive2d::EpsPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::EpsPrimitive2D>(
aObjectTransform, aObjectTransform,
pA->GetLink(), pA->GetLink(),
pA->GetSubstitute())); pA->GetSubstitute()));
...@@ -2872,7 +2863,7 @@ namespace wmfemfhelper ...@@ -2872,7 +2863,7 @@ namespace wmfemfhelper
{ {
// not really a gradient; create UnifiedTransparencePrimitive2D // not really a gradient; create UnifiedTransparencePrimitive2D
rTargetHolders.Current().append( rTargetHolders.Current().append(
new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::UnifiedTransparencePrimitive2D>(
xSubContent, xSubContent,
aAttribute.getStartColor().luminance())); aAttribute.getStartColor().luminance()));
} }
...@@ -2890,7 +2881,7 @@ namespace wmfemfhelper ...@@ -2890,7 +2881,7 @@ namespace wmfemfhelper
// create transparence primitive // create transparence primitive
rTargetHolders.Current().append( rTargetHolders.Current().append(
new drawinglayer::primitive2d::TransparencePrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::TransparencePrimitive2D>(
xSubContent, xSubContent,
drawinglayer::primitive2d::Primitive2DContainer { xTransparence })); drawinglayer::primitive2d::Primitive2DContainer { xTransparence }));
} }
...@@ -2992,7 +2983,7 @@ namespace wmfemfhelper ...@@ -2992,7 +2983,7 @@ namespace wmfemfhelper
{ {
// not really a gradient // not really a gradient
rTargetHolders.Current().append( rTargetHolders.Current().append(
new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::PolyPolygonColorPrimitive2D>(
aPolyPolygon, aPolyPolygon,
aAttribute.getStartColor())); aAttribute.getStartColor()));
} }
...@@ -3000,7 +2991,7 @@ namespace wmfemfhelper ...@@ -3000,7 +2991,7 @@ namespace wmfemfhelper
{ {
// really a gradient // really a gradient
rTargetHolders.Current().append( rTargetHolders.Current().append(
new drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D( o3tl::make_unique<drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D>(
aPolyPolygon, aPolyPolygon,
aAttribute)); aAttribute));
} }
......
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