Kaydet (Commit) e66e004c authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in ScPreviewShell

Change-Id: I95c248755200ab1651faa82f00d49f1ca8e04191
Reviewed-on: https://gerrit.libreoffice.org/57201
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 6b8a1a6f
......@@ -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 );
......
......@@ -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 );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment