summaryrefslogtreecommitdiff
path: root/svx/source/sdr/primitive2d
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/sdr/primitive2d')
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx8
-rw-r--r--svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx6
-rw-r--r--svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx6
-rw-r--r--svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx18
-rw-r--r--svx/source/sdr/primitive2d/sdrdecompositiontools.cxx35
-rw-r--r--svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx18
-rw-r--r--svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx6
-rw-r--r--svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx15
-rw-r--r--svx/source/sdr/primitive2d/sdrole2primitive2d.cxx60
-rw-r--r--svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx18
-rw-r--r--svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx6
-rw-r--r--svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx6
-rw-r--r--svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx20
13 files changed, 106 insertions, 116 deletions
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 417445b7d7..ee43fb9dc9 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -31,14 +31,14 @@
#include "precompiled_svx.hxx"
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/xdef.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <svx/xlineit0.hxx>
#include <svx/xfillit0.hxx>
#include <svx/xlntrit.hxx>
#include <svx/xlnwtit.hxx>
-#include <xlinjoit.hxx>
+#include <svx/xlinjoit.hxx>
#include <svx/xlnclit.hxx>
#include <svx/xlnstwit.hxx>
#include <svx/xlnedwit.hxx>
@@ -67,7 +67,7 @@
#include <svx/sdr/attribute/sdrtextattribute.hxx>
#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/xbtmpit.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <vcl/svapp.hxx>
#include <basegfx/range/b2drange.hxx>
#include <svx/svx3ditems.hxx>
@@ -556,7 +556,7 @@ namespace drawinglayer
const XGradient& rGradient = ((XFillFloatTransparenceItem*)pGradientItem)->GetGradientValue();
const sal_uInt8 nStartLuminance(rGradient.GetStartColor().GetLuminance());
const sal_uInt8 nEndLuminance(rGradient.GetEndColor().GetLuminance());
- const bool bCompletelyTransparent(0xff == nStartLuminance == nEndLuminance);
+ const bool bCompletelyTransparent(0xff == nStartLuminance && 0xff == nEndLuminance);
if(!bCompletelyTransparent)
{
diff --git a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
index 233aed8ed2..cc71488fb6 100644
--- a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
@@ -47,7 +47,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence SdrCaptionPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
+ Primitive2DSequence SdrCaptionPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
Primitive2DSequence aHitTestContent;
@@ -142,7 +142,7 @@ namespace drawinglayer
const basegfx::B2DPolygon& rTail,
double fCornerRadiusX,
double fCornerRadiusY)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maTransform(rTransform),
maSdrLFSTAttribute(rSdrLFSTAttribute),
maTail(rTail),
@@ -160,7 +160,7 @@ namespace drawinglayer
bool SdrCaptionPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const SdrCaptionPrimitive2D& rCompare = (SdrCaptionPrimitive2D&)rPrimitive;
diff --git a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
index a00820289c..f08fd75ab0 100644
--- a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
@@ -47,7 +47,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence SdrConnectorPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
+ Primitive2DSequence SdrConnectorPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
@@ -87,7 +87,7 @@ namespace drawinglayer
SdrConnectorPrimitive2D::SdrConnectorPrimitive2D(
const attribute::SdrLineShadowTextAttribute& rSdrLSTAttribute,
const ::basegfx::B2DPolygon& rUnitPolygon)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maSdrLSTAttribute(rSdrLSTAttribute),
maUnitPolygon(rUnitPolygon)
{
@@ -95,7 +95,7 @@ namespace drawinglayer
bool SdrConnectorPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const SdrConnectorPrimitive2D& rCompare = (SdrConnectorPrimitive2D&)rPrimitive;
diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
index 93e8b3a6e7..61b60abc52 100644
--- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
@@ -47,7 +47,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence SdrCustomShapePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
+ Primitive2DSequence SdrCustomShapePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval(getSubPrimitives());
@@ -92,21 +92,21 @@ namespace drawinglayer
const Primitive2DSequence& rSubPrimitives,
const basegfx::B2DHomMatrix& rTextBox,
bool bWordWrap,
- bool bForceTextClipToTextRange,
- bool b3DShape)
- : BasePrimitive2D(),
+ bool b3DShape,
+ bool bForceTextClipToTextRange)
+ : BufferedDecompositionPrimitive2D(),
maSdrSTAttribute(rSdrSTAttribute),
maSubPrimitives(rSubPrimitives),
maTextBox(rTextBox),
mbWordWrap(bWordWrap),
- mbForceTextClipToTextRange(bForceTextClipToTextRange),
- mb3DShape(b3DShape)
+ mb3DShape(b3DShape),
+ mbForceTextClipToTextRange(bForceTextClipToTextRange)
{
}
bool SdrCustomShapePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const SdrCustomShapePrimitive2D& rCompare = (SdrCustomShapePrimitive2D&)rPrimitive;
@@ -114,8 +114,8 @@ namespace drawinglayer
&& getSubPrimitives() == rCompare.getSubPrimitives()
&& getTextBox() == rCompare.getTextBox()
&& getWordWrap() == rCompare.getWordWrap()
- && isForceTextClipToTextRange() == rCompare.isForceTextClipToTextRange()
- && get3DShape() == rCompare.get3DShape());
+ && get3DShape() == rCompare.get3DShape()
+ && isForceTextClipToTextRange() == rCompare.isForceTextClipToTextRange());
}
return false;
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 6204eba4fa..67fb97e6b7 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -75,11 +75,11 @@ namespace drawinglayer
// prepare fully scaled polygon
basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
aScaledPolyPolygon.transform(rObjectTransform);
- BasePrimitive2D* pNewFillPrimitive = 0L;
+ BasePrimitive2D* pNewFillPrimitive = 0;
if(rFill.isGradient())
{
- pNewFillPrimitive = new PolyPolygonGradientPrimitive2D(aScaledPolyPolygon, rFill.getColor(), *rFill.getGradient());
+ pNewFillPrimitive = new PolyPolygonGradientPrimitive2D(aScaledPolyPolygon, *rFill.getGradient());
}
else if(rFill.isHatch())
{
@@ -88,7 +88,7 @@ namespace drawinglayer
else if(rFill.isBitmap())
{
const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon));
- pNewFillPrimitive = new PolyPolygonBitmapPrimitive2D(aScaledPolyPolygon, rFill.getColor(), rFill.getBitmap()->getFillBitmapAttribute(aRange));
+ pNewFillPrimitive = new PolyPolygonBitmapPrimitive2D(aScaledPolyPolygon, rFill.getBitmap()->getFillBitmapAttribute(aRange));
}
else
{
@@ -192,19 +192,17 @@ namespace drawinglayer
// scale outline to object's size to allow growing with value relative to that size
// and also to keep aspect ratio
- basegfx::B2DHomMatrix aScaleTransform;
- aScaleTransform.set(0, 0, fabs(aScale.getX()));
- aScaleTransform.set(1, 1, fabs(aScale.getY()));
basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon);
- aScaledUnitPolyPolygon.transform(aScaleTransform);
+ aScaledUnitPolyPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(
+ 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));
// scale back to unit polygon
- aScaleTransform.set(0, 0, 0.0 != aScale.getX() ? 1.0 / aScale.getX() : 1.0);
- aScaleTransform.set(1, 1, 0.0 != aScale.getY() ? 1.0 / aScale.getY() : 1.0);
- aScaledUnitPolyPolygon.transform(aScaleTransform);
+ aScaledUnitPolyPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(
+ 0.0 != aScale.getX() ? 1.0 / aScale.getX() : 1.0,
+ 0.0 != aScale.getY() ? 1.0 / aScale.getY() : 1.0));
// create with unit polygon
pNew = new SdrContourTextPrimitive2D(
@@ -265,17 +263,16 @@ namespace drawinglayer
aTextAnchorRange.expand(aBottomRight);
// now create a transformation from this basic range (aTextAnchorRange)
- aAnchorTransform.identity();
- aAnchorTransform.scale(aTextAnchorRange.getWidth(), aTextAnchorRange.getHeight());
- aAnchorTransform.translate(aTextAnchorRange.getMinX(), aTextAnchorRange.getMinY());
+ aAnchorTransform = basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aTextAnchorRange.getWidth(), aTextAnchorRange.getHeight(),
+ aTextAnchorRange.getMinX(), aTextAnchorRange.getMinY());
// apply mirroring
aAnchorTransform.scale(bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0);
// apply object's other transforms
- aAnchorTransform.shearX(fShearX);
- aAnchorTransform.rotate(fRotate);
- aAnchorTransform.translate(aTranslate.getX(), aTranslate.getY());
+ aAnchorTransform = basegfx::tools::createShearXRotateTranslateB2DHomMatrix(fShearX, fRotate, aTranslate)
+ * aAnchorTransform;
if(rText.isFitToSize())
{
@@ -342,10 +339,8 @@ namespace drawinglayer
aAnchorTransform.decompose(aScale, aTranslate, fRotate, fShearX);
// build transform from scaled only to full AnchorTransform and inverse
- basegfx::B2DHomMatrix aSRT;
- aSRT.shearX(fShearX);
- aSRT.rotate(fRotate);
- aSRT.translate(aTranslate.getX(), aTranslate.getY());
+ const basegfx::B2DHomMatrix aSRT(basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
+ fShearX, fRotate, aTranslate));
basegfx::B2DHomMatrix aISRT(aSRT);
aISRT.invert();
diff --git a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
index dee271c97f..016ff9fa8f 100644
--- a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
@@ -39,6 +39,7 @@
#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
#include <basegfx/color/bcolor.hxx>
#include <drawinglayer/attribute/sdrattribute.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -50,7 +51,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence SdrEllipsePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
+ Primitive2DSequence SdrEllipsePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
@@ -61,11 +62,7 @@ namespace drawinglayer
::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromUnitCircle(1));
// scale and move UnitEllipse to UnitObject (-1,-1 1,1) -> (0,0 1,1)
- ::basegfx::B2DHomMatrix aUnitCorrectionMatrix;
- aUnitCorrectionMatrix.set(0, 0, 0.5);
- aUnitCorrectionMatrix.set(1, 1, 0.5);
- aUnitCorrectionMatrix.set(0, 2, 0.5);
- aUnitCorrectionMatrix.set(1, 2, 0.5);
+ const basegfx::B2DHomMatrix aUnitCorrectionMatrix(basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5));
// apply to the geometry
aUnitOutline.transform(aUnitCorrectionMatrix);
@@ -109,7 +106,7 @@ namespace drawinglayer
SdrEllipsePrimitive2D::SdrEllipsePrimitive2D(
const ::basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maTransform(rTransform),
maSdrLFSTAttribute(rSdrLFSTAttribute)
{
@@ -117,7 +114,7 @@ namespace drawinglayer
bool SdrEllipsePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const SdrEllipsePrimitive2D& rCompare = (SdrEllipsePrimitive2D&)rPrimitive;
@@ -140,13 +137,12 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence SdrEllipseSegmentPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
+ Primitive2DSequence SdrEllipseSegmentPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
// create unit outline polygon
::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromUnitEllipseSegment(mfStartAngle, mfEndAngle));
- ::basegfx::B2DHomMatrix aUnitCorrectionMatrix;
if(mbCloseSegment)
{
@@ -161,7 +157,7 @@ namespace drawinglayer
}
// move and scale UnitEllipse to UnitObject (-1,-1 1,1) -> (0,0 1,1)
- aUnitCorrectionMatrix.translate(1.0, 1.0);
+ basegfx::B2DHomMatrix aUnitCorrectionMatrix(basegfx::tools::createTranslateB2DHomMatrix(1.0, 1.0));
aUnitCorrectionMatrix.scale(0.5, 0.5);
// apply to the geometry
diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
index d57540cce7..70b973e521 100644
--- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
@@ -44,7 +44,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence SdrGrafPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
+ Primitive2DSequence SdrGrafPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
@@ -121,7 +121,7 @@ namespace drawinglayer
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
const GraphicObject& rGraphicObject,
const GraphicAttr& rGraphicAttr)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maTransform(rTransform),
maSdrLFSTAttribute(rSdrLFSTAttribute),
maGraphicObject(rGraphicObject),
@@ -133,7 +133,7 @@ namespace drawinglayer
bool SdrGrafPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const SdrGrafPrimitive2D& rCompare = (SdrGrafPrimitive2D&)rPrimitive;
diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
index ce9f40037c..7f59e8be96 100644
--- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
@@ -40,6 +40,7 @@
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -85,7 +86,7 @@ namespace drawinglayer
return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, &aLineStartEnd);
}
- Primitive2DSequence SdrMeasurePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
+ Primitive2DSequence SdrMeasurePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
SdrBlockTextPrimitive2D* pBlockText = 0L;
@@ -97,10 +98,8 @@ namespace drawinglayer
const double fAngle(atan2(aLine.getY(), aLine.getX()));
bool bAutoUpsideDown(false);
const attribute::SdrTextAttribute* pTextAttribute = getSdrLSTAttribute().getText();
-
- basegfx::B2DHomMatrix aObjectMatrix;
- aObjectMatrix.rotate(fAngle);
- aObjectMatrix.translate(getStart().getX(), getStart().getY());
+ const basegfx::B2DHomMatrix aObjectMatrix(
+ basegfx::tools::createShearXRotateTranslateB2DHomMatrix(0.0, fAngle, getStart()));
if(pTextAttribute)
{
@@ -430,7 +429,7 @@ namespace drawinglayer
// apply to existing text primitive
SdrTextPrimitive2D* pNewBlockText = pBlockText->createTransformedClone(aChange);
- OSL_ENSURE(pNewBlockText, "SdrMeasurePrimitive2D::createLocalDecomposition: Could not create transformed clone of text primitive (!)");
+ OSL_ENSURE(pNewBlockText, "SdrMeasurePrimitive2D::create2DDecomposition: Could not create transformed clone of text primitive (!)");
delete pBlockText;
// add to local primitives
@@ -460,7 +459,7 @@ namespace drawinglayer
bool bBelow,
bool bTextRotation,
bool bTextAutoAngle)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maSdrLSTAttribute(rSdrLSTAttribute),
maStart(rStart),
maEnd(rEnd),
@@ -479,7 +478,7 @@ namespace drawinglayer
bool SdrMeasurePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const SdrMeasurePrimitive2D& rCompare = (SdrMeasurePrimitive2D&)rPrimitive;
diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
index 1f4d48ea0a..5a7d327cd9 100644
--- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
@@ -46,9 +46,37 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence SdrOle2Primitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
+ SdrOle2Primitive2D::SdrOle2Primitive2D(
+ const Primitive2DSequence& rOLEContent,
+ const basegfx::B2DHomMatrix& rTransform,
+ const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute)
+ : BasePrimitive2D(),
+ maOLEContent(rOLEContent),
+ maTransform(rTransform),
+ maSdrLFSTAttribute(rSdrLFSTAttribute)
+ {
+ }
+
+ bool SdrOle2Primitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const SdrOle2Primitive2D& rCompare = (SdrOle2Primitive2D&)rPrimitive;
+
+ if(getOLEContent() == rCompare.getOLEContent()
+ && getTransform() == rCompare.getTransform()
+ && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute())
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ Primitive2DSequence SdrOle2Primitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
- // to take care of getSdrLFSTAttribute() later, the same as in SdrGrafPrimitive2D::createLocalDecomposition
+ // to take care of getSdrLFSTAttribute() later, the same as in SdrGrafPrimitive2D::create2DDecomposition
// should happen. For the moment we only need the OLE itself
// Added complete primitive preparation using getSdrLFSTAttribute() now. To not do stuff which is not needed now, it
// may be supressed by using a static bool. The paint version only supported text.
@@ -104,7 +132,7 @@ namespace drawinglayer
}
// add graphic content
- appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, getChildren());
+ appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, getOLEContent());
// add text, no need to supress to stay compatible since text was
// always supported by the old paints, too
@@ -122,32 +150,6 @@ namespace drawinglayer
return aRetval;
}
- SdrOle2Primitive2D::SdrOle2Primitive2D(
- const Primitive2DSequence& rChildren,
- const ::basegfx::B2DHomMatrix& rTransform,
- const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute)
- : GroupPrimitive2D(rChildren),
- maTransform(rTransform),
- maSdrLFSTAttribute(rSdrLFSTAttribute)
- {
- }
-
- bool SdrOle2Primitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(GroupPrimitive2D::operator==(rPrimitive))
- {
- const SdrOle2Primitive2D& rCompare = (SdrOle2Primitive2D&)rPrimitive;
-
- if(getTransform() == rCompare.getTransform()
- && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute())
- {
- return true;
- }
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(SdrOle2Primitive2D, PRIMITIVE2D_ID_SDROLE2PRIMITIVE2D)
diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
index 164e122e67..cb871d0949 100644
--- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
@@ -39,6 +39,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -46,7 +47,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence SdrOleContentPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
+ Primitive2DSequence SdrOleContentPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
const SdrOle2Obj* pSource = (mpSdrOle2Obj.is() ? static_cast< SdrOle2Obj* >(mpSdrOle2Obj.get()) : 0);
@@ -105,13 +106,10 @@ namespace drawinglayer
if(basegfx::fTools::moreOrEqual(fOffsetX, 0.0) && basegfx::fTools::moreOrEqual(fOffsetY, 0.0))
{
// if content fits into frame, create it
- basegfx::B2DHomMatrix aInnerObjectMatrix;
-
- aInnerObjectMatrix.scale(aPrefSize.getWidth(), aPrefSize.getHeight());
- aInnerObjectMatrix.translate(fOffsetX, fOffsetY);
- aInnerObjectMatrix.shearX(fShearX);
- aInnerObjectMatrix.rotate(fRotate);
- aInnerObjectMatrix.translate(aTranslate.getX(), aTranslate.getY());
+ basegfx::B2DHomMatrix aInnerObjectMatrix(basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aPrefSize.getWidth(), aPrefSize.getHeight(), fOffsetX, fOffsetY));
+ aInnerObjectMatrix = basegfx::tools::createShearXRotateTranslateB2DHomMatrix(fShearX, fRotate, aTranslate)
+ * aInnerObjectMatrix;
const drawinglayer::primitive2d::Primitive2DReference aGraphicPrimitive(
new drawinglayer::primitive2d::GraphicPrimitive2D(
@@ -159,7 +157,7 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& rObjectTransform,
sal_uInt32 nGraphicVersion,
bool bHighContrast)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
mpSdrOle2Obj(const_cast< SdrOle2Obj* >(&rSdrOle2Obj)),
maObjectTransform(rObjectTransform),
mnGraphicVersion(nGraphicVersion),
@@ -169,7 +167,7 @@ namespace drawinglayer
bool SdrOleContentPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const SdrOleContentPrimitive2D& rCompare = (SdrOleContentPrimitive2D&)rPrimitive;
const bool bBothNot(!mpSdrOle2Obj.is() && !rCompare.mpSdrOle2Obj.is());
diff --git a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
index 128a450ee2..e19bc75fd6 100644
--- a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
@@ -47,7 +47,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence SdrPathPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
+ Primitive2DSequence SdrPathPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
@@ -105,7 +105,7 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
const basegfx::B2DPolyPolygon& rUnitPolyPolygon)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maTransform(rTransform),
maSdrLFSTAttribute(rSdrLFSTAttribute),
maUnitPolyPolygon(rUnitPolyPolygon)
@@ -114,7 +114,7 @@ namespace drawinglayer
bool SdrPathPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const SdrPathPrimitive2D& rCompare = (SdrPathPrimitive2D&)rPrimitive;
diff --git a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
index 6449859318..1e963e3244 100644
--- a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
@@ -47,7 +47,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence SdrRectanglePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
+ Primitive2DSequence SdrRectanglePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
Primitive2DSequence aHitTestContent;
@@ -128,7 +128,7 @@ namespace drawinglayer
double fCornerRadiusX,
double fCornerRadiusY,
bool bForceFillForHitTest)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maTransform(rTransform),
maSdrLFSTAttribute(rSdrLFSTAttribute),
mfCornerRadiusX(fCornerRadiusX),
@@ -139,7 +139,7 @@ namespace drawinglayer
bool SdrRectanglePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const SdrRectanglePrimitive2D& rCompare = (SdrRectanglePrimitive2D&)rPrimitive;
diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
index bd8547c8b8..ef716c25d3 100644
--- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
@@ -109,7 +109,7 @@ namespace drawinglayer
SdrTextPrimitive2D::SdrTextPrimitive2D(
const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObject)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
mrSdrText(const_cast< SdrText* >(pSdrText)),
maOutlinerParaObject(rOutlinerParaObject),
mxLastVisualizingPage(),
@@ -132,7 +132,7 @@ namespace drawinglayer
bool SdrTextPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const SdrTextPrimitive2D& rCompare = (SdrTextPrimitive2D&)rPrimitive;
@@ -157,7 +157,7 @@ namespace drawinglayer
sal_Int16 nCurrentlyValidPageNumber(0);
sal_Int16 nCurrentlyValidPageCount(0);
- if(getLocalDecomposition().hasElements())
+ if(getBuffered2DDecomposition().hasElements())
{
bool bDoDelete(false);
@@ -211,11 +211,11 @@ namespace drawinglayer
if(bDoDelete)
{
- const_cast< SdrTextPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ const_cast< SdrTextPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence());
}
}
- if(!getLocalDecomposition().hasElements())
+ if(!getBuffered2DDecomposition().hasElements())
{
if(!bCurrentlyVisualizingPageIsSet && mbContainsPageField)
{
@@ -245,7 +245,7 @@ namespace drawinglayer
}
// call parent
- return BasePrimitive2D::get2DDecomposition(rViewInformation);
+ return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation);
}
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -256,7 +256,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence SdrContourTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
+ Primitive2DSequence SdrContourTextPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
getSdrText()->GetObject().impDecomposeContourTextPrimitive(aRetval, *this, aViewInformation);
@@ -309,7 +309,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence SdrPathTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
+ Primitive2DSequence SdrPathTextPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
getSdrText()->GetObject().impDecomposePathTextPrimitive(aRetval, *this, aViewInformation);
@@ -365,7 +365,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence SdrBlockTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
+ Primitive2DSequence SdrBlockTextPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
getSdrText()->GetObject().impDecomposeBlockTextPrimitive(aRetval, *this, aViewInformation);
@@ -442,7 +442,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence SdrStretchTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
+ Primitive2DSequence SdrStretchTextPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
getSdrText()->GetObject().impDecomposeStretchTextPrimitive(aRetval, *this, aViewInformation);