summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@Sun.COM>2010-01-27 11:51:56 +0100
committerArmin Le Grand <Armin.Le.Grand@Sun.COM>2010-01-27 11:51:56 +0100
commit071d3a90f8cc2a2248caf51aaab6075c33a13b45 (patch)
treebe0e7a0347f3f191ce4075d9714768bdb0f0b5f9 /svx/source
parent5446b023cd512e23968ea70012fee6dfb11e2713 (diff)
aw079: #i99147# attribute rework and others
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/engine3d/dragmt3d.cxx27
-rw-r--r--svx/source/engine3d/scene3d.cxx6
-rw-r--r--svx/source/engine3d/view3d.cxx6
-rw-r--r--svx/source/sdr/attribute/makefile.mk5
-rw-r--r--svx/source/sdr/attribute/sdrallattribute.cxx412
-rw-r--r--svx/source/sdr/attribute/sdrfilltextattribute.cxx92
-rw-r--r--svx/source/sdr/attribute/sdrformtextattribute.cxx339
-rw-r--r--svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx143
-rw-r--r--svx/source/sdr/attribute/sdrlinefillshadowtextattribute.cxx95
-rw-r--r--svx/source/sdr/attribute/sdrlineshadowtextattribute.cxx93
-rw-r--r--svx/source/sdr/attribute/sdrshadowtextattribute.cxx85
-rw-r--r--svx/source/sdr/attribute/sdrtextattribute.cxx475
-rw-r--r--svx/source/sdr/contact/viewcontact.cxx3
-rw-r--r--svx/source/sdr/contact/viewcontactofe3d.cxx30
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dcube.cxx19
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dextrude.cxx22
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dlathe.cxx24
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dpolygon.cxx22
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dscene.cxx117
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dsphere.cxx20
-rw-r--r--svx/source/sdr/contact/viewcontactofgraphic.cxx236
-rw-r--r--svx/source/sdr/contact/viewcontactofgroup.cxx26
-rw-r--r--svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx41
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx194
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrcircobj.cxx93
-rw-r--r--svx/source/sdr/contact/viewcontactofsdredgeobj.cxx43
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx149
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx13
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx181
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrole2obj.cxx93
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpage.cxx39
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpathobj.cxx163
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrrectobj.cxx97
-rw-r--r--svx/source/sdr/contact/viewcontactofunocontrol.cxx45
-rw-r--r--svx/source/sdr/contact/viewcontactofvirtobj.cxx41
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofe3d.cxx1
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx11
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofgroup.cxx14
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofpageobj.cxx25
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx8
-rw-r--r--svx/source/sdr/overlay/overlayobjectcell.cxx8
-rw-r--r--svx/source/sdr/overlay/overlayselection.cxx10
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx407
-rw-r--r--svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx67
-rw-r--r--svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx44
-rw-r--r--svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx27
-rw-r--r--svx/source/sdr/primitive2d/sdrdecompositiontools.cxx58
-rw-r--r--svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx116
-rw-r--r--svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx66
-rw-r--r--svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx130
-rw-r--r--svx/source/sdr/primitive2d/sdrole2primitive2d.cxx64
-rw-r--r--svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx2
-rw-r--r--svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx67
-rw-r--r--svx/source/sdr/primitive2d/sdrprimitivetools.cxx17
-rw-r--r--svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx59
-rw-r--r--svx/source/sdr/primitive3d/sdrattributecreator3d.cxx5
-rw-r--r--svx/source/sdr/properties/oleproperties.cxx80
-rw-r--r--svx/source/svdraw/svddrgmt.cxx44
-rw-r--r--svx/source/svdraw/svdedtv.cxx97
-rw-r--r--svx/source/svdraw/svdocapt.cxx2
-rw-r--r--svx/source/svdraw/svdogrp.cxx6
-rw-r--r--svx/source/svdraw/svdopath.cxx12
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx78
-rw-r--r--svx/source/table/tablehandles.cxx7
-rw-r--r--svx/source/table/viewcontactoftableobj.cxx124
65 files changed, 2862 insertions, 2283 deletions
diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx
index 7bbf9c6ca9..55a68c167b 100644
--- a/svx/source/engine3d/dragmt3d.cxx
+++ b/svx/source/engine3d/dragmt3d.cxx
@@ -70,8 +70,33 @@ E3dDragMethod::E3dDragMethod (
// eine Unit anlegen
const long nCnt(rMark.GetMarkCount());
static bool bDoInvalidate(false);
+ long nObjs(0);
- for(long nObjs = 0;nObjs < nCnt;nObjs++)
+ if(mbMoveFull)
+ {
+ // for non-visible 3D objects fallback to wireframe interaction
+ bool bInvisibleObjects(false);
+
+ for(nObjs = 0;!bInvisibleObjects && nObjs < nCnt;nObjs++)
+ {
+ E3dObject* pE3dObj = dynamic_cast< E3dObject* >(rMark.GetMark(nObjs)->GetMarkedSdrObj());
+
+ if(pE3dObj)
+ {
+ if(!pE3dObj->HasFillStyle() && !pE3dObj->HasLineStyle())
+ {
+ bInvisibleObjects = true;
+ }
+ }
+ }
+
+ if(bInvisibleObjects)
+ {
+ mbMoveFull = false;
+ }
+ }
+
+ for(nObjs = 0;nObjs < nCnt;nObjs++)
{
E3dObject* pE3dObj = dynamic_cast< E3dObject* >(rMark.GetMark(nObjs)->GetMarkedSdrObj());
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index 05de87c705..f4bbfa25b8 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -337,6 +337,12 @@ UINT16 E3dScene::GetObjIdentifier() const
return E3D_SCENE_ID;
}
+void E3dScene::SetBoundRectDirty()
+{
+ // avoid resetting aOutRect which in case of this object is model data,
+ // not re-creatable view data
+}
+
/*************************************************************************
|*
|* SetSnapRect
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index 7f0e83108e..68d31687e7 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -74,7 +74,7 @@
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
#include <svx/sdr/contact/viewobjectcontact.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -208,8 +208,8 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr
// if we have full overlay from selected objects, embed with 50% transparence, the
// transformation is added to the OverlayPrimitive2DSequenceObject
- drawinglayer::primitive2d::Primitive2DReference aUnifiedAlphaPrimitive2D(new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(aContent, 0.5));
- aContent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlphaPrimitive2D, 1);
+ drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aContent, 0.5));
+ aContent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparencePrimitive2D, 1);
sdr::overlay::OverlayPrimitive2DSequenceObject* pNew = new sdr::overlay::OverlayPrimitive2DSequenceObject(aContent);
diff --git a/svx/source/sdr/attribute/makefile.mk b/svx/source/sdr/attribute/makefile.mk
index 44e161a3b5..33ef24169a 100644
--- a/svx/source/sdr/attribute/makefile.mk
+++ b/svx/source/sdr/attribute/makefile.mk
@@ -43,7 +43,10 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
SLOFILES=\
- $(SLO)$/sdrallattribute.obj \
+ $(SLO)$/sdrfilltextattribute.obj \
+ $(SLO)$/sdrlinefillshadowtextattribute.obj \
+ $(SLO)$/sdrlineshadowtextattribute.obj \
+ $(SLO)$/sdrshadowtextattribute.obj \
$(SLO)$/sdrtextattribute.obj \
$(SLO)$/sdrformtextattribute.obj \
$(SLO)$/sdrformtextoutlineattribute.obj
diff --git a/svx/source/sdr/attribute/sdrallattribute.cxx b/svx/source/sdr/attribute/sdrallattribute.cxx
deleted file mode 100644
index 1150f5a684..0000000000
--- a/svx/source/sdr/attribute/sdrallattribute.cxx
+++ /dev/null
@@ -1,412 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: sdrallattribute.cxx,v $
- *
- * $Revision: 1.2 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "precompiled_svx.hxx"
-
-#include <svx/sdr/attribute/sdrallattribute.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
-#include <svx/sdr/attribute/sdrtextattribute.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-// pointer compare define
-#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrShadowTextAttribute::SdrShadowTextAttribute(
- SdrShadowAttribute* pShadow,
- SdrTextAttribute* pTextAttribute)
- : mpShadow(pShadow),
- mpTextAttribute(pTextAttribute)
- {
- }
-
- SdrShadowTextAttribute::SdrShadowTextAttribute(
- const SdrShadowTextAttribute& rCandidate)
- : mpShadow(0),
- mpTextAttribute(0)
- {
- *this = rCandidate;
- }
-
- SdrShadowTextAttribute::~SdrShadowTextAttribute()
- {
- delete mpShadow;
- delete mpTextAttribute;
- }
-
- SdrShadowTextAttribute& SdrShadowTextAttribute::operator=(const SdrShadowTextAttribute& rCandidate)
- {
- // handle mpShadow
- {
- // delete local mpShadow if necessary
- if(mpShadow)
- {
- delete mpShadow;
- mpShadow = 0;
- }
-
- // copy mpShadow if necessary
- if(rCandidate.mpShadow)
- {
- mpShadow = new SdrShadowAttribute(*rCandidate.mpShadow);
- }
- }
-
- // handle mpTextAttribute
- {
- // delete local mpTextAttribute if necessary
- if(mpTextAttribute)
- {
- delete mpTextAttribute;
- mpTextAttribute = 0;
- }
-
- // copy mpTextAttribute if necessary
- if(rCandidate.mpTextAttribute)
- {
- mpTextAttribute = new SdrTextAttribute(*rCandidate.mpTextAttribute);
- }
- }
-
- return *this;
- }
-
- bool SdrShadowTextAttribute::operator==(const SdrShadowTextAttribute& rCandidate) const
- {
- // handle mpShadow
- if(!pointerOrContentEqual(mpShadow, rCandidate.mpShadow))
- return false;
-
- // handle mpTextAttribute
- if(!pointerOrContentEqual(mpTextAttribute, rCandidate.mpTextAttribute))
- return false;
-
- return true;
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrFillTextAttribute::SdrFillTextAttribute(
- SdrFillAttribute* pFill,
- FillGradientAttribute* pFillFloatTransGradient,
- SdrTextAttribute* pTextAttribute)
- : mpFill(pFill),
- mpFillFloatTransGradient(pFillFloatTransGradient),
- mpTextAttribute(pTextAttribute)
- {
- }
-
- SdrFillTextAttribute::SdrFillTextAttribute(
- const SdrFillTextAttribute& rCandidate)
- : mpFill(0),
- mpFillFloatTransGradient(0),
- mpTextAttribute(0)
- {
- *this = rCandidate;
- }
-
- SdrFillTextAttribute::~SdrFillTextAttribute()
- {
- delete mpFill;
- delete mpFillFloatTransGradient;
- delete mpTextAttribute;
- }
-
- SdrFillTextAttribute& SdrFillTextAttribute::operator=(const SdrFillTextAttribute& rCandidate)
- {
- // handle mpFill
- {
- // delete local mpFill if necessary
- if(mpFill)
- {
- delete mpFill;
- mpFill = 0;
- }
-
- // copy mpFill if necessary
- if(rCandidate.mpFill)
- {
- mpFill = new attribute::SdrFillAttribute(*rCandidate.mpFill);
- }
- }
-
- // handle mpFillFloatTransGradient
- {
- // delete local mpFillFloatTransGradient if necessary
- if(mpFillFloatTransGradient)
- {
- delete mpFillFloatTransGradient;
- mpFillFloatTransGradient = 0;
- }
-
- // copy mpFillFloatTransGradient if necessary
- if(rCandidate.mpFillFloatTransGradient)
- {
- mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient);
- }
- }
-
- // handle mpTextAttribute
- {
- // delete local mpTextAttribute if necessary
- if(mpTextAttribute)
- {
- delete mpTextAttribute;
- mpTextAttribute = 0;
- }
-
- // copy mpTextAttribute if necessary
- if(rCandidate.mpTextAttribute)
- {
- mpTextAttribute = new SdrTextAttribute(*rCandidate.mpTextAttribute);
- }
- }
-
- return *this;
- }
-
- bool SdrFillTextAttribute::operator==(const SdrFillTextAttribute& rCandidate) const
- {
- // handle mpFill
- if(!pointerOrContentEqual(mpFill, rCandidate.mpFill))
- return false;
-
- // handle mpFillFloatTransGradient
- if(!pointerOrContentEqual(mpFillFloatTransGradient, rCandidate.mpFillFloatTransGradient))
- return false;
-
- // handle mpTextAttribute
- if(!pointerOrContentEqual(mpTextAttribute, rCandidate.mpTextAttribute))
- return false;
-
- return true;
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(
- SdrLineAttribute* pLine,
- SdrLineStartEndAttribute* pLineStartEnd,
- SdrShadowAttribute* pShadow,
- SdrTextAttribute* pTextAttribute)
- : SdrShadowTextAttribute(pShadow, pTextAttribute),
- mpLine(pLine),
- mpLineStartEnd(pLineStartEnd)
- {
- }
-
- SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(
- const SdrLineShadowTextAttribute& rCandidate)
- : SdrShadowTextAttribute(0, 0),
- mpLine(0),
- mpLineStartEnd(0)
- {
- *this = rCandidate;
- }
-
- SdrLineShadowTextAttribute::~SdrLineShadowTextAttribute()
- {
- delete mpLine;
- delete mpLineStartEnd;
- }
-
- SdrLineShadowTextAttribute& SdrLineShadowTextAttribute::operator=(const SdrLineShadowTextAttribute& rCandidate)
- {
- // call parent
- SdrShadowTextAttribute::operator=(rCandidate);
-
- // handle mpLine
- {
- // delete local mpLine if necessary
- if(mpLine)
- {
- delete mpLine;
- mpLine = 0;
- }
-
- // copy mpLine if necessary
- if(rCandidate.mpLine)
- {
- mpLine = new SdrLineAttribute(*rCandidate.mpLine);
- }
- }
-
- // handle mpLineStartEnd
- {
- // delete local mpLineStartEnd if necessary
- if(mpLineStartEnd)
- {
- delete mpLineStartEnd;
- mpLineStartEnd = 0;
- }
-
- // copy mpLineStartEnd if necessary
- if(rCandidate.mpLineStartEnd)
- {
- mpLineStartEnd = new SdrLineStartEndAttribute(*rCandidate.mpLineStartEnd);
- }
- }
-
- return *this;
- }
-
- bool SdrLineShadowTextAttribute::operator==(const SdrLineShadowTextAttribute& rCandidate) const
- {
- // call parent
- if(!(SdrShadowTextAttribute::operator==(rCandidate)))
- return false;
-
- // handle mpLine
- if(!pointerOrContentEqual(mpLine, rCandidate.mpLine))
- return false;
-
- // handle mpLineStartEnd
- if(!pointerOrContentEqual(mpLineStartEnd, rCandidate.mpLineStartEnd))
- return false;
-
- return true;
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(
- SdrLineAttribute* pLine,
- attribute::SdrFillAttribute* pFill,
- SdrLineStartEndAttribute* pLineStartEnd,
- SdrShadowAttribute* pShadow,
- FillGradientAttribute* pFillFloatTransGradient,
- SdrTextAttribute* pTextAttribute)
- : SdrLineShadowTextAttribute(pLine, pLineStartEnd, pShadow, pTextAttribute),
- mpFill(pFill),
- mpFillFloatTransGradient(pFillFloatTransGradient)
- {
- }
-
- SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(
- const SdrLineFillShadowTextAttribute& rCandidate)
- : SdrLineShadowTextAttribute(0, 0, 0, 0),
- mpFill(0),
- mpFillFloatTransGradient(0)
- {
- *this = rCandidate;
- }
-
- SdrLineFillShadowTextAttribute::~SdrLineFillShadowTextAttribute()
- {
- delete mpFill;
- delete mpFillFloatTransGradient;
- }
-
- SdrLineFillShadowTextAttribute& SdrLineFillShadowTextAttribute::operator=(const SdrLineFillShadowTextAttribute& rCandidate)
- {
- // call parent
- SdrLineShadowTextAttribute::operator=(rCandidate);
-
- // handle mpFill
- {
- // delete local mpFill if necessary
- if(mpFill)
- {
- delete mpFill;
- mpFill = 0;
- }
-
- // copy mpFill if necessary
- if(rCandidate.mpFill)
- {
- mpFill = new attribute::SdrFillAttribute(*rCandidate.mpFill);
- }
- }
-
- // handle mpFillFloatTransGradient
- {
- // delete local mpFillFloatTransGradient if necessary
- if(mpFillFloatTransGradient)
- {
- delete mpFillFloatTransGradient;
- mpFillFloatTransGradient = 0;
- }
-
- // copy mpFillFloatTransGradient if necessary
- if(rCandidate.mpFillFloatTransGradient)
- {
- mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient);
- }
- }
-
- return *this;
- }
-
- bool SdrLineFillShadowTextAttribute::operator==(const SdrLineFillShadowTextAttribute& rCandidate) const
- {
- // call parent
- if(!(SdrLineShadowTextAttribute::operator==(rCandidate)))
- return false;
-
- // handle mpFill
- if(!pointerOrContentEqual(mpFill, rCandidate.mpFill))
- return false;
-
- // handle mpFillFloatTransGradient
- if(!pointerOrContentEqual(mpFillFloatTransGradient, rCandidate.mpFillFloatTransGradient))
- return false;
-
- return true;
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/svx/source/sdr/attribute/sdrfilltextattribute.cxx b/svx/source/sdr/attribute/sdrfilltextattribute.cxx
new file mode 100644
index 0000000000..f31622bfc8
--- /dev/null
+++ b/svx/source/sdr/attribute/sdrfilltextattribute.cxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrallattribute.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_svx.hxx"
+
+#include <svx/sdr/attribute/sdrfilltextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ SdrFillTextAttribute::SdrFillTextAttribute(
+ const SdrFillAttribute& rFill,
+ const FillGradientAttribute& rFillFloatTransGradient,
+ const SdrTextAttribute& rTextAttribute)
+ : maFill(rFill),
+ maFillFloatTransGradient(rFillFloatTransGradient),
+ maTextAttribute(rTextAttribute)
+ {
+ }
+
+ SdrFillTextAttribute::SdrFillTextAttribute()
+ : maFill(),
+ maFillFloatTransGradient(),
+ maTextAttribute()
+ {
+ }
+
+ SdrFillTextAttribute::SdrFillTextAttribute(const SdrFillTextAttribute& rCandidate)
+ : maFill(rCandidate.getFill()),
+ maFillFloatTransGradient(rCandidate.getFillFloatTransGradient()),
+ maTextAttribute(rCandidate.getText())
+ {
+ }
+
+ SdrFillTextAttribute& SdrFillTextAttribute::operator=(const SdrFillTextAttribute& rCandidate)
+ {
+ maFill = rCandidate.getFill();
+ maFillFloatTransGradient = rCandidate.getFillFloatTransGradient();
+ maTextAttribute = rCandidate.getText();
+
+ return *this;
+ }
+
+ bool SdrFillTextAttribute::isDefault() const
+ {
+ return(getFill().isDefault()
+ && getFillFloatTransGradient().isDefault()
+ && getText().isDefault());
+ }
+
+ bool SdrFillTextAttribute::operator==(const SdrFillTextAttribute& rCandidate) const
+ {
+ return(getFill() == rCandidate.getFill()
+ && getFillFloatTransGradient() == rCandidate.getFillFloatTransGradient()
+ && getText() == rCandidate.getText());
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/attribute/sdrformtextattribute.cxx b/svx/source/sdr/attribute/sdrformtextattribute.cxx
index 619c08ade9..507ecf06a4 100644
--- a/svx/source/sdr/attribute/sdrformtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrformtextattribute.cxx
@@ -32,8 +32,8 @@
#include "precompiled_svx.hxx"
#include <svx/sdr/attribute/sdrformtextattribute.hxx>
+#include <basegfx/vector/b2enums.hxx>
#include <svl/itemset.hxx>
-
#include <svx/xftdiit.hxx>
#include <svx/xftstit.hxx>
#include <svx/xftshxy.hxx>
@@ -44,11 +44,8 @@
#include <svx/xftshcit.hxx>
#include <svx/xftmrit.hxx>
#include <svx/xftouit.hxx>
-
#include <svx/sdshtitm.hxx>
#include <svx/xlntrit.hxx>
-#include <drawinglayer/attribute/lineattribute.hxx>
-#include <drawinglayer/attribute/strokeattribute.hxx>
#include <svx/sdshcitm.hxx>
#include <svx/xlnclit.hxx>
#include <svx/xlnwtit.hxx>
@@ -56,13 +53,11 @@
#include <svx/xlineit0.hxx>
#include <svx/xdash.hxx>
#include <svx/xlndsit.hxx>
+#include <drawinglayer/attribute/lineattribute.hxx>
+#include <drawinglayer/attribute/strokeattribute.hxx>
#include <svx/sdr/attribute/sdrformtextoutlineattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
-// pointer compare define
-#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
-
-//////////////////////////////////////////////////////////////////////////////
// helper to get line, stroke and transparence attributes from SfxItemSet
namespace
@@ -158,144 +153,272 @@ namespace drawinglayer
{
namespace attribute
{
- SdrFormTextAttribute::SdrFormTextAttribute(const SfxItemSet& rSet)
- : mnFormTextDistance(((const XFormTextDistanceItem&)rSet.Get(XATTR_FORMTXTDISTANCE)).GetValue()),
- mnFormTextStart(((const XFormTextStartItem&)rSet.Get(XATTR_FORMTXTSTART)).GetValue()),
- mnFormTextShdwXVal(((const XFormTextShadowXValItem&)rSet.Get(XATTR_FORMTXTSHDWXVAL)).GetValue()),
- mnFormTextShdwYVal(((const XFormTextShadowYValItem&)rSet.Get(XATTR_FORMTXTSHDWYVAL)).GetValue()),
- mnFormTextShdwTransp(((const XFormTextShadowTranspItem&)rSet.Get(XATTR_FORMTXTSHDWTRANSP)).GetValue()),
- meFormTextStyle(((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue()),
- meFormTextAdjust(((const XFormTextAdjustItem&)rSet.Get(XATTR_FORMTXTADJUST)).GetValue()),
- meFormTextShadow(((const XFormTextShadowItem&)rSet.Get(XATTR_FORMTXTSHADOW)).GetValue()),
- maFormTextShdwColor(((const XFormTextShadowColorItem&)rSet.Get(XATTR_FORMTXTSHDWCOLOR)).GetColorValue()),
- mpOutline(0),
- mpShadowOutline(0),
- mbFormTextMirror(((const XFormTextMirrorItem&)rSet.Get(XATTR_FORMTXTMIRROR)).GetValue()),
- mbFormTextOutline(((const XFormTextOutlineItem&)rSet.Get(XATTR_FORMTXTOUTLINE)).GetValue())
+ class ImpSdrFormTextAttribute
{
- if(getFormTextOutline())
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // FormText (FontWork) Attributes
+ sal_Int32 mnFormTextDistance; // distance from line in upright direction
+ sal_Int32 mnFormTextStart; // shift from polygon start
+ sal_Int32 mnFormTextShdwXVal; // shadow distance or 10th degrees
+ sal_Int32 mnFormTextShdwYVal; // shadow distance or scaling
+ sal_uInt16 mnFormTextShdwTransp; // shadow transparence
+ XFormTextStyle meFormTextStyle; // on/off and char orientation
+ XFormTextAdjust meFormTextAdjust; // adjustment (left/right/center) and scale
+ XFormTextShadow meFormTextShadow; // shadow mode
+ Color maFormTextShdwColor; // shadow color
+
+ // outline attributes; used when getFormTextOutline() is true and (for
+ // shadow) when getFormTextShadow() != XFTSHADOW_NONE
+ SdrFormTextOutlineAttribute maOutline;
+ SdrFormTextOutlineAttribute maShadowOutline;
+
+ // bitfield
+ unsigned mbFormTextMirror : 1; // change orientation
+ unsigned mbFormTextOutline : 1; // show contour of objects
+
+ ImpSdrFormTextAttribute(const SfxItemSet& rSet)
+ : mnRefCount(0),
+ mnFormTextDistance(((const XFormTextDistanceItem&)rSet.Get(XATTR_FORMTXTDISTANCE)).GetValue()),
+ mnFormTextStart(((const XFormTextStartItem&)rSet.Get(XATTR_FORMTXTSTART)).GetValue()),
+ mnFormTextShdwXVal(((const XFormTextShadowXValItem&)rSet.Get(XATTR_FORMTXTSHDWXVAL)).GetValue()),
+ mnFormTextShdwYVal(((const XFormTextShadowYValItem&)rSet.Get(XATTR_FORMTXTSHDWYVAL)).GetValue()),
+ mnFormTextShdwTransp(((const XFormTextShadowTranspItem&)rSet.Get(XATTR_FORMTXTSHDWTRANSP)).GetValue()),
+ meFormTextStyle(((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue()),
+ meFormTextAdjust(((const XFormTextAdjustItem&)rSet.Get(XATTR_FORMTXTADJUST)).GetValue()),
+ meFormTextShadow(((const XFormTextShadowItem&)rSet.Get(XATTR_FORMTXTSHADOW)).GetValue()),
+ maFormTextShdwColor(((const XFormTextShadowColorItem&)rSet.Get(XATTR_FORMTXTSHDWCOLOR)).GetColorValue()),
+ maOutline(),
+ maShadowOutline(),
+ mbFormTextMirror(((const XFormTextMirrorItem&)rSet.Get(XATTR_FORMTXTMIRROR)).GetValue()),
+ mbFormTextOutline(((const XFormTextOutlineItem&)rSet.Get(XATTR_FORMTXTOUTLINE)).GetValue())
{
- const StrokeAttribute aStrokeAttribute(impGetStrokeAttribute(rSet));
-
- // also need to prepare attributes for outlines
+ if(getFormTextOutline())
{
- const LineAttribute aLineAttribute(impGetLineAttribute(false, rSet));
- const sal_uInt8 nTransparence(impGetStrokeTransparence(false, rSet));
-
- mpOutline = new SdrFormTextOutlineAttribute(
- aLineAttribute, aStrokeAttribute, nTransparence);
+ const StrokeAttribute aStrokeAttribute(impGetStrokeAttribute(rSet));
+
+ // also need to prepare attributes for outlines
+ {
+ const LineAttribute aLineAttribute(impGetLineAttribute(false, rSet));
+ const sal_uInt8 nTransparence(impGetStrokeTransparence(false, rSet));
+
+ maOutline = SdrFormTextOutlineAttribute(
+ aLineAttribute, aStrokeAttribute, nTransparence);
+ }
+
+ if(XFTSHADOW_NONE != getFormTextShadow())
+ {
+ // also need to prepare attributes for shadow outlines
+ const LineAttribute aLineAttribute(impGetLineAttribute(true, rSet));
+ const sal_uInt8 nTransparence(impGetStrokeTransparence(true, rSet));
+
+ maShadowOutline = SdrFormTextOutlineAttribute(
+ aLineAttribute, aStrokeAttribute, nTransparence);
+ }
}
+ }
- if(XFTSHADOW_NONE != getFormTextShadow())
- {
- // also need to prepare attributes for shadow outlines
- const LineAttribute aLineAttribute(impGetLineAttribute(true, rSet));
- const sal_uInt8 nTransparence(impGetStrokeTransparence(true, rSet));
-
- mpShadowOutline = new SdrFormTextOutlineAttribute(
- aLineAttribute, aStrokeAttribute, nTransparence);
- }
+ ImpSdrFormTextAttribute()
+ : mnRefCount(0),
+ mnFormTextDistance(0),
+ mnFormTextStart(0),
+ mnFormTextShdwXVal(0),
+ mnFormTextShdwYVal(0),
+ mnFormTextShdwTransp(0),
+ meFormTextStyle(XFT_NONE),
+ meFormTextAdjust(XFT_CENTER),
+ meFormTextShadow(XFTSHADOW_NONE),
+ maFormTextShdwColor(),
+ maOutline(),
+ maShadowOutline(),
+ mbFormTextMirror(false),
+ mbFormTextOutline(false)
+ {
}
- }
- SdrFormTextAttribute::~SdrFormTextAttribute()
- {
- if(mpOutline)
+ // data read access
+ sal_Int32 getFormTextDistance() const { return mnFormTextDistance; }
+ sal_Int32 getFormTextStart() const { return mnFormTextStart; }
+ sal_Int32 getFormTextShdwXVal() const { return mnFormTextShdwXVal; }
+ sal_Int32 getFormTextShdwYVal() const { return mnFormTextShdwYVal; }
+ sal_uInt16 getFormTextShdwTransp() const { return mnFormTextShdwTransp; }
+ XFormTextStyle getFormTextStyle() const { return meFormTextStyle; }
+ XFormTextAdjust getFormTextAdjust() const { return meFormTextAdjust; }
+ XFormTextShadow getFormTextShadow() const { return meFormTextShadow; }
+ Color getFormTextShdwColor() const { return maFormTextShdwColor; }
+ const SdrFormTextOutlineAttribute& getOutline() const { return maOutline; }
+ const SdrFormTextOutlineAttribute& getShadowOutline() const { return maShadowOutline; }
+ bool getFormTextMirror() const { return mbFormTextMirror; }
+ bool getFormTextOutline() const { return mbFormTextOutline; }
+
+ // compare operator
+ bool operator==(const ImpSdrFormTextAttribute& rCandidate) const
{
- delete mpOutline;
- mpOutline = 0;
+ return (getFormTextDistance() == rCandidate.getFormTextDistance()
+ && getFormTextStart() == rCandidate.getFormTextStart()
+ && getFormTextShdwXVal() == rCandidate.getFormTextShdwXVal()
+ && getFormTextShdwYVal() == rCandidate.getFormTextShdwYVal()
+ && getFormTextShdwTransp() == rCandidate.getFormTextShdwTransp()
+ && getFormTextStyle() == rCandidate.getFormTextStyle()
+ && getFormTextAdjust() == rCandidate.getFormTextAdjust()
+ && getFormTextShadow() == rCandidate.getFormTextShadow()
+ && getFormTextShdwColor() == rCandidate.getFormTextShdwColor()
+ && getOutline() == rCandidate.getOutline()
+ && getShadowOutline() == rCandidate.getShadowOutline()
+ && getFormTextMirror() == rCandidate.getFormTextMirror()
+ && getFormTextOutline() == rCandidate.getFormTextOutline());
}
- if(mpShadowOutline)
+ static ImpSdrFormTextAttribute* get_global_default()
{
- delete mpShadowOutline;
- mpShadowOutline = 0;
+ static ImpSdrFormTextAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrFormTextAttribute();
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
}
+ };
+
+ SdrFormTextAttribute::SdrFormTextAttribute(const SfxItemSet& rSet)
+ : mpSdrFormTextAttribute(new ImpSdrFormTextAttribute(rSet))
+ {
+ }
+
+ SdrFormTextAttribute::SdrFormTextAttribute()
+ : mpSdrFormTextAttribute(ImpSdrFormTextAttribute::get_global_default())
+ {
+ mpSdrFormTextAttribute->mnRefCount++;
}
SdrFormTextAttribute::SdrFormTextAttribute(const SdrFormTextAttribute& rCandidate)
- : mnFormTextDistance(rCandidate.getFormTextDistance()),
- mnFormTextStart(rCandidate.getFormTextStart()),
- mnFormTextShdwXVal(rCandidate.getFormTextShdwXVal()),
- mnFormTextShdwYVal(rCandidate.getFormTextShdwYVal()),
- mnFormTextShdwTransp(rCandidate.getFormTextShdwTransp()),
- meFormTextStyle(rCandidate.getFormTextStyle()),
- meFormTextAdjust(rCandidate.getFormTextAdjust()),
- meFormTextShadow(rCandidate.getFormTextShadow()),
- maFormTextShdwColor(rCandidate.getFormTextShdwColor()),
- mpOutline(0),
- mpShadowOutline(0),
- mbFormTextMirror(rCandidate.getFormTextMirror()),
- mbFormTextOutline(rCandidate.getFormTextOutline())
+ : mpSdrFormTextAttribute(rCandidate.mpSdrFormTextAttribute)
{
- if(rCandidate.getOutline())
+ mpSdrFormTextAttribute->mnRefCount++;
+ }
+
+ SdrFormTextAttribute::~SdrFormTextAttribute()
+ {
+ if(mpSdrFormTextAttribute->mnRefCount)
{
- mpOutline = new SdrFormTextOutlineAttribute(*rCandidate.getOutline());
+ mpSdrFormTextAttribute->mnRefCount--;
}
-
- if(rCandidate.getShadowOutline())
+ else
{
- mpShadowOutline = new SdrFormTextOutlineAttribute(*rCandidate.getShadowOutline());
+ delete mpSdrFormTextAttribute;
}
}
+ bool SdrFormTextAttribute::isDefault() const
+ {
+ return mpSdrFormTextAttribute == ImpSdrFormTextAttribute::get_global_default();
+ }
+
SdrFormTextAttribute& SdrFormTextAttribute::operator=(const SdrFormTextAttribute& rCandidate)
{
- mnFormTextDistance = rCandidate.getFormTextDistance();
- mnFormTextStart = rCandidate.getFormTextStart();
- mnFormTextShdwXVal = rCandidate.getFormTextShdwXVal();
- mnFormTextShdwYVal = rCandidate.getFormTextShdwYVal();
- mnFormTextShdwTransp = rCandidate.getFormTextShdwTransp();
- meFormTextStyle = rCandidate.getFormTextStyle();
- meFormTextAdjust = rCandidate.getFormTextAdjust();
- meFormTextShadow = rCandidate.getFormTextShadow();
- maFormTextShdwColor = rCandidate.getFormTextShdwColor();
-
- if(mpOutline)
+ if(rCandidate.mpSdrFormTextAttribute != mpSdrFormTextAttribute)
{
- delete mpOutline;
+ if(mpSdrFormTextAttribute->mnRefCount)
+ {
+ mpSdrFormTextAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFormTextAttribute;
+ }
+
+ mpSdrFormTextAttribute = rCandidate.mpSdrFormTextAttribute;
+ mpSdrFormTextAttribute->mnRefCount++;
}
- mpOutline = 0;
+ return *this;
+ }
- if(rCandidate.getOutline())
+ bool SdrFormTextAttribute::operator==(const SdrFormTextAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrFormTextAttribute == mpSdrFormTextAttribute)
{
- mpOutline = new SdrFormTextOutlineAttribute(*rCandidate.getOutline());
+ return true;
}
- if(mpShadowOutline)
+ if(rCandidate.isDefault() != isDefault())
{
- delete mpShadowOutline;
+ return false;
}
- mpShadowOutline = 0;
-
- if(rCandidate.getShadowOutline())
- {
- mpShadowOutline = new SdrFormTextOutlineAttribute(*rCandidate.getShadowOutline());
- }
+ return (*rCandidate.mpSdrFormTextAttribute == *mpSdrFormTextAttribute);
+ }
+
+ sal_Int32 SdrFormTextAttribute::getFormTextDistance() const
+ {
+ return mpSdrFormTextAttribute->getFormTextDistance();
+ }
- mbFormTextMirror = rCandidate.getFormTextMirror();
- mbFormTextOutline = rCandidate.getFormTextOutline();
+ sal_Int32 SdrFormTextAttribute::getFormTextStart() const
+ {
+ return mpSdrFormTextAttribute->getFormTextStart();
+ }
- return *this;
+ sal_Int32 SdrFormTextAttribute::getFormTextShdwXVal() const
+ {
+ return mpSdrFormTextAttribute->getFormTextShdwXVal();
}
- bool SdrFormTextAttribute::operator==(const SdrFormTextAttribute& rCandidate) const
- {
- return (getFormTextDistance() == rCandidate.getFormTextDistance()
- && getFormTextStart() == rCandidate.getFormTextStart()
- && getFormTextShdwXVal() == rCandidate.getFormTextShdwXVal()
- && getFormTextShdwYVal() == rCandidate.getFormTextShdwYVal()
- && getFormTextShdwTransp() == rCandidate.getFormTextShdwTransp()
- && getFormTextStyle() == rCandidate.getFormTextStyle()
- && getFormTextAdjust() == rCandidate.getFormTextAdjust()
- && getFormTextShadow() == rCandidate.getFormTextShadow()
- && getFormTextShdwColor() == rCandidate.getFormTextShdwColor()
- && pointerOrContentEqual(getOutline(), rCandidate.getOutline())
- && pointerOrContentEqual(getShadowOutline(), rCandidate.getShadowOutline())
- && getFormTextMirror() == rCandidate.getFormTextMirror()
- && getFormTextOutline() == rCandidate.getFormTextOutline());
+ sal_Int32 SdrFormTextAttribute::getFormTextShdwYVal() const
+ {
+ return mpSdrFormTextAttribute->getFormTextShdwYVal();
+ }
+
+ sal_uInt16 SdrFormTextAttribute::getFormTextShdwTransp() const
+ {
+ return mpSdrFormTextAttribute->getFormTextShdwTransp();
+ }
+
+ XFormTextStyle SdrFormTextAttribute::getFormTextStyle() const
+ {
+ return mpSdrFormTextAttribute->getFormTextStyle();
+ }
+
+ XFormTextAdjust SdrFormTextAttribute::getFormTextAdjust() const
+ {
+ return mpSdrFormTextAttribute->getFormTextAdjust();
+ }
+
+ XFormTextShadow SdrFormTextAttribute::getFormTextShadow() const
+ {
+ return mpSdrFormTextAttribute->getFormTextShadow();
+ }
+
+ Color SdrFormTextAttribute::getFormTextShdwColor() const
+ {
+ return mpSdrFormTextAttribute->getFormTextShdwColor();
+ }
+
+ const SdrFormTextOutlineAttribute& SdrFormTextAttribute::getOutline() const
+ {
+ return mpSdrFormTextAttribute->getOutline();
+ }
+
+ const SdrFormTextOutlineAttribute& SdrFormTextAttribute::getShadowOutline() const
+ {
+ return mpSdrFormTextAttribute->getShadowOutline();
+ }
+
+ bool SdrFormTextAttribute::getFormTextMirror() const
+ {
+ return mpSdrFormTextAttribute->getFormTextMirror();
+ }
+
+ bool SdrFormTextAttribute::getFormTextOutline() const
+ {
+ return mpSdrFormTextAttribute->getFormTextOutline();
}
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx b/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx
index 0a96ad2f6f..683088931f 100644
--- a/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx
+++ b/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx
@@ -32,10 +32,8 @@
#include "precompiled_svx.hxx"
#include <svx/sdr/attribute/sdrformtextoutlineattribute.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-// pointer compare define
-#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
+#include <drawinglayer/attribute/lineattribute.hxx>
+#include <drawinglayer/attribute/strokeattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -43,21 +41,146 @@ namespace drawinglayer
{
namespace attribute
{
+ class ImpSdrFormTextOutlineAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // one set of attributes for FormText (FontWork) outline visualisation
+ LineAttribute maLineAttribute;
+ StrokeAttribute maStrokeAttribute;
+ sal_uInt8 mnTransparence;
+
+ ImpSdrFormTextOutlineAttribute(
+ const LineAttribute& rLineAttribute,
+ const StrokeAttribute& rStrokeAttribute,
+ sal_uInt8 nTransparence)
+ : mnRefCount(0),
+ maLineAttribute(rLineAttribute),
+ maStrokeAttribute(rStrokeAttribute),
+ mnTransparence(nTransparence)
+ {
+ }
+
+ // data read access
+ const LineAttribute& getLineAttribute() const { return maLineAttribute; }
+ const StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
+ sal_uInt8 getTransparence() const { return mnTransparence; }
+
+ // compare operator
+ bool operator==(const ImpSdrFormTextOutlineAttribute& rCandidate) const
+ {
+ return (getLineAttribute() == rCandidate.getLineAttribute()
+ && getStrokeAttribute() == rCandidate.getStrokeAttribute()
+ && getTransparence() == rCandidate.getTransparence());
+ }
+
+ static ImpSdrFormTextOutlineAttribute* get_global_default()
+ {
+ static ImpSdrFormTextOutlineAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrFormTextOutlineAttribute(
+ LineAttribute(),
+ StrokeAttribute(),
+ 0);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
SdrFormTextOutlineAttribute::SdrFormTextOutlineAttribute(
const LineAttribute& rLineAttribute,
const StrokeAttribute& rStrokeAttribute,
sal_uInt8 nTransparence)
- : maLineAttribute(rLineAttribute),
- maStrokeAttribute(rStrokeAttribute),
- mnTransparence(nTransparence)
+ : mpSdrFormTextOutlineAttribute(new ImpSdrFormTextOutlineAttribute(
+ rLineAttribute, rStrokeAttribute, nTransparence))
+ {
+ }
+
+ SdrFormTextOutlineAttribute::SdrFormTextOutlineAttribute()
+ : mpSdrFormTextOutlineAttribute(ImpSdrFormTextOutlineAttribute::get_global_default())
+ {
+ mpSdrFormTextOutlineAttribute->mnRefCount++;
+ }
+
+ SdrFormTextOutlineAttribute::SdrFormTextOutlineAttribute(const SdrFormTextOutlineAttribute& rCandidate)
+ : mpSdrFormTextOutlineAttribute(rCandidate.mpSdrFormTextOutlineAttribute)
{
+ mpSdrFormTextOutlineAttribute->mnRefCount++;
+ }
+
+ SdrFormTextOutlineAttribute::~SdrFormTextOutlineAttribute()
+ {
+ if(mpSdrFormTextOutlineAttribute->mnRefCount)
+ {
+ mpSdrFormTextOutlineAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFormTextOutlineAttribute;
+ }
+ }
+
+ bool SdrFormTextOutlineAttribute::isDefault() const
+ {
+ return mpSdrFormTextOutlineAttribute == ImpSdrFormTextOutlineAttribute::get_global_default();
+ }
+
+ SdrFormTextOutlineAttribute& SdrFormTextOutlineAttribute::operator=(const SdrFormTextOutlineAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrFormTextOutlineAttribute != mpSdrFormTextOutlineAttribute)
+ {
+ if(mpSdrFormTextOutlineAttribute->mnRefCount)
+ {
+ mpSdrFormTextOutlineAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFormTextOutlineAttribute;
+ }
+
+ mpSdrFormTextOutlineAttribute = rCandidate.mpSdrFormTextOutlineAttribute;
+ mpSdrFormTextOutlineAttribute->mnRefCount++;
+ }
+
+ return *this;
}
bool SdrFormTextOutlineAttribute::operator==(const SdrFormTextOutlineAttribute& rCandidate) const
{
- return (getLineAttribute() == rCandidate.getLineAttribute()
- && getStrokeAttribute() == rCandidate.getStrokeAttribute()
- && getTransparence() == rCandidate.getTransparence());
+ if(rCandidate.mpSdrFormTextOutlineAttribute == mpSdrFormTextOutlineAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrFormTextOutlineAttribute == *mpSdrFormTextOutlineAttribute);
+ }
+
+ const LineAttribute& SdrFormTextOutlineAttribute::getLineAttribute() const
+ {
+ return mpSdrFormTextOutlineAttribute->getLineAttribute();
+ }
+
+ const StrokeAttribute& SdrFormTextOutlineAttribute::getStrokeAttribute() const
+ {
+ return mpSdrFormTextOutlineAttribute->getStrokeAttribute();
+ }
+
+ sal_uInt8 SdrFormTextOutlineAttribute::getTransparence() const
+ {
+ return mpSdrFormTextOutlineAttribute->getTransparence();
}
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/svx/source/sdr/attribute/sdrlinefillshadowtextattribute.cxx b/svx/source/sdr/attribute/sdrlinefillshadowtextattribute.cxx
new file mode 100644
index 0000000000..073d9b7cf8
--- /dev/null
+++ b/svx/source/sdr/attribute/sdrlinefillshadowtextattribute.cxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrallattribute.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_svx.hxx"
+
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(
+ const SdrLineAttribute& rLine,
+ const SdrFillAttribute& rFill,
+ const SdrLineStartEndAttribute& rLineStartEnd,
+ const SdrShadowAttribute& rShadow,
+ const FillGradientAttribute& rFillFloatTransGradient,
+ const SdrTextAttribute& rTextAttribute)
+ : SdrLineShadowTextAttribute(rLine, rLineStartEnd, rShadow, rTextAttribute),
+ maFill(rFill),
+ maFillFloatTransGradient(rFillFloatTransGradient)
+ {
+ }
+
+ SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute()
+ : SdrLineShadowTextAttribute(),
+ maFill(),
+ maFillFloatTransGradient()
+ {
+ }
+
+ SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(const SdrLineFillShadowTextAttribute& rCandidate)
+ : SdrLineShadowTextAttribute(rCandidate),
+ maFill(rCandidate.getFill()),
+ maFillFloatTransGradient(rCandidate.getFillFloatTransGradient())
+ {
+ }
+
+ SdrLineFillShadowTextAttribute& SdrLineFillShadowTextAttribute::operator=(const SdrLineFillShadowTextAttribute& rCandidate)
+ {
+ SdrLineShadowTextAttribute::operator=(rCandidate);
+ maFill = rCandidate.getFill();
+ maFillFloatTransGradient = rCandidate.getFillFloatTransGradient();
+
+ return *this;
+ }
+
+ bool SdrLineFillShadowTextAttribute::isDefault() const
+ {
+ return (SdrLineShadowTextAttribute::isDefault()
+ && getFill().isDefault()
+ && getFillFloatTransGradient().isDefault());
+ }
+
+ bool SdrLineFillShadowTextAttribute::operator==(const SdrLineFillShadowTextAttribute& rCandidate) const
+ {
+ return(SdrLineShadowTextAttribute::operator==(rCandidate)
+ && getFill() == rCandidate.getFill()
+ && getFillFloatTransGradient() == rCandidate.getFillFloatTransGradient());
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/attribute/sdrlineshadowtextattribute.cxx b/svx/source/sdr/attribute/sdrlineshadowtextattribute.cxx
new file mode 100644
index 0000000000..f2042d6d0c
--- /dev/null
+++ b/svx/source/sdr/attribute/sdrlineshadowtextattribute.cxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrallattribute.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_svx.hxx"
+
+#include <svx/sdr/attribute/sdrlineshadowtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(
+ const SdrLineAttribute& rLine,
+ const SdrLineStartEndAttribute& rLineStartEnd,
+ const SdrShadowAttribute& rShadow,
+ const SdrTextAttribute& rTextAttribute)
+ : SdrShadowTextAttribute(rShadow, rTextAttribute),
+ maLine(rLine),
+ maLineStartEnd(rLineStartEnd)
+ {
+ }
+
+ SdrLineShadowTextAttribute::SdrLineShadowTextAttribute()
+ : SdrShadowTextAttribute(),
+ maLine(),
+ maLineStartEnd()
+ {
+ }
+
+ SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(const SdrLineShadowTextAttribute& rCandidate)
+ : SdrShadowTextAttribute(rCandidate),
+ maLine(rCandidate.getLine()),
+ maLineStartEnd(rCandidate.getLineStartEnd())
+ {
+ }
+
+ SdrLineShadowTextAttribute& SdrLineShadowTextAttribute::operator=(const SdrLineShadowTextAttribute& rCandidate)
+ {
+ SdrShadowTextAttribute::operator=(rCandidate);
+ maLine = rCandidate.getLine();
+ maLineStartEnd = rCandidate.getLineStartEnd();
+
+ return *this;
+ }
+
+ bool SdrLineShadowTextAttribute::isDefault() const
+ {
+ return(SdrShadowTextAttribute::isDefault()
+ && getLine().isDefault()
+ && getLineStartEnd().isDefault());
+ }
+
+ bool SdrLineShadowTextAttribute::operator==(const SdrLineShadowTextAttribute& rCandidate) const
+ {
+ return(SdrShadowTextAttribute::operator==(rCandidate)
+ && getLine() == rCandidate.getLine()
+ && getLineStartEnd() == rCandidate.getLineStartEnd());
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/attribute/sdrshadowtextattribute.cxx b/svx/source/sdr/attribute/sdrshadowtextattribute.cxx
new file mode 100644
index 0000000000..d1da426a79
--- /dev/null
+++ b/svx/source/sdr/attribute/sdrshadowtextattribute.cxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrallattribute.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_svx.hxx"
+
+#include <svx/sdr/attribute/sdrshadowtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ SdrShadowTextAttribute::SdrShadowTextAttribute(
+ const SdrShadowAttribute& rShadow,
+ const SdrTextAttribute& rTextAttribute)
+ : maShadow(rShadow),
+ maTextAttribute(rTextAttribute)
+ {
+ }
+
+ SdrShadowTextAttribute::SdrShadowTextAttribute()
+ : maShadow(),
+ maTextAttribute()
+ {
+ }
+
+ SdrShadowTextAttribute::SdrShadowTextAttribute(const SdrShadowTextAttribute& rCandidate)
+ : maShadow(rCandidate.getShadow()),
+ maTextAttribute(rCandidate.getText())
+ {
+ }
+
+ SdrShadowTextAttribute& SdrShadowTextAttribute::operator=(const SdrShadowTextAttribute& rCandidate)
+ {
+ maShadow = rCandidate.getShadow();
+ maTextAttribute = rCandidate.getText();
+
+ return *this;
+ }
+
+ bool SdrShadowTextAttribute::isDefault() const
+ {
+ return (getShadow().isDefault()
+ && getText().isDefault());
+ }
+
+ bool SdrShadowTextAttribute::operator==(const SdrShadowTextAttribute& rCandidate) const
+ {
+ return (getShadow() == rCandidate.getShadow()
+ && getText() == rCandidate.getText());
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx
index 1c72623610..1c410b9c31 100644
--- a/svx/source/sdr/attribute/sdrtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrtextattribute.cxx
@@ -34,21 +34,233 @@
#include <svx/sdr/attribute/sdrtextattribute.hxx>
#include <svx/sdr/attribute/sdrformtextattribute.hxx>
#include <svx/svdotext.hxx>
-#include <svx/outlobj.hxx>
-#include <svx/editobj.hxx>
-#include <svx/flditem.hxx>
#include <svx/sdr/properties/properties.hxx>
//////////////////////////////////////////////////////////////////////////////
-// pointer compare define
-#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
-
-//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
{
namespace attribute
{
+ class ImpSdrTextAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // all-text attributes. The SdrText itself and a copy
+ // of te OPO
+ const SdrText* mpSdrText;
+ const OutlinerParaObject* mpOutlinerParaObject;
+
+ // Set when it's a FormText; contains all FormText attributes
+ SdrFormTextAttribute maSdrFormTextAttribute;
+
+ // text distances
+ sal_Int32 maTextLeftDistance;
+ sal_Int32 maTextUpperDistance;
+ sal_Int32 maTextRightDistance;
+ sal_Int32 maTextLowerDistance;
+
+ // #i101556# use versioning from text attributes to detect changes
+ sal_uInt32 maPropertiesVersion;
+
+ // text alignments
+ SdrTextHorzAdjust maSdrTextHorzAdjust;
+ SdrTextVertAdjust maSdrTextVertAdjust;
+
+ // bitfield
+ unsigned mbContour : 1;
+ unsigned mbFitToSize : 1;
+ unsigned mbHideContour : 1;
+ unsigned mbBlink : 1;
+ unsigned mbScroll : 1;
+ unsigned mbInEditMode : 1;
+ unsigned mbFixedCellHeight : 1;
+ unsigned mbWrongSpell : 1;
+
+ public:
+ ImpSdrTextAttribute(
+ const SdrText* pSdrText,
+ const OutlinerParaObject& rOutlinerParaObject,
+ XFormTextStyle eFormTextStyle,
+ sal_Int32 aTextLeftDistance,
+ sal_Int32 aTextUpperDistance,
+ sal_Int32 aTextRightDistance,
+ sal_Int32 aTextLowerDistance,
+ SdrTextHorzAdjust aSdrTextHorzAdjust,
+ SdrTextVertAdjust aSdrTextVertAdjust,
+ bool bContour,
+ bool bFitToSize,
+ bool bHideContour,
+ bool bBlink,
+ bool bScroll,
+ bool bInEditMode,
+ bool bFixedCellHeight,
+ bool bWrongSpell)
+ : mnRefCount(0),
+ mpSdrText(pSdrText),
+ mpOutlinerParaObject(new OutlinerParaObject(rOutlinerParaObject)),
+ maSdrFormTextAttribute(),
+ maTextLeftDistance(aTextLeftDistance),
+ maTextUpperDistance(aTextUpperDistance),
+ maTextRightDistance(aTextRightDistance),
+ maTextLowerDistance(aTextLowerDistance),
+ maPropertiesVersion(0),
+ maSdrTextHorzAdjust(aSdrTextHorzAdjust),
+ maSdrTextVertAdjust(aSdrTextVertAdjust),
+ mbContour(bContour),
+ mbFitToSize(bFitToSize),
+ mbHideContour(bHideContour),
+ mbBlink(bBlink),
+ mbScroll(bScroll),
+ mbInEditMode(bInEditMode),
+ mbFixedCellHeight(bFixedCellHeight),
+ mbWrongSpell(bWrongSpell)
+ {
+ if(pSdrText)
+ {
+ if(XFT_NONE != eFormTextStyle)
+ {
+ // text on path. Create FormText attribute
+ const SfxItemSet& rSet = pSdrText->GetItemSet();
+ maSdrFormTextAttribute = SdrFormTextAttribute(rSet);
+ }
+
+ // #i101556# init with version number to detect changes of single text
+ // attribute and/or style sheets in primitive data without having to
+ // copy that data locally (which would be better from principle)
+ maPropertiesVersion = pSdrText->GetObject().GetProperties().getVersion();
+ }
+ }
+
+ ImpSdrTextAttribute()
+ : mnRefCount(0),
+ mpSdrText(0),
+ mpOutlinerParaObject(0),
+ maSdrFormTextAttribute(),
+ maTextLeftDistance(0),
+ maTextUpperDistance(0),
+ maTextRightDistance(0),
+ maTextLowerDistance(0),
+ maPropertiesVersion(0),
+ maSdrTextHorzAdjust(SDRTEXTHORZADJUST_LEFT),
+ maSdrTextVertAdjust(SDRTEXTVERTADJUST_TOP),
+ mbContour(false),
+ mbFitToSize(false),
+ mbHideContour(false),
+ mbBlink(false),
+ mbScroll(false),
+ mbInEditMode(false),
+ mbFixedCellHeight(false),
+ mbWrongSpell(false)
+ {
+ }
+
+ ~ImpSdrTextAttribute()
+ {
+ if(mpOutlinerParaObject)
+ {
+ delete mpOutlinerParaObject;
+ }
+ }
+
+ // data read access
+ const SdrText& getSdrText() const
+ {
+ OSL_ENSURE(mpSdrText, "Access to text of default version of ImpSdrTextAttribute (!)");
+ return *mpSdrText;
+ }
+ const OutlinerParaObject& getOutlinerParaObject() const
+ {
+ OSL_ENSURE(mpOutlinerParaObject, "Access to OutlinerParaObject of default version of ImpSdrTextAttribute (!)");
+ return *mpOutlinerParaObject;
+ }
+ bool isContour() const { return mbContour; }
+ bool isFitToSize() const { return mbFitToSize; }
+ bool isHideContour() const { return mbHideContour; }
+ bool isBlink() const { return mbBlink; }
+ bool isScroll() const { return mbScroll; }
+ bool isInEditMode() const { return mbInEditMode; }
+ bool isFixedCellHeight() const { return mbFixedCellHeight; }
+ bool isWrongSpell() const { return mbWrongSpell; }
+ const SdrFormTextAttribute& getSdrFormTextAttribute() const { return maSdrFormTextAttribute; }
+ sal_Int32 getTextLeftDistance() const { return maTextLeftDistance; }
+ sal_Int32 getTextUpperDistance() const { return maTextUpperDistance; }
+ sal_Int32 getTextRightDistance() const { return maTextRightDistance; }
+ sal_Int32 getTextLowerDistance() const { return maTextLowerDistance; }
+ sal_uInt32 getPropertiesVersion() const { return maPropertiesVersion; }
+ SdrTextHorzAdjust getSdrTextHorzAdjust() const { return maSdrTextHorzAdjust; }
+ SdrTextVertAdjust getSdrTextVertAdjust() const { return maSdrTextVertAdjust; }
+
+ // compare operator
+ bool operator==(const ImpSdrTextAttribute& rCandidate) const
+ {
+ if(mpOutlinerParaObject != rCandidate.mpOutlinerParaObject)
+ {
+ if(mpOutlinerParaObject && rCandidate.mpOutlinerParaObject)
+ {
+ // compares OPO and it's contents, but traditionally not the RedLining
+ // which is not seen as model, but as temporary information
+ if(!(getOutlinerParaObject() == rCandidate.getOutlinerParaObject()))
+ {
+ return false;
+ }
+
+ // #i102062# for primitive visualisation, the WrongList (SpellChecking)
+ // is important, too, so use isWrongListEqual since there is no WrongList
+ // comparison in the regular OutlinerParaObject compare (since it's
+ // not-persistent data)
+ if(!(getOutlinerParaObject().isWrongListEqual(rCandidate.getOutlinerParaObject())))
+ {
+ return false;
+ }
+ }
+ else
+ {
+ // only one is zero; not equal
+ return false;
+ }
+ }
+
+ return (
+ getSdrFormTextAttribute() == rCandidate.getSdrFormTextAttribute()
+ && getTextLeftDistance() == rCandidate.getTextLeftDistance()
+ && getTextUpperDistance() == rCandidate.getTextUpperDistance()
+ && getTextRightDistance() == rCandidate.getTextRightDistance()
+ && getTextLowerDistance() == rCandidate.getTextLowerDistance()
+ && getPropertiesVersion() == rCandidate.getPropertiesVersion()
+
+ && getSdrTextHorzAdjust() == rCandidate.getSdrTextHorzAdjust()
+ && getSdrTextVertAdjust() == rCandidate.getSdrTextVertAdjust()
+
+ && isContour() == rCandidate.isContour()
+ && isFitToSize() == rCandidate.isFitToSize()
+ && isHideContour() == rCandidate.isHideContour()
+ && isBlink() == rCandidate.isBlink()
+ && isScroll() == rCandidate.isScroll()
+ && isInEditMode() == rCandidate.isInEditMode()
+ && isFixedCellHeight() == rCandidate.isFixedCellHeight()
+ && isWrongSpell() == rCandidate.isWrongSpell());
+ }
+
+ static ImpSdrTextAttribute* get_global_default()
+ {
+ static ImpSdrTextAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ // use default constructor
+ pDefault = new ImpSdrTextAttribute();
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
SdrTextAttribute::SdrTextAttribute(
const SdrText& rSdrText,
const OutlinerParaObject& rOutlinerParaObject,
@@ -67,149 +279,172 @@ namespace drawinglayer
bool bInEditMode,
bool bFixedCellHeight,
bool bWrongSpell)
- : mpSdrText(&rSdrText),
- maOutlinerParaObject(rOutlinerParaObject),
- mpSdrFormTextAttribute(0),
- maTextLeftDistance(aTextLeftDistance),
- maTextUpperDistance(aTextUpperDistance),
- maTextRightDistance(aTextRightDistance),
- maTextLowerDistance(aTextLowerDistance),
- maPropertiesVersion(0),
- maSdrTextHorzAdjust(aSdrTextHorzAdjust),
- maSdrTextVertAdjust(aSdrTextVertAdjust),
- mbContour(bContour),
- mbFitToSize(bFitToSize),
- mbHideContour(bHideContour),
- mbBlink(bBlink),
- mbScroll(bScroll),
- mbInEditMode(bInEditMode),
- mbFixedCellHeight(bFixedCellHeight),
- mbWrongSpell(bWrongSpell)
+ : mpSdrTextAttribute(new ImpSdrTextAttribute(
+ &rSdrText, rOutlinerParaObject, eFormTextStyle, aTextLeftDistance, aTextUpperDistance,
+ aTextRightDistance, aTextLowerDistance, aSdrTextHorzAdjust, aSdrTextVertAdjust, bContour,
+ bFitToSize, bHideContour, bBlink, bScroll, bInEditMode, bFixedCellHeight, bWrongSpell))
{
- if(XFT_NONE != eFormTextStyle)
- {
- // text on path. Create FormText attribute
- const SfxItemSet& rSet = getSdrText().GetItemSet();
- mpSdrFormTextAttribute = new SdrFormTextAttribute(rSet);
- }
+ }
+
+ SdrTextAttribute::SdrTextAttribute()
+ : mpSdrTextAttribute(ImpSdrTextAttribute::get_global_default())
+ {
+ mpSdrTextAttribute->mnRefCount++;
+ }
- // #i101556# init with version number to detect changes of single text
- // attribute and/or style sheets in primitive data without having to
- // copy that data locally (which would be better from principle)
- maPropertiesVersion = rSdrText.GetObject().GetProperties().getVersion();
+ SdrTextAttribute::SdrTextAttribute(const SdrTextAttribute& rCandidate)
+ : mpSdrTextAttribute(rCandidate.mpSdrTextAttribute)
+ {
+ mpSdrTextAttribute->mnRefCount++;
}
SdrTextAttribute::~SdrTextAttribute()
{
- if(mpSdrFormTextAttribute)
+ if(mpSdrTextAttribute->mnRefCount)
+ {
+ mpSdrTextAttribute->mnRefCount--;
+ }
+ else
{
- delete mpSdrFormTextAttribute;
- mpSdrFormTextAttribute = 0;
+ delete mpSdrTextAttribute;
}
}
- SdrTextAttribute::SdrTextAttribute(const SdrTextAttribute& rCandidate)
- : mpSdrText(&rCandidate.getSdrText()),
- maOutlinerParaObject(rCandidate.getOutlinerParaObject()),
- mpSdrFormTextAttribute(0),
- maTextLeftDistance(rCandidate.getTextLeftDistance()),
- maTextUpperDistance(rCandidate.getTextUpperDistance()),
- maTextRightDistance(rCandidate.getTextRightDistance()),
- maTextLowerDistance(rCandidate.getTextLowerDistance()),
- maPropertiesVersion(rCandidate.getPropertiesVersion()),
- maSdrTextHorzAdjust(rCandidate.getSdrTextHorzAdjust()),
- maSdrTextVertAdjust(rCandidate.getSdrTextVertAdjust()),
- mbContour(rCandidate.isContour()),
- mbFitToSize(rCandidate.isFitToSize()),
- mbHideContour(rCandidate.isHideContour()),
- mbBlink(rCandidate.isBlink()),
- mbScroll(rCandidate.isScroll()),
- mbInEditMode(rCandidate.isInEditMode()),
- mbFixedCellHeight(rCandidate.isFixedCellHeight()),
- mbWrongSpell(rCandidate.isWrongSpell())
+ bool SdrTextAttribute::isDefault() const
{
- if(rCandidate.getSdrFormTextAttribute())
- {
- mpSdrFormTextAttribute = new SdrFormTextAttribute(*rCandidate.getSdrFormTextAttribute());
- }
+ return mpSdrTextAttribute == ImpSdrTextAttribute::get_global_default();
}
SdrTextAttribute& SdrTextAttribute::operator=(const SdrTextAttribute& rCandidate)
{
- mpSdrText = &rCandidate.getSdrText();
- maOutlinerParaObject = rCandidate.getOutlinerParaObject();
+ if(rCandidate.mpSdrTextAttribute != mpSdrTextAttribute)
+ {
+ if(mpSdrTextAttribute->mnRefCount)
+ {
+ mpSdrTextAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrTextAttribute;
+ }
+
+ mpSdrTextAttribute = rCandidate.mpSdrTextAttribute;
+ mpSdrTextAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
- if(mpSdrFormTextAttribute)
+ bool SdrTextAttribute::operator==(const SdrTextAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrTextAttribute == mpSdrTextAttribute)
{
- delete mpSdrFormTextAttribute;
+ return true;
}
-
- mpSdrFormTextAttribute = 0;
- if(rCandidate.getSdrFormTextAttribute())
+ if(rCandidate.isDefault() != isDefault())
{
- mpSdrFormTextAttribute = new SdrFormTextAttribute(*rCandidate.getSdrFormTextAttribute());
+ return false;
}
- maTextLeftDistance = rCandidate.getTextLeftDistance();
- maTextUpperDistance = rCandidate.getTextUpperDistance();
- maTextRightDistance = rCandidate.getTextRightDistance();
- maTextLowerDistance = rCandidate.getTextLowerDistance();
- maPropertiesVersion = rCandidate.getPropertiesVersion();
-
- maSdrTextHorzAdjust = rCandidate.getSdrTextHorzAdjust();
- maSdrTextVertAdjust = rCandidate.getSdrTextVertAdjust();
-
- mbContour = rCandidate.isContour();
- mbFitToSize = rCandidate.isFitToSize();
- mbHideContour = rCandidate.isHideContour();
- mbBlink = rCandidate.isBlink();
- mbScroll = rCandidate.isScroll();
- mbInEditMode = rCandidate.isInEditMode();
- mbFixedCellHeight = rCandidate.isFixedCellHeight();
- mbWrongSpell = rCandidate.isWrongSpell();
+ return (*rCandidate.mpSdrTextAttribute == *mpSdrTextAttribute);
+ }
- return *this;
+ const SdrText& SdrTextAttribute::getSdrText() const
+ {
+ return mpSdrTextAttribute->getSdrText();
}
- bool SdrTextAttribute::operator==(const SdrTextAttribute& rCandidate) const
- {
- return (
- // compares OPO and it's contents, but traditionally not the RedLining
- // which is not seen as model, but as temporary information
- getOutlinerParaObject() == rCandidate.getOutlinerParaObject()
-
- // #i102062# for primitive visualisation, the WrongList (SpellChecking)
- // is important, too, so use isWrongListEqual since there is no WrongList
- // comparison in the regular OutlinerParaObject compare (since it's
- // not-persistent data)
- && getOutlinerParaObject().isWrongListEqual(rCandidate.getOutlinerParaObject())
-
- && pointerOrContentEqual(getSdrFormTextAttribute(), rCandidate.getSdrFormTextAttribute())
- && getTextLeftDistance() == rCandidate.getTextLeftDistance()
- && getTextUpperDistance() == rCandidate.getTextUpperDistance()
- && getTextRightDistance() == rCandidate.getTextRightDistance()
- && getTextLowerDistance() == rCandidate.getTextLowerDistance()
- && getPropertiesVersion() == rCandidate.getPropertiesVersion()
-
- && getSdrTextHorzAdjust() == rCandidate.getSdrTextHorzAdjust()
- && getSdrTextVertAdjust() == rCandidate.getSdrTextVertAdjust()
-
- && isContour() == rCandidate.isContour()
- && isFitToSize() == rCandidate.isFitToSize()
- && isHideContour() == rCandidate.isHideContour()
- && isBlink() == rCandidate.isBlink()
- && isScroll() == rCandidate.isScroll()
- && isInEditMode() == rCandidate.isInEditMode()
- && isFixedCellHeight() == rCandidate.isFixedCellHeight()
- && isWrongSpell() == rCandidate.isWrongSpell());
+ const OutlinerParaObject& SdrTextAttribute::getOutlinerParaObject() const
+ {
+ return mpSdrTextAttribute->getOutlinerParaObject();
+ }
+
+ bool SdrTextAttribute::isContour() const
+ {
+ return mpSdrTextAttribute->isContour();
+ }
+
+ bool SdrTextAttribute::isFitToSize() const
+ {
+ return mpSdrTextAttribute->isFitToSize();
+ }
+
+ bool SdrTextAttribute::isHideContour() const
+ {
+ return mpSdrTextAttribute->isHideContour();
+ }
+
+ bool SdrTextAttribute::isBlink() const
+ {
+ return mpSdrTextAttribute->isBlink();
+ }
+
+ bool SdrTextAttribute::isScroll() const
+ {
+ return mpSdrTextAttribute->isScroll();
+ }
+
+ bool SdrTextAttribute::isInEditMode() const
+ {
+ return mpSdrTextAttribute->isInEditMode();
+ }
+
+ bool SdrTextAttribute::isFixedCellHeight() const
+ {
+ return mpSdrTextAttribute->isFixedCellHeight();
+ }
+
+ bool SdrTextAttribute::isWrongSpell() const
+ {
+ return mpSdrTextAttribute->isWrongSpell();
+ }
+
+ const SdrFormTextAttribute& SdrTextAttribute::getSdrFormTextAttribute() const
+ {
+ return mpSdrTextAttribute->getSdrFormTextAttribute();
+ }
+
+ sal_Int32 SdrTextAttribute::getTextLeftDistance() const
+ {
+ return mpSdrTextAttribute->getTextLeftDistance();
+ }
+
+ sal_Int32 SdrTextAttribute::getTextUpperDistance() const
+ {
+ return mpSdrTextAttribute->getTextUpperDistance();
+ }
+
+ sal_Int32 SdrTextAttribute::getTextRightDistance() const
+ {
+ return mpSdrTextAttribute->getTextRightDistance();
+ }
+
+ sal_Int32 SdrTextAttribute::getTextLowerDistance() const
+ {
+ return mpSdrTextAttribute->getTextLowerDistance();
+ }
+
+ sal_uInt32 SdrTextAttribute::getPropertiesVersion() const
+ {
+ return mpSdrTextAttribute->getPropertiesVersion();
+ }
+
+ SdrTextHorzAdjust SdrTextAttribute::getSdrTextHorzAdjust() const
+ {
+ return mpSdrTextAttribute->getSdrTextHorzAdjust();
+ }
+
+ SdrTextVertAdjust SdrTextAttribute::getSdrTextVertAdjust() const
+ {
+ return mpSdrTextAttribute->getSdrTextVertAdjust();
}
void SdrTextAttribute::getBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const
{
if(isBlink())
{
- mpSdrText->GetObject().impGetBlinkTextTiming(rAnimList);
+ getSdrText().GetObject().impGetBlinkTextTiming(rAnimList);
}
}
@@ -217,7 +452,7 @@ namespace drawinglayer
{
if(isScroll())
{
- mpSdrText->GetObject().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength);
+ getSdrText().GetObject().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength);
}
}
} // end of namespace attribute
diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx
index f3c6ea732a..0f27d11090 100644
--- a/svx/source/sdr/contact/viewcontact.cxx
+++ b/svx/source/sdr/contact/viewcontact.cxx
@@ -280,7 +280,8 @@ namespace sdr
DBG_ERROR("ViewContact::createViewIndependentPrimitive2DSequence(): Never call the fallback base implementation, this is always an error (!)");
const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(1000.0, 1000.0, 5000.0, 3000.0)));
const basegfx::BColor aYellow(1.0, 1.0, 0.0);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aYellow));
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aYellow));
return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
diff --git a/svx/source/sdr/contact/viewcontactofe3d.cxx b/svx/source/sdr/contact/viewcontactofe3d.cxx
index 948bab1b2f..afd4ce8815 100644
--- a/svx/source/sdr/contact/viewcontactofe3d.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3d.cxx
@@ -37,10 +37,12 @@
#include <svx/obj3d.hxx>
#include <drawinglayer/primitive2d/embedded3dprimitive2d.hxx>
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <svx/scene3d.hxx>
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
+#include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -128,13 +130,14 @@ namespace sdr
// create embedded 2d primitive and add. LightNormal and ShadowSlant are needed for evtl.
// 3D shadow extraction for correct B2DRange calculation (shadow is part of the object)
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::Embedded3DPrimitive2D(
- rxContent3D,
- pVCOfE3DScene->getObjectTransformation(),
- aViewInformation3D,
- aLightNormal,
- fShadowSlant,
- rAllContentRange));
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::Embedded3DPrimitive2D(
+ rxContent3D,
+ pVCOfE3DScene->getObjectTransformation(),
+ aViewInformation3D,
+ aLightNormal,
+ fShadowSlant,
+ rAllContentRange));
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
@@ -179,9 +182,12 @@ namespace sdr
if(!rObjectTransform.isIdentity())
{
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::TransformPrimitive3D(
- rObjectTransform, xRetval));
- return drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::TransformPrimitive3D(
+ rObjectTransform,
+ xRetval));
+
+ xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
}
}
diff --git a/svx/source/sdr/contact/viewcontactofe3dcube.cxx b/svx/source/sdr/contact/viewcontactofe3dcube.cxx
index 8bde7b3c45..883c3e7faa 100644
--- a/svx/source/sdr/contact/viewcontactofe3dcube.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dcube.cxx
@@ -58,16 +58,8 @@ namespace sdr
{
drawinglayer::primitive3d::Primitive3DSequence xRetval;
const SfxItemSet& rItemSet = GetE3dCubeObj().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false);
-
- // for 3D Objects, always create a primitive even when not visible. This is necessary ATM
- // since e.g. chart geometries rely on the occupied space of non-visible objects
- if(!pAttribute)
- {
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute(
- impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)),
- 0, 0, 0, 0);
- }
+ const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false));
// get cube geometry and use as traslation and scaling for unit cube
basegfx::B3DRange aCubeRange;
@@ -100,13 +92,14 @@ namespace sdr
const basegfx::B2DVector aTextureSize(aCubeSize.getX(), aCubeSize.getY());
// create primitive and add
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrCubePrimitive3D(aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute));
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::SdrCubePrimitive3D(
+ aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute));
xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
// delete 3D Object Attributes
delete pSdr3DObjectAttribute;
- delete pAttribute;
-
+
return xRetval;
}
} // end of namespace contact
diff --git a/svx/source/sdr/contact/viewcontactofe3dextrude.cxx b/svx/source/sdr/contact/viewcontactofe3dextrude.cxx
index 954b54396a..b042d58cb9 100644
--- a/svx/source/sdr/contact/viewcontactofe3dextrude.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dextrude.cxx
@@ -58,16 +58,8 @@ namespace sdr
{
drawinglayer::primitive3d::Primitive3DSequence xRetval;
const SfxItemSet& rItemSet = GetE3dExtrudeObj().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false);
-
- // for 3D Objects, always create a primitive even when not visible. This is necessary ATM
- // since e.g. chart geometries rely on the occupied space of non-visible objects
- if(!pAttribute)
- {
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute(
- impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)),
- 0, 0, 0, 0);
- }
+ const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false));
// get extrude geometry
const basegfx::B2DPolyPolygon aPolyPolygon(GetE3dExtrudeObj().GetExtrudePolygon());
@@ -93,15 +85,15 @@ namespace sdr
// create primitive and add
const basegfx::B3DHomMatrix aWorldTransform;
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrExtrudePrimitive3D(
- aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute,
- aPolyPolygon, fDepth, fDiagonal, fBackScale, bSmoothNormals, true, bSmoothLids,
- bCharacterMode, bCloseFront, bCloseBack));
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::SdrExtrudePrimitive3D(
+ aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute,
+ aPolyPolygon, fDepth, fDiagonal, fBackScale, bSmoothNormals, true, bSmoothLids,
+ bCharacterMode, bCloseFront, bCloseBack));
xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
// delete 3D Object Attributes
delete pSdr3DObjectAttribute;
- delete pAttribute;
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx
index 5ef516f9a0..026d25beff 100644
--- a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx
@@ -58,16 +58,8 @@ namespace sdr
{
drawinglayer::primitive3d::Primitive3DSequence xRetval;
const SfxItemSet& rItemSet = GetE3dLatheObj().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false);
-
- // for 3D Objects, always create a primitive even when not visible. This is necessary ATM
- // since e.g. chart geometries rely on the occupied space of non-visible objects
- if(!pAttribute)
- {
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute(
- impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)),
- 0, 0, 0, 0);
- }
+ const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false));
// get extrude geometry
const basegfx::B2DPolyPolygon aPolyPolygon(GetE3dLatheObj().GetPolyPoly2D());
@@ -107,16 +99,16 @@ namespace sdr
// create primitive and add
const basegfx::B3DHomMatrix aWorldTransform;
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrLathePrimitive3D(
- aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute,
- aPolyPolygon, nHorizontalSegments, nVerticalSegments,
- fDiagonal, fBackScale, fRotation,
- bSmoothNormals, true, bSmoothLids, bCharacterMode, bCloseFront, bCloseBack));
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::SdrLathePrimitive3D(
+ aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute,
+ aPolyPolygon, nHorizontalSegments, nVerticalSegments,
+ fDiagonal, fBackScale, fRotation,
+ bSmoothNormals, true, bSmoothLids, bCharacterMode, bCloseFront, bCloseBack));
xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
// delete 3D Object Attributes
delete pSdr3DObjectAttribute;
- delete pAttribute;
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx b/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx
index e61c73c2d8..7b47e70cec 100644
--- a/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx
@@ -60,23 +60,15 @@ namespace sdr
drawinglayer::primitive3d::Primitive3DSequence xRetval;
const SfxItemSet& rItemSet = GetE3dPolygonObj().GetMergedItemSet();
const bool bSuppressFill(GetE3dPolygonObj().GetLineOnly());
- drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, bSuppressFill);
-
- // for 3D Objects, always create a primitive even when not visible. This is necessary ATM
- // since e.g. chart geometries rely on the occupied space of non-visible objects
- if(!pAttribute)
- {
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute(
- impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)),
- 0, 0, 0, 0);
- }
+ const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, bSuppressFill));
// get extrude geometry
basegfx::B3DPolyPolygon aPolyPolygon3D(GetE3dPolygonObj().GetPolyPolygon3D());
const basegfx::B3DPolyPolygon aPolyNormals3D(GetE3dPolygonObj().GetPolyNormals3D());
const basegfx::B2DPolyPolygon aPolyTexture2D(GetE3dPolygonObj().GetPolyTexture2D());
- const bool bNormals(aPolyNormals3D.count() && aPolyNormals3D.count() == aPolyPolygon3D.count());
- const bool bTexture(aPolyTexture2D.count() && aPolyTexture2D.count() == aPolyPolygon3D.count());
+ const bool bNormals(aPolyNormals3D.count() && aPolyNormals3D.count() == aPolyPolygon3D.count());
+ const bool bTexture(aPolyTexture2D.count() && aPolyTexture2D.count() == aPolyPolygon3D.count());
if(bNormals || bTexture)
{
@@ -181,13 +173,13 @@ namespace sdr
// create primitive and add
const basegfx::B3DHomMatrix aWorldTransform;
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrPolyPolygonPrimitive3D(
- aPolyPolygon3D, aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute));
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::SdrPolyPolygonPrimitive3D(
+ aPolyPolygon3D, aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute));
xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
// delete 3D Object Attributes
delete pSdr3DObjectAttribute;
- delete pAttribute;
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewcontactofe3dscene.cxx b/svx/source/sdr/contact/viewcontactofe3dscene.cxx
index cf5768910f..c267508755 100644
--- a/svx/source/sdr/contact/viewcontactofe3dscene.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dscene.cxx
@@ -41,11 +41,11 @@
#include <svx/sdr/contact/viewobjectcontactofe3dscene.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/range/b3drange.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
#include <svx/sdr/contact/viewcontactofe3d.hxx>
#include <drawinglayer/primitive2d/sceneprimitive2d.hxx>
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -167,21 +167,13 @@ namespace sdr
ViewContactOfE3dScene::ViewContactOfE3dScene(E3dScene& rScene)
: ViewContactOfSdrObj(rScene),
- mpViewInformation3D(0),
- mpObjectTransformation(0),
- mpSdrSceneAttribute(0),
- mpSdrLightingAttribute(0)
+ maViewInformation3D(),
+ maObjectTransformation(),
+ maSdrSceneAttribute(),
+ maSdrLightingAttribute()
{
}
- ViewContactOfE3dScene::~ViewContactOfE3dScene()
- {
- delete mpViewInformation3D;
- delete mpObjectTransformation;
- delete mpSdrSceneAttribute;
- delete mpSdrLightingAttribute;
- }
-
void ViewContactOfE3dScene::createViewInformation3D(const basegfx::B3DRange& rContentRange)
{
basegfx::B3DHomMatrix aTransformation;
@@ -265,34 +257,36 @@ namespace sdr
}
const uno::Sequence< beans::PropertyValue > aEmptyProperties;
- mpViewInformation3D = new drawinglayer::geometry::ViewInformation3D(aTransformation, aOrientation, aProjection, aDeviceToView, 0.0, aEmptyProperties);
+ maViewInformation3D = drawinglayer::geometry::ViewInformation3D(
+ aTransformation, aOrientation, aProjection,
+ aDeviceToView, 0.0, aEmptyProperties);
}
void ViewContactOfE3dScene::createObjectTransformation()
{
// create 2d Object Transformation from relative point in 2d scene to world
- mpObjectTransformation = new basegfx::B2DHomMatrix;
const Rectangle& rRectangle = GetE3dScene().GetSnapRect();
- mpObjectTransformation->set(0, 0, rRectangle.getWidth());
- mpObjectTransformation->set(1, 1, rRectangle.getHeight());
- mpObjectTransformation->set(0, 2, rRectangle.Left());
- mpObjectTransformation->set(1, 2, rRectangle.Top());
+ maObjectTransformation.set(0, 0, rRectangle.getWidth());
+ maObjectTransformation.set(1, 1, rRectangle.getHeight());
+ maObjectTransformation.set(0, 2, rRectangle.Left());
+ maObjectTransformation.set(1, 2, rRectangle.Top());
}
void ViewContactOfE3dScene::createSdrSceneAttribute()
{
const SfxItemSet& rItemSet = GetE3dScene().GetMergedItemSet();
- mpSdrSceneAttribute = drawinglayer::primitive2d::createNewSdrSceneAttribute(rItemSet);
+ maSdrSceneAttribute = drawinglayer::primitive2d::createNewSdrSceneAttribute(rItemSet);
}
void ViewContactOfE3dScene::createSdrLightingAttribute()
{
const SfxItemSet& rItemSet = GetE3dScene().GetMergedItemSet();
- mpSdrLightingAttribute = drawinglayer::primitive2d::createNewSdrLightingAttribute(rItemSet);
+ maSdrLightingAttribute = drawinglayer::primitive2d::createNewSdrLightingAttribute(rItemSet);
}
- drawinglayer::primitive2d::Primitive2DSequence ViewContactOfE3dScene::createScenePrimitive2DSequence(const SetOfByte* pLayerVisibility) const
+ drawinglayer::primitive2d::Primitive2DSequence ViewContactOfE3dScene::createScenePrimitive2DSequence(
+ const SetOfByte* pLayerVisibility) const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
const sal_uInt32 nChildrenCount(GetObjectCount());
@@ -332,19 +326,27 @@ namespace sdr
// on identity and the time on 0.0.
const uno::Sequence< beans::PropertyValue > aEmptyProperties;
const drawinglayer::geometry::ViewInformation3D aNeutralViewInformation3D(aEmptyProperties);
- const basegfx::B3DRange aContentRange(drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(aAllSequence, aNeutralViewInformation3D));
+ const basegfx::B3DRange aContentRange(
+ drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(aAllSequence, aNeutralViewInformation3D));
// create 2d primitive 3dscene with generated sub-list from collector
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::ScenePrimitive2D(
- bTestVisibility ? aVisibleSequence : aAllSequence,
- getSdrSceneAttribute(),
- getSdrLightingAttribute(),
- getObjectTransformation(),
- getViewInformation3D(aContentRange)));
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::ScenePrimitive2D(
+ bTestVisibility ? aVisibleSequence : aAllSequence,
+ getSdrSceneAttribute(),
+ getSdrLightingAttribute(),
+ getObjectTransformation(),
+ getViewInformation3D(aContentRange)));
+
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
}
+ // always append an invisible outline for the cases where no visible content exists
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, getObjectTransformation()));
+
return xRetval;
}
@@ -358,27 +360,7 @@ namespace sdr
xRetval = createScenePrimitive2DSequence(0);
}
- if(xRetval.hasElements())
- {
- return xRetval;
- }
- else
- {
- // create a gray placeholder hairline polygon in object size as empty 3D scene marker. Use object size
- // model information directly, NOT getBoundRect()/getSnapRect() since these will
- // be using the geometry data we get just asked for. AFAIK for empty 3D Scenes, the model data
- // is SdrObject::aOutRect which i can access directly using GetLastBoundRect() here
- const Rectangle aEmptySceneGeometry(GetE3dScene().GetLastBoundRect());
- const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(
- aEmptySceneGeometry.Left(), aEmptySceneGeometry.Top(),
- aEmptySceneGeometry.Right(), aEmptySceneGeometry.Bottom())));
- const double fGrayTone(0xc0 / 255.0);
- const basegfx::BColor aGrayTone(fGrayTone, fGrayTone, fGrayTone);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aGrayTone));
-
- // The replacement object may also get a text like 'empty 3D Scene' here later
- return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
+ return xRetval;
}
void ViewContactOfE3dScene::ActionChanged()
@@ -387,22 +369,15 @@ namespace sdr
ViewContactOfSdrObj::ActionChanged();
// mark locally cached values as invalid
- delete mpViewInformation3D;
- mpViewInformation3D = 0;
-
- delete mpObjectTransformation;
- mpObjectTransformation = 0;
-
- delete mpSdrSceneAttribute;
- mpSdrSceneAttribute = 0;
-
- delete mpSdrLightingAttribute;
- mpSdrLightingAttribute = 0;
+ maViewInformation3D = drawinglayer::geometry::ViewInformation3D();
+ maObjectTransformation.identity();
+ maSdrSceneAttribute = drawinglayer::attribute::SdrSceneAttribute();
+ maSdrLightingAttribute = drawinglayer::attribute::SdrLightingAttribute();
}
const drawinglayer::geometry::ViewInformation3D& ViewContactOfE3dScene::getViewInformation3D() const
{
- if(!mpViewInformation3D)
+ if(maViewInformation3D.isDefault())
{
// this version will create the content range on demand locally and thus is less
// performant than the other one. Since the information is buffered the planned
@@ -421,47 +396,47 @@ namespace sdr
const_cast < ViewContactOfE3dScene* >(this)->createViewInformation3D(aContentRange);
}
- return *mpViewInformation3D;
+ return maViewInformation3D;
}
const drawinglayer::geometry::ViewInformation3D& ViewContactOfE3dScene::getViewInformation3D(const basegfx::B3DRange& rContentRange) const
{
- if(!mpViewInformation3D)
+ if(maViewInformation3D.isDefault())
{
const_cast < ViewContactOfE3dScene* >(this)->createViewInformation3D(rContentRange);
}
- return *mpViewInformation3D;
+ return maViewInformation3D;
}
const basegfx::B2DHomMatrix& ViewContactOfE3dScene::getObjectTransformation() const
{
- if(!mpObjectTransformation)
+ if(maObjectTransformation.isIdentity())
{
const_cast < ViewContactOfE3dScene* >(this)->createObjectTransformation();
}
- return *mpObjectTransformation;
+ return maObjectTransformation;
}
const drawinglayer::attribute::SdrSceneAttribute& ViewContactOfE3dScene::getSdrSceneAttribute() const
{
- if(!mpSdrSceneAttribute)
+ if(maSdrSceneAttribute.isDefault())
{
const_cast < ViewContactOfE3dScene* >(this)->createSdrSceneAttribute();
}
- return *mpSdrSceneAttribute;
+ return maSdrSceneAttribute;
}
const drawinglayer::attribute::SdrLightingAttribute& ViewContactOfE3dScene::getSdrLightingAttribute() const
{
- if(!mpSdrLightingAttribute)
+ if(maSdrLightingAttribute.isDefault())
{
const_cast < ViewContactOfE3dScene* >(this)->createSdrLightingAttribute();
}
- return *mpSdrLightingAttribute;
+ return maSdrLightingAttribute;
}
drawinglayer::primitive3d::Primitive3DSequence ViewContactOfE3dScene::getAllPrimitive3DSequence() const
diff --git a/svx/source/sdr/contact/viewcontactofe3dsphere.cxx b/svx/source/sdr/contact/viewcontactofe3dsphere.cxx
index 8dad4c0d93..5603a7da1b 100644
--- a/svx/source/sdr/contact/viewcontactofe3dsphere.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dsphere.cxx
@@ -57,16 +57,8 @@ namespace sdr
{
drawinglayer::primitive3d::Primitive3DSequence xRetval;
const SfxItemSet& rItemSet = GetE3dSphereObj().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false);
-
- // for 3D Objects, always create a primitive even when not visible. This is necessary ATM
- // since e.g. chart geometries rely on the occupied space of non-visible objects
- if(!pAttribute)
- {
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute(
- impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)),
- 0, 0, 0, 0);
- }
+ const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false));
// get sphere center and size for geometry
basegfx::B3DRange aSphereRange;
@@ -92,14 +84,14 @@ namespace sdr
F_PI2 * aSphereSize.getY()); // half outline, (PI * d)/2 -> PI/2 * d
// create primitive and add
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrSpherePrimitive3D(
- aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute,
- nHorizontalSegments, nVerticalSegments));
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::SdrSpherePrimitive3D(
+ aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute,
+ nHorizontalSegments, nVerticalSegments));
xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
// delete 3D Object Attributes
delete pSdr3DObjectAttribute;
- delete pAttribute;
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index b2340f94e1..dcd06915be 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -33,7 +33,6 @@
#include <svx/sdr/contact/viewcontactofgraphic.hxx>
#include <svx/sdr/contact/viewobjectcontactofgraphic.hxx>
#include <svx/svdograf.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <svl/itemset.hxx>
@@ -42,7 +41,6 @@
#endif
#include <svx/sdgcpitm.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/contact/viewobjectcontact.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
@@ -62,6 +60,7 @@
#include <svx/eeitem.hxx>
#include <svx/colritem.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -151,10 +150,9 @@ namespace sdr
* aSmallerMatrix;
const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
- const drawinglayer::attribute::SdrLineFillShadowTextAttribute aEmptyAttributes(0, 0, 0, 0, 0, 0);
const drawinglayer::primitive2d::Primitive2DReference xReferenceB(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
aSmallerMatrix,
- aEmptyAttributes,
+ drawinglayer::attribute::SdrLineFillShadowTextAttribute(),
rGraphicObject,
rLocalGrafInfo));
@@ -180,14 +178,12 @@ namespace sdr
aEmptyGraphicAttr));
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReferenceA, 1);
- if(!rAttribute.getLine())
+ if(rAttribute.getLine().isDefault())
{
// create a surrounding frame when no linestyle given
const Color aColor(Application::GetSettings().GetStyleSettings().GetShadowColor());
const basegfx::BColor aBColor(aColor.getBColor());
- const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
-
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aUnitRange));
+ basegfx::B2DPolygon aOutline(basegfx::tools::createUnitPolygon());
aOutline.transform(rObjectMatrix);
drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
@@ -317,127 +313,123 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createViewIndependentPrimitive2DSequence() const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
- SdrText* pSdrText = GetGrafObject().getText(0);
-
- if(pSdrText)
+ const SfxItemSet& rItemSet = GetGrafObject().GetMergedItemSet();
+ drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ GetGrafObject().getText(0)));
+
+ // create and fill GraphicAttr
+ GraphicAttr aLocalGrafInfo;
+ const sal_uInt16 nTrans(((SdrGrafTransparenceItem&)rItemSet.Get(SDRATTR_GRAFTRANSPARENCE)).GetValue());
+ const SdrGrafCropItem& rCrop((const SdrGrafCropItem&)rItemSet.Get(SDRATTR_GRAFCROP));
+ aLocalGrafInfo.SetLuminance(((SdrGrafLuminanceItem&)rItemSet.Get(SDRATTR_GRAFLUMINANCE)).GetValue());
+ aLocalGrafInfo.SetContrast(((SdrGrafContrastItem&)rItemSet.Get(SDRATTR_GRAFCONTRAST)).GetValue());
+ aLocalGrafInfo.SetChannelR(((SdrGrafRedItem&)rItemSet.Get(SDRATTR_GRAFRED)).GetValue());
+ aLocalGrafInfo.SetChannelG(((SdrGrafGreenItem&)rItemSet.Get(SDRATTR_GRAFGREEN)).GetValue());
+ aLocalGrafInfo.SetChannelB(((SdrGrafBlueItem&)rItemSet.Get(SDRATTR_GRAFBLUE)).GetValue());
+ aLocalGrafInfo.SetGamma(((SdrGrafGamma100Item&)rItemSet.Get(SDRATTR_GRAFGAMMA)).GetValue() * 0.01);
+ aLocalGrafInfo.SetTransparency((BYTE)::basegfx::fround(Min(nTrans, (USHORT)100) * 2.55));
+ aLocalGrafInfo.SetInvert(((SdrGrafInvertItem&)rItemSet.Get(SDRATTR_GRAFINVERT)).GetValue());
+ aLocalGrafInfo.SetDrawMode(((SdrGrafModeItem&)rItemSet.Get(SDRATTR_GRAFMODE)).GetValue());
+ aLocalGrafInfo.SetCrop(rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom());
+
+ if(aAttribute.isDefault() && 255L != aLocalGrafInfo.GetTransparency())
{
- const SfxItemSet& rItemSet = GetGrafObject().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute =
- drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
- bool bVisible(pAttribute && pAttribute->isVisible());
-
- // create and fill GraphicAttr
- GraphicAttr aLocalGrafInfo;
- const sal_uInt16 nTrans(((SdrGrafTransparenceItem&)rItemSet.Get(SDRATTR_GRAFTRANSPARENCE)).GetValue());
- const SdrGrafCropItem& rCrop((const SdrGrafCropItem&)rItemSet.Get(SDRATTR_GRAFCROP));
- aLocalGrafInfo.SetLuminance(((SdrGrafLuminanceItem&)rItemSet.Get(SDRATTR_GRAFLUMINANCE)).GetValue());
- aLocalGrafInfo.SetContrast(((SdrGrafContrastItem&)rItemSet.Get(SDRATTR_GRAFCONTRAST)).GetValue());
- aLocalGrafInfo.SetChannelR(((SdrGrafRedItem&)rItemSet.Get(SDRATTR_GRAFRED)).GetValue());
- aLocalGrafInfo.SetChannelG(((SdrGrafGreenItem&)rItemSet.Get(SDRATTR_GRAFGREEN)).GetValue());
- aLocalGrafInfo.SetChannelB(((SdrGrafBlueItem&)rItemSet.Get(SDRATTR_GRAFBLUE)).GetValue());
- aLocalGrafInfo.SetGamma(((SdrGrafGamma100Item&)rItemSet.Get(SDRATTR_GRAFGAMMA)).GetValue() * 0.01);
- aLocalGrafInfo.SetTransparency((BYTE)::basegfx::fround(Min(nTrans, (USHORT)100) * 2.55));
- aLocalGrafInfo.SetInvert(((SdrGrafInvertItem&)rItemSet.Get(SDRATTR_GRAFINVERT)).GetValue());
- aLocalGrafInfo.SetDrawMode(((SdrGrafModeItem&)rItemSet.Get(SDRATTR_GRAFMODE)).GetValue());
- aLocalGrafInfo.SetCrop(rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom());
-
- if(!bVisible && 255L != aLocalGrafInfo.GetTransparency())
+ // no fill, no line, no text (invisible), but the graphic content is visible.
+ // Create evtl. shadow for content which was not created by createNewSdrLineFillShadowTextAttribute yet
+ const drawinglayer::attribute::SdrShadowAttribute aShadow(
+ drawinglayer::primitive2d::createNewSdrShadowAttribute(rItemSet));
+
+ if(!aShadow.isDefault())
{
- // content is visible, so force some fill stuff
- delete pAttribute;
- bVisible = true;
+ // create new attribute set if indeed shadow is used
+ aAttribute = drawinglayer::attribute::SdrLineFillShadowTextAttribute(
+ aAttribute.getLine(),
+ aAttribute.getFill(),
+ aAttribute.getLineStartEnd(),
+ aShadow,
+ aAttribute.getFillFloatTransGradient(),
+ aAttribute.getText());
+ }
+ }
- // check shadow
- drawinglayer::attribute::SdrShadowAttribute* pShadow = drawinglayer::primitive2d::createNewSdrShadowAttribute(rItemSet);
+ // take unrotated snap rect for position and size. Directly use model data, not getBoundRect() or getSnapRect()
+ // which will use the primitive data we just create in the near future
+ const Rectangle& rRectangle = GetGrafObject().GetGeoRect();
+ const ::basegfx::B2DRange aObjectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+
+ // look for mirroring
+ const GeoStat& rGeoStat(GetGrafObject().GetGeoStat());
+ const sal_Int32 nDrehWink(rGeoStat.nDrehWink);
+ const bool bRota180(18000 == nDrehWink);
+ const bool bMirrored(GetGrafObject().IsMirrored());
+ const sal_uInt16 nMirrorCase(bRota180 ? (bMirrored ? 3 : 4) : (bMirrored ? 2 : 1));
+ bool bHMirr((2 == nMirrorCase ) || (4 == nMirrorCase));
+ bool bVMirr((3 == nMirrorCase ) || (4 == nMirrorCase));
+
+ // set mirror flags at LocalGrafInfo. Take into account that the geometry in
+ // aObjectRange is already changed and rotated when bRota180 is used. To rebuild
+ // that old behaviour (as long as part of the model data), correct the H/V flags
+ // accordingly. The created bitmapPrimitive WILL use the rotation, too.
+ if(bRota180)
+ {
+ // if bRota180 which is used for vertical mirroring, the graphic will already be rotated
+ // by 180 degrees. To correct, switch off VMirror and invert HMirroring.
+ bHMirr = !bHMirr;
+ bVMirr = false;
+ }
- if(pShadow && !pShadow->isVisible())
- {
- delete pShadow;
- pShadow = 0L;
- }
+ if(bHMirr || bVMirr)
+ {
+ aLocalGrafInfo.SetMirrorFlags((bHMirr ? BMP_MIRROR_HORZ : 0)|(bVMirr ? BMP_MIRROR_VERT : 0));
+ }
- // create new attribute set
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowTextAttribute(0L, 0L, 0L, pShadow, 0L, 0L);
- }
+ // fill object matrix
+ const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
+ const double fRotate(nDrehWink ? (36000 - nDrehWink) * F_PI18000 : 0.0);
+ const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(),
+ fShearX, fRotate,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
- if(pAttribute)
- {
- if(pAttribute->isVisible() || bVisible)
- {
- // take unrotated snap rect for position and size. Directly use model data, not getBoundRect() or getSnapRect()
- // which will use the primitive data we just create in the near future
- const Rectangle& rRectangle = GetGrafObject().GetGeoRect();
- const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
-
- // look for mirroring
- const GeoStat& rGeoStat(GetGrafObject().GetGeoStat());
- const sal_Int32 nDrehWink(rGeoStat.nDrehWink);
- const bool bRota180(18000 == nDrehWink);
- const bool bMirrored(GetGrafObject().IsMirrored());
- const sal_uInt16 nMirrorCase(bRota180 ? (bMirrored ? 3 : 4) : (bMirrored ? 2 : 1));
- bool bHMirr((2 == nMirrorCase ) || (4 == nMirrorCase));
- bool bVMirr((3 == nMirrorCase ) || (4 == nMirrorCase));
-
- // set mirror flags at LocalGrafInfo. Take into account that the geometry in
- // aObjectRange is already changed and rotated when bRota180 is used. To rebuild
- // that old behaviour (as long as part of the model data), correct the H/V flags
- // accordingly. The created bitmapPrimitive WILL use the rotation, too.
- if(bRota180)
- {
- // if bRota180 which is used for vertical mirroring, the graphic will already be rotated
- // by 180 degrees. To correct, switch off VMirror and invert HMirroring.
- bHMirr = !bHMirr;
- bVMirr = false;
- }
-
- if(bHMirr || bVMirr)
- {
- aLocalGrafInfo.SetMirrorFlags((bHMirr ? BMP_MIRROR_HORZ : 0)|(bVMirr ? BMP_MIRROR_VERT : 0));
- }
-
- // fill object matrix
- const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
- const double fRotate(nDrehWink ? (36000 - nDrehWink) * F_PI18000 : 0.0);
- const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- fShearX, fRotate,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
-
- // get the current, unchenged graphic obect from SdrGrafObj
- const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
-
- if(visualisationUsesPresObj())
- {
- // it's an EmptyPresObj, create the SdrGrafPrimitive2D without content and another scaled one
- // with the content which is the placeholder graphic
- xRetval = createVIP2DSForPresObj(aObjectMatrix, *pAttribute, aLocalGrafInfo);
- }
- else if(visualisationUsesDraft())
- {
- // #i102380# The graphic is swapped out. To not force a swap-in here, there is a mechanism
- // which shows a swapped-out-visualisation (which gets created here now) and an asynchronious
- // visual update mechanism for swapped-out grapgics when they were loaded (see AsynchGraphicLoadingEvent
- // and ViewObjectContactOfGraphic implementation). Not forcing the swap-in here allows faster
- // (non-blocking) processing here and thus in the effect e.g. fast scrolling through pages
- xRetval = createVIP2DSForDraft(aObjectMatrix, *pAttribute);
- }
- else
- {
- // create primitive. Info: Calling the copy-constructor of GraphicObject in this
- // SdrGrafPrimitive2D constructor will force a full swap-in of the graphic
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
- aObjectMatrix,
- *pAttribute,
- rGraphicObject,
- aLocalGrafInfo));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- }
-
- delete pAttribute;
- }
+ // get the current, unchenged graphic obect from SdrGrafObj
+ const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
+
+ if(visualisationUsesPresObj())
+ {
+ // it's an EmptyPresObj, create the SdrGrafPrimitive2D without content and another scaled one
+ // with the content which is the placeholder graphic
+ xRetval = createVIP2DSForPresObj(aObjectMatrix, aAttribute, aLocalGrafInfo);
+ }
+ else if(visualisationUsesDraft())
+ {
+ // #i102380# The graphic is swapped out. To not force a swap-in here, there is a mechanism
+ // which shows a swapped-out-visualisation (which gets created here now) and an asynchronious
+ // visual update mechanism for swapped-out grapgics when they were loaded (see AsynchGraphicLoadingEvent
+ // and ViewObjectContactOfGraphic implementation). Not forcing the swap-in here allows faster
+ // (non-blocking) processing here and thus in the effect e.g. fast scrolling through pages
+ xRetval = createVIP2DSForDraft(aObjectMatrix, aAttribute);
}
+ else
+ {
+ // create primitive. Info: Calling the copy-constructor of GraphicObject in this
+ // SdrGrafPrimitive2D constructor will force a full swap-in of the graphic
+ const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
+ aObjectMatrix,
+ aAttribute,
+ rGraphicObject,
+ aLocalGrafInfo));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
+
+ // always append an invisible outline for the cases where no visible content exists
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, aObjectMatrix));
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewcontactofgroup.cxx b/svx/source/sdr/contact/viewcontactofgroup.cxx
index 5c5e6edc48..51599ea88f 100644
--- a/svx/source/sdr/contact/viewcontactofgroup.cxx
+++ b/svx/source/sdr/contact/viewcontactofgroup.cxx
@@ -39,6 +39,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/color/bcolor.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -81,25 +82,22 @@ namespace sdr
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, aCandSeq);
}
}
-
- if(xRetval.hasElements())
- {
- return xRetval;
- }
else
{
- // create a gray placeholder hairline polygon in object size. Use the model data directly. For empty groups,
- // this is SdrObject::aOutRect, as can be seen in SdrObjGroup::GetSnapRect(). Access that using GetLastBoundRect()
- // to not execute anything.
+ // append an invisible outline for the cases where no visible content exists
const Rectangle aCurrentBoundRect(GetSdrObjGroup().GetLastBoundRect());
- const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(
- aCurrentBoundRect.Left(), aCurrentBoundRect.Top(), aCurrentBoundRect.Right(), aCurrentBoundRect.Bottom())));
- const basegfx::BColor aGrayTone(0xc0 / 255.0, 0xc0 / 255.0, 0xc0 / 255.0);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aGrayTone));
+ const basegfx::B2DRange aCurrentRange(
+ aCurrentBoundRect.Left(), aCurrentBoundRect.Top(),
+ aCurrentBoundRect.Right(), aCurrentBoundRect.Bottom());
+
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, aCurrentRange));
- // The replacement object may also get a text like 'empty group' here later
- return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
+
+ return xRetval;
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
index 0b7d9d7572..4e526b4239 100644
--- a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
+++ b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
@@ -41,12 +41,14 @@
#include <svx/svdview.hxx>
#include <svx/sdr/contact/viewcontactofsdrpage.hxx>
#include <svx/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <svx/svdpage.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -68,26 +70,27 @@ namespace sdr
{
// build primitive from pBackgroundCandidate's attributes
const SfxItemSet& rFillProperties = pBackgroundCandidate->GetMergedItemSet();
- drawinglayer::attribute::SdrFillAttribute* pFill = drawinglayer::primitive2d::createNewSdrFillAttribute(rFillProperties);
+ const drawinglayer::attribute::SdrFillAttribute aFill(
+ drawinglayer::primitive2d::createNewSdrFillAttribute(rFillProperties));
- if(pFill)
+ if(!aFill.isDefault())
{
- if(pFill->isVisible())
- {
- // direct model data is the page size, get and use it
- const SdrPage& rOwnerPage = GetMasterPageDescriptor().GetOwnerPage();
- const basegfx::B2DRange aInnerRange(
- rOwnerPage.GetLftBorder(), rOwnerPage.GetUppBorder(),
- rOwnerPage.GetWdt() - rOwnerPage.GetRgtBorder(), rOwnerPage.GetHgt() - rOwnerPage.GetLwrBorder());
- const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
- const basegfx::B2DHomMatrix aEmptyTransform;
- const drawinglayer::primitive2d::Primitive2DReference xReference(drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
- basegfx::B2DPolyPolygon(aInnerPolgon), aEmptyTransform, *pFill));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
-
- delete pFill;
+ // direct model data is the page size, get and use it
+ const SdrPage& rOwnerPage = GetMasterPageDescriptor().GetOwnerPage();
+ const basegfx::B2DRange aInnerRange(
+ rOwnerPage.GetLftBorder(), rOwnerPage.GetUppBorder(),
+ rOwnerPage.GetWdt() - rOwnerPage.GetRgtBorder(),
+ rOwnerPage.GetHgt() - rOwnerPage.GetLwrBorder());
+ const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
+ const basegfx::B2DHomMatrix aEmptyTransform;
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aInnerPolgon),
+ aEmptyTransform,
+ aFill,
+ drawinglayer::attribute::FillGradientAttribute()));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
index 6dcd211856..a040c7c310 100644
--- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
@@ -35,7 +35,6 @@
#include <svx/sdr/contact/viewcontactofsdrcaptionobj.hxx>
#include <svx/svdocapt.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -70,107 +69,108 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SdrCaptionObj& rCaptionObj(GetCaptionObj());
const SfxItemSet& rItemSet = rCaptionObj.GetMergedItemSet();
- SdrText* pSdrText = rCaptionObj.getText(0);
-
- if(pSdrText)
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ rCaptionObj.getText(0)));
+
+ // take unrotated snap rect (direct model data) for position and size
+ const Rectangle& rRectangle = rCaptionObj.GetGeoRect();
+ const ::basegfx::B2DRange aObjectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+ const GeoStat& rGeoStat(rCaptionObj.GetGeoStat());
+
+ // fill object matrix
+ basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(),
+ rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
+ rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
+
+ // calculate corner radius
+ double fCornerRadiusX;
+ double fCornerRadiusY;
+ drawinglayer::primitive2d::calculateRelativeCornerRadius(
+ rCaptionObj.GetEckenradius(), aObjectRange, fCornerRadiusX, fCornerRadiusY);
+
+ // create primitive. Always create one (even if invisible) to let the decomposition
+ // of SdrCaptionPrimitive2D create needed invisible elements for HitTest and BoundRect
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrCaptionPrimitive2D(
+ aObjectMatrix,
+ aAttribute,
+ rCaptionObj.getTailPolygon(),
+ fCornerRadiusX,
+ fCornerRadiusY));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+
+ if(!aAttribute.isDefault() && rCaptionObj.GetSpecialTextBoxShadow())
{
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
-
- if(pAttribute)
+ // for SC, the caption object may have a specialized shadow. The usual object shadow is off
+ // and a specialized shadow gets created here (see old paint)
+ const SdrShadowColorItem& rShadColItem = (SdrShadowColorItem&)(rItemSet.Get(SDRATTR_SHADOWCOLOR));
+ const sal_uInt16 nTransp(((SdrShadowTransparenceItem&)(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
+ const Color aShadCol(rShadColItem.GetColorValue());
+ const XFillStyle eStyle = ((XFillStyleItem&)(rItemSet.Get(XATTR_FILLSTYLE))).GetValue();
+
+ // Create own ItemSet and modify as needed
+ // Always hide lines for special calc shadow
+ SfxItemSet aSet(rItemSet);
+ aSet.Put(XLineStyleItem(XLINE_NONE));
+
+ if(XFILL_HATCH == eStyle)
+ {
+ // #41666# Hatch color is set hard to shadow color
+ XHatch aHatch = ((XFillHatchItem&)(rItemSet.Get(XATTR_FILLHATCH))).GetHatchValue();
+ aHatch.SetColor(aShadCol);
+ aSet.Put(XFillHatchItem(String(),aHatch));
+ }
+ else
{
- if(pAttribute->isVisible())
+ if(XFILL_NONE != eStyle && XFILL_SOLID != eStyle)
{
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = rCaptionObj.GetGeoRect();
- const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
- const GeoStat& rGeoStat(rCaptionObj.GetGeoStat());
-
- // fill object matrix
- basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
- rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
-
- // calculate corner radius
- double fCornerRadiusX;
- double fCornerRadiusY;
- drawinglayer::primitive2d::calculateRelativeCornerRadius(rCaptionObj.GetEckenradius(), aObjectRange, fCornerRadiusX, fCornerRadiusY);
-
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrCaptionPrimitive2D(
- aObjectMatrix, *pAttribute, rCaptionObj.getTailPolygon(), fCornerRadiusX, fCornerRadiusY));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
-
- if(rCaptionObj.GetSpecialTextBoxShadow())
- {
- // for SC, the caption object may have a specialized shadow. The usual object shadow is off
- // and a specialized shadow gets created here (see old paint)
- const SdrShadowColorItem& rShadColItem = (SdrShadowColorItem&)(rItemSet.Get(SDRATTR_SHADOWCOLOR));
- const sal_uInt16 nTransp(((SdrShadowTransparenceItem&)(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
- const Color aShadCol(rShadColItem.GetColorValue());
- const XFillStyle eStyle = ((XFillStyleItem&)(rItemSet.Get(XATTR_FILLSTYLE))).GetValue();
-
- // Create own ItemSet and modify as needed
- // Always hide lines for special calc shadow
- SfxItemSet aSet(rItemSet);
- aSet.Put(XLineStyleItem(XLINE_NONE));
-
- if(XFILL_HATCH == eStyle)
- {
- // #41666# Hatch color is set hard to shadow color
- XHatch aHatch = ((XFillHatchItem&)(rItemSet.Get(XATTR_FILLHATCH))).GetHatchValue();
- aHatch.SetColor(aShadCol);
- aSet.Put(XFillHatchItem(String(),aHatch));
- }
- else
- {
- if(XFILL_NONE != eStyle && XFILL_SOLID != eStyle)
- {
- // force fill to solid (for Gradient and Bitmap)
- aSet.Put(XFillStyleItem(XFILL_SOLID));
- }
-
- aSet.Put(XFillColorItem(String(),aShadCol));
- aSet.Put(XFillTransparenceItem(nTransp));
- }
-
- // crete FillAttribute from modified ItemSet
- drawinglayer::attribute::SdrFillAttribute* pFill = drawinglayer::primitive2d::createNewSdrFillAttribute(aSet);
- drawinglayer::primitive2d::Primitive2DReference xSpecialShadow;
-
- if(pFill)
- {
- if(pFill->isVisible())
- {
- // add shadow offset to object matrix
- const sal_uInt32 nXDist(((SdrShadowXDistItem&)(rItemSet.Get(SDRATTR_SHADOWXDIST))).GetValue());
- const sal_uInt32 nYDist(((SdrShadowYDistItem&)(rItemSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
- aObjectMatrix.translate(nXDist, nYDist);
-
- // create unit outline polygon as geometry (see SdrCaptionPrimitive2D::create2DDecomposition)
- basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), fCornerRadiusX, fCornerRadiusY));
-
- // create the specialized shadow primitive
- xSpecialShadow = drawinglayer::primitive2d::createPolyPolygonFillPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), aObjectMatrix, *pFill);
- }
-
- delete pFill;
- }
-
- if(xSpecialShadow.is())
- {
- // if we really got a special shadow, create a two-element retval with the shadow
- // behind the standard object's geometry
- xRetval.realloc(2);
-
- xRetval[0] = xSpecialShadow;
- xRetval[1] = xReference;
- }
- }
+ // force fill to solid (for Gradient and Bitmap)
+ aSet.Put(XFillStyleItem(XFILL_SOLID));
}
- delete pAttribute;
+ aSet.Put(XFillColorItem(String(),aShadCol));
+ aSet.Put(XFillTransparenceItem(nTransp));
+ }
+
+ // crete FillAttribute from modified ItemSet
+ const drawinglayer::attribute::SdrFillAttribute aFill(
+ drawinglayer::primitive2d::createNewSdrFillAttribute(aSet));
+ drawinglayer::primitive2d::Primitive2DReference xSpecialShadow;
+
+ if(!aFill.isDefault() && 1.0 != aFill.getTransparence())
+ {
+ // add shadow offset to object matrix
+ const sal_uInt32 nXDist(((SdrShadowXDistItem&)(rItemSet.Get(SDRATTR_SHADOWXDIST))).GetValue());
+ const sal_uInt32 nYDist(((SdrShadowYDistItem&)(rItemSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
+ aObjectMatrix.translate(nXDist, nYDist);
+
+ // create unit outline polygon as geometry (see SdrCaptionPrimitive2D::create2DDecomposition)
+ basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(
+ basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), fCornerRadiusX, fCornerRadiusY));
+
+ // create the specialized shadow primitive
+ xSpecialShadow = drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ aObjectMatrix,
+ aFill,
+ drawinglayer::attribute::FillGradientAttribute());
+ }
+
+ if(xSpecialShadow.is())
+ {
+ // if we really got a special shadow, create a two-element retval with the shadow
+ // behind the standard object's geometry
+ xRetval.realloc(2);
+
+ xRetval[0] = xSpecialShadow;
+ xRetval[1] = xReference;
}
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
index eaaacd849c..ff2f5b945e 100644
--- a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
@@ -35,7 +35,6 @@
#include <svx/sdr/contact/viewcontactofsdrcircobj.hxx>
#include <svx/svdocirc.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrellipseprimitive2d.hxx>
#include <svl/itemset.hxx>
#include <svx/sxciaitm.hxx>
@@ -58,56 +57,62 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrCircObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetCircObj().GetMergedItemSet();
- SdrText* pSdrText = GetCircObj().getText(0);
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ GetCircObj().getText(0)));
- if(pSdrText)
- {
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
-
- if(pAttribute)
- {
- if(pAttribute->isVisible())
- {
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = GetCircObj().GetGeoRect();
- const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
- const GeoStat& rGeoStat(GetCircObj().GetGeoStat());
-
- // fill object matrix
- const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
- rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
+ // take unrotated snap rect (direct model data) for position and size
+ const Rectangle& rRectangle = GetCircObj().GetGeoRect();
+ const basegfx::B2DRange aObjectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+ const GeoStat& rGeoStat(GetCircObj().GetGeoStat());
- // create primitive data
- const sal_uInt16 nIdentifier(GetCircObj().GetObjIdentifier());
+ // fill object matrix
+ const basegfx::B2DHomMatrix aObjectMatrix(
+ basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(),
+ rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
+ rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
- if(OBJ_CIRC == nIdentifier)
- {
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrEllipsePrimitive2D(aObjectMatrix, *pAttribute));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- else
- {
- const sal_Int32 nNewStart(((SdrCircStartAngleItem&)rItemSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue());
- const sal_Int32 nNewEnd(((SdrCircEndAngleItem&)rItemSet.Get(SDRATTR_CIRCENDANGLE)).GetValue());
- const double fStart(((36000 - nNewEnd) % 36000) * F_PI18000);
- const double fEnd(((36000 - nNewStart) % 36000) * F_PI18000);
- const bool bCloseSegment(OBJ_CARC != nIdentifier);
- const bool bCloseUsingCenter(OBJ_SECT == nIdentifier);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrEllipseSegmentPrimitive2D(aObjectMatrix, *pAttribute, fStart, fEnd, bCloseSegment, bCloseUsingCenter));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- }
+ // create primitive data
+ const sal_uInt16 nIdentifier(GetCircObj().GetObjIdentifier());
- delete pAttribute;
- }
+ // always create primitives to allow the decomposition of SdrEllipsePrimitive2D
+ // or SdrEllipseSegmentPrimitive2D to create needed invisible elements for HitTest
+ // and/or BoundRect
+ if(OBJ_CIRC == nIdentifier)
+ {
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrEllipsePrimitive2D(
+ aObjectMatrix,
+ aAttribute));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
+ else
+ {
+ const sal_Int32 nNewStart(((SdrCircStartAngleItem&)rItemSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue());
+ const sal_Int32 nNewEnd(((SdrCircEndAngleItem&)rItemSet.Get(SDRATTR_CIRCENDANGLE)).GetValue());
+ const double fStart(((36000 - nNewEnd) % 36000) * F_PI18000);
+ const double fEnd(((36000 - nNewStart) % 36000) * F_PI18000);
+ const bool bCloseSegment(OBJ_CARC != nIdentifier);
+ const bool bCloseUsingCenter(OBJ_SECT == nIdentifier);
- return xRetval;
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrEllipseSegmentPrimitive2D(
+ aObjectMatrix,
+ aAttribute,
+ fStart,
+ fEnd,
+ bCloseSegment,
+ bCloseUsingCenter));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx b/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx
index 54da961623..132698916c 100644
--- a/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx
@@ -35,7 +35,6 @@
#include <svx/sdr/contact/viewcontactofsdredgeobj.hxx>
#include <svx/svdoedge.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -55,35 +54,27 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrEdgeObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
- ::basegfx::B2DPolygon aEdgeTrack(GetEdgeObj().getEdgeTrack());
+ const basegfx::B2DPolygon& rEdgeTrack = GetEdgeObj().getEdgeTrack();
- // base visualisation on EdgeTrack
- if(aEdgeTrack.count())
- {
- // ckeck attributes
- const SfxItemSet& rItemSet = GetEdgeObj().GetMergedItemSet();
- SdrText* pSdrText = GetEdgeObj().getText(0);
+ // what to do when no EdgeTrack is provided (HitTest and selectability) ?
+ OSL_ENSURE(0 != rEdgeTrack.count(), "Connectors with no geometry are not allowed (!)");
- if(pSdrText)
- {
- drawinglayer::attribute::SdrLineShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute(rItemSet, *pSdrText);
+ // ckeck attributes
+ const SfxItemSet& rItemSet = GetEdgeObj().GetMergedItemSet();
+ const drawinglayer::attribute::SdrLineShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute(
+ rItemSet,
+ GetEdgeObj().getText(0)));
- if(pAttribute)
- {
- if(pAttribute->isVisible())
- {
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrConnectorPrimitive2D(*pAttribute, aEdgeTrack));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
+ // create primitive. Always create primitives to allow the decomposition of
+ // SdrConnectorPrimitive2D to create needed invisible elements for HitTest
+ // and/or BoundRect
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrConnectorPrimitive2D(
+ aAttribute,
+ rEdgeTrack));
- delete pAttribute;
- }
- }
- }
-
- return xRetval;
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
index 9012768fcb..01d1a9b901 100644
--- a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
@@ -35,7 +35,6 @@
#include <svx/sdr/contact/viewcontactofsdrmeasureobj.hxx>
#include <svx/svdomeas.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svl/itemset.hxx>
#include <svx/sxmbritm.hxx>
#include <svx/sxmlhitm.hxx>
@@ -61,91 +60,85 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrMeasureObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetMeasureObj().GetMergedItemSet();
- SdrText* pSdrText = GetMeasureObj().getText(0);
+ const drawinglayer::attribute::SdrLineShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute(
+ rItemSet,
+ GetMeasureObj().getText(0)));
- if(pSdrText)
- {
- drawinglayer::attribute::SdrLineShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute(rItemSet, *pSdrText);
+ // take properties which are the model data.
+ const ::basegfx::B2DPoint aStart(GetMeasureObj().GetPoint(0).X(), GetMeasureObj().GetPoint(0).Y());
+ const ::basegfx::B2DPoint aEnd(GetMeasureObj().GetPoint(1).X(), GetMeasureObj().GetPoint(1).Y());
+ const double fDistance(((SdrMeasureLineDistItem&)rItemSet.Get(SDRATTR_MEASURELINEDIST)).GetValue());
+ const double fUpperDistance(((SdrMeasureHelplineOverhangItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEOVERHANG)).GetValue());
+ const double fLowerDistance(((SdrMeasureHelplineDistItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEDIST)).GetValue());
+ const double fLeftDelta(((SdrMeasureHelpline1LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE1LEN)).GetValue());
+ const double fRightDelta(((SdrMeasureHelpline2LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE2LEN)).GetValue());
+ const bool bBelow(((SdrMeasureBelowRefEdgeItem&)rItemSet.Get(SDRATTR_MEASUREBELOWREFEDGE)).GetValue());
+ const bool bTextRotation(((SdrMeasureTextRota90Item&)rItemSet.Get(SDRATTR_MEASURETEXTROTA90)).GetValue());
+ const bool bTextAutoAngle(((SdrMeasureTextAutoAngleItem&)rItemSet.Get(SDRATTR_MEASURETEXTAUTOANGLE)).GetValue());
+ drawinglayer::primitive2d::MeasureTextPosition aMTPHor(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC);
+ drawinglayer::primitive2d::MeasureTextPosition aMTPVer(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC);
- if(pAttribute)
+ switch(((SdrMeasureTextHPosItem&)rItemSet.Get(SDRATTR_MEASURETEXTHPOS)).GetValue())
+ {
+ case SDRMEASURE_TEXTLEFTOUTSIDE :
{
- if(pAttribute->isVisible())
- {
- // take properties which are the model data.
- const ::basegfx::B2DPoint aStart(GetMeasureObj().GetPoint(0).X(), GetMeasureObj().GetPoint(0).Y());
- const ::basegfx::B2DPoint aEnd(GetMeasureObj().GetPoint(1).X(), GetMeasureObj().GetPoint(1).Y());
- const double fDistance(((SdrMeasureLineDistItem&)rItemSet.Get(SDRATTR_MEASURELINEDIST)).GetValue());
- const double fUpperDistance(((SdrMeasureHelplineOverhangItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEOVERHANG)).GetValue());
- const double fLowerDistance(((SdrMeasureHelplineDistItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEDIST)).GetValue());
- const double fLeftDelta(((SdrMeasureHelpline1LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE1LEN)).GetValue());
- const double fRightDelta(((SdrMeasureHelpline2LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE2LEN)).GetValue());
- const bool bBelow(((SdrMeasureBelowRefEdgeItem&)rItemSet.Get(SDRATTR_MEASUREBELOWREFEDGE)).GetValue());
- const bool bTextRotation(((SdrMeasureTextRota90Item&)rItemSet.Get(SDRATTR_MEASURETEXTROTA90)).GetValue());
- const bool bTextAutoAngle(((SdrMeasureTextAutoAngleItem&)rItemSet.Get(SDRATTR_MEASURETEXTAUTOANGLE)).GetValue());
- drawinglayer::primitive2d::MeasureTextPosition aMTPHor(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC);
- drawinglayer::primitive2d::MeasureTextPosition aMTPVer(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC);
-
- switch(((SdrMeasureTextHPosItem&)rItemSet.Get(SDRATTR_MEASURETEXTHPOS)).GetValue())
- {
- case SDRMEASURE_TEXTLEFTOUTSIDE :
- {
- aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE;
- break;
- }
- case SDRMEASURE_TEXTINSIDE :
- {
- aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED;
- break;
- }
- case SDRMEASURE_TEXTRIGHTOUTSIDE :
- {
- aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE;
- break;
- }
- default : // SDRMEASURE_TEXTHAUTO
- {
- break;
- }
- }
-
- switch(((SdrMeasureTextVPosItem&)rItemSet.Get(SDRATTR_MEASURETEXTVPOS)).GetValue())
- {
- case SDRMEASURE_ABOVE :
- {
- aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE;
- break;
- }
- case SDRMEASURETEXT_BREAKEDLINE :
- case SDRMEASURETEXT_VERTICALCENTERED :
- {
- aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED;
- break;
- }
- case SDRMEASURE_BELOW :
- {
- aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE;
- break;
- }
- default : // SDRMEASURE_TEXTVAUTO
- {
- break;
- }
- }
-
- // create primitive with the model data
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrMeasurePrimitive2D(*pAttribute,
- aStart, aEnd, aMTPHor, aMTPVer, fDistance, fUpperDistance, fLowerDistance, fLeftDelta, fRightDelta,
- bBelow, bTextRotation, bTextAutoAngle));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
+ aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE;
+ break;
+ }
+ case SDRMEASURE_TEXTINSIDE :
+ {
+ aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED;
+ break;
+ }
+ case SDRMEASURE_TEXTRIGHTOUTSIDE :
+ {
+ aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE;
+ break;
+ }
+ default : // SDRMEASURE_TEXTHAUTO
+ {
+ break;
+ }
+ }
- delete pAttribute;
+ switch(((SdrMeasureTextVPosItem&)rItemSet.Get(SDRATTR_MEASURETEXTVPOS)).GetValue())
+ {
+ case SDRMEASURE_ABOVE :
+ {
+ aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE;
+ break;
+ }
+ case SDRMEASURETEXT_BREAKEDLINE :
+ case SDRMEASURETEXT_VERTICALCENTERED :
+ {
+ aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED;
+ break;
+ }
+ case SDRMEASURE_BELOW :
+ {
+ aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE;
+ break;
+ }
+ default : // SDRMEASURE_TEXTVAUTO
+ {
+ break;
}
}
- return xRetval;
+ // create primitive with the model data. Always create primitives to allow the
+ // decomposition of SdrMeasurePrimitive2D to create needed invisible elements for HitTest
+ // and/or BoundRect
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrMeasurePrimitive2D(
+ aAttribute, aStart, aEnd,
+ aMTPHor, aMTPVer, fDistance,
+ fUpperDistance, fLowerDistance,
+ fLeftDelta, fRightDelta, bBelow,
+ bTextRotation, bTextAutoAngle));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx
index b9cf4e0a9b..1909b1bdf1 100644
--- a/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx
@@ -157,7 +157,9 @@ namespace sdr
// create range using the model data directly. This is in SdrTextObj::aRect which i will access using
// GetGeoRect() to not trigger any calculations. It's the unrotated geometry which is okay for MediaObjects ATM.
const Rectangle& rRectangle(GetSdrMediaObj().GetGeoRect());
- const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
+ const basegfx::B2DRange aRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
// create object transform
basegfx::B2DHomMatrix aTransform;
@@ -166,12 +168,15 @@ namespace sdr
aTransform.set(0, 2, aRange.getMinX());
aTransform.set(1, 2, aRange.getMinY());
- // create media primitive
+ // create media primitive. Always create primitives to allow the
+ // decomposition of MediaPrimitive2D to create needed invisible elements for HitTest
+ // and/or BoundRect
const basegfx::BColor aBackgroundColor(67.0 / 255.0, 67.0 / 255.0, 67.0 / 255.0);
const rtl::OUString& rURL(GetSdrMediaObj().getURL());
const sal_uInt32 nPixelBorder(4L);
- const drawinglayer::primitive2d::Primitive2DReference xRetval(new drawinglayer::primitive2d::MediaPrimitive2D(
- aTransform, rURL, aBackgroundColor, nPixelBorder));
+ const drawinglayer::primitive2d::Primitive2DReference xRetval(
+ new drawinglayer::primitive2d::MediaPrimitive2D(
+ aTransform, rURL, aBackgroundColor, nPixelBorder));
return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1);
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
index e07f6b4d37..9492427862 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
@@ -34,13 +34,13 @@
#include <svx/svdoashp.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svditer.hxx>
#include <svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <svx/obj3d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -121,126 +121,121 @@ namespace sdr
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetCustomShapeObj().GetMergedItemSet();
- SdrText* pSdrText = GetCustomShapeObj().getText(0);
- if(pSdrText)
- {
- // #i98072# Get shandow and text; eventually suppress the text if it's
- // a TextPath FontworkGallery object
- drawinglayer::attribute::SdrShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrShadowTextAttribute(
+ // #i98072# Get shandow and text; eventually suppress the text if it's
+ // a TextPath FontworkGallery object
+ const drawinglayer::attribute::SdrShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrShadowTextAttribute(
rItemSet,
- *pSdrText,
- GetCustomShapeObj().IsTextPath());
- drawinglayer::primitive2d::Primitive2DSequence xGroup;
- bool bHasText(pAttribute && pAttribute->getText());
+ GetCustomShapeObj().getText(0),
+ GetCustomShapeObj().IsTextPath()));
+ drawinglayer::primitive2d::Primitive2DSequence xGroup;
+ bool bHasText(!aAttribute.getText().isDefault());
- // create Primitive2DSequence from sub-geometry
- const SdrObject* pSdrObjRepresentation = GetCustomShapeObj().GetSdrObjectFromCustomShape();
- bool b3DShape(false);
+ // create Primitive2DSequence from sub-geometry
+ const SdrObject* pSdrObjRepresentation = GetCustomShapeObj().GetSdrObjectFromCustomShape();
+ bool b3DShape(false);
- if(pSdrObjRepresentation)
+ if(pSdrObjRepresentation)
+ {
+ SdrObjListIter aIterator(*pSdrObjRepresentation);
+
+ while(aIterator.IsMore())
{
- SdrObjListIter aIterator(*pSdrObjRepresentation);
-
- while(aIterator.IsMore())
- {
- SdrObject& rCandidate = *aIterator.Next();
+ SdrObject& rCandidate = *aIterator.Next();
- if(!b3DShape && dynamic_cast< E3dObject* >(&rCandidate))
- {
- b3DShape = true;
- }
-
- const drawinglayer::primitive2d::Primitive2DSequence xNew(rCandidate.GetViewContact().getViewIndependentPrimitive2DSequence());
- drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xGroup, xNew);
+ if(!b3DShape && dynamic_cast< E3dObject* >(&rCandidate))
+ {
+ b3DShape = true;
}
+
+ const drawinglayer::primitive2d::Primitive2DSequence xNew(rCandidate.GetViewContact().getViewIndependentPrimitive2DSequence());
+ drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xGroup, xNew);
}
+ }
+
+ if(bHasText || xGroup.hasElements())
+ {
+ // prepare text box geometry
+ basegfx::B2DHomMatrix aTextBoxMatrix;
+ bool bWordWrap(false);
- if(bHasText || xGroup.hasElements())
+ if(bHasText)
{
- // prepare text box geometry
- basegfx::B2DHomMatrix aTextBoxMatrix;
- bool bWordWrap(false);
+ // take unrotated snap rect as default, then get the
+ // unrotated text box. Rotation needs to be done centered
+ const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect());
+ const basegfx::B2DRange aObjectRange(aObjectBound.Left(), aObjectBound.Top(), aObjectBound.Right(), aObjectBound.Bottom());
- if(bHasText)
- {
- // take unrotated snap rect as default, then get the
- // unrotated text box. Rotation needs to be done centered
- const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect());
- const basegfx::B2DRange aObjectRange(aObjectBound.Left(), aObjectBound.Top(), aObjectBound.Right(), aObjectBound.Bottom());
+ // #i101684# get the text range unrotated and absolute to the object range
+ const basegfx::B2DRange aTextRange(getCorrectedTextBoundRect());
- // #i101684# get the text range unrotated and absolute to the object range
- const basegfx::B2DRange aTextRange(getCorrectedTextBoundRect());
+ // give text object a size
+ aTextBoxMatrix.scale(aTextRange.getWidth(), aTextRange.getHeight());
- // give text object a size
- aTextBoxMatrix.scale(aTextRange.getWidth(), aTextRange.getHeight());
+ // check if we have a rotation/shear at all to take care of
+ const double fExtraTextRotation(GetCustomShapeObj().GetExtraTextRotation());
+ const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat());
- // check if we have a rotation/shear at all to take care of
- const double fExtraTextRotation(GetCustomShapeObj().GetExtraTextRotation());
- const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat());
+ if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !basegfx::fTools::equalZero(fExtraTextRotation))
+ {
+ if(aObjectRange != aTextRange)
+ {
+ // move relative to unrotated object range
+ aTextBoxMatrix.translate(
+ aTextRange.getMinX() - aObjectRange.getMinimum().getX(),
+ aTextRange.getMinY() - aObjectRange.getMinimum().getY());
+ }
- if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !basegfx::fTools::equalZero(fExtraTextRotation))
+ if(rGeoStat.nShearWink)
{
- if(aObjectRange != aTextRange)
- {
- // move relative to unrotated object range
- aTextBoxMatrix.translate(
- aTextRange.getMinX() - aObjectRange.getMinimum().getX(),
- aTextRange.getMinY() - aObjectRange.getMinimum().getY());
- }
-
- if(rGeoStat.nShearWink)
- {
- aTextBoxMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000));
- }
-
- if(rGeoStat.nDrehWink)
- {
- aTextBoxMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
- }
-
- if(!basegfx::fTools::equalZero(fExtraTextRotation))
- {
- aTextBoxMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180);
- }
-
- // give text it's target position
- aTextBoxMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY());
+ aTextBoxMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000));
}
- else
+
+ if(rGeoStat.nDrehWink)
{
- aTextBoxMatrix.translate(aTextRange.getMinX(), aTextRange.getMinY());
+ aTextBoxMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
}
- // check if SdrTextWordWrapItem is set
- bWordWrap = ((SdrTextWordWrapItem&)(GetCustomShapeObj().GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue();
- }
+ if(!basegfx::fTools::equalZero(fExtraTextRotation))
+ {
+ aTextBoxMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180);
+ }
- // make sure a (even empty) SdrShadowTextAttribute exists for
- // primitive creation
- if(!pAttribute)
+ // give text it's target position
+ aTextBoxMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY());
+ }
+ else
{
- pAttribute = new drawinglayer::attribute::SdrShadowTextAttribute(0L, 0L);
+ aTextBoxMatrix.translate(aTextRange.getMinX(), aTextRange.getMinY());
}
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::SdrCustomShapePrimitive2D(
- *pAttribute,
- xGroup,
- aTextBoxMatrix,
- bWordWrap,
- b3DShape,
- false)); // #SJ# New parameter to force to clipped BlockText for SC
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ // check if SdrTextWordWrapItem is set
+ bWordWrap = ((SdrTextWordWrapItem&)(GetCustomShapeObj().GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue();
}
- if(pAttribute)
- {
- delete pAttribute;
- }
+ // create primitive
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrCustomShapePrimitive2D(
+ aAttribute,
+ xGroup,
+ aTextBoxMatrix,
+ bWordWrap,
+ b3DShape,
+ false)); // #SJ# New parameter to force to clipped BlockText for SC
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
+ // always append an invisible outline for the cases where no visible content exists
+ const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect());
+ const basegfx::B2DRange aObjectRange(
+ aObjectBound.Left(), aObjectBound.Top(),
+ aObjectBound.Right(), aObjectBound.Bottom());
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, aObjectRange));
+
return xRetval;
}
} // end of namespace contact
diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
index 0038b7ea85..ca0735d93b 100644
--- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
@@ -34,7 +34,6 @@
#include <svx/sdr/contact/viewcontactofsdrole2obj.hxx>
#include <svx/svdoole2.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/contact/viewobjectcontactofsdrole2obj.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <svx/sdr/primitive2d/sdrole2primitive2d.hxx>
@@ -76,59 +75,51 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createPrimitive2DSequenceWithParameters(
bool bHighContrast) const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
- SdrText* pSdrText = GetOle2Obj().getText(0);
-
- if(pSdrText)
- {
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = GetOle2Obj().GetGeoRect();
- const basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
-
- // create object matrix
- const GeoStat& rGeoStat(GetOle2Obj().GetGeoStat());
- const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
- const double fRotate(rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0);
- const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
-
- // Prepare attribute settings, will be used soon anyways
- const SfxItemSet& rItemSet = GetOle2Obj().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
-
- if(!pAttribute)
- {
- // force existence, even when not visible
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowTextAttribute(0, 0, 0, 0, 0, 0);
- }
-
- // #i102063# embed OLE content in an own primitive; this will be able to decompose accessing
- // the weak SdrOle2 reference and will also implement getB2DRange() for fast BoundRect
- // calculations without OLE Graphic access (which may trigger e.g. chart recalculation).
- // It will also take care of HighContrast and ScaleContent
- const drawinglayer::primitive2d::Primitive2DReference xOleContent(
- new drawinglayer::primitive2d::SdrOleContentPrimitive2D(
- GetOle2Obj(),
- aObjectMatrix,
-
- // #i104867# add GraphicVersion number to be able to check for
- // content change in the primitive later
- GetOle2Obj().getEmbeddedObjectRef().getGraphicVersion(),
-
- bHighContrast));
-
- // create primitive. Use Ole2 primitive here. Prepare attribute settings, will be used soon anyways.
- const drawinglayer::primitive2d::Primitive2DSequence xOLEContent(&xOleContent, 1);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrOle2Primitive2D(
+ // take unrotated snap rect (direct model data) for position and size
+ const Rectangle& rRectangle = GetOle2Obj().GetGeoRect();
+ const basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
+
+ // create object matrix
+ const GeoStat& rGeoStat(GetOle2Obj().GetGeoStat());
+ const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
+ const double fRotate(rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0);
+ const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
+
+ // Prepare attribute settings, will be used soon anyways
+ const SfxItemSet& rItemSet = GetOle2Obj().GetMergedItemSet();
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ GetOle2Obj().getText(0)));
+
+ // #i102063# embed OLE content in an own primitive; this will be able to decompose accessing
+ // the weak SdrOle2 reference and will also implement getB2DRange() for fast BoundRect
+ // calculations without OLE Graphic access (which may trigger e.g. chart recalculation).
+ // It will also take care of HighContrast and ScaleContent
+ const drawinglayer::primitive2d::Primitive2DReference xOleContent(
+ new drawinglayer::primitive2d::SdrOleContentPrimitive2D(
+ GetOle2Obj(),
+ aObjectMatrix,
+
+ // #i104867# add GraphicVersion number to be able to check for
+ // content change in the primitive later
+ GetOle2Obj().getEmbeddedObjectRef().getGraphicVersion(),
+
+ bHighContrast));
+
+ // create primitive. Use Ole2 primitive here. Prepare attribute settings, will
+ // be used soon anyways. Always create primitives to allow the decomposition of
+ // SdrOle2Primitive2D to create needed invisible elements for HitTest and/or BoundRect
+ const drawinglayer::primitive2d::Primitive2DSequence xOLEContent(&xOleContent, 1);
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrOle2Primitive2D(
xOLEContent,
aObjectMatrix,
- *pAttribute));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- delete pAttribute;
- }
+ aAttribute));
- return xRetval;
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createViewIndependentPrimitive2DSequence() const
diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
index c150681efb..9a86a44032 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
@@ -45,9 +45,9 @@
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -101,7 +101,8 @@ namespace sdr
const svtools::ColorConfig aColorConfig;
const Color aInitColor(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
const basegfx::BColor aRGBColor(aInitColor.getBColor());
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::BackgroundColorPrimitive2D(aRGBColor));
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::BackgroundColorPrimitive2D(aRGBColor));
return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
@@ -216,25 +217,25 @@ namespace sdr
{
// build primitive from pObject's attributes
const SfxItemSet& rFillProperties = pObject->GetMergedItemSet();
- drawinglayer::attribute::SdrFillAttribute* pFill = drawinglayer::primitive2d::createNewSdrFillAttribute(rFillProperties);
+ const drawinglayer::attribute::SdrFillAttribute aFill(
+ drawinglayer::primitive2d::createNewSdrFillAttribute(rFillProperties));
- if(pFill)
+ if(!aFill.isDefault() && 1.0 != aFill.getTransparence())
{
- if(pFill->isVisible())
- {
- // direct model data is the page size, get and use it
- const basegfx::B2DRange aInnerRange(
- rPage.GetLftBorder(), rPage.GetUppBorder(),
- rPage.GetWdt() - rPage.GetRgtBorder(), rPage.GetHgt() - rPage.GetLwrBorder());
- const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
- const basegfx::B2DHomMatrix aEmptyTransform;
- const drawinglayer::primitive2d::Primitive2DReference xReference(drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
- basegfx::B2DPolyPolygon(aInnerPolgon), aEmptyTransform, *pFill));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
-
- delete pFill;
+ // direct model data is the page size, get and use it
+ const basegfx::B2DRange aInnerRange(
+ rPage.GetLftBorder(), rPage.GetUppBorder(),
+ rPage.GetWdt() - rPage.GetRgtBorder(), rPage.GetHgt() - rPage.GetLwrBorder());
+ const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
+ const basegfx::B2DHomMatrix aEmptyTransform;
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aInnerPolgon),
+ aEmptyTransform,
+ aFill,
+ drawinglayer::attribute::FillGradientAttribute()));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
}
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
index 4b92c70587..67a31d7423 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
@@ -35,7 +35,6 @@
#include <svx/sdr/contact/viewcontactofsdrpathobj.hxx>
#include <svx/svdopath.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <svx/sdr/primitive2d/sdrpathprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -57,93 +56,91 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrPathObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetPathObj().GetMergedItemSet();
- SdrText* pSdrText = GetPathObj().getText(0);
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ GetPathObj().getText(0)));
+ basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().GetPathPoly());
+ sal_uInt32 nPolyCount(aUnitPolyPolygon.count());
+ sal_uInt32 nPointCount(0);
+
+ for(sal_uInt32 a(0); a < nPolyCount; a++)
+ {
+ nPointCount += aUnitPolyPolygon.getB2DPolygon(a).count();
+ }
- if(pSdrText)
+ if(!nPointCount)
{
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute =
- drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
- rItemSet,
- *pSdrText);
-
- if(pAttribute)
- {
- if(pAttribute->isVisible())
- {
- basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().GetPathPoly());
- const sal_uInt32 nPolyCount(aUnitPolyPolygon.count());
-
- if(nPolyCount)
- {
- // prepare object transformation and unit polygon (direct model data)
- basegfx::B2DHomMatrix aObjectMatrix;
- const bool bIsLine(
- !aUnitPolyPolygon.areControlPointsUsed()
- && 1 == nPolyCount
- && 2 == aUnitPolyPolygon.getB2DPolygon(0).count());
-
- if(bIsLine)
- {
- // special handling for single line mode (2 points)
- const basegfx::B2DPolygon aSubPolygon(aUnitPolyPolygon.getB2DPolygon(0));
- const basegfx::B2DPoint aStart(aSubPolygon.getB2DPoint(0));
- const basegfx::B2DPoint aEnd(aSubPolygon.getB2DPoint(1));
- const basegfx::B2DVector aLine(aEnd - aStart);
-
- // #i102548# create new unit polygon for line (horizontal)
- basegfx::B2DPolygon aNewPolygon;
- aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0));
- aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0));
- aUnitPolyPolygon.setB2DPolygon(0, aNewPolygon);
-
- // #i102548# fill objectMatrix with rotation and offset (no shear for lines)
- aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aLine.getLength(), 1.0,
- 0.0,
- atan2(aLine.getY(), aLine.getX()),
- aStart.getX(), aStart.getY());
- }
- else
- {
- // #i102548# create unscaled, unsheared, unrotated and untranslated polygon
- // (unit polygon) by creating the object matrix and back-transforming the polygon
- const basegfx::B2DRange aObjectRange(basegfx::tools::getRange(aUnitPolyPolygon));
- const GeoStat& rGeoStat(GetPathObj().GetGeoStat());
- const double fWidth(aObjectRange.getWidth());
- const double fHeight(aObjectRange.getHeight());
- const double fScaleX(basegfx::fTools::equalZero(fWidth) ? 1.0 : fWidth);
- const double fScaleY(basegfx::fTools::equalZero(fHeight) ? 1.0 : fHeight);
-
- aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- fScaleX, fScaleY,
- rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
- rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY());
-
- // ceate unit polygon from object's absolute path
- basegfx::B2DHomMatrix aInverse(aObjectMatrix);
- aInverse.invert();
- aUnitPolyPolygon.transform(aInverse);
- }
-
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::SdrPathPrimitive2D(
- aObjectMatrix,
- *pAttribute,
- aUnitPolyPolygon));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- }
-
- delete pAttribute;
- }
+ OSL_ENSURE(false, "PolyPolygon object without geometry detected, this should not be created (!)");
+ basegfx::B2DPolygon aFallbackLine;
+ aFallbackLine.append(basegfx::B2DPoint(0.0, 0.0));
+ aFallbackLine.append(basegfx::B2DPoint(1000.0, 1000.0));
+ aUnitPolyPolygon = basegfx::B2DPolyPolygon(aFallbackLine);
+
+ nPolyCount = 1;
}
- return xRetval;
+ // prepare object transformation and unit polygon (direct model data)
+ basegfx::B2DHomMatrix aObjectMatrix;
+ const bool bIsLine(
+ !aUnitPolyPolygon.areControlPointsUsed()
+ && 1 == nPolyCount
+ && 2 == aUnitPolyPolygon.getB2DPolygon(0).count());
+
+ if(bIsLine)
+ {
+ // special handling for single line mode (2 points)
+ const basegfx::B2DPolygon aSubPolygon(aUnitPolyPolygon.getB2DPolygon(0));
+ const basegfx::B2DPoint aStart(aSubPolygon.getB2DPoint(0));
+ const basegfx::B2DPoint aEnd(aSubPolygon.getB2DPoint(1));
+ const basegfx::B2DVector aLine(aEnd - aStart);
+
+ // #i102548# create new unit polygon for line (horizontal)
+ basegfx::B2DPolygon aNewPolygon;
+ aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0));
+ aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0));
+ aUnitPolyPolygon.setB2DPolygon(0, aNewPolygon);
+
+ // #i102548# fill objectMatrix with rotation and offset (no shear for lines)
+ aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aLine.getLength(), 1.0,
+ 0.0,
+ atan2(aLine.getY(), aLine.getX()),
+ aStart.getX(), aStart.getY());
+ }
+ else
+ {
+ // #i102548# create unscaled, unsheared, unrotated and untranslated polygon
+ // (unit polygon) by creating the object matrix and back-transforming the polygon
+ const basegfx::B2DRange aObjectRange(basegfx::tools::getRange(aUnitPolyPolygon));
+ const GeoStat& rGeoStat(GetPathObj().GetGeoStat());
+ const double fWidth(aObjectRange.getWidth());
+ const double fHeight(aObjectRange.getHeight());
+ const double fScaleX(basegfx::fTools::equalZero(fWidth) ? 1.0 : fWidth);
+ const double fScaleY(basegfx::fTools::equalZero(fHeight) ? 1.0 : fHeight);
+
+ aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ fScaleX, fScaleY,
+ rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
+ rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
+ aObjectRange.getMinX(), aObjectRange.getMinY());
+
+ // ceate unit polygon from object's absolute path
+ basegfx::B2DHomMatrix aInverse(aObjectMatrix);
+ aInverse.invert();
+ aUnitPolyPolygon.transform(aInverse);
+ }
+
+ // create primitive. Always create primitives to allow the decomposition of
+ // SdrPathPrimitive2D to create needed invisible elements for HitTest and/or BoundRect
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrPathPrimitive2D(
+ aObjectMatrix,
+ aAttribute,
+ aUnitPolyPolygon));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
index 8ac99245a1..ae36d674aa 100644
--- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
@@ -35,7 +35,6 @@
#include <svx/sdr/contact/viewcontactofsdrrectobj.hxx>
#include <svx/svdorect.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx>
#include <svl/itemset.hxx>
#include <svx/sdr/primitive2d/sdrprimitivetools.hxx>
@@ -59,70 +58,48 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrRectObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetRectObj().GetMergedItemSet();
- SdrText* pSdrText = GetRectObj().getText(0);
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ GetRectObj().getText(0)));
- if(pSdrText)
- {
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
+ // take unrotated snap rect (direct model data) for position and size
+ const Rectangle& rRectangle = GetRectObj().GetGeoRect();
+ const ::basegfx::B2DRange aObjectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+ const GeoStat& rGeoStat(GetRectObj().GetGeoStat());
+
+ // fill object matrix
+ basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(),
+ rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
+ rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
- if(pAttribute)
- {
- if(pAttribute->isVisible())
- {
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = GetRectObj().GetGeoRect();
- const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
- const GeoStat& rGeoStat(GetRectObj().GetGeoStat());
-
- // fill object matrix
- basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
- rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
+ // calculate corner radius
+ sal_uInt32 nCornerRadius(((SdrEckenradiusItem&)(rItemSet.Get(SDRATTR_ECKENRADIUS))).GetValue());
+ double fCornerRadiusX;
+ double fCornerRadiusY;
+ drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY);
- // calculate corner radius
- sal_uInt32 nCornerRadius(((SdrEckenradiusItem&)(rItemSet.Get(SDRATTR_ECKENRADIUS))).GetValue());
- double fCornerRadiusX;
- double fCornerRadiusY;
- drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY);
+ // #i105856# use knowledge about pickthrough from the model
+ const bool bPickThroughTransparentTextFrames(
+ GetRectObj().GetModel() && GetRectObj().GetModel()->IsPickThroughTransparentTextFrames());
- // #i105856# use knowledge about pickthrough from the model
- const bool bPickThroughTransparentTextFrames(
- GetRectObj().GetModel() && GetRectObj().GetModel()->IsPickThroughTransparentTextFrames());
-
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::SdrRectanglePrimitive2D(
- aObjectMatrix,
- *pAttribute,
- fCornerRadiusX,
- fCornerRadiusY,
- // #i105856# use fill for HitTest when TextFrame and not PickThrough
- GetRectObj().IsTextFrame() && !bPickThroughTransparentTextFrames));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
-
- delete pAttribute;
- }
-
- if(!xRetval.hasElements())
- {
- // #i99123#
- // Object is invisible. Create a fallback primitive for HitTest
- basegfx::B2DHomMatrix aObjectMatrix;
- basegfx::B2DPolyPolygon aObjectPolyPolygon;
- GetRectObj().TRGetBaseGeometry(aObjectMatrix, aObjectPolyPolygon);
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- drawinglayer::primitive2d::createFallbackHitTestPrimitive(aObjectMatrix));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- }
-
- return xRetval;
+ // create primitive. Always create primitives to allow the decomposition of
+ // SdrRectanglePrimitive2D to create needed invisible elements for HitTest and/or BoundRect
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrRectanglePrimitive2D(
+ aObjectMatrix,
+ aAttribute,
+ fCornerRadiusX,
+ fCornerRadiusY,
+ // #i105856# use fill for HitTest when TextFrame and not PickThrough
+ GetRectObj().IsTextFrame() && !bPickThroughTransparentTextFrames));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofunocontrol.cxx b/svx/source/sdr/contact/viewcontactofunocontrol.cxx
index 1de8ffd792..d25ee9606f 100644
--- a/svx/source/sdr/contact/viewcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewcontactofunocontrol.cxx
@@ -50,6 +50,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <drawinglayer/primitive2d/controlprimitive2d.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//........................................................................
namespace sdr { namespace contact {
@@ -138,35 +139,43 @@ namespace sdr { namespace contact {
//--------------------------------------------------------------------
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfUnoControl::createViewIndependentPrimitive2DSequence() const
{
+ // create range. Use model data directly, not getBoundRect()/getSnapRect; these will use
+ // the primitive data themselves in the long run. Use SdrUnoObj's (which is a SdrRectObj)
+ // call to GetGeoRect() to access SdrTextObj::aRect directly and without executing anything
+ const Rectangle& rRectangle(GetSdrUnoObj().GetGeoRect());
+ const basegfx::B2DRange aRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+
+ // create object transform
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.set(0, 0, aRange.getWidth());
+ aTransform.set(1, 1, aRange.getHeight());
+ aTransform.set(0, 2, aRange.getMinX());
+ aTransform.set(1, 2, aRange.getMinY());
+
Reference< XControlModel > xControlModel = GetSdrUnoObj().GetUnoControlModel();
if(xControlModel.is())
{
- // create range. Use model data directly, not getBoundRect()/getSnapRect; these will use
- // the primitive data themselves in the long run. Use SdrUnoObj's (which is a SdrRectObj)
- // call to GetGeoRect() to access SdrTextObj::aRect directly and without executing anything
- const Rectangle& rRectangle(GetSdrUnoObj().GetGeoRect());
- const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
-
- // create object transform
- basegfx::B2DHomMatrix aTransform;
- aTransform.set(0, 0, aRange.getWidth());
- aTransform.set(1, 1, aRange.getHeight());
- aTransform.set(0, 2, aRange.getMinX());
- aTransform.set(1, 2, aRange.getMinY());
-
// create control primitive WITHOUT possibly existing XControl; this would be done in
// the VOC in createPrimitive2DSequence()
- const drawinglayer::primitive2d::Primitive2DReference xRetval(new drawinglayer::primitive2d::ControlPrimitive2D(
- aTransform, xControlModel));
+ const drawinglayer::primitive2d::Primitive2DReference xRetval(
+ new drawinglayer::primitive2d::ControlPrimitive2D(
+ aTransform,
+ xControlModel));
return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1);
}
else
{
- // #i93161# This UnoControl does not yet have a xControlModel (can happen
- // during diverse creations). Without a model, create no visualisation.
- return drawinglayer::primitive2d::Primitive2DSequence();
+ // always append an invisible outline for the cases where no visible content exists
+ const drawinglayer::primitive2d::Primitive2DReference xRetval(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, aTransform));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1);
}
}
diff --git a/svx/source/sdr/contact/viewcontactofvirtobj.cxx b/svx/source/sdr/contact/viewcontactofvirtobj.cxx
index ce6a755af7..e3582f88eb 100644
--- a/svx/source/sdr/contact/viewcontactofvirtobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofvirtobj.cxx
@@ -36,6 +36,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <vcl/outdev.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -77,29 +78,39 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfVirtObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
+ // create displacement transformation if we have content
+ basegfx::B2DHomMatrix aObjectMatrix;
+ Point aAnchor(GetVirtObj().GetAnchorPos());
+
+ if(aAnchor.X() || aAnchor.Y())
+ {
+ aObjectMatrix.set(0, 2, aAnchor.X());
+ aObjectMatrix.set(1, 2, aAnchor.Y());
+ }
// use method from referenced object to get the Primitive2DSequence
- const drawinglayer::primitive2d::Primitive2DSequence xSequenceVirtual(GetVirtObj().GetReferencedObj().GetViewContact().getViewIndependentPrimitive2DSequence());
+ const drawinglayer::primitive2d::Primitive2DSequence xSequenceVirtual(
+ GetVirtObj().GetReferencedObj().GetViewContact().getViewIndependentPrimitive2DSequence());
if(xSequenceVirtual.hasElements())
{
- // create displacement transformation if we have content
- ::basegfx::B2DHomMatrix aObjectMatrix;
- Point aAnchor(GetVirtObj().GetAnchorPos());
-
- if(aAnchor.X() || aAnchor.Y())
- {
- aObjectMatrix.set(0, 2, aAnchor.X());
- aObjectMatrix.set(1, 2, aAnchor.Y());
- }
-
// create transform primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::TransformPrimitive2D(aObjectMatrix, xSequenceVirtual));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
+ aObjectMatrix,
+ xSequenceVirtual));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
+ else
+ {
+ // always append an invisible outline for the cases where no visible content exists
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, aObjectMatrix));
- return xRetval;
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
index c59072c31d..b036b2d460 100644
--- a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
@@ -39,7 +39,6 @@
#include <svx/sdr/contact/viewobjectcontactofe3dscene.hxx>
#include <drawinglayer/primitive2d/embedded3dprimitive2d.hxx>
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
//////////////////////////////////////////////////////////////////////////////
// predeclarations
diff --git a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
index 21f7a9d3e2..f41e864f8b 100644
--- a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
@@ -125,17 +125,6 @@ namespace sdr
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
}
- else
- {
- // do neither print nor PDF export the fallback visualisation
- if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile())
- {
- // empty group, fallback to parent method which will create the default
- // grayed frame for empty 3d scenes by using model data and
- // createViewIndependentPrimitive2DSequence::ViewContactOfE3dScene
- xRetval = ViewObjectContactOfSdrObj::createPrimitive2DSequence(rDisplayInfo);
- }
- }
if(bIsActiveVC)
{
diff --git a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
index 9f58fe5f9e..5e037dd44a 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
@@ -59,20 +59,6 @@ namespace sdr
{
}
- bool ViewObjectContactOfGroup::isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const
- {
- const bool bHasChildren(0 != GetViewContact().GetObjectCount());
-
- if(!bHasChildren && (GetObjectContact().isOutputToPrinter() || GetObjectContact().isOutputToRecordingMetaFile()))
- {
- // empty group uses fallback gray empty frame display. Do neither print nor PDF export it
- return false;
- }
-
- // call parent
- return ViewObjectContactOfSdrObj::isPrimitiveVisible(rDisplayInfo);
- }
-
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfGroup::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const
{
const sal_uInt32 nSubHierarchyCount(GetViewContact().GetObjectCount());
diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
index fefe1fa720..3c4e531999 100644
--- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
@@ -44,7 +44,7 @@
#include <svx/svdpage.hxx>
#include <unoapi.hxx>
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -296,28 +296,19 @@ namespace sdr
else if(bCreateGrayFrame)
{
// #i105146# no content, but frame display. To make hitting the page preview objects
- // on the handout page more simple, add a HitTest fill primitive
- const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aUnitRange));
- aOutline.transform(aPageObjectTransform);
-
- const drawinglayer::primitive2d::Primitive2DReference xHitFill(
- new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
- basegfx::B2DPolyPolygon(aOutline),
- basegfx::BColor(0.0, 0.0, 0.0)));
-
- const drawinglayer::primitive2d::Primitive2DReference xHit(
- new drawinglayer::primitive2d::HitTestPrimitive2D(
- drawinglayer::primitive2d::Primitive2DSequence(&xHitFill, 1)));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xHit, 1);
+ // on the handout page more simple, add hidden fill geometry
+ const drawinglayer::primitive2d::Primitive2DReference xFrameHit(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false,
+ aPageObjectTransform));
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xFrameHit, 1);
}
// add a gray outline frame, except not when printing
if(bCreateGrayFrame)
{
const Color aFrameColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES).nColor);
- basegfx::B2DPolygon aOwnOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aOwnOutline(basegfx::tools::createUnitPolygon());
aOwnOutline.transform(aPageObjectTransform);
const drawinglayer::primitive2d::Primitive2DReference xGrayFrame(
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
index 9c9aaa959c..c2b62b0cff 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
@@ -39,11 +39,11 @@
#include <svx/sdr/contact/objectcontact.hxx>
#include <svx/svdview.hxx>
#include <drawinglayer/primitive2d/chartprimitive2d.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
-#include <com/sun/star/embed/EmbedMisc.hpp>
-#include <com/sun/star/embed/EmbedStates.hpp>
+#include <com/sun/star/embed/EmbedMisc.hpp>
+#include <com/sun/star/embed/EmbedStates.hpp>
+#include <basegfx/polygon/b2dpolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -207,7 +207,7 @@ namespace sdr
if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile())
{
// shade the representation if the object is activated outplace
- basegfx::B2DPolygon aObjectOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aObjectOutline(basegfx::tools::createUnitPolygon());
aObjectOutline.transform(aObjectTransform);
// Use a FillHatchPrimitive2D with necessary attributes
diff --git a/svx/source/sdr/overlay/overlayobjectcell.cxx b/svx/source/sdr/overlay/overlayobjectcell.cxx
index cda1bbd636..00e80ced0c 100644
--- a/svx/source/sdr/overlay/overlayobjectcell.cxx
+++ b/svx/source/sdr/overlay/overlayobjectcell.cxx
@@ -38,7 +38,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
using namespace ::basegfx;
@@ -87,12 +87,12 @@ namespace sdr
if(mePaintType == CELL_OVERLAY_TRANSPARENT)
{
// embed in 50% transparent paint
- const drawinglayer::primitive2d::Primitive2DReference aUnifiedAlpha(
- new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ const drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparence(
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
aRetval,
0.5));
- aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlpha, 1);
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparence, 1);
}
else // CELL_OVERLAY_INVERT
{
diff --git a/svx/source/sdr/overlay/overlayselection.cxx b/svx/source/sdr/overlay/overlayselection.cxx
index 24c73e045b..d8d1e21e39 100644
--- a/svx/source/sdr/overlay/overlayselection.cxx
+++ b/svx/source/sdr/overlay/overlayselection.cxx
@@ -38,7 +38,7 @@
#include <vcl/svapp.hxx>
#include <vcl/outdev.hxx>
#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
@@ -144,8 +144,8 @@ namespace sdr
{
// embed all rectangles in transparent paint
const double fTransparence(mnLastTransparence / 100.0);
- const drawinglayer::primitive2d::Primitive2DReference aUnifiedAlpha(
- new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ const drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparence(
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
aRetval,
fTransparence));
@@ -159,13 +159,13 @@ namespace sdr
// add both to result
aRetval.realloc(2);
- aRetval[0] = aUnifiedAlpha;
+ aRetval[0] = aUnifiedTransparence;
aRetval[1] = aSelectionOutline;
}
else
{
// just add transparent part
- aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlpha, 1);
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparence, 1);
}
}
}
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 5d5ecad5d0..33b720f59f 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -58,14 +58,11 @@
#include <svx/sdsxyitm.hxx>
#include <svx/sdshcitm.hxx>
#include <svx/sdshtitm.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
#include <basegfx/polygon/b2dlinegeometry.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/svdotext.hxx>
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
#include <svx/sdr/attribute/sdrtextattribute.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/xbtmpit.hxx>
#include <svl/itempool.hxx>
#include <vcl/svapp.hxx>
@@ -73,13 +70,22 @@
#include <svx/svx3ditems.hxx>
#include <com/sun/star/drawing/ProjectionMode.hpp>
#include <com/sun/star/drawing/ShadeMode.hpp>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/attribute/sdrallattribute3d.hxx>
#include <svx/rectenum.hxx>
#include <svx/sdtfchim.hxx>
#include <svx/svdoutl.hxx>
#include <svx/svdmodel.hxx>
#include <svx/editstat.hxx>
+#include <drawinglayer/attribute/fillhatchattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+#include <svx/sdr/attribute/sdrshadowtextattribute.hxx>
+#include <svx/sdr/attribute/sdrlineshadowtextattribute.hxx>
+#include <svx/sdr/attribute/sdrformtextattribute.hxx>
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
+#include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
+#include <svx/sdr/attribute/sdrfilltextattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -221,9 +227,8 @@ namespace drawinglayer
{
namespace primitive2d
{
- attribute::SdrLineAttribute* createNewSdrLineAttribute(const SfxItemSet& rSet)
+ attribute::SdrLineAttribute createNewSdrLineAttribute(const SfxItemSet& rSet)
{
- attribute::SdrLineAttribute* pRetval(0L);
const XLineStyle eStyle(((XLineStyleItem&)(rSet.Get(XATTR_LINESTYLE))).GetValue());
if(XLINE_NONE != eStyle)
@@ -253,7 +258,7 @@ namespace drawinglayer
}
}
- pRetval = new attribute::SdrLineAttribute(
+ return attribute::SdrLineAttribute(
XLineJointtoB2DLineJoin(eJoint),
(double)nWidth,
(double)nTransparence * 0.01,
@@ -263,12 +268,13 @@ namespace drawinglayer
}
}
- return pRetval;
+ return attribute::SdrLineAttribute();
}
- attribute::SdrLineStartEndAttribute* createNewSdrLineStartEndAttribute(const SfxItemSet& rSet, double fWidth)
+ attribute::SdrLineStartEndAttribute createNewSdrLineStartEndAttribute(
+ const SfxItemSet& rSet,
+ double fWidth)
{
- attribute::SdrLineStartEndAttribute* pRetval(0L);
const sal_Int32 nTempStartWidth(((const XLineStartWidthItem&)(rSet.Get(XATTR_LINESTARTWIDTH))).GetValue());
const sal_Int32 nTempEndWidth(((const XLineEndWidthItem&)(rSet.Get(XATTR_LINEENDWIDTH))).GetValue());
basegfx::B2DPolyPolygon aStartPolyPolygon;
@@ -328,15 +334,16 @@ namespace drawinglayer
if(bStartActive || bEndActive)
{
- pRetval = new attribute::SdrLineStartEndAttribute(aStartPolyPolygon, aEndPolyPolygon, fStartWidth, fEndWidth, bStartActive, bEndActive, bStartCentered, bEndCentered);
+ return attribute::SdrLineStartEndAttribute(
+ aStartPolyPolygon, aEndPolyPolygon, fStartWidth, fEndWidth,
+ bStartActive, bEndActive, bStartCentered, bEndCentered);
}
- return pRetval;
+ return attribute::SdrLineStartEndAttribute();
}
- attribute::SdrShadowAttribute* createNewSdrShadowAttribute(const SfxItemSet& rSet)
+ attribute::SdrShadowAttribute createNewSdrShadowAttribute(const SfxItemSet& rSet)
{
- attribute::SdrShadowAttribute* pRetval(0L);
const bool bShadow(((SdrShadowItem&)rSet.Get(SDRATTR_SHADOW)).GetValue());
if(bShadow)
@@ -374,16 +381,15 @@ namespace drawinglayer
(double)((SdrShadowYDistItem&)(rSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
const Color aColor(((SdrShadowColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
- pRetval = new attribute::SdrShadowAttribute(aOffset, (double)nTransparence * 0.01, aColor.getBColor());
+ return attribute::SdrShadowAttribute(aOffset, (double)nTransparence * 0.01, aColor.getBColor());
}
}
- return pRetval;
+ return attribute::SdrShadowAttribute();
}
- attribute::SdrFillAttribute* createNewSdrFillAttribute(const SfxItemSet& rSet)
+ attribute::SdrFillAttribute createNewSdrFillAttribute(const SfxItemSet& rSet)
{
- attribute::SdrFillAttribute* pRetval(0L);
const XFillStyle eStyle(((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue());
if(XFILL_NONE != eStyle)
@@ -398,9 +404,9 @@ namespace drawinglayer
if(100 != nTransparence)
{
const Color aColor(((const XFillColorItem&)(rSet.Get(XATTR_FILLCOLOR))).GetColorValue());
- attribute::FillGradientAttribute* pGradient(0L);
- attribute::FillHatchAttribute* pHatch(0L);
- attribute::SdrFillBitmapAttribute* pBitmap(0L);
+ attribute::FillGradientAttribute aGradient;
+ attribute::FillHatchAttribute aHatch;
+ attribute::SdrFillBitmapAttribute aBitmap;
switch(eStyle)
{
@@ -412,10 +418,10 @@ namespace drawinglayer
}
case XFILL_GRADIENT :
{
- XGradient aGradient(((XFillGradientItem&)(rSet.Get(XATTR_FILLGRADIENT))).GetGradientValue());
+ XGradient aXGradient(((XFillGradientItem&)(rSet.Get(XATTR_FILLGRADIENT))).GetGradientValue());
- const Color aStartColor(aGradient.GetStartColor());
- const sal_uInt16 nStartIntens(aGradient.GetStartIntens());
+ const Color aStartColor(aXGradient.GetStartColor());
+ const sal_uInt16 nStartIntens(aXGradient.GetStartIntens());
basegfx::BColor aStart(aStartColor.getBColor());
if(nStartIntens != 100)
@@ -424,8 +430,8 @@ namespace drawinglayer
aStart = interpolate(aBlack, aStart, (double)nStartIntens * 0.01);
}
- const Color aEndColor(aGradient.GetEndColor());
- const sal_uInt16 nEndIntens(aGradient.GetEndIntens());
+ const Color aEndColor(aXGradient.GetEndColor());
+ const sal_uInt16 nEndIntens(aXGradient.GetEndIntens());
basegfx::BColor aEnd(aEndColor.getBColor());
if(nEndIntens != 100)
@@ -434,12 +440,12 @@ namespace drawinglayer
aEnd = interpolate(aBlack, aEnd, (double)nEndIntens * 0.01);
}
- pGradient = new attribute::FillGradientAttribute(
- XGradientStyleToGradientStyle(aGradient.GetGradientStyle()),
- (double)aGradient.GetBorder() * 0.01,
- (double)aGradient.GetXOffset() * 0.01,
- (double)aGradient.GetYOffset() * 0.01,
- (double)aGradient.GetAngle() * F_PI1800,
+ aGradient = attribute::FillGradientAttribute(
+ XGradientStyleToGradientStyle(aXGradient.GetGradientStyle()),
+ (double)aXGradient.GetBorder() * 0.01,
+ (double)aXGradient.GetXOffset() * 0.01,
+ (double)aXGradient.GetYOffset() * 0.01,
+ (double)aXGradient.GetAngle() * F_PI1800,
aStart,
aEnd,
((const XGradientStepCountItem&)rSet.Get(XATTR_GRADIENTSTEPCOUNT)).GetValue());
@@ -451,7 +457,7 @@ namespace drawinglayer
const XHatch& rHatch(((XFillHatchItem&)(rSet.Get(XATTR_FILLHATCH))).GetHatchValue());
const Color aColorB(rHatch.GetColor());
- pHatch = new attribute::FillHatchAttribute(
+ aHatch = attribute::FillHatchAttribute(
XHatchStyleToHatchStyle(rHatch.GetHatchStyle()),
(double)rHatch.GetDistance(),
(double)rHatch.GetAngle() * F_PI1800,
@@ -462,23 +468,25 @@ namespace drawinglayer
}
case XFILL_BITMAP :
{
- pBitmap = createNewSdrFillBitmapAttribute(rSet);
+ aBitmap = createNewSdrFillBitmapAttribute(rSet);
break;
}
}
- pRetval = new attribute::SdrFillAttribute(
+ return attribute::SdrFillAttribute(
(double)nTransparence * 0.01,
aColor.getBColor(),
- pGradient, pHatch, pBitmap);
+ aGradient,
+ aHatch,
+ aBitmap);
}
}
- return pRetval;
+ return attribute::SdrFillAttribute();
}
// #i101508# Support handing over given text-to-border distances
- attribute::SdrTextAttribute* createNewSdrTextAttribute(
+ attribute::SdrTextAttribute createNewSdrTextAttribute(
const SfxItemSet& rSet,
const SdrText& rText,
const sal_Int32* pLeft,
@@ -486,7 +494,6 @@ namespace drawinglayer
const sal_Int32* pRight,
const sal_Int32* pLower)
{
- attribute::SdrTextAttribute* pRetval(0);
const SdrTextObj& rTextObj = rText.GetObject();
if(rText.GetOutlinerParaObject() && rText.GetModel())
@@ -530,7 +537,7 @@ namespace drawinglayer
const SdrOutliner& rDrawTextOutliner = rText.GetModel()->GetDrawOutliner(&rTextObj);
const bool bWrongSpell(rDrawTextOutliner.GetControlWord() & EE_CNTRL_ONLINESPELLING);
- pRetval = new attribute::SdrTextAttribute(
+ return attribute::SdrTextAttribute(
rText,
aOutlinerParaObject,
((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue(),
@@ -550,15 +557,15 @@ namespace drawinglayer
bWrongSpell);
}
- return pRetval;
+ return attribute::SdrTextAttribute();
}
- attribute::FillGradientAttribute* createNewTransparenceGradientAttribute(const SfxItemSet& rSet)
+ attribute::FillGradientAttribute createNewTransparenceGradientAttribute(const SfxItemSet& rSet)
{
- attribute::FillGradientAttribute* pRetval = 0L;
const SfxPoolItem* pGradientItem;
- if(SFX_ITEM_SET == rSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE, TRUE, &pGradientItem) && ((XFillFloatTransparenceItem*)pGradientItem)->IsEnabled())
+ if(SFX_ITEM_SET == rSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE, TRUE, &pGradientItem)
+ && ((XFillFloatTransparenceItem*)pGradientItem)->IsEnabled())
{
// test if float transparence is completely transparent
const XGradient& rGradient = ((XFillFloatTransparenceItem*)pGradientItem)->GetGradientValue();
@@ -571,7 +578,7 @@ namespace drawinglayer
const double fStartLum(nStartLuminance / 255.0);
const double fEndLum(nEndLuminance / 255.0);
- pRetval = new attribute::FillGradientAttribute(
+ return attribute::FillGradientAttribute(
XGradientStyleToGradientStyle(rGradient.GetGradientStyle()),
(double)rGradient.GetBorder() * 0.01,
(double)rGradient.GetXOffset() * 0.01,
@@ -583,12 +590,11 @@ namespace drawinglayer
}
}
- return pRetval;
+ return attribute::FillGradientAttribute();
}
- attribute::SdrFillBitmapAttribute* createNewSdrFillBitmapAttribute(const SfxItemSet& rSet)
+ attribute::SdrFillBitmapAttribute createNewSdrFillBitmapAttribute(const SfxItemSet& rSet)
{
- attribute::SdrFillBitmapAttribute* pRetval(0L);
Bitmap aBitmap((((const XFillBitmapItem&)(rSet.Get(XATTR_FILLBITMAP))).GetBitmapValue()).GetBitmap());
// make sure it's not empty, use default instead
@@ -635,7 +641,7 @@ namespace drawinglayer
(double)((const SfxUInt16Item&) (rSet.Get(XATTR_FILLBMP_POSOFFSETX))).GetValue(),
(double)((const SfxUInt16Item&) (rSet.Get(XATTR_FILLBMP_POSOFFSETY))).GetValue());
- pRetval = new attribute::SdrFillBitmapAttribute(
+ return attribute::SdrFillBitmapAttribute(
aBitmap,
aSize,
aOffset,
@@ -644,252 +650,174 @@ namespace drawinglayer
((const SfxBoolItem&) (rSet.Get(XATTR_FILLBMP_TILE))).GetValue(),
((const SfxBoolItem&) (rSet.Get(XATTR_FILLBMP_STRETCH))).GetValue(),
((const SfxBoolItem&) (rSet.Get(XATTR_FILLBMP_SIZELOG))).GetValue());
-
- return pRetval;
}
- attribute::SdrShadowTextAttribute* createNewSdrShadowTextAttribute(const SfxItemSet& rSet, const SdrText& rText, bool bSuppressText)
+ attribute::SdrShadowTextAttribute createNewSdrShadowTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pText,
+ bool bSuppressText)
{
- attribute::SdrShadowTextAttribute* pRetval(0L);
- attribute::SdrShadowAttribute* pShadow(0L);
- attribute::SdrTextAttribute* pText(0L);
+ attribute::SdrTextAttribute aText;
// #i98072# added option to suppress text
// look for text first
- if(!bSuppressText)
+ if(!bSuppressText && pText)
{
- pText = createNewSdrTextAttribute(rSet, rText);
+ aText = createNewSdrTextAttribute(rSet, *pText);
}
// try shadow
- pShadow = createNewSdrShadowAttribute(rSet);
-
- if(pShadow && !pShadow->isVisible())
- {
- delete pShadow;
- pShadow = 0L;
- }
+ const attribute::SdrShadowAttribute aShadow(createNewSdrShadowAttribute(rSet));
- if(pText || pShadow)
- {
- pRetval = new attribute::SdrShadowTextAttribute(pShadow, pText);
- }
-
- return pRetval;
+ return attribute::SdrShadowTextAttribute(aShadow, aText);
}
- attribute::SdrLineShadowTextAttribute* createNewSdrLineShadowTextAttribute(const SfxItemSet& rSet, const SdrText& rText)
+ attribute::SdrLineShadowTextAttribute createNewSdrLineShadowTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pText)
{
- attribute::SdrLineShadowTextAttribute* pRetval(0L);
- attribute::SdrLineAttribute* pLine(0L);
- attribute::SdrLineStartEndAttribute* pLineStartEnd(0L);
- attribute::SdrShadowAttribute* pShadow(0L);
- attribute::SdrTextAttribute* pText(0L);
+ attribute::SdrLineAttribute aLine;
+ attribute::SdrLineStartEndAttribute aLineStartEnd;
+ attribute::SdrTextAttribute aText;
bool bFontworkHideContour(false);
// look for text first
- pText = createNewSdrTextAttribute(rSet, rText);
-
- // when object has text and text is fontwork and hide contour is set for fontwork, force
- // line and fill style to empty
- if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour())
+ if(pText)
{
- bFontworkHideContour = true;
+ aText = createNewSdrTextAttribute(rSet, *pText);
+
+ // when object has text and text is fontwork and hide contour is set for fontwork, force
+ // line and fill style to empty
+ if(!aText.isDefault()
+ && !aText.getSdrFormTextAttribute().isDefault()
+ && aText.isHideContour())
+ {
+ bFontworkHideContour = true;
+ }
}
// try line style
if(!bFontworkHideContour)
{
- pLine = createNewSdrLineAttribute(rSet);
+ aLine = createNewSdrLineAttribute(rSet);
- if(pLine && !pLine->isVisible())
- {
- delete pLine;
- pLine = 0L;
- }
-
- if(pLine)
+ if(!aLine.isDefault())
{
// try LineStartEnd
- pLineStartEnd = createNewSdrLineStartEndAttribute(rSet, pLine->getWidth());
-
- if(pLineStartEnd && !pLineStartEnd->isVisible())
- {
- delete pLineStartEnd;
- pLineStartEnd = 0L;
- }
+ aLineStartEnd = createNewSdrLineStartEndAttribute(rSet, aLine.getWidth());
}
}
- // try shadow
- if(pLine || pText)
+ if(!aLine.isDefault() || !aText.isDefault())
{
- pShadow = createNewSdrShadowAttribute(rSet);
+ // try shadow
+ const attribute::SdrShadowAttribute aShadow(createNewSdrShadowAttribute(rSet));
- if(pShadow && !pShadow->isVisible())
- {
- delete pShadow;
- pShadow = 0L;
- }
+ return attribute::SdrLineShadowTextAttribute(aLine, aLineStartEnd, aShadow, aText);
}
- if(pLine || pText)
- {
- pRetval = new attribute::SdrLineShadowTextAttribute(pLine, pLineStartEnd, pShadow, pText);
- }
-
- return pRetval;
+ return attribute::SdrLineShadowTextAttribute();
}
- attribute::SdrLineFillShadowTextAttribute* createNewSdrLineFillShadowTextAttribute(const SfxItemSet& rSet, const SdrText& rText)
+ attribute::SdrLineFillShadowTextAttribute createNewSdrLineFillShadowTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pText)
{
- attribute::SdrLineFillShadowTextAttribute* pRetval(0L);
- attribute::SdrLineAttribute* pLine(0L);
- attribute::SdrFillAttribute* pFill(0L);
- attribute::SdrLineStartEndAttribute* pLineStartEnd(0L);
- attribute::SdrShadowAttribute* pShadow(0L);
- attribute::FillGradientAttribute* pFillFloatTransGradient(0L);
- attribute::SdrTextAttribute* pText(0L);
+ attribute::SdrLineAttribute aLine;
+ attribute::SdrFillAttribute aFill;
+ attribute::SdrLineStartEndAttribute aLineStartEnd;
+ attribute::SdrShadowAttribute aShadow;
+ attribute::FillGradientAttribute aFillFloatTransGradient;
+ attribute::SdrTextAttribute aText;
bool bFontworkHideContour(false);
// look for text first
- pText = createNewSdrTextAttribute(rSet, rText);
-
- // when object has text and text is fontwork and hide contour is set for fontwork, force
- // line and fill style to empty
- if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour())
+ if(pText)
{
- bFontworkHideContour = true;
- }
-
- // try line style
- if(!bFontworkHideContour)
- {
- pLine = createNewSdrLineAttribute(rSet);
+ aText = createNewSdrTextAttribute(rSet, *pText);
- if(pLine && !pLine->isVisible())
+ // when object has text and text is fontwork and hide contour is set for fontwork, force
+ // line and fill style to empty
+ if(!aText.getSdrFormTextAttribute().isDefault() && aText.isHideContour())
{
- delete pLine;
- pLine = 0L;
- }
-
- if(pLine)
- {
- // try LineStartEnd
- pLineStartEnd = createNewSdrLineStartEndAttribute(rSet, pLine->getWidth());
-
- if(pLineStartEnd && !pLineStartEnd->isVisible())
- {
- delete pLineStartEnd;
- pLineStartEnd = 0L;
- }
+ bFontworkHideContour = true;
}
}
- // try fill style
if(!bFontworkHideContour)
{
- pFill = createNewSdrFillAttribute(rSet);
+ // try line style
+ aLine = createNewSdrLineAttribute(rSet);
- if(pFill && !pFill->isVisible())
+ if(!aLine.isDefault())
{
- delete pFill;
- pFill = 0L;
+ // try LineStartEnd
+ aLineStartEnd = createNewSdrLineStartEndAttribute(rSet, aLine.getWidth());
}
- if(pFill)
+ // try fill style
+ aFill = createNewSdrFillAttribute(rSet);
+
+ if(!aFill.isDefault())
{
// try fillfloattransparence
- pFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
+ aFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
}
}
- // try shadow
- if(pLine || pFill || pText)
+ if(!aLine.isDefault() || !aFill.isDefault() || !aText.isDefault())
{
- pShadow = createNewSdrShadowAttribute(rSet);
-
- if(pShadow && !pShadow->isVisible())
- {
- delete pShadow;
- pShadow = 0L;
- }
- }
+ // try shadow
+ aShadow = createNewSdrShadowAttribute(rSet);
- if(pLine || pFill || pText)
- {
- pRetval = new attribute::SdrLineFillShadowTextAttribute(pLine, pFill, pLineStartEnd, pShadow, pFillFloatTransGradient, pText);
+ return attribute::SdrLineFillShadowTextAttribute(
+ aLine, aFill, aLineStartEnd, aShadow, aFillFloatTransGradient, aText);
}
- return pRetval;
+ return attribute::SdrLineFillShadowTextAttribute();
}
- attribute::SdrLineFillShadowAttribute* createNewSdrLineFillShadowAttribute(const SfxItemSet& rSet, bool bSuppressFill)
+ attribute::SdrLineFillShadowAttribute3D createNewSdrLineFillShadowAttribute(const SfxItemSet& rSet, bool bSuppressFill)
{
- attribute::SdrLineFillShadowAttribute* pRetval(0L);
- attribute::SdrLineAttribute* pLine(0L);
- attribute::SdrFillAttribute* pFill(0L);
- attribute::SdrLineStartEndAttribute* pLineStartEnd(0L);
- attribute::SdrShadowAttribute* pShadow(0L);
- attribute::FillGradientAttribute* pFillFloatTransGradient(0L);
+ attribute::SdrFillAttribute aFill;
+ attribute::SdrLineStartEndAttribute aLineStartEnd;
+ attribute::SdrShadowAttribute aShadow;
+ attribute::FillGradientAttribute aFillFloatTransGradient;
// try line style
- pLine = createNewSdrLineAttribute(rSet);
+ const attribute::SdrLineAttribute aLine(createNewSdrLineAttribute(rSet));
- if(pLine && !pLine->isVisible())
- {
- delete pLine;
- pLine = 0L;
- }
-
- if(pLine)
+ if(!aLine.isDefault())
{
// try LineStartEnd
- pLineStartEnd = createNewSdrLineStartEndAttribute(rSet, pLine->getWidth());
-
- if(pLineStartEnd && !pLineStartEnd->isVisible())
- {
- delete pLineStartEnd;
- pLineStartEnd = 0L;
- }
+ aLineStartEnd = createNewSdrLineStartEndAttribute(rSet, aLine.getWidth());
}
// try fill style
- pFill = bSuppressFill ? 0 : createNewSdrFillAttribute(rSet);
-
- if(pFill && !pFill->isVisible())
+ if(!bSuppressFill)
{
- delete pFill;
- pFill = 0L;
- }
-
- if(pFill)
- {
- // try fillfloattransparence
- pFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
- }
+ aFill = createNewSdrFillAttribute(rSet);
- // try shadow
- if(pLine || pFill)
- {
- pShadow = createNewSdrShadowAttribute(rSet);
-
- if(pShadow && !pShadow->isVisible())
+ if(!aFill.isDefault())
{
- delete pShadow;
- pShadow = 0L;
+ // try fillfloattransparence
+ aFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
}
}
- if(pLine || pFill)
+ if(!aLine.isDefault() || !aFill.isDefault())
{
- pRetval = new attribute::SdrLineFillShadowAttribute(pLine, pFill, pLineStartEnd, pShadow, pFillFloatTransGradient);
+ // try shadow
+ aShadow = createNewSdrShadowAttribute(rSet);
+
+ return attribute::SdrLineFillShadowAttribute3D(
+ aLine, aFill, aLineStartEnd, aShadow, aFillFloatTransGradient);
}
- return pRetval;
+ return attribute::SdrLineFillShadowAttribute3D();
}
- attribute::SdrSceneAttribute* createNewSdrSceneAttribute(const SfxItemSet& rSet)
+ attribute::SdrSceneAttribute createNewSdrSceneAttribute(const SfxItemSet& rSet)
{
// get perspective
::com::sun::star::drawing::ProjectionMode aProjectionMode(::com::sun::star::drawing::ProjectionMode_PARALLEL);
@@ -926,10 +854,10 @@ namespace drawinglayer
// get two sided lighting
const bool bTwoSidedLighting(((const Svx3DTwoSidedLightingItem&)rSet.Get(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING)).GetValue());
- return new attribute::SdrSceneAttribute(fDistance, fShadowSlant, aProjectionMode, aShadeMode, bTwoSidedLighting);
+ return attribute::SdrSceneAttribute(fDistance, fShadowSlant, aProjectionMode, aShadeMode, bTwoSidedLighting);
}
- attribute::SdrLightingAttribute* createNewSdrLightingAttribute(const SfxItemSet& rSet)
+ attribute::SdrLightingAttribute createNewSdrLightingAttribute(const SfxItemSet& rSet)
{
// extract lights from given SfxItemSet (from scene)
::std::vector< attribute::Sdr3DLightAttribute > aLightVector;
@@ -994,7 +922,7 @@ namespace drawinglayer
const Color aAmbientValue(((const Svx3DAmbientcolorItem&)rSet.Get(SDRATTR_3DSCENE_AMBIENTCOLOR)).GetValue());
const basegfx::BColor aAmbientLight(aAmbientValue.getBColor());
- return new attribute::SdrLightingAttribute(aAmbientLight, aLightVector);
+ return attribute::SdrLightingAttribute(aAmbientLight, aLightVector);
}
void calculateRelativeCornerRadius(sal_Int32 nRadius, const basegfx::B2DRange& rObjectRange, double& rfCornerRadiusX, double& rfCornerRadiusY)
@@ -1051,57 +979,50 @@ namespace drawinglayer
}
// #i101508# Support handing over given text-to-border distances
- attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute(
+ attribute::SdrFillTextAttribute createNewSdrFillTextAttribute(
const SfxItemSet& rSet,
- const SdrText* pSdrText,
+ const SdrText* pText,
const sal_Int32* pLeft,
const sal_Int32* pUpper,
const sal_Int32* pRight,
const sal_Int32* pLower)
{
- attribute::SdrFillTextAttribute* pRetval(0L);
- attribute::SdrFillAttribute* pFill(0L);
- attribute::FillGradientAttribute* pFillFloatTransGradient(0L);
- attribute::SdrTextAttribute* pText(0L);
+ attribute::SdrFillAttribute aFill;
+ attribute::FillGradientAttribute aFillFloatTransGradient;
+ attribute::SdrTextAttribute aText;
bool bFontworkHideContour(false);
// look for text first
- if(pSdrText)
+ if(pText)
{
- pText = createNewSdrTextAttribute(rSet, *pSdrText, pLeft, pUpper, pRight, pLower);
- }
+ aText = createNewSdrTextAttribute(rSet, *pText, pLeft, pUpper, pRight, pLower);
- // when object has text and text is fontwork and hide contour is set for fontwork, force
- // fill style to empty
- if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour())
- {
- bFontworkHideContour = true;
+ // when object has text and text is fontwork and hide contour is set for fontwork, force
+ // fill style to empty
+ if(!aText.getSdrFormTextAttribute().isDefault() && aText.isHideContour())
+ {
+ bFontworkHideContour = true;
+ }
}
- // try fill style
if(!bFontworkHideContour)
{
- pFill = createNewSdrFillAttribute(rSet);
-
- if(pFill && !pFill->isVisible())
- {
- delete pFill;
- pFill = 0L;
- }
+ // try fill style
+ aFill = createNewSdrFillAttribute(rSet);
- if(pFill)
+ if(!aFill.isDefault())
{
// try fillfloattransparence
- pFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
+ aFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
}
}
- if(pFill || pText)
+ if(!aFill.isDefault() || !aText.isDefault())
{
- pRetval = new attribute::SdrFillTextAttribute(pFill, pFillFloatTransGradient, pText);
+ return attribute::SdrFillTextAttribute(aFill, aFillFloatTransGradient, aText);
}
- return pRetval;
+ return attribute::SdrFillTextAttribute();
}
} // end of namespace primitive2d
diff --git a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
index cc71488fb6..517c1318ee 100644
--- a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
@@ -35,7 +35,7 @@
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -50,7 +50,6 @@ namespace drawinglayer
Primitive2DSequence SdrCaptionPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
- Primitive2DSequence aHitTestContent;
// create unit outline polygon
const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(
@@ -59,68 +58,66 @@ namespace drawinglayer
getCornerRadiusY()));
// add fill
- if(getSdrLFSTAttribute().getFill())
+ if(getSdrLFSTAttribute().getFill().isDefault())
{
+ // create invisible fill for HitTest
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- createPolyPolygonFillPrimitive(
- basegfx::B2DPolyPolygon(aUnitOutline),
- getTransform(),
- *getSdrLFSTAttribute().getFill(),
- getSdrLFSTAttribute().getFillFloatTransGradient()));
+ createHiddenGeometryPrimitives2D(
+ true,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
else
{
- // if no fill, create one for HitTest and BoundRect fallback
- appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
createPolyPolygonFillPrimitive(
basegfx::B2DPolyPolygon(aUnitOutline),
getTransform(),
- attribute::SdrFillAttribute(0.0, basegfx::BColor(0.0, 0.0, 0.0)),
+ getSdrLFSTAttribute().getFill(),
getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(getSdrLFSTAttribute().getLine().isDefault())
{
+ // create invisible line for HitTest/BoundRect
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- createPolygonLinePrimitive(
- aUnitOutline,
- getTransform(),
- *getSdrLFSTAttribute().getLine()));
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- createPolygonLinePrimitive(
- getTail(),
- getTransform(),
- *getSdrLFSTAttribute().getLine(),
- getSdrLFSTAttribute().getLineStartEnd()));
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(getTail()),
+ getTransform()));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect. It
- // is sufficient to use the tail; the body is already ensured with fill creation
- appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
createPolygonLinePrimitive(
- getTail(),
+ aUnitOutline,
getTransform(),
- attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0))));
- }
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
- // add HitTest and BoundRect helper geometry (if exists)
- if(aHitTestContent.hasElements())
- {
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- Primitive2DReference(new HitTestPrimitive2D(aHitTestContent)));
+ createPolygonLinePrimitive(
+ getTail(),
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ getSdrLFSTAttribute().getLineStartEnd()));
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
createTextPrimitive(
basegfx::B2DPolyPolygon(aUnitOutline),
getTransform(),
- *getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getText(),
getSdrLFSTAttribute().getLine(),
false,
false,
@@ -128,9 +125,9 @@ namespace drawinglayer
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(aRetval, getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
index f08fd75ab0..b1afda1671 100644
--- a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
@@ -35,7 +35,8 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -51,34 +52,45 @@ namespace drawinglayer
{
Primitive2DSequence aRetval;
- // prepare unit transform
- ::basegfx::B2DHomMatrix aEmptyMatrix;
-
// add line
- if(getSdrLSTAttribute().getLine())
+ if(getSdrLSTAttribute().getLine().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(getUnitPolygon(), aEmptyMatrix, *getSdrLSTAttribute().getLine(), getSdrLSTAttribute().getLineStartEnd()));
+ // create invisible line for HitTest/BoundRect
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(getUnitPolygon())));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(getUnitPolygon(), aEmptyMatrix, aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ getUnitPolygon(),
+ basegfx::B2DHomMatrix(),
+ getSdrLSTAttribute().getLine(),
+ getSdrLSTAttribute().getLineStartEnd()));
}
// add text
- if(getSdrLSTAttribute().getText())
+ if(!getSdrLSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(getUnitPolygon()), aEmptyMatrix, *getSdrLSTAttribute().getText(), getSdrLSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(getUnitPolygon()),
+ basegfx::B2DHomMatrix(),
+ getSdrLSTAttribute().getText(),
+ getSdrLSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLSTAttribute().getShadow())
+ if(!getSdrLSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
index 61b60abc52..9d4df7fc5e 100644
--- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
@@ -36,6 +36,7 @@
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -52,21 +53,23 @@ namespace drawinglayer
Primitive2DSequence aRetval(getSubPrimitives());
// add text
- if(getSdrSTAttribute().getText())
+ if(!getSdrSTAttribute().getText().isDefault())
{
- const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(
- basegfx::B2DPolyPolygon(aUnitOutline),
- getTextBox(),
- *getSdrSTAttribute().getText(),
- 0,
- false,
- getWordWrap(),
- isForceTextClipToTextRange()));
+ const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createUnitPolygon());
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTextBox(),
+ getSdrSTAttribute().getText(),
+ attribute::SdrLineAttribute(),
+ false,
+ getWordWrap(),
+ isForceTextClipToTextRange()));
}
// add shadow
- if(aRetval.hasElements() && getSdrSTAttribute().getShadow())
+ if(aRetval.hasElements() && !getSdrSTAttribute().getShadow().isDefault())
{
// #i105323# add generic shadow only for 2D shapes. For
// 3D shapes shadow will be set at the individual created
@@ -80,7 +83,7 @@ namespace drawinglayer
// shadow will be correct (using ColorModifierStack), but expensive.
if(!get3DShape())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(aRetval, getSdrSTAttribute().getShadow());
}
}
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 67fb97e6b7..265ddb32ec 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -31,12 +31,10 @@
#include "precompiled_svx.hxx"
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx>
#include <drawinglayer/attribute/strokeattribute.hxx>
@@ -55,6 +53,10 @@
#include <basegfx/tools/canvastools.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <drawinglayer/primitive2d/texthierarchyprimitive2d.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -70,25 +72,25 @@ namespace drawinglayer
const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrFillAttribute& rFill,
- const attribute::FillGradientAttribute* pFillGradient)
+ const attribute::FillGradientAttribute& rFillGradient)
{
// prepare fully scaled polygon
basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
aScaledPolyPolygon.transform(rObjectTransform);
BasePrimitive2D* pNewFillPrimitive = 0;
- if(rFill.isGradient())
+ if(!rFill.getGradient().isDefault())
{
- pNewFillPrimitive = new PolyPolygonGradientPrimitive2D(aScaledPolyPolygon, *rFill.getGradient());
+ pNewFillPrimitive = new PolyPolygonGradientPrimitive2D(aScaledPolyPolygon, rFill.getGradient());
}
- else if(rFill.isHatch())
+ else if(!rFill.getHatch().isDefault())
{
- pNewFillPrimitive = new PolyPolygonHatchPrimitive2D(aScaledPolyPolygon, rFill.getColor(), *rFill.getHatch());
+ pNewFillPrimitive = new PolyPolygonHatchPrimitive2D(aScaledPolyPolygon, rFill.getColor(), rFill.getHatch());
}
- else if(rFill.isBitmap())
+ else if(!rFill.getBitmap().isDefault())
{
const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon));
- pNewFillPrimitive = new PolyPolygonBitmapPrimitive2D(aScaledPolyPolygon, rFill.getBitmap()->getFillBitmapAttribute(aRange));
+ pNewFillPrimitive = new PolyPolygonBitmapPrimitive2D(aScaledPolyPolygon, rFill.getBitmap().getFillBitmapAttribute(aRange));
}
else
{
@@ -100,9 +102,9 @@ namespace drawinglayer
// create simpleTransparencePrimitive, add created fill primitive
const Primitive2DReference xRefA(pNewFillPrimitive);
const Primitive2DSequence aContent(&xRefA, 1L);
- return Primitive2DReference(new UnifiedAlphaPrimitive2D(aContent, rFill.getTransparence()));
+ return Primitive2DReference(new UnifiedTransparencePrimitive2D(aContent, rFill.getTransparence()));
}
- else if(pFillGradient)
+ else if(!rFillGradient.isDefault())
{
// create sequence with created fill primitive
const Primitive2DReference xRefA(pNewFillPrimitive);
@@ -111,11 +113,11 @@ namespace drawinglayer
// create FillGradientPrimitive2D for transparence and add to new sequence
// fillGradientPrimitive is enough here (compared to PolyPolygonGradientPrimitive2D) since float transparence will be masked anyways
const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon));
- const Primitive2DReference xRefB(new FillGradientPrimitive2D(aRange, *pFillGradient));
+ const Primitive2DReference xRefB(new FillGradientPrimitive2D(aRange, rFillGradient));
const Primitive2DSequence aAlpha(&xRefB, 1L);
- // create AlphaPrimitive2D using alpha and content
- return Primitive2DReference(new AlphaPrimitive2D(aContent, aAlpha));
+ // create TransparencePrimitive2D using alpha and content
+ return Primitive2DReference(new TransparencePrimitive2D(aContent, aAlpha));
}
else
{
@@ -128,7 +130,7 @@ namespace drawinglayer
const basegfx::B2DPolygon& rUnitPolygon,
const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrLineAttribute& rLine,
- const attribute::SdrLineStartEndAttribute* pStroke)
+ const attribute::SdrLineStartEndAttribute& rStroke)
{
// prepare fully scaled polygon
basegfx::B2DPolygon aScaledPolygon(rUnitPolygon);
@@ -139,10 +141,10 @@ namespace drawinglayer
const attribute::StrokeAttribute aStrokeAttribute(rLine.getDotDashArray(), rLine.getFullDotDashLen());
BasePrimitive2D* pNewLinePrimitive = 0L;
- if(!rUnitPolygon.isClosed() && pStroke)
+ if(!rUnitPolygon.isClosed() && !rStroke.isDefault())
{
- attribute::LineStartEndAttribute aStart(pStroke->getStartWidth(), pStroke->getStartPolyPolygon(), pStroke->isStartCentered());
- attribute::LineStartEndAttribute aEnd(pStroke->getEndWidth(), pStroke->getEndPolyPolygon(), pStroke->isEndCentered());
+ attribute::LineStartEndAttribute aStart(rStroke.getStartWidth(), rStroke.getStartPolyPolygon(), rStroke.isStartCentered());
+ attribute::LineStartEndAttribute aEnd(rStroke.getEndWidth(), rStroke.getEndPolyPolygon(), rStroke.isEndCentered());
// create data
pNewLinePrimitive = new PolygonStrokeArrowPrimitive2D(aScaledPolygon, aLineAttribute, aStrokeAttribute, aStart, aEnd);
@@ -158,7 +160,7 @@ namespace drawinglayer
// create simpleTransparencePrimitive, add created fill primitive
const Primitive2DReference xRefA(pNewLinePrimitive);
const Primitive2DSequence aContent(&xRefA, 1L);
- return Primitive2DReference(new UnifiedAlphaPrimitive2D(aContent, rLine.getTransparence()));
+ return Primitive2DReference(new UnifiedTransparencePrimitive2D(aContent, rLine.getTransparence()));
}
else
{
@@ -171,7 +173,7 @@ namespace drawinglayer
const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrTextAttribute& rText,
- const attribute::SdrLineAttribute* pStroke,
+ const attribute::SdrLineAttribute& rStroke,
bool bCellText,
bool bWordWrap,
bool bClipOnBounds)
@@ -182,7 +184,7 @@ namespace drawinglayer
if(rText.isContour())
{
// contour text
- if(pStroke && 0.0 != pStroke->getWidth())
+ if(!rStroke.isDefault() && 0.0 != rStroke.getWidth())
{
// take line width into account and shrink contour polygon accordingly
// decompose to get scale
@@ -197,7 +199,7 @@ namespace drawinglayer
fabs(aScale.getX()), fabs(aScale.getY())));
// grow the polygon. To shrink, use negative value (half width)
- aScaledUnitPolyPolygon = basegfx::tools::growInNormalDirection(aScaledUnitPolyPolygon, -(pStroke->getWidth() * 0.5));
+ aScaledUnitPolyPolygon = basegfx::tools::growInNormalDirection(aScaledUnitPolyPolygon, -(rStroke.getWidth() * 0.5));
// scale back to unit polygon
aScaledUnitPolyPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(
@@ -221,7 +223,7 @@ namespace drawinglayer
rObjectTransform);
}
}
- else if(rText.getSdrFormTextAttribute())
+ else if(!rText.getSdrFormTextAttribute().isDefault())
{
// text on path, use scaled polygon
basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
@@ -230,7 +232,7 @@ namespace drawinglayer
&rText.getSdrText(),
rText.getOutlinerParaObject(),
aScaledPolyPolygon,
- *rText.getSdrFormTextAttribute());
+ rText.getSdrFormTextAttribute());
}
else
{
@@ -327,7 +329,7 @@ namespace drawinglayer
if(rText.isScroll())
{
// suppress scroll when FontWork
- if(!rText.getSdrFormTextAttribute())
+ if(rText.getSdrFormTextAttribute().isDefault())
{
// get scroll direction
const SdrTextAniDirection eDirection(rText.getSdrText().GetObject().GetTextAniDirection());
@@ -468,7 +470,7 @@ namespace drawinglayer
const Primitive2DSequence aTempContent(&aRetval[0], 1);
aRetval[0] = Primitive2DReference(
- new UnifiedAlphaPrimitive2D(
+ new UnifiedTransparencePrimitive2D(
aTempContent,
rShadow.getTransparence()));
}
diff --git a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
index 016ff9fa8f..80056260f1 100644
--- a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
@@ -36,10 +36,9 @@
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
#include <basegfx/color/bcolor.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -59,52 +58,73 @@ namespace drawinglayer
// Do use createPolygonFromUnitCircle, but let create from first quadrant to mimic old geometry creation.
// This is needed to have the same look when stroke is used since the polygon start point defines the
// stroke start, too.
- ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromUnitCircle(1));
+ basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromUnitCircle(1));
// scale and move UnitEllipse to UnitObject (-1,-1 1,1) -> (0,0 1,1)
- const basegfx::B2DHomMatrix aUnitCorrectionMatrix(basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5));
+ const basegfx::B2DHomMatrix aUnitCorrectionMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5));
// apply to the geometry
aUnitOutline.transform(aUnitCorrectionMatrix);
// add fill
- if(getSdrLFSTAttribute().getFill())
+ if(!getSdrLFSTAttribute().getFill().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(getSdrLFSTAttribute().getLine().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ // create invisible line for HitTest/BoundRect
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aUnitOutline,
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
}
SdrEllipsePrimitive2D::SdrEllipsePrimitive2D(
- const ::basegfx::B2DHomMatrix& rTransform,
+ const basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute)
: BufferedDecompositionPrimitive2D(),
maTransform(rTransform),
@@ -142,7 +162,7 @@ namespace drawinglayer
Primitive2DSequence aRetval;
// create unit outline polygon
- ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromUnitEllipseSegment(mfStartAngle, mfEndAngle));
+ basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromUnitEllipseSegment(mfStartAngle, mfEndAngle));
if(mbCloseSegment)
{
@@ -150,57 +170,77 @@ namespace drawinglayer
{
// for compatibility, insert the center point at polygon start to get the same
// line stroking pattern as the old painting mechanisms.
- aUnitOutline.insert(0L, ::basegfx::B2DPoint(0.0, 0.0));
+ aUnitOutline.insert(0L, basegfx::B2DPoint(0.0, 0.0));
}
aUnitOutline.setClosed(true);
}
// move and scale UnitEllipse to UnitObject (-1,-1 1,1) -> (0,0 1,1)
- basegfx::B2DHomMatrix aUnitCorrectionMatrix(basegfx::tools::createTranslateB2DHomMatrix(1.0, 1.0));
- aUnitCorrectionMatrix.scale(0.5, 0.5);
+ const basegfx::B2DHomMatrix aUnitCorrectionMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5));
// apply to the geometry
aUnitOutline.transform(aUnitCorrectionMatrix);
// add fill
- if(getSdrLFSTAttribute().getFill() && aUnitOutline.isClosed())
+ if(!getSdrLFSTAttribute().getFill().isDefault() && aUnitOutline.isClosed())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(getSdrLFSTAttribute().getLine().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine(), getSdrLFSTAttribute().getLineStartEnd()));
+ // create invisible line for HitTest/BoundRect
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aUnitOutline,
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ getSdrLFSTAttribute().getLineStartEnd()));
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
}
SdrEllipseSegmentPrimitive2D::SdrEllipseSegmentPrimitive2D(
- const ::basegfx::B2DHomMatrix& rTransform,
+ const basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
double fStartAngle,
double fEndAngle,
diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
index 70b973e521..8b1ce3a911 100644
--- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
@@ -36,7 +36,8 @@
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -49,21 +50,25 @@ namespace drawinglayer
Primitive2DSequence aRetval;
// create unit outline polygon
- basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aUnitOutline(basegfx::tools::createUnitPolygon());
// add fill, but only when graphic ist transparent
- if(getSdrLFSTAttribute().getFill() && isTransparent())
+ if(!getSdrLFSTAttribute().getFill().isDefault() && isTransparent())
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- createPolyPolygonFillPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(!getSdrLFSTAttribute().getLine().isDefault())
{
// if line width is given, polygon needs to be grown by half of it to make the
// outline to be outside of the bitmap
- if(0.0 != getSdrLFSTAttribute().getLine()->getWidth())
+ if(0.0 != getSdrLFSTAttribute().getLine().getWidth())
{
// decompose to get scale
basegfx::B2DVector aScale, aTranslate;
@@ -71,46 +76,61 @@ namespace drawinglayer
getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
// create expanded range (add relative half line width to unit rectangle)
- double fHalfLineWidth(getSdrLFSTAttribute().getLine()->getWidth() * 0.5);
+ double fHalfLineWidth(getSdrLFSTAttribute().getLine().getWidth() * 0.5);
double fScaleX(0.0 != aScale.getX() ? fHalfLineWidth / fabs(aScale.getX()) : 1.0);
double fScaleY(0.0 != aScale.getY() ? fHalfLineWidth / fabs(aScale.getY()) : 1.0);
const basegfx::B2DRange aExpandedRange(-fScaleX, -fScaleY, 1.0 + fScaleX, 1.0 + fScaleY);
basegfx::B2DPolygon aExpandedUnitOutline(basegfx::tools::createPolygonFromRect(aExpandedRange));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aExpandedUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aExpandedUnitOutline,
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
else
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aUnitOutline, getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
}
- else
- {
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
- }
// add graphic content
if(255L != getGraphicAttr().GetTransparency())
{
- Primitive2DReference xGraphicContentPrimitive(new GraphicPrimitive2D(getTransform(), getGraphicObject(), getGraphicAttr()));
+ const Primitive2DReference xGraphicContentPrimitive(
+ new GraphicPrimitive2D(
+ getTransform(),
+ getGraphicObject(),
+ getGraphicAttr()));
+
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, xGraphicContentPrimitive);
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
index 7f59e8be96..4f65287b55 100644
--- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
@@ -39,8 +39,8 @@
#include <basegfx/tools/canvastools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -60,36 +60,44 @@ namespace drawinglayer
bool bLeftActive,
bool bRightActive) const
{
- const attribute::SdrLineStartEndAttribute* pLineStartEnd = getSdrLSTAttribute().getLineStartEnd();
+ const attribute::SdrLineStartEndAttribute& rLineStartEnd = getSdrLSTAttribute().getLineStartEnd();
basegfx::B2DPolygon aPolygon;
aPolygon.append(rStart);
aPolygon.append(rEnd);
- if(!pLineStartEnd || (!bLeftActive && !bRightActive))
+ if(rLineStartEnd.isDefault() || (!bLeftActive && !bRightActive))
{
- return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, 0);
+ return createPolygonLinePrimitive(
+ aPolygon,
+ rObjectMatrix,
+ rLineAttribute,
+ attribute::SdrLineStartEndAttribute());
}
if(bLeftActive && bRightActive)
{
- return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, pLineStartEnd);
+ return createPolygonLinePrimitive(
+ aPolygon,
+ rObjectMatrix,
+ rLineAttribute,
+ rLineStartEnd);
}
const basegfx::B2DPolyPolygon aEmpty;
const attribute::SdrLineStartEndAttribute aLineStartEnd(
- bLeftActive ? pLineStartEnd->getStartPolyPolygon() : aEmpty, bRightActive ? pLineStartEnd->getEndPolyPolygon() : aEmpty,
- bLeftActive ? pLineStartEnd->getStartWidth() : 0.0, bRightActive ? pLineStartEnd->getEndWidth() : 0.0,
- bLeftActive ? pLineStartEnd->isStartActive() : false, bRightActive ? pLineStartEnd->isEndActive() : false,
- bLeftActive ? pLineStartEnd->isStartCentered() : false, bRightActive? pLineStartEnd->isEndCentered() : false);
+ bLeftActive ? rLineStartEnd.getStartPolyPolygon() : aEmpty, bRightActive ? rLineStartEnd.getEndPolyPolygon() : aEmpty,
+ bLeftActive ? rLineStartEnd.getStartWidth() : 0.0, bRightActive ? rLineStartEnd.getEndWidth() : 0.0,
+ bLeftActive ? rLineStartEnd.isStartActive() : false, bRightActive ? rLineStartEnd.isEndActive() : false,
+ bLeftActive ? rLineStartEnd.isStartCentered() : false, bRightActive? rLineStartEnd.isEndCentered() : false);
- return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, &aLineStartEnd);
+ return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, aLineStartEnd);
}
Primitive2DSequence SdrMeasurePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
- SdrBlockTextPrimitive2D* pBlockText = 0L;
+ SdrBlockTextPrimitive2D* pBlockText = 0;
basegfx::B2DRange aTextRange;
double fTextX((getStart().getX() + getEnd().getX()) * 0.5);
double fTextY((getStart().getX() + getEnd().getX()) * 0.5);
@@ -97,11 +105,13 @@ namespace drawinglayer
const double fDistance(aLine.getLength());
const double fAngle(atan2(aLine.getY(), aLine.getX()));
bool bAutoUpsideDown(false);
- const attribute::SdrTextAttribute* pTextAttribute = getSdrLSTAttribute().getText();
+ const attribute::SdrTextAttribute rTextAttribute = getSdrLSTAttribute().getText();
const basegfx::B2DHomMatrix aObjectMatrix(
basegfx::tools::createShearXRotateTranslateB2DHomMatrix(0.0, fAngle, getStart()));
- if(pTextAttribute)
+ // preapare text, but do not add yet; it needs to be aligned to
+ // the line geometry
+ if(!rTextAttribute.isDefault())
{
basegfx::B2DHomMatrix aTextMatrix;
double fTestAngle(fAngle);
@@ -127,58 +137,52 @@ namespace drawinglayer
// create primitive and get text range
pBlockText = new SdrBlockTextPrimitive2D(
- &pTextAttribute->getSdrText(),
- pTextAttribute->getOutlinerParaObject(),
+ &rTextAttribute.getSdrText(),
+ rTextAttribute.getOutlinerParaObject(),
aTextMatrix,
SDRTEXTHORZADJUST_CENTER,
SDRTEXTVERTADJUST_CENTER,
- pTextAttribute->isScroll(),
+ rTextAttribute.isScroll(),
false,
false,
false,
false);
+
aTextRange = pBlockText->getB2DRange(aViewInformation);
}
// prepare line attribute and result
- const attribute::SdrLineAttribute* pLineAttribute(getSdrLSTAttribute().getLine());
-
- if(!pLineAttribute)
- {
- // if initially no line is defined, create one for HitTest and BoundRect
- pLineAttribute = new attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0));
- }
-
{
+ const attribute::SdrLineAttribute rLineAttribute(getSdrLSTAttribute().getLine());
bool bArrowsOutside(false);
bool bMainLineSplitted(false);
- const attribute::SdrLineStartEndAttribute* pLineStartEnd = getSdrLSTAttribute().getLineStartEnd();
+ const attribute::SdrLineStartEndAttribute& rLineStartEnd = getSdrLSTAttribute().getLineStartEnd();
double fStartArrowW(0.0);
double fStartArrowH(0.0);
double fEndArrowW(0.0);
double fEndArrowH(0.0);
- if(pLineStartEnd)
+ if(!rLineStartEnd.isDefault())
{
- if(pLineStartEnd->isStartActive())
+ if(rLineStartEnd.isStartActive())
{
- const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(pLineStartEnd->getStartPolyPolygon()));
- fStartArrowW = pLineStartEnd->getStartWidth();
+ const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(rLineStartEnd.getStartPolyPolygon()));
+ fStartArrowW = rLineStartEnd.getStartWidth();
fStartArrowH = aArrowRange.getHeight() * fStartArrowW / aArrowRange.getWidth();
- if(pLineStartEnd->isStartCentered())
+ if(rLineStartEnd.isStartCentered())
{
fStartArrowH *= 0.5;
}
}
- if(pLineStartEnd->isEndActive())
+ if(rLineStartEnd.isEndActive())
{
- const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(pLineStartEnd->getEndPolyPolygon()));
- fEndArrowW = pLineStartEnd->getEndWidth();
+ const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(rLineStartEnd.getEndPolyPolygon()));
+ fEndArrowW = rLineStartEnd.getEndWidth();
fEndArrowH = aArrowRange.getHeight() * fEndArrowW / aArrowRange.getWidth();
- if(pLineStartEnd->isEndCentered())
+ if(rLineStartEnd.isEndCentered())
{
fEndArrowH *= 0.5;
}
@@ -187,7 +191,7 @@ namespace drawinglayer
const double fSpaceNeededByArrows(fStartArrowH + fEndArrowH + ((fStartArrowW + fEndArrowW) * 0.5));
const double fArrowsOutsideLen((fStartArrowH + fEndArrowH + fStartArrowW + fEndArrowW) * 0.5);
- const double fHalfLineWidth(pLineAttribute->getWidth() * 0.5);
+ const double fHalfLineWidth(rLineAttribute.getWidth() * 0.5);
if(fSpaceNeededByArrows > fDistance)
{
@@ -279,12 +283,12 @@ namespace drawinglayer
const basegfx::B2DPoint aMainLeftLeft(aMainLeft.getX() - fLenLeft, aMainLeft.getY());
const basegfx::B2DPoint aMainRightRight(aMainRight.getX() + fLenRight, aMainRight.getY());
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainLeftLeft, aMainLeft, false, true));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainRight, aMainRightRight, true, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainLeftLeft, aMainLeft, false, true));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainRight, aMainRightRight, true, false));
if(!bMainLineSplitted || MEASURETEXTPOSITION_CENTERED != eHorizontal)
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(* pLineAttribute, aObjectMatrix, aMainLeft, aMainRight, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainLeft, aMainRight, false, false));
}
}
else
@@ -295,12 +299,12 @@ namespace drawinglayer
const basegfx::B2DPoint aMainInnerLeft(aMainLeft.getX() + fHalfLength, aMainLeft.getY());
const basegfx::B2DPoint aMainInnerRight(aMainRight.getX() - fHalfLength, aMainRight.getY());
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainLeft, aMainInnerLeft, true, false));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainInnerRight, aMainRight, false, true));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainLeft, aMainInnerLeft, true, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainInnerRight, aMainRight, false, true));
}
else
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainLeft, aMainRight, true, true));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainLeft, aMainRight, true, true));
}
}
@@ -313,13 +317,13 @@ namespace drawinglayer
const basegfx::B2DPoint aLeftUp(0.0, fTopEdge);
const basegfx::B2DPoint aLeftDown(0.0, fBottomLeft);
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aLeftDown, aLeftUp, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aLeftDown, aLeftUp, false, false));
// right help line
const basegfx::B2DPoint aRightUp(fDistance, fTopEdge);
const basegfx::B2DPoint aRightDown(fDistance, fBottomRight);
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aRightDown, aRightUp, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aRightDown, aRightUp, false, false));
// text horizontal position
if(MEASURETEXTPOSITION_NEGATIVE == eHorizontal)
@@ -333,9 +337,9 @@ namespace drawinglayer
fTextX -= (fArrowsOutsideLen - fStartArrowH);
}
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextX -= pTextAttribute->getTextRightDistance();
+ fTextX -= rTextAttribute.getTextRightDistance();
}
}
else if(MEASURETEXTPOSITION_POSITIVE == eHorizontal)
@@ -349,9 +353,9 @@ namespace drawinglayer
fTextX += (fArrowsOutsideLen - fEndArrowH);
}
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextX += pTextAttribute->getTextLeftDistance();
+ fTextX += rTextAttribute.getTextLeftDistance();
}
}
else // MEASURETEXTPOSITION_CENTERED
@@ -359,9 +363,9 @@ namespace drawinglayer
// centered
fTextX = aMainLeft.getX() + ((fDistance - aTextRange.getWidth()) * 0.5);
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextX += (pTextAttribute->getTextLeftDistance() - pTextAttribute->getTextRightDistance()) / 2L;
+ fTextX += (rTextAttribute.getTextLeftDistance() - rTextAttribute.getTextRightDistance()) / 2L;
}
}
@@ -372,9 +376,9 @@ namespace drawinglayer
const double fSmall(fArrowsOutsideLen * 0.10);
fTextY = aMainLeft.getY() - (aTextRange.getHeight() + fSmall + fHalfLineWidth);
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextY -= pTextAttribute->getTextLowerDistance();
+ fTextY -= rTextAttribute.getTextLowerDistance();
}
}
else if(MEASURETEXTPOSITION_POSITIVE == eVertical)
@@ -383,9 +387,9 @@ namespace drawinglayer
const double fSmall(fArrowsOutsideLen * 0.10);
fTextY = aMainLeft.getY() + (fSmall + fHalfLineWidth);
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextY += pTextAttribute->getTextUpperDistance();
+ fTextY += rTextAttribute.getTextUpperDistance();
}
}
else // MEASURETEXTPOSITION_CENTERED
@@ -393,21 +397,19 @@ namespace drawinglayer
// centered
fTextY = aMainLeft.getY() - (aTextRange.getHeight() * 0.5);
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextY += (pTextAttribute->getTextUpperDistance() - pTextAttribute->getTextLowerDistance()) / 2L;
+ fTextY += (rTextAttribute.getTextUpperDistance() - rTextAttribute.getTextLowerDistance()) / 2L;
}
}
}
- if(!getSdrLSTAttribute().getLine())
+ if(getSdrLSTAttribute().getLine().isDefault())
{
- // embed line geometry to invisible line group
- const Primitive2DReference xHiddenLines(new HitTestPrimitive2D(aRetval));
+ // embed line geometry to invisible (100% transparent) line group for HitTest
+ const Primitive2DReference xHiddenLines(new HiddenGeometryPrimitive2D(aRetval));
+
aRetval = Primitive2DSequence(&xHiddenLines, 1);
-
- // delete temporary LineAttribute again
- delete pLineAttribute;
}
if(pBlockText)
@@ -437,9 +439,11 @@ namespace drawinglayer
}
// add shadow
- if(getSdrLSTAttribute().getShadow())
+ if(!getSdrLSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
index 5a7d327cd9..ba38e006eb 100644
--- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
@@ -34,7 +34,8 @@
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -84,23 +85,29 @@ namespace drawinglayer
Primitive2DSequence aRetval;
// create unit outline polygon
- basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createUnitPolygon());
// add fill
- if(!bBehaveCompatibleToPaintVersion && getSdrLFSTAttribute().getFill())
+ if(!bBehaveCompatibleToPaintVersion
+ && !getSdrLFSTAttribute().getFill().isDefault())
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- createPolyPolygonFillPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
// #i97981# condition was inverse to purpose. When being compatible to paint version,
// border needs to be suppressed
- if(!bBehaveCompatibleToPaintVersion && getSdrLFSTAttribute().getLine())
+ if(!bBehaveCompatibleToPaintVersion
+ && !getSdrLFSTAttribute().getLine().isDefault())
{
// if line width is given, polygon needs to be grown by half of it to make the
// outline to be outside of the bitmap
- if(0.0 != getSdrLFSTAttribute().getLine()->getWidth())
+ if(0.0 != getSdrLFSTAttribute().getLine().getWidth())
{
// decompose to get scale
basegfx::B2DVector aScale, aTranslate;
@@ -108,27 +115,37 @@ namespace drawinglayer
getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
// create expanded range (add relative half line width to unit rectangle)
- double fHalfLineWidth(getSdrLFSTAttribute().getLine()->getWidth() * 0.5);
+ double fHalfLineWidth(getSdrLFSTAttribute().getLine().getWidth() * 0.5);
double fScaleX(0.0 != aScale.getX() ? fHalfLineWidth / fabs(aScale.getX()) : 1.0);
double fScaleY(0.0 != aScale.getY() ? fHalfLineWidth / fabs(aScale.getY()) : 1.0);
const basegfx::B2DRange aExpandedRange(-fScaleX, -fScaleY, 1.0 + fScaleX, 1.0 + fScaleY);
basegfx::B2DPolygon aExpandedUnitOutline(basegfx::tools::createPolygonFromRect(aExpandedRange));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aExpandedUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aExpandedUnitOutline,
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
else
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aUnitOutline,
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
}
else
{
// if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
// add graphic content
@@ -136,15 +153,26 @@ namespace drawinglayer
// add text, no need to supress to stay compatible since text was
// always supported by the old paints, too
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(!bBehaveCompatibleToPaintVersion && getSdrLFSTAttribute().getShadow())
+ if(!bBehaveCompatibleToPaintVersion
+ && !getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
index cb871d0949..907510127a 100644
--- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
@@ -138,7 +138,7 @@ namespace drawinglayer
if(aColor.bIsVisible)
{
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aOutline(basegfx::tools::createUnitPolygon());
const Color aVclColor(aColor.nColor);
aOutline.transform(getObjectTransform());
const drawinglayer::primitive2d::Primitive2DReference xOutline(
diff --git a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
index e19bc75fd6..a52060a68f 100644
--- a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
@@ -35,7 +35,7 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -52,50 +52,67 @@ namespace drawinglayer
Primitive2DSequence aRetval;
// add fill
- if(getSdrLFSTAttribute().getFill() && getUnitPolyPolygon().isClosed())
+ if(!getSdrLFSTAttribute().getFill().isDefault()
+ && getUnitPolyPolygon().isClosed())
{
// take care for orientations
- basegfx::B2DPolyPolygon aOrientedUnitPolyPolygon(basegfx::tools::correctOrientations(getUnitPolyPolygon()));
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(aOrientedUnitPolyPolygon, getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ const basegfx::B2DPolyPolygon aOrientedUnitPolyPolygon(
+ basegfx::tools::correctOrientations(getUnitPolyPolygon()));
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolyPolygonFillPrimitive(
+ aOrientedUnitPolyPolygon,
+ getTransform(),
+ getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(getSdrLFSTAttribute().getLine().isDefault())
{
- Primitive2DSequence aTemp(getUnitPolyPolygon().count());
-
- for(sal_uInt32 a(0L); a < getUnitPolyPolygon().count(); a++)
- {
- aTemp[a] = createPolygonLinePrimitive(getUnitPolyPolygon().getB2DPolygon(a), getTransform(), *getSdrLFSTAttribute().getLine(), getSdrLFSTAttribute().getLineStartEnd());
- }
-
- appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, aTemp);
+ // if initially no line is defined, create one for HitTest and BoundRect
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ getUnitPolyPolygon(),
+ getTransform()));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- Primitive2DSequence xHiddenLineSequence(getUnitPolyPolygon().count());
-
+ Primitive2DSequence aTemp(getUnitPolyPolygon().count());
+
for(sal_uInt32 a(0); a < getUnitPolyPolygon().count(); a++)
{
- xHiddenLineSequence[a] = createPolygonLinePrimitive(getUnitPolyPolygon().getB2DPolygon(a), getTransform(), aBlackHairline);
+ aTemp[a] = createPolygonLinePrimitive(
+ getUnitPolyPolygon().getB2DPolygon(a),
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ getSdrLFSTAttribute().getLineStartEnd());
}
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+
+ appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, aTemp);
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(getUnitPolyPolygon(), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ getUnitPolyPolygon(),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
index 0ae9483787..6dd57aff80 100644
--- a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
+++ b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
@@ -33,10 +33,6 @@
#include <svx/sdr/primitive2d/sdrprimitivetools.hxx>
#include <vcl/bmpacc.hxx>
#include <osl/mutex.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
-#include <basegfx/polygon/b2dpolygontools.hxx>
-#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
#include <vcl/lazydelete.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -177,19 +173,6 @@ namespace drawinglayer
return aRetVal.get() ? *aRetVal.get() : BitmapEx();
}
- // #i99123#
- Primitive2DReference createFallbackHitTestPrimitive(const basegfx::B2DHomMatrix& rMatrix)
- {
- // create PolygonHairlinePrimitive2D
- basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
- aUnitOutline.transform(rMatrix);
- const basegfx::BColor aBlack(0.0, 0.0, 0.0);
- const Primitive2DReference xReference(new PolygonHairlinePrimitive2D(aUnitOutline, aBlack));
-
- // create HitTestPrimitive2D with it
- const Primitive2DSequence xSequence(&xReference, 1);
- return Primitive2DReference(new HitTestPrimitive2D(xSequence));
- }
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
index 1e963e3244..fb14f3393a 100644
--- a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
@@ -35,7 +35,8 @@
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -50,7 +51,6 @@ namespace drawinglayer
Primitive2DSequence SdrRectanglePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
- Primitive2DSequence aHitTestContent;
// create unit outline polygon
const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(
@@ -59,64 +59,67 @@ namespace drawinglayer
getCornerRadiusY()));
// add fill
- if(getSdrLFSTAttribute().getFill())
+ if(!getSdrLFSTAttribute().getFill().isDefault())
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
createPolyPolygonFillPrimitive(
basegfx::B2DPolyPolygon(aUnitOutline),
getTransform(),
- *getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFill(),
getSdrLFSTAttribute().getFillFloatTransGradient()));
}
else if(getForceFillForHitTest())
{
// if no fill and it's a text frame, create a fill for HitTest and
// BoundRect fallback
- appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
- createPolyPolygonFillPrimitive(
- basegfx::B2DPolyPolygon(aUnitOutline),
- getTransform(),
- attribute::SdrFillAttribute(0.0, basegfx::BColor(0.0, 0.0, 0.0)),
- getSdrLFSTAttribute().getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ true,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(!getSdrLFSTAttribute().getLine().isDefault())
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
createPolygonLinePrimitive(
aUnitOutline,
getTransform(),
- *getSdrLFSTAttribute().getLine()));
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
else if(!getForceFillForHitTest())
{
// if initially no line is defined and it's not a text frame, create
// a line for HitTest and BoundRect
- appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
- createPolygonLinePrimitive(
- aUnitOutline,
- getTransform(),
- attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0))));
- }
-
- // add HitTest and BoundRect helper geometry (if exists)
- if(aHitTestContent.hasElements())
- {
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- Primitive2DReference(new HitTestPrimitive2D(aHitTestContent)));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx b/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx
index aaa885fb2a..fd8d8f1a21 100644
--- a/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx
+++ b/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx
@@ -34,8 +34,11 @@
#include <svl/itemset.hxx>
#include <com/sun/star/drawing/NormalsKind.hpp>
#include <com/sun/star/drawing/TextureProjectionMode.hpp>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
+#include <com/sun/star/drawing/TextureKind2.hpp>
+#include <com/sun/star/drawing/TextureMode.hpp>
#include <svx/xflclit.hxx>
+#include <drawinglayer/attribute/materialattribute3d.hxx>
+#include <drawinglayer/attribute/sdrobjectattribute3d.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/sdr/properties/oleproperties.cxx b/svx/source/sdr/properties/oleproperties.cxx
new file mode 100644
index 0000000000..5c6fae24da
--- /dev/null
+++ b/svx/source/sdr/properties/oleproperties.cxx
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: graphicproperties.cxx,v $
+ * $Revision: 1.12.76.1 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+
+#include <svx/sdr/properties/oleproperties.hxx>
+#include <svl/itemset.hxx>
+#include <svx/xfillit0.hxx>
+#include <svx/xlineit0.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ OleProperties::OleProperties(SdrObject& rObj)
+ : RectangleProperties(rObj)
+ {
+ }
+
+ OleProperties::OleProperties(const OleProperties& rProps, SdrObject& rObj)
+ : RectangleProperties(rProps, rObj)
+ {
+ }
+
+ OleProperties::~OleProperties()
+ {
+ }
+
+ BaseProperties& OleProperties::Clone(SdrObject& rObj) const
+ {
+ return *(new OleProperties(*this, rObj));
+ }
+
+ void OleProperties::ForceDefaultAttributes()
+ {
+ // call parent
+ RectangleProperties::ForceDefaultAttributes();
+
+ // force ItemSet
+ GetObjectItemSet();
+
+ // #i108221#
+ mpItemSet->Put( XFillStyleItem(XFILL_NONE) );
+ mpItemSet->Put( XLineStyleItem(XLINE_NONE) );
+ }
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 074045d4ef..35da9eb1f0 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -69,7 +69,7 @@
#include <svx/sdr/contact/viewcontact.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
#include "svditer.hxx"
#include <svx/svdopath.hxx>
@@ -78,13 +78,14 @@
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <svx/svdoole2.hxx>
#include <svx/svdovirt.hxx>
#include <svx/svdouno.hxx>
#include <svx/sdr/primitive2d/sdrprimitivetools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -726,8 +727,8 @@ void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay
if(aResultTransparent.hasElements())
{
- drawinglayer::primitive2d::Primitive2DReference aUnifiedAlphaPrimitive2D(new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(aResultTransparent, 0.5));
- aResultTransparent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlphaPrimitive2D, 1);
+ drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aResultTransparent, 0.5));
+ aResultTransparent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparencePrimitive2D, 1);
sdr::overlay::OverlayObject* pNewOverlayObject = new sdr::overlay::OverlayPrimitive2DSequenceObject(aResultTransparent);
rOverlayManager.add(*pNewOverlayObject);
@@ -825,35 +826,22 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragMethod::AddConnectorOverla
if(getSolidDraggingActive())
{
const SfxItemSet& rItemSet = pEdge->GetMergedItemSet();
- drawinglayer::attribute::SdrLineAttribute* pLine = drawinglayer::primitive2d::createNewSdrLineAttribute(rItemSet);
- drawinglayer::attribute::SdrLineStartEndAttribute* pLineStartEnd = 0;
+ const drawinglayer::attribute::SdrLineAttribute aLine(
+ drawinglayer::primitive2d::createNewSdrLineAttribute(rItemSet));
- if(pLine && !pLine->isVisible())
+ if(!aLine.isDefault())
{
- delete pLine;
- pLine = 0;
- }
-
- if(pLine)
- {
- pLineStartEnd = drawinglayer::primitive2d::createNewSdrLineStartEndAttribute(rItemSet, pLine->getWidth());
-
- if(pLineStartEnd && !pLineStartEnd->isVisible())
- {
- delete pLineStartEnd;
- pLineStartEnd = 0;
- }
+ const drawinglayer::attribute::SdrLineStartEndAttribute aLineStartEnd(
+ drawinglayer::primitive2d::createNewSdrLineStartEndAttribute(
+ rItemSet,
+ aLine.getWidth()));
drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(
aRetval, drawinglayer::primitive2d::createPolygonLinePrimitive(
- aEdgePolygon, basegfx::B2DHomMatrix(), *pLine, pLineStartEnd));
-
- if(pLineStartEnd)
- {
- delete pLineStartEnd;
- }
-
- delete pLine;
+ aEdgePolygon,
+ basegfx::B2DHomMatrix(),
+ aLine,
+ aLineStartEnd));
}
}
else
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index ec5d5ba7ab..7c2680f3f0 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -808,16 +808,101 @@ void SdrEditView::DeleteMarkedList(const SdrMarkList& rMark)
void SdrEditView::DeleteMarkedObj()
{
- if (GetMarkedObjectCount()) {
- BrkAction();
- //HMHHideMarkHdl();
- BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_DELETE);
+ // moved breaking action and undo start outside loop
+ BrkAction();
+ BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_DELETE);
+
+ // remove as long as something is selected. This allows to schedule objects for
+ // removal for a next run as needed
+ while(GetMarkedObjectCount())
+ {
+ // vector to remember the parents which may be empty after object removal
+ std::vector< SdrObject* > aParents;
+
+ {
+ const SdrMarkList& rMarkList = GetMarkedObjectList();
+ const sal_uInt32 nCount(rMarkList.GetMarkCount());
+ sal_uInt32 a(0);
+
+ for(a = 0; a < nCount; a++)
+ {
+ // in the first run, add all found parents, but only once
+ SdrMark* pMark = rMarkList.GetMark(a);
+ SdrObject* pObject = pMark->GetMarkedSdrObj();
+ SdrObject* pParent = pObject->GetObjList()->GetOwnerObj();
+
+ if(pParent)
+ {
+ if(aParents.size())
+ {
+ std::vector< SdrObject* >::iterator aFindResult =
+ std::find(aParents.begin(), aParents.end(), pParent);
+
+ if(aFindResult == aParents.end())
+ {
+ aParents.push_back(pParent);
+ }
+ }
+ else
+ {
+ aParents.push_back(pParent);
+ }
+ }
+ }
+
+ if(aParents.size())
+ {
+ // in a 2nd run, remove all objects which may already be scheduled for
+ // removal. I am not sure if this can happen, but theoretically
+ // a to-be-removed object may already be the group/3DScene itself
+ for(a = 0; a < nCount; a++)
+ {
+ SdrMark* pMark = rMarkList.GetMark(a);
+ SdrObject* pObject = pMark->GetMarkedSdrObj();
+
+ std::vector< SdrObject* >::iterator aFindResult =
+ std::find(aParents.begin(), aParents.end(), pObject);
+
+ if(aFindResult != aParents.end())
+ {
+ aParents.erase(aFindResult);
+ }
+ }
+ }
+ }
+
+ // original stuff: remove selected objects. Handle clear will
+ // do something only once
DeleteMarkedList(GetMarkedObjectList());
GetMarkedObjectListWriteAccess().Clear();
aHdl.Clear();
- EndUndo();
- MarkListHasChanged();
+
+ while(aParents.size() && !GetMarkedObjectCount())
+ {
+ // iterate over remembered parents
+ SdrObject* pParent = aParents.back();
+ aParents.pop_back();
+
+ if(pParent->GetSubList() && 0 == pParent->GetSubList()->GetObjCount())
+ {
+ // we detected an empty parent, a candidate to leave group/3DScene
+ // if entered
+ if(GetSdrPageView()->GetAktGroup()
+ && GetSdrPageView()->GetAktGroup() == pParent)
+ {
+ GetSdrPageView()->LeaveOneGroup();
+ }
+
+ // schedule empty parent for removal
+ GetMarkedObjectListWriteAccess().InsertEntry(
+ SdrMark(pParent, GetSdrPageView()));
+ }
+ }
}
+
+ // end undo and change messaging moved at the end
+ EndUndo();
+ MarkListHasChanged();
}
void SdrEditView::CopyMarkedObj()
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index 13b5f4a3a2..7ed63ce2fb 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -846,7 +846,7 @@ void SdrCaptionObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, cons
}
// geometry access
-::basegfx::B2DPolygon SdrCaptionObj::getTailPolygon() const
+basegfx::B2DPolygon SdrCaptionObj::getTailPolygon() const
{
return aTailPoly.getB2DPolygon();
}
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index 70cfe07549..cba55f7740 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -166,6 +166,12 @@ void SdrObjGroup::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
}
+void SdrObjGroup::SetBoundRectDirty()
+{
+ // avoid resetting aOutRect which in case of this object is model data,
+ // not re-creatable view data
+}
+
UINT16 SdrObjGroup::GetObjIdentifier() const
{
return UINT16(OBJ_GRUP);
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 5daa6204b1..62f7f6a299 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -79,6 +79,7 @@ inline double ImplMMToTwips(double fVal) { return (fVal * (72.0 / 127.0)); }
#include <svx/sdr/attribute/sdrtextattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <svx/sdr/attribute/sdrformtextattribute.hxx>
using namespace sdr;
@@ -2744,13 +2745,10 @@ SdrObject* SdrPathObj::RipPoint(sal_uInt32 nHdlNum, sal_uInt32& rNewPt0Index)
SdrObject* SdrPathObj::DoConvertToPolyObj(BOOL bBezier) const
{
// #i89784# check for FontWork with activated HideContour
- bool bHideContour(false);
-
- {
- drawinglayer::attribute::SdrTextAttribute* pText = drawinglayer::primitive2d::createNewSdrTextAttribute(GetObjectItemSet(), *getText(0));
- bHideContour = pText && pText->getSdrFormTextAttribute() && pText->isHideContour();
- delete pText;
- }
+ const drawinglayer::attribute::SdrTextAttribute aText(
+ drawinglayer::primitive2d::createNewSdrTextAttribute(GetObjectItemSet(), *getText(0)));
+ const bool bHideContour(
+ !aText.isDefault() && !aText.getSdrFormTextAttribute().isDefault() && aText.isHideContour());
SdrObject* pRet = bHideContour ?
0 :
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index ecccd6fa42..452b24a607 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -66,7 +66,7 @@
#include <svx/xlinjoit.hxx>
#include <svx/xlndsit.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <editstat.hxx>
#include <unoapi.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
@@ -230,7 +230,7 @@ namespace
{
class impPolygonParagraphHandler
{
- const drawinglayer::attribute::SdrFormTextAttribute& mrSdrFormTextAttribute; // FormText parameters
+ const drawinglayer::attribute::SdrFormTextAttribute maSdrFormTextAttribute; // FormText parameters
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrDecomposition; // destination primitive list
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrShadowDecomposition; // destination primitive list for shadow
Reference < com::sun::star::i18n::XBreakIterator > mxBreak; // break iterator
@@ -273,7 +273,7 @@ namespace
const drawinglayer::attribute::SdrFormTextAttribute& rSdrFormTextAttribute,
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rDecomposition,
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rShadowDecomposition)
- : mrSdrFormTextAttribute(rSdrFormTextAttribute),
+ : maSdrFormTextAttribute(rSdrFormTextAttribute),
mrDecomposition(rDecomposition),
mrShadowDecomposition(rShadowDecomposition)
{
@@ -297,18 +297,18 @@ namespace
double fPolyStart(0.0);
double fScaleFactor(1.0);
- if(mrSdrFormTextAttribute.getFormTextMirror())
+ if(maSdrFormTextAttribute.getFormTextMirror())
{
aPolygonCandidate.flip();
}
- if(mrSdrFormTextAttribute.getFormTextStart()
- && (XFT_LEFT == mrSdrFormTextAttribute.getFormTextAdjust()
- || XFT_RIGHT == mrSdrFormTextAttribute.getFormTextAdjust()))
+ if(maSdrFormTextAttribute.getFormTextStart()
+ && (XFT_LEFT == maSdrFormTextAttribute.getFormTextAdjust()
+ || XFT_RIGHT == maSdrFormTextAttribute.getFormTextAdjust()))
{
- if(XFT_LEFT == mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_LEFT == maSdrFormTextAttribute.getFormTextAdjust())
{
- fPolyStart += mrSdrFormTextAttribute.getFormTextStart();
+ fPolyStart += maSdrFormTextAttribute.getFormTextStart();
if(fPolyStart > fPolyEnd)
{
@@ -317,7 +317,7 @@ namespace
}
else
{
- fPolyEnd -= mrSdrFormTextAttribute.getFormTextStart();
+ fPolyEnd -= maSdrFormTextAttribute.getFormTextStart();
if(fPolyEnd < fPolyStart)
{
@@ -326,7 +326,7 @@ namespace
}
}
- if(XFT_LEFT != mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_LEFT != maSdrFormTextAttribute.getFormTextAdjust())
{
// calculate total text length of this paragraph, some layout needs to be done
const double fParagraphTextLength(getParagraphTextLength(rTextPortions));
@@ -335,7 +335,7 @@ namespace
// but still take care of XFT_AUTOSIZE in that case
const bool bTextTooLong(fParagraphTextLength > (fPolyEnd - fPolyStart));
- if(XFT_RIGHT == mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_RIGHT == maSdrFormTextAttribute.getFormTextAdjust())
{
if(!bTextTooLong)
{
@@ -343,7 +343,7 @@ namespace
fPolyStart += ((fPolyEnd - fPolyStart) - fParagraphTextLength);
}
}
- else if(XFT_CENTER == mrSdrFormTextAttribute.getFormTextAdjust())
+ else if(XFT_CENTER == maSdrFormTextAttribute.getFormTextAdjust())
{
if(!bTextTooLong)
{
@@ -351,7 +351,7 @@ namespace
fPolyStart += ((fPolyEnd - fPolyStart) - fParagraphTextLength) / 2.0;
}
}
- else if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust())
+ else if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust())
{
// if scale, prepare scale factor between curve length and text length
if(0.0 != fParagraphTextLength)
@@ -386,7 +386,7 @@ namespace
// prepare portion length. Takes RTL sections into account.
double fPortionLength(pCandidate->getDisplayLength(nUsedTextLength, nNextGlyphLen));
- if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust())
{
// when scaling, expand portion length
fPortionLength *= fScaleFactor;
@@ -401,27 +401,27 @@ namespace
aNewTransformA.scale(aFontScaling.getX(), aFontScaling.getY());
// prepare scaling of text primitive
- if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust())
{
// when scaling, expand text primitive scaling
aNewTransformA.scale(fScaleFactor, fScaleFactor);
}
// eventually create shadow primitives from aDecomposition and add to rDecomposition
- const bool bShadow(XFTSHADOW_NONE != mrSdrFormTextAttribute.getFormTextShadow());
+ const bool bShadow(XFTSHADOW_NONE != maSdrFormTextAttribute.getFormTextShadow());
if(bShadow)
{
- if(XFTSHADOW_NORMAL == mrSdrFormTextAttribute.getFormTextShadow())
+ if(XFTSHADOW_NORMAL == maSdrFormTextAttribute.getFormTextShadow())
{
aNewShadowTransform.translate(
- mrSdrFormTextAttribute.getFormTextShdwXVal(),
- -mrSdrFormTextAttribute.getFormTextShdwYVal());
+ maSdrFormTextAttribute.getFormTextShdwXVal(),
+ -maSdrFormTextAttribute.getFormTextShdwYVal());
}
else // XFTSHADOW_SLANT
{
- double fScaleValue(mrSdrFormTextAttribute.getFormTextShdwYVal() / 100.0);
- double fShearValue(-mrSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800);
+ double fScaleValue(maSdrFormTextAttribute.getFormTextShdwYVal() / 100.0);
+ double fShearValue(-maSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800);
aNewShadowTransform.scale(1.0, fScaleValue);
aNewShadowTransform.shearX(sin(fShearValue));
@@ -429,7 +429,7 @@ namespace
}
}
- switch(mrSdrFormTextAttribute.getFormTextStyle())
+ switch(maSdrFormTextAttribute.getFormTextStyle())
{
case XFT_ROTATE :
{
@@ -487,7 +487,7 @@ namespace
}
// distance from path?
- if(mrSdrFormTextAttribute.getFormTextDistance())
+ if(maSdrFormTextAttribute.getFormTextDistance())
{
if(aEndPos.equal(aStartPos))
{
@@ -497,7 +497,7 @@ namespace
// use back vector (aStartPos - aEndPos) here to get mirrored perpendicular as in old stuff
const basegfx::B2DVector aPerpendicular(
basegfx::getNormalizedPerpendicular(aStartPos - aEndPos) *
- mrSdrFormTextAttribute.getFormTextDistance());
+ maSdrFormTextAttribute.getFormTextDistance());
aNewTransformB.translate(aPerpendicular.getX(), aPerpendicular.getY());
}
@@ -506,7 +506,7 @@ namespace
{
if(pCandidate->getText().Len() && nNextGlyphLen)
{
- const Color aShadowColor(mrSdrFormTextAttribute.getFormTextShdwColor());
+ const Color aShadowColor(maSdrFormTextAttribute.getFormTextShdwColor());
const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor());
const xub_StrLen nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen));
const ::std::vector< double > aNewDXArray(
@@ -627,7 +627,7 @@ namespace
{
if(rOutlineAttribute.getTransparence())
{
- // create UnifiedAlphaPrimitive2D
+ // create UnifiedTransparencePrimitive2D
drawinglayer::primitive2d::Primitive2DSequence aStrokePrimitiveSequence(nStrokeCount);
for(sal_uInt32 b(0L); b < nStrokeCount; b++)
@@ -635,8 +635,8 @@ namespace
aStrokePrimitiveSequence[b] = drawinglayer::primitive2d::Primitive2DReference(aStrokePrimitives[b]);
}
- drawinglayer::primitive2d::UnifiedAlphaPrimitive2D* pNew2 =
- new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ drawinglayer::primitive2d::UnifiedTransparencePrimitive2D* pNew2 =
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
aStrokePrimitiveSequence,
(double)rOutlineAttribute.getTransparence() / 100.0);
aNewPrimitives.push_back(pNew2);
@@ -716,7 +716,9 @@ void SdrTextObj::impDecomposePathTextPrimitive(
std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aRegularDecomposition;
std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aShadowDecomposition;
impPolygonParagraphHandler aPolygonParagraphHandler(
- rFormTextAttribute, aRegularDecomposition, aShadowDecomposition);
+ rFormTextAttribute,
+ aRegularDecomposition,
+ aShadowDecomposition);
sal_uInt32 a;
for(a = 0L; a < nLoopCount; a++)
@@ -755,10 +757,14 @@ void SdrTextObj::impDecomposePathTextPrimitive(
}
// evtl. add shadow outlines
- if(rFormTextAttribute.getFormTextOutline() && rFormTextAttribute.getShadowOutline())
+ if(rFormTextAttribute.getFormTextOutline()
+ && !rFormTextAttribute.getShadowOutline().isDefault())
{
const drawinglayer::primitive2d::Primitive2DSequence aOutlines(
- impAddPathTextOutlines(aShadowDecomposition, *rFormTextAttribute.getShadowOutline()));
+ impAddPathTextOutlines(
+ aShadowDecomposition,
+ rFormTextAttribute.getShadowOutline()));
+
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(aRetvalA, aOutlines);
}
}
@@ -774,10 +780,14 @@ void SdrTextObj::impDecomposePathTextPrimitive(
}
// evtl. add outlines
- if(rFormTextAttribute.getFormTextOutline() && rFormTextAttribute.getOutline())
+ if(rFormTextAttribute.getFormTextOutline()
+ && !rFormTextAttribute.getOutline().isDefault())
{
const drawinglayer::primitive2d::Primitive2DSequence aOutlines(
- impAddPathTextOutlines(aRegularDecomposition, *rFormTextAttribute.getOutline()));
+ impAddPathTextOutlines(
+ aRegularDecomposition,
+ rFormTextAttribute.getOutline()));
+
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(aRetvalB, aOutlines);
}
}
diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx
index 511616921c..7bf9ff3a85 100644
--- a/svx/source/table/tablehandles.cxx
+++ b/svx/source/table/tablehandles.cxx
@@ -50,7 +50,7 @@
#include <svx/svdpagv.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <svx/sdr/overlay/overlayhatchrect.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/UnifiedTransparencePrimitive2D.hxx>
namespace sdr { namespace table {
@@ -245,10 +245,11 @@ drawinglayer::primitive2d::Primitive2DSequence OverlayTableEdge::createOverlayOb
}
else
{
- // embed in HitTest primitive to support HitTest of this overlay object
+ // embed in 100% transparent UnifiedTransparencePrimitive2D to support HitTest
+ // of this overlay object
const drawinglayer::primitive2d::Primitive2DSequence aSequence(&aReference, 1);
const drawinglayer::primitive2d::Primitive2DReference aNewReference(
- new drawinglayer::primitive2d::HitTestPrimitive2D(aSequence));
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aSequence, 1.0));
aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aNewReference, 1);
}
}
diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx
index 70fd77ea1b..55776623b1 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -37,19 +37,20 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <svx/sdr/attribute/sdrtextattribute.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
#include <svx/borderline.hxx>
#include <drawinglayer/primitive2d/borderlineprimitive2d.hxx>
+#include <svx/sdr/attribute/sdrfilltextattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "cell.hxx"
#include "tablelayouter.hxx"
@@ -99,31 +100,44 @@ namespace drawinglayer
{
Primitive2DSequence aRetval;
- if(getSdrFTAttribute().getFill() || getSdrFTAttribute().getText())
+ if(!getSdrFTAttribute().getFill().isDefault()
+ || !getSdrFTAttribute().getText().isDefault())
{
// prepare unit polygon
- const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
- const basegfx::B2DPolyPolygon aUnitPolyPolygon(basegfx::tools::createPolygonFromRect(aUnitRange));
+ const basegfx::B2DPolyPolygon aUnitPolyPolygon(basegfx::tools::createUnitPolygon());
// add fill
- if(getSdrFTAttribute().getFill())
+ if(!getSdrFTAttribute().getFill().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(
- aUnitPolyPolygon,
- getTransform(),
- *getSdrFTAttribute().getFill(),
- getSdrFTAttribute().getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolyPolygonFillPrimitive(
+ aUnitPolyPolygon,
+ getTransform(),
+ getSdrFTAttribute().getFill(),
+ getSdrFTAttribute().getFillFloatTransGradient()));
+ }
+ else
+ {
+ // if no fill create one for HitTest and BoundRect fallback
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ true,
+ aUnitPolyPolygon,
+ getTransform()));
}
// add text
- if(getSdrFTAttribute().getText())
+ if(!getSdrFTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(
- aUnitPolyPolygon,
- getTransform(),
- *getSdrFTAttribute().getText(),
- 0,
- true, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ aUnitPolyPolygon,
+ getTransform(),
+ getSdrFTAttribute().getText(),
+ attribute::SdrLineAttribute(),
+ true,
+ false,
+ false));
}
}
@@ -539,14 +553,13 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfTableObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
const sdr::table::SdrTableObj& rTableObj = GetTableObj();
const uno::Reference< com::sun::star::table::XTable > xTable = rTableObj.getTable();
- const SfxItemSet& rObjectItemSet = rTableObj.GetMergedItemSet();
if(xTable.is())
{
// create primitive representation for table
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
const sal_Int32 nRowCount(xTable->getRowCount());
const sal_Int32 nColCount(xTable->getColumnCount());
const sal_Int32 nAllCount(nRowCount * nColCount);
@@ -599,7 +612,7 @@ namespace sdr
const SfxItemSet& rCellItemSet = xCurrentCell->GetItemSet();
const sal_uInt32 nTextIndex(nColCount * aCellPos.mnRow + aCellPos.mnCol);
const SdrText* pSdrText = rTableObj.getText(nTextIndex);
- drawinglayer::attribute::SdrFillTextAttribute* pAttribute = 0;
+ drawinglayer::attribute::SdrFillTextAttribute aAttribute;
if(pSdrText)
{
@@ -609,7 +622,7 @@ namespace sdr
const sal_Int32 nUpper(xCurrentCell->GetTextUpperDistance());
const sal_Int32 nLower(xCurrentCell->GetTextLowerDistance());
- pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(
+ aAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(
rCellItemSet,
pSdrText,
&nLeft,
@@ -619,21 +632,17 @@ namespace sdr
}
else
{
- pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(
+ aAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(
rCellItemSet,
pSdrText);
}
- if(pAttribute)
+ // always create cell primitives for BoundRect and HitTest
{
- if(pAttribute->isVisible())
- {
- const drawinglayer::primitive2d::Primitive2DReference xCellReference(new drawinglayer::primitive2d::SdrCellPrimitive2D(
- aCellMatrix, *pAttribute));
- xCellSequence[nCellInsert++] = xCellReference;
- }
-
- delete pAttribute;
+ const drawinglayer::primitive2d::Primitive2DReference xCellReference(
+ new drawinglayer::primitive2d::SdrCellPrimitive2D(
+ aCellMatrix, aAttribute));
+ xCellSequence[nCellInsert++] = xCellReference;
}
// handle cell borders
@@ -678,21 +687,46 @@ namespace sdr
xRetval = xCellSequence;
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, xBorderSequence);
}
- }
- if(xRetval.hasElements())
- {
- // check and create evtl. shadow for created content
- drawinglayer::attribute::SdrShadowAttribute* pNewShadowAttribute = drawinglayer::primitive2d::createNewSdrShadowAttribute(rObjectItemSet);
-
- if(pNewShadowAttribute)
+ if(xRetval.hasElements())
{
- xRetval = drawinglayer::primitive2d::createEmbeddedShadowPrimitive(xRetval, *pNewShadowAttribute);
- delete pNewShadowAttribute;
+ // check and create evtl. shadow for created content
+ const SfxItemSet& rObjectItemSet = rTableObj.GetMergedItemSet();
+ const drawinglayer::attribute::SdrShadowAttribute aNewShadowAttribute(
+ drawinglayer::primitive2d::createNewSdrShadowAttribute(rObjectItemSet));
+
+ if(!aNewShadowAttribute.isDefault())
+ {
+ xRetval = drawinglayer::primitive2d::createEmbeddedShadowPrimitive(xRetval, aNewShadowAttribute);
+ }
}
- }
- return xRetval;
+ return xRetval;
+ }
+ else
+ {
+ // take unrotated snap rect (direct model data) for position and size
+ const Rectangle& rRectangle = rTableObj.GetGeoRect();
+ const basegfx::B2DRange aObjectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+
+ // create object matrix
+ const GeoStat& rGeoStat(rTableObj.GetGeoStat());
+ const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
+ const double fRotate(rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0);
+ const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
+
+ // credate an invisible outline for the cases where no visible content exists
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false,
+ aObjectMatrix));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
}
ViewContactOfTableObj::ViewContactOfTableObj(::sdr::table::SdrTableObj& rTableObj)