summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-01-29 12:32:36 +0000
committerArmin Le Grand <alg@apache.org>2013-01-29 12:32:36 +0000
commitc6e63b6bbb6b4a63fe1302de57fc32cd28432378 (patch)
treeadbf342f9cc48fb8fc8db74d609efb9eb9600c36 /svx/source
parent8483543d9db7010a9fe80b815e8957640d190814 (diff)
#121532# enhanced visualisation of text edut&selection, D&D overhauled
Notes
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/engine3d/dragmt3d.cxx3
-rw-r--r--svx/source/engine3d/view3d.cxx3
-rw-r--r--svx/source/sdr/overlay/overlayanimatedbitmapex.cxx17
-rw-r--r--svx/source/sdr/overlay/overlayhatchrect.cxx90
-rw-r--r--svx/source/sdr/overlay/overlaymanager.cxx10
-rw-r--r--svx/source/sdr/overlay/overlayobject.cxx14
-rw-r--r--svx/source/sdr/overlay/overlaypolypolygon.cxx39
-rw-r--r--svx/source/sdr/overlay/overlayrectangle.cxx159
-rw-r--r--svx/source/sdr/overlay/overlayrollingrectangle.cxx26
-rw-r--r--svx/source/sdr/overlay/overlaytools.cxx118
-rw-r--r--svx/source/svdraw/svdcrtv.cxx9
-rw-r--r--svx/source/svdraw/svddrgmt.cxx23
-rw-r--r--svx/source/svdraw/svdedxv.cxx84
-rw-r--r--svx/source/svdraw/svdhdl.cxx21
-rw-r--r--svx/source/svdraw/svdobj.cxx54
-rw-r--r--svx/source/svdraw/svdview.cxx51
-rw-r--r--svx/source/table/svdotable.cxx2
-rw-r--r--svx/source/table/tablehandles.cxx31
-rw-r--r--svx/source/table/tablehandles.hxx8
19 files changed, 475 insertions, 287 deletions
diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx
index 6b703cdb4196..efd7671c3fec 100644
--- a/svx/source/engine3d/dragmt3d.cxx
+++ b/svx/source/engine3d/dragmt3d.cxx
@@ -300,7 +300,8 @@ void E3dDragMethod::CreateOverlayGeometry(::sdr::overlay::OverlayManager& rOverl
if(aResult.count())
{
- ::sdr::overlay::OverlayPolyPolygonStriped* pNew = new ::sdr::overlay::OverlayPolyPolygonStriped(aResult);
+ ::sdr::overlay::OverlayPolyPolygonStripedAndFilled* pNew = new ::sdr::overlay::OverlayPolyPolygonStripedAndFilled(
+ aResult);
rOverlayManager.add(*pNew);
addToOverlayObjectList(*pNew);
}
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index 6f864680c067..f7893de4ad28 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -219,7 +219,8 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr
basegfx::B2DPolyPolygon aPolyPolygon(mpPolygons[b]);
aPolyPolygon.transform(aMatrixTransform);
- ::sdr::overlay::OverlayPolyPolygonStriped* pNew = new ::sdr::overlay::OverlayPolyPolygonStriped(aPolyPolygon);
+ ::sdr::overlay::OverlayPolyPolygonStripedAndFilled* pNew = new ::sdr::overlay::OverlayPolyPolygonStripedAndFilled(
+ aPolyPolygon);
pTargetOverlay->add(*pNew);
maObjects.append(*pNew);
}
diff --git a/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx b/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx
index 8397799c4e60..89e8431571a1 100644
--- a/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx
+++ b/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx
@@ -36,19 +36,6 @@ namespace sdr
{
namespace overlay
{
- // #i53216# check blink time value range
- void OverlayAnimatedBitmapEx::impCheckBlinkTimeValueRange()
- {
- if(mnBlinkTime < 25)
- {
- mnBlinkTime = 25;
- }
- else if(mnBlinkTime > 10000)
- {
- mnBlinkTime = 10000;
- }
- }
-
drawinglayer::primitive2d::Primitive2DSequence OverlayAnimatedBitmapEx::createOverlayObjectPrimitive2DSequence()
{
if(mbOverlayState)
@@ -96,7 +83,7 @@ namespace sdr
mbAllowsAnimation = true;
// #i53216# check blink time value range
- impCheckBlinkTimeValueRange();
+ mnBlinkTime = impCheckBlinkTimeValueRange(mnBlinkTime);
}
OverlayAnimatedBitmapEx::~OverlayAnimatedBitmapEx()
@@ -175,7 +162,7 @@ namespace sdr
mnBlinkTime = nNew;
// #i53216# check blink time value range
- impCheckBlinkTimeValueRange();
+ mnBlinkTime = impCheckBlinkTimeValueRange(mnBlinkTime);
// register change (after change)
objectChange();
diff --git a/svx/source/sdr/overlay/overlayhatchrect.cxx b/svx/source/sdr/overlay/overlayhatchrect.cxx
deleted file mode 100644
index b99d3c7ccb18..000000000000
--- a/svx/source/sdr/overlay/overlayhatchrect.cxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#include <svx/sdr/overlay/overlayhatchrect.hxx>
-#include <vcl/hatch.hxx>
-#include <vcl/outdev.hxx>
-#include <basegfx/matrix/b2dhommatrix.hxx>
-#include <basegfx/polygon/b2dpolygontools.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
-#include <basegfx/numeric/ftools.hxx>
-#include <svx/sdr/overlay/overlaytools.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- drawinglayer::primitive2d::Primitive2DSequence OverlayHatchRect::createOverlayObjectPrimitive2DSequence()
- {
- const basegfx::B2DRange aHatchRange(getBasePosition(), getSecondPosition());
- const drawinglayer::primitive2d::Primitive2DReference aReference(
- new drawinglayer::primitive2d::OverlayHatchRectanglePrimitive(
- aHatchRange,
- 3.0,
- getHatchRotation(),
- getBaseColor().getBColor(),
- getDiscreteGrow(),
- getDiscreteShrink(),
- getRotation()));
-
- return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
- }
-
- OverlayHatchRect::OverlayHatchRect(
- const basegfx::B2DPoint& rBasePosition,
- const basegfx::B2DPoint& rSecondPosition,
- const Color& rHatchColor,
- double fDiscreteGrow,
- double fDiscreteShrink,
- double fHatchRotation,
- double fRotation)
- : OverlayObjectWithBasePosition(rBasePosition, rHatchColor),
- maSecondPosition(rSecondPosition),
- mfDiscreteGrow(fDiscreteGrow),
- mfDiscreteShrink(fDiscreteShrink),
- mfHatchRotation(fHatchRotation),
- mfRotation(fRotation)
- {
- }
-
- void OverlayHatchRect::setSecondPosition(const basegfx::B2DPoint& rNew)
- {
- if(rNew != maSecondPosition)
- {
- // remember new value
- maSecondPosition = rNew;
-
- // register change (after change)
- objectChange();
- }
- }
- } // end of namespace overlay
-} // end of namespace sdr
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx
index 670fe7630353..7317765e0de8 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -157,8 +157,14 @@ namespace sdr
if(OUTDEV_WINDOW == getOutputDevice().GetOutDevType())
{
const Size aOutputSizePixel(getOutputDevice().GetOutputSizePixel());
- aViewRange = basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight());
- aViewRange.transform(getOutputDevice().GetInverseViewTransformation());
+
+ // only set when we *have* a output size, else let aViewRange
+ // stay on empty
+ if(aOutputSizePixel.Width() && aOutputSizePixel.Height())
+ {
+ aViewRange = basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight());
+ aViewRange.transform(getOutputDevice().GetInverseViewTransformation());
+ }
}
OverlayManager* pThis = const_cast< OverlayManager* >(this);
diff --git a/svx/source/sdr/overlay/overlayobject.cxx b/svx/source/sdr/overlay/overlayobject.cxx
index 2c46a13e23f0..abe134a7c891 100644
--- a/svx/source/sdr/overlay/overlayobject.cxx
+++ b/svx/source/sdr/overlay/overlayobject.cxx
@@ -72,6 +72,20 @@ namespace sdr
return drawinglayer::primitive2d::Primitive2DSequence();
}
+ sal_uInt32 OverlayObject::impCheckBlinkTimeValueRange(sal_uInt32 nBlinkTime) const
+ {
+ if(nBlinkTime < 25)
+ {
+ nBlinkTime = 25;
+ }
+ else if(nBlinkTime > 10000)
+ {
+ nBlinkTime = 10000;
+ }
+
+ return nBlinkTime;
+ }
+
void OverlayObject::allowAntiAliase(bool bNew)
{
if(bNew != (bool)mbAllowsAntiAliase)
diff --git a/svx/source/sdr/overlay/overlaypolypolygon.cxx b/svx/source/sdr/overlay/overlaypolypolygon.cxx
index c9024a5d2cec..9c1940e334ac 100644
--- a/svx/source/sdr/overlay/overlaypolypolygon.cxx
+++ b/svx/source/sdr/overlay/overlaypolypolygon.cxx
@@ -37,7 +37,7 @@ namespace sdr
{
namespace overlay
{
- drawinglayer::primitive2d::Primitive2DSequence OverlayPolyPolygonStriped::createOverlayObjectPrimitive2DSequence()
+ drawinglayer::primitive2d::Primitive2DSequence OverlayPolyPolygonStripedAndFilled::createOverlayObjectPrimitive2DSequence()
{
drawinglayer::primitive2d::Primitive2DSequence aRetval;
@@ -46,43 +46,56 @@ namespace sdr
const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
-
- const drawinglayer::primitive2d::Primitive2DReference aReference(
+ const drawinglayer::primitive2d::Primitive2DReference aStriped(
new drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D(
- getPolyPolygon(),
+ getLinePolyPolygon(),
aRGBColorA,
aRGBColorB,
fStripeLengthPixel));
- aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aStriped, 1);
+
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+ const basegfx::BColor aHilightColor(aSvtOptionsDrawinglayer.getHilightColor().getBColor());
+ const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
+
+ const drawinglayer::primitive2d::Primitive2DReference aFilled(
+ new drawinglayer::primitive2d::PolyPolygonSelectionPrimitive2D(
+ getLinePolyPolygon(),
+ aHilightColor,
+ fTransparence,
+ 3.0,
+ false));
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aFilled);
}
return aRetval;
}
- void OverlayPolyPolygonStriped::stripeDefinitionHasChanged()
+ void OverlayPolyPolygonStripedAndFilled::stripeDefinitionHasChanged()
{
// react on OverlayManager's stripe definition change
objectChange();
}
- OverlayPolyPolygonStriped::OverlayPolyPolygonStriped(
- const basegfx::B2DPolyPolygon& rPolyPolygon)
+ OverlayPolyPolygonStripedAndFilled::OverlayPolyPolygonStripedAndFilled(
+ const basegfx::B2DPolyPolygon& rLinePolyPolygon)
: OverlayObject(Color(COL_BLACK)),
- maPolyPolygon(rPolyPolygon)
+ maLinePolyPolygon(rLinePolyPolygon)
{
}
- OverlayPolyPolygonStriped::~OverlayPolyPolygonStriped()
+ OverlayPolyPolygonStripedAndFilled::~OverlayPolyPolygonStripedAndFilled()
{
}
- void OverlayPolyPolygonStriped::setPolyPolygon(const basegfx::B2DPolyPolygon& rNew)
+ void OverlayPolyPolygonStripedAndFilled::setLinePolyPolygon(const basegfx::B2DPolyPolygon& rNew)
{
- if(rNew != maPolyPolygon)
+ if(rNew != maLinePolyPolygon)
{
// remember new value
- maPolyPolygon = rNew;
+ maLinePolyPolygon = rNew;
// register change (after change)
objectChange();
diff --git a/svx/source/sdr/overlay/overlayrectangle.cxx b/svx/source/sdr/overlay/overlayrectangle.cxx
new file mode 100644
index 000000000000..f22359013639
--- /dev/null
+++ b/svx/source/sdr/overlay/overlayrectangle.cxx
@@ -0,0 +1,159 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+
+#include <svx/sdr/overlay/overlayrectangle.hxx>
+#include <vcl/outdev.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/numeric/ftools.hxx>
+#include <svx/sdr/overlay/overlaytools.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
+#include <vcl/svapp.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ drawinglayer::primitive2d::Primitive2DSequence OverlayRectangle::createOverlayObjectPrimitive2DSequence()
+ {
+ const basegfx::B2DRange aHatchRange(getBasePosition(), getSecondPosition());
+ basegfx::BColor aColor(getBaseColor().getBColor());
+ static double fChange(0.1); // just small optical change, do not make it annoying
+
+ if(mbOverlayState)
+ {
+ aColor += basegfx::B3DTuple(fChange, fChange, fChange);
+ aColor.clamp();
+ }
+ else
+ {
+ aColor -= basegfx::B3DTuple(fChange, fChange, fChange);
+ aColor.clamp();
+ }
+
+ const drawinglayer::primitive2d::Primitive2DReference aReference(
+ new drawinglayer::primitive2d::OverlayRectanglePrimitive(
+ aHatchRange,
+ aColor,
+ getTransparence(),
+ getDiscreteGrow(),
+ getDiscreteShrink(),
+ getRotation()));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
+ }
+
+ OverlayRectangle::OverlayRectangle(
+ const basegfx::B2DPoint& rBasePosition,
+ const basegfx::B2DPoint& rSecondPosition,
+ const Color& rHatchColor,
+ double fTransparence,
+ double fDiscreteGrow,
+ double fDiscreteShrink,
+ double fRotation,
+ sal_uInt32 nBlinkTime,
+ bool bAnimate)
+ : OverlayObjectWithBasePosition(rBasePosition, rHatchColor),
+ maSecondPosition(rSecondPosition),
+ mfTransparence(fTransparence),
+ mfDiscreteGrow(fDiscreteGrow),
+ mfDiscreteShrink(fDiscreteShrink),
+ mfRotation(fRotation),
+ mnBlinkTime(nBlinkTime),
+ mbOverlayState(false)
+ {
+ if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
+ {
+ // no animation in high contrast mode
+ bAnimate = false;
+ }
+
+ // set AllowsAnimation flag to mark this object as animation capable
+ mbAllowsAnimation = bAnimate;
+
+ // #i53216# check blink time value range
+ mnBlinkTime = impCheckBlinkTimeValueRange(mnBlinkTime);
+ }
+
+ void OverlayRectangle::setSecondPosition(const basegfx::B2DPoint& rNew)
+ {
+ if(rNew != maSecondPosition)
+ {
+ // remember new value
+ maSecondPosition = rNew;
+
+ // register change (after change)
+ objectChange();
+ }
+ }
+
+ void OverlayRectangle::setBlinkTime(sal_uInt32 nNew)
+ {
+ if(mnBlinkTime != nNew)
+ {
+ // remember new value
+ mnBlinkTime = nNew;
+
+ // #i53216# check blink time value range
+ mnBlinkTime = impCheckBlinkTimeValueRange(mnBlinkTime);
+
+ // register change (after change)
+ objectChange();
+ }
+ }
+
+ void OverlayRectangle::Trigger(sal_uInt32 nTime)
+ {
+ if(getOverlayManager())
+ {
+ // #i53216# produce event after nTime + x
+ SetTime(nTime + mnBlinkTime);
+
+ // switch state
+ if(mbOverlayState)
+ {
+ mbOverlayState = false;
+ }
+ else
+ {
+ mbOverlayState = true;
+ }
+
+ // re-insert me as event
+ getOverlayManager()->InsertEvent(this);
+
+ // register change (after change)
+ objectChange();
+ }
+ }
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/overlay/overlayrollingrectangle.cxx b/svx/source/sdr/overlay/overlayrollingrectangle.cxx
index 173050c6708f..ce08e5af1de5 100644
--- a/svx/source/sdr/overlay/overlayrollingrectangle.cxx
+++ b/svx/source/sdr/overlay/overlayrollingrectangle.cxx
@@ -32,7 +32,7 @@
#include <svx/sdr/overlay/overlaymanager.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
-#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -55,14 +55,24 @@ namespace sdr
{
// view-independent part, create directly
const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(aRollingRectangle));
- const drawinglayer::primitive2d::Primitive2DReference aReference(
- new drawinglayer::primitive2d::PolygonMarkerPrimitive2D(
- aPolygon,
- aRGBColorA,
- aRGBColorB,
- fStripeLengthPixel));
- drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aReference);
+ aRetval.realloc(2);
+ aRetval[0] = new drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D(
+ basegfx::B2DPolyPolygon(aPolygon),
+ aRGBColorA,
+ aRGBColorB,
+ fStripeLengthPixel);
+
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+ const basegfx::BColor aHilightColor(aSvtOptionsDrawinglayer.getHilightColor().getBColor());
+ const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
+
+ aRetval[1] = new drawinglayer::primitive2d::PolyPolygonSelectionPrimitive2D(
+ basegfx::B2DPolyPolygon(aPolygon),
+ aHilightColor,
+ fTransparence,
+ 3.0,
+ false);
}
if(getExtendedLines())
diff --git a/svx/source/sdr/overlay/overlaytools.cxx b/svx/source/sdr/overlay/overlaytools.cxx
index a335878c1190..a061d184a6d2 100644
--- a/svx/source/sdr/overlay/overlaytools.cxx
+++ b/svx/source/sdr/overlay/overlaytools.cxx
@@ -34,6 +34,8 @@
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
+#include <vcl/svapp.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -184,82 +186,122 @@ namespace drawinglayer
{
namespace primitive2d
{
- OverlayHatchRectanglePrimitive::OverlayHatchRectanglePrimitive(
+ OverlayRectanglePrimitive::OverlayRectanglePrimitive(
const basegfx::B2DRange& rObjectRange,
- double fDiscreteHatchDistance,
- double fHatchRotation,
- const basegfx::BColor& rHatchColor,
+ const basegfx::BColor& rColor,
+ double fTransparence,
double fDiscreteGrow,
double fDiscreteShrink,
double fRotation)
: DiscreteMetricDependentPrimitive2D(),
maObjectRange(rObjectRange),
- mfDiscreteHatchDistance(fDiscreteHatchDistance),
- mfHatchRotation(fHatchRotation),
- maHatchColor(rHatchColor),
+ maColor(rColor),
+ mfTransparence(fTransparence),
mfDiscreteGrow(fDiscreteGrow),
mfDiscreteShrink(fDiscreteShrink),
mfRotation(fRotation)
{}
- Primitive2DSequence OverlayHatchRectanglePrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence OverlayRectanglePrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
Primitive2DSequence aRetval;
+ basegfx::B2DRange aInnerRange(getObjectRange());
- if(basegfx::fTools::more(getDiscreteUnit(), 0.0))
+ if(!aInnerRange.isEmpty() && basegfx::fTools::more(getDiscreteUnit(), 0.0) && getTransparence() <= 1.0)
{
basegfx::B2DRange aInnerRange(getObjectRange());
basegfx::B2DRange aOuterRange(getObjectRange());
- basegfx::B2DPolyPolygon aHatchPolyPolygon;
+ // grow/shrink inner/outer polygons
aOuterRange.grow(getDiscreteUnit() * getDiscreteGrow());
aInnerRange.grow(getDiscreteUnit() * -getDiscreteShrink());
- aHatchPolyPolygon.append(basegfx::tools::createPolygonFromRect(aOuterRange));
-
- if(!aInnerRange.isEmpty())
- {
- aHatchPolyPolygon.append(basegfx::tools::createPolygonFromRect(aInnerRange));
- }
-
+ // convert to polygons
+ const double fFullGrow(getDiscreteGrow() + getDiscreteShrink());
+ const double fRelativeRadiusX(fFullGrow / aOuterRange.getWidth());
+ const double fRelativeRadiusY(fFullGrow / aOuterRange.getHeight());
+ basegfx::B2DPolygon aOuterPolygon(
+ basegfx::tools::createPolygonFromRect(
+ aOuterRange,
+ fRelativeRadiusX,
+ fRelativeRadiusY));
+ basegfx::B2DPolygon aInnerPolygon(
+ basegfx::tools::createPolygonFromRect(
+ aInnerRange));
+
+ // apply evtl. existing rotation
if(!basegfx::fTools::equalZero(getRotation()))
{
const basegfx::B2DHomMatrix aTransform(basegfx::tools::createRotateAroundPoint(
getObjectRange().getMinX(), getObjectRange().getMinY(), getRotation()));
- aHatchPolyPolygon.transform(aTransform);
+ aOuterPolygon.transform(aTransform);
+ aInnerPolygon.transform(aTransform);
}
- const basegfx::BColor aEmptyColor(0.0, 0.0, 0.0);
- const drawinglayer::attribute::FillHatchAttribute aFillHatchAttribute(
- drawinglayer::attribute::HATCHSTYLE_SINGLE,
- getDiscreteHatchDistance() * getDiscreteUnit(),
- getHatchRotation() - getRotation(),
- getHatchColor(),
- 3, // same default as VCL, a minimum of three discrete units (pixels) offset
- false);
- const Primitive2DReference aPrimitive(
- new PolyPolygonHatchPrimitive2D(
- aHatchPolyPolygon,
- aEmptyColor,
- aFillHatchAttribute));
+ // create filled primitive
+ basegfx::B2DPolyPolygon aPolyPolygon;
- aRetval = Primitive2DSequence(&aPrimitive, 1);
+ aPolyPolygon.append(aOuterPolygon);
+ aPolyPolygon.append(aInnerPolygon);
+
+ if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
+ {
+ // for high contrast, use hatch
+ const basegfx::BColor aHighContrastLineColor(Application::GetSettings().GetStyleSettings().GetFontColor().getBColor());
+ const basegfx::BColor aEmptyColor(0.0, 0.0, 0.0);
+ const double fHatchRotation(45 * F_PI180);
+ const double fDiscreteHatchDistance(3.0);
+ const drawinglayer::attribute::FillHatchAttribute aFillHatchAttribute(
+ drawinglayer::attribute::HATCHSTYLE_SINGLE,
+ fDiscreteHatchDistance * getDiscreteUnit(),
+ fHatchRotation - getRotation(),
+ aHighContrastLineColor,
+ 3, // same default as VCL, a minimum of three discrete units (pixels) offset
+ false);
+ const Primitive2DReference aHatch(
+ new PolyPolygonHatchPrimitive2D(
+ aPolyPolygon,
+ aEmptyColor,
+ aFillHatchAttribute));
+
+ aRetval = Primitive2DSequence(&aHatch, 1);
+ }
+ else
+ {
+ // create fill primitive
+ const Primitive2DReference aFill(
+ new PolyPolygonColorPrimitive2D(
+ aPolyPolygon,
+ getColor()));
+
+ aRetval = Primitive2DSequence(&aFill, 1);
+
+ // embed filled to transparency (if used)
+ if(getTransparence() > 0.0)
+ {
+ const Primitive2DReference aFillTransparent(
+ new UnifiedTransparencePrimitive2D(
+ aRetval,
+ getTransparence()));
+
+ aRetval = Primitive2DSequence(&aFillTransparent, 1);
+ }
+ }
}
return aRetval;
}
- bool OverlayHatchRectanglePrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
+ bool OverlayRectanglePrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
{
if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
{
- const OverlayHatchRectanglePrimitive& rCompare = static_cast< const OverlayHatchRectanglePrimitive& >(rPrimitive);
+ const OverlayRectanglePrimitive& rCompare = static_cast< const OverlayRectanglePrimitive& >(rPrimitive);
return (getObjectRange() == rCompare.getObjectRange()
- && getDiscreteHatchDistance() == rCompare.getDiscreteHatchDistance()
- && getHatchRotation() == rCompare.getHatchRotation()
- && getHatchColor() == rCompare.getHatchColor()
+ && getColor() == rCompare.getColor()
+ && getTransparence() == rCompare.getTransparence()
&& getDiscreteGrow() == rCompare.getDiscreteGrow()
&& getDiscreteShrink() == rCompare.getDiscreteShrink()
&& getRotation() == rCompare.getRotation());
@@ -268,7 +310,7 @@ namespace drawinglayer
return false;
}
- ImplPrimitrive2DIDBlock(OverlayHatchRectanglePrimitive, PRIMITIVE2D_ID_OVERLAYHATCHRECTANGLEPRIMITIVE)
+ ImplPrimitrive2DIDBlock(OverlayRectanglePrimitive, PRIMITIVE2D_ID_OVERLAYRECTANGLEPRIMITIVE)
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx
index dc6a6f34f978..d4a4e14529a7 100644
--- a/svx/source/svdraw/svdcrtv.cxx
+++ b/svx/source/svdraw/svdcrtv.cxx
@@ -80,7 +80,8 @@ ImplConnectMarkerOverlay::ImplConnectMarkerOverlay(const SdrCreateView& rView, S
Size aHalfLogicSize(pTargetOverlay->getOutputDevice().PixelToLogic(Size(4, 4)));
// object
- ::sdr::overlay::OverlayPolyPolygonStriped* pNew = new ::sdr::overlay::OverlayPolyPolygonStriped(aB2DPolyPolygon);
+ ::sdr::overlay::OverlayPolyPolygonStripedAndFilled* pNew = new ::sdr::overlay::OverlayPolyPolygonStripedAndFilled(
+ aB2DPolyPolygon);
pTargetOverlay->add(*pNew);
maObjects.append(*pNew);
@@ -105,7 +106,8 @@ ImplConnectMarkerOverlay::ImplConnectMarkerOverlay(const SdrCreateView& rView, S
basegfx::B2DPolyPolygon aTempPolyPoly;
aTempPolyPoly.append(aTempPoly);
- pNew = new ::sdr::overlay::OverlayPolyPolygonStriped(aTempPolyPoly);
+ pNew = new ::sdr::overlay::OverlayPolyPolygonStripedAndFilled(
+ aTempPolyPoly);
pTargetOverlay->add(*pNew);
maObjects.append(*pNew);
}
@@ -166,7 +168,8 @@ void ImpSdrCreateViewExtraData::CreateAndShowOverlay(const SdrCreateView& rView,
if(rPolyPoly.count())
{
- ::sdr::overlay::OverlayPolyPolygonStriped* pNew = new ::sdr::overlay::OverlayPolyPolygonStriped(rPolyPoly);
+ ::sdr::overlay::OverlayPolyPolygonStripedAndFilled* pNew = new ::sdr::overlay::OverlayPolyPolygonStripedAndFilled(
+ rPolyPoly);
pOverlayManager->add(*pNew);
maObjects.append(*pNew);
}
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index d193d54e2aab..8d01d5a788a6 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -67,6 +67,7 @@
#include <svx/svdopath.hxx>
#include <svx/polypolygoneditor.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
@@ -124,10 +125,22 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragEntryPolyPolygon::createPr
aColB.invert();
}
- drawinglayer::primitive2d::Primitive2DReference aPolyPolygonMarkerPrimitive2D(
- new drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D(aCopy, aColA, aColB, fStripeLength));
+ aRetval.realloc(2);
+ aRetval[0] = new drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D(
+ aCopy,
+ aColA,
+ aColB,
+ fStripeLength);
- aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aPolyPolygonMarkerPrimitive2D, 1);
+ const basegfx::BColor aHilightColor(aSvtOptionsDrawinglayer.getHilightColor().getBColor());
+ const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
+
+ aRetval[1] = new drawinglayer::primitive2d::PolyPolygonSelectionPrimitive2D(
+ aCopy,
+ aHilightColor,
+ fTransparence,
+ 3.0,
+ false);
}
return aRetval;
@@ -964,8 +977,8 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragMethod::AddConnectorOverla
}
drawinglayer::primitive2d::Primitive2DReference aPolyPolygonMarkerPrimitive2D(
- new drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D(
- basegfx::B2DPolyPolygon(aEdgePolygon), aColA, aColB, fStripeLength));
+ new drawinglayer::primitive2d::PolygonMarkerPrimitive2D(
+ aEdgePolygon, aColA, aColB, fStripeLength));
drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aPolyPolygonMarkerPrimitive2D);
}
}
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index a58695d3b662..ffba5a3eb523 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -19,19 +19,13 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <com/sun/star/i18n/WordType.hpp>
-
#include <svtools/accessibilityoptions.hxx>
-
#include <svx/svdedxv.hxx>
#include <svl/solar.hrc>
-
-//#include <tools/string.h>
#include <svl/itemiter.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/hatch.hxx>
@@ -41,7 +35,6 @@
#include <tools/config.hxx>
#include <vcl/cursor.hxx>
#include <editeng/unotext.hxx>
-
#include <editeng/editeng.hxx>
#include <editeng/editobj.hxx>
#include <editeng/outlobj.hxx>
@@ -54,26 +47,26 @@
#include "svx/svditer.hxx"
#include "svx/svdpagv.hxx"
#include "svx/svdpage.hxx"
-#include "svx/svdetc.hxx" // fuer GetDraftFillColor
+#include "svx/svdetc.hxx"
#include "svx/svdotable.hxx"
#include <svx/selectioncontroller.hxx>
#ifdef DBG_UTIL
#include <svdibrow.hxx>
#endif
-
#include <svx/svdoutl.hxx>
-#include <svx/svddrgv.hxx> // fuer SetSolidDragging()
-#include "svx/svdstr.hrc" // Namen aus der Resource
-#include "svx/svdglob.hxx" // StringCache
+#include <svx/svddrgv.hxx>
+#include "svx/svdstr.hrc"
+#include "svx/svdglob.hxx"
#include "svx/globl3d.hxx"
#include <editeng/outliner.hxx>
#include <editeng/adjitem.hxx>
-
-// #98988#
#include <svtools/colorcfg.hxx>
-#include <vcl/svapp.hxx> //add CHINA001
+#include <vcl/svapp.hxx>
#include <svx/sdrpaintwindow.hxx>
#include <svx/sdrundomanager.hxx>
+#include <svx/sdr/contact/objectcontacttools.hxx>
+#include <svx/sdr/overlay/overlaytools.hxx>
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -364,44 +357,35 @@ void SdrObjEditView::ImpPaintOutlinerView(OutlinerView& rOutlView, const Rectang
if(bTextFrame && !bFitToSize)
{
- aPixRect.Left()--;
- aPixRect.Top()--;
- aPixRect.Right()++;
- aPixRect.Bottom()++;
- sal_uInt16 nPixSiz(rOutlView.GetInvalidateMore() - 1);
+ // completely reworked to use primitives; this ensures same look and functionality
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
+ drawinglayer::processor2d::BaseProcessor2D* pProcessor = ::sdr::contact::createBaseProcessor2DFromOutputDevice(
+ rTargetDevice,
+ aViewInformation2D);
+ if(pProcessor)
{
- // xPixRect Begrenzen, wegen Treiberproblem bei zu weit hinausragenden Pixelkoordinaten
- Size aMaxXY(rTargetDevice.GetOutputSizePixel());
- long a(2 * nPixSiz);
- long nMaxX(aMaxXY.Width() + a);
- long nMaxY(aMaxXY.Height() + a);
-
- if (aPixRect.Left ()<-a) aPixRect.Left()=-a;
- if (aPixRect.Top ()<-a) aPixRect.Top ()=-a;
- if (aPixRect.Right ()>nMaxX) aPixRect.Right ()=nMaxX;
- if (aPixRect.Bottom()>nMaxY) aPixRect.Bottom()=nMaxY;
+ const bool bMerk(rTargetDevice.IsMapModeEnabled());
+ const basegfx::B2DRange aRange(aPixRect.Left(), aPixRect.Top(), aPixRect.Right(), aPixRect.Bottom());
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+ const Color aHilightColor(aSvtOptionsDrawinglayer.getHilightColor());
+ const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
+ const sal_uInt16 nPixSiz(rOutlView.GetInvalidateMore() - 1);
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::OverlayRectanglePrimitive(
+ aRange,
+ aHilightColor.getBColor(),
+ fTransparence,
+ std::max(6, nPixSiz - 2), // grow
+ 0.0, // shrink
+ 0.0));
+ const drawinglayer::primitive2d::Primitive2DSequence aSequence(&xReference, 1);
+
+ rTargetDevice.EnableMapMode(false);
+ pProcessor->process(aSequence);
+ rTargetDevice.EnableMapMode(bMerk);
+ delete pProcessor;
}
-
- Rectangle aOuterPix(aPixRect);
- aOuterPix.Left()-=nPixSiz;
- aOuterPix.Top()-=nPixSiz;
- aOuterPix.Right()+=nPixSiz;
- aOuterPix.Bottom()+=nPixSiz;
-
- bool bMerk(rTargetDevice.IsMapModeEnabled());
- rTargetDevice.EnableMapMode(sal_False);
- PolyPolygon aPolyPoly( 2 );
-
- svtools::ColorConfig aColorConfig;
- Color aHatchCol( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor );
- const Hatch aHatch( HATCH_SINGLE, aHatchCol, 3, 450 );
-
- aPolyPoly.Insert( aOuterPix );
- aPolyPoly.Insert( aPixRect );
- rTargetDevice.DrawHatch( aPolyPoly, aHatch );
-
- rTargetDevice.EnableMapMode(bMerk);
}
rOutlView.ShowCursor();
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index b37ccf332f73..41e1039897c1 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -56,7 +56,7 @@
#include <svx/sdr/overlay/overlaybitmapex.hxx>
#include <svx/sdr/overlay/overlayline.hxx>
#include <svx/sdr/overlay/overlaytriangle.hxx>
-#include <svx/sdr/overlay/overlayhatchrect.hxx>
+#include <svx/sdr/overlay/overlayrectangle.hxx>
#include <svx/sdrpagewindow.hxx>
#include <svx/sdrpaintwindow.hxx>
#include <vcl/svapp.hxx>
@@ -1466,7 +1466,8 @@ void E3dVolumeMarker::CreateB2dIAObject()
if(rPageWindow.GetOverlayManager() && aWireframePoly.count())
{
::sdr::overlay::OverlayObject* pNewOverlayObject = new
- ::sdr::overlay::OverlayPolyPolygonStriped(aWireframePoly);
+ ::sdr::overlay::OverlayPolyPolygonStripedAndFilled(
+ aWireframePoly);
DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
// OVERLAYMANAGER
@@ -1715,17 +1716,21 @@ void ImpTextframeHdl::CreateB2dIAObject()
{
const basegfx::B2DPoint aTopLeft(maRect.Left(), maRect.Top());
const basegfx::B2DPoint aBottomRight(maRect.Right(), maRect.Bottom());
- const svtools::ColorConfig aColorConfig;
- const Color aHatchCol( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor );
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+ const Color aHilightColor(aSvtOptionsDrawinglayer.getHilightColor());
+ const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
- ::sdr::overlay::OverlayHatchRect* pNewOverlayObject = new ::sdr::overlay::OverlayHatchRect(
+ ::sdr::overlay::OverlayRectangle* pNewOverlayObject = new ::sdr::overlay::OverlayRectangle(
aTopLeft,
aBottomRight,
- aHatchCol,
+ aHilightColor,
+ fTransparence,
3.0,
3.0,
- 45 * F_PI180,
- nDrehWink * -F_PI18000);
+ nDrehWink * -F_PI18000,
+ 500,
+ true); // allow animation; the Handle is not shown at text edit time
+
pNewOverlayObject->setHittable(false);
// OVERLAYMANAGER
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 653b6ea4eb25..c1a21fca565a 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -2414,6 +2414,33 @@ SdrObject* SdrObject::GetConnectedNode(FASTBOOL /*bTail1*/) const
////////////////////////////////////////////////////////////////////////////////////////////////////
+void extractLineContourFromPrimitive2DSequence(
+ const drawinglayer::primitive2d::Primitive2DSequence& rxSequence,
+ basegfx::B2DPolygonVector& rExtractedHairlines,
+ basegfx::B2DPolyPolygonVector& rExtractedLineFills)
+{
+ rExtractedHairlines.clear();
+ rExtractedLineFills.clear();
+
+ if(rxSequence.hasElements())
+ {
+ // use neutral ViewInformation
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
+
+ // create extractor, process and get result
+ drawinglayer::processor2d::LineGeometryExtractor2D aExtractor(aViewInformation2D);
+ aExtractor.process(rxSequence);
+
+ // copy line results
+ rExtractedHairlines = aExtractor.getExtractedHairlines();
+
+ // copy fill rsults
+ rExtractedLineFills = aExtractor.getExtractedLineFills();
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, sal_Bool bForceLineDash) const
{
bool bNoChange(true);
@@ -2426,37 +2453,28 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, sal_Bool bForceLin
if(xSequence.hasElements())
{
- // use neutral ViewInformation
- const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
-
- // create extractor, process and get result
- drawinglayer::processor2d::LineGeometryExtractor2D aExtractor(aViewInformation2D);
- aExtractor.process(xSequence);
+ basegfx::B2DPolygonVector aExtractedHairlines;
+ basegfx::B2DPolyPolygonVector aExtractedLineFills;
- // #i102241# check for line results
- const basegfx::B2DPolygonVector& rHairlineVector = aExtractor.getExtractedHairlines();
+ extractLineContourFromPrimitive2DSequence(xSequence, aExtractedHairlines, aExtractedLineFills);
- if(!rHairlineVector.empty())
+ if(!aExtractedHairlines.empty())
{
// for SdrObject creation, just copy all to a single Hairline-PolyPolygon
- for(sal_uInt32 a(0); a < rHairlineVector.size(); a++)
+ for(sal_uInt32 a(0); a < aExtractedHairlines.size(); a++)
{
- aMergedHairlinePolyPolygon.append(rHairlineVector[a]);
+ aMergedHairlinePolyPolygon.append(aExtractedHairlines[a]);
}
}
- // #i102241# check for fill rsults
- const basegfx::B2DPolyPolygonVector& rLineFillVector(aExtractor.getExtractedLineFills());
-
- if(!rLineFillVector.empty())
+ // check for fill rsults
+ if(!aExtractedLineFills.empty())
{
// merge to a single PolyPolygon (OR)
- aMergedLineFillPolyPolygon = basegfx::tools::mergeToSinglePolyPolygon(rLineFillVector);
+ aMergedLineFillPolyPolygon = basegfx::tools::mergeToSinglePolyPolygon(aExtractedLineFills);
}
}
- // || aMergedHairlinePolyPolygon.Count() removed; the conversion is ONLY
- // useful when new closed filled polygons are created
if(aMergedLineFillPolyPolygon.count() || (bForceLineDash && aMergedHairlinePolyPolygon.count()))
{
SfxItemSet aSet(pRet->GetMergedItemSet());
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index b649f1b8c5a0..d6aa387cbe99 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -19,22 +19,20 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include <editeng/eeitem.hxx>
-#include "svx/svdstr.hrc" // Namen aus der Resource
-#include "svx/svdglob.hxx" // StringCache
+#include <editeng/eeitem.hxx>
+#include "svx/svdstr.hrc"
+#include "svx/svdglob.hxx"
#include <svx/svdpagv.hxx>
#include <svx/svdmrkv.hxx>
#include <svx/svdedxv.hxx>
#include <svx/svdobj.hxx>
-#include <svx/svdopath.hxx> // fuer GetContext
-#include <svx/svdograf.hxx> // fuer GetContext
-#include <svx/svdomedia.hxx> // fuer GetContext
-#include <svx/svdetc.hxx> // Fuer SdrEngineDefaults
+#include <svx/svdopath.hxx>
+#include <svx/svdograf.hxx>
+#include <svx/svdomedia.hxx>
+#include <svx/svdetc.hxx>
#ifdef DBG_UTIL
#include <svdibrow.hxx>
@@ -42,8 +40,8 @@
#include "svx/svdoutl.hxx"
#include "svx/svdview.hxx"
-#include "editeng/editview.hxx" // fuer GetField
-#include "editeng/flditem.hxx" // fuer URLField
+#include "editeng/editview.hxx"
+#include "editeng/flditem.hxx"
#include "svx/obj3d.hxx"
#include "svx/svddrgmt.hxx"
#include "svx/svdoutl.hxx"
@@ -54,6 +52,8 @@
#include <svx/sdrpaintwindow.hxx>
#include <svx/sdrpagewindow.hxx>
#include <svx/sdrhittesthelper.hxx>
+#include <svx/sdr/contact/viewcontact.hxx>
+#include <drawinglayer/processor2d/contourextractor2d.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -96,7 +96,9 @@ SdrViewEvent::~SdrViewEvent()
////////////////////////////////////////////////////////////////////////////////////////////////////
// helper class for all D&D overlays
-void SdrDropMarkerOverlay::ImplCreateOverlays(const SdrView& rView, const basegfx::B2DPolyPolygon& rPolyPolygon)
+void SdrDropMarkerOverlay::ImplCreateOverlays(
+ const SdrView& rView,
+ const basegfx::B2DPolyPolygon& rLinePolyPolygon)
{
for(sal_uInt32 a(0L); a < rView.PaintWindowCount(); a++)
{
@@ -105,8 +107,9 @@ void SdrDropMarkerOverlay::ImplCreateOverlays(const SdrView& rView, const basegf
if(pTargetOverlay)
{
- ::sdr::overlay::OverlayPolyPolygonStriped* pNew = new ::sdr::overlay::OverlayPolyPolygonStriped(
- rPolyPolygon);
+ ::sdr::overlay::OverlayPolyPolygonStripedAndFilled* pNew = new ::sdr::overlay::OverlayPolyPolygonStripedAndFilled(
+ rLinePolyPolygon);
+
pTargetOverlay->add(*pNew);
maObjects.append(*pNew);
}
@@ -115,35 +118,37 @@ void SdrDropMarkerOverlay::ImplCreateOverlays(const SdrView& rView, const basegf
SdrDropMarkerOverlay::SdrDropMarkerOverlay(const SdrView& rView, const SdrObject& rObject)
{
- ImplCreateOverlays(rView, rObject.TakeXorPoly());
+ ImplCreateOverlays(
+ rView,
+ rObject.TakeXorPoly());
}
SdrDropMarkerOverlay::SdrDropMarkerOverlay(const SdrView& rView, const Rectangle& rRectangle)
{
basegfx::B2DPolygon aB2DPolygon;
+
aB2DPolygon.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Top()));
aB2DPolygon.append(basegfx::B2DPoint(rRectangle.Right(), rRectangle.Top()));
aB2DPolygon.append(basegfx::B2DPoint(rRectangle.Right(), rRectangle.Bottom()));
aB2DPolygon.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
aB2DPolygon.setClosed(true);
- basegfx::B2DPolyPolygon aB2DPolyPolygon;
- aB2DPolyPolygon.append(aB2DPolygon);
-
- ImplCreateOverlays(rView, aB2DPolyPolygon);
+ ImplCreateOverlays(
+ rView,
+ basegfx::B2DPolyPolygon(aB2DPolygon));
}
SdrDropMarkerOverlay::SdrDropMarkerOverlay(const SdrView& rView, const Point& rStart, const Point& rEnd)
{
basegfx::B2DPolygon aB2DPolygon;
+
aB2DPolygon.append(basegfx::B2DPoint(rStart.X(), rStart.Y()));
aB2DPolygon.append(basegfx::B2DPoint(rEnd.X(), rEnd.Y()));
aB2DPolygon.setClosed(true);
- basegfx::B2DPolyPolygon aB2DPolyPolygon;
- aB2DPolyPolygon.append(aB2DPolygon);
-
- ImplCreateOverlays(rView, aB2DPolyPolygon);
+ ImplCreateOverlays(
+ rView,
+ basegfx::B2DPolyPolygon(aB2DPolygon));
}
SdrDropMarkerOverlay::~SdrDropMarkerOverlay()
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 525d754fbeb4..1f20b8aeab7e 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -2427,7 +2427,7 @@ void SdrTableObj::AddToHdlList(SdrHdlList& rHdlList) const
// add remaining handles
SdrHdl* pH=0;
- rHdlList.AddHdl( pH = new TableBorderHdl( aRect ) ); pH->SetMoveOutside( true );
+ rHdlList.AddHdl( pH = new TableBorderHdl( aRect, !IsTextEditActive() ) ); pH->SetMoveOutside( true );
rHdlList.AddHdl( pH = new SdrHdl(aRect.TopLeft(),HDL_UPLFT) ); pH->SetMoveOutside( true );
rHdlList.AddHdl( pH = new SdrHdl(aRect.TopCenter(),HDL_UPPER) ); pH->SetMoveOutside( true );
rHdlList.AddHdl( pH = new SdrHdl(aRect.TopRight(),HDL_UPRGT) ); pH->SetMoveOutside( true );
diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx
index cf67e0520dc9..0cbe92228507 100644
--- a/svx/source/table/tablehandles.cxx
+++ b/svx/source/table/tablehandles.cxx
@@ -42,7 +42,7 @@
#include <svx/svdmrkv.hxx>
#include <svx/svdpagv.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
-#include <svx/sdr/overlay/overlayhatchrect.hxx>
+#include <svx/sdr/overlay/overlayrectangle.hxx>
#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
namespace sdr { namespace table {
@@ -252,11 +252,13 @@ drawinglayer::primitive2d::Primitive2DSequence OverlayTableEdge::createOverlayOb
// ====================================================================
-TableBorderHdl::TableBorderHdl( const Rectangle& rRect )
-: SdrHdl( rRect.TopLeft(), HDL_MOVE )
-, maRectangle( rRect )
+TableBorderHdl::TableBorderHdl(
+ const Rectangle& rRect,
+ bool bAnimate)
+: SdrHdl(rRect.TopLeft(), HDL_MOVE),
+ maRectangle(rRect),
+ mbAnimate(bAnimate)
{
-
}
Pointer TableBorderHdl::GetPointer() const
@@ -278,7 +280,6 @@ void TableBorderHdl::CreateB2dIAObject()
{
for(sal_uInt32 nWindow = 0; nWindow < pPageView->PageWindowCount(); nWindow++)
{
- // const SdrPageViewWinRec& rPageViewWinRec = rPageViewWinList[b];
const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(nWindow);
if(rPageWindow.GetPaintWindow().OutputToWindow())
@@ -286,14 +287,24 @@ void TableBorderHdl::CreateB2dIAObject()
if(rPageWindow.GetOverlayManager())
{
const basegfx::B2DRange aRange(vcl::unotools::b2DRectangleFromRectangle(maRectangle));
- sdr::overlay::OverlayObject* pOverlayObject = new sdr::overlay::OverlayHatchRect(
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+ const Color aHilightColor(aSvtOptionsDrawinglayer.getHilightColor());
+ const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
+
+ sdr::overlay::OverlayObject* pOverlayObject = new sdr::overlay::OverlayRectangle(
aRange.getMinimum(),
aRange.getMaximum(),
- Color(0x80, 0x80, 0x80),
+ aHilightColor,
+ fTransparence,
6.0,
0.0,
- 45 * F_PI180,
- 0.0);
+ 0.0,
+ 500,
+ // make animation dependent from text edit active, because for tables
+ // this handle is also used when text edit *is* active for it. This
+ // interferes too much concerning repaint stuff (at least as long as
+ // text edit is not yet on the overlay)
+ getAnimate());
rPageWindow.GetOverlayManager()->add(*pOverlayObject);
maOverlayGroup.append(*pOverlayObject);
diff --git a/svx/source/table/tablehandles.hxx b/svx/source/table/tablehandles.hxx
index 8ffd175e67ee..6f1d060da797 100644
--- a/svx/source/table/tablehandles.hxx
+++ b/svx/source/table/tablehandles.hxx
@@ -74,9 +74,12 @@ private:
class TableBorderHdl : public SdrHdl
{
public:
- TableBorderHdl( const Rectangle& rRect );
+ TableBorderHdl(
+ const Rectangle& rRect,
+ bool bAnimate);
virtual Pointer GetPointer() const;
+ bool getAnimate() const { return mbAnimate; }
protected:
// create marker for this kind
@@ -84,6 +87,9 @@ protected:
private:
Rectangle maRectangle;
+
+ /// bitfield
+ bool mbAnimate : 1;
};
} // end of namespace table