summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-04 11:01:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-10 08:31:21 +0200
commite66e004cc00c4616732bbac6500463be30a19643 (patch)
treebe868dc40726b19d2885e5ff6303aa1fcf9596d7
parent6b8a1a6fa77f910a2537958799bbdbac96e0bb57 (diff)
loplugin:useuniqueptr in ScPreviewShell
Change-Id: I95c248755200ab1651faa82f00d49f1ca8e04191 Reviewed-on: https://gerrit.libreoffice.org/57201 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/source/ui/inc/prevwsh.hxx2
-rw-r--r--sc/source/ui/view/prevwsh.cxx7
2 files changed, 4 insertions, 5 deletions
diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx
index 85b5afdf1044..da22608854fd 100644
--- a/sc/source/ui/inc/prevwsh.hxx
+++ b/sc/source/ui/inc/prevwsh.hxx
@@ -50,7 +50,7 @@ class SC_DLLPUBLIC ScPreviewShell: public SfxViewShell
SvxZoomType eZoom;
long nMaxVertPos;
- SfxBroadcaster* pAccessibilityBroadcaster;
+ std::unique_ptr<SfxBroadcaster> pAccessibilityBroadcaster;
bool GetPageSize( Size& aPageSize );
private:
void Construct( vcl::Window* pParent );
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 53c017e4fe2b..735e715311b7 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -151,8 +151,7 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame,
pDocShell( static_cast<ScDocShell*>(pViewFrame->GetObjectShell()) ),
mpFrameWindow(nullptr),
nSourceDesignMode( TRISTATE_INDET ),
- nMaxVertPos(0),
- pAccessibilityBroadcaster( nullptr )
+ nMaxVertPos(0)
{
Construct( &pViewFrame->GetWindow() );
@@ -185,7 +184,7 @@ ScPreviewShell::~ScPreviewShell()
// #108333#; notify Accessibility that Shell is dying and before destroy all
BroadcastAccessibility( SfxHint( SfxHintId::Dying ) );
- DELETEZ(pAccessibilityBroadcaster);
+ pAccessibilityBroadcaster.reset();
SfxBroadcaster* pDrawBC = pDocShell->GetDocument().GetDrawBroadcaster();
if (pDrawBC)
@@ -1135,7 +1134,7 @@ void ScPreviewShell::ExitPreview()
void ScPreviewShell::AddAccessibilityObject( SfxListener& rObject )
{
if (!pAccessibilityBroadcaster)
- pAccessibilityBroadcaster = new SfxBroadcaster;
+ pAccessibilityBroadcaster.reset( new SfxBroadcaster );
rObject.StartListening( *pAccessibilityBroadcaster );
}