summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-03-31 23:04:14 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-04-10 13:40:25 +0100
commit8a65284fe31e6c0a927cb88b75df7845cd248572 (patch)
tree0427685579288f412d1890619e8bc224339bb228 /sd/source/ui
parentd46e0d9656670dcd7dcca2f32062606400ff6246 (diff)
Automated conversion of VclPtr construction to use Instance template.
Change-Id: I8be9141b9653e73ebd23a5a3d810f240c376f97e
Diffstat (limited to 'sd/source/ui')
-rw-r--r--sd/source/ui/animations/CustomAnimationDialog.cxx2
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.cxx4
-rw-r--r--sd/source/ui/animations/SlideTransitionPane.cxx2
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx2
-rw-r--r--sd/source/ui/annotations/annotationtag.cxx2
-rw-r--r--sd/source/ui/dlg/PhotoAlbumDialog.cxx4
-rw-r--r--sd/source/ui/dlg/animobjs.cxx4
-rw-r--r--sd/source/ui/dlg/brkdlg.cxx2
-rw-r--r--sd/source/ui/dlg/custsdlg.cxx4
-rw-r--r--sd/source/ui/dlg/docprev.cxx2
-rw-r--r--sd/source/ui/dlg/sdpreslt.cxx2
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx2
-rw-r--r--sd/source/ui/dlg/tpoption.cxx2
-rw-r--r--sd/source/ui/docshell/docshel2.cxx2
-rw-r--r--sd/source/ui/func/fuinsert.cxx2
-rw-r--r--sd/source/ui/func/fuinsfil.cxx6
-rw-r--r--sd/source/ui/slideshow/showwin.cxx2
-rw-r--r--sd/source/ui/slidesorter/controller/SlsClipboard.cxx2
-rw-r--r--sd/source/ui/view/Outliner.cxx4
-rw-r--r--sd/source/ui/view/drviews2.cxx2
-rw-r--r--sd/source/ui/view/drviews6.cxx2
-rw-r--r--sd/source/ui/view/drviews9.cxx2
22 files changed, 29 insertions, 29 deletions
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index f0aba1483ff3..9f0bad85b88f 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -1548,7 +1548,7 @@ void CustomAnimationEffectTabPage::openSoundFileDialog()
{
OUString aStrWarning(SD_RESSTR(STR_WARNING_NOSOUNDFILE));
aStrWarning = aStrWarning.replaceFirst("%", aFile);
- ScopedVclPtr<WarningBox> aWarningBox(new WarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning ));
+ ScopedVclPtrInstance< WarningBox > aWarningBox( nullptr, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning );
aWarningBox->SetModalInputMode (true);
bQuitLoop = aWarningBox->Execute() != RET_RETRY;
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 047507f5693c..3532be1cdf6c 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -1573,7 +1573,7 @@ void CustomAnimationPane::showOptions(const OString& sPage)
{
STLPropertySet* pSet = createSelectionSet();
- VclPtr<CustomAnimationDialog> pDlg(new CustomAnimationDialog(this, pSet, sPage));
+ VclPtrInstance< CustomAnimationDialog > pDlg(this, pSet, sPage);
if( pDlg->Execute() )
{
addUndo();
@@ -1752,7 +1752,7 @@ void CustomAnimationPane::onChange( bool bCreate )
}
}
- VclPtr<CustomAnimationCreateDialog> pDlg(new CustomAnimationCreateDialog( this, this, aTargets, bHasText, sPresetId, fDuration ));
+ VclPtrInstance< CustomAnimationCreateDialog > pDlg( this, this, aTargets, bHasText, sPresetId, fDuration );
if( pDlg->Execute() )
{
addUndo();
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index 9a5a28549b0b..9f83e71aaf2f 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -743,7 +743,7 @@ void SlideTransitionPane::openSoundFileDialog()
{
OUString aStrWarning(SD_RESSTR(STR_WARNING_NOSOUNDFILE));
aStrWarning = aStrWarning.replaceFirst("%", aFile);
- ScopedVclPtr<WarningBox> aWarningBox(new WarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning ));
+ ScopedVclPtrInstance< WarningBox > aWarningBox( nullptr, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning );
aWarningBox->SetModalInputMode (true);
bQuitLoop = (aWarningBox->Execute() != RET_RETRY);
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index 9ac354940fb1..112b55922445 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -694,7 +694,7 @@ void AnnotationManagerImpl::SelectNextAnnotation(bool bForeward)
// Pop up question box that asks the user whether to wrap around.
// The dialog is made modal with respect to the whole application.
- ScopedVclPtr<QueryBox> aQuestionBox (new QueryBox( NULL, (WB_YES_NO | WB_DEF_YES), SD_RESSTR(nStringId)));
+ ScopedVclPtrInstance< QueryBox > aQuestionBox( nullptr, (WB_YES_NO | WB_DEF_YES), SD_RESSTR(nStringId));
aQuestionBox->SetImage( QueryBox::GetStandardImage() );
if (aQuestionBox->Execute() != RET_YES)
break;
diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx
index 62ee8dace947..5b94e7c9910b 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -515,7 +515,7 @@ void AnnotationTag::deselect()
BitmapEx AnnotationTag::CreateAnnotationBitmap( bool bSelected )
{
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
OUString sAuthor( getInitials( mxAnnotation->getAuthor() ) );
sAuthor += OUString( ' ' );
diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
index ddc8b9b9fb90..ecf89cf9054f 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
@@ -105,7 +105,7 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl)
{
if (pImagesLst->GetEntryCount() == 0)
{
- ScopedVclPtr<WarningBox> aWarning(new WarningBox(this, WB_OK, SD_RESSTR(STR_PHOTO_ALBUM_EMPTY_WARNING)));
+ ScopedVclPtrInstance< WarningBox > aWarning(this, WB_OK, SD_RESSTR(STR_PHOTO_ALBUM_EMPTY_WARNING));
aWarning->Execute();
}
else
@@ -462,7 +462,7 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl)
}
else
{
- ScopedVclPtr<InfoBox> aInfo(new InfoBox(this, OUString("Function is not implemented!")));
+ ScopedVclPtrInstance< InfoBox > aInfo(this, OUString("Function is not implemented!"));
aInfo->Execute();
}
EndDialog();
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index 3fcebfbff8e9..47f785e5e038 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -455,7 +455,7 @@ IMPL_LINK( AnimationWindow, ClickRemoveBitmapHdl, void *, pBtn )
}
else // delete everything
{
- ScopedVclPtr<WarningBox> aWarnBox(new WarningBox( this, WB_YES_NO, SD_RESSTR( STR_ASK_DELETE_ALL_PICTURES ) ));
+ ScopedVclPtrInstance< WarningBox > aWarnBox( this, WB_YES_NO, SD_RESSTR( STR_ASK_DELETE_ALL_PICTURES ) );
short nReturn = aWarnBox->Execute();
if( nReturn == RET_YES )
@@ -548,7 +548,7 @@ void AnimationWindow::UpdateControl(bool const bDisableCtrls)
static_cast<SdrObject*>(pPage->GetObj(m_nCurrentFrame));
if( pObject )
{
- ScopedVclPtr<VirtualDevice> pVD(new VirtualDevice());
+ ScopedVclPtrInstance< VirtualDevice > pVD;
Rectangle aObjRect( pObject->GetCurrentBoundRect() );
Size aObjSize( aObjRect.GetSize() );
Point aOrigin( Point( -aObjRect.Left(), -aObjRect.Top() ) );
diff --git a/sd/source/ui/dlg/brkdlg.cxx b/sd/source/ui/dlg/brkdlg.cxx
index 4cd524707300..7a961dbe1379 100644
--- a/sd/source/ui/dlg/brkdlg.cxx
+++ b/sd/source/ui/dlg/brkdlg.cxx
@@ -103,7 +103,7 @@ IMPL_LINK( BreakDlg, UpDate, void*, nInit )
// update status bar or show a error message?
if(nInit == reinterpret_cast<void*>(1L))
{
- ScopedVclPtr<MessageDialog> aErrBox(new MessageDialog(this, SD_RESSTR(STR_BREAK_FAIL)));
+ ScopedVclPtrInstance< MessageDialog > aErrBox(this, SD_RESSTR(STR_BREAK_FAIL));
aErrBox->Execute();
}
else
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index 00cec79e80a2..d8a98f413f39 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -126,7 +126,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
if( p == m_pBtnNew )
{
pCustomShow = NULL;
- ScopedVclPtr<SdDefineCustomShowDlg> aDlg(new SdDefineCustomShowDlg( this, rDoc, pCustomShow ));
+ ScopedVclPtrInstance< SdDefineCustomShowDlg > aDlg( this, rDoc, pCustomShow );
if( aDlg->Execute() == RET_OK )
{
if( pCustomShow )
@@ -154,7 +154,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
{
DBG_ASSERT( pCustomShowList, "pCustomShowList does not exist" );
pCustomShow = (*pCustomShowList)[ nPos ];
- ScopedVclPtr<SdDefineCustomShowDlg> aDlg(new SdDefineCustomShowDlg( this, rDoc, pCustomShow ));
+ ScopedVclPtrInstance< SdDefineCustomShowDlg > aDlg( this, rDoc, pCustomShow );
if( aDlg->Execute() == RET_OK )
{
diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx
index f772bb97c22e..e0895092d7fb 100644
--- a/sd/source/ui/dlg/docprev.cxx
+++ b/sd/source/ui/dlg/docprev.cxx
@@ -241,7 +241,7 @@ void SdDocPreviewWin::updateViewSettings()
pMtf = new GDIMetaFile;
- ScopedVclPtr<VirtualDevice> pVDev(new VirtualDevice());
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
const Fraction aFrac( pDoc->GetScaleFraction() );
const MapMode aMap( pDoc->GetScaleUnit(), Point(), aFrac, aFrac );
diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx
index 9237de3f9cfe..51206936dd07 100644
--- a/sd/source/ui/dlg/sdpreslt.cxx
+++ b/sd/source/ui/dlg/sdpreslt.cxx
@@ -179,7 +179,7 @@ IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLayoutHdl)
*/
IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLoadHdl)
{
- VclPtr<SfxNewFileDialog> pDlg(new SfxNewFileDialog(this, SFXWB_PREVIEW));
+ VclPtrInstance< SfxNewFileDialog > pDlg(this, SFXWB_PREVIEW);
pDlg->SetText(SD_RESSTR(STR_LOAD_PRESENTATION_LAYOUT));
if(!IsReallyVisible())
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 9afcdcfc7176..2bea6ebf5cda 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1012,7 +1012,7 @@ SdDrawDocument* SdPageObjsTLB::GetBookmarkDoc(SfxMedium* pMed)
if ( !mpBookmarkDoc )
{
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(this, SD_RESSTR(STR_READ_DATA_ERROR)));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(this, SD_RESSTR(STR_READ_DATA_ERROR));
aErrorBox->Execute();
mpMedium = 0; //On failure the SfxMedium is invalid
}
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index 4f4e783515e6..a6bcae748d0b 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -373,7 +373,7 @@ int SdTpOptionsMisc::DeactivatePage( SfxItemSet* pActiveSet )
FillItemSet( pActiveSet );
return LEAVE_PAGE;
}
- ScopedVclPtr<WarningBox> aWarnBox(new WarningBox( GetParent(), WB_YES_NO, SD_RESSTR( STR_WARN_SCALE_FAIL ) ));
+ ScopedVclPtrInstance< WarningBox > aWarnBox( GetParent(), WB_YES_NO, SD_RESSTR( STR_WARN_SCALE_FAIL ) );
if( aWarnBox->Execute() == RET_YES )
return KEEP_PAGE;
diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx
index 769d015b5de3..b4e66d5caf4c 100644
--- a/sd/source/ui/docshell/docshel2.cxx
+++ b/sd/source/ui/docshell/docshel2.cxx
@@ -193,7 +193,7 @@ Bitmap DrawDocShell::GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixe
MapMode aMapMode( MAP_100TH_MM );
const Size aSize( pPage->GetSize() );
const Point aNullPt;
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( *Application::GetDefaultDevice() ) );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( *Application::GetDefaultDevice() );
pVDev->SetMapMode( aMapMode );
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 72a5bc118e0a..a12d8b2ed52a 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -151,7 +151,7 @@ void FuInsertGraphic::DoExecute( SfxRequest& )
// really store as link only?
if( SvtMiscOptions().ShowLinkWarningDialog() )
{
- ScopedVclPtr<SvxLinkWarningDialog> aWarnDlg(new SvxLinkWarningDialog(mpWindow,aDlg.GetPath()));
+ ScopedVclPtrInstance< SvxLinkWarningDialog > aWarnDlg(mpWindow,aDlg.GetPath());
if( aWarnDlg->Execute() != RET_OK )
return; // don't store as link
}
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index fa683dbe7d94..7a7d98c9c7bd 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -281,7 +281,7 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
if( !bInserted )
{
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(mpWindow, SD_RESSTR( STR_READ_DATA_ERROR)));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(mpWindow, SD_RESSTR( STR_READ_DATA_ERROR));
aErrorBox->Execute();
delete pMedium;
}
@@ -431,7 +431,7 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium)
if (nErr || pOutliner->GetEditEngine().GetText().isEmpty())
{
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR)));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR));
aErrorBox->Execute();
}
else
@@ -575,7 +575,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
if (nErr || pOutliner->GetEditEngine().GetText().isEmpty())
{
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR)));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR));
aErrorBox->Execute();
}
else
diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx
index 6d67c9ac14ae..dc064412ff03 100644
--- a/sd/source/ui/slideshow/showwin.cxx
+++ b/sd/source/ui/slideshow/showwin.cxx
@@ -504,7 +504,7 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly )
if( SLIDE_NO_TIMEOUT != mnPauseTimeout )
{
MapMode aVMap( rMap );
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( *this ) );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( *this );
aVMap.SetOrigin( Point() );
pVDev->SetMapMode( aVMap );
diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index c3f3bad8043c..8e3e2b0b6ad5 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -287,7 +287,7 @@ sal_Int32 Clipboard::GetInsertionPosition (::vcl::Window* pWindow)
else if (mrController.GetFocusManager().IsFocusShowing())
{
// Use the focus to determine the insertion position.
- ScopedVclPtr<SdInsertPasteDlg> aDialog (new SdInsertPasteDlg(pWindow));
+ ScopedVclPtrInstance< SdInsertPasteDlg > aDialog(pWindow);
if (aDialog->Execute() == RET_OK)
{
nInsertPosition = mrController.GetFocusManager().GetFocusedPageIndex();
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index b9d97b12b19b..7dfde4e00329 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1068,7 +1068,7 @@ void Outliner::ShowEndOfSearchDialog (void)
// Show the message in an info box that is modal with respect to the
// whole application.
- ScopedVclPtr<MessageDialog> aInfoBox(new MessageDialog(NULL, aString, VCL_MESSAGE_INFO));
+ ScopedVclPtrInstance< MessageDialog > aInfoBox(nullptr, aString, VCL_MESSAGE_INFO);
ShowModalMessageBox (*aInfoBox.get());
@@ -1376,7 +1376,7 @@ bool Outliner::HandleFailedSearch (void)
if (HasNoPreviousMatch ())
{
// No match found in the whole presentation. Tell the user.
- ScopedVclPtr<InfoBox> aInfoBox (new InfoBox(NULL, SD_RESSTR(STR_SAR_NOT_FOUND)));
+ ScopedVclPtrInstance< InfoBox > aInfoBox(nullptr, SD_RESSTR(STR_SAR_NOT_FOUND));
ShowModalMessageBox (*aInfoBox.get());
}
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 3ea2b88a32de..9647e52c528f 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -993,7 +993,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj);
- ScopedVclPtr<CompressGraphicsDialog> dialog(new CompressGraphicsDialog( GetParentWindow(), pGraphicObj, GetViewFrame()->GetBindings() ) );
+ ScopedVclPtrInstance< CompressGraphicsDialog > dialog( GetParentWindow(), pGraphicObj, GetViewFrame()->GetBindings() );
if ( dialog->Execute() == RET_OK )
{
SdrGrafObj* pNewObject = dialog->GetCompressedSdrGrafObj();
diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx
index adffc746bf5c..c6bdfed2a8f0 100644
--- a/sd/source/ui/view/drviews6.cxx
+++ b/sd/source/ui/view/drviews6.cxx
@@ -294,7 +294,7 @@ void DrawViewShell::ExecBmpMask( SfxRequest& rReq )
if( pNewObj->IsLinkedGraphic() )
{
- ScopedVclPtr<MessageDialog> aQueryBox(new MessageDialog( (vcl::Window*) GetActiveWindow(),"QueryUnlinkImageDialog","modules/sdraw/ui/queryunlinkimagedialog.ui") );
+ ScopedVclPtrInstance< MessageDialog > aQueryBox( (vcl::Window*) GetActiveWindow(),"QueryUnlinkImageDialog","modules/sdraw/ui/queryunlinkimagedialog.ui");
if (RET_YES == aQueryBox->Execute())
pNewObj->ReleaseGraphicLink();
diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx
index 19bd115c7a85..7b2137113e9c 100644
--- a/sd/source/ui/view/drviews9.cxx
+++ b/sd/source/ui/view/drviews9.cxx
@@ -87,7 +87,7 @@ void DrawViewShell::ExecGallery(SfxRequest& rReq)
Graphic aGraphic( pGalleryItem->GetGraphic() );
// reduce size if necessary
- ScopedVclPtr<Window> aWindow(new Window(GetActiveWindow()));
+ ScopedVclPtrInstance< Window > aWindow(GetActiveWindow());
aWindow->SetMapMode(aGraphic.GetPrefMapMode());
Size aSizePix = aWindow->LogicToPixel(aGraphic.GetPrefSize());
aWindow->SetMapMode( MapMode(MAP_100TH_MM) );