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

loplugin:useuniqueptr in AnnotationWindow

Change-Id: I3ea0b0ed28e85e7f8cf00e73b6698a5773c886ba
Reviewed-on: https://gerrit.libreoffice.org/56197
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 6621c3c6
......@@ -285,8 +285,8 @@ AnnotationWindow::~AnnotationWindow()
void AnnotationWindow::dispose()
{
mpMeta.disposeAndClear();
delete mpOutlinerView;
delete mpOutliner;
mpOutlinerView.reset();
mpOutliner.reset();
mpOutliner = nullptr;
mpVScrollbar.disposeAndClear();
mpTextWindow.disposeAndClear();
......@@ -316,8 +316,8 @@ void AnnotationWindow::InitControls()
aSettings.SetStyleSettings(aStyleSettings);
mpMeta->SetSettings(aSettings);
mpOutliner = new ::Outliner(GetAnnotationPool(),OutlinerMode::TextObject);
SdDrawDocument::SetCalcFieldValueHdl( mpOutliner );
mpOutliner.reset( new ::Outliner(GetAnnotationPool(),OutlinerMode::TextObject) );
SdDrawDocument::SetCalcFieldValueHdl( mpOutliner.get() );
mpOutliner->SetUpdateMode( true );
Rescale();
......@@ -328,9 +328,9 @@ void AnnotationWindow::InitControls()
}
mpTextWindow->EnableRTL( false );
mpOutlinerView = new OutlinerView ( mpOutliner, mpTextWindow );
mpOutliner->InsertView(mpOutlinerView );
mpTextWindow->SetOutlinerView(mpOutlinerView);
mpOutlinerView.reset( new OutlinerView ( mpOutliner.get(), mpTextWindow ) );
mpOutliner->InsertView(mpOutlinerView.get() );
mpTextWindow->SetOutlinerView(mpOutlinerView.get());
mpOutlinerView->SetOutputArea( PixelToLogic( ::tools::Rectangle(0,0,1,1) ) );
//create Scrollbars
......
......@@ -78,8 +78,8 @@ class AnnotationWindow : public FloatingWindow
DrawDocShell* mpDocShell;
SdDrawDocument* mpDoc;
OutlinerView* mpOutlinerView;
::Outliner* mpOutliner;
std::unique_ptr<OutlinerView> mpOutlinerView;
std::unique_ptr<::Outliner> mpOutliner;
VclPtr<ScrollBar> mpVScrollbar;
css::uno::Reference< css::office::XAnnotation > mxAnnotation;
bool mbReadonly;
......@@ -105,8 +105,8 @@ class AnnotationWindow : public FloatingWindow
void ExecuteSlot( sal_uInt16 nSID );
DrawDocShell* DocShell() { return mpDocShell; }
OutlinerView* getView() { return mpOutlinerView; }
::Outliner* Engine() { return mpOutliner; }
OutlinerView* getView() { return mpOutlinerView.get(); }
::Outliner* Engine() { return mpOutliner.get(); }
SdDrawDocument* Doc() { return mpDoc; }
long GetPostItTextHeight();
......
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