diff options
author | Armin Le Grand <alg@apache.org> | 2013-01-29 12:32:36 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-06-16 20:01:56 +0100 |
commit | 5aee0c13cc62a81a38d4132db7972dc301c21b3d (patch) | |
tree | 00c7837aa82296623f38305ce0f47bc6e6f5586a /svx | |
parent | 9618c7627061b9eb82ad6107de78a12c764744cf (diff) |
Resolves: #i121532# enhanced visualisation of text edit&selection
D&D overhauled
(cherry picked from commit c6e63b6bbb6b4a63fe1302de57fc32cd28432378)
Conflicts:
drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx
drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
svx/Package_inc.mk
svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx
svx/inc/svx/sdr/overlay/overlayobject.hxx
svx/inc/svx/sdr/overlay/overlaypolypolygon.hxx
svx/inc/svx/sdr/overlay/overlayrectangle.hxx
svx/inc/svx/sdr/overlay/overlaytools.hxx
svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx
svx/inc/svx/svdview.hxx
svx/source/engine3d/view3d.cxx
svx/source/sdr/overlay/overlayanimatedbitmapex.cxx
svx/source/sdr/overlay/overlayhatchrect.cxx
svx/source/sdr/overlay/overlaypolypolygon.cxx
svx/source/sdr/overlay/overlaytools.cxx
svx/source/svdraw/svdcrtv.cxx
svx/source/svdraw/svdedxv.cxx
svx/source/svdraw/svdhdl.cxx
svx/source/svdraw/svdobj.cxx
svx/source/svdraw/svdview.cxx
sw/source/ui/dochdl/swdtflvr.cxx
Unname unused arguments to prevent WaE issues.
(cherry picked from commit 0735a61e631b8d4bb3d4e889bee436fb9e7c5734)
Change-Id: I3b1cf4754063985dc1b4adac44b33e52e200607f
e4288936cadd1f6e06bdf79611536d7114236b56
Diffstat (limited to 'svx')
-rw-r--r-- | svx/Library_svxcore.mk | 2 | ||||
-rw-r--r-- | svx/source/engine3d/dragmt3d.cxx | 3 | ||||
-rw-r--r-- | svx/source/engine3d/view3d.cxx | 3 | ||||
-rw-r--r-- | svx/source/sdr/overlay/overlayanimatedbitmapex.cxx | 15 | ||||
-rw-r--r-- | svx/source/sdr/overlay/overlayhatchrect.cxx | 71 | ||||
-rw-r--r-- | svx/source/sdr/overlay/overlaymanager.cxx | 10 | ||||
-rw-r--r-- | svx/source/sdr/overlay/overlayobject.cxx | 14 | ||||
-rw-r--r-- | svx/source/sdr/overlay/overlaypolypolygon.cxx | 33 | ||||
-rw-r--r-- | svx/source/sdr/overlay/overlayrectangle.cxx | 150 | ||||
-rw-r--r-- | svx/source/sdr/overlay/overlayrollingrectangle.cxx | 26 | ||||
-rw-r--r-- | svx/source/sdr/overlay/overlaytools.cxx | 119 | ||||
-rw-r--r-- | svx/source/svdraw/svdcrtv.cxx | 9 | ||||
-rw-r--r-- | svx/source/svdraw/svddrgmt.cxx | 23 | ||||
-rw-r--r-- | svx/source/svdraw/svdedxv.cxx | 81 | ||||
-rw-r--r-- | svx/source/svdraw/svdhdl.cxx | 21 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 54 | ||||
-rw-r--r-- | svx/source/svdraw/svdview.cxx | 31 | ||||
-rw-r--r-- | svx/source/table/svdotable.cxx | 2 | ||||
-rw-r--r-- | svx/source/table/tablehandles.cxx | 31 | ||||
-rw-r--r-- | svx/source/table/tablehandles.hxx | 8 |
20 files changed, 455 insertions, 251 deletions
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index 21a03bf47a18..30a33a4cdbfc 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -196,7 +196,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\ svx/source/sdr/overlay/overlayrollingrectangle \ svx/source/sdr/overlay/overlaytriangle \ svx/source/sdr/overlay/overlayselection \ - svx/source/sdr/overlay/overlayhatchrect \ + svx/source/sdr/overlay/overlayrectangle \ svx/source/sdr/overlay/overlaybitmapex \ svx/source/sdr/overlay/overlaymanagerbuffered \ svx/source/sdr/overlay/overlayhelpline \ diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx index ccc796eb6dbe..4e0bf86df28e 100644 --- a/svx/source/engine3d/dragmt3d.cxx +++ b/svx/source/engine3d/dragmt3d.cxx @@ -259,7 +259,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 5f856ed538a8..15a4787a68bd 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -213,7 +213,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); xTargetOverlay->add(*pNew); maObjects.append(*pNew); } diff --git a/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx b/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx index cf9d5842a37b..ff4d97b8c9d2 100644 --- a/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx +++ b/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx @@ -29,19 +29,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) @@ -89,7 +76,7 @@ namespace sdr mbAllowsAnimation = true; // #i53216# check blink time value range - impCheckBlinkTimeValueRange(); + mnBlinkTime = impCheckBlinkTimeValueRange(mnBlinkTime); } OverlayAnimatedBitmapEx::~OverlayAnimatedBitmapEx() diff --git a/svx/source/sdr/overlay/overlayhatchrect.cxx b/svx/source/sdr/overlay/overlayhatchrect.cxx deleted file mode 100644 index 2b6c7e1e3668..000000000000 --- a/svx/source/sdr/overlay/overlayhatchrect.cxx +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * 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 . - */ - - -#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) - { - } - } // end of namespace overlay -} // end of namespace sdr - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx index 818bfc6b6b27..d9a0ef4772ac 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 da15079b7f54..292cb5a0c220 100644 --- a/svx/source/sdr/overlay/overlayobject.cxx +++ b/svx/source/sdr/overlay/overlayobject.cxx @@ -63,6 +63,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 e1b06469d1be..f85021c7e797 100644 --- a/svx/source/sdr/overlay/overlaypolypolygon.cxx +++ b/svx/source/sdr/overlay/overlaypolypolygon.cxx @@ -30,7 +30,7 @@ namespace sdr { namespace overlay { - drawinglayer::primitive2d::Primitive2DSequence OverlayPolyPolygonStriped::createOverlayObjectPrimitive2DSequence() + drawinglayer::primitive2d::Primitive2DSequence OverlayPolyPolygonStripedAndFilled::createOverlayObjectPrimitive2DSequence() { drawinglayer::primitive2d::Primitive2DSequence aRetval; @@ -39,34 +39,47 @@ 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() { } } // end of namespace overlay diff --git a/svx/source/sdr/overlay/overlayrectangle.cxx b/svx/source/sdr/overlay/overlayrectangle.cxx new file mode 100644 index 000000000000..7f07be08633d --- /dev/null +++ b/svx/source/sdr/overlay/overlayrectangle.cxx @@ -0,0 +1,150 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * 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 . + */ + +#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 + +////////////////////////////////////////////////////////////////////////////// diff --git a/svx/source/sdr/overlay/overlayrollingrectangle.cxx b/svx/source/sdr/overlay/overlayrollingrectangle.cxx index 977c91e2275f..496cec8d320f 100644 --- a/svx/source/sdr/overlay/overlayrollingrectangle.cxx +++ b/svx/source/sdr/overlay/overlayrollingrectangle.cxx @@ -24,7 +24,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> ////////////////////////////////////////////////////////////////////////////// @@ -47,14 +47,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 92e0ff5866eb..d3ae3f97694c 100644 --- a/svx/source/sdr/overlay/overlaytools.cxx +++ b/svx/source/sdr/overlay/overlaytools.cxx @@ -28,6 +28,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> ////////////////////////////////////////////////////////////////////////////// @@ -178,82 +180,121 @@ 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()); @@ -262,7 +303,7 @@ namespace drawinglayer return false; } - ImplPrimitive2DIDBlock(OverlayHatchRectanglePrimitive, PRIMITIVE2D_ID_OVERLAYHATCHRECTANGLEPRIMITIVE) + ImplPrimitive2DIDBlock(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 e6980bd72006..10bcaed1aac4 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -73,7 +73,8 @@ ImplConnectMarkerOverlay::ImplConnectMarkerOverlay(const SdrCreateView& rView, S Size aHalfLogicSize(xTargetOverlay->getOutputDevice().PixelToLogic(Size(4, 4))); // object - ::sdr::overlay::OverlayPolyPolygonStriped* pNew = new ::sdr::overlay::OverlayPolyPolygonStriped(aB2DPolyPolygon); + ::sdr::overlay::OverlayPolyPolygonStripedAndFilled* pNew = new ::sdr::overlay::OverlayPolyPolygonStripedAndFilled( + aB2DPolyPolygon); xTargetOverlay->add(*pNew); maObjects.append(*pNew); @@ -98,7 +99,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); xTargetOverlay->add(*pNew); maObjects.append(*pNew); } @@ -159,7 +161,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); xOverlayManager->add(*pNew); maObjects.append(*pNew); } diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index d79d5f2add25..2255d58ad9a8 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -56,6 +56,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> @@ -113,10 +114,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; @@ -936,8 +949,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 273480f83366..492b0a754365 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -17,14 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include <com/sun/star/i18n/WordType.hpp> - #include <svtools/accessibilityoptions.hxx> - #include <svx/svdedxv.hxx> #include <svl/solar.hrc> - #include <svl/itemiter.hxx> #include <vcl/msgbox.hxx> #include <vcl/hatch.hxx> @@ -33,7 +29,6 @@ #include <editeng/editstat.hxx> #include <vcl/cursor.hxx> #include <editeng/unotext.hxx> - #include <editeng/editdata.hxx> #include <editeng/editeng.hxx> #include <editeng/editobj.hxx> @@ -46,24 +41,26 @@ #include "svx/svditer.hxx" #include "svx/svdpagv.hxx" #include "svx/svdpage.hxx" -#include "svx/svdetc.hxx" // for GetDraftFillColor +#include "svx/svdetc.hxx" #include "svx/svdotable.hxx" #include <svx/selectioncontroller.hxx> #ifdef DBG_UTIL #include <svdibrow.hxx> #endif - -#include <svx/svddrgv.hxx> // for SetSolidDragging() -#include "svx/svdstr.hrc" // names taken from the resource -#include "svx/svdglob.hxx" // StringCache +#include <svx/svdoutl.hxx> +#include <svx/svddrgv.hxx> +#include "svx/svdstr.hrc" +#include "svx/svdglob.hxx" #include "svx/globl3d.hxx" #include <editeng/outliner.hxx> #include <editeng/adjustitem.hxx> - #include <svtools/colorcfg.hxx> #include <vcl/svapp.hxx> #include <svx/sdrpaintwindow.hxx> #include <svx/sdrundomanager.hxx> +#include <svx/sdr/overlay/overlaytools.hxx> +#include <drawinglayer/processor2d/baseprocessor2d.hxx> +#include <drawinglayer/processor2d/processorfromoutputdevice.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -344,44 +341,36 @@ 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 = drawinglayer::processor2d::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 fa7dc52b3318..5a03983b0c64 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -50,7 +50,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> @@ -1402,7 +1402,8 @@ void E3dVolumeMarker::CreateB2dIAObject() if (xManager.is() && aWireframePoly.count()) { ::sdr::overlay::OverlayObject* pNewOverlayObject = new - ::sdr::overlay::OverlayPolyPolygonStriped(aWireframePoly); + ::sdr::overlay::OverlayPolyPolygonStripedAndFilled( + aWireframePoly); DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!"); // OVERLAYMANAGER @@ -1654,17 +1655,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 98e3b9a6dfb9..6930128ad850 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -2416,6 +2416,33 @@ SdrObject* SdrObject::GetConnectedNode(bool /*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, bool bForceLineDash) const { bool bNoChange(true); @@ -2428,37 +2455,28 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDas 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 ea1c73700395..b9338608d60e 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -47,6 +47,8 @@ #include <svx/sdrpaintwindow.hxx> #include <svx/sdrpagewindow.hxx> #include <svx/sdrhittesthelper.hxx> +#include <svx/sdr/contact/viewcontact.hxx> +#include <drawinglayer/processor2d/contourextractor2d.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -89,7 +91,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++) { @@ -98,8 +102,9 @@ void SdrDropMarkerOverlay::ImplCreateOverlays(const SdrView& rView, const basegf if (xTargetOverlay.is()) { - ::sdr::overlay::OverlayPolyPolygonStriped* pNew = new ::sdr::overlay::OverlayPolyPolygonStriped( - rPolyPolygon); + ::sdr::overlay::OverlayPolyPolygonStripedAndFilled* pNew = new ::sdr::overlay::OverlayPolyPolygonStripedAndFilled( + rLinePolyPolygon); + xTargetOverlay->add(*pNew); maObjects.append(*pNew); } @@ -108,35 +113,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 bed3988c7c81..2148eb98bf0a 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -2215,7 +2215,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 07fd729804b6..d6457e7becc0 100644 --- a/svx/source/table/tablehandles.cxx +++ b/svx/source/table/tablehandles.cxx @@ -35,7 +35,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 { @@ -246,11 +246,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 @@ -272,7 +274,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()) @@ -281,14 +282,24 @@ void TableBorderHdl::CreateB2dIAObject() if (xManager.is()) { 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()); xManager->add(*pOverlayObject); maOverlayGroup.append(*pOverlayObject); diff --git a/svx/source/table/tablehandles.hxx b/svx/source/table/tablehandles.hxx index 28e2200881a4..b9b745a89ba5 100644 --- a/svx/source/table/tablehandles.hxx +++ b/svx/source/table/tablehandles.hxx @@ -70,9 +70,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 @@ -80,6 +83,9 @@ protected: private: Rectangle maRectangle; + + /// bitfield + bool mbAnimate : 1; }; } // end of namespace table |