summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-03-13 15:14:33 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-03-13 15:15:11 +0000
commit131e5d35a4edb9f8875a197e8e0382c168834f70 (patch)
tree80a1f601731ccb98e25882c47fa1c1b36dc359be
parentccac587b1bfc15ed3974cbd9dd59d1e1edda17a3 (diff)
Resolves: fdo#46728 reference count the overlay managers
-rw-r--r--sc/source/ui/inc/gridwin.hxx2
-rw-r--r--sc/source/ui/view/gridwin.cxx54
-rw-r--r--sd/source/ui/animations/motionpathtag.cxx5
-rw-r--r--sd/source/ui/annotations/annotationtag.cxx5
-rw-r--r--sd/source/ui/view/viewoverlaymanager.cxx5
-rw-r--r--svx/inc/svx/sdr/overlay/overlaymanager.hxx21
-rw-r--r--svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx9
-rw-r--r--svx/inc/svx/sdr/overlay/overlayobject.hxx1
-rw-r--r--svx/inc/svx/sdrpagewindow.hxx3
-rw-r--r--svx/inc/svx/sdrpaintwindow.hxx12
-rw-r--r--svx/source/engine3d/view3d.cxx8
-rw-r--r--svx/source/sdr/overlay/overlaymanager.cxx22
-rw-r--r--svx/source/sdr/overlay/overlaymanagerbuffered.cxx12
-rw-r--r--svx/source/svdraw/sdrpagewindow.cxx2
-rw-r--r--svx/source/svdraw/sdrpaintwindow.cxx49
-rw-r--r--svx/source/svdraw/svdcrtv.cxx24
-rw-r--r--svx/source/svdraw/svddrgv.cxx8
-rw-r--r--svx/source/svdraw/svdhdl.cxx72
-rw-r--r--svx/source/svdraw/svdmrkv.cxx6
-rw-r--r--svx/source/svdraw/svdsnpv.cxx12
-rw-r--r--svx/source/svdraw/svdview.cxx6
-rw-r--r--svx/source/table/tablecontroller.cxx6
-rw-r--r--svx/source/table/tablehandles.cxx12
-rw-r--r--sw/source/core/crsr/viscrs.cxx6
-rw-r--r--sw/source/ui/docvw/AnchorOverlayObject.cxx6
-rw-r--r--sw/source/ui/docvw/ShadowOverlayObject.cxx6
26 files changed, 216 insertions, 158 deletions
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index ef9170f96568..1b10ad0349b8 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -310,7 +310,7 @@ public:
~ScGridWindow();
// #i70788# flush and get overlay
- ::sdr::overlay::OverlayManager* getOverlayManager();
+ rtl::Reference<sdr::overlay::OverlayManager> getOverlayManager();
void flushOverlayManager();
virtual void DataChanged( const DataChangedEvent& rDCEvt );
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 0d020fc6a5de..efae750942b3 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5361,8 +5361,8 @@ void ScGridWindow::UpdateCopySourceOverlay()
if (!pViewData->ShowPasteSource())
return;
- ::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
- if (!pOverlayManager)
+ rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = getOverlayManager();
+ if (!xOverlayManager.is())
return;
ScTransferObj* pTransObj = ScTransferObj::GetOwnClipboard( pViewData->GetActiveWin() );
if (!pTransObj)
@@ -5400,7 +5400,7 @@ void ScGridWindow::UpdateCopySourceOverlay()
Rectangle aLogic = PixelToLogic(aRect, aDrawMode);
::basegfx::B2DRange aRange(aLogic.Left(), aLogic.Top(), aLogic.Right(), aLogic.Bottom());
ScOverlayDashedBorder* pDashedBorder = new ScOverlayDashedBorder(aRange, aHighlight, this);
- pOverlayManager->add(*pDashedBorder);
+ xOverlayManager->add(*pDashedBorder);
mpOOSelectionBorder->append(*pDashedBorder);
}
@@ -5495,9 +5495,9 @@ void ScGridWindow::UpdateCursorOverlay()
if ( !aPixelRects.empty() )
{
// #i70788# get the OverlayManager safely
- ::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
+ rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = getOverlayManager();
- if(pOverlayManager)
+ if (xOverlayManager.is())
{
Color aCursorColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
if (pViewData->GetActivePart() != eWhich)
@@ -5520,7 +5520,7 @@ void ScGridWindow::UpdateCursorOverlay()
aRanges,
false);
- pOverlayManager->add(*pOverlay);
+ xOverlayManager->add(*pOverlay);
mpOOCursors = new ::sdr::overlay::OverlayObjectList;
mpOOCursors->append(*pOverlay);
}
@@ -5549,9 +5549,9 @@ void ScGridWindow::UpdateSelectionOverlay()
if ( aPixelRects.size() && pViewData->IsActive() )
{
// #i70788# get the OverlayManager safely
- ::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
+ rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = getOverlayManager();
- if(pOverlayManager)
+ if (xOverlayManager.is())
{
std::vector< basegfx::B2DRange > aRanges;
const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
@@ -5590,7 +5590,7 @@ void ScGridWindow::UpdateSelectionOverlay()
aRanges,
true);
- pOverlayManager->add(*pOverlay);
+ xOverlayManager->add(*pOverlay);
mpOOSelection = new ::sdr::overlay::OverlayObjectList;
mpOOSelection->append(*pOverlay);
}
@@ -5647,9 +5647,9 @@ void ScGridWindow::UpdateAutoFillOverlay()
mpAutoFillRect.reset(new Rectangle(aFillPos, Size(6, 6)));
// #i70788# get the OverlayManager safely
- ::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
+ rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = getOverlayManager();
- if(pOverlayManager)
+ if (xOverlayManager.is())
{
Color aHandleColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
if (pViewData->GetActivePart() != eWhich)
@@ -5668,7 +5668,7 @@ void ScGridWindow::UpdateAutoFillOverlay()
aRanges,
false);
- pOverlayManager->add(*pOverlay);
+ xOverlayManager->add(*pOverlay);
mpOOAutoFill = new ::sdr::overlay::OverlayObjectList;
mpOOAutoFill->append(*pOverlay);
}
@@ -5777,9 +5777,9 @@ void ScGridWindow::UpdateDragRectOverlay()
}
// #i70788# get the OverlayManager safely
- ::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
+ rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = getOverlayManager();
- if(pOverlayManager)
+ if (xOverlayManager.is())
{
std::vector< basegfx::B2DRange > aRanges;
const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
@@ -5798,7 +5798,7 @@ void ScGridWindow::UpdateDragRectOverlay()
aRanges,
false);
- pOverlayManager->add(*pOverlay);
+ xOverlayManager->add(*pOverlay);
mpOODragRect = new ::sdr::overlay::OverlayObjectList;
mpOODragRect->append(*pOverlay);
}
@@ -5826,9 +5826,9 @@ void ScGridWindow::UpdateHeaderOverlay()
if ( !aInvertRect.IsEmpty() )
{
// #i70788# get the OverlayManager safely
- ::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
+ rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = getOverlayManager();
- if(pOverlayManager)
+ if (xOverlayManager.is())
{
// Color aHighlight = GetSettings().GetStyleSettings().GetHighlightColor();
std::vector< basegfx::B2DRange > aRanges;
@@ -5844,7 +5844,7 @@ void ScGridWindow::UpdateHeaderOverlay()
aRanges,
false);
- pOverlayManager->add(*pOverlay);
+ xOverlayManager->add(*pOverlay);
mpOOHeader = new ::sdr::overlay::OverlayObjectList;
mpOOHeader->append(*pOverlay);
}
@@ -5896,9 +5896,9 @@ void ScGridWindow::UpdateShrinkOverlay()
if ( !aPixRect.IsEmpty() )
{
// #i70788# get the OverlayManager safely
- ::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
+ rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = getOverlayManager();
- if(pOverlayManager)
+ if (xOverlayManager.is())
{
std::vector< basegfx::B2DRange > aRanges;
const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
@@ -5913,7 +5913,7 @@ void ScGridWindow::UpdateShrinkOverlay()
aRanges,
false);
- pOverlayManager->add(*pOverlay);
+ xOverlayManager->add(*pOverlay);
mpOOShrink = new ::sdr::overlay::OverlayObjectList;
mpOOShrink->append(*pOverlay);
}
@@ -5924,7 +5924,7 @@ void ScGridWindow::UpdateShrinkOverlay()
}
// #i70788# central method to get the OverlayManager safely
-::sdr::overlay::OverlayManager* ScGridWindow::getOverlayManager()
+rtl::Reference<sdr::overlay::OverlayManager> ScGridWindow::getOverlayManager()
{
SdrPageView* pPV = pViewData->GetView()->GetScDrawView()->GetSdrPageView();
@@ -5938,18 +5938,16 @@ void ScGridWindow::UpdateShrinkOverlay()
}
}
- return 0L;
+ return rtl::Reference<sdr::overlay::OverlayManager>();
}
void ScGridWindow::flushOverlayManager()
{
// #i70788# get the OverlayManager safely
- ::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
+ rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = getOverlayManager();
- if(pOverlayManager)
- {
- pOverlayManager->flush();
- }
+ if (xOverlayManager.is())
+ xOverlayManager->flush();
}
// ---------------------------------------------------------------------------
diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx
index ebfa3caf3d34..d4cd4b3b2f54 100644
--- a/sd/source/ui/animations/motionpathtag.cxx
+++ b/sd/source/ui/animations/motionpathtag.cxx
@@ -312,13 +312,14 @@ void SdPathHdl::CreateB2dIAObject()
if(rPageWindow.GetPaintWindow().OutputToWindow())
{
- if(rPageWindow.GetOverlayManager() && mpPathObj)
+ rtl::Reference< ::sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager();
+ if (xManager.is() && mpPathObj)
{
const sdr::contact::ViewContact& rVC = mpPathObj->GetViewContact();
const drawinglayer::primitive2d::Primitive2DSequence aSequence = rVC.getViewIndependentPrimitive2DSequence();
sdr::overlay::OverlayObject* pNew = new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence);
- rPageWindow.GetOverlayManager()->add(*pNew);
+ xManager->add(*pNew);
maOverlayGroup.append(*pNew);
}
}
diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx
index 7a4ee0c0b248..b8381c52539c 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -237,7 +237,8 @@ void AnnotationHdl::CreateB2dIAObject()
const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
SdrPaintWindow& rPaintWindow = rPageWindow.GetPaintWindow();
- if(rPaintWindow.OutputToWindow() && rPageWindow.GetOverlayManager() )
+ rtl::Reference< ::sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager();
+ if(rPaintWindow.OutputToWindow() && xManager.is() )
{
::sdr::overlay::OverlayObject* pOverlayObject = 0;
@@ -259,7 +260,7 @@ void AnnotationHdl::CreateB2dIAObject()
pOverlayObject = new ::sdr::overlay::OverlayBitmapEx( aPosition, aBitmapEx, 0, 0 );
}
- rPageWindow.GetOverlayManager()->add(*pOverlayObject);
+ xManager->add(*pOverlayObject);
maOverlayGroup.append(*pOverlayObject);
}
}
diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx
index 081655f9cd91..236655b6d9fb 100644
--- a/sd/source/ui/view/viewoverlaymanager.cxx
+++ b/sd/source/ui/view/viewoverlaymanager.cxx
@@ -277,12 +277,13 @@ void ImageButtonHdl::CreateB2dIAObject()
const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
SdrPaintWindow& rPaintWindow = rPageWindow.GetPaintWindow();
- if(rPaintWindow.OutputToWindow() && rPageWindow.GetOverlayManager() )
+ rtl::Reference< ::sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager();
+ if(rPaintWindow.OutputToWindow() && xManager.is() )
{
::sdr::overlay::OverlayObject* pOverlayObject = 0;
pOverlayObject = new ::sdr::overlay::OverlayBitmapEx( aPosition, aBitmapEx, 0, 0 );
- rPageWindow.GetOverlayManager()->add(*pOverlayObject);
+ xManager->add(*pOverlayObject);
maOverlayGroup.append(*pOverlayObject);
}
}
diff --git a/svx/inc/svx/sdr/overlay/overlaymanager.hxx b/svx/inc/svx/sdr/overlay/overlaymanager.hxx
index 532b481e81f9..5a525ac209c1 100644
--- a/svx/inc/svx/sdr/overlay/overlaymanager.hxx
+++ b/svx/inc/svx/sdr/overlay/overlaymanager.hxx
@@ -29,6 +29,8 @@
#ifndef _SDR_OVERLAY_OVERLAYMANAGER_HXX
#define _SDR_OVERLAY_OVERLAYMANAGER_HXX
+#include <boost/utility.hpp>
+#include <rtl/ref.hxx>
#include <svx/sdr/animation/scheduler.hxx>
#include <svx/sdr/overlay/overlayobject.hxx>
#include <vcl/mapmod.hxx>
@@ -58,8 +60,13 @@ namespace sdr
{
namespace overlay
{
- class SVX_DLLPUBLIC OverlayManager : public ::sdr::animation::Scheduler
+ class SVX_DLLPUBLIC OverlayManager
+ : private boost::noncopyable
+ , protected ::sdr::animation::Scheduler
+ , public rtl::IReference
{
+ private:
+ oslInterlockedCount mnRefCount;
protected:
// the OutputDevice to work on, set on construction and not to be changed
OutputDevice& rmOutputDevice;
@@ -92,15 +99,18 @@ namespace sdr
// ViewTransformation and evtl. correct mfDiscreteOne
double getDiscreteOne() const;
- public:
// when handing over another OverlayManager at construction, the OverlayObjects
// will be taken over from it. The new one will have added all OverlayObjects
// while the handed over one will have none
OverlayManager(
OutputDevice& rOutputDevice,
- OverlayManager* pOldOverlayManager = 0);
+ OverlayManager* pOldOverlayManager);
virtual ~OverlayManager();
+ public:
+ static rtl::Reference<OverlayManager> create(OutputDevice& rOutputDevice,
+ OverlayManager* pOldOverlayManager = 0);
+
// access to current ViewInformation2D; this call checks and evtl. updates ViewInformation2D
const drawinglayer::geometry::ViewInformation2D getCurrentViewInformation2D() const;
@@ -140,6 +150,11 @@ namespace sdr
// access to maDrawinglayerOpt
const SvtOptionsDrawinglayer& getDrawinglayerOpt() const { return maDrawinglayerOpt; }
+
+ void InsertEvent(sdr::animation::Event* pNew) { Scheduler::InsertEvent(pNew); }
+
+ virtual oslInterlockedCount SAL_CALL acquire();
+ virtual oslInterlockedCount SAL_CALL release();
};
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx b/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx
index d1cec1123cba..6f9c03305063 100644
--- a/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx
+++ b/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx
@@ -70,16 +70,19 @@ namespace sdr
void ImpRestoreBackground(const Region& rRegionPixel) const;
void ImpSaveBackground(const Region& rRegion, OutputDevice* pPreRenderDevice = 0L);
- public:
// when handing over another OverlayManager at construction, the OverlayObjects
// will be taken over from it. The new one will have added all OverlayObjects
// while the handed over one will have none
OverlayManagerBuffered(
OutputDevice& rOutputDevice,
- OverlayManager* pOldOverlayManager = 0,
- bool bRefreshWithPreRendering = false);
+ OverlayManager* pOldOverlayManager,
+ bool bRefreshWithPreRendering);
virtual ~OverlayManagerBuffered();
+ public:
+ static rtl::Reference<OverlayManager> create(OutputDevice& rOutputDevice,
+ OverlayManager* pOldOverlayManager = 0, bool bRefreshWithPreRendering = false);
+
// complete redraw
virtual void completeRedraw(const Region& rRegion, OutputDevice* pPreRenderDevice = 0L) const;
diff --git a/svx/inc/svx/sdr/overlay/overlayobject.hxx b/svx/inc/svx/sdr/overlay/overlayobject.hxx
index 321190931a58..ea4c3e4a4510 100644
--- a/svx/inc/svx/sdr/overlay/overlayobject.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayobject.hxx
@@ -32,6 +32,7 @@
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/range/b2drange.hxx>
#include <tools/color.hxx>
+#include <rtl/ref.hxx>
#include <svx/sdr/animation/scheduler.hxx>
#include "svx/svxdllapi.h"
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
diff --git a/svx/inc/svx/sdrpagewindow.hxx b/svx/inc/svx/sdrpagewindow.hxx
index 7464c1bfb101..88a0a20516d3 100644
--- a/svx/inc/svx/sdrpagewindow.hxx
+++ b/svx/inc/svx/sdrpagewindow.hxx
@@ -34,6 +34,7 @@
#include <com/sun/star/awt/XControlContainer.hpp>
#include <com/sun/star/util/XModeChangeListener.hpp>
#include <cppuhelper/implbase4.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
#include <svx/svdtypes.hxx> // for SdrLayerID
#include <svl/svarray.hxx>
#include <tools/contnr.hxx>
@@ -105,7 +106,7 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > GetControlContainer( bool _bCreateIfNecessary = true ) const;
// OVERLAYMANAGER
- ::sdr::overlay::OverlayManager* GetOverlayManager() const;
+ rtl::Reference< ::sdr::overlay::OverlayManager > GetOverlayManager() const;
// #i72752# allow patcing SdrPaintWindow from SdrPageView::DrawLayer if needed
void patchPaintWindow(SdrPaintWindow& rPaintWindow);
diff --git a/svx/inc/svx/sdrpaintwindow.hxx b/svx/inc/svx/sdrpaintwindow.hxx
index 24388ef324cc..9ecfbed65839 100644
--- a/svx/inc/svx/sdrpaintwindow.hxx
+++ b/svx/inc/svx/sdrpaintwindow.hxx
@@ -29,6 +29,7 @@
#ifndef _SDRPAINTWINDOW_HXX
#define _SDRPAINTWINDOW_HXX
+#include <rtl/ref.hxx>
#include <vcl/virdev.hxx>
#include "svx/svxdllapi.h"
@@ -78,7 +79,7 @@ private:
// the new OverlayManager for the new OverlayObjects. Test add here, will
// replace the IAOManager as soon as it works.
- ::sdr::overlay::OverlayManager* mpOverlayManager;
+ rtl::Reference< ::sdr::overlay::OverlayManager > mxOverlayManager;
// The PreRenderDevice for PreRendering
SdrPreRenderDevice* mpPreRenderDevice;
@@ -90,14 +91,14 @@ private:
// #i72889# flag if this is only a temporary target for repaint, default is false
unsigned mbTemporaryTarget : 1;
- /** Remember whether the mpOverlayManager supports buffering. Using
- this flags expensive dynamic_casts on mpOverlayManager in order to
+ /** Remember whether the mxOverlayManager supports buffering. Using
+ this flags expensive dynamic_casts on mxOverlayManager in order to
detect this.
*/
bool mbUseBuffer;
// helpers
- /** Create mpOverlayManager member on demand.
+ /** Create mxOverlayManager member on demand.
@param bUseBuffer
Specifies whether to use the buffered (OverlayManagerBuffered)
or the unbuffered (OverlayManager) version of the overlay
@@ -119,7 +120,8 @@ public:
OutputDevice& GetOutputDevice() const { return mrOutputDevice; }
// OVERLAYMANAGER
- ::sdr::overlay::OverlayManager* GetOverlayManager() const;
+ rtl::Reference< ::sdr::overlay::OverlayManager > GetOverlayManager() const;
+
// #i73602# add flag if buffer shall be used
void DrawOverlay(const Region& rRegion, bool bUseBuffer);
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index 20509dc70052..869c2f95bdbe 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -176,9 +176,9 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr
for(sal_uInt32 a(0); a < mrView.PaintWindowCount(); a++)
{
SdrPaintWindow* pCandidate = mrView.GetPaintWindow(a);
- ::sdr::overlay::OverlayManager* pTargetOverlay = pCandidate->GetOverlayManager();
+ rtl::Reference< ::sdr::overlay::OverlayManager > xTargetOverlay = pCandidate->GetOverlayManager();
- if(pTargetOverlay)
+ if(xTargetOverlay.is())
{
// buld transfoprmation: translate and rotate so that given edge is
// on x axis, them mirror in y and translate back
@@ -210,7 +210,7 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr
sdr::overlay::OverlayPrimitive2DSequenceObject* pNew = new sdr::overlay::OverlayPrimitive2DSequenceObject(aContent);
- pTargetOverlay->add(*pNew);
+ xTargetOverlay->add(*pNew);
maObjects.append(*pNew);
}
}
@@ -223,7 +223,7 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr
aPolyPolygon.transform(aMatrixTransform);
::sdr::overlay::OverlayPolyPolygonStriped* pNew = new ::sdr::overlay::OverlayPolyPolygonStriped(aPolyPolygon);
- pTargetOverlay->add(*pNew);
+ xTargetOverlay->add(*pNew);
maObjects.append(*pNew);
}
}
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx
index db14b9abb10c..e94f02d4e918 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -176,6 +176,14 @@ namespace sdr
}
}
+ rtl::Reference<OverlayManager> OverlayManager::create(
+ OutputDevice& rOutputDevice,
+ OverlayManager* pOldOverlayManager)
+ {
+ return rtl::Reference<OverlayManager>(new OverlayManager(rOutputDevice,
+ pOldOverlayManager));
+ }
+
const drawinglayer::geometry::ViewInformation2D OverlayManager::getCurrentViewInformation2D() const
{
if(getOutputDevice().GetViewTransformation() != maViewTransformation)
@@ -385,6 +393,20 @@ namespace sdr
ImpStripeDefinitionChanged();
}
}
+
+ oslInterlockedCount OverlayManager::acquire()
+ {
+ return osl_incrementInterlockedCount( &mnRefCount );
+ }
+
+ oslInterlockedCount OverlayManager::release()
+ {
+ oslInterlockedCount nCount( osl_decrementInterlockedCount( &mnRefCount ) );
+ if ( nCount == 0 )
+ delete this;
+ return nCount;
+ }
+
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
index 1a0016fa6b37..933e5e97ca70 100644
--- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
+++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
@@ -219,6 +219,9 @@ namespace sdr
IMPL_LINK(OverlayManagerBuffered, ImpBufferTimerHandler, AutoTimer*, /*pTimer*/)
{
+ //Resolves: fdo#46728 ensure this exists until end of scope
+ rtl::Reference<OverlayManager> xRef(this);
+
// stop timer
maBufferTimer.Stop();
@@ -412,6 +415,15 @@ namespace sdr
maBufferTimer.SetTimeoutHdl(LINK(this, OverlayManagerBuffered, ImpBufferTimerHandler));
}
+ rtl::Reference<OverlayManager> OverlayManagerBuffered::create(
+ OutputDevice& rOutputDevice,
+ OverlayManager* pOldOverlayManager,
+ bool bRefreshWithPreRendering)
+ {
+ return rtl::Reference<OverlayManager>(new OverlayManagerBuffered(rOutputDevice,
+ pOldOverlayManager, bRefreshWithPreRendering));
+ }
+
OverlayManagerBuffered::~OverlayManagerBuffered()
{
// Clear timer
diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx
index 9a4bcac9af51..48d2de4e69bb 100644
--- a/svx/source/svdraw/sdrpagewindow.cxx
+++ b/svx/source/svdraw/sdrpagewindow.cxx
@@ -147,7 +147,7 @@ sdr::contact::ObjectContact* SdrPageWindow::CreateViewSpecificObjectContact()
}
// OVERLAY MANAGER
-::sdr::overlay::OverlayManager* SdrPageWindow::GetOverlayManager() const
+rtl::Reference< ::sdr::overlay::OverlayManager > SdrPageWindow::GetOverlayManager() const
{
return GetPaintWindow().GetOverlayManager();
}
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx
index 1e0311b93939..02186241fc47 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -112,17 +112,17 @@ void SdrPaintWindow::impCreateOverlayManager(const bool bUseBuffer)
// When the buffer usage has changed then we have to create a new
// overlay manager. Save the current one so that later we can move its
// overlay objects to the new one.
- sdr::overlay::OverlayManager* pOldOverlayManager = NULL;
+ rtl::Reference<sdr::overlay::OverlayManager> xOldOverlayManager;
if(mbUseBuffer != bUseBuffer)
{
mbUseBuffer = bUseBuffer;
- pOldOverlayManager = mpOverlayManager;
- mpOverlayManager = NULL;
+ xOldOverlayManager = mxOverlayManager;
+ mxOverlayManager.clear();
}
// not yet one created?
- if(!mpOverlayManager)
+ if(!mxOverlayManager.is())
{
// is it a window?
if(OUTDEV_WINDOW == GetOutputDevice().GetOutDevType())
@@ -135,7 +135,8 @@ void SdrPaintWindow::impCreateOverlayManager(const bool bUseBuffer)
// whether that refresh itself will use a 2nd vdev to avoid flickering.
// Also hand over the old OverlayManager if existent; this means to take over
// the registered OverlayObjects from it
- mpOverlayManager = new ::sdr::overlay::OverlayManagerBuffered(GetOutputDevice(), pOldOverlayManager, true);
+ mxOverlayManager = ::sdr::overlay::OverlayManagerBuffered::create(GetOutputDevice(),
+ xOldOverlayManager.get(), true);
}
else
{
@@ -143,10 +144,11 @@ void SdrPaintWindow::impCreateOverlayManager(const bool bUseBuffer)
// take place
// Also hand over the old OverlayManager if existent; this means to take over
// the registered OverlayObjects from it
- mpOverlayManager = new ::sdr::overlay::OverlayManager(GetOutputDevice(), pOldOverlayManager);
+ mxOverlayManager = ::sdr::overlay::OverlayManager::create(GetOutputDevice(),
+ xOldOverlayManager.get());
}
- OSL_ENSURE(mpOverlayManager, "SdrPaintWindow::SdrPaintWindow: Could not allocate an overlayManager (!)");
+ OSL_ENSURE(mxOverlayManager.is(), "SdrPaintWindow::SdrPaintWindow: Could not allocate an overlayManager (!)");
// Request a repaint so that the buffered overlay manager fills
// its buffer properly. This is a workaround for missing buffer
@@ -164,25 +166,16 @@ void SdrPaintWindow::impCreateOverlayManager(const bool bUseBuffer)
aColB.Invert();
}
- mpOverlayManager->setStripeColorA(aColA);
- mpOverlayManager->setStripeColorB(aColB);
- mpOverlayManager->setStripeLengthPixel(GetPaintView().getOptionsDrawinglayer().GetStripeLength());
+ mxOverlayManager->setStripeColorA(aColA);
+ mxOverlayManager->setStripeColorB(aColB);
+ mxOverlayManager->setStripeLengthPixel(GetPaintView().getOptionsDrawinglayer().GetStripeLength());
}
}
-
- // OverlayObjects are transfered for the in some cases newly created OverlayManager by handing over
- // at construction time
- if(pOldOverlayManager)
- {
- // The old overlay manager is not used any more and can be (has to be) deleted.
- delete pOldOverlayManager;
- }
}
SdrPaintWindow::SdrPaintWindow(SdrPaintView& rNewPaintView, OutputDevice& rOut)
: mrOutputDevice(rOut),
mrPaintView(rNewPaintView),
- mpOverlayManager(0L),
mpPreRenderDevice(0L),
mbTemporaryTarget(false), // #i72889#
mbUseBuffer(true)
@@ -191,24 +184,20 @@ SdrPaintWindow::SdrPaintWindow(SdrPaintView& rNewPaintView, OutputDevice& rOut)
SdrPaintWindow::~SdrPaintWindow()
{
- if(mpOverlayManager)
- {
- delete mpOverlayManager;
- mpOverlayManager = 0L;
- }
+ mxOverlayManager.clear();
DestroyPreRenderDevice();
}
-::sdr::overlay::OverlayManager* SdrPaintWindow::GetOverlayManager() const
+rtl::Reference< ::sdr::overlay::OverlayManager > SdrPaintWindow::GetOverlayManager() const
{
- if(!mpOverlayManager)
+ if(!mxOverlayManager.is())
{
// Create buffered overlay manager by default.
const_cast< SdrPaintWindow* >(this)->impCreateOverlayManager(true);
}
- return mpOverlayManager;
+ return mxOverlayManager;
}
Rectangle SdrPaintWindow::GetVisibleArea() const
@@ -273,15 +262,15 @@ void SdrPaintWindow::DrawOverlay(const Region& rRegion, bool bUseBuffer)
// save the background to get a controlled start into overlay mechanism
impCreateOverlayManager(bUseBuffer);
- if(mpOverlayManager && !OutputToPrinter())
+ if(mxOverlayManager.is() && !OutputToPrinter())
{
if(mpPreRenderDevice && bUseBuffer)
{
- mpOverlayManager->completeRedraw(rRegion, &mpPreRenderDevice->GetPreRenderDevice());
+ mxOverlayManager->completeRedraw(rRegion, &mpPreRenderDevice->GetPreRenderDevice());
}
else
{
- mpOverlayManager->completeRedraw(rRegion);
+ mxOverlayManager->completeRedraw(rRegion);
}
}
}
diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx
index 3d113eda2d74..546f143682da 100644
--- a/svx/source/svdraw/svdcrtv.cxx
+++ b/svx/source/svdraw/svdcrtv.cxx
@@ -76,15 +76,15 @@ ImplConnectMarkerOverlay::ImplConnectMarkerOverlay(const SdrCreateView& rView, S
for(sal_uInt32 a(0L); a < rView.PaintWindowCount(); a++)
{
SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
- ::sdr::overlay::OverlayManager* pTargetOverlay = pCandidate->GetOverlayManager();
+ rtl::Reference< ::sdr::overlay::OverlayManager > xTargetOverlay = pCandidate->GetOverlayManager();
- if(pTargetOverlay)
+ if(xTargetOverlay.is())
{
- Size aHalfLogicSize(pTargetOverlay->getOutputDevice().PixelToLogic(Size(4, 4)));
+ Size aHalfLogicSize(xTargetOverlay->getOutputDevice().PixelToLogic(Size(4, 4)));
// object
::sdr::overlay::OverlayPolyPolygonStriped* pNew = new ::sdr::overlay::OverlayPolyPolygonStriped(aB2DPolyPolygon);
- pTargetOverlay->add(*pNew);
+ xTargetOverlay->add(*pNew);
maObjects.append(*pNew);
// glue points
@@ -109,7 +109,7 @@ ImplConnectMarkerOverlay::ImplConnectMarkerOverlay(const SdrCreateView& rView, S
aTempPolyPoly.append(aTempPoly);
pNew = new ::sdr::overlay::OverlayPolyPolygonStriped(aTempPolyPoly);
- pTargetOverlay->add(*pNew);
+ xTargetOverlay->add(*pNew);
maObjects.append(*pNew);
}
}
@@ -153,9 +153,9 @@ void ImpSdrCreateViewExtraData::CreateAndShowOverlay(const SdrCreateView& rView,
for(sal_uInt32 a(0L); a < rView.PaintWindowCount(); a++)
{
SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
- ::sdr::overlay::OverlayManager* pOverlayManager = pCandidate->GetOverlayManager();
+ rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = pCandidate->GetOverlayManager();
- if(pOverlayManager)
+ if (xOverlayManager.is())
{
if(pObject)
{
@@ -163,14 +163,14 @@ void ImpSdrCreateViewExtraData::CreateAndShowOverlay(const SdrCreateView& rView,
const drawinglayer::primitive2d::Primitive2DSequence aSequence = rVC.getViewIndependentPrimitive2DSequence();
sdr::overlay::OverlayObject* pNew = new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence);
- pOverlayManager->add(*pNew);
+ xOverlayManager->add(*pNew);
maObjects.append(*pNew);
}
if(rPolyPoly.count())
{
::sdr::overlay::OverlayPolyPolygonStriped* pNew = new ::sdr::overlay::OverlayPolyPolygonStriped(rPolyPoly);
- pOverlayManager->add(*pNew);
+ xOverlayManager->add(*pNew);
maObjects.append(*pNew);
}
}
@@ -857,11 +857,11 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, sal_Bool bFull*/)
for(sal_uInt32 a(0); a < PaintWindowCount(); a++)
{
SdrPaintWindow* pCandidate = GetPaintWindow(a);
- sdr::overlay::OverlayManager* pOverlayManager = pCandidate->GetOverlayManager();
+ rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = pCandidate->GetOverlayManager();
- if(pOverlayManager)
+ if (xOverlayManager.is())
{
- pOverlayManager->flush();
+ xOverlayManager->flush();
}
}
}
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index b1d66bf26305..0baddd30db0d 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -829,14 +829,14 @@ void SdrDragView::ShowDragObj()
for(sal_uInt32 a(0); a < PaintWindowCount(); a++)
{
SdrPaintWindow* pCandidate = GetPaintWindow(a);
- sdr::overlay::OverlayManager* pOverlayManager = pCandidate->GetOverlayManager();
+ rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = pCandidate->GetOverlayManager();
- if(pOverlayManager)
+ if (xOverlayManager.is())
{
- mpCurrentSdrDragMethod->CreateOverlayGeometry(*pOverlayManager);
+ mpCurrentSdrDragMethod->CreateOverlayGeometry(*xOverlayManager);
// #i101679# Force changed overlay to be shown
- pOverlayManager->flush();
+ xOverlayManager->flush();
}
}
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 6ac8941b6af7..818f8e7d6056 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -570,7 +570,8 @@ void SdrHdl::CreateB2dIAObject()
aMoveOutsideOffset.X() += aOffset.Height();
}
- if(rPageWindow.GetOverlayManager())
+ rtl::Reference< ::sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager();
+ if (xManager.is())
{
basegfx::B2DPoint aPosition(aPos.X(), aPos.Y());
::sdr::overlay::OverlayObject* pNewOverlayObject = CreateOverlayObject(
@@ -582,7 +583,7 @@ void SdrHdl::CreateB2dIAObject()
// OVERLAYMANAGER
if(pNewOverlayObject)
{
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
+ xManager->add(*pNewOverlayObject);
maOverlayGroup.append(*pNewOverlayObject);
}
}
@@ -929,7 +930,8 @@ void SdrHdlColor::CreateB2dIAObject()
if(rPageWindow.GetPaintWindow().OutputToWindow())
{
- if(rPageWindow.GetOverlayManager())
+ rtl::Reference< ::sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager();
+ if (xManager.is())
{
Bitmap aBmpCol(CreateColorDropper(aMarkerColor));
basegfx::B2DPoint aPosition(aPos.X(), aPos.Y());
@@ -945,7 +947,7 @@ void SdrHdlColor::CreateB2dIAObject()
// OVERLAYMANAGER
if(pNewOverlayObject)
{
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
+ xManager->add(*pNewOverlayObject);
maOverlayGroup.append(*pNewOverlayObject);
}
}
@@ -1096,7 +1098,8 @@ void SdrHdlGradient::CreateB2dIAObject()
if(rPageWindow.GetPaintWindow().OutputToWindow())
{
- if(rPageWindow.GetOverlayManager())
+ rtl::Reference< ::sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager();
+ if (xManager.is())
{
// striped line in between
basegfx::B2DVector aVec(a2ndPos.X() - aPos.X(), a2ndPos.Y() - aPos.Y());
@@ -1119,7 +1122,7 @@ void SdrHdlGradient::CreateB2dIAObject()
DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
pNewOverlayObject->setBaseColor(IsGradient() ? Color(COL_BLACK) : Color(COL_BLUE));
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
+ xManager->add(*pNewOverlayObject);
maOverlayGroup.append(*pNewOverlayObject);
// arrowhead
@@ -1141,7 +1144,7 @@ void SdrHdlGradient::CreateB2dIAObject()
);
DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
+ xManager->add(*pNewOverlayObject);
maOverlayGroup.append(*pNewOverlayObject);
}
}
@@ -1255,7 +1258,8 @@ void SdrHdlLine::CreateB2dIAObject()
if(rPageWindow.GetPaintWindow().OutputToWindow())
{
- if(rPageWindow.GetOverlayManager())
+ rtl::Reference< ::sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager();
+ if (xManager.is())
{
basegfx::B2DPoint aPosition1(pHdl1->GetPos().X(), pHdl1->GetPos().Y());
basegfx::B2DPoint aPosition2(pHdl2->GetPos().X(), pHdl2->GetPos().Y());
@@ -1273,7 +1277,7 @@ void SdrHdlLine::CreateB2dIAObject()
// color(?)
pNewOverlayObject->setBaseColor(Color(COL_LIGHTRED));
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
+ xManager->add(*pNewOverlayObject);
maOverlayGroup.append(*pNewOverlayObject);
}
}
@@ -1315,7 +1319,8 @@ void SdrHdlBezWgt::CreateB2dIAObject()
if(rPageWindow.GetPaintWindow().OutputToWindow())
{
- if(rPageWindow.GetOverlayManager())
+ rtl::Reference< ::sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager();
+ if (xManager.is())
{
basegfx::B2DPoint aPosition1(pHdl1->GetPos().X(), pHdl1->GetPos().Y());
basegfx::B2DPoint aPosition2(aPos.X(), aPos.Y());
@@ -1338,7 +1343,7 @@ void SdrHdlBezWgt::CreateB2dIAObject()
// color(?)
pNewOverlayObject->setBaseColor(Color(COL_LIGHTBLUE));
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
+ xManager->add(*pNewOverlayObject);
maOverlayGroup.append(*pNewOverlayObject);
}
}
@@ -1376,20 +1381,20 @@ void E3dVolumeMarker::CreateB2dIAObject()
if(rPageWindow.GetPaintWindow().OutputToWindow())
{
- if(rPageWindow.GetOverlayManager() && aWireframePoly.count())
- {
- ::sdr::overlay::OverlayObject* pNewOverlayObject = new
- ::sdr::overlay::OverlayPolyPolygonStriped(aWireframePoly);
- DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
+ rtl::Reference< ::sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager();
+ if (xManager.is() && aWireframePoly.count())
+ {
+ ::sdr::overlay::OverlayObject* pNewOverlayObject = new
+ ::sdr::overlay::OverlayPolyPolygonStriped(aWireframePoly);
+ DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
- // OVERLAYMANAGER
- if(pNewOverlayObject)
- {
- pNewOverlayObject->setBaseColor(Color(COL_BLACK));
+ // OVERLAYMANAGER
+ if(pNewOverlayObject)
+ {
+ pNewOverlayObject->setBaseColor(Color(COL_BLACK));
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
- maOverlayGroup.append(*pNewOverlayObject);
- }
+ xManager->add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
}
}
}
@@ -1397,6 +1402,7 @@ void E3dVolumeMarker::CreateB2dIAObject()
}
}
}
+}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1441,7 +1447,8 @@ void ImpEdgeHdl::CreateB2dIAObject()
if(rPageWindow.GetPaintWindow().OutputToWindow())
{
- if(rPageWindow.GetOverlayManager())
+ rtl::Reference< ::sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager();
+ if (xManager.is())
{
basegfx::B2DPoint aPosition(aPos.X(), aPos.Y());
@@ -1453,7 +1460,7 @@ void ImpEdgeHdl::CreateB2dIAObject()
// OVERLAYMANAGER
if(pNewOverlayObject)
{
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
+ xManager->add(*pNewOverlayObject);
maOverlayGroup.append(*pNewOverlayObject);
}
}
@@ -1561,7 +1568,8 @@ void ImpMeasureHdl::CreateB2dIAObject()
if(rPageWindow.GetPaintWindow().OutputToWindow())
{
- if(rPageWindow.GetOverlayManager())
+ rtl::Reference< ::sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager();
+ if (xManager.is())
{
basegfx::B2DPoint aPosition(aPos.X(), aPos.Y());
@@ -1573,7 +1581,7 @@ void ImpMeasureHdl::CreateB2dIAObject()
// OVERLAYMANAGER
if(pNewOverlayObject)
{
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
+ xManager->add(*pNewOverlayObject);
maOverlayGroup.append(*pNewOverlayObject);
}
}
@@ -1624,7 +1632,8 @@ void ImpTextframeHdl::CreateB2dIAObject()
if(rPageWindow.GetPaintWindow().OutputToWindow())
{
- if(rPageWindow.GetOverlayManager())
+ rtl::Reference< ::sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager();
+ if (xManager.is())
{
const basegfx::B2DPoint aTopLeft(maRect.Left(), maRect.Top());
const basegfx::B2DPoint aBottomRight(maRect.Right(), maRect.Bottom());
@@ -1644,7 +1653,7 @@ void ImpTextframeHdl::CreateB2dIAObject()
// OVERLAYMANAGER
if(pNewOverlayObject)
{
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
+ xManager->add(*pNewOverlayObject);
maOverlayGroup.append(*pNewOverlayObject);
}
}
@@ -2264,7 +2273,8 @@ void SdrCropHdl::CreateB2dIAObject()
if(rPageWindow.GetPaintWindow().OutputToWindow())
{
- if(rPageWindow.GetOverlayManager())
+ rtl::Reference< ::sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager();
+ if (xManager.is())
{
basegfx::B2DPoint aPosition(aPos.X(), aPos.Y());
@@ -2297,7 +2307,7 @@ void SdrCropHdl::CreateB2dIAObject()
// OVERLAYMANAGER
if(pOverlayObject)
{
- rPageWindow.GetOverlayManager()->add(*pOverlayObject);
+ xManager->add(*pOverlayObject);
maOverlayGroup.append(*pOverlayObject);
}
}
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 3729c02b5f7e..9ef1e738745b 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -93,13 +93,13 @@ ImplMarkingOverlay::ImplMarkingOverlay(const SdrPaintView& rView, const basegfx:
for(sal_uInt32 a(0L); a < rView.PaintWindowCount(); a++)
{
SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
- ::sdr::overlay::OverlayManager* pTargetOverlay = pCandidate->GetOverlayManager();
+ rtl::Reference< ::sdr::overlay::OverlayManager > xTargetOverlay = pCandidate->GetOverlayManager();
- if(pTargetOverlay)
+ if (xTargetOverlay.is())
{
::sdr::overlay::OverlayRollingRectangleStriped* pNew = new ::sdr::overlay::OverlayRollingRectangleStriped(
rStartPos, rStartPos, false);
- pTargetOverlay->add(*pNew);
+ xTargetOverlay->add(*pNew);
maObjects.append(*pNew);
}
}
diff --git a/svx/source/svdraw/svdsnpv.cxx b/svx/source/svdraw/svdsnpv.cxx
index fb8157bd9004..52c37a187f80 100644
--- a/svx/source/svdraw/svdsnpv.cxx
+++ b/svx/source/svdraw/svdsnpv.cxx
@@ -64,13 +64,13 @@ ImplPageOriginOverlay::ImplPageOriginOverlay(const SdrPaintView& rView, const ba
for(sal_uInt32 a(0L); a < rView.PaintWindowCount(); a++)
{
SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
- ::sdr::overlay::OverlayManager* pTargetOverlay = pCandidate->GetOverlayManager();
+ rtl::Reference< ::sdr::overlay::OverlayManager > xTargetOverlay = pCandidate->GetOverlayManager();
- if(pTargetOverlay)
+ if (xTargetOverlay.is())
{
::sdr::overlay::OverlayCrosshairStriped* aNew = new ::sdr::overlay::OverlayCrosshairStriped(
maPosition);
- pTargetOverlay->add(*aNew);
+ xTargetOverlay->add(*aNew);
maObjects.append(*aNew);
}
}
@@ -142,13 +142,13 @@ ImplHelpLineOverlay::ImplHelpLineOverlay(
for(sal_uInt32 a(0L); a < rView.PaintWindowCount(); a++)
{
SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
- ::sdr::overlay::OverlayManager* pTargetOverlay = pCandidate->GetOverlayManager();
+ rtl::Reference< ::sdr::overlay::OverlayManager > xTargetOverlay = pCandidate->GetOverlayManager();
- if(pTargetOverlay)
+ if (xTargetOverlay.is())
{
::sdr::overlay::OverlayHelplineStriped* aNew = new ::sdr::overlay::OverlayHelplineStriped(
maPosition, meHelpLineKind);
- pTargetOverlay->add(*aNew);
+ xTargetOverlay->add(*aNew);
maObjects.append(*aNew);
}
}
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index e7ffe85f2a09..074669421536 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -104,13 +104,13 @@ void SdrDropMarkerOverlay::ImplCreateOverlays(const SdrView& rView, const basegf
for(sal_uInt32 a(0L); a < rView.PaintWindowCount(); a++)
{
SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
- ::sdr::overlay::OverlayManager* pTargetOverlay = pCandidate->GetOverlayManager();
+ rtl::Reference< ::sdr::overlay::OverlayManager > xTargetOverlay = pCandidate->GetOverlayManager();
- if(pTargetOverlay)
+ if (xTargetOverlay.is())
{
::sdr::overlay::OverlayPolyPolygonStriped* pNew = new ::sdr::overlay::OverlayPolyPolygonStriped(
rPolyPolygon);
- pTargetOverlay->add(*pNew);
+ xTargetOverlay->add(*pNew);
maObjects.append(*pNew);
}
}
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 736e40041148..f3ca36ff81ca 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -1935,15 +1935,15 @@ void SvxTableController::updateSelectionOverlay()
SdrPaintWindow* pPaintWindow = mpView->GetPaintWindow(nIndex);
if( pPaintWindow )
{
- ::sdr::overlay::OverlayManager* pOverlayManager = pPaintWindow->GetOverlayManager();
- if( pOverlayManager )
+ rtl::Reference < ::sdr::overlay::OverlayManager > xOverlayManager = pPaintWindow->GetOverlayManager();
+ if( xOverlayManager.is() )
{
// sdr::overlay::CellOverlayType eType = sdr::overlay::CELL_OVERLAY_INVERT;
sdr::overlay::CellOverlayType eType = sdr::overlay::CELL_OVERLAY_TRANSPARENT;
sdr::overlay::OverlayObjectCell* pOverlay = new sdr::overlay::OverlayObjectCell( eType, aHighlight, aRanges );
- pOverlayManager->add(*pOverlay);
+ xOverlayManager->add(*pOverlay);
mpSelectionOverlay = new ::sdr::overlay::OverlayObjectList;
mpSelectionOverlay->append(*pOverlay);
}
diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx
index 73a980ac06c3..7b1db08662ac 100644
--- a/svx/source/table/tablehandles.cxx
+++ b/svx/source/table/tablehandles.cxx
@@ -181,13 +181,14 @@ void TableEdgeHdl::CreateB2dIAObject()
if(rPageWindow.GetPaintWindow().OutputToWindow())
{
- if(rPageWindow.GetOverlayManager())
+ rtl::Reference< ::sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager();
+ if (xManager.is())
{
if(aVisible.count())
{
// create overlay object for visible parts
sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableEdge(aVisible, true);
- rPageWindow.GetOverlayManager()->add(*pOverlayObject);
+ xManager->add(*pOverlayObject);
maOverlayGroup.append(*pOverlayObject);
}
@@ -197,7 +198,7 @@ void TableEdgeHdl::CreateB2dIAObject()
// a standard HitTest using the primitives from that overlay object
// (see OverlayTableEdge implementation)
sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableEdge(aInvisible, false);
- rPageWindow.GetOverlayManager()->add(*pOverlayObject);
+ xManager->add(*pOverlayObject);
maOverlayGroup.append(*pOverlayObject);
}
}
@@ -286,7 +287,8 @@ void TableBorderHdl::CreateB2dIAObject()
if(rPageWindow.GetPaintWindow().OutputToWindow())
{
- if(rPageWindow.GetOverlayManager())
+ rtl::Reference< ::sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager();
+ if (xManager.is())
{
const basegfx::B2DRange aRange(vcl::unotools::b2DRectangleFromRectangle(maRectangle));
sdr::overlay::OverlayObject* pOverlayObject = new sdr::overlay::OverlayHatchRect(
@@ -298,7 +300,7 @@ void TableBorderHdl::CreateB2dIAObject()
45 * F_PI180,
0.0);
- rPageWindow.GetOverlayManager()->add(*pOverlayObject);
+ xManager->add(*pOverlayObject);
maOverlayGroup.append(*pOverlayObject);
}
}
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 231f3493d4be..cbefb9f55135 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -345,9 +345,9 @@ void SwSelPaintRects::Show()
else if(Count())
{
SdrPaintWindow* pCandidate = pView->GetPaintWindow(0);
- sdr::overlay::OverlayManager* pTargetOverlay = pCandidate->GetOverlayManager();
+ rtl::Reference< ::sdr::overlay::OverlayManager > xTargetOverlay = pCandidate->GetOverlayManager();
- if(pTargetOverlay)
+ if (xTargetOverlay.is())
{
// #i97672# get the system's highlight color and limit it to the maximum
// allowed luminance. This is needed to react on too bright highlight colors
@@ -377,7 +377,7 @@ void SwSelPaintRects::Show()
aNewRanges,
true);
- pTargetOverlay->add(*mpCursorOverlay);
+ xTargetOverlay->add(*mpCursorOverlay);
}
}
}
diff --git a/sw/source/ui/docvw/AnchorOverlayObject.cxx b/sw/source/ui/docvw/AnchorOverlayObject.cxx
index 9764a13f0fb3..abd549bedea5 100644
--- a/sw/source/ui/docvw/AnchorOverlayObject.cxx
+++ b/sw/source/ui/docvw/AnchorOverlayObject.cxx
@@ -258,9 +258,9 @@ ImplPrimitrive2DIDBlock(AnchorPrimitive, PRIMITIVE2D_ID_SWSIDEBARANCHORPRIMITIVE
SdrPaintWindow* pPaintWindow = rDocView.GetDrawView()->GetPaintWindow(0);
if( pPaintWindow )
{
- sdr::overlay::OverlayManager* pOverlayManager = pPaintWindow->GetOverlayManager();
+ rtl::Reference< ::sdr::overlay::OverlayManager > xOverlayManager = pPaintWindow->GetOverlayManager();
- if ( pOverlayManager )
+ if ( xOverlayManager.is() )
{
pAnchorOverlayObject = new AnchorOverlayObject(
basegfx::B2DPoint( aAnchorRect.Left() , aAnchorRect.Bottom()-5*15),
@@ -273,7 +273,7 @@ ImplPrimitrive2DIDBlock(AnchorPrimitive, PRIMITIVE2D_ID_SWSIDEBARANCHORPRIMITIVE
aColorAnchor,
false,
false);
- pOverlayManager->add(*pAnchorOverlayObject);
+ xOverlayManager->add(*pAnchorOverlayObject);
}
}
}
diff --git a/sw/source/ui/docvw/ShadowOverlayObject.cxx b/sw/source/ui/docvw/ShadowOverlayObject.cxx
index 33780649cf66..712cfa56232b 100644
--- a/sw/source/ui/docvw/ShadowOverlayObject.cxx
+++ b/sw/source/ui/docvw/ShadowOverlayObject.cxx
@@ -188,15 +188,15 @@ ImplPrimitrive2DIDBlock(ShadowPrimitive, PRIMITIVE2D_ID_SWSIDEBARSHADOWPRIMITIVE
SdrPaintWindow* pPaintWindow = rDocView.GetDrawView()->GetPaintWindow(0);
if( pPaintWindow )
{
- sdr::overlay::OverlayManager* pOverlayManager = pPaintWindow->GetOverlayManager();
+ rtl::Reference< ::sdr::overlay::OverlayManager > xOverlayManager = pPaintWindow->GetOverlayManager();
- if ( pOverlayManager )
+ if ( xOverlayManager.is() )
{
pShadowOverlayObject = new ShadowOverlayObject( basegfx::B2DPoint(0,0),
basegfx::B2DPoint(0,0),
Color(0,0,0),
SS_NORMAL );
- pOverlayManager->add(*pShadowOverlayObject);
+ xOverlayManager->add(*pShadowOverlayObject);
}
}
}