summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-02-11 14:42:23 +0200
committerMichael Meeks <michael.meeks@collabora.com>2015-04-09 22:17:00 +0100
commit00f2787a4a68633206635743298926bf2e65a8fa (patch)
treeefc3a4f02b3d8acd69d25071499be5a475cb0338 /sd
parentb3dcb2996b70caabda1939c9e85545c97d78404a (diff)
vclwidgets: wrap all vcl::Window subclasses allocated on stack in VclPtr
Change-Id: Ia8b0d84bbf69f9d8f85505d019acdded14e25133 Conflicts: sw/qa/tiledrendering/tiledrendering.cxx
Diffstat (limited to 'sd')
-rw-r--r--sd/source/core/drawdoc3.cxx4
-rw-r--r--sd/source/filter/grf/sdgrffilter.cxx4
-rw-r--r--sd/source/filter/html/htmlex.cxx6
-rw-r--r--sd/source/filter/html/pubdlg.cxx12
-rw-r--r--sd/source/ui/animations/CustomAnimationDialog.cxx6
-rw-r--r--sd/source/ui/animations/SlideTransitionPane.cxx6
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx7
-rw-r--r--sd/source/ui/dlg/LayerTabBar.cxx6
-rw-r--r--sd/source/ui/dlg/PhotoAlbumDialog.cxx8
-rw-r--r--sd/source/ui/dlg/animobjs.cxx4
-rw-r--r--sd/source/ui/dlg/brkdlg.cxx4
-rw-r--r--sd/source/ui/dlg/custsdlg.cxx12
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx4
-rw-r--r--sd/source/ui/dlg/tpoption.cxx5
-rw-r--r--sd/source/ui/func/fuinsert.cxx4
-rw-r--r--sd/source/ui/func/fuinsfil.cxx12
-rw-r--r--sd/source/ui/func/fulinend.cxx6
-rw-r--r--sd/source/ui/func/fupage.cxx8
-rw-r--r--sd/source/ui/slidesorter/controller/SlsClipboard.cxx6
-rw-r--r--sd/source/ui/view/DocumentRenderer.cxx6
-rw-r--r--sd/source/ui/view/Outliner.cxx22
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx6
-rw-r--r--sd/source/ui/view/drviews2.cxx18
-rw-r--r--sd/source/ui/view/drviews6.cxx4
-rw-r--r--sd/source/ui/view/drviews9.cxx10
-rw-r--r--sd/source/ui/view/drviewsi.cxx6
26 files changed, 97 insertions, 99 deletions
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index ee8739610b64..83e318db5ed8 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -242,8 +242,8 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium)
if (!bOK)
{
- MessageDialog aErrorBox(NULL, SD_RESSTR(STR_READ_DATA_ERROR));
- aErrorBox.Execute();
+ VclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, SD_RESSTR(STR_READ_DATA_ERROR)));
+ aErrorBox->Execute();
CloseBookmarkDoc();
pBookmarkDoc = NULL;
diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx
index 727fba485427..4127f74feb6e 100644
--- a/sd/source/filter/grf/sdgrffilter.cxx
+++ b/sd/source/filter/grf/sdgrffilter.cxx
@@ -169,8 +169,8 @@ void SdGRFFilter::HandleGraphicFilterError( sal_uInt16 nFilterError, sal_uLong n
ErrorHandler::HandleError( ERRCODE_IO_GENERAL );
else
{
- MessageDialog aErrorBox(NULL, SD_RESSTR(nId));
- aErrorBox.Execute();
+ VclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, SD_RESSTR(nId)));
+ aErrorBox->Execute();
}
}
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index bd2757718b39..c592a42d3ec0 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -3113,9 +3113,9 @@ bool HtmlExport::checkForExistingFiles()
OUString aSystemPath;
osl::FileBase::getSystemPathFromFileURL( maExportPath, aSystemPath );
aMsg = aMsg.replaceFirst( "%FILENAME", aSystemPath );
- WarningBox aWarning( 0, WB_YES_NO | WB_DEF_YES, aMsg );
- aWarning.SetImage( WarningBox::GetStandardImage() );
- bFound = ( RET_NO == aWarning.Execute() );
+ VclPtr<WarningBox> aWarning(new WarningBox( 0, WB_YES_NO | WB_DEF_YES, aMsg ));
+ aWarning->SetImage( WarningBox::GetStandardImage() );
+ bFound = ( RET_NO == aWarning->Execute() );
delete pResMgr;
}
diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx
index 7edbf1200514..4a36503c83b2 100644
--- a/sd/source/filter/html/pubdlg.cxx
+++ b/sd/source/filter/html/pubdlg.cxx
@@ -1072,11 +1072,11 @@ IMPL_LINK_NOARG(SdPublishingDlg, FinishHdl)
{
bRetry = false;
- SdDesignNameDlg aDlg(this, aName );
+ VclPtr<SdDesignNameDlg> aDlg(new SdDesignNameDlg(this, aName ));
- if ( aDlg.Execute() == RET_OK )
+ if ( aDlg->Execute() == RET_OK )
{
- pDesign->m_aDesignName = aDlg.GetDesignName();
+ pDesign->m_aDesignName = aDlg->GetDesignName();
boost::ptr_vector<SdPublishingDesign>::iterator iter;
for (iter = m_aDesignList.begin(); iter != m_aDesignList.end(); ++iter)
@@ -1087,9 +1087,9 @@ IMPL_LINK_NOARG(SdPublishingDlg, FinishHdl)
if (iter != m_aDesignList.end())
{
- MessageDialog aErrorBox(this, SD_RESSTR(STR_PUBDLG_SAMENAME),
- VCL_MESSAGE_ERROR, VCL_BUTTONS_YES_NO);
- bRetry = aErrorBox.Execute() == RET_NO;
+ VclPtr<MessageDialog> aErrorBox(new MessageDialog(this, SD_RESSTR(STR_PUBDLG_SAMENAME),
+ VCL_MESSAGE_ERROR, VCL_BUTTONS_YES_NO));
+ bRetry = aErrorBox->Execute() == RET_NO;
if(!bRetry)
m_aDesignList.erase(iter);
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index fd21601d8665..c5e3a2e6b2c4 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -1524,9 +1524,9 @@ void CustomAnimationEffectTabPage::openSoundFileDialog()
{
OUString aStrWarning(SD_RESSTR(STR_WARNING_NOSOUNDFILE));
aStrWarning = aStrWarning.replaceFirst("%", aFile);
- WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning );
- aWarningBox.SetModalInputMode (true);
- bQuitLoop = aWarningBox.Execute()==RET_RETRY ? sal_False : sal_True;
+ VclPtr<WarningBox> aWarningBox(new WarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning ));
+ aWarningBox->SetModalInputMode (true);
+ bQuitLoop = aWarningBox->Execute() != RET_RETRY;
bValidSoundFile=false;
}
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index a58a444048e1..5d5682bb3363 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -730,9 +730,9 @@ void SlideTransitionPane::openSoundFileDialog()
{
OUString aStrWarning(SD_RESSTR(STR_WARNING_NOSOUNDFILE));
aStrWarning = aStrWarning.replaceFirst("%", aFile);
- WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning );
- aWarningBox.SetModalInputMode (true);
- bQuitLoop = (aWarningBox.Execute() != RET_RETRY);
+ VclPtr<WarningBox> aWarningBox(new WarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning ));
+ aWarningBox->SetModalInputMode (true);
+ bQuitLoop = (aWarningBox->Execute() != RET_RETRY);
bValidSoundFile = false;
}
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index cbbbc345c59b..09887ec32a94 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -694,10 +694,9 @@ 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.
- QueryBox aQuestionBox ( NULL, (WB_YES_NO | WB_DEF_YES), SD_RESSTR(nStringId));
- aQuestionBox.SetImage (QueryBox::GetStandardImage());
- short nBoxResult = aQuestionBox.Execute();
- if (nBoxResult != RET_YES)
+ VclPtr<QueryBox> aQuestionBox (new QueryBox( NULL, (WB_YES_NO | WB_DEF_YES), SD_RESSTR(nStringId)));
+ aQuestionBox->SetImage( QueryBox::GetStandardImage() );
+ if (aQuestionBox->Execute() != RET_YES)
break;
}
while( true );
diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx
index 98df417636ce..14b88f9ea422 100644
--- a/sd/source/ui/dlg/LayerTabBar.cxx
+++ b/sd/source/ui/dlg/LayerTabBar.cxx
@@ -203,9 +203,9 @@ TabBarAllowRenamingReturnCode LayerTabBar::AllowRenaming()
(rLayerAdmin.GetLayer( aNewName, false ) && aLayerName != aNewName) )
{
// Name already exists
- WarningBox aWarningBox( &pDrViewSh->GetViewFrame()->GetWindow(), WinBits( WB_OK ),
- SD_RESSTR( STR_WARN_NAME_DUPLICATE ) );
- aWarningBox.Execute();
+ VclPtr<WarningBox> aWarningBox(new WarningBox( &pDrViewSh->GetViewFrame()->GetWindow(), WinBits( WB_OK ),
+ SD_RESSTR( STR_WARN_NAME_DUPLICATE ) ));
+ aWarningBox->Execute();
bOK = false;
}
diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
index a3da722b97e5..4d75e6c8142c 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
@@ -88,8 +88,8 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl)
{
if (pImagesLst->GetEntryCount() == 0)
{
- WarningBox aWarning(this, WB_OK, SD_RESSTR(STR_PHOTO_ALBUM_EMPTY_WARNING));
- aWarning.Execute();
+ VclPtr<WarningBox> aWarning(new WarningBox(this, WB_OK, SD_RESSTR(STR_PHOTO_ALBUM_EMPTY_WARNING)));
+ aWarning->Execute();
}
else
{
@@ -445,8 +445,8 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl)
}
else
{
- InfoBox aInfo(this, OUString("Function is not implemented!"));
- aInfo.Execute();
+ VclPtr<InfoBox> aInfo(new InfoBox(this, OUString("Function is not implemented!")));
+ aInfo->Execute();
}
EndDialog();
return 0;
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index 2be1601d3c67..a84cfd9d0ddd 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -437,8 +437,8 @@ IMPL_LINK( AnimationWindow, ClickRemoveBitmapHdl, void *, pBtn )
}
else // delete everything
{
- WarningBox aWarnBox( this, WB_YES_NO, SD_RESSTR( STR_ASK_DELETE_ALL_PICTURES ) );
- short nReturn = aWarnBox.Execute();
+ VclPtr<WarningBox> aWarnBox(new WarningBox( this, WB_YES_NO, SD_RESSTR( STR_ASK_DELETE_ALL_PICTURES ) ));
+ short nReturn = aWarnBox->Execute();
if( nReturn == RET_YES )
{
diff --git a/sd/source/ui/dlg/brkdlg.cxx b/sd/source/ui/dlg/brkdlg.cxx
index e36c5648c987..92c83eac13c7 100644
--- a/sd/source/ui/dlg/brkdlg.cxx
+++ b/sd/source/ui/dlg/brkdlg.cxx
@@ -99,8 +99,8 @@ IMPL_LINK( BreakDlg, UpDate, void*, nInit )
// update status bar or show a error message?
if(nInit == reinterpret_cast<void*>(1L))
{
- MessageDialog aErrBox(this, SD_RESSTR(STR_BREAK_FAIL));
- aErrBox.Execute();
+ VclPtr<MessageDialog> aErrBox(new MessageDialog(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 d1c023e9b387..8cfd56d0a583 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -111,8 +111,8 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
if( p == m_pBtnNew )
{
pCustomShow = NULL;
- SdDefineCustomShowDlg aDlg( this, rDoc, pCustomShow );
- if( aDlg.Execute() == RET_OK )
+ VclPtr<SdDefineCustomShowDlg> aDlg(new SdDefineCustomShowDlg( this, rDoc, pCustomShow ));
+ if( aDlg->Execute() == RET_OK )
{
if( pCustomShow )
{
@@ -125,7 +125,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
m_pLbCustomShows->SelectEntry( pCustomShow->GetName() );
}
- if( aDlg.IsModified() )
+ if( aDlg->IsModified() )
bModified = true;
}
else if( pCustomShow )
@@ -139,9 +139,9 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
{
DBG_ASSERT( pCustomShowList, "pCustomShowList does not exist" );
pCustomShow = (*pCustomShowList)[ nPos ];
- SdDefineCustomShowDlg aDlg( this, rDoc, pCustomShow );
+ VclPtr<SdDefineCustomShowDlg> aDlg(new SdDefineCustomShowDlg( this, rDoc, pCustomShow ));
- if( aDlg.Execute() == RET_OK )
+ if( aDlg->Execute() == RET_OK )
{
if( pCustomShow )
{
@@ -151,7 +151,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
m_pLbCustomShows->InsertEntry( pCustomShow->GetName(), nPos );
m_pLbCustomShows->SelectEntryPos( nPos );
}
- if( aDlg.IsModified() )
+ if( aDlg->IsModified() )
bModified = true;
}
}
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 4b8d11f6728f..184cc15081d8 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1010,8 +1010,8 @@ SdDrawDocument* SdPageObjsTLB::GetBookmarkDoc(SfxMedium* pMed)
if ( !mpBookmarkDoc )
{
- MessageDialog aErrorBox(this, SD_RESSTR(STR_READ_DATA_ERROR));
- aErrorBox.Execute();
+ VclPtr<MessageDialog> aErrorBox(new MessageDialog(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 9065e1ebe922..6383700d0bb7 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -331,10 +331,9 @@ int SdTpOptionsMisc::DeactivatePage( SfxItemSet* pActiveSet )
FillItemSet( pActiveSet );
return LEAVE_PAGE;
}
- WarningBox aWarnBox( GetParent(), WB_YES_NO, SD_RESSTR( STR_WARN_SCALE_FAIL ) );
- short nReturn = aWarnBox.Execute();
+ VclPtr<WarningBox> aWarnBox(new WarningBox( GetParent(), WB_YES_NO, SD_RESSTR( STR_WARN_SCALE_FAIL ) ));
- if( nReturn == RET_YES )
+ if( aWarnBox->Execute() == RET_YES )
return KEEP_PAGE;
if( pActiveSet )
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index bd21323f0984..d47f025ff538 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -151,8 +151,8 @@ void FuInsertGraphic::DoExecute( SfxRequest& )
// really store as link only?
if( SvtMiscOptions().ShowLinkWarningDialog() )
{
- SvxLinkWarningDialog aWarnDlg(mpWindow,aDlg.GetPath());
- if( aWarnDlg.Execute() != RET_OK )
+ VclPtr<SvxLinkWarningDialog> aWarnDlg(new SvxLinkWarningDialog(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 d368f96f4894..e47b22a797de 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -281,8 +281,8 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
if( !bInserted )
{
- MessageDialog aErrorBox(mpWindow, SD_RESSTR( STR_READ_DATA_ERROR));
- aErrorBox.Execute();
+ VclPtr<MessageDialog> aErrorBox(new MessageDialog(mpWindow, SD_RESSTR( STR_READ_DATA_ERROR)));
+ aErrorBox->Execute();
delete pMedium;
}
}
@@ -431,8 +431,8 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium)
if (nErr || pOutliner->GetEditEngine().GetText().isEmpty())
{
- MessageDialog aErrorBox(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR));
- aErrorBox.Execute();
+ VclPtr<MessageDialog> aErrorBox(new MessageDialog(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR)));
+ aErrorBox->Execute();
}
else
{
@@ -575,8 +575,8 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
if (nErr || pOutliner->GetEditEngine().GetText().isEmpty())
{
- MessageDialog aErrorBox(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR));
- aErrorBox.Execute();
+ VclPtr<MessageDialog> aErrorBox(new MessageDialog(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR)));
+ aErrorBox->Execute();
}
else
{
diff --git a/sd/source/ui/func/fulinend.cxx b/sd/source/ui/func/fulinend.cxx
index e8f441cc7398..cc94ac446bff 100644
--- a/sd/source/ui/func/fulinend.cxx
+++ b/sd/source/ui/func/fulinend.cxx
@@ -138,9 +138,9 @@ void FuLineEnd::DoExecute( SfxRequest& )
}
else
{
- WarningBox aWarningBox( mpWindow, WinBits( WB_OK ),
- SD_RESSTR( STR_WARN_NAME_DUPLICATE ) );
- aWarningBox.Execute();
+ VclPtr<WarningBox> aWarningBox(new WarningBox( mpWindow, WinBits( WB_OK ),
+ SD_RESSTR( STR_WARN_NAME_DUPLICATE ) ) );
+ aWarningBox->Execute();
}
}
}
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index 8253ee54c6a8..670bbff5802b 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -351,13 +351,13 @@ const SfxItemSet* FuPage::ExecuteDialog( ::vcl::Window* pParent )
// notice-masterpage (at the moment)
if( ePageKind != PK_NOTES )
{
- MessBox aQuestionBox (
+ VclPtr<MessBox> aQuestionBox (new MessBox(
pParent,
WB_YES_NO | WB_DEF_YES,
SD_RESSTR(STR_PAGE_BACKGROUND_TITLE),
- SD_RESSTR(STR_PAGE_BACKGROUND_TXT) );
- aQuestionBox.SetImage( QueryBox::GetStandardImage() );
- bSetToAllPages = ( RET_YES == aQuestionBox.Execute() );
+ SD_RESSTR(STR_PAGE_BACKGROUND_TXT) ) );
+ aQuestionBox->SetImage( QueryBox::GetStandardImage() );
+ bSetToAllPages = ( RET_YES == aQuestionBox->Execute() );
}
if( mbPageBckgrdDeleted )
diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index 1157b2973e3d..92a880853d19 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -287,11 +287,11 @@ sal_Int32 Clipboard::GetInsertionPosition (::vcl::Window* pWindow)
else if (mrController.GetFocusManager().IsFocusShowing())
{
// Use the focus to determine the insertion position.
- SdInsertPasteDlg aDialog (pWindow);
- if (aDialog.Execute() == RET_OK)
+ VclPtr<SdInsertPasteDlg> aDialog (new SdInsertPasteDlg(pWindow));
+ if (aDialog->Execute() == RET_OK)
{
nInsertPosition = mrController.GetFocusManager().GetFocusedPageIndex();
- if ( ! aDialog.IsInsertBefore())
+ if ( ! aDialog->IsInsertBefore())
nInsertPosition ++;
}
}
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index b49fffc24a82..22a4e840be6c 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -1300,11 +1300,11 @@ public:
// Show warning that the orientation could not be set.
if (pViewShell)
{
- WarningBox aWarnBox(
+ VclPtr<WarningBox> aWarnBox(new WarningBox(
pViewShell->GetActiveWindow(),
(WinBits)(WB_OK_CANCEL | WB_DEF_CANCEL),
- SD_RESSTR(STR_WARN_PRINTFORMAT_FAILURE));
- if (aWarnBox.Execute() != RET_OK)
+ SD_RESSTR(STR_WARN_PRINTFORMAT_FAILURE)));
+ if (aWarnBox->Execute() != RET_OK)
return;
}
}
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 469d1f82905f..b46951154485 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1068,9 +1068,9 @@ void Outliner::ShowEndOfSearchDialog (void)
// Show the message in an info box that is modal with respect to the
// whole application.
- MessageDialog aInfoBox(NULL, aString, VCL_MESSAGE_INFO);
+ VclPtr<MessageDialog> aInfoBox(new MessageDialog(NULL, aString, VCL_MESSAGE_INFO));
- ShowModalMessageBox (aInfoBox);
+ ShowModalMessageBox (*aInfoBox.get());
mbWholeDocumentProcessed = true;
}
@@ -1109,12 +1109,12 @@ bool Outliner::ShowWrapArroundDialog (void)
// Pop up question box that asks the user whether to wrap around.
// The dialog is made modal with respect to the whole application.
- QueryBox aQuestionBox (
+ VclPtr<QueryBox> aQuestionBox (new QueryBox(
NULL,
WB_YES_NO | WB_DEF_YES,
- SD_RESSTR(nStringId));
- aQuestionBox.SetImage (QueryBox::GetStandardImage());
- sal_uInt16 nBoxResult = ShowModalMessageBox(aQuestionBox);
+ SD_RESSTR(nStringId)));
+ aQuestionBox->SetImage (QueryBox::GetStandardImage());
+ sal_uInt16 nBoxResult = ShowModalMessageBox(*aQuestionBox.get());
bDoWrapArround = (nBoxResult == RET_YES);
}
@@ -1157,9 +1157,9 @@ void Outliner::PrepareSpellCheck (void)
{
mbError = true;
mbEndOfSearch = true;
- MessageDialog aErrorBox (NULL,
- SD_RESSTR(STR_NOLANGUAGE));
- ShowModalMessageBox (aErrorBox);
+ VclPtr<MessageDialog> aErrorBox (new MessageDialog(NULL,
+ SD_RESSTR(STR_NOLANGUAGE)));
+ ShowModalMessageBox (*aErrorBox.get());
}
else if (eState != EE_SPELL_OK)
{
@@ -1376,8 +1376,8 @@ bool Outliner::HandleFailedSearch (void)
if (HasNoPreviousMatch ())
{
// No match found in the whole presentation. Tell the user.
- InfoBox aInfoBox (NULL, SD_RESSTR(STR_SAR_NOT_FOUND));
- ShowModalMessageBox (aInfoBox);
+ VclPtr<InfoBox> aInfoBox (new InfoBox(NULL, SD_RESSTR(STR_SAR_NOT_FOUND)));
+ ShowModalMessageBox (*aInfoBox.get());
}
else
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index c0ab66f3f210..3bd57dc51e99 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -533,11 +533,11 @@ sal_uInt16 ViewShellBase::SetPrinter (
bool bScaleAll = false;
if ( bIsAPI )
{
- WarningBox aWarnBox (
+ VclPtr<WarningBox> aWarnBox (new WarningBox(
GetWindow(),
(WinBits)(WB_YES_NO | WB_DEF_YES),
- SD_RESSTR(STR_SCALE_OBJS_TO_PAGE));
- bScaleAll = (aWarnBox.Execute() == RET_YES);
+ SD_RESSTR(STR_SCALE_OBJS_TO_PAGE)));
+ bScaleAll = (aWarnBox->Execute() == RET_YES);
}
::boost::shared_ptr<DrawViewShell> pDrawViewShell (
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index c210857b6482..e442aeb9be15 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -993,10 +993,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj);
- CompressGraphicsDialog dialog( GetParentWindow(), pGraphicObj, GetViewFrame()->GetBindings() );
- if ( dialog.Execute() == RET_OK )
+ VclPtr<CompressGraphicsDialog> dialog(new CompressGraphicsDialog( GetParentWindow(), pGraphicObj, GetViewFrame()->GetBindings() ) );
+ if ( dialog->Execute() == RET_OK )
{
- SdrGrafObj* pNewObject = dialog.GetCompressedSdrGrafObj();
+ SdrGrafObj* pNewObject = dialog->GetCompressedSdrGrafObj();
SdrPageView* pPageView = mpDrawView->GetSdrPageView();
OUString aUndoString = mpDrawView->GetDescriptionOfMarkedObjects();
aUndoString += " Compress";
@@ -1422,11 +1422,11 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
|| aLayerName.isEmpty() )
{
// name already exists
- WarningBox aWarningBox (
+ VclPtr<WarningBox> aWarningBox (new WarningBox(
GetParentWindow(),
WinBits( WB_OK ),
- SD_RESSTR(STR_WARN_NAME_DUPLICATE));
- aWarningBox.Execute();
+ SD_RESSTR(STR_WARN_NAME_DUPLICATE)));
+ aWarningBox->Execute();
}
else
bLoop = false;
@@ -1591,11 +1591,11 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
aLayerName != aOldLayerName) || aLayerName.isEmpty() )
{
// name already exists
- WarningBox aWarningBox (
+ VclPtr<WarningBox> aWarningBox (new WarningBox(
GetParentWindow(),
WinBits( WB_OK ),
- SD_RESSTR(STR_WARN_NAME_DUPLICATE));
- aWarningBox.Execute();
+ SD_RESSTR(STR_WARN_NAME_DUPLICATE)));
+ aWarningBox->Execute();
}
else
bLoop = false;
diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx
index 31c9f08a6831..c76556e9a177 100644
--- a/sd/source/ui/view/drviews6.cxx
+++ b/sd/source/ui/view/drviews6.cxx
@@ -294,9 +294,9 @@ void DrawViewShell::ExecBmpMask( SfxRequest& rReq )
if( pNewObj->IsLinkedGraphic() )
{
- MessageDialog aQueryBox( (vcl::Window*) GetActiveWindow(),"QueryUnlinkImageDialog","modules/sdraw/ui/queryunlinkimagedialog.ui");
+ VclPtr<MessageDialog> aQueryBox(new MessageDialog( (vcl::Window*) GetActiveWindow(),"QueryUnlinkImageDialog","modules/sdraw/ui/queryunlinkimagedialog.ui") );
- if (RET_YES == aQueryBox.Execute())
+ if (RET_YES == aQueryBox->Execute())
pNewObj->ReleaseGraphicLink();
else
{
diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx
index d224c328122f..66745078a240 100644
--- a/sd/source/ui/view/drviews9.cxx
+++ b/sd/source/ui/view/drviews9.cxx
@@ -87,11 +87,11 @@ void DrawViewShell::ExecGallery(SfxRequest& rReq)
Graphic aGraphic( pGalleryItem->GetGraphic() );
// reduce size if necessary
- Window aWindow (GetActiveWindow());
- aWindow.SetMapMode(aGraphic.GetPrefMapMode());
- Size aSizePix = aWindow.LogicToPixel(aGraphic.GetPrefSize());
- aWindow.SetMapMode( MapMode(MAP_100TH_MM) );
- Size aSize = aWindow.PixelToLogic(aSizePix);
+ VclPtr<Window> aWindow(GetActiveWindow());
+ aWindow->SetMapMode(aGraphic.GetPrefMapMode());
+ Size aSizePix = aWindow->LogicToPixel(aGraphic.GetPrefSize());
+ aWindow->SetMapMode( MapMode(MAP_100TH_MM) );
+ Size aSize = aWindow->PixelToLogic(aSizePix);
// constrain size to page size if necessary
SdrPage* pPage = mpDrawView->GetSdrPageView()->GetPage();
diff --git a/sd/source/ui/view/drviewsi.cxx b/sd/source/ui/view/drviewsi.cxx
index e969c84a3a16..e15f19627216 100644
--- a/sd/source/ui/view/drviewsi.cxx
+++ b/sd/source/ui/view/drviewsi.cxx
@@ -164,10 +164,10 @@ void DrawViewShell::AssignFrom3DWindow()
}
else
{
- InfoBox aInfoBox (
+ VclPtr<InfoBox> aInfoBox (new InfoBox(
GetActiveWindow(),
- SD_RESSTR(STR_ACTION_NOTPOSSIBLE));
- aInfoBox.Execute();
+ SD_RESSTR(STR_ACTION_NOTPOSSIBLE)));
+ aInfoBox->Execute();
}
// get focus back