summaryrefslogtreecommitdiff
path: root/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
diff options
context:
space:
mode:
authorRelease Engineers <releng@openoffice.org>2009-08-26 14:41:39 +0000
committerRelease Engineers <releng@openoffice.org>2009-08-26 14:41:39 +0000
commit05a1a258cf2aab6e33750ff2c00bcd8827348146 (patch)
treea0006d6e0aa3d1b12bd2f61dffd5e5c0300d9b19 /svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
parentfcf4f2dbc83a61a1747f5ee95f0470dbb5a7d0a8 (diff)
CWS-TOOLING: integrate CWS aw075
2009-08-12 18:26:05 +0200 aw r274912 : #i97672# use SelectionMaximumLuminancePercent to limit the hilight color to be not too invisible 2009-08-12 18:25:53 +0200 aw r274911 : #i97672# use SelectionMaximumLuminancePercent to limit the hilight color to be not too invisible 2009-08-12 18:25:20 +0200 aw r274910 : #i97672# Added SelectionMaximumLuminancePercent to decide which maximum luminance for the selection color to accept from the system 2009-08-12 18:00:17 +0200 aw r274908 : #i97672# added SelectionMaximumLuminancePercent which limits the luminance of the system's selection color to a maximum luminance (default is 70) 2009-08-11 14:01:07 +0200 aw r274859 : #i104150# take over values from transparence percent field even when disabled 2009-08-11 13:59:33 +0200 aw r274858 : #i103500# corrected the transparent SC overlay pixel alignment 2009-08-11 12:42:46 +0200 jsk r274854 : #i103937# Added two new controls to options/view page for transparency and opacity 2009-08-10 16:20:02 +0200 aw r274823 : #i97672# Adapting MF_SELECTION to #i35956# 2009-08-04 17:50:42 +0200 aw r274626 : #i102109# need to use AlphaMask instead of Bitmap 2009-08-04 17:03:25 +0200 aw r274624 : #i103982# corrected OutlinerParaObject owvership in GetBackgroundTextForwarder() 2009-08-04 12:18:11 +0200 aw r274614 : #i97672# corrected warning due to member initialisation 2009-08-03 11:54:16 +0200 aw r274571 : #i99268# corrected SdrExchangeView::GetObjGraphic 2009-07-31 14:22:57 +0200 aw r274529 : #i101520# added support for not correct 3d polygons for 3D polygon object which is used over API from chart directly 2009-07-31 13:25:20 +0200 aw r274527 : #i97672# added disabling selection options when system does not support them; slightly corrected positions 2009-07-31 13:20:32 +0200 aw r274526 : #i102706# Do not merge closed polygons when converting MetaFiles to SdrObjects 2009-07-30 18:03:07 +0200 aw r274499 : #i102175# corrected 1870 degree rotation situation for MetaFile paints 2009-07-30 17:06:31 +0200 aw r274496 : #i103709# corrected HitTest for callouts and DrawingLayer text objects 2009-07-29 18:55:22 +0200 aw r274465 : #i102956# corrected CutFindProcessor to back-transform all found cuts to the starting 3D coordinate system 2009-07-29 13:38:40 +0200 aw r274448 : #i103720# corrected mpAsynchLoadEvent usage 2009-07-29 12:48:12 +0200 aw r274447 : #i96762# cleanup: spaces 2009-07-28 19:11:31 +0200 aw r274427 : #97672# first version of reworked selection with changeable transparency and frame 2009-07-28 19:09:39 +0200 aw r274425 : #97672# first version of reworked selection with changeable transparency and frame 2009-07-28 19:09:27 +0200 aw r274424 : #97672# first version of reworked selection with changeable transparency and frame 2009-07-28 19:09:14 +0200 aw r274423 : #97672# first version of reworked selection with changeable transparency and frame 2009-07-28 19:08:59 +0200 aw r274422 : #97672# first version of reworked selection with changeable transparency and frame 2009-07-28 19:08:47 +0200 aw r274421 : #97672# first version of reworked selection with changeable transparency and frame 2009-07-28 15:44:50 +0200 aw r274411 : #i102556# corrected TextLayouterDevice::getTextBoundRect implementation and usage; empty Rectangles were not handled correctly 2009-07-23 17:48:36 +0200 aw r274277 : #i102063# implemented in-between OLE content holder (SdrOleContentPrimitive2D) and it's decomposition. Cleaned up diverse OLE graphic preparations 2009-07-22 12:55:12 +0200 aw r274227 : #i102109# extended OutputDevice::DrawTransparent (the version with TransparenceGradient) to work correctly with AntiAliased content 2009-07-21 13:31:12 +0200 aw r274191 : #i102611# changed scaling of Z-Range for Z-Buffer for ZBufferProcessor3D 2009-07-20 20:06:46 +0200 aw r274155 : #i103500# moved OverlayObjectCell back to use discrete coordinates for rectangle list 2009-07-16 17:33:26 +0200 aw r274065 : #i103530# corrected parameter preparation for MetaFile::Rotate call
Diffstat (limited to 'svx/source/sdr/primitive2d/sdrdecompositiontools.cxx')
-rw-r--r--svx/source/sdr/primitive2d/sdrdecompositiontools.cxx105
1 files changed, 56 insertions, 49 deletions
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 366b934b5473..9666bd2c1ac1 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -67,13 +67,13 @@ namespace drawinglayer
namespace primitive2d
{
Primitive2DReference createPolyPolygonFillPrimitive(
- const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon,
- const ::basegfx::B2DHomMatrix& rObjectTransform,
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrFillAttribute& rFill,
const attribute::FillGradientAttribute* pFillGradient)
{
// prepare fully scaled polygon
- ::basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
+ basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
aScaledPolyPolygon.transform(rObjectTransform);
BasePrimitive2D* pNewFillPrimitive = 0L;
@@ -87,7 +87,7 @@ namespace drawinglayer
}
else if(rFill.isBitmap())
{
- const ::basegfx::B2DRange aRange(::basegfx::tools::getRange(aScaledPolyPolygon));
+ const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon));
pNewFillPrimitive = new PolyPolygonBitmapPrimitive2D(aScaledPolyPolygon, rFill.getColor(), rFill.getBitmap()->getFillBitmapAttribute(aRange));
}
else
@@ -110,7 +110,7 @@ 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 basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon));
const Primitive2DReference xRefB(new FillGradientPrimitive2D(aRange, *pFillGradient));
const Primitive2DSequence aAlpha(&xRefB, 1L);
@@ -125,13 +125,13 @@ namespace drawinglayer
}
Primitive2DReference createPolygonLinePrimitive(
- const ::basegfx::B2DPolygon& rUnitPolygon,
- const ::basegfx::B2DHomMatrix& rObjectTransform,
+ const basegfx::B2DPolygon& rUnitPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrLineAttribute& rLine,
const attribute::SdrLineStartEndAttribute* pStroke)
{
// prepare fully scaled polygon
- ::basegfx::B2DPolygon aScaledPolygon(rUnitPolygon);
+ basegfx::B2DPolygon aScaledPolygon(rUnitPolygon);
aScaledPolygon.transform(rObjectTransform);
// create line and stroke attribute
@@ -168,14 +168,14 @@ namespace drawinglayer
}
Primitive2DReference createTextPrimitive(
- const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon,
- const ::basegfx::B2DHomMatrix& rObjectTransform,
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrTextAttribute& rText,
const attribute::SdrLineAttribute* pStroke,
bool bCellText,
bool bWordWrap)
{
- ::basegfx::B2DHomMatrix aAnchorTransform(rObjectTransform);
+ basegfx::B2DHomMatrix aAnchorTransform(rObjectTransform);
SdrTextPrimitive2D* pNew = 0;
if(rText.isContour())
@@ -185,20 +185,20 @@ namespace drawinglayer
{
// take line width into account and shrink contour polygon accordingly
// decompose to get scale
- ::basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale, aTranslate;
double fRotate, fShearX;
rObjectTransform.decompose(aScale, aTranslate, fRotate, fShearX);
// scale outline to object's size to allow growing with value relative to that size
// and also to keep aspect ratio
- ::basegfx::B2DHomMatrix aScaleTransform;
+ basegfx::B2DHomMatrix aScaleTransform;
aScaleTransform.set(0, 0, fabs(aScale.getX()));
aScaleTransform.set(1, 1, fabs(aScale.getY()));
- ::basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon);
+ basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon);
aScaledUnitPolyPolygon.transform(aScaleTransform);
// grow the polygon. To shrink, use negative value (half width)
- aScaledUnitPolyPolygon = ::basegfx::tools::growInNormalDirection(aScaledUnitPolyPolygon, -(pStroke->getWidth() * 0.5));
+ 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);
@@ -225,7 +225,7 @@ namespace drawinglayer
else if(rText.getSdrFormTextAttribute())
{
// text on path, use scaled polygon
- ::basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
+ basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
aScaledPolyPolygon.transform(rObjectTransform);
pNew = new SdrPathTextPrimitive2D(
&rText.getSdrText(),
@@ -237,29 +237,29 @@ namespace drawinglayer
{
// rObjectTransform is the whole SdrObject transformation from unit rectangle
// to it's size and position. Decompose to allow working with single values.
- ::basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale, aTranslate;
double fRotate, fShearX;
rObjectTransform.decompose(aScale, aTranslate, fRotate, fShearX);
// extract mirroring
- const bool bMirrorX(::basegfx::fTools::less(aScale.getX(), 0.0));
- const bool bMirrorY(::basegfx::fTools::less(aScale.getY(), 0.0));
+ const bool bMirrorX(basegfx::fTools::less(aScale.getX(), 0.0));
+ const bool bMirrorY(basegfx::fTools::less(aScale.getY(), 0.0));
aScale = basegfx::absolute(aScale);
// Get the real size, since polygon ountline and scale
// from the object transformation may vary (e.g. ellipse segments)
- ::basegfx::B2DHomMatrix aJustScaleTransform;
+ basegfx::B2DHomMatrix aJustScaleTransform;
aJustScaleTransform.set(0, 0, aScale.getX());
aJustScaleTransform.set(1, 1, aScale.getY());
- ::basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon);
+ basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon);
aScaledUnitPolyPolygon.transform(aJustScaleTransform);
- const ::basegfx::B2DRange aSnapRange(::basegfx::tools::getRange(aScaledUnitPolyPolygon));
+ const basegfx::B2DRange aSnapRange(basegfx::tools::getRange(aScaledUnitPolyPolygon));
// create a range describing the wanted text position and size (aTextAnchorRange). This
// means to use the text distance values here
- const ::basegfx::B2DPoint aTopLeft(aSnapRange.getMinX() + rText.getTextLeftDistance(), aSnapRange.getMinY() + rText.getTextUpperDistance());
- const ::basegfx::B2DPoint aBottomRight(aSnapRange.getMaxX() - rText.getTextRightDistance(), aSnapRange.getMaxY() - rText.getTextLowerDistance());
- ::basegfx::B2DRange aTextAnchorRange;
+ const basegfx::B2DPoint aTopLeft(aSnapRange.getMinX() + rText.getTextLeftDistance(), aSnapRange.getMinY() + rText.getTextUpperDistance());
+ const basegfx::B2DPoint aBottomRight(aSnapRange.getMaxX() - rText.getTextRightDistance(), aSnapRange.getMaxY() - rText.getTextLowerDistance());
+ basegfx::B2DRange aTextAnchorRange;
aTextAnchorRange.expand(aTopLeft);
aTextAnchorRange.expand(aBottomRight);
@@ -331,16 +331,16 @@ namespace drawinglayer
const bool bHorizontal(SDRTEXTANI_LEFT == eDirection || SDRTEXTANI_RIGHT == eDirection);
// decompose to get separated values for the scroll box
- ::basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale, aTranslate;
double fRotate, fShearX;
aAnchorTransform.decompose(aScale, aTranslate, fRotate, fShearX);
// build transform from scaled only to full AnchorTransform and inverse
- ::basegfx::B2DHomMatrix aSRT;
+ basegfx::B2DHomMatrix aSRT;
aSRT.shearX(fShearX);
aSRT.rotate(fRotate);
aSRT.translate(aTranslate.getX(), aTranslate.getY());
- ::basegfx::B2DHomMatrix aISRT(aSRT);
+ basegfx::B2DHomMatrix aISRT(aSRT);
aISRT.invert();
// bring the primitive back to scaled only and get scaled range, create new clone for this
@@ -355,13 +355,13 @@ namespace drawinglayer
geometry::ViewInformation2D aViewInformation2D(xViewParameters);
// get range
- const ::basegfx::B2DRange aScaledRange(pNew->getB2DRange(aViewInformation2D));
+ const basegfx::B2DRange aScaledRange(pNew->getB2DRange(aViewInformation2D));
// create left outside and right outside transformations. Also take care
// of the clip rectangle
- ::basegfx::B2DHomMatrix aLeft, aRight;
- ::basegfx::B2DPoint aClipTopLeft(0.0, 0.0);
- ::basegfx::B2DPoint aClipBottomRight(aScale.getX(), aScale.getY());
+ basegfx::B2DHomMatrix aLeft, aRight;
+ basegfx::B2DPoint aClipTopLeft(0.0, 0.0);
+ basegfx::B2DPoint aClipBottomRight(aScale.getX(), aScale.getY());
if(bHorizontal)
{
@@ -410,10 +410,10 @@ namespace drawinglayer
const Primitive2DSequence aContent(&xRefA, 1L);
// scrolling needs an encapsulating clipping primitive
- const ::basegfx::B2DRange aClipRange(aClipTopLeft, aClipBottomRight);
- ::basegfx::B2DPolygon aClipPolygon(::basegfx::tools::createPolygonFromRect(aClipRange));
+ const basegfx::B2DRange aClipRange(aClipTopLeft, aClipBottomRight);
+ basegfx::B2DPolygon aClipPolygon(basegfx::tools::createPolygonFromRect(aClipRange));
aClipPolygon.transform(aSRT);
- return Primitive2DReference(new MaskPrimitive2D(::basegfx::B2DPolyPolygon(aClipPolygon), aContent));
+ return Primitive2DReference(new MaskPrimitive2D(basegfx::B2DPolyPolygon(aClipPolygon), aContent));
}
else
{
@@ -441,36 +441,43 @@ namespace drawinglayer
}
}
- Primitive2DReference createShadowPrimitive(
- const Primitive2DSequence& rSource,
+ Primitive2DSequence createEmbeddedShadowPrimitive(
+ const Primitive2DSequence& rContent,
const attribute::SdrShadowAttribute& rShadow)
{
- // create Shadow primitives. Need to be added in front, should use already created primitives
- if(rSource.hasElements())
+ if(rContent.hasElements())
{
+ Primitive2DSequence aRetval(2);
+ basegfx::B2DHomMatrix aShadowOffset;
+
// prepare shadow offset
- ::basegfx::B2DHomMatrix aShadowOffset;
aShadowOffset.set(0, 2, rShadow.getOffset().getX());
aShadowOffset.set(1, 2, rShadow.getOffset().getY());
// create shadow primitive and add content
- const Primitive2DReference xRefShadow(new ShadowPrimitive2D(aShadowOffset, rShadow.getColor(), rSource));
+ aRetval[0] = Primitive2DReference(
+ new ShadowPrimitive2D(
+ aShadowOffset,
+ rShadow.getColor(),
+ rContent));
if(0.0 != rShadow.getTransparence())
{
// create SimpleTransparencePrimitive2D
- const Primitive2DSequence aContent(&xRefShadow, 1L);
- return Primitive2DReference(new UnifiedAlphaPrimitive2D(aContent, rShadow.getTransparence()));
- }
- else
- {
- // return directly
- return xRefShadow;
+ const Primitive2DSequence aTempContent(&aRetval[0], 1);
+
+ aRetval[0] = Primitive2DReference(
+ new UnifiedAlphaPrimitive2D(
+ aTempContent,
+ rShadow.getTransparence()));
}
+
+ aRetval[1] = Primitive2DReference(new GroupPrimitive2D(rContent));
+ return aRetval;
}
else
{
- return Primitive2DReference();
+ return rContent;
}
}
} // end of namespace primitive2d