[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source include/drawinglayer

2023-03-23 Thread Armin Le Grand (allotropia) (via logerrit)
 drawinglayer/inc/texture/texture.hxx |   29 -
 drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx  |  255 +--
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx  |   84 +++
 drawinglayer/source/texture/texture.cxx  |   92 +--
 include/drawinglayer/primitive2d/fillgradientprimitive2d.hxx |   21 
 5 files changed, 247 insertions(+), 234 deletions(-)

New commits:
commit 462ebbd10bd537f42104fe991a0aeebcd563f178
Author: Armin Le Grand (allotropia) 
AuthorDate: Thu Mar 23 16:13:26 2023 +0100
Commit: Armin Le Grand 
CommitDate: Thu Mar 23 17:14:04 2023 +

MCGR: Speedup Gradient Paint for VCLPixelProcessor

To do this, I re-organized FillGradientPrimitive2D and
how it creates it's decompose. This provides the needed
tooling to also do a more direct rendering in primitive
processors if needed.

The decompose no longer collects the matrices & colors
as a 1st step in a helper data struecture (so I removed
B2DHomMatrixAndBColor). It now uses a lambda function
callback that hands over the matrix & color for each
created step, so you can process it directly, in this
case to create the needed primitives.

NOTE: The decompositions are both tested. There was
createNonOverlappingFill, but also createOverlappingFill
that I am not sure is still used - and if in re-creating
an old, strange XOR-using gradient paint mechanism in
old metafiles (encapsulated with gradient info anyways),
but I converted that and made sure it works.
To do so I forced it to be used in paint. This is not
really usable in paint since we need to paint using AA
(else we would get staircase effects, esp. in new 'hard'
color changes in multi-color gradients) and - as should
be known - same edges painted in AA do *not* add up to
full opacity, but leave behind awful 'jaggies' (e.g.
opacity 0.5 and 0.5 create 0.75 and *not* 1.0). Still
important to have the working geometry creation for this
case.

This already makes the decompose faster, but the main
purpose is to use it as tooling for painting in own
primitive renderers.

Thus processFillGradientPrimitive2D now uses that
instead of using the decomposition by default.
This avoids one level of primitive creation, use
that new FillGradientPrimitive2D tooling to directly
create needed geoemtry & color for getting better
performance (to partially compensate for potentially
more expensive multi color gradients). It then paints
directly using OutputDevice calls.

NOTE: This can also be used in SDPRs as a 1st step
to just directly and rapidly render filled single-
color polygons, but of course there an implementation
using the back-transformations (which are also
adapted for MCGRs aleady and work) will be superior.

Change-Id: I5079f76d6d8fe86007a098614c276447f2bfebce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149456
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/drawinglayer/inc/texture/texture.hxx 
b/drawinglayer/inc/texture/texture.hxx
index 8a5c411d320f..54ace6ba3b47 100644
--- a/drawinglayer/inc/texture/texture.hxx
+++ b/drawinglayer/inc/texture/texture.hxx
@@ -43,14 +43,6 @@ namespace drawinglayer::texture
 virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& 
rfOpacity) const;
 };
 
-/// helper class for processing equal number of matrices and colors
-/// for texture processing
-struct B2DHomMatrixAndBColor
-{
-basegfx::B2DHomMatrix   maB2DHomMatrix;
-basegfx::BColor maBColor;
-};
-
 class GeoTexSvxGradient : public GeoTexSvx
 {
 protected:
@@ -76,8 +68,7 @@ namespace drawinglayer::texture
 
 // virtual base methods
 virtual void appendTransformationsAndColors(
-std::vector< B2DHomMatrixAndBColor >& rEntries,
-basegfx::BColor& rOuterColor) = 0;
+std::function aCallback) = 0;
 };
 
 class GeoTexSvxGradientLinear final : public GeoTexSvxGradient
@@ -97,8 +88,7 @@ namespace drawinglayer::texture
 virtual ~GeoTexSvxGradientLinear() override;
 
 virtual void appendTransformationsAndColors(
-std::vector< B2DHomMatrixAndBColor >& rEntries,
-basegfx::BColor& rOuterColor) override;
+std::function aCallback) override;
 virtual void modifyBColor(const basegfx::B2DPoint& rUV, 
basegfx::BColor& rBColor, double& rfOpacity) const override;
 };
 
@@ -118,8 +108,7 @@ namespace drawinglayer::texture
 virtual ~GeoTexSvxGradientAxial() override;
 
 virtual void appendTransformationsAndColors(
-std::vector< B2DHomMatrixAndBColor >& rEntries,
-

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source include/drawinglayer

2022-06-15 Thread Noel Grandin (via logerrit)
 drawinglayer/inc/primitive2d/cropprimitive2d.hxx |2 
 drawinglayer/inc/primitive2d/textlineprimitive2d.hxx |2 
 drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx|6 +-
 drawinglayer/inc/primitive3d/hatchtextureprimitive3d.hxx |2 
 drawinglayer/inc/primitive3d/shadowprimitive3d.hxx   |2 
 drawinglayer/inc/primitive3d/textureprimitive3d.hxx  |2 
 drawinglayer/inc/processor3d/geometry2dextractor.hxx |2 
 drawinglayer/inc/processor3d/shadow3dextractor.hxx   |2 
 drawinglayer/source/attribute/fillgraphicattribute.cxx   |5 +-
 drawinglayer/source/attribute/fontattribute.cxx  |   11 
++--
 drawinglayer/source/attribute/linestartendattribute.cxx  |5 +-
 drawinglayer/source/attribute/sdrallattribute3d.cxx  |   21 
-
 drawinglayer/source/attribute/sdrfillattribute.cxx   |   13 
+++--
 drawinglayer/source/attribute/sdrfillgraphicattribute.cxx|5 +-
 drawinglayer/source/attribute/sdrlinestartendattribute.cxx   |9 ++-
 drawinglayer/source/geometry/viewinformation2d.cxx   |   13 
+++--
 drawinglayer/source/geometry/viewinformation3d.cxx   |   17 
+++
 drawinglayer/source/primitive2d/PolyPolygonColorPrimitive2D.cxx  |7 +--
 drawinglayer/source/primitive2d/PolyPolygonGradientPrimitive2D.cxx   |   14 
+++---
 drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D.cxx|5 +-
 drawinglayer/source/primitive2d/PolyPolygonHairlinePrimitive2D.cxx   |7 +--
 drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D.cxx  |   16 
+++---
 drawinglayer/source/primitive2d/PolyPolygonMarkerPrimitive2D.cxx |   10 
++--
 drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D.cxx  |7 +--
 drawinglayer/source/primitive2d/PolyPolygonStrokePrimitive2D.cxx |   13 
+++--
 drawinglayer/source/primitive2d/bitmapprimitive2d.cxx|9 ++-
 drawinglayer/source/primitive2d/borderlineprimitive2d.cxx|5 +-
 drawinglayer/source/primitive2d/controlprimitive2d.cxx   |   21 
-
 drawinglayer/source/primitive2d/cropprimitive2d.cxx  |5 +-
 drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx|9 ++-
 drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx|   13 
+++--
 drawinglayer/source/primitive2d/epsprimitive2d.cxx   |9 ++-
 drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx  |9 ++-
 drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx   |5 +-
 drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx |9 ++-
 drawinglayer/source/primitive2d/graphicprimitive2d.cxx   |9 ++-
 drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx |7 +--
 drawinglayer/source/primitive2d/gridprimitive2d.cxx  |5 +-
 drawinglayer/source/primitive2d/maskprimitive2d.cxx  |5 +-
 drawinglayer/source/primitive2d/mediaprimitive2d.cxx |   13 
+++--
 drawinglayer/source/primitive2d/metafileprimitive2d.cxx  |5 +-
 drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx |5 +-
 drawinglayer/source/primitive2d/objectinfoprimitive2d.cxx|   13 
+++--
 drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx   |9 ++-
 drawinglayer/source/primitive2d/patternfillprimitive2d.cxx   |5 +-
 drawinglayer/source/primitive2d/polygonprimitive2d.cxx   |   23 
+-
 drawinglayer/source/primitive2d/sceneprimitive2d.cxx |   21 
-
 drawinglayer/source/primitive2d/shadowprimitive2d.cxx|5 +-
 drawinglayer/source/primitive2d/svggradientprimitive2d.cxx   |9 ++-
 drawinglayer/source/primitive2d/textlineprimitive2d.cxx  |5 +-
 drawinglayer/source/primitive2d/textprimitive2d.cxx  |   18 
+++
 drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx |   13 
+++--
 drawinglayer/source/primitive2d/transformprimitive2d.cxx |5 +-
 drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx|5 +-
 drawinglayer/source/primitive3d/groupprimitive3d.cxx |5 +-
 drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx  |5 +-
 drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx |5 +-
 drawinglayer/source/primitive3d/polygonprimitive3d.cxx   |   13 
+++--
 drawinglayer/source/primitive3d/polypolygonprimitive3d.cxx   |5 +-
 drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx|5 +-
 drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx  |5 +-
 

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source

2022-05-29 Thread Noel Grandin (via logerrit)
 drawinglayer/inc/wmfemfhelper.hxx  |4 
 drawinglayer/source/tools/wmfemfhelper.cxx |   26 --
 2 files changed, 12 insertions(+), 18 deletions(-)

New commits:
commit e42703d9f23d2235c3a1d61b06610248627595c0
Author: Noel Grandin 
AuthorDate: Sun May 29 12:34:31 2022 +0200
Commit: Noel Grandin 
CommitDate: Sun May 29 19:39:38 2022 +0200

elide temporary vector in processMetaTextLineAction

Change-Id: Icf5a3ae47aec43854e669133f3d0c2bace1d942d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135090
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/drawinglayer/inc/wmfemfhelper.hxx 
b/drawinglayer/inc/wmfemfhelper.hxx
index 01449ae2b1da..f085065c1ea6 100644
--- a/drawinglayer/inc/wmfemfhelper.hxx
+++ b/drawinglayer/inc/wmfemfhelper.hxx
@@ -53,6 +53,10 @@ namespace wmfemfhelper
 {
 append(pCandidate.get());
 }
+void append(drawinglayer::primitive2d::Primitive2DContainer xCandidate)
+{
+aTargets.append(std::move(xCandidate));
+}
 void append(drawinglayer::primitive2d::BasePrimitive2D* pCandidate);
 drawinglayer::primitive2d::Primitive2DContainer 
getPrimitive2DSequence(const PropertyHolder& rPropertyHolder);
 };
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx 
b/drawinglayer/source/tools/wmfemfhelper.cxx
index 0e8668e80656..8a5dbab74e12 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -1292,7 +1292,7 @@ namespace wmfemfhelper
 if(!(bUnderlineUsed || bStrikeoutUsed || bOverlineUsed))
 return;
 
-std::vector< drawinglayer::primitive2d::BasePrimitive2D* > 
aTargetVector;
+drawinglayer::primitive2d::Primitive2DContainer aTargets;
 basegfx::B2DVector aAlignmentOffset(0.0, 0.0);
 drawinglayer::attribute::FontAttribute aFontAttribute;
 basegfx::B2DHomMatrix aTextTransform;
@@ -1314,7 +1314,7 @@ namespace wmfemfhelper
 if(bOverlineUsed)
 {
 // create primitive geometry for overline
-aTargetVector.push_back(
+aTargets.push_back(
 new drawinglayer::primitive2d::TextLinePrimitive2D(
 aTextTransform,
 fLineWidth,
@@ -1327,7 +1327,7 @@ namespace wmfemfhelper
 if(bUnderlineUsed)
 {
 // create primitive geometry for underline
-aTargetVector.push_back(
+aTargets.push_back(
 new drawinglayer::primitive2d::TextLinePrimitive2D(
 aTextTransform,
 fLineWidth,
@@ -1349,7 +1349,7 @@ namespace wmfemfhelper
 const css::lang::Locale aLocale(LanguageTag(
 rProperty.getLanguageType()).getLocale());
 
-aTargetVector.push_back(
+aTargets.push_back(
 new 
drawinglayer::primitive2d::TextCharacterStrikeoutPrimitive2D(
 aTextTransform,
 fLineWidth,
@@ -1361,7 +1361,7 @@ namespace wmfemfhelper
 else
 {
 // strikeout with geometry
-aTargetVector.push_back(
+aTargets.push_back(
 new 
drawinglayer::primitive2d::TextGeometryStrikeoutPrimitive2D(
 aTextTransform,
 fLineWidth,
@@ -1372,31 +1372,21 @@ namespace wmfemfhelper
 }
 }
 
-if(aTargetVector.empty())
+if(aTargets.empty())
 return;
 
 // add created text primitive to target
 if(rProperty.getTransformation().isIdentity())
 {
-for(drawinglayer::primitive2d::BasePrimitive2D* a : aTargetVector)
-{
-rTarget.append(a);
-}
+rTarget.append(std::move(aTargets));
 }
 else
 {
 // when a transformation is set, embed to it
-drawinglayer::primitive2d::Primitive2DContainer 
xTargets(aTargetVector.size());
-
-for(size_t a(0); a < aTargetVector.size(); a++)
-{
-xTargets[a] = 
drawinglayer::primitive2d::Primitive2DReference(aTargetVector[a]);
-}
-
 rTarget.append(
 new drawinglayer::primitive2d::TransformPrimitive2D(
 rProperty.getTransformation(),
-std::move(xTargets)));
+std::move(aTargets)));
 }
 }
 


[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source

2022-05-29 Thread Noel Grandin (via logerrit)
 drawinglayer/inc/wmfemfhelper.hxx  |2 +-
 drawinglayer/source/tools/wmfemfhelper.cxx |9 +
 2 files changed, 2 insertions(+), 9 deletions(-)

New commits:
commit 7088b6c6c191a105426fc631c9bf95a17e9f02dd
Author: Noel Grandin 
AuthorDate: Sun May 29 12:29:04 2022 +0200
Commit: Noel Grandin 
CommitDate: Sun May 29 19:28:31 2022 +0200

use Primitive2DContainer in TargetHolder

which we can std::move the data around, instead of copying

Change-Id: Id7aaad3970b942599807b7fda73d028f082a0f38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135089
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/drawinglayer/inc/wmfemfhelper.hxx 
b/drawinglayer/inc/wmfemfhelper.hxx
index 39cd9b7b0777..01449ae2b1da 100644
--- a/drawinglayer/inc/wmfemfhelper.hxx
+++ b/drawinglayer/inc/wmfemfhelper.hxx
@@ -43,7 +43,7 @@ namespace wmfemfhelper
 class TargetHolder
 {
 private:
-std::vector< 
rtl::Reference > aTargets;
+drawinglayer::primitive2d::Primitive2DContainer aTargets;
 
 public:
 TargetHolder();
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx 
b/drawinglayer/source/tools/wmfemfhelper.cxx
index 1f5b8a10fcf2..0e8668e80656 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -333,15 +333,8 @@ namespace wmfemfhelper
 
 drawinglayer::primitive2d::Primitive2DContainer 
TargetHolder::getPrimitive2DSequence(const PropertyHolder& rPropertyHolder)
 {
-const sal_uInt32 nCount(aTargets.size());
-drawinglayer::primitive2d::Primitive2DContainer xRetval(nCount);
+drawinglayer::primitive2d::Primitive2DContainer xRetval = 
std::move(aTargets);
 
-for (sal_uInt32 a(0); a < nCount; a++)
-{
-xRetval[a] = aTargets[a].get();
-}
-// Since we have released them from the list
-aTargets.clear();
 
 if (!xRetval.empty() && rPropertyHolder.getClipPolyPolygonActive())
 {


[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source include/drawinglayer include/svx sd/source svgio/inc svgio/source svx/inc svx/source sw/source

2021-09-24 Thread Noel Grandin (via logerrit)
 drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx|2 
 drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx   |2 
 drawinglayer/source/primitive2d/graphicprimitive2d.cxx   |2 
 drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx |4 
 drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx   |4 
 drawinglayer/source/primitive2d/patternfillprimitive2d.cxx   |4 
 drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx |4 
 drawinglayer/source/primitive2d/texteffectprimitive2d.cxx|4 
 drawinglayer/source/primitive2d/textprimitive2d.cxx  |4 
 include/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx  |2 
 include/drawinglayer/primitive2d/patternfillprimitive2d.hxx  |2 
 include/svx/sdr/animation/animationstate.hxx |2 
 include/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx |2 
 include/svx/svddrgmt.hxx |3 
 sd/source/ui/animations/motionpathtag.cxx|2 
 svgio/inc/svgstyleattributes.hxx |4 
 svgio/inc/svgtextnode.hxx|2 
 svgio/source/svgreader/svganode.cxx  |2 
 svgio/source/svgreader/svgcirclenode.cxx |2 
 svgio/source/svgreader/svgellipsenode.cxx|2 
 svgio/source/svgreader/svggnode.cxx  |2 
 svgio/source/svgreader/svgimagenode.cxx  |2 
 svgio/source/svgreader/svglinenode.cxx   |2 
 svgio/source/svgreader/svgpathnode.cxx   |2 
 svgio/source/svgreader/svgpolynode.cxx   |2 
 svgio/source/svgreader/svgrectnode.cxx   |2 
 svgio/source/svgreader/svgstyleattributes.cxx|   10 
 svgio/source/svgreader/svgtextnode.cxx   |   16 -
 svx/inc/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx|2 
 svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx|4 
 svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx   |2 
 svx/source/engine3d/view3d.cxx   |2 
 svx/source/sdr/animation/animationstate.cxx  |4 
 svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx|2 
 svx/source/sdr/contact/viewobjectcontact.cxx |3 
 svx/source/sdr/contact/viewobjectcontactofpageobj.cxx|2 
 svx/source/sdr/overlay/overlayprimitive2dsequenceobject.cxx  |4 
 svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx |2 
 svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx   |2 
 svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx |8 
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |  166 +--
 svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx |4 
 svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx|6 
 svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx |2 
 svx/source/sdr/primitive2d/sdrole2primitive2d.cxx|6 
 svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx|2 
 svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx   |2 
 svx/source/svdraw/svdcrtv.cxx|2 
 svx/source/svdraw/svddrgmt.cxx   |8 
 svx/source/svdraw/svdhdl.cxx |2 
 svx/source/table/viewcontactoftableobj.cxx   |4 
 sw/source/core/layout/paintfrm.cxx   |   10 
 52 files changed, 169 insertions(+), 175 deletions(-)

New commits:
commit c8d2fa176a15a7ae76d6a4b76aea5f108313c2ec
Author: Noel Grandin 
AuthorDate: Thu Sep 23 15:35:34 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Sep 24 11:33:32 2021 +0200

reduce copying in drawinglayer

by passing PrimitiveContainer&& around.

There are lots of place where we were preparing a local variable of type
PrimitiveContainer, and then copying it someplace else, then throwing it
away.

Change-Id: Iacfd983640c9e55da25800ccc01734dfc8b4d64a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122527
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx 
b/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx
index 001ff3159305..cecb1d8f1564 100644
--- a/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx
+++ b/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx
@@ -44,7 +44,7 @@ namespace drawinglayer::primitive2d
 applied.
 */
 Primitive2DContainer create2DColorModifierEmbeddingsAsNeeded(
-const Primitive2DContainer& rChildren,
+Primitive2DContainer&& rChildren,
 GraphicDrawMode aGraphicDrawMode,
 double fLuminance = 0.0,// 

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source include/drawinglayer sd/source svgio/source svx/inc svx/source sw/source

2021-09-09 Thread Noel Grandin (via logerrit)
 drawinglayer/inc/primitive2d/cropprimitive2d.hxx|2 
 drawinglayer/source/primitive2d/PolyPolygonGradientPrimitive2D.cxx  |4 
 drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D.cxx |4 
 drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D.cxx |2 
 drawinglayer/source/primitive2d/animatedprimitive2d.cxx |   14 +-
 drawinglayer/source/primitive2d/cropprimitive2d.cxx |6 -
 drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx   |2 
 drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx  |2 
 drawinglayer/source/primitive2d/glowprimitive2d.cxx |4 
 drawinglayer/source/primitive2d/graphicprimitive2d.cxx  |   15 +-
 drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx|   14 +-
 drawinglayer/source/primitive2d/groupprimitive2d.cxx|4 
 drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx   |4 
 drawinglayer/source/primitive2d/invertprimitive2d.cxx   |4 
 drawinglayer/source/primitive2d/maskprimitive2d.cxx |4 
 drawinglayer/source/primitive2d/mediaprimitive2d.cxx|4 
 drawinglayer/source/primitive2d/metafileprimitive2d.cxx |4 
 drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx|4 
 drawinglayer/source/primitive2d/objectinfoprimitive2d.cxx   |4 
 drawinglayer/source/primitive2d/pagehierarchyprimitive2d.cxx|4 
 drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx  |4 
 drawinglayer/source/primitive2d/patternfillprimitive2d.cxx  |   22 ++--
 drawinglayer/source/primitive2d/shadowprimitive2d.cxx   |   10 -
 drawinglayer/source/primitive2d/softedgeprimitive2d.cxx |7 -
 drawinglayer/source/primitive2d/structuretagprimitive2d.cxx |4 
 drawinglayer/source/primitive2d/svggradientprimitive2d.cxx  |   14 +-
 drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx|2 
 drawinglayer/source/primitive2d/texteffectprimitive2d.cxx   |   42 
---
 drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx|   24 ++--
 drawinglayer/source/primitive2d/textlineprimitive2d.cxx |4 
 drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx|2 
 drawinglayer/source/primitive2d/transformprimitive2d.cxx|4 
 drawinglayer/source/primitive2d/transparenceprimitive2d.cxx |8 -
 drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx  |6 -
 drawinglayer/source/processor3d/shadow3dextractor.cxx   |6 -
 drawinglayer/source/tools/converters.cxx|8 -
 drawinglayer/source/tools/wmfemfhelper.cxx  |   32 
++---
 include/drawinglayer/primitive2d/animatedprimitive2d.hxx|6 -
 include/drawinglayer/primitive2d/glowprimitive2d.hxx|2 
 include/drawinglayer/primitive2d/groupprimitive2d.hxx   |2 
 include/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx  |2 
 include/drawinglayer/primitive2d/invertprimitive2d.hxx  |2 
 include/drawinglayer/primitive2d/maskprimitive2d.hxx|2 
 include/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx   |2 
 include/drawinglayer/primitive2d/objectinfoprimitive2d.hxx  |2 
 include/drawinglayer/primitive2d/pagehierarchyprimitive2d.hxx   |2 
 include/drawinglayer/primitive2d/shadowprimitive2d.hxx  |2 
 include/drawinglayer/primitive2d/softedgeprimitive2d.hxx|2 
 include/drawinglayer/primitive2d/structuretagprimitive2d.hxx|2 
 include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx   |   12 +-
 include/drawinglayer/primitive2d/transformprimitive2d.hxx   |2 
 include/drawinglayer/primitive2d/transparenceprimitive2d.hxx|4 
 include/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx |2 
 sd/source/ui/unoidl/unomodel.cxx|4 
 svgio/source/svgreader/svgclippathnode.cxx  |6 -
 svgio/source/svgreader/svgimagenode.cxx |4 
 svgio/source/svgreader/svgmasknode.cxx  |   20 +--
 svgio/source/svgreader/svgnode.cxx  |4 
 svgio/source/svgreader/svgstyleattributes.cxx   |   16 +-
 svgio/source/svgreader/svgsvgnode.cxx   |   12 +-
 svgio/source/svgreader/svgusenode.cxx   |2 
 svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx   |2 
 svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx  |2 
 svx/source/engine3d/view3d.cxx  |4 
 

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source include/drawinglayer include/svx svx/inc svx/source sw/source

2021-06-20 Thread Tomaž Vajngerl (via logerrit)
 drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx|2 
 drawinglayer/inc/primitive2d/textlineprimitive2d.hxx  |2 
 drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx |2 
 drawinglayer/source/primitive2d/baseprimitive2d.cxx   |2 
 include/drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx |  106 
++
 include/drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx  |3 
 include/drawinglayer/primitive2d/PolyPolygonGradientPrimitive2D.hxx   |3 
 include/drawinglayer/primitive2d/PolyPolygonGraphicPrimitive2D.hxx|3 
 include/drawinglayer/primitive2d/PolyPolygonHairlinePrimitive2D.hxx   |2 
 include/drawinglayer/primitive2d/PolyPolygonHatchPrimitive2D.hxx  |3 
 include/drawinglayer/primitive2d/PolyPolygonMarkerPrimitive2D.hxx |2 
 include/drawinglayer/primitive2d/PolyPolygonSelectionPrimitive2D.hxx  |3 
 include/drawinglayer/primitive2d/PolyPolygonStrokePrimitive2D.hxx |2 
 include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx   |2 
 include/drawinglayer/primitive2d/baseprimitive2d.hxx  |   74 
--
 include/drawinglayer/primitive2d/bitmapprimitive2d.hxx|1 
 include/drawinglayer/primitive2d/borderlineprimitive2d.hxx|2 
 include/drawinglayer/primitive2d/controlprimitive2d.hxx   |2 
 include/drawinglayer/primitive2d/embedded3dprimitive2d.hxx|2 
 include/drawinglayer/primitive2d/epsprimitive2d.hxx   |2 
 include/drawinglayer/primitive2d/fillgradientprimitive2d.hxx  |2 
 include/drawinglayer/primitive2d/fillgraphicprimitive2d.hxx   |2 
 include/drawinglayer/primitive2d/graphicprimitive2d.hxx   |2 
 include/drawinglayer/primitive2d/gridprimitive2d.hxx  |2 
 include/drawinglayer/primitive2d/groupprimitive2d.hxx |2 
 include/drawinglayer/primitive2d/helplineprimitive2d.hxx  |2 
 include/drawinglayer/primitive2d/markerarrayprimitive2d.hxx   |2 
 include/drawinglayer/primitive2d/mediaprimitive2d.hxx |2 
 include/drawinglayer/primitive2d/metafileprimitive2d.hxx  |2 
 include/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx   |2 
 include/drawinglayer/primitive2d/patternfillprimitive2d.hxx   |2 
 include/drawinglayer/primitive2d/polygonprimitive2d.hxx   |2 
 include/drawinglayer/primitive2d/primitivetools2d.hxx |2 
 include/drawinglayer/primitive2d/sceneprimitive2d.hxx |2 
 include/drawinglayer/primitive2d/svggradientprimitive2d.hxx   |2 
 include/drawinglayer/primitive2d/textprimitive2d.hxx  |2 
 include/drawinglayer/primitive2d/wrongspellprimitive2d.hxx|2 
 include/svx/sdr/primitive2d/sdrframeborderprimitive2d.hxx |2 
 svx/inc/sdr/primitive2d/sdrcaptionprimitive2d.hxx |2 
 svx/inc/sdr/primitive2d/sdrconnectorprimitive2d.hxx   |2 
 svx/inc/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx |2 
 svx/inc/sdr/primitive2d/sdrellipseprimitive2d.hxx |2 
 svx/inc/sdr/primitive2d/sdrgrafprimitive2d.hxx|2 
 svx/inc/sdr/primitive2d/sdrmeasureprimitive2d.hxx |2 
 svx/inc/sdr/primitive2d/sdrolecontentprimitive2d.hxx  |2 
 svx/inc/sdr/primitive2d/sdrpathprimitive2d.hxx|2 
 svx/inc/sdr/primitive2d/sdrrectangleprimitive2d.hxx   |2 
 svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx|2 
 svx/source/table/viewcontactoftableobj.cxx|1 
 sw/source/core/draw/dflyobj.cxx   |2 
 50 files changed, 163 insertions(+), 116 deletions(-)

New commits:
commit 7e478166361248c3f3c923b9f0d18dc25d30ef15
Author: Tomaž Vajngerl 
AuthorDate: Sun Jun 20 23:52:32 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 21 02:22:32 2021 +0200

drawinglayer: put BufferedDecompositionPrimitive2D in its own file

And fix includes all over the place...

Change-Id: I6e2696bbeeac6ab7467cac70545fa7209aa981a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117528
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
index 45a21f67dab8..ce62b3110199 100644
--- a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
@@ -19,7 +19,7 @@
 
 #pragma once
 
-#include 
+#include 
 #include 
 
 namespace drawinglayer::primitive2d
diff --git a/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx 

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source

2021-05-30 Thread Noel Grandin (via logerrit)
 drawinglayer/inc/processor3d/zbufferprocessor3d.hxx|2 -
 drawinglayer/source/processor3d/zbufferprocessor3d.cxx |   26 +
 2 files changed, 9 insertions(+), 19 deletions(-)

New commits:
commit 039c7999d4b92122cb4a356a1e65f62026c04173
Author: Noel Grandin 
AuthorDate: Sun May 30 10:17:12 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun May 30 20:18:52 2021 +0200

no need to allocate this separately

Change-Id: I78260d3e6ad8ce96db4353fede18d5e3a6808402
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116400
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/drawinglayer/inc/processor3d/zbufferprocessor3d.hxx 
b/drawinglayer/inc/processor3d/zbufferprocessor3d.hxx
index 642781e58177..4207a6fcd474 100644
--- a/drawinglayer/inc/processor3d/zbufferprocessor3d.hxx
+++ b/drawinglayer/inc/processor3d/zbufferprocessor3d.hxx
@@ -61,7 +61,7 @@ namespace drawinglayer::processor3d
 /*  remembered RasterPrimitive3D's which need to be painted back 
to front
 for transparent 3D parts
  */
-std::unique_ptr> 
mpRasterPrimitive3Ds;
+mutable std::vector< RasterPrimitive3D > maRasterPrimitive3Ds;
 
 sal_uInt32 mnStartLine;
 sal_uInt32 mnStopLine;
diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx 
b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
index 73587089b192..56cfc3c45c18 100644
--- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
@@ -422,12 +422,8 @@ namespace drawinglayer::processor3d
 {
 // transparent output; record for later sorting and painting 
from
 // back to front
-if(!mpRasterPrimitive3Ds)
-{
-const_cast< ZBufferProcessor3D* 
>(this)->mpRasterPrimitive3Ds.reset( new std::vector< RasterPrimitive3D > );
-}
 
-mpRasterPrimitive3Ds->push_back(RasterPrimitive3D(
+maRasterPrimitive3Ds.push_back(RasterPrimitive3D(
 getGeoTexSvx(),
 getTransparenceGeoTexSvx(),
 rMaterial,
@@ -486,12 +482,7 @@ namespace drawinglayer::processor3d
 {
 // transparent output; record for later sorting and painting 
from
 // back to front
-if(!mpRasterPrimitive3Ds)
-{
-const_cast< ZBufferProcessor3D* 
>(this)->mpRasterPrimitive3Ds.reset( new std::vector< RasterPrimitive3D > );
-}
-
-mpRasterPrimitive3Ds->push_back(RasterPrimitive3D(
+maRasterPrimitive3Ds.push_back(RasterPrimitive3D(
 getGeoTexSvx(),
 getTransparenceGeoTexSvx(),
 rMaterial,
@@ -596,32 +587,31 @@ namespace drawinglayer::processor3d
 {
 mpZBufferRasterConverter3D.reset();
 
-if(mpRasterPrimitive3Ds)
+if(!maRasterPrimitive3Ds.empty())
 {
 OSL_FAIL("ZBufferProcessor3D: destructed, but there are 
unrendered transparent geometries. Use ZBufferProcessor3D::finish() to render 
these (!)");
 }
-mpRasterPrimitive3Ds.reset();
 }
 
 void ZBufferProcessor3D::finish()
 {
-if(!mpRasterPrimitive3Ds)
+if(maRasterPrimitive3Ds.empty())
 return;
 
 // there are transparent rasterprimitives
-const sal_uInt32 nSize(mpRasterPrimitive3Ds->size());
+const sal_uInt32 nSize(maRasterPrimitive3Ds.size());
 
 if(nSize > 1)
 {
 // sort them from back to front
-std::sort(mpRasterPrimitive3Ds->begin(), 
mpRasterPrimitive3Ds->end());
+std::sort(maRasterPrimitive3Ds.begin(), 
maRasterPrimitive3Ds.end());
 }
 
 for(sal_uInt32 a(0); a < nSize; a++)
 {
 // paint each one by setting the remembered data and calling
 // the render method
-const RasterPrimitive3D& rCandidate = 
(*mpRasterPrimitive3Ds)[a];
+const RasterPrimitive3D& rCandidate = maRasterPrimitive3Ds[a];
 
 mpGeoTexSvx = rCandidate.getGeoTexSvx();
 mpTransparenceGeoTexSvx = 
rCandidate.getTransparenceGeoTexSvx();
@@ -645,7 +635,7 @@ namespace drawinglayer::processor3d
 
 // delete them to signal the destructor that all is done and
 // to allow asserting there
-mpRasterPrimitive3Ds.reset();
+maRasterPrimitive3Ds.clear();
 }
 
 } // end of namespace
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source include/drawinglayer

2021-05-10 Thread Tomaž Vajngerl (via logerrit)
 drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx |2 +-
 drawinglayer/source/primitive2d/patternfillprimitive2d.cxx   |2 +-
 drawinglayer/source/tools/converters.cxx |2 +-
 include/drawinglayer/converters.hxx  |   10 --
 4 files changed, 7 insertions(+), 9 deletions(-)

New commits:
commit 1bcad85a5d48cc38ced5883de364f2c66ada273e
Author: Tomaž Vajngerl 
AuthorDate: Mon May 3 23:21:18 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue May 11 01:16:23 2021 +0200

drawinglayer: move converter.hxx to public include

Change-Id: I71a15c532ba161d69585bd47631b3a8e2f6ddd66
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115304
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx 
b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index 66b29591df7e..2f750e73af65 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -33,7 +33,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 using namespace ::com::sun::star;
 
diff --git a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx 
b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
index ec1f9621452a..0e5b1a218690 100644
--- a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
@@ -28,7 +28,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 using namespace com::sun::star;
 
diff --git a/drawinglayer/source/tools/converters.cxx 
b/drawinglayer/source/tools/converters.cxx
index 6a963748161f..d8fe291bf803 100644
--- a/drawinglayer/source/tools/converters.cxx
+++ b/drawinglayer/source/tools/converters.cxx
@@ -25,7 +25,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 #ifdef DBG_UTIL
 #include 
diff --git a/drawinglayer/inc/converters.hxx 
b/include/drawinglayer/converters.hxx
similarity index 79%
rename from drawinglayer/inc/converters.hxx
rename to include/drawinglayer/converters.hxx
index 5e4e8a49bdb5..64d0e2ce7d4e 100644
--- a/drawinglayer/inc/converters.hxx
+++ b/include/drawinglayer/converters.hxx
@@ -24,12 +24,10 @@
 
 namespace drawinglayer
 {
-BitmapEx convertToBitmapEx(
-const drawinglayer::primitive2d::Primitive2DContainer& rSeq,
-const geometry::ViewInformation2D& rViewInformation2D,
-sal_uInt32 nDiscreteWidth,
-sal_uInt32 nDiscreteHeight,
-sal_uInt32 nMaxSquarePixels);
+BitmapEx DRAWINGLAYER_DLLPUBLIC
+convertToBitmapEx(const drawinglayer::primitive2d::Primitive2DContainer& rSeq,
+  const geometry::ViewInformation2D& rViewInformation2D, 
sal_uInt32 nDiscreteWidth,
+  sal_uInt32 nDiscreteHeight, sal_uInt32 nMaxSquarePixels);
 
 } // end of namespace drawinglayer
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source

2021-02-01 Thread Antje Kazimiers (via logerrit)
 drawinglayer/inc/converters.hxx|2 +-
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx |   12 ++--
 drawinglayer/source/tools/converters.cxx   |6 +++---
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit fda6ca70c253ede3bf758f90ae7aacd49bcf6dd9
Author: Antje Kazimiers 
AuthorDate: Sat Jan 30 19:23:52 2021 +0100
Commit: Michael Stahl 
CommitDate: Mon Feb 1 15:59:28 2021 +0100

tdf#39674 Replace Quadrat

Change-Id: Icdc27fa9ab33a6c5a442760a9491e82000883ef1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110177
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/drawinglayer/inc/converters.hxx b/drawinglayer/inc/converters.hxx
index cd1fdba37bbc..5e4e8a49bdb5 100644
--- a/drawinglayer/inc/converters.hxx
+++ b/drawinglayer/inc/converters.hxx
@@ -29,7 +29,7 @@ namespace drawinglayer
 const geometry::ViewInformation2D& rViewInformation2D,
 sal_uInt32 nDiscreteWidth,
 sal_uInt32 nDiscreteHeight,
-sal_uInt32 nMaxQuadratPixels);
+sal_uInt32 nMaxSquarePixels);
 
 } // end of namespace drawinglayer
 
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index dba886f1cc32..7cf4fc4b2cd2 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2203,14 +2203,14 @@ void 
VclMetafileProcessor2D::processTransparencePrimitive2D(
 const tools::Rectangle 
aRectPixel(mpOutputDevice->LogicToPixel(aRectLogic));
 Size aSizePixel(aRectPixel.GetSize());
 ScopedVclPtrInstance aBufferDevice;
-const sal_uInt32 nMaxQuadratPixels(50);
+const sal_uInt32 nMaxSquarePixels(50);
 const sal_uInt32 nViewVisibleArea(aSizePixel.getWidth() * 
aSizePixel.getHeight());
 double fReduceFactor(1.0);
 
-if (nViewVisibleArea > nMaxQuadratPixels)
+if (nViewVisibleArea > nMaxSquarePixels)
 {
 // reduce render size
-fReduceFactor = sqrt(double(nMaxQuadratPixels) / 
static_cast(nViewVisibleArea));
+fReduceFactor = sqrt(double(nMaxSquarePixels) / 
static_cast(nViewVisibleArea));
 aSizePixel = Size(
 basegfx::fround(static_cast(aSizePixel.getWidth()) * 
fReduceFactor),
 basegfx::fround(static_cast(aSizePixel.getHeight()) * 
fReduceFactor));
@@ -2314,7 +2314,7 @@ VclMetafileProcessor2D::CreateBufferDevice(const 
basegfx::B2DRange& rCandidateRa
geometry::ViewInformation2D& 
rViewInfo,
tools::Rectangle& rRectLogic, Size& 
rSizePixel)
 {
-constexpr double fMaxQuadratPixels = 50;
+constexpr double fMaxSquarePixels = 50;
 basegfx::B2DRange aViewRange(rCandidateRange);
 aViewRange.transform(maCurrentTransformation);
 rRectLogic = 
tools::Rectangle(static_cast(std::floor(aViewRange.getMinX())),
@@ -2326,10 +2326,10 @@ VclMetafileProcessor2D::CreateBufferDevice(const 
basegfx::B2DRange& rCandidateRa
 const double fViewVisibleArea(rSizePixel.getWidth() * 
rSizePixel.getHeight());
 double fReduceFactor(1.0);
 
-if (fViewVisibleArea > fMaxQuadratPixels)
+if (fViewVisibleArea > fMaxSquarePixels)
 {
 // reduce render size
-fReduceFactor = sqrt(fMaxQuadratPixels / fViewVisibleArea);
+fReduceFactor = sqrt(fMaxSquarePixels / fViewVisibleArea);
 rSizePixel = Size(basegfx::fround(rSizePixel.getWidth() * 
fReduceFactor),
   basegfx::fround(rSizePixel.getHeight() * 
fReduceFactor));
 }
diff --git a/drawinglayer/source/tools/converters.cxx 
b/drawinglayer/source/tools/converters.cxx
index ff9b79a688fa..e1a59d0175df 100644
--- a/drawinglayer/source/tools/converters.cxx
+++ b/drawinglayer/source/tools/converters.cxx
@@ -40,7 +40,7 @@ namespace drawinglayer
 const geometry::ViewInformation2D& rViewInformation2D,
 sal_uInt32 nDiscreteWidth,
 sal_uInt32 nDiscreteHeight,
-sal_uInt32 nMaxQuadratPixels)
+sal_uInt32 nMaxSquarePixels)
 {
 BitmapEx aRetval;
 
@@ -51,10 +51,10 @@ namespace drawinglayer
 const sal_uInt32 nViewVisibleArea(nDiscreteWidth * 
nDiscreteHeight);
 drawinglayer::primitive2d::Primitive2DContainer aSequence(rSeq);
 
-if(nViewVisibleArea > nMaxQuadratPixels)
+if(nViewVisibleArea > nMaxSquarePixels)
 {
 // reduce render size
-double fReduceFactor = 
sqrt(static_cast(nMaxQuadratPixels) / 
static_cast(nViewVisibleArea));
+double fReduceFactor = 
sqrt(static_cast(nMaxSquarePixels) / 
static_cast(nViewVisibleArea));
 nDiscreteWidth = 
basegfx::fround(static_cast(nDiscreteWidth) * fReduceFactor);
   

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source solenv/clang-format

2020-08-13 Thread Tomaž Vajngerl (via logerrit)
 drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx|  140 ++---
 drawinglayer/source/primitive2d/texteffectprimitive2d.cxx |  383 ++
 solenv/clang-format/excludelist   |2 
 3 files changed, 257 insertions(+), 268 deletions(-)

New commits:
commit f9d05d109136330f3e2996586a262601e935baea
Author: Tomaž Vajngerl 
AuthorDate: Tue Jul 14 22:44:13 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Thu Aug 13 14:39:50 2020 +0200

remove texteffectprimitive2d.{cxx,hxx} from clang-format blacklist

Change-Id: I57a47358d5e4f1e41fc1c89884b7603d8afdc3bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100646
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
index ac2343220316..9a856c9f6f59 100644
--- a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
@@ -20,79 +20,79 @@
 #pragma once
 
 #include 
-
 #include 
 #include 
 
-
 namespace drawinglayer::primitive2d
-{
-/** TextEffectStyle2D definition */
-enum class TextEffectStyle2D
-{
-ReliefEmbossedDefault,
-ReliefEngravedDefault,
-ReliefEmbossed,
-ReliefEngraved,
-Outline
-};
-
-/** TextEffectPrimitive2D class
-
-This primitive embeds text primitives (normally, as can be seen can
-also be used for any other primitives) which have some TextEffect 
applied
-and create the needed geometry and embedding on decomposition.
-*/
-class TextEffectPrimitive2D final : public 
BufferedDecompositionPrimitive2D
-{
-private:
-/// the text (or other) content
-Primitive2DContainer   maTextContent;
-
-/// the style to apply, the direction and the rotation center
-const basegfx::B2DPoint maRotationCenter;
-double  mfDirection;
-TextEffectStyle2D   
meTextEffectStyle2D;
-
-/** the last used object to view transformtion used from 
getDecomposition
-for decide buffering
- */
-basegfx::B2DHomMatrix   
maLastObjectToViewTransformation;
-
-/// create local decomposition
-virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
-
-public:
-/// constructor
-TextEffectPrimitive2D(
-const Primitive2DContainer& rTextContent,
-const basegfx::B2DPoint& rRotationCenter,
-double fDirection,
-TextEffectStyle2D eTextEffectStyle2D);
-
-/// data read access
-const Primitive2DContainer& getTextContent() const { return 
maTextContent; }
-const basegfx::B2DPoint& getRotationCenter() const { return 
maRotationCenter; }
-double getDirection() const { return mfDirection; }
-TextEffectStyle2D getTextEffectStyle2D() const { return 
meTextEffectStyle2D; }
-
-/// compare operator
-virtual bool operator==(const BasePrimitive2D& rPrimitive) const 
override;
-
-/** own get range implementation to solve more effective. Content 
is by definition displaced
-by a fixed discrete unit, thus the contained geometry needs 
only once be asked for its
-own basegfx::B2DRange
- */
-virtual basegfx::B2DRange getB2DRange(const 
geometry::ViewInformation2D& rViewInformation) const override;
-
-/// provide unique ID
-virtual sal_uInt32 getPrimitive2DID() const override;
-
-/// Override standard getDecomposition to be view-dependent here
-virtual void get2DDecomposition(Primitive2DDecompositionVisitor& 
rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
-};
-
-} // end of namespace drawinglayer::primitive2d
-
+{
+/** TextEffectStyle2D definition */
+enum class TextEffectStyle2D
+{
+ReliefEmbossedDefault,
+ReliefEngravedDefault,
+ReliefEmbossed,
+ReliefEngraved,
+Outline
+};
+
+/** TextEffectPrimitive2D class
+
+This primitive embeds text primitives (normally, as can be seen can
+also be used for any other primitives) which have some TextEffect applied
+and create the needed geometry and embedding on decomposition.
+*/
+class TextEffectPrimitive2D final : public BufferedDecompositionPrimitive2D
+{
+private:
+/// the text (or other) content
+Primitive2DContainer maTextContent;
+
+/// the style to apply, the direction and the rotation center
+const 

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source include/drawinglayer

2020-07-16 Thread Noel Grandin (via logerrit)
 drawinglayer/inc/primitive2d/cropprimitive2d.hxx   |8 --
 drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx |8 --
 drawinglayer/inc/primitive2d/textlineprimitive2d.hxx   |8 --
 drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx  |   24 ++
 drawinglayer/inc/primitive2d/wallpaperprimitive2d.hxx  |8 --
 drawinglayer/inc/primitive3d/hatchtextureprimitive3d.hxx   |8 --
 drawinglayer/inc/primitive3d/hiddengeometryprimitive3d.hxx |8 --
 drawinglayer/inc/primitive3d/polygontubeprimitive3d.hxx|8 --
 drawinglayer/inc/primitive3d/sdrdecompositiontools3d.hxx   |7 -
 drawinglayer/inc/primitive3d/shadowprimitive3d.hxx |8 --
 drawinglayer/inc/primitive3d/textureprimitive3d.hxx|   40 
+++---
 drawinglayer/inc/processor3d/defaultprocessor3d.hxx|8 --
 drawinglayer/inc/processor3d/geometry2dextractor.hxx   |8 --
 drawinglayer/inc/processor3d/shadow3dextractor.hxx |8 --
 drawinglayer/inc/processor3d/zbufferprocessor3d.hxx|   11 +-
 drawinglayer/inc/texture/texture3d.hxx |   32 +++-
 drawinglayer/source/attribute/sdrglowattribute.cxx |7 -
 drawinglayer/source/primitive2d/polygonprimitive2d.cxx |5 -
 include/drawinglayer/animation/animationtiming.hxx |7 -
 include/drawinglayer/attribute/fillgradientattribute.hxx   |   16 +---
 include/drawinglayer/attribute/fillgraphicattribute.hxx|8 --
 include/drawinglayer/attribute/fillhatchattribute.hxx  |   16 +---
 include/drawinglayer/attribute/linestartendattribute.hxx   |8 --
 include/drawinglayer/attribute/materialattribute3d.hxx |8 --
 include/drawinglayer/attribute/sdrallattribute3d.hxx   |8 --
 include/drawinglayer/attribute/sdrfillattribute.hxx|8 --
 include/drawinglayer/attribute/sdrfillgraphicattribute.hxx |8 --
 include/drawinglayer/attribute/sdrglowattribute.hxx|8 --
 include/drawinglayer/attribute/sdrlightattribute3d.hxx |8 --
 include/drawinglayer/attribute/sdrlightingattribute3d.hxx  |8 --
 include/drawinglayer/attribute/sdrlineattribute.hxx|8 --
 include/drawinglayer/attribute/sdrlinestartendattribute.hxx|8 --
 include/drawinglayer/attribute/sdrobjectattribute3d.hxx|8 --
 include/drawinglayer/attribute/sdrsceneattribute3d.hxx |8 --
 include/drawinglayer/attribute/sdrshadowattribute.hxx  |8 --
 include/drawinglayer/geometry/viewinformation3d.hxx|8 --
 include/drawinglayer/primitive3d/baseprimitive3d.hxx   |   23 ++---
 include/drawinglayer/primitive3d/groupprimitive3d.hxx  |8 --
 include/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx  |8 --
 include/drawinglayer/primitive3d/polygonprimitive3d.hxx|   16 +---
 include/drawinglayer/primitive3d/polypolygonprimitive3d.hxx|8 --
 include/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx|8 --
 include/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx|7 -
 include/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx |8 --
 include/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx   |8 --
 include/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx |8 --
 include/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx  |8 --
 include/drawinglayer/primitive3d/transformprimitive3d.hxx  |8 --
 include/drawinglayer/processor2d/baseprocessor2d.hxx   |8 --
 include/drawinglayer/processor2d/contourextractor2d.hxx|8 --
 include/drawinglayer/processor2d/hittestprocessor2d.hxx|8 --
 include/drawinglayer/processor2d/linegeometryextractor2d.hxx   |8 --
 include/drawinglayer/processor2d/objectinfoextractor2d.hxx |8 --
 include/drawinglayer/processor2d/processor2dtools.hxx  |8 --
 include/drawinglayer/processor2d/processorfromoutputdevice.hxx |7 -
 include/drawinglayer/processor2d/textaspolygonextractor2d.hxx  |8 --
 include/drawinglayer/processor3d/baseprocessor3d.hxx   |8 --
 include/drawinglayer/processor3d/cutfindprocessor3d.hxx|8 --
 58 files changed, 209 insertions(+), 361 deletions(-)

New commits:
commit 1ebe85bc1fc6cf2adeb05aac78749806e20a71c2
Author: Noel Grandin 
AuthorDate: Thu Jul 16 18:11:15 2020 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 16 20:36:17 2020 +0200

compact namespace: drawinglayer

Change-Id: I32648ae81c4a06f944b70c0cca1694333ec02859
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98916
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/drawinglayer/inc/primitive2d/cropprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
index ba427eb6fba6..818e6f2b3771 100644
--- a/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
+++ 

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source include/drawinglayer solenv/clang-format

2020-05-09 Thread Tomaž Vajngerl (via logerrit)
 drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D.cxx |2 +-
 drawinglayer/source/primitive2d/epsprimitive2d.cxx  |2 +-
 drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx|2 +-
 drawinglayer/source/primitive2d/gridprimitive2d.cxx |2 +-
 drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx   |2 +-
 drawinglayer/source/processor2d/hittestprocessor2d.cxx  |2 +-
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx  |4 ++--
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |6 +++---
 drawinglayer/source/processor2d/vclprocessor2d.cxx  |4 ++--
 drawinglayer/source/tools/wmfemfhelper.cxx  |6 +++---
 solenv/clang-format/blacklist   |6 +++---
 11 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit ad3cb89f02f84ba4bbd4fc288e31ef1595db7238
Author: Tomaž Vajngerl 
AuthorDate: Tue May 5 22:21:42 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Sat May 9 21:03:58 2020 +0200

dl: move {Eps,FillHatch,PointArray}Primitive2D to global include

Change-Id: I85c10cb957f5065d964863360ca03355c87b7980
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93821
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D.cxx 
b/drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D.cxx
index 17140a549436..ad85c02f22c1 100644
--- a/drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D.cxx
+++ b/drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D.cxx
@@ -21,7 +21,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 using namespace com::sun::star;
 
diff --git a/drawinglayer/source/primitive2d/epsprimitive2d.cxx 
b/drawinglayer/source/primitive2d/epsprimitive2d.cxx
index 8ad1db87ac4d..b519547c00d7 100644
--- a/drawinglayer/source/primitive2d/epsprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/epsprimitive2d.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx 
b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
index 5919847ab33c..9c4ef03bfba3 100644
--- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drawinglayer/source/primitive2d/gridprimitive2d.cxx 
b/drawinglayer/source/primitive2d/gridprimitive2d.cxx
index 66a747452103..e1d0841678e2 100644
--- a/drawinglayer/source/primitive2d/gridprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/gridprimitive2d.cxx
@@ -18,7 +18,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx 
b/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx
index 66ca43bd8004..7e527487eb85 100644
--- a/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include 
+#include 
 #include 
 
 
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx 
b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 225fe4d5fb97..65a03548cb1c 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -27,7 +27,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index b3c0d773fbff..73438efc40f9 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -47,7 +47,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -61,7 +61,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 // for PDFExtOutDevData Graphic support
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index cb0e3124b19d..4f7d6a22f723 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -59,9 +59,9 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 96b0bf9a97b5..5af4dcac755f 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source

2020-04-14 Thread Mark Hung (via logerrit)
 drawinglayer/inc/texture/texture.hxx|6 ++-
 drawinglayer/source/texture/texture.cxx |   50 +---
 2 files changed, 19 insertions(+), 37 deletions(-)

New commits:
commit 6ab37705448393c2d4253fb9970caf73142a99f0
Author: Mark Hung 
AuthorDate: Fri Apr 3 23:42:09 2020 +0800
Commit: Noel Grandin 
CommitDate: Tue Apr 14 09:28:41 2020 +0200

drawinglayer: refactor GeoTexSvxTiled::iterateTiles

to provide a more generic callback interface and expose
it as public to allow other usage.

Change-Id: I6bc62a05fee750586f7281d8c24f2133884e77ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92134
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/drawinglayer/inc/texture/texture.hxx 
b/drawinglayer/inc/texture/texture.hxx
index c61d8d2b1674..64595a46222c 100644
--- a/drawinglayer/inc/texture/texture.hxx
+++ b/drawinglayer/inc/texture/texture.hxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 
 namespace drawinglayer
@@ -317,8 +318,6 @@ namespace drawinglayer
 double  mfOffsetX;
 double  mfOffsetY;
 
-sal_Int32 iterateTiles(::std::vector< basegfx::B2DHomMatrix >* 
pMatrices) const;
-
 public:
 GeoTexSvxTiled(
 const basegfx::B2DRange& rRange,
@@ -329,6 +328,9 @@ namespace drawinglayer
 // compare operator
 virtual bool operator==(const GeoTexSvx& rGeoTexSvx) const 
override;
 
+// Iterate over created tiles with callback provided.
+void iterateTiles(std::function 
aFunc) const;
+
 void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& 
rMatrices) const;
 sal_uInt32 getNumberOfTiles() const;
 };
diff --git a/drawinglayer/source/texture/texture.cxx 
b/drawinglayer/source/texture/texture.cxx
index e3cbc14e4fac..4787718195d8 100644
--- a/drawinglayer/source/texture/texture.cxx
+++ b/drawinglayer/source/texture/texture.cxx
@@ -677,18 +677,27 @@ namespace drawinglayer::texture
 
 sal_uInt32 GeoTexSvxTiled::getNumberOfTiles() const
 {
-return iterateTiles(nullptr);
+sal_Int32 nTiles = 0;
+iterateTiles([&](double, double) { ++nTiles; });
+return nTiles;
 }
 
 void GeoTexSvxTiled::appendTransformations(std::vector< 
basegfx::B2DHomMatrix >& rMatrices) const
 {
-iterateTiles();
+const double fWidth(maRange.getWidth());
+const double fHeight(maRange.getHeight());
+iterateTiles([&](double fPosX, double fPosY) {
+
rMatrices.push_back(basegfx::utils::createScaleTranslateB2DHomMatrix(
+fWidth,
+fHeight,
+fPosX,
+fPosY));
+});
 }
 
-sal_Int32 GeoTexSvxTiled::iterateTiles(std::vector< 
basegfx::B2DHomMatrix >* pMatrices) const
+void GeoTexSvxTiled::iterateTiles(std::function aFunc) const
 {
 const double fWidth(maRange.getWidth());
-sal_Int32 nTiles = 0;
 
 if(!basegfx::fTools::equalZero(fWidth))
 {
@@ -739,21 +748,7 @@ namespace drawinglayer::texture
 {
 for(double fPosY((nPosX % 2) ? fStartY - fHeight + 
(mfOffsetY * fHeight) : fStartY);
 basegfx::fTools::less(fPosY, 1.0); fPosY += 
fHeight)
-{
-if(pMatrices)
-{
-pMatrices->push_back(
-
basegfx::utils::createScaleTranslateB2DHomMatrix(
-fWidth,
-fHeight,
-fPosX,
-fPosY));
-}
-else
-{
-nTiles++;
-}
-}
+aFunc(fPosX, fPosY);
 }
 }
 else
@@ -762,27 +757,12 @@ namespace drawinglayer::texture
 {
 for(double fPosX((nPosY % 2) ? fStartX - fWidth + 
(mfOffsetX * fWidth) : fStartX);
 basegfx::fTools::less(fPosX, 1.0); fPosX += 
fWidth)
-{
-if(pMatrices)
-{
-pMatrices->push_back(
-

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source include/drawinglayer sc/source sfx2/inc sfx2/source svgio/source svx/inc svx/source sw/inc sw/source

2020-04-03 Thread Tomaž Vajngerl (via logerrit)
 drawinglayer/inc/pch/precompiled_drawinglayer.hxx|   11 
 drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx   |2 
 drawinglayer/source/primitive2d/borderlineprimitive2d.cxx|2 
 drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx  |2 
 drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx |2 
 drawinglayer/source/primitive2d/mediaprimitive2d.cxx |2 
 drawinglayer/source/primitive2d/polygonprimitive2d.cxx   |3 
 drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx   |   10 
 drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx  |3 
 drawinglayer/source/primitive2d/svggradientprimitive2d.cxx   |2 
 drawinglayer/source/primitive2d/textprimitive2d.cxx  |2 
 drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx   |2 
 drawinglayer/source/processor2d/contourextractor2d.cxx   |2 
 drawinglayer/source/processor2d/hittestprocessor2d.cxx   |2 
 drawinglayer/source/processor2d/linegeometryextractor2d.cxx  |2 
 drawinglayer/source/processor2d/textaspolygonextractor2d.cxx |3 
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx   |8 
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx  |9 
 drawinglayer/source/processor2d/vclprocessor2d.cxx   |9 
 drawinglayer/source/processor3d/geometry2dextractor.cxx  |2 
 drawinglayer/source/processor3d/shadow3dextractor.cxx|2 
 drawinglayer/source/tools/emfphelperdata.cxx |8 
 drawinglayer/source/tools/primitive2dxmldump.cxx |8 
 drawinglayer/source/tools/wmfemfhelper.cxx   |9 
 include/drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx |   67 +
 include/drawinglayer/primitive2d/PolyPolygonGradientPrimitive2D.hxx  |   76 +
 include/drawinglayer/primitive2d/PolyPolygonGraphicPrimitive2D.hxx   |   73 +
 include/drawinglayer/primitive2d/PolyPolygonHairlinePrimitive2D.hxx  |   79 +
 include/drawinglayer/primitive2d/PolyPolygonHatchPrimitive2D.hxx |   83 ++
 include/drawinglayer/primitive2d/PolyPolygonMarkerPrimitive2D.hxx|   88 ++
 include/drawinglayer/primitive2d/PolyPolygonSelectionPrimitive2D.hxx |   85 ++
 include/drawinglayer/primitive2d/PolyPolygonStrokePrimitive2D.hxx|   87 ++
 include/drawinglayer/primitive2d/polypolygonprimitive2d.hxx  |  415 
--
 sc/source/ui/view/hintwin.cxx|2 
 sc/source/ui/view/overlayobject.cxx  |2 
 sfx2/inc/pch/precompiled_sfx.hxx |   12 
 sfx2/source/control/emojiviewitem.cxx|2 
 sfx2/source/control/templateviewitem.cxx |3 
 sfx2/source/control/thumbnailview.cxx|2 
 sfx2/source/control/thumbnailviewitem.cxx|2 
 sfx2/source/dialog/infobar.cxx   |3 
 svgio/source/svgreader/svgstyleattributes.cxx|3 
 svx/inc/pch/precompiled_svxcore.hxx  |   79 -
 svx/source/sdr/contact/viewcontactofsdrpage.cxx  |3 
 svx/source/sdr/contact/viewobjectcontactofpageobj.cxx|2 
 svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx |2 
 svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx|2 
 svx/source/sdr/overlay/overlayobjectcell.cxx |2 
 svx/source/sdr/overlay/overlaypolypolygon.cxx|3 
 svx/source/sdr/overlay/overlayrollingrectangle.cxx   |4 
 svx/source/sdr/overlay/overlayselection.cxx  |3 
 svx/source/sdr/overlay/overlaytools.cxx  |4 
 svx/source/sdr/overlay/overlaytriangle.cxx   |2 
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |5 
 svx/source/svdraw/svddrgmt.cxx   |3 
 svx/source/table/tablehandles.cxx|2 
 svx/source/xoutdev/xtabgrdt.cxx  |2 
 svx/source/xoutdev/xtabhtch.cxx  |2 
 sw/inc/pch/precompiled_sw.hxx|3 
 sw/source/core/crsr/overlayrangesoutline.cxx |2 
 sw/source/core/layout/paintfrm.cxx   |2 
 sw/source/uibase/docvw/AnchorOverlayObject.cxx   |2 
 sw/source/uibase/docvw/DashedLine.cxx|2 
 sw/source/uibase/docvw/HeaderFooterWin.cxx  

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source include/drawinglayer solenv/clang-format

2020-03-21 Thread Noel Grandin (via logerrit)
 drawinglayer/inc/pch/precompiled_drawinglayer.hxx |   12 --
 drawinglayer/inc/primitive3d/hatchtextureprimitive3d.hxx  |7 -
 drawinglayer/inc/primitive3d/hiddengeometryprimitive3d.hxx|5 -
 drawinglayer/inc/primitive3d/polygontubeprimitive3d.hxx   |5 -
 drawinglayer/inc/primitive3d/sdrdecompositiontools3d.hxx  |   23 ++---
 drawinglayer/inc/primitive3d/shadowprimitive3d.hxx|5 -
 drawinglayer/inc/primitive3d/textureprimitive3d.hxx   |5 -
 drawinglayer/inc/processor3d/defaultprocessor3d.hxx   |5 -
 drawinglayer/inc/processor3d/geometry2dextractor.hxx  |4 
 drawinglayer/inc/processor3d/shadow3dextractor.hxx|5 -
 drawinglayer/inc/processor3d/zbufferprocessor3d.hxx   |7 -
 drawinglayer/inc/texture/texture.hxx  |5 -
 drawinglayer/inc/texture/texture3d.hxx|7 -
 drawinglayer/source/primitive2d/cropprimitive2d.cxx   |2 
 drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx |2 
 drawinglayer/source/primitive2d/epsprimitive2d.cxx|2 
 drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx   |2 
 drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx|4 
 drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx  |4 
 drawinglayer/source/primitive2d/graphicprimitive2d.cxx|4 
 drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx  |2 
 drawinglayer/source/primitive2d/gridprimitive2d.cxx   |2 
 drawinglayer/source/primitive2d/patternfillprimitive2d.cxx|2 
 drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx |2 
 drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx|2 
 drawinglayer/source/primitive2d/sceneprimitive2d.cxx  |6 -
 drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx  |6 -
 drawinglayer/source/primitive2d/texteffectprimitive2d.cxx |2 
 drawinglayer/source/primitive2d/textlineprimitive2d.cxx   |2 
 drawinglayer/source/primitive2d/textprimitive2d.cxx   |2 
 drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx  |2 
 drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx  |2 
 drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx   |4 
 drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx |2 
 drawinglayer/source/primitive3d/polygonprimitive3d.cxx|2 
 drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx|2 
 drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx|2 
 drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx   |   10 +-
 drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx |2 
 drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx   |2 
 drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx |2 
 drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx  |2 
 drawinglayer/source/primitive3d/shadowprimitive3d.cxx |2 
 drawinglayer/source/primitive3d/textureprimitive3d.cxx|2 
 drawinglayer/source/processor2d/hittestprocessor2d.cxx|2 
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx|4 
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx   |6 -
 drawinglayer/source/processor2d/vclprocessor2d.cxx|4 
 drawinglayer/source/processor3d/cutfindprocessor3d.cxx|4 
 drawinglayer/source/processor3d/defaultprocessor3d.cxx|   10 +-
 drawinglayer/source/processor3d/geometry2dextractor.cxx   |4 
 drawinglayer/source/processor3d/shadow3dextractor.cxx |4 
 drawinglayer/source/processor3d/zbufferprocessor3d.cxx|4 
 drawinglayer/source/texture/texture.cxx   |2 
 drawinglayer/source/texture/texture3d.cxx |4 
 drawinglayer/source/tools/wmfemfhelper.cxx|   12 +-
 solenv/clang-format/blacklist |   44 +-
 57 files changed, 121 insertions(+), 164 deletions(-)

New commits:
commit ad38105f45b517e09bf65a76e66517ece41fb62e
Author: Noel Grandin 
AuthorDate: Fri Mar 20 12:09:42 2020 +0200
Commit: Noel Grandin 
CommitDate: Sat Mar 21 10:30:07 2020 +0100

move headers inside modules

Change-Id: Iad5c414861eb807e6246b8a988b94d66ef5f687d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90776
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx 
b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
index c07ffd345150..b5fb42d97e6e 100644
--- a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
+++ b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
@@ -13,7 +13,7 @@
  manual changes will be rewritten by the next run of update_pch.sh (which 
presumably
  also fixes all possible problems, so it's usually better to use it).
 
- 

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source

2020-03-09 Thread Tomaž Vajngerl (via logerrit)
 drawinglayer/inc/converters.hxx|3 ---
 drawinglayer/source/primitive2d/polygonprimitive2d.cxx |6 --
 drawinglayer/source/texture/texture.cxx|   10 +-
 3 files changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 60b041f1a0bb5312dd4147698bb1a829dc25227b
Author: Tomaž Vajngerl 
AuthorDate: Sun Mar 8 17:54:32 2020 +0100
Commit: Tomaž Vajngerl 
CommitDate: Mon Mar 9 17:17:38 2020 +0100

drawinglayer: move getRandomColorRange to be private to GeoTexSvx

Change-Id: I9b306277a67b793ffd065d40446909ac59da0641
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90190
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/drawinglayer/inc/converters.hxx b/drawinglayer/inc/converters.hxx
index acc00f3c4b3c..4f585d5d08db 100644
--- a/drawinglayer/inc/converters.hxx
+++ b/drawinglayer/inc/converters.hxx
@@ -24,7 +24,6 @@
 
 namespace drawinglayer
 {
-
 BitmapEx convertToBitmapEx(
 const drawinglayer::primitive2d::Primitive2DContainer& rSeq,
 const geometry::ViewInformation2D& rViewInformation2D,
@@ -32,8 +31,6 @@ namespace drawinglayer
 sal_uInt32 nDiscreteHeight,
 sal_uInt32 nMaxQuadratPixels);
 
-double getRandomColorRange();
-
 } // end of namespace drawinglayer
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx 
b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
index cdcc843a8b17..a93deae3817f 100644
--- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
@@ -24,7 +24,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
@@ -196,11 +195,6 @@ namespace drawinglayer::primitive2d
 
 namespace drawinglayer
 {
-double getRandomColorRange()
-{
-return comphelper::rng::uniform_real_distribution(0.0, nextafter(1.0, 
DBL_MAX));
-}
-
 namespace primitive2d
 {
 void 
PolygonStrokePrimitive2D::create2DDecomposition(Primitive2DContainer& 
rContainer, const geometry::ViewInformation2D& /*rViewInformation*/) const
diff --git a/drawinglayer/source/texture/texture.cxx 
b/drawinglayer/source/texture/texture.cxx
index 8aa121462465..7ca4a4f1b164 100644
--- a/drawinglayer/source/texture/texture.cxx
+++ b/drawinglayer/source/texture/texture.cxx
@@ -26,10 +26,18 @@
 #include 
 #include 
 
-#include 
+#include 
 
 namespace drawinglayer::texture
 {
+namespace
+{
+double getRandomColorRange()
+{
+return comphelper::rng::uniform_real_distribution(0.0, 
nextafter(1.0, DBL_MAX));
+}
+}
+
 GeoTexSvx::GeoTexSvx()
 {
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source filter/source include/IwyuFilter_include.yaml include/vcl sc/source sd/source sfx2/source svtools/source vcl/inc vcl/osx vcl/source

2018-12-03 Thread Libreoffice Gerrit user
 drawinglayer/inc/wmfemfhelper.hxx|1 +
 drawinglayer/source/processor2d/processor2dtools.cxx |1 +
 filter/source/pdf/impdialog.cxx  |1 +
 filter/source/pdf/pdfexport.cxx  |2 ++
 include/IwyuFilter_include.yaml  |9 -
 include/vcl/NotebookbarContextControl.hxx|2 --
 include/vcl/notebookbar.hxx  |6 +++---
 include/vcl/opengl/OpenGLContext.hxx |6 --
 include/vcl/opengl/OpenGLHelper.hxx  |3 ++-
 include/vcl/outdev.hxx   |   14 +-
 include/vcl/outdevstate.hxx  |8 
 include/vcl/pdfextoutdevdata.hxx |5 +
 include/vcl/pdfwriter.hxx|   14 +-
 include/vcl/pngwrite.hxx |9 ++---
 include/vcl/ppdparser.hxx|6 --
 include/vcl/print.hxx|7 ++-
 include/vcl/prntypes.hxx |1 -
 include/vcl/region.hxx   |1 -
 sc/source/ui/app/transobj.cxx|1 +
 sd/source/ui/view/DocumentRenderer.cxx   |1 +
 sfx2/source/doc/new.cxx  |1 +
 sfx2/source/doc/objcont.cxx  |1 +
 sfx2/source/doc/sfxbasemodel.cxx |1 +
 svtools/source/filter/DocumentToGraphicRenderer.cxx  |1 +
 vcl/inc/jobset.h |1 +
 vcl/inc/printdlg.hxx |5 +
 vcl/inc/salprn.hxx   |1 +
 vcl/osx/salprn.cxx   |1 +
 vcl/source/filter/ipdf/pdfdocument.cxx   |1 +
 vcl/source/gdi/pdfwriter_impl.cxx|1 +
 vcl/source/gdi/pdfwriter_impl.hxx|1 +
 vcl/source/gdi/pdfwriter_impl2.cxx   |1 +
 vcl/source/gdi/pngwrite.cxx  |3 +++
 vcl/unx/generic/print/genprnpsp.cxx  |1 +
 34 files changed, 59 insertions(+), 59 deletions(-)

New commits:
commit be99b42489b3dad31e2a92ece937131803b17275
Author: Gabor Kelemen 
AuthorDate: Sat Dec 1 17:59:14 2018 +0100
Commit: Miklos Vajna 
CommitDate: Mon Dec 3 15:13:07 2018 +0100

tdf#42949 Fix IWYU warnings in include/vcl/[n-r]*

Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I5a4951e983078ab6b6cbf0e96b00a20584b85e20
Reviewed-on: https://gerrit.libreoffice.org/64398
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/drawinglayer/inc/wmfemfhelper.hxx 
b/drawinglayer/inc/wmfemfhelper.hxx
index 2af7cce6904d..d88a6385fc26 100644
--- a/drawinglayer/inc/wmfemfhelper.hxx
+++ b/drawinglayer/inc/wmfemfhelper.hxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 // predefines
diff --git a/drawinglayer/source/processor2d/processor2dtools.cxx 
b/drawinglayer/source/processor2d/processor2dtools.cxx
index 9d7e1aed245c..1149e5271b9e 100644
--- a/drawinglayer/source/processor2d/processor2dtools.cxx
+++ b/drawinglayer/source/processor2d/processor2dtools.cxx
@@ -18,6 +18,7 @@
  */
 #include 
 #include 
+#include 
 #include "vclpixelprocessor2d.hxx"
 #include "vclmetafileprocessor2d.hxx"
 
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 8b372cf752cf..ea069da20b75 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static OUString PDFFilterResId(const char* pId)
 {
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 88f212fbb609..2f788b9b3539 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -72,6 +72,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 
diff --git a/include/IwyuFilter_include.yaml b/include/IwyuFilter_include.yaml
index 3d6389e633f3..0615d343c09d 100644
--- a/include/IwyuFilter_include.yaml
+++ b/include/IwyuFilter_include.yaml
@@ -326,4 +326,11 @@ blacklist:
 # Needed for macros
 - com/sun/star/awt/Key.hpp
 - com/sun/star/awt/KeyGroup.hpp
-
+include/vcl/outdevstate.hxx:
+# Full definition needed for boost::optional
+- vcl/mapmod.hxx
+- tools/color.hxx
+- tools/gen.hxx
+include/vcl/prntypes.hxx:
+# Needed for macro
+- tools/solar.h
diff --git a/include/vcl/NotebookbarContextControl.hxx 
b/include/vcl/NotebookbarContextControl.hxx
index b338d8dd3e57..ce557c54904f 100644
--- a/include/vcl/NotebookbarContextControl.hxx
+++ b/include/vcl/NotebookbarContextControl.hxx
@@ -12,8 +12,6 @@
 
 #include 
 
-class NotebookBar;
-
 class NotebookbarContextControl
 {
 public:
diff --git 

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source

2017-10-18 Thread Noel Grandin
 drawinglayer/inc/wmfemfhelper.hxx|5 -
 drawinglayer/source/tools/emfphelperdata.cxx |   23 +++
 drawinglayer/source/tools/wmfemfhelper.cxx   |   87 ---
 3 files changed, 54 insertions(+), 61 deletions(-)

New commits:
commit da9d85ae699b841a6d6616e6db9d9dbb23ed73c0
Author: Noel Grandin 
Date:   Wed Oct 18 10:54:11 2017 +0200

use std::unique_ptr in wmfemfhelper::TargetHolder

Change-Id: I2fab3b9a111513ac711a6480eb240de99eea1991
Reviewed-on: https://gerrit.libreoffice.org/43486
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/drawinglayer/inc/wmfemfhelper.hxx 
b/drawinglayer/inc/wmfemfhelper.hxx
index 7ae8e64ad6e8..2af7cce6904d 100644
--- a/drawinglayer/inc/wmfemfhelper.hxx
+++ b/drawinglayer/inc/wmfemfhelper.hxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 // predefines
 namespace drawinglayer { namespace geometry { class ViewInformation2D; }}
@@ -42,13 +43,13 @@ namespace wmfemfhelper
 class TargetHolder
 {
 private:
-std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aTargets;
+std::vector< 
std::unique_ptr > aTargets;
 
 public:
 TargetHolder();
 ~TargetHolder();
 sal_uInt32 size() const;
-void append(drawinglayer::primitive2d::BasePrimitive2D* pCandidate);
+void 
append(std::unique_ptr pCandidate);
 drawinglayer::primitive2d::Primitive2DContainer 
getPrimitive2DSequence(const PropertyHolder& rPropertyHolder);
 };
 }
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx 
b/drawinglayer/source/tools/emfphelperdata.cxx
index d769ea9a0b9d..19d24eb77481 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -421,7 +422,7 @@ namespace emfplushelper
 
 }
 mrTargetHolders.Current().append(
-new 
drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D(
+
o3tl::make_unique(
 polygon,
 lineAttribute,
 aStrokeAttribute));
@@ -437,7 +438,7 @@ namespace emfplushelper
 }
 drawinglayer::attribute::StrokeAttribute 
strokeAttribute(aPattern);
 mrTargetHolders.Current().append(
-new 
drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D(
+
o3tl::make_unique(
 polygon,
 lineAttribute,
 strokeAttribute));
@@ -446,7 +447,7 @@ namespace emfplushelper
 else // no further line decoration, so use simple primitive
 {
 mrTargetHolders.Current().append(
-new 
drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D(
+
o3tl::make_unique(
 polygon,
 lineAttribute));
 }
@@ -466,7 +467,7 @@ namespace emfplushelper
 if (isColor) // use Color
 {
 mrTargetHolders.Current().append(
-new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+
o3tl::make_unique(
 polygon,
 ::Color(0xff - (brushIndexOrColor >> 24), 
(brushIndexOrColor >> 16) & 0xff, (brushIndexOrColor >> 8) & 0xff, 
brushIndexOrColor & 0xff).getBColor()));
 
@@ -525,7 +526,7 @@ namespace emfplushelper
 // temporal solution: create a solid colored polygon
 // TODO create a 'real' hatching primitive
 mrTargetHolders.Current().append(
-new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+
o3tl::make_unique(
 polygon,
 fillColor.getBColor()));
 }
@@ -634,7 +635,7 @@ namespace emfplushelper
 
 // create the same one used for SVG
 mrTargetHolders.Current().append(
-new 
drawinglayer::primitive2d::SvgLinearGradientPrimitive2D(
+
o3tl::make_unique(
 aTextureTransformation,
 polygon,
 aVector,
@@ -650,7 +651,7 @@ namespace emfplushelper
 
 // create the same one used for SVG
 mrTargetHolders.Current().append(
-new 
drawinglayer::primitive2d::SvgRadialGradientPrimitive2D(
+
o3tl::make_unique(
 aTextureTransformation,
 polygon,
 aVector,
@@ -1130,7 +1131,7 @@ namespace emfplushelper
 if (aSize.Width() > 0 && 

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source include/drawinglayer

2017-09-22 Thread Tor Lillqvist
 drawinglayer/inc/converters.hxx  |   30 -
 drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx |5 
 drawinglayer/source/primitive2d/patternfillprimitive2d.cxx   |5 
 drawinglayer/source/primitive2d/polygonprimitive2d.cxx   |9 
 drawinglayer/source/texture/texture.cxx  |9 
 drawinglayer/source/tools/converters.cxx |  194 +--
 6 files changed, 123 insertions(+), 129 deletions(-)

New commits:
commit 632edfabe8065cd59a237d975ee03468ce4d868b
Author: Tor Lillqvist 
Date:   Fri Sep 22 10:21:50 2017 +0300

 can be internal to drawinglayer

And while moving it, get rid of the 'drawinglyer::tools' subnamespace.
Less potential confusion with the global 'tools' namespace.

Change-Id: Iab3c25be0cec7f3d182228d122837e9f2ac9a529
Reviewed-on: https://gerrit.libreoffice.org/42619
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/include/drawinglayer/tools/converters.hxx 
b/drawinglayer/inc/converters.hxx
similarity index 65%
rename from include/drawinglayer/tools/converters.hxx
rename to drawinglayer/inc/converters.hxx
index c5f6bcd38c49..6f520509bb2f 100644
--- a/include/drawinglayer/tools/converters.hxx
+++ b/drawinglayer/inc/converters.hxx
@@ -17,31 +17,27 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_DRAWINGLAYER_TOOLS_CONVERTERS_HXX
-#define INCLUDED_DRAWINGLAYER_TOOLS_CONVERTERS_HXX
+#ifndef INCLUDED_DRAWINGLAYER_INC_CONVERTERS_HXX
+#define INCLUDED_DRAWINGLAYER_INC_CONVERTERS_HXX
 
 #include 
 #include 
 #include 
 
-
 namespace drawinglayer
 {
-namespace tools
-{
-BitmapEx DRAWINGLAYER_DLLPUBLIC convertToBitmapEx(
-const drawinglayer::primitive2d::Primitive2DContainer& rSeq,
-const geometry::ViewInformation2D& rViewInformation2D,
-sal_uInt32 nDiscreteWidth,
-sal_uInt32 nDiscreteHeight,
-sal_uInt32 nMaxQuadratPixels);
-
-double DRAWINGLAYER_DLLPUBLIC getRandomColorRange();
-
-} // end of namespace tools
-} // end of namespace drawinglayer
 
+BitmapEx convertToBitmapEx(
+const drawinglayer::primitive2d::Primitive2DContainer& rSeq,
+const geometry::ViewInformation2D& rViewInformation2D,
+sal_uInt32 nDiscreteWidth,
+sal_uInt32 nDiscreteHeight,
+sal_uInt32 nMaxQuadratPixels);
+
+double getRandomColorRange();
+
+} // end of namespace drawinglayer
 
-#endif // INCLUDED_DRAWINGLAYER_TOOLS_CONVERTERS_HXX
+#endif // INCLUDED_DRAWINGLAYER_INC_CONVERTERS_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx 
b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index 8a515b117e4d..02dd689b7048 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -31,12 +31,13 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
 
+#include "converters.hxx"
+
 #include 
 
 using namespace ::com::sun::star;
@@ -160,7 +161,7 @@ namespace drawinglayer
 const primitive2d::Primitive2DContainer xEmbedSeq { 
xEmbedRef };
 
 BitmapEx aBitmapEx(
-tools::convertToBitmapEx(
+convertToBitmapEx(
 xEmbedSeq,
 aViewInformation2D,
 nDiscreteWidth,
diff --git a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx 
b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
index 6d6ef225d022..ed26d32470b9 100644
--- a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
@@ -26,9 +26,10 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
+#include "converters.hxx"
+
 using namespace com::sun::star;
 
 #define MAXIMUM_SQUARE_LENGTH (186.0)
@@ -109,7 +110,7 @@ namespace drawinglayer
 const primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef 
};
 
 const BitmapEx aBitmapEx(
-tools::convertToBitmapEx(
+convertToBitmapEx(
 xEmbedSeq,
 aViewInformation2D,
 mnDiscreteWidth,
diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx 
b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
index 2f6deba32bfe..0511d3602fd4 100644
--- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
@@ -206,12 +206,9 @@ namespace drawinglayer
 
 namespace drawinglayer
 {
-namespace tools
+double getRandomColorRange()
 {
-double getRandomColorRange()
-{
-return 

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source

2017-08-16 Thread Thorsten Behrens
 drawinglayer/inc/emfplushelper.hxx   |1 
 drawinglayer/source/tools/emfphelperdata.cxx |  103 +--
 drawinglayer/source/tools/emfphelperdata.hxx |4 -
 drawinglayer/source/tools/emfppen.hxx|1 
 4 files changed, 54 insertions(+), 55 deletions(-)

New commits:
commit 791f93e01a847f475cd3f1ad5bf947ee1a45314e
Author: Thorsten Behrens 
Date:   Wed Aug 16 21:41:53 2017 +0200

Fixup source layout in emf+ parser

Non-functional change, cleaning up dog's breakfast in the
grandfathered binary parser.

Change-Id: If3592959b1580e869413910460ccf5b6c9f6f25d
Reviewed-on: https://gerrit.libreoffice.org/41230
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/drawinglayer/inc/emfplushelper.hxx 
b/drawinglayer/inc/emfplushelper.hxx
index 03fbeb43f71e..060bd04dc054 100644
--- a/drawinglayer/inc/emfplushelper.hxx
+++ b/drawinglayer/inc/emfplushelper.hxx
@@ -25,7 +25,6 @@
 #include 
 #include 
 
- /// predefines
 namespace emfplushelper { struct EmfPlusHelperData; }
 namespace wmfemfhelper { class TargetHolders; }
 namespace drawinglayer { namespace geometry { class ViewInformation2D; }}
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx 
b/drawinglayer/source/tools/emfphelperdata.cxx
index 17f27f33180f..3aaf19b60c30 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -343,7 +343,7 @@ namespace emfplushelper
 const EMFPPen* pen = 
static_cast(maEMFPObjects[brushIndexOrColor & 0xff].get());
 if (pen)
 {
-color = pen->GetColor().getBColor();
+color = pen->GetColor().getBColor();
 }
 }
 return color;
@@ -394,22 +394,22 @@ namespace emfplushelper
 basegfx::B2DLineJoin lineJoin = basegfx::B2DLineJoin::Round;
 if (pen->penDataFlags & 0x0008) // additional line join 
information
 {
-lineJoin = 
static_cast(EMFPPen::lcl_convertLineJoinType(pen->lineJoin));
+lineJoin = 
static_cast(EMFPPen::lcl_convertLineJoinType(pen->lineJoin));
 }
 
 // we need a line cap attribute
 css::drawing::LineCap lineCap = css::drawing::LineCap_BUTT;
 if (pen->penDataFlags & 0x0002) // additional line cap 
information
 {
-lineCap = 
static_cast(EMFPPen::lcl_convertStrokeCap(pen->startCap));
-SAL_WARN_IF(pen->startCap != pen->endCap, "cppcanvas.emf", "emf+ 
pen uses different start and end cap");
+lineCap = 
static_cast(EMFPPen::lcl_convertStrokeCap(pen->startCap));
+SAL_WARN_IF(pen->startCap != pen->endCap, "cppcanvas.emf", 
"emf+ pen uses different start and end cap");
 }
 // transform the pen width
 double adjustedPenWidth = pen->penWidth;
 if (!pen->penWidth) // no width specified, then use default value
 {
 adjustedPenWidth = pen->penUnit == 0 ? 0.18f   // 0.18f is 
determined by comparison with MSO  (case of Unit == World)
-: 0.05f;  // 0.05f is 
taken from old EMF+ implementation (case of Unit == Pixel etc.)
+: 0.05f;  // 0.05f is taken from old EMF+ implementation 
(case of Unit == Pixel etc.)
 }
 
 // transform and compare to 5 (the value 5 is determined by 
comparison to MSO)
@@ -445,7 +445,6 @@ namespace emfplushelper
 mrPropertyHolders.Current().setFillColor(::Color(0xff - 
(brushIndexOrColor >> 24), (brushIndexOrColor >> 16) & 0xff, (brushIndexOrColor 
>> 8) & 0xff, brushIndexOrColor & 0xff).getBColor());
 mrPropertyHolders.Current().setFillColorActive(true);
 mrPropertyHolders.Current().setLineColorActive(false);
-
 }
 else // use Brush
 {
@@ -498,9 +497,9 @@ namespace emfplushelper
 // temporal solution: create a solid colored polygon
 // TODO create a 'real' hatching primitive
 mrTargetHolders.Current().append(
-new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
-polygon,
-fillColor.getBColor()));
+new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+polygon,
+fillColor.getBColor()));
 }
 else if (brush->type == BrushTypeTextureFill)
 {
@@ -532,7 +531,7 @@ namespace emfplushelper
 
 if (brush->blendPositions)
 {
- SAL_INFO("cppcanvas.emf", "EMF+\t\tuse blend");
+SAL_INFO("cppcanvas.emf", "EMF+\t\tuse blend");
 
 // store the blendpoints in the vector
 for (int 

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source

2013-04-03 Thread Thomas Arnhold
 drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx |6 
 drawinglayer/source/geometry/viewinformation2d.cxx   |   80 ++-
 2 files changed, 20 insertions(+), 66 deletions(-)

New commits:
commit 0c85109e647ab1d1d8d87891b3bba23d90cd7e65
Author: Thomas Arnhold tho...@arnhold.org
Date:   Wed Apr 3 12:01:03 2013 +0200

fdo#62525: use cow_wrapper for ViewInformation2D

Change-Id: Ide3bce3257c9fed7bbda7276dfb55fa179d74fdd
Reviewed-on: https://gerrit.libreoffice.org/3183
Tested-by: Thorsten Behrens tbehr...@suse.com
Reviewed-by: Thorsten Behrens tbehr...@suse.com

diff --git a/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx 
b/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx
index e3d4f23..f8e0d66 100644
--- a/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx
+++ b/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx
@@ -29,6 +29,7 @@
 #include com/sun/star/uno/Sequence.h
 #include com/sun/star/beans/PropertyValue.hpp
 #include com/sun/star/drawing/XDrawPage.hpp
+#include o3tl/cow_wrapper.hxx
 
 //
 // predefines
@@ -58,9 +59,12 @@ namespace drawinglayer
 */
 class DRAWINGLAYER_DLLPUBLIC ViewInformation2D
 {
+public:
+typedef o3tl::cow_wrapper ImpViewInformation2D, 
o3tl::ThreadSafeRefCountingPolicy  ImplType;
+
 private:
 /// pointer to private implementation class
-ImpViewInformation2D*   mpViewInformation2D;
+ImplType mpViewInformation2D;
 
 public:
 /** Constructor: Create a ViewInformation2D
diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx 
b/drawinglayer/source/geometry/viewinformation2d.cxx
index 6a0b352..69b541d 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -24,6 +24,7 @@
 #include basegfx/tools/canvastools.hxx
 #include com/sun/star/geometry/AffineMatrix2D.hpp
 #include com/sun/star/geometry/RealRectangle2D.hpp
+#include rtl/instance.hxx
 
 //
 
@@ -42,9 +43,6 @@ namespace drawinglayer
 // two memory regions for pairs of 
ViewInformation2D/ImpViewInformation2D
 friend class ::drawinglayer::geometry::ViewInformation2D;
 
-// the refcounter. 0 means exclusively used
-sal_uInt32  mnRefCount;
-
 protected:
 // the object transformation
 basegfx::B2DHomMatrix   maObjectTransformation;
@@ -261,8 +259,7 @@ namespace drawinglayer
 const uno::Reference drawing::XDrawPage  rxDrawPage,
 double fViewTime,
 const uno::Sequence beans::PropertyValue  
rExtendedParameters)
-:   mnRefCount(0),
-maObjectTransformation(rObjectTransformation),
+:   maObjectTransformation(rObjectTransformation),
 maViewTransformation(rViewTransformation),
 maObjectToViewTransformation(),
 maInverseObjectToViewTransformation(),
@@ -278,8 +275,7 @@ namespace drawinglayer
 }
 
 explicit ImpViewInformation2D(const uno::Sequence 
beans::PropertyValue  rViewParameters)
-:   mnRefCount(0),
-maObjectTransformation(),
+:   maObjectTransformation(),
 maViewTransformation(),
 maObjectToViewTransformation(),
 maInverseObjectToViewTransformation(),
@@ -295,8 +291,7 @@ namespace drawinglayer
 }
 
 ImpViewInformation2D()
-:   mnRefCount(0),
-maObjectTransformation(),
+:   maObjectTransformation(),
 maViewTransformation(),
 maObjectToViewTransformation(),
 maInverseObjectToViewTransformation(),
@@ -407,21 +402,6 @@ namespace drawinglayer
  mfViewTime == rCandidate.mfViewTime
  mxExtendedInformation == 
rCandidate.mxExtendedInformation);
 }
-
-static ImpViewInformation2D* get_global_default()
-{
-static ImpViewInformation2D* pDefault = 0;
-
-if(!pDefault)
-{
-pDefault = new ImpViewInformation2D();
-
-// never delete; start with RefCount 1, not 0
-pDefault-mnRefCount++;
-}
-
-return pDefault;
-}
 };
 } // end of anonymous namespace
 } // end of namespace drawinglayer
@@ -432,6 +412,12 @@ namespace drawinglayer
 {
 namespace geometry
 {
+namespace
+{
+struct theGlobalDefault :
+public rtl::Static ViewInformation2D::ImplType, 

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source

2013-04-03 Thread Thomas Arnhold
 drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx |6 
 drawinglayer/source/geometry/viewinformation3d.cxx   |   80 ++-
 2 files changed, 20 insertions(+), 66 deletions(-)

New commits:
commit 78bec2b6f40144277464a64a9851d1dc940ed336
Author: Thomas Arnhold tho...@arnhold.org
Date:   Wed Apr 3 12:12:57 2013 +0200

fdo#62525: use cow_wrapper for ViewInformation3D

Change-Id: I4f304febfedfa4a5a89d996fe276a9413d0ef855

diff --git a/drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx 
b/drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx
index acaeff8..86c9a2c 100644
--- a/drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx
+++ b/drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx
@@ -28,6 +28,7 @@
 #include sal/config.h
 #include com/sun/star/uno/Sequence.h
 #include com/sun/star/beans/PropertyValue.hpp
+#include o3tl/cow_wrapper.hxx
 
 //
 // predefines
@@ -56,9 +57,12 @@ namespace drawinglayer
 */
 class DRAWINGLAYER_DLLPUBLIC ViewInformation3D
 {
+public:
+typedef o3tl::cow_wrapper ImpViewInformation3D, 
o3tl::ThreadSafeRefCountingPolicy  ImplType;
+
 private:
 /// pointer to private implementation class
-ImpViewInformation3D*   mpViewInformation3D;
+ImplType mpViewInformation3D;
 
 public:
 /** Constructor: Create a ViewInformation3D
diff --git a/drawinglayer/source/geometry/viewinformation3d.cxx 
b/drawinglayer/source/geometry/viewinformation3d.cxx
index 68c940ad..3569a2d 100644
--- a/drawinglayer/source/geometry/viewinformation3d.cxx
+++ b/drawinglayer/source/geometry/viewinformation3d.cxx
@@ -23,6 +23,7 @@
 #include com/sun/star/geometry/AffineMatrix3D.hpp
 #include com/sun/star/geometry/RealRectangle3D.hpp
 #include basegfx/tools/canvastools.hxx
+#include rtl/instance.hxx
 
 //
 
@@ -43,9 +44,6 @@ namespace drawinglayer
 // two memory regions for pairs of 
ViewInformation3D/ImpViewInformation3D
 friend class ::drawinglayer::geometry::ViewInformation3D;
 
-// the refcounter. 0 means exclusively used
-sal_uInt32  mnRefCount;
-
 // the 3D transformations
 // Object to World. This may change and being adapted when 
entering 3D transformation
 // groups
@@ -351,8 +349,7 @@ namespace drawinglayer
 const basegfx::B3DHomMatrix rDeviceToView,
 double fViewTime,
 const uno::Sequence beans::PropertyValue  
rExtendedParameters)
-:   mnRefCount(0),
-maObjectTransformation(rObjectTransformation),
+:   maObjectTransformation(rObjectTransformation),
 maOrientation(rOrientation),
 maProjection(rProjection),
 maDeviceToView(rDeviceToView),
@@ -364,8 +361,7 @@ namespace drawinglayer
 }
 
 explicit ImpViewInformation3D(const uno::Sequence 
beans::PropertyValue  rViewParameters)
-:   mnRefCount(0),
-maObjectTransformation(),
+:   maObjectTransformation(),
 maOrientation(),
 maProjection(),
 maDeviceToView(),
@@ -377,8 +373,7 @@ namespace drawinglayer
 }
 
 ImpViewInformation3D()
-:   mnRefCount(0),
-maObjectTransformation(),
+:   maObjectTransformation(),
 maOrientation(),
 maProjection(),
 maDeviceToView(),
@@ -433,21 +428,6 @@ namespace drawinglayer
  mfViewTime == rCandidate.mfViewTime
  mxExtendedInformation == 
rCandidate.mxExtendedInformation);
 }
-
-static ImpViewInformation3D* get_global_default()
-{
-static ImpViewInformation3D* pDefault = 0;
-
-if(!pDefault)
-{
-pDefault = new ImpViewInformation3D();
-
-// never delete; start with RefCount 1, not 0
-pDefault-mnRefCount++;
-}
-
-return pDefault;
-}
 };
 } // end of anonymous namespace
 } // end of namespace drawinglayer
@@ -458,6 +438,12 @@ namespace drawinglayer
 {
 namespace geometry
 {
+namespace
+{
+struct theGlobalDefault :
+public rtl::Static ViewInformation3D::ImplType, 
theGlobalDefault  {};
+}
+
 ViewInformation3D::ViewInformation3D(
 const basegfx::B3DHomMatrix rObjectObjectTransformation,
 const basegfx::B3DHomMatrix rOrientation,
@@ -465,81 +451,45 @@ namespace drawinglayer
 const 

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source

2013-03-28 Thread Jan Holesovsky
 drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx |3 
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx   |   31 
--
 2 files changed, 18 insertions(+), 16 deletions(-)

New commits:
commit 51f50a0dee2867b0f9e3f869e5fbe14923fcef3a
Author: Jan Holesovsky ke...@suse.cz
Date:   Thu Mar 28 10:41:57 2013 +0100

fdo#61789 Fix crash, pSvtGraphicStroke is allowed to be NULL.

Change-Id: Ia08e2e91354c9b4e543023c193b95e79d56e235b

diff --git 
a/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx 
b/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
index d174764..fa85105 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
@@ -92,6 +92,9 @@ namespace drawinglayer
 void impStartSvtGraphicStroke(SvtGraphicStroke* pSvtGraphicStroke);
 void impEndSvtGraphicStroke(SvtGraphicStroke* pSvtGraphicStroke);
 
+/// Convert the fWidth to the same space as its coordinates.
+double getTransformedLineWidth( double fWidth ) const;
+
 /// the current clipping PolyPolygon from MaskPrimitive2D
 basegfx::B2DPolyPolygon maClipPolyPolygon;
 
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 9663384..83d52c0 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -378,6 +378,18 @@ namespace drawinglayer
 }
 }
 
+double VclMetafileProcessor2D::getTransformedLineWidth( double fWidth 
) const
+{
+// #i113922# the LineWidth is duplicated in the MetaPolylineAction,
+// and also inside the SvtGraphicStroke and needs transforming into
+// the same space as its co-ordinates here cf. fdo#61789
+// This is a partial fix. When a object transformation is used 
which
+// e.g. contains a scaleX != scaleY, an unproportional scaling 
will happen.
+const basegfx::B2DVector aDiscreteUnit( maCurrentTransformation * 
basegfx::B2DVector( fWidth, 0.0 ) );
+
+return aDiscreteUnit.getLength();
+}
+
 SvtGraphicStroke* 
VclMetafileProcessor2D::impTryToCreateSvtGraphicStroke(
 const basegfx::B2DPolygon rB2DPolygon,
 const basegfx::BColor* pColor,
@@ -441,20 +453,7 @@ namespace drawinglayer
 
 if(pLineAttribute)
 {
-// pre-fill fLineWidth
-fLineWidth = pLineAttribute-getWidth();
-
-// #i113922# the LineWidth is duplicated in the 
MetaPolylineAction,
-// and also inside the SvtGraphicStroke and needs 
transforming into
-// the same space as its co-ordinates here cf. fdo#61789
-// This is a partial fix. When a object transformation is 
used which
-// e.g. contains a scaleX != scaleY, an unproportional 
scaling will happen.
-const basegfx::B2DVector 
aDiscreteUnit(maCurrentTransformation *
-   
basegfx::B2DVector(pLineAttribute-getWidth(), 0.0 ));
-fLineWidth = aDiscreteUnit.getLength();
-
-// pre-fill fMiterLength
-fMiterLength = fLineWidth;
+fLineWidth = fMiterLength = getTransformedLineWidth( 
pLineAttribute-getWidth() );
 
 // get Join
 switch(pLineAttribute-getLineJoin())
@@ -1242,8 +1241,8 @@ namespace drawinglayer
 mpOutputDevice-SetFillColor();
 
aHairLinePolyPolygon.transform(maCurrentTransformation);
 
-// use the transformed line width from the stroke 
info.
-LineInfo aLineInfo(LINE_SOLID, 
basegfx::fround(pSvtGraphicStroke-getStrokeWidth()));
+// use the transformed line width
+LineInfo aLineInfo(LINE_SOLID, 
getTransformedLineWidth(rLine.getWidth()));
 aLineInfo.SetLineJoin(rLine.getLineJoin());
 aLineInfo.SetLineCap(rLine.getLineCap());
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source

2013-03-27 Thread Thomas Arnhold
 drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx |6 
 drawinglayer/source/attribute/fillhatchattribute.cxx   |   85 
++
 2 files changed, 27 insertions(+), 64 deletions(-)

New commits:
commit 63da9d632827e7d08450dfd72bdcdfbed9c73cae
Author: Thomas Arnhold tho...@arnhold.org
Date:   Wed Mar 27 03:41:13 2013 +0100

fdo#62525: use cow_wrapper for FillHatchAttribute

Change-Id: I1581b4bca6f14bd27af12ff40a4f4c0fe08af133
Reviewed-on: https://gerrit.libreoffice.org/3073
Reviewed-by: Thorsten Behrens tbehr...@suse.com
Tested-by: Thorsten Behrens tbehr...@suse.com

diff --git a/drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx 
b/drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx
index dc2665b..7e6244b 100644
--- a/drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX
 
 #include drawinglayer/drawinglayerdllapi.h
+#include o3tl/cow_wrapper.hxx
 
 //
 // predefines
@@ -55,8 +56,11 @@ namespace drawinglayer
 {
 class DRAWINGLAYER_DLLPUBLIC FillHatchAttribute
 {
+public:
+typedef o3tl::cow_wrapper ImpFillHatchAttribute  ImplType;
+
 private:
-ImpFillHatchAttribute*  mpFillHatchAttribute;
+ImplType mpFillHatchAttribute;
 
 public:
 /// constructors/assignmentoperator/destructor
diff --git a/drawinglayer/source/attribute/fillhatchattribute.cxx 
b/drawinglayer/source/attribute/fillhatchattribute.cxx
index d3d86ee..e89628b 100644
--- a/drawinglayer/source/attribute/fillhatchattribute.cxx
+++ b/drawinglayer/source/attribute/fillhatchattribute.cxx
@@ -19,6 +19,7 @@
 
 #include drawinglayer/attribute/fillhatchattribute.hxx
 #include basegfx/color/bcolor.hxx
+#include rtl/instance.hxx
 
 //
 
@@ -29,9 +30,6 @@ namespace drawinglayer
 class ImpFillHatchAttribute
 {
 public:
-// refcounter
-sal_uInt32  mnRefCount;
-
 // data definitions
 HatchStyle  meStyle;
 double  mfDistance;
@@ -47,8 +45,7 @@ namespace drawinglayer
 double fAngle,
 const basegfx::BColor rColor,
 bool bFillBackground)
-:   mnRefCount(0),
-meStyle(eStyle),
+:   meStyle(eStyle),
 mfDistance(fDistance),
 mfAngle(fAngle),
 maColor(rColor),
@@ -56,6 +53,15 @@ namespace drawinglayer
 {
 }
 
+ImpFillHatchAttribute()
+:   meStyle(HATCHSTYLE_SINGLE),
+mfDistance(0.0),
+mfAngle(0.0),
+maColor(basegfx::BColor()),
+mbFillBackground(false)
+{
+}
+
 // data read access
 HatchStyle getStyle() const { return meStyle; }
 double getDistance() const { return mfDistance; }
@@ -71,100 +77,53 @@ namespace drawinglayer
  getColor() == rCandidate.getColor()
  isFillBackground()  == rCandidate.isFillBackground());
 }
-
-static ImpFillHatchAttribute* get_global_default()
-{
-static ImpFillHatchAttribute* pDefault = 0;
-
-if(!pDefault)
-{
-pDefault = new ImpFillHatchAttribute(
-HATCHSTYLE_SINGLE,
-0.0, 0.0,
-basegfx::BColor(),
-false);
-
-// never delete; start with RefCount 1, not 0
-pDefault-mnRefCount++;
-}
-
-return pDefault;
-}
 };
 
+namespace
+{
+struct theGlobalDefault :
+public rtl::Static FillHatchAttribute::ImplType, 
theGlobalDefault  {};
+}
+
 FillHatchAttribute::FillHatchAttribute(
 HatchStyle eStyle,
 double fDistance,
 double fAngle,
 const basegfx::BColor rColor,
 bool bFillBackground)
-:   mpFillHatchAttribute(new ImpFillHatchAttribute(
+:   mpFillHatchAttribute(ImpFillHatchAttribute(
 eStyle, fDistance, fAngle, rColor, bFillBackground))
 {
 }
 
 FillHatchAttribute::FillHatchAttribute()
-:   mpFillHatchAttribute(ImpFillHatchAttribute::get_global_default())
+:   mpFillHatchAttribute(theGlobalDefault::get())
 {
-mpFillHatchAttribute-mnRefCount++;
 }
 
 

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source

2013-03-27 Thread Thomas Arnhold
 drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx |6 
 drawinglayer/source/attribute/fontattribute.cxx   |   89 --
 2 files changed, 32 insertions(+), 63 deletions(-)

New commits:
commit 32ec7666596b2a0f27c72f9d856e2ec0f0545f6b
Author: Thomas Arnhold tho...@arnhold.org
Date:   Wed Mar 27 03:51:53 2013 +0100

fdo#62525: use cow_wrapper for FontAttribute

Change-Id: Ic07da7c7cf225a910e6f0fa4f6d20c4700e7ec7a

diff --git a/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx 
b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
index 36686fe..b49ab83 100644
--- a/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX
 
 #include drawinglayer/drawinglayerdllapi.h
+#include o3tl/cow_wrapper.hxx
 
 //
 // predefines
@@ -44,8 +45,11 @@ namespace drawinglayer
  */
 class DRAWINGLAYER_DLLPUBLIC FontAttribute
 {
+public:
+typedef o3tl::cow_wrapper ImpFontAttribute  ImplType;
+
 private:
-ImpFontAttribute*   mpFontAttribute;
+ImplType mpFontAttribute;
 
 public:
 /// constructors/assignmentoperator/destructor
diff --git a/drawinglayer/source/attribute/fontattribute.cxx 
b/drawinglayer/source/attribute/fontattribute.cxx
index 627fb6c..7f4316f 100644
--- a/drawinglayer/source/attribute/fontattribute.cxx
+++ b/drawinglayer/source/attribute/fontattribute.cxx
@@ -18,6 +18,7 @@
  */
 
 #include drawinglayer/attribute/fontattribute.hxx
+#include rtl/instance.hxx
 #include tools/string.hxx
 
 //
@@ -29,9 +30,6 @@ namespace drawinglayer
 class ImpFontAttribute
 {
 public:
-// refcounter
-sal_uInt32  mnRefCount;
-
 /// core data
 String  maFamilyName;   // 
Font Family Name
 String  maStyleName;// 
Font Style Name
@@ -57,8 +55,7 @@ namespace drawinglayer
 bool bOutline,
 bool bRTL,
 bool bBiDiStrong)
-:   mnRefCount(0),
-maFamilyName(rFamilyName),
+:   maFamilyName(rFamilyName),
 maStyleName(rStyleName),
 mnWeight(nWeight),
 mbSymbol(bSymbol),
@@ -71,6 +68,20 @@ namespace drawinglayer
 {
 }
 
+ImpFontAttribute()
+:   maFamilyName(),
+maStyleName(),
+mnWeight(0),
+mbSymbol(false),
+mbVertical(false),
+mbItalic(false),
+mbOutline(false),
+mbRTL(false),
+mbBiDiStrong(false),
+mbMonospaced(false)
+{
+}
+
 // data read access
 const String getFamilyName() const { return maFamilyName; }
 const String getStyleName() const { return maStyleName; }
@@ -96,26 +107,14 @@ namespace drawinglayer
  getBiDiStrong() == rCompare.getBiDiStrong()
  getMonospaced() == rCompare.getMonospaced());
 }
-
-static ImpFontAttribute* get_global_default()
-{
-static ImpFontAttribute* pDefault = 0;
-
-if(!pDefault)
-{
-pDefault = new ImpFontAttribute(
-String(), String(),
-0,
-false, false, false, false, false, false, false);
-
-// never delete; start with RefCount 1, not 0
-pDefault-mnRefCount++;
-}
-
-return pDefault;
-}
 };
 
+namespace
+{
+struct theGlobalDefault :
+public rtl::Static FontAttribute::ImplType, theGlobalDefault 
 {};
+}
+
 FontAttribute::FontAttribute(
 const String rFamilyName,
 const String rStyleName,
@@ -127,73 +126,39 @@ namespace drawinglayer
 bool bOutline,
 bool bRTL,
 bool bBiDiStrong)
-:   mpFontAttribute(new ImpFontAttribute(
+:   mpFontAttribute(ImpFontAttribute(
 rFamilyName, rStyleName, nWeight, bSymbol, bVertical, bItalic, 
bMonospaced, bOutline, bRTL, bBiDiStrong))
 {
 }
 
 FontAttribute::FontAttribute()
-:   mpFontAttribute(ImpFontAttribute::get_global_default())
+:   mpFontAttribute(theGlobalDefault::get())
 {
-mpFontAttribute-mnRefCount++;
 }
 
 

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source

2013-03-23 Thread Thomas Arnhold
 drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx |6 
 drawinglayer/source/attribute/sdrshadowattribute.cxx   |   81 
++
 2 files changed, 25 insertions(+), 62 deletions(-)

New commits:
commit 62fca307fc0fc775234572c79a1237494c2d72a7
Author: Thomas Arnhold tho...@arnhold.org
Date:   Sat Mar 23 05:40:32 2013 +0100

fdo#62525: use cow_wrapper for SdrShadowAttribute

Thanks to Thorsten.

Change-Id: I9b5435d2326e9ebf340e88025eeea25ff6388ea2
Reviewed-on: https://gerrit.libreoffice.org/2946
Reviewed-by: Thorsten Behrens tbehr...@suse.com
Tested-by: Thorsten Behrens tbehr...@suse.com

diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx 
b/drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx
index 91657cd..ee1f362 100644
--- a/drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSHADOWATTRIBUTE_HXX
 
 #include drawinglayer/drawinglayerdllapi.h
+#include o3tl/cow_wrapper.hxx
 
 //
 // predefines
@@ -42,8 +43,11 @@ namespace drawinglayer
 {
 class DRAWINGLAYER_DLLPUBLIC SdrShadowAttribute
 {
+public:
+typedef o3tl::cow_wrapper ImpSdrShadowAttribute  ImplType;
+
 private:
-ImpSdrShadowAttribute*  mpSdrShadowAttribute;
+ImplType mpSdrShadowAttribute;
 
 public:
 /// constructors/assignmentoperator/destructor
diff --git a/drawinglayer/source/attribute/sdrshadowattribute.cxx 
b/drawinglayer/source/attribute/sdrshadowattribute.cxx
index f6b5e49..9705f6a 100644
--- a/drawinglayer/source/attribute/sdrshadowattribute.cxx
+++ b/drawinglayer/source/attribute/sdrshadowattribute.cxx
@@ -20,6 +20,7 @@
 #include drawinglayer/attribute/sdrshadowattribute.hxx
 #include basegfx/vector/b2dvector.hxx
 #include basegfx/color/bcolor.hxx
+#include rtl/instance.hxx
 
 //
 
@@ -30,9 +31,6 @@ namespace drawinglayer
 class ImpSdrShadowAttribute
 {
 public:
-// refcounter
-sal_uInt32  mnRefCount;
-
 // shadow definitions
 basegfx::B2DVector  maOffset;   // 
shadow offset 1/100th mm
 double  mfTransparence; // 
[0.0 .. 1.0], 0.0==no transp.
@@ -42,13 +40,19 @@ namespace drawinglayer
 const basegfx::B2DVector rOffset,
 double fTransparence,
 const basegfx::BColor rColor)
-:   mnRefCount(0),
-maOffset(rOffset),
+:   maOffset(rOffset),
 mfTransparence(fTransparence),
 maColor(rColor)
 {
 }
 
+ImpSdrShadowAttribute()
+:   maOffset(basegfx::B2DVector()),
+mfTransparence(0.0),
+maColor(basegfx::BColor())
+{
+}
+
 // data read access
 const basegfx::B2DVector getOffset() const { return maOffset; }
 double getTransparence() const { return mfTransparence; }
@@ -60,97 +64,52 @@ namespace drawinglayer
  getTransparence() == rCandidate.getTransparence()
  getColor() == rCandidate.getColor());
 }
+};
 
-static ImpSdrShadowAttribute* get_global_default()
-{
-static ImpSdrShadowAttribute* pDefault = 0;
-
-if(!pDefault)
-{
-pDefault = new ImpSdrShadowAttribute(
-basegfx::B2DVector(),
-0.0,
-basegfx::BColor());
-
-// never delete; start with RefCount 1, not 0
-pDefault-mnRefCount++;
-}
+namespace
+{
+struct theGlobalDefault :
+public rtl::Static SdrShadowAttribute::ImplType, 
theGlobalDefault  {};
+}
 
-return pDefault;
-}
-};
 
 SdrShadowAttribute::SdrShadowAttribute(
 const basegfx::B2DVector rOffset,
 double fTransparence,
 const basegfx::BColor rColor)
-:   mpSdrShadowAttribute(new ImpSdrShadowAttribute(
+:   mpSdrShadowAttribute(ImpSdrShadowAttribute(
 rOffset, fTransparence, rColor))
 {
 }
 
 SdrShadowAttribute::SdrShadowAttribute()
-:   mpSdrShadowAttribute(ImpSdrShadowAttribute::get_global_default())
+:   mpSdrShadowAttribute(theGlobalDefault::get())
 {
-mpSdrShadowAttribute-mnRefCount++;
 }
 
 

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source

2013-03-23 Thread Thomas Arnhold
 drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx |6 
 drawinglayer/source/attribute/fillbitmapattribute.cxx   |   80 
++
 2 files changed, 24 insertions(+), 62 deletions(-)

New commits:
commit cafc879f8978ea9f7fca1be9f6aa5057f0a59617
Author: Thomas Arnhold tho...@arnhold.org
Date:   Sat Mar 23 06:15:47 2013 +0100

fdo#62525: use cow_wrapper for FillBitmapAttribute

Change-Id: I0f666d4baaf6dc4e9f7ea30a518a8904f01d749f
Reviewed-on: https://gerrit.libreoffice.org/2948
Reviewed-by: Thorsten Behrens tbehr...@suse.com
Tested-by: Thorsten Behrens tbehr...@suse.com

diff --git a/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx 
b/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx
index ced46b3..851dc5e 100644
--- a/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX
 
 #include drawinglayer/drawinglayerdllapi.h
+#include o3tl/cow_wrapper.hxx
 
 //
 // predefines
@@ -44,8 +45,11 @@ namespace drawinglayer
 {
 class DRAWINGLAYER_DLLPUBLIC FillBitmapAttribute
 {
+public:
+typedef o3tl::cow_wrapper ImpFillBitmapAttribute  ImplType;
+
 private:
-ImpFillBitmapAttribute* mpFillBitmapAttribute;
+ImplType mpFillBitmapAttribute;
 
 public:
 /// constructors/assignmentoperator/destructor
diff --git a/drawinglayer/source/attribute/fillbitmapattribute.cxx 
b/drawinglayer/source/attribute/fillbitmapattribute.cxx
index b315178..e2bedb4 100644
--- a/drawinglayer/source/attribute/fillbitmapattribute.cxx
+++ b/drawinglayer/source/attribute/fillbitmapattribute.cxx
@@ -29,9 +29,6 @@ namespace drawinglayer
 class ImpFillBitmapAttribute
 {
 public:
-// refcounter
-sal_uInt32  mnRefCount;
-
 // data definitions
 BitmapExmaBitmapEx;
 basegfx::B2DPoint   maTopLeft;
@@ -45,14 +42,21 @@ namespace drawinglayer
 const basegfx::B2DPoint rTopLeft,
 const basegfx::B2DVector rSize,
 bool bTiling)
-:   mnRefCount(0),
-maBitmapEx(rBitmapEx),
+:   maBitmapEx(rBitmapEx),
 maTopLeft(rTopLeft),
 maSize(rSize),
 mbTiling(bTiling)
 {
 }
 
+ImpFillBitmapAttribute()
+:   maBitmapEx(BitmapEx()),
+maTopLeft(basegfx::B2DPoint()),
+maSize(basegfx::B2DVector()),
+mbTiling(false)
+{
+}
+
 bool operator==(const ImpFillBitmapAttribute rCandidate) const
 {
 return (maBitmapEx == rCandidate.maBitmapEx
@@ -66,33 +70,20 @@ namespace drawinglayer
 const basegfx::B2DPoint getTopLeft() const { return maTopLeft; }
 const basegfx::B2DVector getSize() const { return maSize; }
 bool getTiling() const { return mbTiling; }
-
-static ImpFillBitmapAttribute* get_global_default()
-{
-static ImpFillBitmapAttribute* pDefault = 0;
-
-if(!pDefault)
-{
-pDefault = new ImpFillBitmapAttribute(
-BitmapEx(),
-basegfx::B2DPoint(),
-basegfx::B2DVector(),
-false);
-
-// never delete; start with RefCount 1, not 0
-pDefault-mnRefCount++;
-}
-
-return pDefault;
-}
 };
 
+namespace
+{
+struct theGlobalDefault :
+public rtl::Static FillBitmapAttribute::ImplType, 
theGlobalDefault  {};
+}
+
 FillBitmapAttribute::FillBitmapAttribute(
 const BitmapEx rBitmapEx,
 const basegfx::B2DPoint rTopLeft,
 const basegfx::B2DVector rSize,
 bool bTiling)
-:   mpFillBitmapAttribute(new ImpFillBitmapAttribute(
+:   mpFillBitmapAttribute(ImpFillBitmapAttribute(
 rBitmapEx, rTopLeft, rSize, bTiling))
 {
 }
@@ -100,59 +91,26 @@ namespace drawinglayer
 FillBitmapAttribute::FillBitmapAttribute(const FillBitmapAttribute 
rCandidate)
 :   mpFillBitmapAttribute(rCandidate.mpFillBitmapAttribute)
 {
-mpFillBitmapAttribute-mnRefCount++;
 }
 
 FillBitmapAttribute::~FillBitmapAttribute()
 {
-if(mpFillBitmapAttribute-mnRefCount)
-{
-mpFillBitmapAttribute-mnRefCount--;
-}
-  

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source

2013-03-23 Thread Thomas Arnhold
 drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx |6 
 drawinglayer/source/attribute/fillgradientattribute.cxx   |   89 
++
 2 files changed, 30 insertions(+), 65 deletions(-)

New commits:
commit 75ad992d1801334a2bb39e1b0bdf3ca5f3714625
Author: Thomas Arnhold tho...@arnhold.org
Date:   Sat Mar 23 06:28:11 2013 +0100

fdo#62525: use cow_wrapper for FillGradientAttribute

Change-Id: I85a9864820f49da8ebcc4a7d2c80a3c9d0c13b27

diff --git a/drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx 
b/drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx
index 6d01c86..e791193 100644
--- a/drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX
 
 #include drawinglayer/drawinglayerdllapi.h
+#include o3tl/cow_wrapper.hxx
 
 //
 // predefines
@@ -58,8 +59,11 @@ namespace drawinglayer
 {
 class DRAWINGLAYER_DLLPUBLIC FillGradientAttribute
 {
+public:
+typedef o3tl::cow_wrapper ImpFillGradientAttribute  ImplType;
+
 private:
-ImpFillGradientAttribute*   mpFillGradientAttribute;
+ImplType mpFillGradientAttribute;
 
 public:
 /// constructors/assignmentoperator/destructor
diff --git a/drawinglayer/source/attribute/fillgradientattribute.cxx 
b/drawinglayer/source/attribute/fillgradientattribute.cxx
index 987082c..6664791 100644
--- a/drawinglayer/source/attribute/fillgradientattribute.cxx
+++ b/drawinglayer/source/attribute/fillgradientattribute.cxx
@@ -19,6 +19,7 @@
 
 #include drawinglayer/attribute/fillgradientattribute.hxx
 #include basegfx/color/bcolor.hxx
+#include rtl/instance.hxx
 
 //
 
@@ -29,9 +30,6 @@ namespace drawinglayer
 class ImpFillGradientAttribute
 {
 public:
-// refcounter
-sal_uInt32  mnRefCount;
-
 // data definitions
 GradientStyle   meStyle;
 double  mfBorder;
@@ -51,8 +49,7 @@ namespace drawinglayer
 const basegfx::BColor rStartColor,
 const basegfx::BColor rEndColor,
 sal_uInt16 nSteps)
-:   mnRefCount(0),
-meStyle(eStyle),
+:   meStyle(eStyle),
 mfBorder(fBorder),
 mfOffsetX(fOffsetX),
 mfOffsetY(fOffsetY),
@@ -63,6 +60,18 @@ namespace drawinglayer
 {
 }
 
+ImpFillGradientAttribute()
+:   meStyle(GRADIENTSTYLE_LINEAR),
+mfBorder(0.0),
+mfOffsetX(0.0),
+mfOffsetY(0.0),
+mfAngle(0.0),
+maStartColor(basegfx::BColor()),
+maEndColor(basegfx::BColor()),
+mnSteps(0)
+{
+}
+
 // data read access
 GradientStyle getStyle() const { return meStyle; }
 double getBorder() const { return mfBorder; }
@@ -84,28 +93,14 @@ namespace drawinglayer
  getEndColor() == rCandidate.getEndColor()
  getSteps() == rCandidate.getSteps());
 }
-
-static ImpFillGradientAttribute* get_global_default()
-{
-static ImpFillGradientAttribute* pDefault = 0;
-
-if(!pDefault)
-{
-pDefault = new ImpFillGradientAttribute(
-GRADIENTSTYLE_LINEAR,
-0.0, 0.0, 0.0, 0.0,
-basegfx::BColor(),
-basegfx::BColor(),
-0);
-
-// never delete; start with RefCount 1, not 0
-pDefault-mnRefCount++;
-}
-
-return pDefault;
-}
 };
 
+namespace
+{
+struct theGlobalDefault :
+public rtl::Static FillGradientAttribute::ImplType, 
theGlobalDefault  {};
+}
+
 FillGradientAttribute::FillGradientAttribute(
 GradientStyle eStyle,
 double fBorder,
@@ -115,73 +110,39 @@ namespace drawinglayer
 const basegfx::BColor rStartColor,
 const basegfx::BColor rEndColor,
 sal_uInt16 nSteps)
-:   mpFillGradientAttribute(new ImpFillGradientAttribute(
+:   mpFillGradientAttribute(ImpFillGradientAttribute(
 eStyle, fBorder, fOffsetX, fOffsetY, fAngle, rStartColor, 
rEndColor, nSteps))
 {
 }
 
 FillGradientAttribute::FillGradientAttribute()
-:   

[Libreoffice-commits] core.git: drawinglayer/inc drawinglayer/source svgio/source

2013-02-22 Thread Armin Le Grand
 drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx |9 +
 drawinglayer/source/primitive2d/svggradientprimitive2d.cxx   |   83 
+++---
 svgio/source/svgreader/svgstyleattributes.cxx|2 
 3 files changed, 71 insertions(+), 23 deletions(-)

New commits:
commit 99501a839f6d777c24bc9210787fd14dc3aad67d
Author: Armin Le Grand a...@apache.org
Date:   Thu Feb 21 17:51:40 2013 +0100

#120616# Corrected SVG gradient primitive and it's decomposition

Conflicts:

drawinglayer/source/primitive2d/svggradientprimitive2d.cxx

Change-Id: I04c148303e7153a5376eae79803c540f6eba0b00

diff --git 
a/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx 
b/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx
index 39115a7..2c9e34f 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx
@@ -111,6 +111,11 @@ namespace drawinglayer
 boolmbSingleEntry : 1;
 boolmbFullyOpaque : 1;
 
+// true = interpret in unit coordinate system - object aspect 
ratio will scale result
+// false = interpret in object coordinate system - object aspect 
ratio will not scale result
+// (related to SVG's gradientUnits 
(userSpaceOnUse|objectBoundingBox)
+boolmbUseUnitCoordinates : 1;
+
 protected:
 /// local helpers
 Primitive2DSequence createSingleGradientEntryFill() const;
@@ -145,6 +150,7 @@ namespace drawinglayer
 const basegfx::B2DPolyPolygon rPolyPolygon,
 const SvgGradientEntryVector rGradientEntries,
 const basegfx::B2DPoint rStart,
+bool bUseUnitCoordinates,
 SpreadMethod aSpreadMethod = Spread_pad);
virtual ~SvgGradientHelper() {}
 
@@ -152,6 +158,7 @@ namespace drawinglayer
 const basegfx::B2DPolyPolygon getPolyPolygon() const { return 
maPolyPolygon; }
 const SvgGradientEntryVector getGradientEntries() const { return 
maGradientEntries; }
 const basegfx::B2DPoint getStart() const { return maStart; }
+bool getUseUnitCoordinates() const { return mbUseUnitCoordinates; }
 SpreadMethod getSpreadMethod() const { return maSpreadMethod; }
 
 /// compare operator
@@ -194,6 +201,7 @@ namespace drawinglayer
 const SvgGradientEntryVector rGradientEntries,
 const basegfx::B2DPoint rStart,
 const basegfx::B2DPoint rEnd,
+bool bUseUnitCoordinates,
 SpreadMethod aSpreadMethod = Spread_pad);
 virtual ~SvgLinearGradientPrimitive2D() {}
 
@@ -261,6 +269,7 @@ namespace drawinglayer
 const SvgGradientEntryVector rGradientEntries,
 const basegfx::B2DPoint rStart,
 double fRadius,
+bool bUseUnitCoordinates,
 SpreadMethod aSpreadMethod = Spread_pad,
 const basegfx::B2DPoint* pFocal = 0);
 
diff --git a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx 
b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
index a8c60da..98dc1ca 100644
--- a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
@@ -283,6 +283,7 @@ namespace drawinglayer
 const basegfx::B2DPolyPolygon rPolyPolygon,
 const SvgGradientEntryVector rGradientEntries,
 const basegfx::B2DPoint rStart,
+bool bUseUnitCoordinates,
 SpreadMethod aSpreadMethod)
 :   maPolyPolygon(rPolyPolygon),
 maGradientEntries(rGradientEntries),
@@ -291,7 +292,8 @@ namespace drawinglayer
 mbPreconditionsChecked(false),
 mbCreatesContent(false),
 mbSingleEntry(false),
-mbFullyOpaque(true)
+mbFullyOpaque(true),
+mbUseUnitCoordinates(bUseUnitCoordinates)
 {
 }
 
@@ -302,6 +304,7 @@ namespace drawinglayer
 return (getPolyPolygon() == rCompare.getPolyPolygon()
  getGradientEntries() == rCompare.getGradientEntries()
  getStart() == rCompare.getStart()
+ getUseUnitCoordinates() == rCompare.getUseUnitCoordinates()
  getSpreadMethod() == rCompare.getSpreadMethod());
 }
 
@@ -388,20 +391,37 @@ namespace drawinglayer
 basegfx::tools::createScaleTranslateB2DHomMatrix(
 fPolyWidth, fPolyHeight,
 aPolyRange.getMinX(), aPolyRange.getMinY()));
+basegfx::B2DHomMatrix aUnitGradientToObject;
+static bool bInterpretAbsolute(true);
 
-// create unit transform from