vclwidgets: wrap all vcl::Window subclasses allocated on stack in VclPtr

Change-Id: Ia8b0d84bbf69f9d8f85505d019acdded14e25133

Conflicts:
	sw/qa/tiledrendering/tiledrendering.cxx
diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx
index a40d8a3..6444303 100644
--- a/avmedia/source/viewer/mediawindow.cxx
+++ b/avmedia/source/viewer/mediawindow.cxx
@@ -327,9 +327,9 @@ bool MediaWindow::executeMediaURLDialog(vcl::Window* /* pParent */,

void MediaWindow::executeFormatErrorBox( vcl::Window* pParent )
{
    MessageDialog aErrBox( pParent, AVMEDIA_RESID( AVMEDIA_STR_ERR_URL ) );
    VclPtr<MessageDialog> aErrBox(new MessageDialog( pParent, AVMEDIA_RESID( AVMEDIA_STR_ERR_URL ) ) );

    aErrBox.Execute();
    aErrBox->Execute();
}


diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index a5d4af8..9b48376 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -619,8 +619,8 @@ void ModulWindow::BasicToggleBreakPointEnabled()
void ModulWindow::ManageBreakPoints()
{
    BreakPointWindow& rBrkWin = GetBreakPointWindow();
    BreakPointDialog aBrkDlg( &rBrkWin, GetBreakPoints() );
    aBrkDlg.Execute();
    VclPtr<BreakPointDialog> aBrkDlg(new BreakPointDialog( &rBrkWin, GetBreakPoints() ));
    aBrkDlg->Execute();
    rBrkWin.Invalidate();
}

@@ -1043,9 +1043,9 @@ void ModulWindow::ExecuteCommand (SfxRequest& rReq)
            break;
        case SID_GOTOLINE:
        {
            GotoLineDialog aGotoDlg(this);
            if (aGotoDlg.Execute())
                if (sal_Int32 const nLine = aGotoDlg.GetLineNumber())
            VclPtr<GotoLineDialog> aGotoDlg(new GotoLineDialog(this));
            if (aGotoDlg->Execute())
                if (sal_Int32 const nLine = aGotoDlg->GetLineNumber())
                {
                    TextSelection const aSel(TextPaM(nLine - 1, 0), TextPaM(nLine - 1, 0));
                    GetEditView()->SetSelection(aSel);
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 605c1f4..be6895c 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1519,9 +1519,9 @@ void BreakPointWindow::Command( const CommandEvent& rCEvt )
                break;
                case RID_BRKPROPS:
                {
                    BreakPointDialog aBrkDlg( this, GetBreakPoints() );
                    aBrkDlg.SetCurrentBreakPoint( pBrk );
                    aBrkDlg.Execute();
                    VclPtr<BreakPointDialog> aBrkDlg(new BreakPointDialog( this, GetBreakPoints() ));
                    aBrkDlg->SetCurrentBreakPoint( pBrk );
                    aBrkDlg->Execute();
                    Invalidate();
                }
                break;
@@ -1534,8 +1534,8 @@ void BreakPointWindow::Command( const CommandEvent& rCEvt )
            {
                case RID_BRKDLG:
                {
                    BreakPointDialog aBrkDlg( this, GetBreakPoints() );
                    aBrkDlg.Execute();
                    VclPtr<BreakPointDialog> aBrkDlg(new BreakPointDialog( this, GetBreakPoints() ));
                    aBrkDlg->Execute();
                    Invalidate();
                }
                break;
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 7a6a04e..642981f8 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -1024,8 +1024,8 @@ bool implImportDialog( vcl::Window* pWin, const OUString& rCurPath, const Script
                OUString aQueryBoxText(IDE_RESSTR(RID_STR_DLGIMP_CLASH_TEXT));
                aQueryBoxText = aQueryBoxText.replaceAll("$(ARG1)", aXmlDlgName);

                NameClashQueryBox aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
                sal_uInt16 nRet = aQueryBox.Execute();
                VclPtr<NameClashQueryBox> aQueryBox(new NameClashQueryBox( pWin, aQueryBoxTitle, aQueryBoxText ));
                sal_uInt16 nRet = aQueryBox->Execute();
                if( RET_YES == nRet )
                {
                    // RET_YES == Rename, see NameClashQueryBox::NameClashQueryBox
@@ -1086,8 +1086,8 @@ bool implImportDialog( vcl::Window* pWin, const OUString& rCurPath, const Script
            {
                OUString aQueryBoxTitle(IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_TITLE));
                OUString aQueryBoxText(IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_TEXT));
                LanguageMismatchQueryBox aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
                sal_uInt16 nRet = aQueryBox.Execute();
                VclPtr<LanguageMismatchQueryBox> aQueryBox(new LanguageMismatchQueryBox( pWin, aQueryBoxTitle, aQueryBoxText ));
                sal_uInt16 nRet = aQueryBox->Execute();
                if( RET_YES == nRet )
                {
                    // RET_YES == Add, see LanguageMismatchQueryBox::LanguageMismatchQueryBox
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 2f1e8fd..c6374bf 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -136,8 +136,8 @@ void Shell::ExecuteCurrent( SfxRequest& rReq )
                            SfxViewFrame* pViewFrame = GetViewFrame();
                            SfxChildWindow* pChildWin = pViewFrame ? pViewFrame->GetChildWindow( SID_SEARCH_DLG ) : NULL;
                            vcl::Window* pParent = pChildWin ? pChildWin->GetWindow() : NULL;
                            QueryBox aQuery(pParent, WB_YES_NO|WB_DEF_YES, IDE_RESSTR(RID_STR_SEARCHFROMSTART));
                            if ( aQuery.Execute() == RET_YES )
                            VclPtr<QueryBox> aQuery(new QueryBox(pParent, WB_YES_NO|WB_DEF_YES, IDE_RESSTR(RID_STR_SEARCHFROMSTART)));
                            if ( aQuery->Execute() == RET_YES )
                            {
                                it = aWindowTable.begin();
                                if ( it != aWindowTable.end() )
@@ -676,8 +676,8 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )

        case SID_BASICIDE_MANAGE_LANG:
        {
            ManageLanguageDialog aDlg(pCurWin, m_pCurLocalizationMgr);
            aDlg.Execute();
            VclPtr<ManageLanguageDialog> aDlg(new ManageLanguageDialog(pCurWin, m_pCurLocalizationMgr));
            aDlg->Execute();
            rReq.Done();
        }
        break;
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index 2e41965..6fee19e 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -149,16 +149,16 @@ bool RenameModule (

    if ( rDocument.hasModule( rLibName, rNewName ) )
    {
        MessageDialog aError(pErrorParent, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2));
        aError.Execute();
        VclPtr<MessageDialog> aError(new MessageDialog(pErrorParent, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2)));
        aError->Execute();
        return false;
    }

    // #i74440
    if ( rNewName.isEmpty() )
    {
        MessageDialog aError(pErrorParent, IDE_RESSTR(RID_STR_BADSBXNAME));
        aError.Execute();
        VclPtr<MessageDialog> aError(new MessageDialog(pErrorParent, IDE_RESSTR(RID_STR_BADSBXNAME)));
        aError->Execute();
        return false;
    }

diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index 87f5790..c280c3b 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -155,16 +155,16 @@ bool RenameDialog (

    if ( rDocument.hasDialog( rLibName, rNewName ) )
    {
        MessageDialog aError(pErrorParent, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2));
        aError.Execute();
        VclPtr<MessageDialog> aError(new MessageDialog(pErrorParent, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2)));
        aError->Execute();
        return false;
    }

    // #i74440
    if ( rNewName.isEmpty() )
    {
        MessageDialog aError(pErrorParent, IDE_RESSTR(RID_STR_BADSBXNAME));
        aError.Execute();
        VclPtr<MessageDialog> aError(new MessageDialog(pErrorParent, IDE_RESSTR(RID_STR_BADSBXNAME)));
        aError->Execute();
        return false;
    }

diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 0da73c2..3a6be36 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -790,8 +790,8 @@ bool QueryDel( const OUString& rName, const ResId& rId, vcl::Window* pParent )
    aNameBuf.append('\'');
    aNameBuf.insert(0, '\'');
    aQuery = aQuery.replaceAll("XX", aNameBuf.makeStringAndClear());
    MessageDialog aQueryBox(pParent, aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
    return ( aQueryBox.Execute() == RET_YES );
    VclPtr<MessageDialog> aQueryBox(new MessageDialog(pParent, aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
    return ( aQueryBox->Execute() == RET_YES );
}

bool QueryDelMacro( const OUString& rName, vcl::Window* pParent )
@@ -827,19 +827,19 @@ bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer,
    do
    {
        // password dialog
        SfxPasswordDialog aDlg(Application::GetDefDialogParent());
        aDlg.SetMinLen( 1 );
        VclPtr<SfxPasswordDialog> aDlg(new SfxPasswordDialog(Application::GetDefDialogParent()));
        aDlg->SetMinLen( 1 );

        // set new title
        if ( bNewTitle )
        {
            OUString aTitle(IDE_RESSTR(RID_STR_ENTERPASSWORD));
            aTitle = aTitle.replaceAll("XX", rLibName);
            aDlg.SetText( aTitle );
            aDlg->SetText( aTitle );
        }

        // execute dialog
        nRet = aDlg.Execute();
        nRet = aDlg->Execute();

        // verify password
        if ( nRet == RET_OK )
@@ -849,14 +849,14 @@ bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer,
                Reference< script::XLibraryContainerPassword > xPasswd( xLibContainer, UNO_QUERY );
                if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( rLibName ) && !xPasswd->isLibraryPasswordVerified( rLibName ) )
                {
                    rPassword = aDlg.GetPassword();
                    rPassword = aDlg->GetPassword();
                    //                    OUString aOUPassword( rPassword );
                    bOK = xPasswd->verifyLibraryPassword( rLibName, rPassword );

                    if ( !bOK )
                    {
                        MessageDialog aErrorBox(Application::GetDefDialogParent(), IDE_RESSTR(RID_STR_WRONGPASSWORD));
                        aErrorBox.Execute();
                        VclPtr<MessageDialog> aErrorBox(new MessageDialog(Application::GetDefDialogParent(), IDE_RESSTR(RID_STR_WRONGPASSWORD)));
                        aErrorBox->Execute();
                    }
                }
            }
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 9907076..48cd1ed 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -1078,12 +1078,12 @@ void LibPage::Export( void )
            return;
    }

    ExportDialog aNewDlg(this);
    if (aNewDlg.Execute() == RET_OK)
    VclPtr<ExportDialog> aNewDlg(new ExportDialog(this));
    if (aNewDlg->Execute() == RET_OK)
    {
        try
        {
            if (aNewDlg.isExportAsPackage())
            if (aNewDlg->isExportAsPackage())
                ExportAsPackage( aLibName );
            else
                ExportAsBasic( aLibName );
@@ -1454,13 +1454,13 @@ void createLibImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
        i++;
    }

    NewObjectDialog aNewDlg(pWin, ObjectMode::Library);
    aNewDlg.SetObjectName(aLibName);
    VclPtr<NewObjectDialog> aNewDlg(new NewObjectDialog(pWin, ObjectMode::Library));
    aNewDlg->SetObjectName(aLibName);

    if (aNewDlg.Execute())
    if (aNewDlg->Execute())
    {
        if (!aNewDlg.GetObjectName().isEmpty())
            aLibName = aNewDlg.GetObjectName();
        if (!aNewDlg->GetObjectName().isEmpty())
            aLibName = aNewDlg->GetObjectName();

        if ( aLibName.getLength() > 30 )
        {
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index fd15d17..9d3185b 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -804,12 +804,12 @@ void ObjectPage::NewDialog()
    {
        aDocument.getOrCreateLibrary( E_DIALOGS, aLibName );

        NewObjectDialog aNewDlg(this, ObjectMode::Dialog, true);
        aNewDlg.SetObjectName( aDocument.createObjectName( E_DIALOGS, aLibName ) );
        VclPtr<NewObjectDialog> aNewDlg(new NewObjectDialog(this, ObjectMode::Dialog, true));
        aNewDlg->SetObjectName( aDocument.createObjectName( E_DIALOGS, aLibName ) );

        if (aNewDlg.Execute() != 0)
        if (aNewDlg->Execute() != 0)
        {
            OUString aDlgName = aNewDlg.GetObjectName();
            OUString aDlgName = aNewDlg->GetObjectName();
            if (aDlgName.isEmpty())
                aDlgName = aDocument.createObjectName( E_DIALOGS, aLibName);

@@ -947,13 +947,13 @@ SbModule* createModImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
    if ( aModName.isEmpty() )
        aModName = rDocument.createObjectName( E_SCRIPTS, aLibName );

    NewObjectDialog aNewDlg(pWin, ObjectMode::Module, true);
    aNewDlg.SetObjectName( aModName );
    VclPtr<NewObjectDialog> aNewDlg(new NewObjectDialog(pWin, ObjectMode::Module, true));
    aNewDlg->SetObjectName( aModName );

    if (aNewDlg.Execute() != 0)
    if (aNewDlg->Execute() != 0)
    {
        if (!aNewDlg.GetObjectName().isEmpty() )
            aModName = aNewDlg.GetObjectName();
        if (!aNewDlg->GetObjectName().isEmpty() )
            aModName = aNewDlg->GetObjectName();

        try
        {
diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx
index ed304b2..953f96b 100644
--- a/basctl/source/dlged/managelang.cxx
+++ b/basctl/source/dlged/managelang.cxx
@@ -142,11 +142,11 @@ void ManageLanguageDialog::ClearLanguageBox()

IMPL_LINK_NOARG(ManageLanguageDialog, AddHdl)
{
    SetDefaultLanguageDialog aDlg( this, m_xLocalizationMgr );
    if ( RET_OK == aDlg.Execute() )
    VclPtr<SetDefaultLanguageDialog> aDlg(new SetDefaultLanguageDialog( this, m_xLocalizationMgr ));
    if ( RET_OK == aDlg->Execute() )
    {
        // add new locales
        Sequence< Locale > aLocaleSeq = aDlg.GetLocales();
        Sequence< Locale > aLocaleSeq = aDlg->GetLocales();
        m_xLocalizationMgr->handleAddLocales( aLocaleSeq );
        // update listbox
        ClearLanguageBox();
@@ -160,8 +160,8 @@ IMPL_LINK_NOARG(ManageLanguageDialog, AddHdl)

IMPL_LINK_NOARG(ManageLanguageDialog, DeleteHdl)
{
    MessageDialog aQBox(this, "DeleteLangDialog", "modules/BasicIDE/ui/deletelang.ui");
    if ( aQBox.Execute() == RET_OK )
    VclPtr<MessageDialog> aQBox(new MessageDialog(this, "DeleteLangDialog", "modules/BasicIDE/ui/deletelang.ui"));
    if ( aQBox->Execute() == RET_OK )
    {
        sal_uInt16 i, nCount = m_pLanguageLB->GetSelectEntryCount();
        sal_uInt16 nPos = m_pLanguageLB->GetSelectEntryPos();
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index 01921da..831dee35 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -966,10 +966,10 @@ void SbiIoSystem::CloseAll(void)
void SbiIoSystem::ReadCon(OString& rIn)
{
    OUString aPromptStr(OStringToOUString(aPrompt, osl_getThreadTextEncoding()));
    SbiInputDialog aDlg( NULL, aPromptStr );
    if( aDlg.Execute() )
    VclPtr<SbiInputDialog> aDlg(new SbiInputDialog(NULL, aPromptStr) );
    if( aDlg->Execute() )
    {
        rIn = OUStringToOString(aDlg.GetInput(), osl_getThreadTextEncoding());
        rIn = OUStringToOString(aDlg->GetInput(), osl_getThreadTextEncoding());
    }
    else
    {
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx
index c0f2da1..5bbe9f6 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -205,12 +205,12 @@ IMPL_LINK( DataLabelResources, NumberFormatDialogHdl, PushButton *, pButton )
        aNumberSet.Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE, rnFormatKey ));
    aNumberSet.Put( SfxBoolItem( SID_ATTR_NUMBERFORMAT_SOURCE, rUseSourceFormat ));

    NumberFormatDialog aDlg(m_pWindow, aNumberSet);
    VclPtr<NumberFormatDialog> aDlg(new NumberFormatDialog(m_pWindow, aNumberSet));
    if( bPercent )
        aDlg.SetText( m_pFT_NumberFormatForPercent->GetText());
    if( RET_OK == aDlg.Execute() )
        aDlg->SetText( m_pFT_NumberFormatForPercent->GetText());
    if( RET_OK == aDlg->Execute() )
    {
        const SfxItemSet* pResult = aDlg.GetOutputItemSet();
        const SfxItemSet* pResult = aDlg->GetOutputItemSet();
        if( pResult )
        {
            bool bOldSource = rUseSourceFormat;
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 242fdf2..6e6f3d1 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1271,8 +1271,8 @@ void ChartController::executeDispatch_ChartType()

    SolarMutexGuard aSolarGuard;
    //prepare and open dialog
    ChartTypeDialog aDlg( m_pChartWindow, getModel(), m_xCC );
    if( aDlg.Execute() == RET_OK )
    VclPtr<ChartTypeDialog> aDlg(new ChartTypeDialog( m_pChartWindow, getModel(), m_xCC ));
    if( aDlg->Execute() == RET_OK )
    {
        impl_adaptDataSeriesAutoResize();
        aUndoGuard.commit();
@@ -1292,8 +1292,8 @@ void ChartController::executeDispatch_SourceData()
    if( xChartDoc.is())
    {
        SolarMutexGuard aSolarGuard;
        ::chart::DataSourceDialog aDlg( m_pChartWindow, xChartDoc, m_xCC );
        if( aDlg.Execute() == RET_OK )
        VclPtr<::chart::DataSourceDialog> aDlg(new ::chart::DataSourceDialog( m_pChartWindow, xChartDoc, m_xCC ));
        if( aDlg->Execute() == RET_OK )
        {
            impl_adaptDataSeriesAutoResize();
            aUndoGuard.commit();
diff --git a/chart2/source/controller/main/ChartController_EditData.cxx b/chart2/source/controller/main/ChartController_EditData.cxx
index 9cba950..3f8079a 100644
--- a/chart2/source/controller/main/ChartController_EditData.cxx
+++ b/chart2/source/controller/main/ChartController_EditData.cxx
@@ -54,10 +54,9 @@ void ChartController::executeDispatch_EditData()
            UndoLiveUpdateGuardWithData aUndoGuard = UndoLiveUpdateGuardWithData(
                SCH_RESSTR( STR_ACTION_EDIT_CHART_DATA ),
                m_xUndoManager );
            vcl::Window* pParent( NULL );
            DataEditor aDataEditorDialog( pParent, xChartDoc, m_xCC );
            if (aDataEditorDialog.Execute() == RET_OK)
                aDataEditorDialog.ApplyChangesToModel();
            VclPtr<DataEditor> aDataEditorDialog(new DataEditor( nullptr, xChartDoc, m_xCC ));
            if (aDataEditorDialog->Execute() == RET_OK)
                aDataEditorDialog->ApplyChangesToModel();
            aUndoGuard.commit();
        }
    }
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index 7c83ecc..57a5d9d 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -109,14 +109,14 @@ void ChartController::executeDispatch_InsertAxes()
        AxisHelper::getAxisOrGridPossibilities( aDialogInput.aPossibilityList, xDiagram, true );

        SolarMutexGuard aGuard;
        SchAxisDlg aDlg( m_pChartWindow, aDialogInput );
        if( aDlg.Execute() == RET_OK )
        VclPtr<SchAxisDlg> aDlg(new SchAxisDlg( m_pChartWindow, aDialogInput ));
        if( aDlg->Execute() == RET_OK )
        {
            // lock controllers till end of block
            ControllerLockGuardUNO aCLGuard( getModel() );

            InsertAxisOrGridDialogData aDialogOutput;
            aDlg.getResult( aDialogOutput );
            aDlg->getResult( aDialogOutput );
            boost::scoped_ptr< ReferenceSizeProvider > mpRefSizeProvider(
                impl_createReferenceSizeProvider());
            bool bChanged = AxisHelper::changeVisibilityOfAxes( xDiagram
@@ -147,13 +147,13 @@ void ChartController::executeDispatch_InsertGrid()
        AxisHelper::getAxisOrGridPossibilities( aDialogInput.aPossibilityList, xDiagram, false );

        SolarMutexGuard aGuard;
        SchGridDlg aDlg( m_pChartWindow, aDialogInput );//aItemSet, b3D, bNet, bSecondaryX, bSecondaryY );
        if( aDlg.Execute() == RET_OK )
        VclPtr<SchGridDlg> aDlg(new SchGridDlg( m_pChartWindow, aDialogInput ));//aItemSet, b3D, bNet, bSecondaryX, bSecondaryY );
        if( aDlg->Execute() == RET_OK )
        {
            // lock controllers till end of block
            ControllerLockGuardUNO aCLGuard( getModel() );
            InsertAxisOrGridDialogData aDialogOutput;
            aDlg.getResult( aDialogOutput );
            aDlg->getResult( aDialogOutput );
            bool bChanged = AxisHelper::changeVisibilityOfGrids( xDiagram
                , aDialogInput.aExistenceList, aDialogOutput.aExistenceList, m_xCC );
            if( bChanged )
@@ -179,13 +179,13 @@ void ChartController::executeDispatch_InsertTitles()
        aDialogInput.readFromModel( getModel() );

        SolarMutexGuard aGuard;
        SchTitleDlg aDlg( m_pChartWindow, aDialogInput );
        if( aDlg.Execute() == RET_OK )
        VclPtr<SchTitleDlg> aDlg(new SchTitleDlg( m_pChartWindow, aDialogInput ));
        if( aDlg->Execute() == RET_OK )
        {
            // lock controllers till end of block
            ControllerLockGuardUNO aCLGuard( getModel() );
            TitleDialogData aDialogOutput(impl_createReferenceSizeProvider());
            aDlg.getResult( aDialogOutput );
            aDlg->getResult( aDialogOutput );
            bool bChanged = aDialogOutput.writeDifferenceToModel( getModel(), m_xCC, &aDialogInput );
            if( bChanged )
                aUndoGuard.commit();
@@ -232,13 +232,13 @@ void ChartController::executeDispatch_OpenLegendDialog()
    {
        //prepare and open dialog
        SolarMutexGuard aGuard;
        SchLegendDlg aDlg( m_pChartWindow, m_xCC );
        aDlg.init( getModel() );
        if( aDlg.Execute() == RET_OK )
        VclPtr<SchLegendDlg> aDlg(new SchLegendDlg( m_pChartWindow, m_xCC ));
        aDlg->init( getModel() );
        if( aDlg->Execute() == RET_OK )
        {
            // lock controllers till end of block
            ControllerLockGuardUNO aCLGuard( getModel() );
            bool bChanged = aDlg.writeToModel( getModel() );
            bool bChanged = aDlg->writeToModel( getModel() );
            if( bChanged )
                aUndoGuard.commit();
        }
@@ -292,12 +292,12 @@ void ChartController::executeDispatch_InsertMenu_DataLabels()
        NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
        SvNumberFormatter* pNumberFormatter = aNumberFormatterWrapper.getSvNumberFormatter();

        DataLabelsDialog aDlg( m_pChartWindow, aItemSet, pNumberFormatter);
        VclPtr<DataLabelsDialog> aDlg(new DataLabelsDialog( m_pChartWindow, aItemSet, pNumberFormatter));

        if( aDlg.Execute() == RET_OK )
        if( aDlg->Execute() == RET_OK )
        {
            SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet();
            aDlg.FillItemSet( aOutItemSet );
            aDlg->FillItemSet( aOutItemSet );
            // lock controllers till end of block
            ControllerLockGuardUNO aCLGuard( getModel() );
            bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
@@ -397,14 +397,14 @@ void ChartController::executeDispatch_InsertTrendline()
    aDialogParameter.init( getModel() );
    ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get());
    SolarMutexGuard aGuard;
    SchAttribTabDlg aDialog( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider,
                          uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY ));
    VclPtr<SchAttribTabDlg> aDialog(new SchAttribTabDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider,
                          uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY )));

    // note: when a user pressed "OK" but didn't change any settings in the
    // dialog, the SfxTabDialog returns "Cancel"
    if( aDialog.Execute() == RET_OK || aDialog.DialogWasClosedWithOK())
    if( aDialog->Execute() == RET_OK || aDialog->DialogWasClosedWithOK())
    {
        const SfxItemSet* pOutItemSet = aDialog.GetOutputItemSet();
        const SfxItemSet* pOutItemSet = aDialog->GetOutputItemSet();
        if( pOutItemSet )
        {
            ControllerLockGuardUNO aCLGuard( getModel() );
@@ -452,17 +452,17 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError )
        aDialogParameter.init( getModel() );
        ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get());
        SolarMutexGuard aGuard;
        SchAttribTabDlg aDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider,
                              uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY ));
        aDlg.SetAxisMinorStepWidthForErrorBarDecimals(
        VclPtr<SchAttribTabDlg> aDlg(new SchAttribTabDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider,
                              uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY )));
        aDlg->SetAxisMinorStepWidthForErrorBarDecimals(
            InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getModel(),
                                                                             m_xChartView, m_aSelection.getSelectedCID()));

        // note: when a user pressed "OK" but didn't change any settings in the
        // dialog, the SfxTabDialog returns "Cancel"
        if( aDlg.Execute() == RET_OK || aDlg.DialogWasClosedWithOK())
        if( aDlg->Execute() == RET_OK || aDlg->DialogWasClosedWithOK())
        {
            const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet();
            const SfxItemSet* pOutItemSet = aDlg->GetOutputItemSet();
            if( pOutItemSet )
            {
                ControllerLockGuardUNO aCLGuard( getModel() );
@@ -489,18 +489,18 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError )

            //prepare and open dialog
            SolarMutexGuard aGuard;
            InsertErrorBarsDialog aDlg(
            VclPtr<InsertErrorBarsDialog> aDlg(new InsertErrorBarsDialog(
                m_pChartWindow, aItemSet,
                uno::Reference< chart2::XChartDocument >( getModel(), uno::UNO_QUERY ),
                bYError ? ErrorBarResources::ERROR_BAR_Y : ErrorBarResources::ERROR_BAR_X);
                bYError ? ErrorBarResources::ERROR_BAR_Y : ErrorBarResources::ERROR_BAR_X));

            aDlg.SetAxisMinorStepWidthForErrorBarDecimals(
            aDlg->SetAxisMinorStepWidthForErrorBarDecimals(
                InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getModel(), m_xChartView, OUString() ) );

            if( aDlg.Execute() == RET_OK )
            if( aDlg->Execute() == RET_OK )
            {
                SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet();
                aDlg.FillItemSet( aOutItemSet );
                aDlg->FillItemSet( aOutItemSet );

                // lock controllers till end of block
                ControllerLockGuardUNO aCLGuard( getModel() );
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx
index ca3dfa1..d0676cd1 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -761,8 +761,8 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard(
        ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get() );

        SolarMutexGuard aGuard;
        SchAttribTabDlg aDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider
            , uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY ) );
        VclPtr<SchAttribTabDlg> aDlg(new SchAttribTabDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider
            , uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY ) ));

        if(aDialogParameter.HasSymbolProperties())
        {
@@ -782,18 +782,18 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard(
            sal_Int32   nStandardSymbol=0;//@todo get from somewhere
            Graphic*    pAutoSymbolGraphic = new Graphic( aViewElementListProvider.GetSymbolGraphic( nStandardSymbol, pSymbolShapeProperties ) );
            // note: the dialog takes the ownership of pSymbolShapeProperties and pAutoSymbolGraphic
            aDlg.setSymbolInformation( pSymbolShapeProperties, pAutoSymbolGraphic );
            aDlg->setSymbolInformation( pSymbolShapeProperties, pAutoSymbolGraphic );
        }
        if( aDialogParameter.HasStatisticProperties() )
        {
            aDlg.SetAxisMinorStepWidthForErrorBarDecimals(
            aDlg->SetAxisMinorStepWidthForErrorBarDecimals(
                InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getModel(), m_xChartView, rObjectCID ) );
        }

        //open the dialog
        if (aDlg.Execute() == RET_OK || (bSuccessOnUnchanged && aDlg.DialogWasClosedWithOK()))
        if (aDlg->Execute() == RET_OK || (bSuccessOnUnchanged && aDlg->DialogWasClosedWithOK()))
        {
            const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet();
            const SfxItemSet* pOutItemSet = aDlg->GetOutputItemSet();
            if(pOutItemSet)
            {
                ControllerLockGuardUNO aCLGuard( getModel());
@@ -822,8 +822,8 @@ void ChartController::executeDispatch_View3D()

        //open dialog
        SolarMutexGuard aSolarGuard;
        View3DDialog aDlg( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorList() );
        if( aDlg.Execute() == RET_OK )
        VclPtr<View3DDialog> aDlg(new View3DDialog( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorList() ));
        if( aDlg->Execute() == RET_OK )
            aUndoGuard.commit();
    }
    catch(const uno::RuntimeException& e)
diff --git a/compilerplugins/clang/vclwidgets.cxx b/compilerplugins/clang/vclwidgets.cxx
index 38a4741..bf1f86e 100644
--- a/compilerplugins/clang/vclwidgets.cxx
+++ b/compilerplugins/clang/vclwidgets.cxx
@@ -31,13 +31,15 @@ public:

    virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

    bool VisitFieldDecl(const FieldDecl * decl);
    bool VisitVarDecl(const VarDecl *);

    bool VisitParmVarDecl(ParmVarDecl const * decl);
    bool VisitFieldDecl(const FieldDecl *);

    bool VisitFunctionDecl( const FunctionDecl* var );
    bool VisitParmVarDecl(const ParmVarDecl *);

    bool VisitCXXDestructorDecl(const CXXDestructorDecl* pCXXDestructorDecl);
    bool VisitFunctionDecl(const FunctionDecl *);

    bool VisitCXXDestructorDecl(const CXXDestructorDecl *);

private:
    bool isDisposeCallingSuperclassDispose(const CXXMethodDecl* pMethodDecl);
@@ -150,6 +152,30 @@ bool VCLWidgets::VisitCXXDestructorDecl(const CXXDestructorDecl* pCXXDestructorD
}


bool VCLWidgets::VisitVarDecl(const VarDecl * pVarDecl) {
    if (ignoreLocation(pVarDecl)) {
        return true;
    }
    const RecordType *recordType = pVarDecl->getType()->getAs<RecordType>();
    if (recordType == nullptr) {
        return true;
    }
    const CXXRecordDecl *recordDecl = dyn_cast<CXXRecordDecl>(recordType->getDecl());
    if (recordDecl == nullptr) {
        return true;
    }

    // check if this field is derived from Window
    if (isDerivedFromWindow(recordDecl)) {
        report(
            DiagnosticsEngine::Warning,
            "vcl::Window subclass allocated on stack, should be allocated via VclPtr or via *.",
            pVarDecl->getLocation())
          << pVarDecl->getSourceRange();
    }
    return true;
}

bool VCLWidgets::VisitFieldDecl(const FieldDecl * fieldDecl) {
    if (ignoreLocation(fieldDecl)) {
        return true;
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 05c7796..7c108a6 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2355,9 +2355,9 @@ short SvxMenuConfigPage::QueryReset()

    OUString label = replaceSaveInName( msg, saveInName );

    QueryBox qbox( this, WB_YES_NO, label );
    VclPtr<QueryBox> qbox(new QueryBox( this, WB_YES_NO, label ));

    return qbox.Execute();
    return qbox->Execute();
}

IMPL_LINK( SvxMenuConfigPage, SelectMenu, ListBox *, pBox )
@@ -2996,10 +2996,10 @@ bool SvxToolbarConfigPage::DeleteSelectedContent()
        if ( m_pContentsListBox->GetEntryCount() == 0 &&
             GetTopLevelSelection()->IsDeletable() )
        {
            MessageDialog qbox(this,
                CUI_RES(RID_SXVSTR_CONFIRM_DELETE_TOOLBAR), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
            VclPtr<MessageDialog> qbox(new MessageDialog(this,
                CUI_RES(RID_SXVSTR_CONFIRM_DELETE_TOOLBAR), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));

            if ( qbox.Execute() == RET_YES )
            if ( qbox->Execute() == RET_YES )
            {
                DeleteSelectedTopLevel();
            }
@@ -3076,10 +3076,10 @@ IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton )
        }
        case ID_DEFAULT_STYLE:
        {
            MessageDialog qbox(this,
                CUI_RES(RID_SVXSTR_CONFIRM_RESTORE_DEFAULT), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
            VclPtr<MessageDialog> qbox(new MessageDialog(this,
                CUI_RES(RID_SVXSTR_CONFIRM_RESTORE_DEFAULT), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));

            if ( qbox.Execute() == RET_YES )
            if ( qbox->Execute() == RET_YES )
            {
                ToolbarSaveInData* pSaveInData_ =
                    static_cast<ToolbarSaveInData*>(GetSaveInData());
@@ -4307,9 +4307,9 @@ short SvxToolbarConfigPage::QueryReset()

    OUString label = replaceSaveInName( msg, saveInName );

    QueryBox qbox( this, WB_YES_NO, label );
    VclPtr<QueryBox> qbox(new QueryBox( this, WB_YES_NO, label ));

    return qbox.Execute();
    return qbox->Execute();
}

IMPL_LINK( SvxToolbarConfigPage, SelectToolbar, ListBox *, pBox )
@@ -5226,8 +5226,8 @@ void SvxIconSelectorDialog::ImportGraphics(
            message += newLine;
        }

        SvxIconChangeDialog aDialog(this, message);
        aDialog.Execute();
        VclPtr<SvxIconChangeDialog> aDialog(new SvxIconChangeDialog(this, message));
        aDialog->Execute();
    }
}

diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 9f091c1..2d130a5 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -2035,9 +2035,9 @@ IMPL_LINK( SpellDialog, HandleHyperlink, FixedHyperlink*, pHyperlink )
        uno::Any exc( ::cppu::getCaughtException() );
        OUString msg( ::comphelper::anyToString( exc ) );
        const SolarMutexGuard guard;
        MessageDialog aErrorBox(NULL, msg);
        aErrorBox.SetText(sTitle);
        aErrorBox.Execute();
        VclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, msg));
        aErrorBox->SetText(sTitle);
        aErrorBox->Execute();
    }

    return 1;
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index f5761d3..867c8ce 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -126,9 +126,9 @@ IMPL_LINK( AboutDialog, HandleClick, PushButton*, pButton )
        Any exc( ::cppu::getCaughtException() );
        OUString msg( ::comphelper::anyToString( exc ) );
        const SolarMutexGuard guard;
        MessageDialog aErrorBox(NULL, msg);
        aErrorBox.SetText( GetText() );
        aErrorBox.Execute();
        VclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, msg));
        aErrorBox->SetText( GetText() );
        aErrorBox->Execute();
    }

    return 1;
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index 4b8c9a3..76619da 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -1509,10 +1509,10 @@ void SAL_CALL ColorPicker::setTitle( const OUString& sTitle ) throw (RuntimeExce

sal_Int16 SAL_CALL ColorPicker::execute(  ) throw (RuntimeException, std::exception)
{
    ColorPickerDialog aDlg( VCLUnoHelper::GetWindow( mxParent ), mnColor, mnMode );
    sal_Int16 ret = aDlg.Execute();
    VclPtr<ColorPickerDialog> aDlg(new ColorPickerDialog( VCLUnoHelper::GetWindow( mxParent ), mnColor, mnMode ));
    sal_Int16 ret = aDlg->Execute();
    if( ret )
        mnColor = aDlg.GetColor();
        mnColor = aDlg->GetColor();

    return ret;
}
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index d6487fb..27337db 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -552,8 +552,8 @@ IMPL_LINK_NOARG(GalleryIdDialog, ClickOkHdl)
            aStr += pInfo->GetThemeName();
            aStr += ")";

            InfoBox aBox( this, aStr );
            aBox.Execute();
            VclPtr<InfoBox> aBox(new InfoBox( this, aStr ));
            aBox->Execute();
            m_pLbResName->GrabFocus();
            bDifferentThemeExists = true;
        }
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index ff425f9..46136a9 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -732,8 +732,8 @@ namespace svx

    IMPL_LINK_NOARG( HangulHanjaConversionDialog, OnOption )
    {
        HangulHanjaOptionsDialog        aOptDlg( this );
        aOptDlg.Execute();
        VclPtr<HangulHanjaOptionsDialog>        aOptDlg( new HangulHanjaOptionsDialog(this) );
        aOptDlg->Execute();
        m_aOptionsChangedLink.Call( this );
        return 0L;
    }
@@ -1012,9 +1012,9 @@ namespace svx
    IMPL_LINK_NOARG(HangulHanjaOptionsDialog, NewDictHdl)
    {
        OUString                    aName;
        HangulHanjaNewDictDialog    aNewDlg( this );
        aNewDlg.Execute();
        if( aNewDlg.GetName( aName ) )
        VclPtr<HangulHanjaNewDictDialog>    aNewDlg( new HangulHanjaNewDictDialog(this) );
        aNewDlg->Execute();
        if( aNewDlg->GetName( aName ) )
        {
            if( m_xConversionDictionaryList.is() )
            {
@@ -1048,8 +1048,8 @@ namespace svx
        DBG_ASSERT( pEntry, "+HangulHanjaEditDictDialog::EditDictHdl(): call of edit should not be possible with no selection!" );
        if( pEntry )
        {
            HangulHanjaEditDictDialog   aEdDlg( this, m_aDictList, m_pDictsLB->GetSelectEntryPos() );
            aEdDlg.Execute();
            VclPtr<HangulHanjaEditDictDialog>   aEdDlg( new HangulHanjaEditDictDialog(this, m_aDictList, m_pDictsLB->GetSelectEntryPos()) );
            aEdDlg->Execute();
        }
        return 0L;
    }
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index b415ae3..f1c7900 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -266,8 +266,8 @@ bool SvxHyperlinkNewDocTp::AskApply()
    bool bRet = ImplGetURLObject( m_pCbbPath->GetText(), m_pCbbPath->GetBaseURL(), aINetURLObject );
    if ( !bRet )
    {
        WarningBox aWarning( this, WB_OK, CUI_RESSTR(RID_SVXSTR_HYPDLG_NOVALIDFILENAME) );
        aWarning.Execute();
        VclPtr<WarningBox> aWarning(new WarningBox( this, WB_OK, CUI_RESSTR(RID_SVXSTR_HYPDLG_NOVALIDFILENAME) ) );
        aWarning->Execute();
    }
    return bRet;
}
@@ -316,8 +316,8 @@ void SvxHyperlinkNewDocTp::DoApply ()

                if( bOk )
                {
                    WarningBox aWarning( this, WB_YES_NO, CUI_RESSTR(RID_SVXSTR_HYPERDLG_QUERYOVERWRITE) );
                    bCreate = aWarning.Execute() == RET_YES;
                    VclPtr<WarningBox> aWarning(new WarningBox( this, WB_YES_NO, CUI_RESSTR(RID_SVXSTR_HYPERDLG_QUERYOVERWRITE) ));
                    bCreate = aWarning->Execute() == RET_YES;
                }
            }

diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index bec3132..62fd046 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -325,10 +325,10 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl)
        bool bIsInputEnabled = GetParent()->IsInputEnabled();
        if ( bIsInputEnabled )
            GetParent()->EnableInput( false );
        SfxMacroAssignDlg aDlg( this, mxDocumentFrame, *pItemSet );
        VclPtr<SfxMacroAssignDlg> aDlg(new SfxMacroAssignDlg( this, mxDocumentFrame, *pItemSet ));

        // add events
        SfxMacroTabPage *pMacroPage = static_cast<SfxMacroTabPage*>( aDlg.GetTabPage() );
        SfxMacroTabPage *pMacroPage = static_cast<SfxMacroTabPage*>( aDlg->GetTabPage() );

        if ( pHyperlinkItem->GetMacroEvents() & HYPERDLG_EVENT_MOUSEOVER_OBJECT )
            pMacroPage->AddEvent( OUString( CUI_RESSTR(RID_SVXSTR_HYPDLG_MACROACT1) ),
@@ -344,11 +344,11 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl)
            GetParent()->EnableInput( true );
        // execute dlg
        DisableClose( true );
        short nRet = aDlg.Execute();
        short nRet = aDlg->Execute();
        DisableClose( false );
        if ( RET_OK == nRet )
        {
            const SfxItemSet* pOutSet = aDlg.GetOutputItemSet();
            const SfxItemSet* pOutSet = aDlg->GetOutputItemSet();
            const SfxPoolItem* pItem;
            if( SfxItemState::SET == pOutSet->GetItemState( SID_ATTR_MACROITEM, false, &pItem ))
            {
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index 610ea49..95c348d 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -424,9 +424,9 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
        if( !xLink.Is() )
            return 0;

        QueryBox aBox( this, WB_YES_NO | WB_DEF_YES, Closelinkmsg() );
        VclPtr<QueryBox> aBox(new QueryBox( this, WB_YES_NO | WB_DEF_YES, Closelinkmsg() ));

        if( RET_YES == aBox.Execute() )
        if( RET_YES == aBox->Execute() )
        {
            m_pTbLinks->GetModel()->Remove( m_pTbLinks->GetEntry( nPos ) );

@@ -455,9 +455,9 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
    }
    else
    {
        QueryBox aBox( this, WB_YES_NO | WB_DEF_YES, CloselinkmsgMulti() );
        VclPtr<QueryBox> aBox(new QueryBox( this, WB_YES_NO | WB_DEF_YES, CloselinkmsgMulti() ));

        if( RET_YES == aBox.Execute() )
        if( RET_YES == aBox->Execute() )
        {

            SvBaseLinkMemberList aLinkList;
diff --git a/cui/source/dialogs/passwdomdlg.cxx b/cui/source/dialogs/passwdomdlg.cxx
index 683d4e1..ccba000 100644
--- a/cui/source/dialogs/passwdomdlg.cxx
+++ b/cui/source/dialogs/passwdomdlg.cxx
@@ -101,9 +101,9 @@ IMPL_LINK( PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, OKButton *, EMPTYARG 
            m_pPasswdToModifyED->GetText().isEmpty();
    if (bInvalidState)
    {
        MessageDialog aErrorBox(m_pParent,
            m_bIsPasswordToModify? m_aInvalidStateForOkButton : m_aInvalidStateForOkButton_v2);
        aErrorBox.Execute();
        VclPtr<MessageDialog> aErrorBox(new MessageDialog(m_pParent,
            m_bIsPasswordToModify? m_aInvalidStateForOkButton : m_aInvalidStateForOkButton_v2));
        aErrorBox->Execute();
    }
    else // check for mismatched passwords...
    {
@@ -112,8 +112,8 @@ IMPL_LINK( PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, OKButton *, EMPTYARG 
        const int nMismatch = (bToOpenMatch? 0 : 1) + (bToModifyMatch? 0 : 1);
        if (nMismatch > 0)
        {
            MessageDialog aErrorBox(m_pParent, nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch);
            aErrorBox.Execute();
            VclPtr<MessageDialog> aErrorBox(new MessageDialog(m_pParent, nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch));
            aErrorBox->Execute();

            Edit* pEdit = !bToOpenMatch ? m_pPasswdToOpenED : m_pPasswdToModifyED;
            Edit* pRepeatEdit = !bToOpenMatch? m_pReenterPasswdToOpenED : m_pReenterPasswdToModifyED;
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index adde1bb..4013f71 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -904,9 +904,9 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
                        bValid = false;
                        OUString aError( m_createErrStr );
                        aError += m_createDupStr;
                        MessageDialog aErrorBox(static_cast<vcl::Window*>(this), aError);
                        aErrorBox.SetText( m_createErrTitleStr );
                        aErrorBox.Execute();
                        VclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), aError));
                        aErrorBox->SetText( m_createErrTitleStr );
                        aErrorBox->Execute();
                        xNewDlg->SetObjectName( aNewName );
                        break;
                    }
@@ -986,9 +986,9 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
    {
        //ISSUE L10N & message from exception?
        OUString aError( m_createErrStr );
        MessageDialog aErrorBox(static_cast<vcl::Window*>(this), aError);
        aErrorBox.SetText( m_createErrTitleStr );
        aErrorBox.Execute();
        VclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), aError));
        aErrorBox->SetText( m_createErrTitleStr );
        aErrorBox->Execute();
    }
}

@@ -1062,9 +1062,9 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry )
    {
        //ISSUE L10N & message from exception?
        OUString aError( m_renameErrStr );
        MessageDialog aErrorBox(static_cast<vcl::Window*>(this), aError);
        aErrorBox.SetText( m_renameErrTitleStr );
        aErrorBox.Execute();
        VclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), aError));
        aErrorBox->SetText( m_renameErrTitleStr );
        aErrorBox->Execute();
    }
}
void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
@@ -1073,9 +1073,9 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
    Reference< browse::XBrowseNode > node = getBrowseNode( pEntry );
    // ISSUE L10N string & can we centre list?
    OUString aQuery = m_delQueryStr + getListOfChildren( node, 0 );
    MessageDialog aQueryBox(static_cast<vcl::Window*>(this), aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
    aQueryBox.SetText( m_delQueryTitleStr );
    if ( aQueryBox.Execute() == RET_NO )
    VclPtr<MessageDialog> aQueryBox(new MessageDialog(static_cast<vcl::Window*>(this), aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
    aQueryBox->SetText( m_delQueryTitleStr );
    if ( aQueryBox->Execute() == RET_NO )
    {
        return;
    }
@@ -1108,9 +1108,9 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
    else
    {
        //ISSUE L10N & message from exception?
        MessageDialog aErrorBox(static_cast<vcl::Window*>(this), m_delErrStr);
        aErrorBox.SetText( m_delErrTitleStr );
        aErrorBox.Execute();
        VclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), m_delErrStr));
        aErrorBox->SetText( m_delErrTitleStr );
        aErrorBox->Execute();
    }

}
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index 2a48aac..eb2364e 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -274,8 +274,8 @@ IMPL_LINK_NOARG(DbRegistrationOptionsPage, DeleteHdl)
    SvTreeListEntry* pEntry = pPathBox->FirstSelected();
    if ( pEntry )
    {
        MessageDialog aQuery(this, CUI_RES(RID_SVXSTR_QUERY_DELETE_CONFIRM), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
        if ( aQuery.Execute() == RET_YES )
        VclPtr<MessageDialog> aQuery(new MessageDialog(this, CUI_RES(RID_SVXSTR_QUERY_DELETE_CONFIRM), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
        if ( aQuery->Execute() == RET_YES )
            pPathBox->GetModel()->Remove(pEntry);
    }
    return 0;
@@ -410,15 +410,15 @@ void DbRegistrationOptionsPage::insertNewEntry( const OUString& _sName,const OUS

void DbRegistrationOptionsPage::openLinkDialog(const OUString& _sOldName,const OUString& _sOldLocation,SvTreeListEntry* _pEntry)
{
    ODocumentLinkDialog aDlg(this,_pEntry == NULL);
    VclPtr<ODocumentLinkDialog> aDlg(new ODocumentLinkDialog(this,_pEntry == NULL));

    aDlg.setLink(_sOldName,_sOldLocation);
    aDlg.setNameValidator(LINK( this, DbRegistrationOptionsPage, NameValidator ) );
    aDlg->setLink(_sOldName,_sOldLocation);
    aDlg->setNameValidator(LINK( this, DbRegistrationOptionsPage, NameValidator ) );

    if ( aDlg.Execute() == RET_OK )
    if ( aDlg->Execute() == RET_OK )
    {
        OUString sNewName,sNewLocation;
        aDlg.getLink(sNewName,sNewLocation);
        aDlg->getLink(sNewName,sNewLocation);
        if ( _pEntry == NULL || sNewName != _sOldName || sNewLocation != _sOldLocation )
        {
            if ( _pEntry )
diff --git a/cui/source/options/doclinkdialog.cxx b/cui/source/options/doclinkdialog.cxx
index ffeeb84..0148229 100644
--- a/cui/source/options/doclinkdialog.cxx
+++ b/cui/source/options/doclinkdialog.cxx
@@ -116,8 +116,8 @@ namespace svx
        {
            OUString sMsg = CUI_RES(STR_LINKEDDOC_DOESNOTEXIST);
            sMsg = sMsg.replaceFirst("$file$", m_pURL->GetText());
            MessageDialog aError(this, sMsg);
            aError.Execute();
            VclPtr<MessageDialog> aError(new MessageDialog(this, sMsg));
            aError->Execute();
            return 0L;
        } // if (!bFileExists)
        INetURLObject aURL( sURL );
@@ -125,8 +125,8 @@ namespace svx
        {
            OUString sMsg = CUI_RES(STR_LINKEDDOC_NO_SYSTEM_FILE);
            sMsg = sMsg.replaceFirst("$file$", m_pURL->GetText());
            MessageDialog aError(this, sMsg);
            aError.Execute();
            VclPtr<MessageDialog> aError(new MessageDialog(this, sMsg));
            aError->Execute();
            return 0L;
        }

@@ -137,8 +137,8 @@ namespace svx
            {
                OUString sMsg = CUI_RES(STR_NAME_CONFLICT);
                sMsg = sMsg.replaceFirst("$file$", sCurrentText);
                MessageDialog aError(this, sMsg, VCL_MESSAGE_INFO);
                aError.Execute();
                VclPtr<MessageDialog> aError(new MessageDialog(this, sMsg, VCL_MESSAGE_INFO));
                aError->Execute();

                m_pName->SetSelection(Selection(0,sCurrentText.getLength()));
                m_pName->GrabFocus();
diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx
index d1aa210..8f8fd97 100644
--- a/cui/source/options/optchart.cxx
+++ b/cui/source/options/optchart.cxx
@@ -221,9 +221,9 @@ IMPL_LINK( SvxDefaultColorOptPage, RemoveChartColor, PushButton*, pButton )
    {
        OSL_ENSURE(pColorConfig->GetColorList().size() > 1, "don't delete the last chart color");

        MessageDialog aQuery(pButton, "QueryDeleteChartColorDialog",
            "cui/ui/querydeletechartcolordialog.ui");
        if (RET_YES == aQuery.Execute())
        VclPtr<MessageDialog> aQuery(new MessageDialog(pButton, "QueryDeleteChartColorDialog",
            "cui/ui/querydeletechartcolordialog.ui"));
        if (RET_YES == aQuery->Execute())
        {
            pColorConfig->GetColorList().remove( nIndex  );

diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 2cb909f..3eb0229 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -545,12 +545,12 @@ void ColorConfigWindow_Impl::CreateEntries()
    long nCheckBoxLabelOffset = 0;
    {
        OUString sSampleText("X");
        CheckBox aCheckBox(this);
        FixedText aFixedText(this);
        aCheckBox.SetText(sSampleText);
        aFixedText.SetText(sSampleText);
        Size aCheckSize(aCheckBox.CalcMinimumSize(0x7fffffff));
        Size aFixedSize(aFixedText.CalcMinimumSize(0x7fffffff));
        VclPtr<CheckBox> aCheckBox(new CheckBox(this));
        VclPtr<FixedText> aFixedText(new FixedText(this));
        aCheckBox->SetText(sSampleText);
        aFixedText->SetText(sSampleText);
        Size aCheckSize(aCheckBox->CalcMinimumSize(0x7fffffff));
        Size aFixedSize(aFixedText->CalcMinimumSize(0x7fffffff));
        nCheckBoxLabelOffset = aCheckSize.Width() - aFixedSize.Width();
    }

@@ -620,13 +620,13 @@ void ColorConfigWindow_Impl::SetAppearance ()
    OSL_ENSURE( vEntries.size() >= sizeof vEntryInfo / sizeof vEntryInfo[0], "wrong number of helpIDs for color listboxes" );

    // creating a sample color listbox with the color entries
    ColorListBox aSampleColorList(this);
    VclPtr<ColorListBox> aSampleColorList(new ColorListBox(this));
    {
        XColorListRef const xColorTable = XColorList::CreateStdColorList();
        for (sal_Int32 i = 0; i != xColorTable->Count(); ++i)
        {
            XColorEntry& rEntry = *xColorTable->GetColor(i);
            aSampleColorList.InsertEntry(rEntry.GetColor(), rEntry.GetName());
            aSampleColorList->InsertEntry(rEntry.GetColor(), rEntry.GetName());
        }
    }

@@ -634,7 +634,7 @@ void ColorConfigWindow_Impl::SetAppearance ()
    for (size_t i = 0; i != vEntries.size(); ++i)
    {
        // appearance
        vEntries[i]->SetAppearance(aTransparentWall, aSampleColorList);
        vEntries[i]->SetAppearance(aTransparentWall, *aSampleColorList.get());
    }
}

@@ -1187,9 +1187,9 @@ IMPL_LINK(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, PushButton*, pButton )
    else
    {
        DBG_ASSERT(m_pColorSchemeLB->GetEntryCount() > 1, "don't delete the last scheme");
        MessageDialog aQuery(pButton, CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
        aQuery.SetText(CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE_TITLE));
        if(RET_YES == aQuery.Execute())
        VclPtr<MessageDialog> aQuery(new MessageDialog(pButton, CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
        aQuery->SetText(CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE_TITLE));
        if(RET_YES == aQuery->Execute())
        {
            OUString sDeleteScheme(m_pColorSchemeLB->GetSelectEntry());
            m_pColorSchemeLB->RemoveEntry(m_pColorSchemeLB->GetSelectEntryPos());
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index daf0bbb..fefbbd2 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -446,12 +446,12 @@ IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectLangHdl_Impl)

    if ( nLang != nOldLang )
    {
        MessageDialog aBox(this, CUI_RES( RID_SVXSTR_CONFIRM_SET_LANGUAGE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
        OUString sTxt(aBox.get_primary_text());
        VclPtr<MessageDialog> aBox(new MessageDialog(this, CUI_RES( RID_SVXSTR_CONFIRM_SET_LANGUAGE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
        OUString sTxt(aBox->get_primary_text());
        sTxt = sTxt.replaceFirst( "%1", pAllDictsLB->GetSelectEntry() );
        aBox.set_primary_text(sTxt);
        aBox->set_primary_text(sTxt);

        if ( aBox.Execute() == RET_YES )
        if ( aBox->Execute() == RET_YES )
        {
            xDic->setLocale( LanguageTag::convertToLocale( nLang ) );
            bool bNegativ = xDic->getDictionaryType() == DictionaryType_NEGATIVE;
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 012d790..09c74e5a 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1298,8 +1298,8 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
            xProp->setPropertyValue(sUserLocaleKey, makeAny(aLangString));
            Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
            // display info
            MessageDialog aBox(this, CUI_RES(RID_SVXSTR_LANGUAGE_RESTART), VCL_MESSAGE_INFO);
            aBox.Execute();
            VclPtr<MessageDialog> aBox(new MessageDialog(this, CUI_RES(RID_SVXSTR_LANGUAGE_RESTART), VCL_MESSAGE_INFO));
            aBox->Execute();

            // tell quickstarter to stop being a veto listener

diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 5d01c40..04333b7 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -669,8 +669,8 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, SavePasswordHdl)
        }
        else
        {
            QueryBox aQuery( this, WB_YES_NO|WB_DEF_NO, m_sPasswordStoringDeactivateStr );
            sal_uInt16 nRet = aQuery.Execute();
            VclPtr<QueryBox> aQuery(new QueryBox( this, WB_YES_NO|WB_DEF_NO, m_sPasswordStoringDeactivateStr ));
            sal_uInt16 nRet = aQuery->Execute();

            if( RET_YES == nRet )
            {
@@ -766,8 +766,8 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, ShowPasswordsHdl)

        if ( xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->authorizateWithMasterPassword( Reference< task::XInteractionHandler>() ) )
        {
            svx::WebConnectionInfoDialog aDlg( this );
            aDlg.Execute();
            VclPtr<svx::WebConnectionInfoDialog> aDlg( new svx::WebConnectionInfoDialog(this) );
            aDlg->Execute();
        }
    }
    catch (const Exception&)
@@ -785,8 +785,8 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, CertPathPBHdl)

    if (nRet == RET_OK && sOrig != mpCertPathDlg->getDirectory())
    {
        MessageDialog aWarnBox(this, CUI_RES(RID_SVXSTR_OPTIONS_RESTART), VCL_MESSAGE_INFO);
        aWarnBox.Execute();
        VclPtr<MessageDialog> aWarnBox(new MessageDialog(this, CUI_RES(RID_SVXSTR_OPTIONS_RESTART), VCL_MESSAGE_INFO));
        aWarnBox->Execute();
    }

    return 0;
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index e95c86c..8843f10 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -326,8 +326,8 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl)
            (void)eErr;
            if ( bRunning )
            {
                MessageDialog aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO );
                aWarnBox.Execute();
                VclPtr<MessageDialog> aWarnBox(new MessageDialog( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO ));
                aWarnBox->Execute();
            }
        }
    }
@@ -371,8 +371,8 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ClassPathHdl_Impl)
            (void)eErr;
            if ( bRunning )
            {
                MessageDialog aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO );
                aWarnBox.Execute();
                VclPtr<MessageDialog> aWarnBox(new MessageDialog( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO ));
                aWarnBox->Execute();
            }
        }
    }
@@ -620,13 +620,13 @@ void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder )
    }
    else if ( JFW_E_NOT_RECOGNIZED == eErr )
    {
        MessageDialog aErrBox( this, CUI_RES( RID_SVXSTR_JRE_NOT_RECOGNIZED ) );
        aErrBox.Execute();
        VclPtr<MessageDialog> aErrBox(new MessageDialog( this, CUI_RES( RID_SVXSTR_JRE_NOT_RECOGNIZED ) ));
        aErrBox->Execute();
    }
    else if ( JFW_E_FAILED_VERSION == eErr )
    {
        MessageDialog aErrBox( this, CUI_RES( RID_SVXSTR_JRE_FAILED_VERSION ) );
        aErrBox.Execute();
        VclPtr<MessageDialog> aErrBox(new MessageDialog( this, CUI_RES( RID_SVXSTR_JRE_FAILED_VERSION ) ));
        aErrBox->Execute();
    }

    if ( bStartAgain )
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index f91b782..393f6f7 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1576,8 +1576,8 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
            pLinguData = new SvxLinguData_Impl;

        SvxLinguData_Impl   aOldLinguData( *pLinguData );
        SvxEditModulesDlg   aDlg( this, *pLinguData );
        if (aDlg.Execute() != RET_OK)
        VclPtr<SvxEditModulesDlg>   aDlg(new SvxEditModulesDlg( this, *pLinguData ));
        if (aDlg->Execute() != RET_OK)
            *pLinguData = aOldLinguData;

        // evaluate new status of 'bConfigured' flag
@@ -1653,9 +1653,9 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
    }
    else if (m_pLinguDicsDelPB == pBtn)
    {
        MessageDialog aQuery(this, "QueryDeleteDictionaryDialog",
            "cui/ui/querydeletedictionarydialog.ui");
        if (RET_NO == aQuery.Execute())
        VclPtr<MessageDialog> aQuery(new MessageDialog(this, "QueryDeleteDictionaryDialog",
            "cui/ui/querydeletedictionarydialog.ui"));
        if (RET_NO == aQuery->Execute())
            return 0;

        SvTreeListEntry *pEntry = m_pLinguDicsCLB->GetCurEntry();
@@ -1725,11 +1725,11 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
            if(aData.HasNumericValue())
            {
                sal_uInt16 nRID = aData.GetEntryId();
                OptionsBreakSet aDlg( this, nRID );
                aDlg.GetNumericFld().SetValue( aData.GetNumericValue() );
                if (RET_OK == aDlg.Execute() )
                VclPtr<OptionsBreakSet> aDlg( new OptionsBreakSet(this, nRID) );
                aDlg->GetNumericFld().SetValue( aData.GetNumericValue() );
                if (RET_OK == aDlg->Execute() )
                {
                    long nVal = static_cast<long>(aDlg.GetNumericFld().GetValue());
                    long nVal = static_cast<long>(aDlg->GetNumericFld().GetValue());
                    if (-1 != nVal && aData.GetNumericValue() != nVal)
                    {
                        aData.SetNumericValue( (sal_uInt8)nVal ); //! sets IsModified !
diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx
index 2323fc4..b6faede 100644
--- a/cui/source/options/optopencl.cxx
+++ b/cui/source/options/optopencl.cxx
@@ -273,10 +273,10 @@ IMPL_LINK(ListEntryDialog, EditModifiedHdl, Edit*, pEdit)

void openListDialog(SvxOpenCLTabPage* pTabPage, OpenCLConfig::ImplMatcher& rEntry, const OString& rTag)
{
    ListEntryDialog aDlg(pTabPage, rEntry, rTag);
    VclPtr<ListEntryDialog> aDlg(new ListEntryDialog(pTabPage, rEntry, rTag));

    if (aDlg.Execute() == RET_OK)
        rEntry = aDlg.maEntry;
    if (aDlg->Execute() == RET_OK)
        rEntry = aDlg->maEntry;
}

const OpenCLConfig::ImplMatcher& findCurrentEntry(OpenCLConfig::ImplMatcherSet& rSet, SvSimpleTable* pListBox)
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index d4591fe..1bae7f52 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -437,11 +437,11 @@ void SvxPersonalizationTabPage::LoadExtensionThemes()

IMPL_LINK( SvxPersonalizationTabPage, SelectPersona, PushButton*, /*pButton*/ )
{
    SelectPersonaDialog aDialog( NULL );
    VclPtr<SelectPersonaDialog> aDialog( new SelectPersonaDialog(NULL) );

    if ( aDialog.Execute() == RET_OK )
    if ( aDialog->Execute() == RET_OK )
    {
        OUString aPersonaSetting( aDialog.GetAppliedPersonaSetting() );
        OUString aPersonaSetting( aDialog->GetAppliedPersonaSetting() );
        if ( !aPersonaSetting.isEmpty() )
        {
            SetPersonaSettings( aPersonaSetting );
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index f808ef4..a35fa19 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -717,11 +717,11 @@ IMPL_LINK_NOARG(OfaSwAutoFmtOptionsPage, EditHdl)
    else if( MERGE_SINGLE_LINE_PARA == nSelEntryPos )
    {
        // dialog for per cent settings
        OfaAutoFmtPrcntSet aDlg(this);
        aDlg.GetPrcntFld().SetValue(nPercent);
        if(RET_OK == aDlg.Execute())
        VclPtr<OfaAutoFmtPrcntSet> aDlg(new OfaAutoFmtPrcntSet(this));
        aDlg->GetPrcntFld().SetValue(nPercent);
        if(RET_OK == aDlg->Execute())
        {
            nPercent = (sal_uInt16)aDlg.GetPrcntFld().GetValue();
            nPercent = (sal_uInt16)aDlg->GetPrcntFld().GetValue();
            sMargin = " " +
                unicode::formatPercent(nPercent, Application::GetSettings().GetUILanguageTag());
        }
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index fe48e241..70c126d 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -681,17 +681,17 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound )
        // display original size
        const FieldUnit eMetric = GetModuleFieldUnit( GetItemSet() );

        MetricField aFld(this, WB_HIDE);
        SetFieldUnit( aFld, eMetric );
        aFld.SetDecimalDigits( m_pWidthMF->GetDecimalDigits() );
        aFld.SetMax( LONG_MAX - 1 );
        VclPtr<MetricField> aFld(new MetricField(this, WB_HIDE));
        SetFieldUnit( *aFld.get(), eMetric );
        aFld->SetDecimalDigits( m_pWidthMF->GetDecimalDigits() );
        aFld->SetMax( LONG_MAX - 1 );

        aFld.SetValue( aFld.Normalize( aOrigSize.Width() ), eUnit );
        OUString sTemp = aFld.GetText();
        aFld.SetValue( aFld.Normalize( aOrigSize.Height() ), eUnit );
        aFld->SetValue( aFld->Normalize( aOrigSize.Width() ), eUnit );
        OUString sTemp = aFld->GetText();
        aFld->SetValue( aFld->Normalize( aOrigSize.Height() ), eUnit );
        // multiplication sign (U+00D7)
        sTemp += OUString( sal_Unicode (0x00D7) );
        sTemp += aFld.GetText();
        sTemp += aFld->GetText();

        if ( aOrigPixelSize.Width() && aOrigPixelSize.Height() ) {
             sal_Int32 ax = sal_Int32(floor((float)aOrigPixelSize.Width() /
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index cdde799..3a81c3d 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -716,10 +716,10 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickModifyHdl_Impl)
            }
            else
            {
                MessageDialog aBox( GetParentDialog()
                VclPtr<MessageDialog> aBox( new MessageDialog(GetParentDialog()
                                   ,"DuplicateNameDialog"
                                   ,"cui/ui/queryduplicatedialog.ui");
                aBox.Execute();
                                   ,"cui/ui/queryduplicatedialog.ui"));
                aBox->Execute();
            }
        }
    }
@@ -734,9 +734,9 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickDeleteHdl_Impl)

    if( nPos != LISTBOX_ENTRY_NOTFOUND )
    {
        MessageDialog aQueryBox( GetParentDialog(),"AskDelBitmapDialog","cui/ui/querydeletebitmapdialog.ui");
        VclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog(),"AskDelBitmapDialog","cui/ui/querydeletebitmapdialog.ui" ));

        if( aQueryBox.Execute() == RET_YES )
        if( aQueryBox->Execute() == RET_YES )
        {
            delete pBitmapList->Remove( nPos );
            m_pLbBitmaps->RemoveEntry( nPos );
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 336a242..a9dd014 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -682,10 +682,10 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl)
    // if yes, it is repeated and a new name is demanded
    if ( !bDifferent )
    {
        MessageDialog aWarningBox( GetParentDialog()
        VclPtr<MessageDialog> aWarningBox(new MessageDialog( GetParentDialog()
                                   ,"DuplicateNameDialog"
                                   ,"cui/ui/queryduplicatedialog.ui");
        aWarningBox.Execute();
                                   ,"cui/ui/queryduplicatedialog.ui"));
        aWarningBox->Execute();

        SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
        boost::scoped_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
@@ -705,7 +705,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl)
            if( bDifferent )
                bLoop = false;
            else
                aWarningBox.Execute();
                aWarningBox->Execute();
        }
    }

@@ -753,10 +753,10 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickModifyHdl_Impl)
        // if yes, it is repeated and a new name is demanded
        if ( !bDifferent )
        {
            MessageDialog aWarningBox( GetParentDialog()
            VclPtr<MessageDialog> aWarningBox(new MessageDialog( GetParentDialog()
                                      ,"DuplicateNameDialog"
                                      ,"cui/ui/queryduplicatedialog.ui");
            aWarningBox.Execute();
                                      ,"cui/ui/queryduplicatedialog.ui"));
            aWarningBox->Execute();

            SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
            boost::scoped_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
@@ -774,7 +774,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickModifyHdl_Impl)
                if( bDifferent )
                    bLoop = false;
                else
                    aWarningBox.Execute();
                    aWarningBox->Execute();
            }
        }

@@ -849,9 +849,9 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickDeleteHdl_Impl)

    if( nPos != LISTBOX_ENTRY_NOTFOUND )
    {
        MessageDialog aQueryBox( GetParentDialog(),"AskDelColorDialog","cui/ui/querydeletecolordialog.ui");
        VclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog(),"AskDelColorDialog","cui/ui/querydeletecolordialog.ui"));

        if( aQueryBox.Execute() == RET_YES )
        if( aQueryBox->Execute() == RET_YES )
        {
            XColorEntry* pEntry = pColorList->Remove( nPos );
            DBG_ASSERT( pEntry, "ColorEntry not found !" );
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index 9c554b7..98caa11 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -561,10 +561,10 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl)
            }
            else
            {
                MessageDialog aBox( GetParentDialog()
                VclPtr<MessageDialog> aBox( new MessageDialog( GetParentDialog()
                                    ,"DuplicateNameDialog"
                                    ,"cui/ui/queryduplicatedialog.ui");
                aBox.Execute();
                                    ,"cui/ui/queryduplicatedialog.ui") );
                aBox->Execute();
            }

        }
@@ -580,9 +580,9 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl)

    if( nPos != LISTBOX_ENTRY_NOTFOUND )
    {
        MessageDialog aQueryBox( GetParentDialog(),"AskDelGradientDialog","cui/ui/querydeletegradientdialog.ui");
        VclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog(),"AskDelGradientDialog","cui/ui/querydeletegradientdialog.ui"));

        if ( aQueryBox.Execute() == RET_YES )
        if ( aQueryBox->Execute() == RET_YES )
        {
            delete pGradientList->Remove( nPos );
            m_pLbGradients->RemoveEntry( nPos );
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index c3afeaf..782b98b 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -606,10 +606,10 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickModifyHdl_Impl)
            }
            else
            {
                MessageDialog aBox( GetParentDialog()
                VclPtr<MessageDialog> aBox(new MessageDialog( GetParentDialog()
                                    ,"DuplicateNameDialog"
                                    ,"cui/ui/queryduplicatedialog.ui");
                aBox.Execute();
                                    ,"cui/ui/queryduplicatedialog.ui"));
                aBox->Execute();
            }
        }
    }
@@ -624,9 +624,9 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickDeleteHdl_Impl)

    if( nPos != LISTBOX_ENTRY_NOTFOUND )
    {
        MessageDialog aQueryBox( GetParentDialog(),"AskDelHatchDialog","cui/ui/querydeletehatchdialog.ui");
        VclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog(),"AskDelHatchDialog","cui/ui/querydeletehatchdialog.ui"));

        if( aQueryBox.Execute() == RET_YES )
        if( aQueryBox->Execute() == RET_YES )
        {
            delete pHatchingList->Remove( nPos );
            m_pLbHatchings->RemoveEntry( nPos );
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 66de7c9..04b7ff0 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -594,10 +594,10 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickAddHdl_Impl)
        else
        {

            MessageDialog aBox( GetParentDialog()
            VclPtr<MessageDialog> aBox(new MessageDialog( GetParentDialog()
                                ,"DuplicateNameDialog"
                                ,"cui/ui/queryduplicatedialog.ui");
            aBox.Execute();
                                ,"cui/ui/queryduplicatedialog.ui"));
            aBox->Execute();
        }
    }
    pDlg.reset();
@@ -672,10 +672,10 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickModifyHdl_Impl)
            }
            else
            {
                MessageDialog aBox( GetParentDialog()
                VclPtr<MessageDialog> aBox(new MessageDialog( GetParentDialog()
                                   ,"DuplicateNameDialog"
                                   ,"cui/ui/queryduplicatedialog.ui");
                aBox.Execute();
                                   ,"cui/ui/queryduplicatedialog.ui") );
                aBox->Execute();
            }
        }
    }
@@ -690,11 +690,11 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickDeleteHdl_Impl)

    if ( nPos != LISTBOX_ENTRY_NOTFOUND )
    {
        MessageDialog aQueryBox( GetParentDialog()
        VclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog()
                                ,"AskDelLineStyleDialog"
                                ,"cui/ui/querydeletelinestyledialog.ui");
                                ,"cui/ui/querydeletelinestyledialog.ui"));

        if ( aQueryBox.Execute() == RET_YES )
        if ( aQueryBox->Execute() == RET_YES )
        {
            delete pDashList->Remove( nPos );
            m_pLbLineStyles->RemoveEntry( nPos );
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index 3bbe568..5235d1d 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -188,11 +188,11 @@ void SvxLineEndDefTabPage::CheckChanges_Impl()

        if( aString != m_pLbLineEnds->GetSelectEntry() )
        {
            MessageDialog aQueryBox( GetParentDialog()
            VclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog()
                                    ,"AskChangeLineEndDialog"
                                    ,"cui/ui/querychangelineenddialog.ui");
                                    ,"cui/ui/querychangelineenddialog.ui"));

            if ( aQueryBox.Execute() == RET_YES )
            if ( aQueryBox->Execute() == RET_YES )
                ClickModifyHdl_Impl( this );
        }
    }
@@ -325,10 +325,10 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl)
        // if yes, repeat and demand a new name
        if ( !bDifferent )
        {
            MessageDialog aWarningBox( GetParentDialog()
            VclPtr<MessageDialog> aWarningBox(new MessageDialog( GetParentDialog()
                                      ,"DuplicateNameDialog"
                                      ,"cui/ui/queryduplicatedialog.ui");
            aWarningBox.Execute();
                                      ,"cui/ui/queryduplicatedialog.ui"));
            aWarningBox->Execute();

            SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
            DBG_ASSERT(pFact, "Dialog creation failed!");
@@ -350,7 +350,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl)
                if( bDifferent )
                    bLoop = false;
                else
                    aWarningBox.Execute();
                    aWarningBox->Execute();
            }
        }

@@ -479,10 +479,10 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl)
            }
            else
            {
                MessageDialog aBox( GetParentDialog()
                VclPtr<MessageDialog> aBox(new MessageDialog( GetParentDialog()
                                   ,"DuplicateNameDialog"
                                   ,"cui/ui/queryduplicatedialog.ui");
                aBox.Execute();
                                   ,"cui/ui/queryduplicatedialog.ui"));
                aBox->Execute();
            }
        }
    }
@@ -507,11 +507,11 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickDeleteHdl_Impl)

    if( nPos != LISTBOX_ENTRY_NOTFOUND )
    {
        MessageDialog aQueryBox( GetParentDialog()
        VclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog()
                                ,"AskDelLineEndDialog"
                                ,"cui/ui/querydeletelineenddialog.ui");
                                ,"cui/ui/querydeletelineenddialog.ui"));

        if ( aQueryBox.Execute() == RET_YES )
        if ( aQueryBox->Execute() == RET_YES )
        {
            delete pLineEndList->Remove( nPos );
            m_pLbLineEnds->RemoveEntry( nPos );
diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx
index c643e80..dd1aa10 100644
--- a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx
+++ b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx
@@ -406,8 +406,8 @@ namespace dbmm
            // check that the backup location isn't the same as the document itself
            if ( lcl_equalURLs_nothrow( m_pData->aContext, sBackupLocation, m_pData->xDocumentModel->getURL() ) )
            {
                MessageDialog aErrorBox( const_cast< MacroMigrationDialog* >( this ), MacroMigrationResId( STR_INVALID_BACKUP_LOCATION ) );
                aErrorBox.Execute();
                VclPtr<MessageDialog> aErrorBox(new MessageDialog( const_cast< MacroMigrationDialog* >( this ), MacroMigrationResId( STR_INVALID_BACKUP_LOCATION ) ));
                aErrorBox->Execute();
                rBackupPage.grabLocationFocus();
                return false;
            }
diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx
index 39e4ecf..ec583e1 100644
--- a/dbaccess/source/ui/app/AppControllerDnD.cxx
+++ b/dbaccess/source/ui/app/AppControllerDnD.cxx
@@ -175,8 +175,8 @@ void OApplicationController::deleteTables(const ::std::vector< OUString>& _rList
        else
        {
            OUString sMessage(ModuleRes(STR_MISSING_TABLES_XDROP));
            MessageDialog aError(getView(), sMessage);
            aError.Execute();
            VclPtr<MessageDialog> aError(new MessageDialog(getView(), sMessage));
            aError->Execute();
        }
    }
}
@@ -210,19 +210,19 @@ void OApplicationController::deleteObjects( ElementType _eType, const ::std::vec

            if ( eResult != svtools::QUERYDELETE_ALL )
            {
                svtools::QueryDeleteDlg_Impl aDlg( getView(), *aThisRound );
                VclPtr<svtools::QueryDeleteDlg_Impl> aDlg( new svtools::QueryDeleteDlg_Impl(getView(), *aThisRound) );

                if ( !sDialogPosition.isEmpty() )
                    aDlg.SetWindowState( sDialogPosition );
                    aDlg->SetWindowState( sDialogPosition );

                if ( nObjectsLeft > 1 )
                    aDlg.EnableAllButton();
                    aDlg->EnableAllButton();

                eResult = aDlg.Execute();
                eResult = aDlg->Execute();
                if (eResult == svtools::QUERYDELETE_CANCEL)
                    return;

                sDialogPosition = aDlg.GetWindowState( );
                sDialogPosition = aDlg->GetWindowState( );
            }

            bool bSuccess = false;
@@ -686,17 +686,17 @@ bool OApplicationController::paste( ElementType _eType, const ::svx::ODataAccess
                                                has a /table/ with that name) */
                if ( bNeedAskForName )
                {
                    OSaveAsDlg aAskForName( getView(),
                    VclPtr<OSaveAsDlg> aAskForName(new OSaveAsDlg( getView(),
                                            CommandType::QUERY,
                                            getORB(),
                                            getConnection(),
                                            sTargetName,
                                            aNameChecker,
                                            SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS);
                    if ( RET_OK != aAskForName.Execute() )
                                            SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS));
                    if ( RET_OK != aAskForName->Execute() )
                        // cancelled by the user
                        return false;
                    sTargetName = aAskForName.getName();
                    sTargetName = aAskForName->getName();
                }

                // create a new object
diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx
index 3eda315..df90c32 100644
--- a/dbaccess/source/ui/app/AppControllerGen.cxx
+++ b/dbaccess/source/ui/app/AppControllerGen.cxx
@@ -111,12 +111,12 @@ void OApplicationController::convertToView(const OUString& _sName)
        OUString aDefaultName = ::dbaui::createDefaultName(xMeta,xTables,aName);

        DynamicTableOrQueryNameCheck aNameChecker( xConnection, CommandType::TABLE );
        OSaveAsDlg aDlg( getView(), CommandType::TABLE, getORB(), xConnection, aDefaultName, aNameChecker );
        if ( aDlg.Execute() == RET_OK )
        VclPtr<OSaveAsDlg> aDlg(new OSaveAsDlg( getView(), CommandType::TABLE, getORB(), xConnection, aDefaultName, aNameChecker ) );
        if ( aDlg->Execute() == RET_OK )
        {
            OUString sName = aDlg.getName();
            OUString sCatalog = aDlg.getCatalog();
            OUString sSchema  = aDlg.getSchema();
            OUString sName = aDlg->getName();
            OUString sCatalog = aDlg->getCatalog();
            OUString sSchema  = aDlg->getSchema();
            OUString sNewName(
                ::dbtools::composeTableName( xMeta, sCatalog, sSchema, sName, false, ::dbtools::eInTableDefinitions ) );
            Reference<XPropertySet> xView = ::dbaui::createView(sNewName,xConnection,xSourceObject);
@@ -534,8 +534,8 @@ void OApplicationController::askToReconnect()
        bool bClear = true;
        if ( !m_pSubComponentManager->empty() )
        {
            MessageDialog aQry(getView(), ModuleRes(STR_QUERY_CLOSEDOCUMENTS), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
            switch (aQry.Execute())
            VclPtr<MessageDialog> aQry(new MessageDialog(getView(), ModuleRes(STR_QUERY_CLOSEDOCUMENTS), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
            switch (aQry->Execute())
            {
                case RET_YES:
                    closeSubComponents();
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index e8cd789..32a261f 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -1271,8 +1271,8 @@ IMPL_LINK( SbaXDataBrowserController, OnAsyncDisplayError, void*, /* _pNotIntere
{
    if ( m_aCurrentError.isValid() )
    {
        OSQLMessageBox aDlg( getBrowserView(), m_aCurrentError );
        aDlg.Execute();
        VclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox( getBrowserView(), m_aCurrentError ));
        aDlg->Execute();
    }
    return 0L;
}
@@ -1764,19 +1764,19 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(bool bFilter)
        Reference< XConnection> xCon(xFormSet->getPropertyValue(PROPERTY_ACTIVE_CONNECTION),UNO_QUERY);
        if(bFilter)
        {
            DlgFilterCrit aDlg( getBrowserView(), getORB(), xCon, xParser, xSup->getColumns() );
            if ( !aDlg.Execute() )
            VclPtr<DlgFilterCrit> aDlg(new DlgFilterCrit( getBrowserView(), getORB(), xCon, xParser, xSup->getColumns() ) );
            if ( !aDlg->Execute() )
                return; // if so we don't need to update the grid
            aDlg.BuildWherePart();
            aDlg->BuildWherePart();
        }
        else
        {
            DlgOrderCrit aDlg( getBrowserView(),xCon,xParser,xSup->getColumns() );
            if(!aDlg.Execute())
            VclPtr<DlgOrderCrit> aDlg(new DlgOrderCrit( getBrowserView(),xCon,xParser,xSup->getColumns() ) );
            if(!aDlg->Execute())
            {
                return; // if so we don't need to actualize the grid
            }
            aDlg.BuildOrderPart();
            aDlg->BuildOrderPart();
        }
    }
    catch(const SQLException& )
@@ -2172,11 +2172,11 @@ bool SbaXDataBrowserController::SaveModified(bool bAskFor)
    {
        getBrowserView()->getVclControl()->GrabFocus();

        MessageDialog aQry(getBrowserView()->getVclControl(),
        VclPtr<MessageDialog> aQry(new MessageDialog(getBrowserView()->getVclControl(),
                           "SaveModifiedDialog",
                           "dbaccess/ui/savemodifieddialog.ui");
                           "dbaccess/ui/savemodifieddialog.ui"));

        switch (aQry.Execute())
        switch (aQry->Execute())
        {
            case RET_NO:
                Execute(ID_BROWSER_UNDORECORD,Sequence<PropertyValue>());
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index 3eb8ac6..77492e6 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -792,10 +792,10 @@ void SbaGridControl::SetColWidth(sal_uInt16 nColId)
        Any aWidth = xAffectedCol->getPropertyValue(PROPERTY_WIDTH);
        sal_Int32 nCurWidth = aWidth.hasValue() ? ::comphelper::getINT32(aWidth) : -1;

        DlgSize aDlgColWidth(this, nCurWidth, false);
        if (aDlgColWidth.Execute())
        VclPtr<DlgSize> aDlgColWidth(new DlgSize(this, nCurWidth, false));
        if (aDlgColWidth->Execute())
        {
            sal_Int32 nValue = aDlgColWidth.GetValue();
            sal_Int32 nValue = aDlgColWidth->GetValue();
            Any aNewWidth;
            if (-1 == nValue)
            {   // set to default
@@ -821,10 +821,10 @@ void SbaGridControl::SetRowHeight()
    Any aHeight = xCols->getPropertyValue(PROPERTY_ROW_HEIGHT);
    sal_Int32 nCurHeight = aHeight.hasValue() ? ::comphelper::getINT32(aHeight) : -1;

    DlgSize aDlgRowHeight(this, nCurHeight, true);
    if (aDlgRowHeight.Execute())
    VclPtr<DlgSize> aDlgRowHeight(new DlgSize(this, nCurHeight, true));
    if (aDlgRowHeight->Execute())
    {
        sal_Int32 nValue = aDlgRowHeight.GetValue();
        sal_Int32 nValue = aDlgRowHeight->GetValue();
        Any aNewHeight;
        if ((sal_Int16)-1 == nValue)
        {   // set to default
diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx
index 02410b9..c3ba08f 100644
--- a/dbaccess/source/ui/dlg/CollectionView.cxx
+++ b/dbaccess/source/ui/dlg/CollectionView.cxx
@@ -164,8 +164,8 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click)
            Reference< XContent> xContent;
            if ( xNameContainer->hasByName(sName) )
            {
                QueryBox aBox( this, WB_YES_NO, ModuleRes( STR_ALREADYEXISTOVERWRITE ) );
                if ( aBox.Execute() != RET_YES )
                VclPtr<QueryBox> aBox(new QueryBox( this, WB_YES_NO, ModuleRes( STR_ALREADYEXISTOVERWRITE ) ) );
                if ( aBox->Execute() != RET_YES )
                    return 0;
            }
            m_pName->SetText(sName);
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index 96e158f..d0d0043 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -312,16 +312,16 @@ namespace dbaui
                    aProfiles.insert(pArray[index]);

                // execute the select dialog
                ODatasourceSelectDialog aSelector(GetParent(), aProfiles);
                VclPtr<ODatasourceSelectDialog> aSelector(new ODatasourceSelectDialog(GetParent(), aProfiles));
                OUString sOldProfile=getURLNoPrefix();

                if (!sOldProfile.isEmpty())
                    aSelector.Select(sOldProfile);
                    aSelector->Select(sOldProfile);
                else
                    aSelector.Select(xMozillaBootstrap->getDefaultProfile(profileType));
                    aSelector->Select(xMozillaBootstrap->getDefaultProfile(profileType));

                if ( RET_OK == aSelector.Execute() )
                    setURLNoPrefix(aSelector.GetSelected());
                if ( RET_OK == aSelector->Execute() )
                    setURLNoPrefix(aSelector->GetSelected());
                break;
            }
            case ::dbaccess::DST_FIREBIRD:
@@ -482,8 +482,8 @@ namespace dbaui
            sQuery = sQuery.replaceFirst("$path$", aTransformer.get(OFileNotation::N_SYSTEM));

            m_bUserGrabFocus = false;
            QueryBox aQuery(GetParent(), WB_YES_NO | WB_DEF_YES, sQuery);
            sal_Int32 nQueryResult = aQuery.Execute();
            VclPtr<QueryBox> aQuery(new QueryBox(GetParent(), WB_YES_NO | WB_DEF_YES, sQuery));
            sal_Int32 nQueryResult = aQuery->Execute();
            m_bUserGrabFocus = true;

            switch (nQueryResult)
@@ -499,8 +499,8 @@ namespace dbaui
                            sQuery = sQuery.replaceFirst("$name$", aTransformer.get(OFileNotation::N_SYSTEM));

                            m_bUserGrabFocus = false;
                            QueryBox aWhatToDo(GetParent(), WB_RETRY_CANCEL | WB_DEF_RETRY, sQuery);
                            nQueryResult = aWhatToDo.Execute();
                            VclPtr<QueryBox> aWhatToDo(new QueryBox(GetParent(), WB_RETRY_CANCEL | WB_DEF_RETRY, sQuery));
                            nQueryResult = aWhatToDo->Execute();
                            m_bUserGrabFocus = true;

                            if (RET_RETRY == nQueryResult)
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx
index f33b1e4..a8884ac 100644
--- a/dbaccess/source/ui/dlg/ConnectionPage.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx
@@ -289,8 +289,8 @@ namespace dbaui

        const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
        const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error;
        OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt );
        aMsg.Execute();
        VclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ) );
        aMsg->Execute();
        return 0L;
    }
    bool OConnectionTabPage::checkTestConnection()
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index 394073e..850a91a 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -508,8 +508,8 @@ using namespace ::com::sun::star;
#endif
        const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
        const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error;
        OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt );
        aMsg.Execute();
        VclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ) );
        aMsg->Execute();
        return 0L;
    }

@@ -617,8 +617,8 @@ using namespace ::com::sun::star;
        }
#endif
        sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
        OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString() );
        aMsg.Execute();
        VclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString() ) );
        aMsg->Execute();
        return 0L;
    }

diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx
index f776e80..219440b 100644
--- a/dbaccess/source/ui/dlg/UserAdmin.cxx
+++ b/dbaccess/source/ui/dlg/UserAdmin.cxx
@@ -92,8 +92,8 @@ IMPL_LINK_NOARG(OPasswordDialog, OKHdl_Impl)
    else
    {
        OUString aErrorMsg( ModuleRes( STR_ERROR_PASSWORDS_NOT_IDENTICAL));
        MessageDialog aErrorBox(this, aErrorMsg);
        aErrorBox.Execute();
        VclPtr<MessageDialog> aErrorBox(new MessageDialog(this, aErrorMsg));
        aErrorBox->Execute();
        m_pEDPassword->SetText( OUString() );
        m_pEDPasswordRepeat->SetText( OUString() );
        m_pEDPassword->GrabFocus();
@@ -199,16 +199,16 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton )
    {
        if(pButton == m_pNEWUSER)
        {
            SfxPasswordDialog aPwdDlg(this);
            aPwdDlg.ShowExtras(SHOWEXTRAS_ALL);
            if(aPwdDlg.Execute())
            VclPtr<SfxPasswordDialog> aPwdDlg(new SfxPasswordDialog(this));
            aPwdDlg->ShowExtras(SHOWEXTRAS_ALL);
            if(aPwdDlg->Execute())
            {
                Reference<XDataDescriptorFactory> xUserFactory(m_xUsers,UNO_QUERY);
                Reference<XPropertySet> xNewUser = xUserFactory->createDataDescriptor();
                if(xNewUser.is())
                {
                    xNewUser->setPropertyValue(PROPERTY_NAME,makeAny(OUString(aPwdDlg.GetUser())));
                    xNewUser->setPropertyValue(PROPERTY_PASSWORD,makeAny(OUString(aPwdDlg.GetPassword())));
                    xNewUser->setPropertyValue(PROPERTY_NAME,makeAny(OUString(aPwdDlg->GetUser())));
                    xNewUser->setPropertyValue(PROPERTY_PASSWORD,makeAny(OUString(aPwdDlg->GetPassword())));
                    Reference<XAppend> xAppend(m_xUsers,UNO_QUERY);
                    if(xAppend.is())
                        xAppend->appendByDescriptor(xNewUser);
@@ -226,11 +226,11 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton )
                if(xUser.is())
                {
                    OUString sNewPassword,sOldPassword;
                    OPasswordDialog aDlg(this,sName);
                    if(aDlg.Execute() == RET_OK)
                    VclPtr<OPasswordDialog> aDlg(new OPasswordDialog(this,sName));
                    if(aDlg->Execute() == RET_OK)
                    {
                        sNewPassword = aDlg.GetNewPassword();
                        sOldPassword = aDlg.GetOldPassword();
                        sNewPassword = aDlg->GetNewPassword();
                        sOldPassword = aDlg->GetOldPassword();

                        if(!sNewPassword.isEmpty())
                            xUser->changePassword(sOldPassword,sNewPassword);
@@ -245,8 +245,8 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton )
                Reference<XDrop> xDrop(m_xUsers,UNO_QUERY);
                if(xDrop.is())
                {
                    MessageDialog aQry(this, ModuleRes(STR_QUERY_USERADMIN_DELETE_USER), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
                    if(aQry.Execute() == RET_YES)
                    VclPtr<MessageDialog> aQry(new MessageDialog(this, ModuleRes(STR_QUERY_USERADMIN_DELETE_USER), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
                    if(aQry->Execute() == RET_YES)
                        xDrop->dropByName(GetUser());
                }
            }
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx
index 0d15109..61744a5 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -117,19 +117,19 @@ namespace dbaui
            // show an error message
            OUString sError( ModuleRes( STR_COULD_NOT_LOAD_ODBC_LIB ) );
            sError = sError.replaceFirst("#lib#", aEnumeration.getLibraryName());
            MessageDialog aDialog(this, sError);
            aDialog.Execute();
            VclPtr<MessageDialog> aDialog(new MessageDialog(this, sError));
            aDialog->Execute();
            return false;
        }
        else
        {
            aEnumeration.getDatasourceNames(aOdbcDatasources);
            // execute the select dialog
            ODatasourceSelectDialog aSelector(GetParent(), aOdbcDatasources);
            VclPtr<ODatasourceSelectDialog> aSelector(new ODatasourceSelectDialog(GetParent(), aOdbcDatasources));
            if (!_sCurr.isEmpty())
                aSelector.Select(_sCurr);
            if ( RET_OK == aSelector.Execute() )
                _sReturn = aSelector.GetSelected();
                aSelector->Select(_sCurr);
            if ( RET_OK == aSelector->Execute() )
                _sReturn = aSelector->GetSelected();
        }
        return true;
    }
@@ -242,8 +242,8 @@ namespace dbaui
                    eImage = OSQLMessageBox::Error;
                    aMessage = ModuleRes(STR_CONNECTION_NO_SUCCESS);
                }
                OSQLMessageBox aMsg( this, sTitle, aMessage, WB_OK, eImage );
                aMsg.Execute();
                VclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, sTitle, aMessage, WB_OK, eImage ) );
                aMsg->Execute();
            }
            if ( !bSuccess )
                m_pAdminDialog->clearPassword();
diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx
index 21ecc09..a4e5d5c 100644
--- a/dbaccess/source/ui/dlg/detailpages.cxx
+++ b/dbaccess/source/ui/dlg/detailpages.cxx
@@ -241,8 +241,8 @@ namespace dbaui
    {
        if (m_pIndexes == pButton)
        {
            ODbaseIndexDialog aIndexDialog(this, m_sDsn);
            aIndexDialog.Execute();
            VclPtr<ODbaseIndexDialog> aIndexDialog(new ODbaseIndexDialog(this, m_sDsn));
            aIndexDialog->Execute();
        }
        else
        {
@@ -490,8 +490,8 @@ namespace dbaui
#endif
        const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
        const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error;
        OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt );
        aMsg.Execute();
        VclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ) );
        aMsg->Execute();
        return 0L;
    }
    IMPL_LINK(OGeneralSpecialJDBCDetailsPage, OnEditModified, Edit*, _pEdit)
diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx
index 139cd24..a4995a2 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -99,8 +99,8 @@ namespace dbaui

        {
            OUString sMessage(ModuleRes(STR_DIRECTSQL_CONNECTIONLOST));
            MessageDialog aError(this, sMessage);
            aError.Execute();
            VclPtr<MessageDialog> aError(new MessageDialog(this, sMessage));
            aError->Execute();
        }

        PostUserEvent(LINK(this, DirectSQLDialog, OnClose));
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index 1e8bd03..a11b42f 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -708,8 +708,8 @@ namespace dbaui
            if ( aFileDlg.GetCurrentFilter() != pFilter->GetUIName() || !pFilter->GetWildcard().Matches(sPath) )
            {
                OUString sMessage(ModuleRes(STR_ERR_USE_CONNECT_TO));
                InfoBox aError(this, sMessage);
                aError.Execute();
                VclPtr<InfoBox> aError(new InfoBox(this, sMessage));
                aError->Execute();
                m_pRB_ConnectDatabase->Check();
                OnSetupModeSelected( m_pRB_ConnectDatabase );
                return 0L;
diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx
index bdf9519..7377ac6 100644
--- a/dbaccess/source/ui/dlg/indexdialog.cxx
+++ b/dbaccess/source/ui/dlg/indexdialog.cxx
@@ -413,8 +413,8 @@ namespace dbaui
            {
                OUString sConfirm(ModuleRes(STR_CONFIRM_DROP_INDEX));
                sConfirm = sConfirm.replaceFirst("$name$", m_pIndexList->GetEntryText(pSelected));
                MessageDialog aConfirm(this, sConfirm, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
                if (RET_YES != aConfirm.Execute())
                VclPtr<MessageDialog> aConfirm(new MessageDialog(this, sConfirm, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
                if (RET_YES != aConfirm->Execute())
                    return;
            }

@@ -577,9 +577,9 @@ namespace dbaui

            if (aSelected->isModified() || aSelected->isNew())
            {
                MessageDialog aQuestion(this, "SaveIndexDialog",
                                        "dbaccess/ui/saveindexdialog.ui");
                nResponse = aQuestion.Execute();
                VclPtr<MessageDialog> aQuestion(new MessageDialog(this, "SaveIndexDialog",
                                        "dbaccess/ui/saveindexdialog.ui"));
                nResponse = aQuestion->Execute();
            }
        }

@@ -621,8 +621,8 @@ namespace dbaui
        {
            OUString sError(ModuleRes(STR_INDEX_NAME_ALREADY_USED));
            sError = sError.replaceFirst("$name$", sNewName);
            MessageDialog aError(this, sError);
            aError.Execute();
            VclPtr<MessageDialog> aError(new MessageDialog(this, sError));
            aError->Execute();

            updateToolbox();
            m_bEditAgain = true;
@@ -682,8 +682,8 @@ namespace dbaui
        // need at least one field
        if (0 == _rPos->aFields.size())
        {
            MessageDialog aError(this, ModuleRes(STR_NEED_INDEX_FIELDS));
            aError.Execute();
            VclPtr<MessageDialog> aError(new MessageDialog(this, ModuleRes(STR_NEED_INDEX_FIELDS)));
            aError->Execute();
            m_pFields->GrabFocus();
            return false;
        }
@@ -700,8 +700,8 @@ namespace dbaui
                // a column is specified twice ... won't work anyway, so prevent this here and now
                OUString sMessage(ModuleRes(STR_INDEXDESIGN_DOUBLE_COLUMN_NAME));
                sMessage = sMessage.replaceFirst("$name$", aFieldCheck->sFieldName);
                MessageDialog aError(this, sMessage);
                aError.Execute();
                VclPtr<MessageDialog> aError(new MessageDialog(this, sMessage));
                aError->Execute();
                m_pFields->GrabFocus();
                return false;
            }
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx
index 771c204..5bbd80b 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.cxx
+++ b/dbaccess/source/ui/dlg/sqlmessage.cxx
@@ -705,8 +705,8 @@ void OSQLMessageBox::dispose()

IMPL_LINK( OSQLMessageBox, ButtonClickHdl, Button *, /*pButton*/ )
{
    OExceptionChainDialog aDlg( this, m_pImpl->aDisplayInfo );
    aDlg.Execute();
    VclPtr<OExceptionChainDialog> aDlg(new OExceptionChainDialog( this, m_pImpl->aDisplayInfo ) );
    aDlg->Execute();
    return 0;
}

diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index e6284d2..9b27593 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -324,8 +324,8 @@ namespace dbaui
            if (aErrorInfo.isValid())
            {
                // establishing the connection failed. Show an error window and exit.
                OSQLMessageBox aMessageBox( GetParentDialog(), aErrorInfo );
                aMessageBox.Execute();
                VclPtr<OSQLMessageBox> aMessageBox(new OSQLMessageBox( GetParentDialog(), aErrorInfo ));
                aMessageBox->Execute();
                m_pTables->Enable(false);
                m_pTablesList->Clear();

diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index 0f16a40..088beb6 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -687,7 +687,7 @@ bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTe
{
    bool bHaveDefaultTable =  !m_sDefaultTableName.isEmpty();
    OUString sTableName( bHaveDefaultTable ? m_sDefaultTableName : _rTableName );
    OCopyTableWizard aWizard(
    VclPtr<OCopyTableWizard> aWizard(new OCopyTableWizard(
        NULL,
        sTableName,
        bHaveDefaultTable ? CopyTableOperation::AppendData : CopyTableOperation::CopyDefinitionAndData,
@@ -698,19 +698,19 @@ bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTe
        getTypeSelectionPageFactory(),
        m_rInputStream,
        m_xContext
    );
    ));

    bool bError = false;
    try
    {
        if (aWizard.Execute())
        if (aWizard->Execute())
        {
            switch(aWizard.getOperation())
            switch(aWizard->getOperation())
            {
                case CopyTableOperation::CopyDefinitionAndData:
                case CopyTableOperation::AppendData:
                    {
                        m_xTable = aWizard.createTable();
                        m_xTable = aWizard->createTable();
                        bError = !m_xTable.is();
                        if(m_xTable.is())
                        {
@@ -718,10 +718,10 @@ bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTe
                            if(_aTextColor.hasValue())
                                m_xTable->setPropertyValue(PROPERTY_TEXTCOLOR,_aTextColor);
                        }
                        m_bIsAutoIncrement  = aWizard.shouldCreatePrimaryKey();
                        m_vColumns          = aWizard.GetColumnPositions();
                        m_vColumnTypes      = aWizard.GetColumnTypes();
                        m_bAppendFirstLine  = !aWizard.UseHeaderLine();
                        m_bIsAutoIncrement  = aWizard->shouldCreatePrimaryKey();
                        m_vColumns          = aWizard->GetColumnPositions();
                        m_vColumnTypes      = aWizard->GetColumnTypes();
                        m_bAppendFirstLine  = !aWizard->UseHeaderLine();
                    }
                    break;
                default:
@@ -736,7 +736,7 @@ bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTe
    }
    catch( const SQLException&)
    {
        ::dbaui::showError( ::dbtools::SQLExceptionInfo( ::cppu::getCaughtException() ), &aWizard, m_xContext );
        ::dbaui::showError( ::dbtools::SQLExceptionInfo( ::cppu::getCaughtException() ), aWizard.get(), m_xContext );
        bError = true;
    }
    catch( const Exception& )
@@ -754,9 +754,9 @@ void ODatabaseExport::showErrorDialog(const ::com::sun::star::sdbc::SQLException
        OUString aMsg(e.Message);
        aMsg += "\n";
        aMsg += ModuleRes( STR_QRY_CONTINUE );
        OSQLWarningBox aBox( NULL, aMsg, WB_YES_NO | WB_DEF_NO );
        VclPtr<OSQLWarningBox> aBox(new OSQLWarningBox( NULL, aMsg, WB_YES_NO | WB_DEF_NO ) );

        if (aBox.Execute() == RET_YES)
        if (aBox->Execute() == RET_YES)
            m_bDontAskAgain = true;
        else
            m_bError = true;
diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx
index 5a061ea..8a74d80 100644
--- a/dbaccess/source/ui/misc/RowSetDrop.cxx
+++ b/dbaccess/source/ui/misc/RowSetDrop.cxx
@@ -241,8 +241,8 @@ bool ORowSetImportExport::insertNewRow()
        if(!m_bAlreadyAsked)
        {
            OUString sAskIfContinue = ModuleRes(STR_ERROR_OCCURRED_WHILE_COPYING);
            OSQLWarningBox aDlg( m_pParent, sAskIfContinue, WB_YES_NO | WB_DEF_YES );
            if(aDlg.Execute() == RET_YES)
            VclPtr<OSQLWarningBox> aDlg(new OSQLWarningBox( m_pParent, sAskIfContinue, WB_YES_NO | WB_DEF_YES ) );
            if(aDlg->Execute() == RET_YES)
                m_bAlreadyAsked = true;
            else
                return false;
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index 5c661d5..ef31134 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -852,12 +852,12 @@ bool callColumnFormatDialog(vcl::Window* _pParent,
    }

    {   // want the dialog to be destroyed before our set
        SbaSbAttrDlg aDlg(_pParent, pFormatDescriptor, _pFormatter, _bHasFormat);
        if (RET_OK == aDlg.Execute())
        VclPtr<SbaSbAttrDlg> aDlg(new SbaSbAttrDlg(_pParent, pFormatDescriptor, _pFormatter, _bHasFormat));
        if (RET_OK == aDlg->Execute())
        {
            // ItemSet->UNO
            // UNO-properties
            const SfxItemSet* pSet = aDlg.GetExampleSet();
            const SfxItemSet* pSet = aDlg->GetExampleSet();
            // (of course we could put the modified items directly into the column, but then the UNO-model
            // won't reflect these changes, and why do we have a model, then ?)

@@ -875,7 +875,7 @@ bool callColumnFormatDialog(vcl::Window* _pParent,
            bRet = true;
        }
            // deleted formats
        const SfxItemSet* pResult = aDlg.GetOutputItemSet();
        const SfxItemSet* pResult = aDlg->GetOutputItemSet();
        if (pResult)
        {
            const SfxPoolItem* pItem = pResult->GetItem( SID_ATTR_NUMBERFORMAT_INFO );
@@ -997,10 +997,10 @@ void adjustBrowseBoxColumnWidth( ::svt::EditBrowseBox* _pBox, sal_uInt16 _nColId

    Size aDefaultMM = _pBox->PixelToLogic( Size( nDefaultWidth, 0 ), MapMode( MAP_MM ) );

    DlgSize aColumnSizeDlg( _pBox, nColSize, false, aDefaultMM.Width() * 10 );
    if ( aColumnSizeDlg.Execute() )
    VclPtr<DlgSize> aColumnSizeDlg(new DlgSize( _pBox, nColSize, false, aDefaultMM.Width() * 10 ) );
    if ( aColumnSizeDlg->Execute() )
    {
        sal_Int32 nValue = aColumnSizeDlg.GetValue();
        sal_Int32 nValue = aColumnSizeDlg->GetValue();
        if ( -1 == nValue )
        {   // default width
            nValue = _pBox->GetDefaultColumnWidth( _pBox->GetColumnTitle( _nColId ) );
@@ -1286,13 +1286,13 @@ sal_Int32 askForUserAction(vcl::Window* _pParent,sal_uInt16 _nTitle,sal_uInt16 _
    SolarMutexGuard aGuard;
    OUString aMsg = ModuleRes(_nText);
    aMsg = aMsg.replaceFirst("%1", _sName);
    OSQLMessageBox aAsk(_pParent, ModuleRes(_nTitle ), aMsg,WB_YES_NO | WB_DEF_YES,OSQLMessageBox::Query);
    VclPtr<OSQLMessageBox> aAsk(new OSQLMessageBox(_pParent, ModuleRes(_nTitle ), aMsg,WB_YES_NO | WB_DEF_YES,OSQLMessageBox::Query));
    if ( _bAll )
    {
        aAsk.AddButton(ModuleRes(STR_BUTTON_TEXT_ALL), RET_ALL, 0);
        aAsk.GetPushButton(RET_ALL)->SetHelpId(HID_CONFIRM_DROP_BUTTON_ALL);
        aAsk->AddButton(ModuleRes(STR_BUTTON_TEXT_ALL), RET_ALL, 0);
        aAsk->GetPushButton(RET_ALL)->SetHelpId(HID_CONFIRM_DROP_BUTTON_ALL);
    }
    return aAsk.Execute();
    return aAsk->Execute();
}

namespace
@@ -1431,17 +1431,17 @@ bool insertHierachyElement( vcl::Window* _pParent, const Reference< XComponentCo
            // here we have everything needed to create a new query object ...
            HierarchicalNameCheck aNameChecker( _xNames.get(), sName );
            // ... ehm, except a new name
            OSaveAsDlg aAskForName( _pParent,
            VclPtr<OSaveAsDlg> aAskForName(new OSaveAsDlg( _pParent,
                                    _rxContext,
                                    sTargetName,
                                    sLabel,
                                    aNameChecker,
                                    SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS);
            if ( RET_OK != aAskForName.Execute() )
                                    SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS));
            if ( RET_OK != aAskForName->Execute() )
                // cancelled by the user
                return false;

            sNewName = aAskForName.getName();
            sNewName = aAskForName->getName();
        }
    }
    else if ( xNameAccess->hasByName(sNewName) )
diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
index d9e4416..ce98528 100644
--- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
+++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
@@ -308,8 +308,8 @@ namespace dbaui
        bool bReConnect = true;
        if ( _bUI )
        {
            MessageDialog aQuery(getView(), ModuleRes(STR_QUERY_CONNECTION_LOST), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
            bReConnect = ( RET_YES == aQuery.Execute() );
            VclPtr<MessageDialog> aQuery(new MessageDialog(getView(), ModuleRes(STR_QUERY_CONNECTION_LOST), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
            bReConnect = ( RET_YES == aQuery->Execute() );
        }

        // now really reconnect ...
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 2c6ddeb..e3c3ea2 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -158,10 +158,10 @@ namespace
                }
            }

            OQueryTableConnection aInfo(pTableView, aInfoData);
            VclPtr<OQueryTableConnection> aInfo(new OQueryTableConnection(pTableView, aInfoData));
            // Because OQueryTableConnection never takes ownership of the data passed to it, but only remembers the pointer,
            // this pointer to a local variable is not critical, as aInfoData and aInfo have the same lifetime
            pTableView->NotifyTabConnection( aInfo );
            pTableView->NotifyTabConnection( *aInfo.get() );
        }
        else
        {
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index b4b313b..573eba4 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -118,11 +118,11 @@ namespace
    {
        OQueryTableConnectionData* pData = static_cast< OQueryTableConnectionData*>(_pConnectionData.get());

        DlgQryJoin aDlg(_pView,_pConnectionData,&_pView->GetTabWinMap(),_pView->getDesignView()->getController().getConnection(),_bSelectableTables);
        bool bOk = aDlg.Execute() == RET_OK;
        VclPtr<DlgQryJoin> aDlg(new DlgQryJoin(_pView,_pConnectionData,&_pView->GetTabWinMap(),_pView->getDesignView()->getController().getConnection(),_bSelectableTables));
        bool bOk = aDlg->Execute() == RET_OK;
        if( bOk )
        {
            pData->SetJoinType(aDlg.GetJoinType());
            pData->SetJoinType(aDlg->GetJoinType());
            _pView->getDesignView()->getController().setModified(sal_True);
        }

@@ -208,10 +208,10 @@ namespace
            pNewConnData->AppendConnLine(*pIter,sRelatedColumn);

            // now add the Conn itself
            OQueryTableConnection aNewConn(_pView, aNewConnData);
            VclPtr<OQueryTableConnection> aNewConn(new OQueryTableConnection(_pView, aNewConnData));
            // referring to the local variable is not important, as NotifyQueryTabConn creates a new copy
            // to add me (if not existent)
            _pView->NotifyTabConnection(aNewConn, false);
            _pView->NotifyTabConnection(*aNewConn.get(), false);
                // don't create an Undo-Action for the new connection : the connection is
                // covered by the Undo-Action for the tabwin, as the "Undo the insert" will
                // automatically remove all connections adjacent to the win.
@@ -621,8 +621,8 @@ void OQueryTableView::AddConnection(const OJoinExchangeData& jxdSource, const OJ

        pNewConnectionData->AppendConnLine( aSourceFieldName,aDestFieldName );

        OQueryTableConnection aNewConnection(this, aNewConnectionData);
        NotifyTabConnection(aNewConnection);
        VclPtr<OQueryTableConnection> aNewConnection(new OQueryTableConnection(this, aNewConnectionData));
        NotifyTabConnection(*aNewConnection.get());
        // As usual with NotifyTabConnection, using a local variable is fine because a copy is made
    }
    else
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 74aeeda..67b4789 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -987,8 +987,8 @@ void OQueryController::impl_initialize()
                OUString aTitle( ModuleRes( STR_QUERYDESIGN_NO_VIEW_SUPPORT ) );
                OUString aMessage( ModuleRes( STR_QUERYDESIGN_NO_VIEW_ASK ) );
                ODataView* pWindow = getView();
                OSQLMessageBox aDlg( pWindow, aTitle, aMessage, WB_YES_NO | WB_DEF_YES, OSQLMessageBox::Query );
                bClose = aDlg.Execute() == RET_NO;
                VclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox( pWindow, aTitle, aMessage, WB_YES_NO | WB_DEF_YES, OSQLMessageBox::Query ));
                bClose = aDlg->Execute() == RET_NO;
            }
            if ( bClose )
                throw VetoException();
@@ -1238,13 +1238,13 @@ void OQueryController::loadViewSettings( const ::comphelper::NamedValueCollectio

void OQueryController::execute_QueryPropDlg()
{
    QueryPropertiesDialog aQueryPropDlg(
        getContainer(), m_bDistinct, m_nLimit );
    VclPtr<QueryPropertiesDialog> aQueryPropDlg(new QueryPropertiesDialog(
        getContainer(), m_bDistinct, m_nLimit ));

    if( aQueryPropDlg.Execute() == RET_OK )
    if( aQueryPropDlg->Execute() == RET_OK )
    {
        m_bDistinct = aQueryPropDlg.getDistinct();
        m_nLimit = aQueryPropDlg.getLimit();
        m_bDistinct = aQueryPropDlg->getDistinct();
        m_nLimit = aQueryPropDlg->getLimit();
        InvalidateFeature( SID_QUERY_DISTINCT_VALUES );
        InvalidateFeature( SID_QUERY_LIMIT, 0, true );
    }
@@ -1398,23 +1398,23 @@ bool OQueryController::askForNewName(const Reference<XNameAccess>& _xElements, b
        }

        DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::QUERY );
        OSaveAsDlg aDlg(
        VclPtr<OSaveAsDlg> aDlg(new OSaveAsDlg(
                getView(),
                m_nCommandType,
                getORB(),
                getConnection(),
                aDefaultName,
                aNameChecker,
                SAD_DEFAULT );
                SAD_DEFAULT ));

        bRet = ( aDlg.Execute() == RET_OK );
        bRet = ( aDlg->Execute() == RET_OK );
        if ( bRet )
        {
            m_sName = aDlg.getName();
            m_sName = aDlg->getName();
            if ( editingView() )
            {
                m_sUpdateCatalogName    = aDlg.getCatalog();
                m_sUpdateSchemaName     = aDlg.getSchema();
                m_sUpdateCatalogName    = aDlg->getCatalog();
                m_sUpdateSchemaName     = aDlg->getSchema();
            }
        }
    }
@@ -1802,9 +1802,9 @@ short OQueryController::saveModified()
        )
    {
        OUString sMessageText( lcl_getObjectResourceString( STR_QUERY_SAVEMODIFIED, m_nCommandType ) );
        QueryBox aQry( getView(), WB_YES_NO_CANCEL | WB_DEF_YES, sMessageText );
        VclPtr<QueryBox> aQry(new QueryBox( getView(), WB_YES_NO_CANCEL | WB_DEF_YES, sMessageText ) );

        nRet = aQry.Execute();
        nRet = aQry->Execute();
        if  (   ( nRet == RET_YES )
            &&  !doSaveAsDoc( false )
            )
@@ -1914,8 +1914,8 @@ void OQueryController::impl_reset( const bool i_bForceCurrentControllerSettings 
                    if ( !i_bForceCurrentControllerSettings && !editingView() )
                    {
                        OUString aTitle(ModuleRes(STR_SVT_SQL_SYNTAX_ERROR));
                        OSQLMessageBox aDlg(getView(),aTitle,aErrorMsg);
                        aDlg.Execute();
                        VclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox(getView(),aTitle,aErrorMsg));
                        aDlg->Execute();
                    }
                    bError = true;
                }
diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx
index 184a20e..6982b38 100644
--- a/dbaccess/source/ui/relationdesign/RelationController.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationController.cxx
@@ -205,8 +205,8 @@ void ORelationController::impl_initialize()
        {
            OUString sTitle(ModuleRes(STR_RELATIONDESIGN));
            sTitle = sTitle.copy(3);
            OSQLMessageBox aDlg(NULL,sTitle,ModuleRes(STR_RELATIONDESIGN_NOT_AVAILABLE));
            aDlg.Execute();
            VclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox(NULL,sTitle,ModuleRes(STR_RELATIONDESIGN_NOT_AVAILABLE)));
            aDlg->Execute();
        }
        disconnect();
        throw SQLException();
@@ -255,9 +255,9 @@ short ORelationController::saveModified()
    short nSaved = RET_YES;
    if(haveDataSource() && isModified())
    {
        MessageDialog aQry(getView(), "DesignSaveModifiedDialog",
                                      "dbaccess/ui/designsavemodifieddialog.ui");
        nSaved = aQry.Execute();
        VclPtr<MessageDialog> aQry(new MessageDialog(getView(), "DesignSaveModifiedDialog",
                                      "dbaccess/ui/designsavemodifieddialog.ui"));
        nSaved = aQry->Execute();
        if(nSaved == RET_YES)
            Execute(ID_BROWSER_SAVEDOC,Sequence<PropertyValue>());
    }
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index bf39293..8f1ed9f 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -222,8 +222,8 @@ void ORelationTableView::AddConnection(const OJoinExchangeData& jxdSource, const

void ORelationTableView::ConnDoubleClicked( OTableConnection* pConnection )
{
    ORelationDialog aRelDlg( this, pConnection->GetData() );
    switch (aRelDlg.Execute())
    VclPtr<ORelationDialog> aRelDlg(new ORelationDialog( this, pConnection->GetData() ));
    switch (aRelDlg->Execute())
    {
        case RET_OK:
            // successfully updated
@@ -250,9 +250,9 @@ void ORelationTableView::AddNewRelation()
{

    TTableConnectionData::value_type pNewConnData( new ORelationTableConnectionData() );
    ORelationDialog aRelDlg(this, pNewConnData, true);
    VclPtr<ORelationDialog> aRelDlg(new ORelationDialog(this, pNewConnData, true));

    bool bSuccess = (aRelDlg.Execute() == RET_OK);
    bool bSuccess = (aRelDlg->Execute() == RET_OK);
    if (bSuccess)
    {
        // already updated by the dialog
@@ -325,8 +325,8 @@ void ORelationTableView::AddTabWin(const OUString& _rComposedName, const OUStrin

void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin )
{
    OSQLWarningBox aDlg( this, ModuleRes( STR_QUERY_REL_DELETE_WINDOW ), WB_YES_NO | WB_DEF_YES );
    if ( m_bInRemove || aDlg.Execute() == RET_YES )
    VclPtr<OSQLWarningBox> aDlg(new OSQLWarningBox( this, ModuleRes( STR_QUERY_REL_DELETE_WINDOW ), WB_YES_NO | WB_DEF_YES ));
    if ( m_bInRemove || aDlg->Execute() == RET_YES )
    {
        m_pView->getController().ClearUndoManager();
        OJoinTableView::RemoveTabWin( pTabWin );
@@ -343,13 +343,14 @@ void ORelationTableView::lookForUiActivities()
    {
        OUString sTitle(ModuleRes(STR_RELATIONDESIGN));
        sTitle = sTitle.copy(3);
        OSQLMessageBox aDlg(this,ModuleRes(STR_QUERY_REL_EDIT_RELATION),OUString(),0);
        aDlg.SetText(sTitle);
        aDlg.RemoveButton(aDlg.GetButtonId(0));
        aDlg.AddButton( ModuleRes(STR_QUERY_REL_EDIT), RET_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON);
        aDlg.AddButton( ModuleRes(STR_QUERY_REL_CREATE), RET_YES, 0);
        aDlg.AddButton( StandardButtonType::Cancel,RET_CANCEL,0);
        sal_uInt16 nRet = aDlg.Execute();

        VclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox(this,ModuleRes(STR_QUERY_REL_EDIT_RELATION),OUString(),0));
        aDlg->SetText(sTitle);
        aDlg->RemoveButton(aDlg->GetButtonId(0));
        aDlg->AddButton( ModuleRes(STR_QUERY_REL_EDIT), RET_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON);
        aDlg->AddButton( ModuleRes(STR_QUERY_REL_CREATE), RET_YES, 0);
        aDlg->AddButton( StandardButtonType::Cancel,RET_CANCEL,0);
        sal_uInt16 nRet = aDlg->Execute();
        if( nRet == RET_CANCEL)
        {
            m_pCurrentlyTabConnData.reset();
@@ -363,8 +364,8 @@ void ORelationTableView::lookForUiActivities()
    }
    if(m_pCurrentlyTabConnData)
    {
        ORelationDialog aRelDlg( this, m_pCurrentlyTabConnData );
        if (aRelDlg.Execute() == RET_OK)
        VclPtr<ORelationDialog> aRelDlg(new ORelationDialog( this, m_pCurrentlyTabConnData ) );
        if (aRelDlg->Execute() == RET_OK)
        {
            // already updated by the dialog
            addConnection( new ORelationTableConnection( this, m_pCurrentlyTabConnData ) );
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index b21d9c8..b9d21bf 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -285,7 +285,7 @@ bool OTableController::doSaveDoc(bool _bSaveAs)
    if (!xTablesSup.is())
    {
        OUString aMessage(ModuleRes(STR_TABLEDESIGN_CONNECTION_MISSING));
        OSQLWarningBox( getView(), aMessage ).Execute();
        VclPtr<OSQLWarningBox>(new OSQLWarningBox( getView(), aMessage ) )->Execute();
        return false;
    }

@@ -318,13 +318,13 @@ bool OTableController::doSaveDoc(bool _bSaveAs)
            }

            DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::TABLE );
            OSaveAsDlg aDlg( getView(), CommandType::TABLE, getORB(), getConnection(), aDefaultName, aNameChecker );
            if ( aDlg.Execute() != RET_OK )
            VclPtr<OSaveAsDlg> aDlg(new OSaveAsDlg( getView(), CommandType::TABLE, getORB(), getConnection(), aDefaultName, aNameChecker ) );
            if ( aDlg->Execute() != RET_OK )
                return false;

            m_sName = aDlg.getName();
            sCatalog = aDlg.getCatalog();
            sSchema  = aDlg.getSchema();
            m_sName = aDlg->getName();
            sCatalog = aDlg->getCatalog();
            sSchema  = aDlg->getSchema();
        }

        // did we get a name
@@ -415,9 +415,9 @@ bool OTableController::doSaveDoc(bool _bSaveAs)
    {
        OUString sText( ModuleRes( STR_NAME_ALREADY_EXISTS ) );
        sText = sText.replaceFirst( "#" , m_sName);
        OSQLMessageBox aDlg( getView(), OUString( ModuleRes( STR_ERROR_DURING_CREATION ) ), sText, WB_OK, OSQLMessageBox::Error );
        VclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox( getView(), OUString( ModuleRes( STR_ERROR_DURING_CREATION ) ), sText, WB_OK, OSQLMessageBox::Error ) );

        aDlg.Execute();
        aDlg->Execute();
        bError = true;
    }
    catch( const Exception& )
@@ -447,8 +447,8 @@ void OTableController::doEditIndexes()
    // table needs to be saved before editing indexes
    if (m_bNew || isModified())
    {
        MessageDialog aAsk(getView(), ModuleRes(STR_QUERY_SAVE_TABLE_EDIT_INDEXES), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
        if (RET_YES != aAsk.Execute())
        VclPtr<MessageDialog> aAsk(new MessageDialog(getView(), ModuleRes(STR_QUERY_SAVE_TABLE_EDIT_INDEXES), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
        if (RET_YES != aAsk->Execute())
            return;

        if (!doSaveDoc(false))
@@ -490,8 +490,8 @@ void OTableController::doEditIndexes()
    if (!xIndexes.is())
        return;

    DbaIndexDialog aDialog(getView(), aFieldNames, xIndexes, getConnection(), getORB(), isConnected() && getConnection()->getMetaData().is() ? getConnection()->getMetaData()->getMaxColumnsInIndex() : 0);
    if (RET_OK != aDialog.Execute())
    VclPtr<DbaIndexDialog> aDialog(new DbaIndexDialog(getView(), aFieldNames, xIndexes, getConnection(), getORB(), isConnected() && getConnection()->getMetaData().is() ? getConnection()->getMetaData()->getMaxColumnsInIndex() : 0));
    if (RET_OK != aDialog->Execute())
        return;

}
@@ -522,7 +522,7 @@ void OTableController::impl_initialize()
    }
    catch(const SQLException&)
    {
        OSQLWarningBox( getView(), ModuleRes( STR_NO_TYPE_INFO_AVAILABLE ) ).Execute();
        VclPtr<OSQLWarningBox>(new OSQLWarningBox( getView(), ModuleRes( STR_NO_TYPE_INFO_AVAILABLE ) ) )->Execute();
        throw;
    }
    try
@@ -563,9 +563,9 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool /*_bSuspend*/) throw( Runti
            ::boost::mem_fn(&OTableRow::isValid));
        if ( aIter != m_vRowList.end() )
        {
            MessageDialog aQry(getView(), "TableDesignSaveModifiedDialog",
                               "dbaccess/ui/tabledesignsavemodifieddialog.ui");
            switch (aQry.Execute())
            VclPtr<MessageDialog> aQry(new MessageDialog(getView(), "TableDesignSaveModifiedDialog",
                               "dbaccess/ui/tabledesignsavemodifieddialog.ui"));
            switch (aQry->Execute())
            {
                case RET_YES:
                    Execute(ID_BROWSER_SAVEDOC,Sequence<PropertyValue>());
@@ -580,9 +580,9 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool /*_bSuspend*/) throw( Runti
        }
        else if ( !m_bNew )
        {
            MessageDialog aQry(getView(), "DeleteAllRowsDialog",
                               "dbaccess/ui/deleteallrowsdialog.ui");
            switch (aQry.Execute())
            VclPtr<MessageDialog> aQry(new MessageDialog(getView(), "DeleteAllRowsDialog",
                               "dbaccess/ui/deleteallrowsdialog.ui"));
            switch (aQry->Execute())
            {
                case RET_YES:
                    {
@@ -936,7 +936,7 @@ bool OTableController::checkColumns(bool _bNew)
                {
                    OUString strMessage = ModuleRes(STR_TABLEDESIGN_DUPLICATE_NAME);
                    strMessage = strMessage.replaceFirst("$column$", pFieldDesc->GetName());
                    OSQLWarningBox( getView(), strMessage ).Execute();
                    VclPtr<OSQLWarningBox>(new OSQLWarningBox( getView(), strMessage ) )->Execute();
                    return false;
                }
            }
@@ -946,9 +946,9 @@ bool OTableController::checkColumns(bool _bNew)
    {
        OUString sTitle(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY_HEAD));
        OUString sMsg(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY));
        OSQLMessageBox aBox(getView(), sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES);
        VclPtr<OSQLMessageBox> aBox(new OSQLMessageBox(getView(), sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES));

        switch ( aBox.Execute() )
        switch ( aBox->Execute() )
        {
        case RET_YES:
        {
@@ -1075,8 +1075,8 @@ void OTableController::alterColumns()
                        aMessage = aMessage.replaceFirst( "$column$", pField->GetName() );

                        SQLExceptionInfo aError( ::cppu::getCaughtException() );
                        OSQLWarningBox aMsg( getView(), aMessage, WB_YES_NO | WB_DEF_YES , &aError );
                        bNotOk = aMsg.Execute() == RET_YES;
                        VclPtr<OSQLWarningBox> aMsg(new OSQLWarningBox( getView(), aMessage, WB_YES_NO | WB_DEF_YES , &aError ) );
                        bNotOk = aMsg->Execute() == RET_YES;
                    }
                    else
                        throw;
@@ -1131,8 +1131,8 @@ void OTableController::alterColumns()
                {
                    OUString aMessage(ModuleRes(STR_TABLEDESIGN_ALTER_ERROR));
                    aMessage = aMessage.replaceFirst("$column$",pField->GetName());
                    OSQLWarningBox aMsg( getView(), aMessage, WB_YES_NO | WB_DEF_YES );
                    if ( aMsg.Execute() != RET_YES )
                    VclPtr<OSQLWarningBox> aMsg(new OSQLWarningBox( getView(), aMessage, WB_YES_NO | WB_DEF_YES ) );
                    if ( aMsg->Execute() != RET_YES )
                    {
                        Reference<XPropertySet> xNewColumn(xIdxColumns->getByIndex(nPos),UNO_QUERY_THROW);
                        OUString sName;
@@ -1198,8 +1198,8 @@ void OTableController::alterColumns()
                    OUString aMsgT(ModuleRes(STR_TBL_COLUMN_IS_KEYCOLUMN));
                    aMsgT = aMsgT.replaceFirst("$column$",*pIter);
                    OUString aTitle(ModuleRes(STR_TBL_COLUMN_IS_KEYCOLUMN_TITLE));
                    OSQLMessageBox aMsg(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES);
                    if(aMsg.Execute() == RET_YES)
                    VclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES));
                    if(aMsg->Execute() == RET_YES)
                    {
                        xKeyColumns = NULL;
                        dropPrimaryKey();
diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx
index 7087c3b..d0f5a99 100644
--- a/dbaccess/source/ui/uno/dbinteraction.cxx
+++ b/dbaccess/source/ui/uno/dbinteraction.cxx
@@ -127,8 +127,8 @@ namespace dbaui
            xParamCallback = Reference< XInteractionSupplyParameters >(_rContinuations[nParamPos], UNO_QUERY);
        OSL_ENSURE(xParamCallback.is(), "BasicInteractionHandler::implHandle(ParametersRequest): can't set the parameters without an appropriate interaction handler!s");

        OParameterDialog aDlg(NULL, _rParamRequest.Parameters, _rParamRequest.Connection, m_xContext);
        sal_Int16 nResult = aDlg.Execute();
        VclPtr<OParameterDialog> aDlg(new OParameterDialog(NULL, _rParamRequest.Parameters, _rParamRequest.Connection, m_xContext));
        sal_Int16 nResult = aDlg->Execute();
        try
        {
            switch (nResult)
@@ -136,7 +136,7 @@ namespace dbaui
                case RET_OK:
                    if (xParamCallback.is())
                    {
                        xParamCallback->setParameters(aDlg.getValues());
                        xParamCallback->setParameters(aDlg->getValues());
                        xParamCallback->select();
                    }
                    break;
@@ -182,9 +182,9 @@ namespace dbaui
        }

        // execute the dialog
        OSQLMessageBox aDialog(NULL, _rSqlInfo, nDialogStyle);
        VclPtr<OSQLMessageBox> aDialog(new OSQLMessageBox(NULL, _rSqlInfo, nDialogStyle));
        // TODO: need a way to specify the parent window
        sal_Int16 nResult = aDialog.Execute();
        sal_Int16 nResult = aDialog->Execute();
        try
        {
            switch (nResult)
@@ -256,8 +256,8 @@ namespace dbaui
                Reference< XInteractionDocumentSave > xCallback(_rContinuations[nDocuPos], UNO_QUERY);
                OSL_ENSURE(xCallback.is(), "BasicInteractionHandler::implHandle(DocumentSaveRequest): can't save document without an appropriate interaction handler!s");

                OCollectionView aDlg(NULL, _rDocuRequest.Content, _rDocuRequest.Name, m_xContext);
                sal_Int16 nResult = aDlg.Execute();
                VclPtr<OCollectionView> aDlg(new OCollectionView(NULL, _rDocuRequest.Content, _rDocuRequest.Name, m_xContext));
                sal_Int16 nResult = aDlg->Execute();
                try
                {
                    switch (nResult)
@@ -265,7 +265,7 @@ namespace dbaui
                        case RET_OK:
                            if (xCallback.is())
                            {
                                xCallback->setName(aDlg.getName(),aDlg.getSelectedFolder());
                                xCallback->setName(aDlg->getName(), aDlg->getSelectedFolder());
                                xCallback->select();
                            }
                            break;
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index d0e5324..177d624 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -708,9 +708,9 @@ void Desktop::HandleBootstrapPathErrors( ::utl::Bootstrap::Status aBootstrapStat

        OUString const aMessage(aDiagnosticMessage + "\n");

        MessageDialog aBootstrapFailedBox(NULL, aMessage);
        aBootstrapFailedBox.SetText( aProductKey );
        aBootstrapFailedBox.Execute();
        VclPtr<MessageDialog> aBootstrapFailedBox(new MessageDialog(NULL, aMessage));
        aBootstrapFailedBox->SetText( aProductKey );
        aBootstrapFailedBox->Execute();
    }
}

@@ -2354,8 +2354,8 @@ void Desktop::OpenClients()
            ResMgr* pDtResMgr = GetDesktopResManager();
            if( pDtResMgr )
            {
                MessageDialog aBox(NULL, ResId(STR_ERR_PRINTDISABLED, *pDtResMgr));
                aBox.Execute();
                VclPtr<MessageDialog> aBox(new MessageDialog(NULL, ResId(STR_ERR_PRINTDISABLED, *pDtResMgr)));
                aBox->Execute();
            }
        }

diff --git a/desktop/source/app/lockfile2.cxx b/desktop/source/app/lockfile2.cxx
index c590ab7..7b9a259 100644
--- a/desktop/source/app/lockfile2.cxx
+++ b/desktop/source/app/lockfile2.cxx
@@ -38,22 +38,22 @@ bool Lockfile_execWarning( Lockfile * that )
    OString aTime  = aConfig.ReadKey( LOCKFILE_TIMEKEY );

    // display warning and return response
    MessageDialog aBox(NULL, DesktopResId(STR_QUERY_USERDATALOCKED),
                       VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
    VclPtr<MessageDialog> aBox(new MessageDialog(NULL, DesktopResId(STR_QUERY_USERDATALOCKED),
                       VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
    // set box title
    OUString aTitle = OUString( DesktopResId( STR_TITLE_USERDATALOCKED ));
    aBox.SetText( aTitle );
    aBox->SetText( aTitle );
    // insert values...
    OUString aMsgText = aBox.get_primary_text();
    OUString aMsgText = aBox->get_primary_text();
    aMsgText = aMsgText.replaceFirst(
        "$u", OStringToOUString( aUser, RTL_TEXTENCODING_ASCII_US) );
    aMsgText = aMsgText.replaceFirst(
        "$h", OStringToOUString( aHost, RTL_TEXTENCODING_ASCII_US) );
    aMsgText = aMsgText.replaceFirst(
        "$t", OStringToOUString( aTime, RTL_TEXTENCODING_ASCII_US) );
    aBox.set_primary_text(aMsgText);
    aBox->set_primary_text(aMsgText);
    // do it
    return aBox.Execute( ) == RET_YES;
    return aBox->Execute( ) == RET_YES;
}

}
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 75b7803..b3a7195 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -407,8 +407,8 @@ void ExtBoxWithBtns_Impl::MouseButtonDown( const MouseEvent& rMEvt )
                                break;
            case CMD_SHOW_LICENSE:
                {
                    ShowLicenseDialog aLicenseDlg( m_pParent, GetEntryData( nPos )->m_xPackage );
                    aLicenseDlg.Execute();
                    VclPtr<ShowLicenseDialog> aLicenseDlg(new ShowLicenseDialog( m_pParent, GetEntryData( nPos )->m_xPackage ));
                    aLicenseDlg->Execute();
                    break;
                }
        }
@@ -594,12 +594,12 @@ bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment::
    if ( !bHadWarning && IsSharedPkgMgr( xPackage ) )
    {
        const SolarMutexGuard guard;
        MessageDialog aInfoBox(pParent, getResId(nResID),
                               VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
        VclPtr<MessageDialog> aInfoBox(new MessageDialog(pParent, getResId(nResID),
                               VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL));

        bHadWarning = true;

        if ( RET_OK == aInfoBox.Execute() )
        if ( RET_OK == aInfoBox->Execute() )
            return true;
        else
            return false;
@@ -626,32 +626,32 @@ void DialogHelper::openWebBrowser( const OUString & sURL, const OUString &sTitle
        uno::Any exc( ::cppu::getCaughtException() );
        OUString msg( ::comphelper::anyToString( exc ) );
        const SolarMutexGuard guard;
        MessageDialog aErrorBox(NULL, msg);
        aErrorBox.SetText( sTitle );
        aErrorBox.Execute();
        VclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, msg));
        aErrorBox->SetText( sTitle );
        aErrorBox->Execute();
    }
}

bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const
{
    const SolarMutexGuard guard;
    MessageDialog aInfo(m_pVCLWindow, getResId(RID_STR_WARNING_INSTALL_EXTENSION),
                        VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
    VclPtr<MessageDialog> aInfo(new MessageDialog(m_pVCLWindow, getResId(RID_STR_WARNING_INSTALL_EXTENSION),
                        VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL));

    OUString sText(aInfo.get_primary_text());
    OUString sText(aInfo->get_primary_text());
    sText = sText.replaceAll("%NAME", rExtensionName);
    aInfo.set_primary_text(sText);
    aInfo->set_primary_text(sText);

    return ( RET_OK == aInfo.Execute() );
    return ( RET_OK == aInfo->Execute() );
}

bool DialogHelper::installForAllUsers( bool &bInstallForAll ) const
{
    const SolarMutexGuard guard;
    MessageDialog aQuery(m_pVCLWindow, "InstallForAllDialog",
                         "desktop/ui/installforalldialog.ui");
    VclPtr<MessageDialog> aQuery(new MessageDialog(m_pVCLWindow, "InstallForAllDialog",
                         "desktop/ui/installforalldialog.ui"));

    short nRet = aQuery.Execute();
    short nRet = aQuery->Execute();
    if (nRet == RET_CANCEL)
        return false;

@@ -782,14 +782,14 @@ void ExtMgrDialog::checkEntries()
bool ExtMgrDialog::removeExtensionWarn( const OUString &rExtensionName ) const
{
    const SolarMutexGuard guard;
    MessageDialog aInfo(const_cast<ExtMgrDialog*>(this), getResId(RID_STR_WARNING_REMOVE_EXTENSION),
                        VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
    VclPtr<MessageDialog> aInfo(new MessageDialog(const_cast<ExtMgrDialog*>(this), getResId(RID_STR_WARNING_REMOVE_EXTENSION),
                        VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL));

    OUString sText(aInfo.get_primary_text());
    OUString sText(aInfo->get_primary_text());
    sText = sText.replaceAll("%NAME", rExtensionName);
    aInfo.set_primary_text(sText);
    aInfo->set_primary_text(sText);

    return ( RET_OK == aInfo.Execute() );
    return ( RET_OK == aInfo->Execute() );
}

bool ExtMgrDialog::enablePackage( const uno::Reference< deployment::XPackage > &xPackage,
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index 203c061..a075891 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -451,12 +451,12 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
            verExc.Deployed->getDisplayName());
        {
            SolarMutexGuard guard;
            MessageDialog box(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL,
                ResId(id, *DeploymentGuiResMgr::get()), VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
            VclPtr<MessageDialog> box(new MessageDialog(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL,
                ResId(id, *DeploymentGuiResMgr::get()), VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL));
            OUString s;
            if (bEqualNames)
            {
                s = box.get_primary_text();
                s = box->get_primary_text();
            }
            else if (id == RID_STR_WARNING_VERSION_EQUAL)
            {
@@ -477,8 +477,8 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
            s = s.replaceAll("$OLDNAME", verExc.Deployed->getDisplayName());
            s = s.replaceAll("$NEW", getVersion(verExc.NewVersion));
            s = s.replaceAll("$DEPLOYED", getVersion(verExc.Deployed));
            box.set_primary_text(s);
            approve = box.Execute() == RET_OK;
            box->set_primary_text(s);
            approve = box->Execute() == RET_OK;
            abort = !approve;
        }
    }
@@ -506,8 +506,8 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
        SolarMutexGuard guard;
        OUString sMsg(ResId(RID_STR_UNSUPPORTED_PLATFORM, *DeploymentGuiResMgr::get()).toString());
        sMsg = sMsg.replaceAll("%Name", platExc.package->getDisplayName());
        MessageDialog box(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, sMsg);
        box.Execute();
        VclPtr<MessageDialog> box(new MessageDialog(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, sMsg));
        box->Execute();
        approve = true;
    }

diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index b4ab62a..31a99d9 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -472,10 +472,10 @@ Reference<XComponentContext> getUNO(
                if ( ! InitVCL() )
                    throw RuntimeException( "Cannot initialize VCL!" );
                {
                    WarningBox warn(NULL, WB_OK | WB_DEF_OK, sMsg);
                    warn.SetText(utl::ConfigManager::getProductName());
                    warn.SetIcon(0);
                    warn.Execute();
                    VclPtr<WarningBox> warn(new WarningBox(NULL, WB_OK | WB_DEF_OK, sMsg));
                    warn->SetText(utl::ConfigManager::getProductName());
                    warn->SetIcon(0);
                    warn->Execute();
                }
                DeInitVCL();
            }
diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx
index 69b2bac..674f563 100644
--- a/editeng/source/misc/splwrap.cxx
+++ b/editeng/source/misc/splwrap.cxx
@@ -411,8 +411,8 @@ bool SvxSpellWrapper::SpellNext( )
        WAIT_OFF();

        sal_uInt16 nResId = bReverse ? RID_SVXSTR_QUERY_BW_CONTINUE : RID_SVXSTR_QUERY_CONTINUE;
        MessageDialog aBox(pWin, EditResId(nResId), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
        if ( aBox.Execute() != RET_YES )
        VclPtr<MessageDialog> aBox(new MessageDialog(pWin, EditResId(nResId), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
        if ( aBox->Execute() != RET_YES )
        {
            // sacrifice the other area if necessary ask for special area
            WAIT_ON();
diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx
index 099ea23..494c7b8 100644
--- a/extensions/source/abpilot/typeselectionpage.cxx
+++ b/extensions/source/abpilot/typeselectionpage.cxx
@@ -232,8 +232,8 @@ namespace abp

        if (AST_INVALID == getSelectedType( ))
        {
            MessageDialog aError(this, ModuleRes(RID_STR_NEEDTYPESELECTION));
            aError.Execute();
            VclPtr<MessageDialog> aError(new MessageDialog(this, ModuleRes(RID_STR_NEEDTYPESELECTION)));
            aError->Execute();
            return false;
        }

diff --git a/extensions/source/bibliography/bibview.cxx b/extensions/source/bibliography/bibview.cxx
index 1df8403..c32e077 100644
--- a/extensions/source/bibliography/bibview.cxx
+++ b/extensions/source/bibliography/bibview.cxx
@@ -139,11 +139,11 @@ namespace bib
            {
                sErrorString += "\n";
                sErrorString += BIB_RESSTR(RID_MAP_QUESTION);
                QueryBox aQuery( this, WB_YES_NO, sErrorString );
                aQuery.SetDefaultCheckBoxText();
                short nResult = aQuery.Execute();
                VclPtr<QueryBox> aQuery(new QueryBox(this, WB_YES_NO, sErrorString) );
                aQuery->SetDefaultCheckBoxText();
                short nResult = aQuery->Execute();
                BibModul::GetConfig()->SetShowColumnAssignmentWarning(
                    !aQuery.GetCheckBoxState());
                    !aQuery->GetCheckBoxState());
                if( RET_YES != nResult )
                {
                    bExecute = false;
diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx
index 6bb08b0..dba10a1 100644
--- a/extensions/source/propctrlr/browserlistbox.cxx
+++ b/extensions/source/propctrlr/browserlistbox.cxx
@@ -357,10 +357,9 @@ namespace pcr
            ,m_bUpdate(true)
            ,m_pControlContextImpl( new PropertyControlContext_Impl( *this ) )
    {

        ListBox aListBox(this,WB_DROPDOWN);
        aListBox.SetPosSizePixel(Point(0,0),Size(100,100));
        m_nRowHeight = aListBox.GetSizePixel().Height()+2;
        VclPtr<ListBox> aListBox(new ListBox(this,WB_DROPDOWN));
        aListBox->SetPosSizePixel(Point(0,0),Size(100,100));
        m_nRowHeight = aListBox->GetSizePixel().Height()+2;
        SetBackground( pParent->GetBackground() );
        m_aLinesPlayground->SetBackground( GetBackground() );

diff --git a/extensions/source/propctrlr/commoncontrol.cxx b/extensions/source/propctrlr/commoncontrol.cxx
index ac33ace..096b717 100644
--- a/extensions/source/propctrlr/commoncontrol.cxx
+++ b/extensions/source/propctrlr/commoncontrol.cxx
@@ -103,9 +103,9 @@ namespace pcr
        if ( !m_pControlWindow )
            return;

        ComboBox aComboBox(m_pControlWindow, WB_DROPDOWN);
        aComboBox.SetPosSizePixel(Point(0,0), Size(100,100));
        m_pControlWindow->SetSizePixel(aComboBox.GetSizePixel());
        VclPtr<ComboBox> aComboBox(new ComboBox(m_pControlWindow, WB_DROPDOWN));
        aComboBox->SetPosSizePixel(Point(0,0), Size(100,100));
        m_pControlWindow->SetSizePixel(aComboBox->GetSizePixel());

        // TODO/UNOize: why do the controls this themselves? Shouldn't this be the task
        // of the browser listbox/line?
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 1059415..a7006cb 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2608,9 +2608,9 @@ namespace pcr
        OSL_PRECOND( m_pInfoService.get(), "FormComponentPropertyHandler::impl_dialogListSelection_nothrow: no property meta data!" );

        OUString sPropertyUIName( m_pInfoService->getPropertyTranslation( m_pInfoService->getPropertyId( _rProperty ) ) );
        ListSelectionDialog aDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, _rProperty, sPropertyUIName );
        VclPtr<ListSelectionDialog> aDialog(new ListSelectionDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, _rProperty, sPropertyUIName ) );
        _rClearBeforeDialog.clear();
        return ( RET_OK == aDialog.Execute() );
        return ( RET_OK == aDialog->Execute() );
    }


@@ -2685,9 +2685,9 @@ namespace pcr
            return false;


        FormLinkDialog aDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, xMasterProp, m_xContext );
        VclPtr<FormLinkDialog> aDialog(new FormLinkDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, xMasterProp, m_xContext ) );
        _rClearBeforeDialog.clear();
        return ( RET_OK == aDialog.Execute() );
        return ( RET_OK == aDialog->Execute() );
    }


@@ -2871,11 +2871,11 @@ namespace pcr

        {   // do this in an own block. The dialog needs to be destroyed before we call
            // destroyItemSet
            ControlCharacterDialog aDlg( impl_getDefaultDialogParent_nothrow(), *pSet );
            VclPtr<ControlCharacterDialog> aDlg(new ControlCharacterDialog( impl_getDefaultDialogParent_nothrow(), *pSet ) );
            _rClearBeforeDialog.clear();
            if ( RET_OK == aDlg.Execute() )
            if ( RET_OK == aDlg->Execute() )
            {
                const SfxItemSet* pOut = aDlg.GetOutputItemSet();
                const SfxItemSet* pOut = aDlg->GetOutputItemSet();
                if ( pOut )
                {
                    Sequence< NamedValue > aFontPropertyValues;
@@ -2942,11 +2942,11 @@ namespace pcr

    bool FormComponentPropertyHandler::impl_dialogChooseLabelControl_nothrow( Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
    {
        OSelectLabelDialog dlgSelectLabel( impl_getDefaultDialogParent_nothrow(), m_xComponent );
        VclPtr<OSelectLabelDialog> dlgSelectLabel(new OSelectLabelDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent ) );
        _rClearBeforeDialog.clear();
        bool bSuccess = ( RET_OK == dlgSelectLabel.Execute() );
        bool bSuccess = ( RET_OK == dlgSelectLabel->Execute() );
        if ( bSuccess )
            _out_rNewValue <<= dlgSelectLabel.GetSelected();
            _out_rNewValue <<= dlgSelectLabel->GetSelected();
        return bSuccess;
    }

@@ -2965,14 +2965,14 @@ namespace pcr
        OSL_PRECOND( impl_getContextControlContainer_nothrow().is(), "FormComponentPropertyHandler::impl_dialogChangeTabOrder_nothrow: invalid control context!" );

        Reference< XTabControllerModel > xTabControllerModel( impl_getRowSet_nothrow(), UNO_QUERY );
        TabOrderDialog aDialog(
        VclPtr<TabOrderDialog> aDialog(new TabOrderDialog(
            impl_getDefaultDialogParent_nothrow(),
            xTabControllerModel,
            impl_getContextControlContainer_nothrow(),
            m_xContext
        );
        ));
        _rClearBeforeDialog.clear();
        return ( RET_OK == aDialog.Execute() );
        return ( RET_OK == aDialog->Execute() );
    }


diff --git a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
index 99df014..3a847ad 100644
--- a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
+++ b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
@@ -496,11 +496,11 @@ namespace pcr
        ::std::vector< OUString > aExistentNames;
        m_pHelper->getAvailableDataTypeNames( aExistentNames );

        NewDataTypeDialog aDialog( NULL, pType->getName(), aExistentNames );  // TODO/eForms: proper parent
        if ( aDialog.Execute() != RET_OK )
        VclPtr<NewDataTypeDialog> aDialog(new NewDataTypeDialog( NULL, pType->getName(), aExistentNames ) );  // TODO/eForms: proper parent
        if ( aDialog->Execute() != RET_OK )
            return false;

        _rNewName = aDialog.GetName();
        _rNewName = aDialog->GetName();
        return true;
    }

@@ -535,8 +535,8 @@ namespace pcr
        // confirmation message
        OUString sConfirmation( PcrRes( RID_STR_CONFIRM_DELETE_DATA_TYPE ).toString() );
        sConfirmation = sConfirmation.replaceFirst( "#type#", pType->getName() );
        QueryBox aQuery( NULL, WB_YES_NO, sConfirmation ); // TODO/eForms: proper parent
        if ( aQuery.Execute() != RET_YES )
        VclPtr<QueryBox> aQuery(new QueryBox( NULL, WB_YES_NO, sConfirmation ) ); // TODO/eForms: proper parent
        if ( aQuery->Execute() != RET_YES )
            return false;

        return true;
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index 2dc49da..8c84962 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -262,8 +262,8 @@ short SaneDlg::Execute()
{
    if( ! Sane::IsSane() )
    {
        MessageDialog aErrorBox(NULL, SaneResId(STR_COULD_NOT_BE_INIT));
        aErrorBox.Execute();
        VclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, SaneResId(STR_COULD_NOT_BE_INIT)));
        aErrorBox->Execute();
        return sal_False;
    }
    LoadState();
@@ -545,8 +545,8 @@ IMPL_LINK( SaneDlg, ClickBtnHdl, Button*, pButton )
            aString = aString.replaceFirst( "%s", Sane::GetVendor( mrSane.GetDeviceNumber() ) );
            aString = aString.replaceFirst( "%s", Sane::GetModel( mrSane.GetDeviceNumber() ) );
            aString = aString.replaceFirst( "%s", Sane::GetType( mrSane.GetDeviceNumber() ) );
            MessageDialog aInfoBox(this, aString, VCL_MESSAGE_INFO);
            aInfoBox.Execute();
            VclPtr<MessageDialog> aInfoBox(new MessageDialog(this, aString, VCL_MESSAGE_INFO));
            aInfoBox->Execute();
        }
        else if( pButton == mpPreviewButton )
            AcquirePreview();
@@ -574,11 +574,11 @@ IMPL_LINK( SaneDlg, ClickBtnHdl, Button*, pButton )
                        x[ i ] = (double)i;
                    mrSane.GetOptionValue( mnCurrentOption, y.get() );

                    GridDialog aGrid( x.get(), y.get(), nElements, this );
                    aGrid.SetText( mrSane.GetOptionName( mnCurrentOption ) );
                    aGrid.setBoundings( 0, mfMin, nElements, mfMax );
                    if( aGrid.Execute() && aGrid.getNewYValues() )
                        mrSane.SetOptionValue( mnCurrentOption, aGrid.getNewYValues() );
                    VclPtr<GridDialog> aGrid(new GridDialog( x.get(), y.get(), nElements, this ) );
                    aGrid->SetText( mrSane.GetOptionName( mnCurrentOption ) );
                    aGrid->setBoundings( 0, mfMin, nElements, mfMax );
                    if( aGrid->Execute() && aGrid->getNewYValues() )
                        mrSane.SetOptionValue( mnCurrentOption, aGrid->getNewYValues() );
                }
                break;
                case SANE_TYPE_BOOL:
@@ -826,8 +826,8 @@ void SaneDlg::AcquirePreview()
    if( nOption == -1 )
    {
        OUString aString(SaneResId(STR_SLOW_PREVIEW));
        MessageDialog aBox(this, aString, VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
        if (aBox.Execute() == RET_CANCEL)
        VclPtr<MessageDialog> aBox(new MessageDialog(this, aString, VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL));
        if (aBox->Execute() == RET_CANCEL)
            return;
    }
    else
@@ -836,8 +836,8 @@ void SaneDlg::AcquirePreview()
    BitmapTransporter aTransporter;
    if( ! mrSane.Start( aTransporter ) )
    {
        MessageDialog aErrorBox(this, SaneResId(STR_ERROR_SCAN));
        aErrorBox.Execute();
        VclPtr<MessageDialog> aErrorBox(new MessageDialog(this, SaneResId(STR_ERROR_SCAN)));
        aErrorBox->Execute();
    }
    else
    {
diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx
index a66d797..e93f623 100644
--- a/extensions/source/scanner/scanunx.cxx
+++ b/extensions/source/scanner/scanunx.cxx
@@ -299,9 +299,9 @@ sal_Bool ScannerManager::configureScannerAndScan( ScannerContext& scanner_contex
            );

        pHolder->m_bBusy = true;
        SaneDlg aDlg( NULL, pHolder->m_aSane, listener.is() );
        bRet = aDlg.Execute();
        bScan = aDlg.getDoScan();
        VclPtr<SaneDlg> aDlg(new SaneDlg(NULL, pHolder->m_aSane, listener.is()) );
        bRet = aDlg->Execute();
        bScan = aDlg->getDoScan();
        pHolder->m_bBusy = false;
    }
    if ( bScan )
diff --git a/filter/source/graphic/GraphicExportDialog.cxx b/filter/source/graphic/GraphicExportDialog.cxx
index ca98685..64f090a 100644
--- a/filter/source/graphic/GraphicExportDialog.cxx
+++ b/filter/source/graphic/GraphicExportDialog.cxx
@@ -107,10 +107,10 @@ void GraphicExportDialog::setTitle( const OUString& aTitle )
sal_Int16 GraphicExportDialog::execute() throw ( RuntimeException, std::exception )
{
    sal_Int16 nReturn = ui::dialogs::ExecutableDialogResults::CANCEL;
    GraphicExportOptionsDialog graphicExportOptionsDialog( Application::GetDefDialogParent(), mxSourceDocument );
    if (graphicExportOptionsDialog.Execute() == RET_OK )
    VclPtr<GraphicExportOptionsDialog> graphicExportOptionsDialog(new GraphicExportOptionsDialog( Application::GetDefDialogParent(), mxSourceDocument ) );
    if (graphicExportOptionsDialog->Execute() == RET_OK )
    {
        maFilterDataSequence = graphicExportOptionsDialog.getFilterData();
        maFilterDataSequence = graphicExportOptionsDialog->getFilterData();
        nReturn = ui::dialogs::ExecutableDialogResults::OK;
    }
    return nReturn;
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index edd7061..4a5d8f2 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -486,8 +486,8 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
        pResMgr = ResMgr::CreateResMgr( "eps", Application::GetSettings().GetUILanguageTag() );
        if( pResMgr )
        {
            InfoBox aInfoBox( NULL, ResId(KEY_VERSION_CHECK, *pResMgr).toString() );
            aInfoBox.Execute();
            VclPtr<InfoBox> aInfoBox(new InfoBox( NULL, ResId(KEY_VERSION_CHECK, *pResMgr).toString() ) );
            aInfoBox->Execute();
            delete pResMgr;
        }
    }
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 4d08f14..073039d 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -812,8 +812,8 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleExportPDFAHdl)
    // if a password was set, inform the user that this will not be used in PDF/A case
    if( mpCbPDFA1b->IsChecked() && pSecPage && pSecPage->hasPassword() )
    {
        MessageDialog aBox(this, PDFFilterResId(STR_WARN_PASSWORD_PDFA), VCL_MESSAGE_WARNING);
        aBox.Execute();
        VclPtr<MessageDialog> aBox(new MessageDialog(this, PDFFilterResId(STR_WARN_PASSWORD_PDFA), VCL_MESSAGE_WARNING));
        aBox->Execute();
    }

    return 0;
@@ -1197,17 +1197,17 @@ void ImpPDFTabSecurityPage::SetFilterConfigItem( const  ImpPDFTabDialog* paParen

IMPL_LINK_NOARG(ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl)
{
    SfxPasswordDialog aPwdDialog( this, &msUserPwdTitle );
    aPwdDialog.SetMinLen( 0 );
    aPwdDialog.ShowMinLengthText(false);
    aPwdDialog.ShowExtras( SHOWEXTRAS_CONFIRM | SHOWEXTRAS_PASSWORD2 | SHOWEXTRAS_CONFIRM2 );
    aPwdDialog.SetText(msStrSetPwd);
    aPwdDialog.SetGroup2Text(msOwnerPwdTitle);
    aPwdDialog.AllowAsciiOnly();
    if( aPwdDialog.Execute() == RET_OK )  //OK issued get password and set it
    VclPtr<SfxPasswordDialog> aPwdDialog(new SfxPasswordDialog( this, &msUserPwdTitle ) );
    aPwdDialog->SetMinLen( 0 );
    aPwdDialog->ShowMinLengthText(false);
    aPwdDialog->ShowExtras( SHOWEXTRAS_CONFIRM | SHOWEXTRAS_PASSWORD2 | SHOWEXTRAS_CONFIRM2 );
    aPwdDialog->SetText(msStrSetPwd);
    aPwdDialog->SetGroup2Text(msOwnerPwdTitle);
    aPwdDialog->AllowAsciiOnly();
    if( aPwdDialog->Execute() == RET_OK )  //OK issued get password and set it
    {
        OUString aUserPW( aPwdDialog.GetPassword() );
        OUString aOwnerPW( aPwdDialog.GetPassword2() );
        OUString aUserPW( aPwdDialog->GetPassword() );
        OUString aOwnerPW( aPwdDialog->GetPassword2() );

        mbHaveUserPassword = !aUserPW.isEmpty();
        mbHaveOwnerPassword = !aOwnerPW.isEmpty();
diff --git a/filter/source/pdf/pdfinteract.cxx b/filter/source/pdf/pdfinteract.cxx
index 579d9ef..ad7641d 100644
--- a/filter/source/pdf/pdfinteract.cxx
+++ b/filter/source/pdf/pdfinteract.cxx
@@ -53,8 +53,8 @@ sal_Bool SAL_CALL PDFInteractionHandler::handleInteractionRequest( const Referen
        sal_Int32 nCodes = aExc.ErrorCodes.getLength();
        for( sal_Int32 i = 0; i < nCodes; i++ )
            aCodes.insert( (vcl::PDFWriter::ErrorCode)aExc.ErrorCodes.getConstArray()[i] );
        ImplErrorDialog aDlg( aCodes );
        aDlg.Execute();
        VclPtr<ImplErrorDialog> aDlg(new ImplErrorDialog( aCodes ) );
        aDlg->Execute();
        bHandled = true;
    }
    return bHandled;
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index 57d8a3d..9186fc8 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -225,11 +225,11 @@ void XMLFilterSettingsDialog::onNew()
    aTempInfo.maDocumentService = "com.sun.star.text.TextDocument";

    // execute XML Filter Dialog
    XMLFilterTabDialog aDlg( this, *getXSLTDialogResMgr(), mxContext, &aTempInfo );
    if ( aDlg.Execute() == RET_OK )
    VclPtr<XMLFilterTabDialog> aDlg(new XMLFilterTabDialog( this, *getXSLTDialogResMgr(), mxContext, &aTempInfo ) );
    if ( aDlg->Execute() == RET_OK )
    {
        // insert the new filter
        insertOrEdit( aDlg.getNewFilterInfo() );
        insertOrEdit( aDlg->getNewFilterInfo() );
    }
}

@@ -246,10 +246,10 @@ void XMLFilterSettingsDialog::onEdit()
        filter_info_impl* pOldInfo = static_cast<filter_info_impl*>(pEntry->GetUserData());

        // execute XML Filter Dialog
        XMLFilterTabDialog aDlg( this, *getXSLTDialogResMgr(), mxContext, pOldInfo );
        if ( aDlg.Execute() == RET_OK )
        VclPtr<XMLFilterTabDialog> aDlg(new XMLFilterTabDialog( this, *getXSLTDialogResMgr(), mxContext, pOldInfo ) );
        if ( aDlg->Execute() == RET_OK )
        {
            filter_info_impl* pNewInfo = aDlg.getNewFilterInfo();
            filter_info_impl* pNewInfo = aDlg->getNewFilterInfo();

            if( !(*pOldInfo == *pNewInfo) )
            {
@@ -771,8 +771,8 @@ void XMLFilterSettingsDialog::onTest()
    {
        filter_info_impl* pInfo = static_cast<filter_info_impl*>(pEntry->GetUserData());

        XMLFilterTestDialog aDlg(this, mxContext);
        aDlg.test( *pInfo );
        VclPtr<XMLFilterTestDialog> aDlg(new XMLFilterTestDialog(this, mxContext));
        aDlg->test( *pInfo );
    }
}

@@ -789,8 +789,8 @@ void XMLFilterSettingsDialog::onDelete()
        OUString aMessage(RESIDSTR(STR_WARN_DELETE));
        aMessage = aMessage.replaceFirst( aPlaceHolder, pInfo->maFilterName );

        WarningBox aWarnBox(this, (WinBits)(WB_YES_NO | WB_DEF_YES),    aMessage );
        if( aWarnBox.Execute() == RET_YES )
        VclPtr<WarningBox> aWarnBox(new WarningBox(this, (WinBits)(WB_YES_NO | WB_DEF_YES), aMessage ));
        if( aWarnBox->Execute() == RET_YES )
        {
            try
            {
@@ -919,8 +919,8 @@ void XMLFilterSettingsDialog::onSave()
            aMsg = aMsg.replaceFirst( sPlaceholder, aURL.GetName() );
        }

        InfoBox aBox(this, aMsg );
        aBox.Execute();
        VclPtr<InfoBox> aBox(new InfoBox(this, aMsg ));
        aBox->Execute();
    }
}

@@ -985,8 +985,8 @@ void XMLFilterSettingsDialog::onOpen()
            aMsg = aMsg.replaceFirst( sPlaceholder, OUString::number( nFilters ) );
        }

        InfoBox aBox(this, aMsg );
        aBox.Execute();
        VclPtr<InfoBox> aBox(new InfoBox(this, aMsg ));
        aBox->Execute();
    }
}

diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.cxx b/filter/source/xsltdialog/xmlfiltertabdialog.cxx
index b5e28d1..3c286b6 100644
--- a/filter/source/xsltdialog/xmlfiltertabdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltertabdialog.cxx
@@ -263,8 +263,8 @@ bool XMLFilterTabDialog::onOk()
            aMessage = aMessage.replaceAll( "%s", aReplace1 );
        }

        MessageDialog aBox(this, aMessage);
        aBox.Execute();
        VclPtr<MessageDialog> aBox(new MessageDialog(this, aMessage));
        aBox->Execute();

        if( pFocusWindow )
            pFocusWindow->GrabFocus();
diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx
index e6e831d..9e7b2e4 100644
--- a/forms/source/runtime/formoperations.cxx
+++ b/forms/source/runtime/formoperations.cxx
@@ -445,8 +445,8 @@ namespace frm
            if(needConfirmation)
            {
                // TODO: shouldn't this be done with an interaction handler?
                QueryBox aQuery( NULL, WB_YES_NO_CANCEL | WB_DEF_YES, FRM_RES_STRING( RID_STR_QUERY_SAVE_MODIFIED_ROW ) );
                switch ( aQuery.Execute() )
                VclPtr<QueryBox> aQuery(new QueryBox( NULL, WB_YES_NO_CANCEL | WB_DEF_YES, FRM_RES_STRING( RID_STR_QUERY_SAVE_MODIFIED_ROW ) ) );
                switch ( aQuery->Execute() )
                {
                case RET_NO:
                    shouldCommit = false;
diff --git a/fpicker/source/office/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx
index bed0b1a..35d84aa 100644
--- a/fpicker/source/office/PlacesListBox.cxx
+++ b/fpicker/source/office/PlacesListBox.cxx
@@ -193,13 +193,13 @@ IMPL_LINK ( PlacesListBox, DoubleClick, void*, EMPTYARG )
    PlacePtr pPlace = maPlaces[nSelected];
    if ( pPlace->IsEditable() == true && !pPlace->IsLocal( ) )
    {
        PlaceEditDialog aDlg( mpDlg, pPlace );
        short aRetCode = aDlg.Execute();
        VclPtr<PlaceEditDialog> aDlg(new PlaceEditDialog(mpDlg, pPlace));
        short aRetCode = aDlg->Execute();
        switch(aRetCode) {
            case RET_OK :
            {
                pPlace->SetName ( aDlg.GetServerName() );
                pPlace->SetUrl( aDlg.GetServerUrl() );
                pPlace->SetName ( aDlg->GetServerName() );
                pPlace->SetUrl( aDlg->GetServerUrl() );
                mbUpdated = true;
                break;
            }
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 01d7e6c..2991262 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -668,17 +668,17 @@ IMPL_STATIC_LINK( SvtFileDialog, NewFolderHdl_Impl, PushButton*, EMPTYARG )
    SmartContent aContent( pThis->_pFileView->GetViewURL( ) );
    OUString aTitle;
    aContent.getTitle( aTitle );
    QueryFolderNameDialog aDlg( pThis, aTitle, SVT_RESSTR(STR_SVT_NEW_FOLDER) );
    VclPtr<QueryFolderNameDialog> aDlg(new QueryFolderNameDialog(pThis, aTitle, SVT_RESSTR(STR_SVT_NEW_FOLDER)) );
    bool bHandled = false;

    while ( !bHandled )
    {
        if ( aDlg.Execute() == RET_OK )
        if ( aDlg->Execute() == RET_OK )
        {
            OUString aUrl = aContent.createFolder( aDlg.GetName( ) );
            OUString aUrl = aContent.createFolder( aDlg->GetName( ) );
            if ( !aUrl.isEmpty( ) )
            {
                pThis->_pFileView->CreatedFolder( aUrl, aDlg.GetName() );
                pThis->_pFileView->CreatedFolder( aUrl, aDlg->GetName() );
                bHandled = true;
            }
        }
@@ -1052,8 +1052,8 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid )
                    "$filename$",
                    aFileObj.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET)
                );
                MessageDialog aBox(pThis, aMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
                if ( aBox.Execute() != RET_YES )
                VclPtr<MessageDialog> aBox(new MessageDialog(pThis, aMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
                if ( aBox->Execute() != RET_YES )
                    return 0;
            }
            else
@@ -1097,8 +1097,8 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid )
                    }
                    sError = sError.replaceFirst( "$name$", sInvalidFile );

                    MessageDialog aError(pThis, sError);
                    aError.Execute();
                    VclPtr<MessageDialog> aError(new MessageDialog(pThis, sError));
                    aError->Execute();
                    return 0;
                }
            }
@@ -1250,13 +1250,13 @@ IMPL_STATIC_LINK ( SvtFileDialog, ConnectToServerPressed_Hdl, void*, EMPTYARG )
{
    pThis->_pFileView->EndInplaceEditing( false );

    PlaceEditDialog aDlg( pThis );
    short aRetCode = aDlg.Execute();
    VclPtr<PlaceEditDialog> aDlg(new PlaceEditDialog(pThis));
    short aRetCode = aDlg->Execute();

    switch (aRetCode) {
        case RET_OK :
        {
            PlacePtr newPlace = aDlg.GetPlace();
            PlacePtr newPlace = aDlg->GetPlace();
            pThis->_pImp->_pPlaces->AppendPlace(newPlace);

      break;
@@ -1886,8 +1886,8 @@ short SvtFileDialog::PrepareExecute()

                if ( bEmpty )
                {
                    MessageDialog aBox(this, SVT_RESSTR(STR_SVT_NOREMOVABLEDEVICE));
                    aBox.Execute();
                    VclPtr<MessageDialog> aBox(new MessageDialog(this, SVT_RESSTR(STR_SVT_NOREMOVABLEDEVICE)));
                    aBox->Execute();
                    return 0;
                }
            }
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index c2e8994..4238795 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -4205,11 +4205,11 @@ void AutoRecovery::impl_showFullDiscError()
    if (sBackupPath.getLength() < 1)
        sBackupPath = sBackupURL;

    ErrorBox dlgError(
    VclPtr<ErrorBox> dlgError(new ErrorBox(
        0, WB_OK,
        sMsg.replaceAll("%PATH", sBackupPath));
    dlgError.SetButtonText(dlgError.GetButtonId(0), sBtn);
    dlgError.Execute();
        sMsg.replaceAll("%PATH", sBackupPath)));
    dlgError->SetButtonText(dlgError->GetButtonId(0), sBtn);
    dlgError->Execute();
}

void AutoRecovery::impl_establishProgress(const AutoRecovery::TDocumentInfo&               rInfo    ,
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 41cc15e..2e9c96f 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -712,16 +712,16 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep
        lcl_CharPropertiesToItems( _rxReportControlFormat, *pDescriptor );

        {   // want the dialog to be destroyed before our set
            ORptPageDialog aDlg(pParent, pDescriptor.get(), "CharDialog");
            VclPtr<ORptPageDialog> aDlg(new ORptPageDialog(pParent, pDescriptor.get(), "CharDialog"));
            uno::Reference< report::XShape > xShape( _rxReportControlFormat, uno::UNO_QUERY );
            if ( xShape.is() )
                aDlg.RemoveTabPage("background");
            bSuccess = ( RET_OK == aDlg.Execute() );
                aDlg->RemoveTabPage("background");
            bSuccess = ( RET_OK == aDlg->Execute() );
            if ( bSuccess )
            {
                lcl_itemsToCharProperties( lcl_getReportControlFont( _rxReportControlFormat,WESTERN ),
                    lcl_getReportControlFont( _rxReportControlFormat,ASIAN ),
                    lcl_getReportControlFont( _rxReportControlFormat,COMPLEX ), *aDlg.GetOutputItemSet(), _out_rNewValues );
                    lcl_getReportControlFont( _rxReportControlFormat,COMPLEX ), *aDlg->GetOutputItemSet(), _out_rNewValues );
            }
        }
    }
@@ -1027,13 +1027,13 @@ bool openDialogFormula_nothrow( OUString& _in_out_rFormula
            CharClass aCC(_xContext, aLangTag);
            svl::SharedStringPool aStringPool(&aCC);

            FormulaDialog aDlg(
                pParent, xServiceFactory, pFormulaManager, aFormula.getUndecoratedContent(), _xRowSet, aStringPool);
            VclPtr<FormulaDialog> aDlg(new FormulaDialog(
                pParent, xServiceFactory, pFormulaManager, aFormula.getUndecoratedContent(), _xRowSet, aStringPool));

            bSuccess = aDlg.Execute() == RET_OK;
            bSuccess = aDlg->Execute() == RET_OK;
            if ( bSuccess )
            {
                OUString sFormula = aDlg.getCurrentFormula();
                OUString sFormula = aDlg->getCurrentFormula();
                if ( sFormula[0] == '=' )
                    _in_out_rFormula = "rpt:" + sFormula.copy(1);
                 else
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 549fa2f..c0d7373 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -1568,8 +1568,8 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
                uno::Reference< report::XFormattedField> xFormattedField(getDesignView()->getCurrentControlModel(),uno::UNO_QUERY);
                if ( xFormattedField.is() )
                {
                    ConditionalFormattingDialog aDlg( getView(), xFormattedField.get(), *this );
                    aDlg.Execute();
                    VclPtr<ConditionalFormattingDialog> aDlg(new ConditionalFormattingDialog( getView(), xFormattedField.get(), *this ));
                    aDlg->Execute();
                }
            }
            break;
@@ -1578,8 +1578,8 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
            {
                if ( !aArgs.getLength() )
                {
                    ODateTimeDialog aDlg(getView(),getDesignView()->getCurrentSection(),this);
                    aDlg.Execute();
                    VclPtr<ODateTimeDialog> aDlg(new ODateTimeDialog(getView(),getDesignView()->getCurrentSection(),this));
                    aDlg->Execute();
                }
                else
                    createDateTime(aArgs);
@@ -1590,8 +1590,8 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
            {
                if ( !aArgs.getLength() )
                {
                    OPageNumberDialog aDlg(getView(),m_xReportDefinition,this);
                    aDlg.Execute();
                    VclPtr<OPageNumberDialog> aDlg(new OPageNumberDialog(getView(),m_xReportDefinition,this));
                    aDlg->Execute();
                }
                else
                    createPageNumber(aArgs);
@@ -2481,15 +2481,15 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
        }

        {   // want the dialog to be destroyed before our set
            ORptPageDialog aDlg(getView(), pDescriptor.get(),_xSection.is()
            VclPtr<ORptPageDialog> aDlg(new ORptPageDialog(getView(), pDescriptor.get(),_xSection.is()
                ? OUString("BackgroundDialog")
                : OUString("PageDialog"));
            if (RET_OK == aDlg.Execute())
                : OUString("PageDialog")));
            if (RET_OK == aDlg->Execute())
            {

                // ItemSet->UNO
                // UNO-properties
                const SfxItemSet* pSet = aDlg.GetOutputItemSet();
                const SfxItemSet* pSet = aDlg->GetOutputItemSet();
                if ( _xSection.is() )
                {
                    const SfxPoolItem* pItem;
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 74756f5..74b233e 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -844,8 +844,8 @@ void ScDocument::UpdateExternalRefLinks(vcl::Window* pWin)
        aBuf.append(OUString(ScResId(SCSTR_EXTDOC_NOT_LOADED)));
        aBuf.appendAscii("\n\n");
        aBuf.append(aFile);
        MessageDialog aBox(pWin, aBuf.makeStringAndClear());
        aBox.Execute();
        VclPtr<MessageDialog> aBox(new MessageDialog(pWin, aBuf.makeStringAndClear()));
        aBox->Execute();
    }

    pExternalRefMgr->enableDocTimer(true);
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 532090d..3e8f153 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -3204,9 +3204,9 @@ uno::Reference<sdbc::XRowSet> ScDPCollection::DBCaches::createRowSet(
    }
    catch ( const sdbc::SQLException& rError )
    {
        //TODO: store error message
        InfoBox aInfoBox( 0, OUString(rError.Message) );
        aInfoBox.Execute();
        //! store error message
        VclPtr<InfoBox> aInfoBox(new InfoBox( 0, OUString(rError.Message) ) );
        aInfoBox->Execute();
    }
    catch ( uno::Exception& )
    {
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 1d95c3f..397fa90 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -253,8 +253,8 @@ bool ScValidationData::DoScript( const ScAddress& rPos, const OUString& rInput,
    {
        //TODO: different error message, if found, but not bAllowed ??

        MessageDialog aBox( pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND));
        aBox.Execute();
        VclPtr<MessageDialog> aBox(new MessageDialog( pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND)));
        aBox->Execute();
    }

    return bScriptReturnedFalse;
@@ -359,8 +359,8 @@ bool ScValidationData::DoMacro( const ScAddress& rPos, const OUString& rInput,
    {
        //TODO: different error message, if found, but not bAllowed ??

        MessageDialog aBox(pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND));
        aBox.Execute();
        VclPtr<MessageDialog> aBox(new MessageDialog(pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND)));
        aBox->Execute();
    }

    return bRet;
@@ -410,8 +410,8 @@ bool ScValidationData::DoError( vcl::Window* pParent, const OUString& rInput,
        }
    }

    MessBox aBox( pParent, WinBits(nStyle), aTitle, aMessage );
    sal_uInt16 nRet = aBox.Execute();
    VclPtr<MessBox> aBox(new MessBox( pParent, WinBits(nStyle), aTitle, aMessage ) );
    sal_uInt16 nRet = aBox->Execute();

    return ( eErrorStyle == SC_VALERR_STOP || nRet == RET_CANCEL );
}
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 05a409c..190a72a 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -662,15 +662,15 @@ void WorkbookGlobals::recalcFormulaCells()
        if (rDoc.IsUserInteractionEnabled())
        {
            // Ask the user if full re-calculation is desired.
            QueryBox aBox(
            VclPtr<QueryBox> aBox(new QueryBox(
                rDocSh.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
                ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS));
            aBox.SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));
                ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS)));
            aBox->SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));

            sal_Int32 nRet = aBox.Execute();
            sal_Int32 nRet = aBox->Execute();
            bHardRecalc = nRet == RET_YES;

            if (aBox.GetCheckBoxState())
            if (aBox->GetCheckBoxState())
            {
                // Always perform selected action in the future.
                std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx
index 26c2040..f3ee36a 100644
--- a/sc/source/ui/condformat/colorformat.cxx
+++ b/sc/source/ui/condformat/colorformat.cxx
@@ -264,8 +264,8 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, OkBtnHdl )
    if(bWarn)
    {
        //show warning message and don't close
        WarningBox aWarn(this, WB_OK, maStrWarnSameValue );
        aWarn.Execute();
        VclPtr<WarningBox> aWarn(new WarningBox(this, WB_OK, maStrWarnSameValue ));
        aWarn->Execute();
    }
    else
    {
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 8313dfa..dca70c5 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -504,9 +504,9 @@ IMPL_LINK_NOARG(ScDbNameDlg, RemoveBtnHdl)
        aBuf.append(aStrDelMsg.getToken(0, '#'));
        aBuf.append(aStrEntry);
        aBuf.append(aStrDelMsg.getToken(1, '#'));
        QueryBox aBox(this, WinBits(WB_YES_NO|WB_DEF_YES), aBuf.makeStringAndClear());
        VclPtr<QueryBox> aBox(new QueryBox(this, WinBits(WB_YES_NO|WB_DEF_YES), aBuf.makeStringAndClear()));

        if (RET_YES == aBox.Execute())
        if (RET_YES == aBox->Execute())
        {
            SCTAB nTab;
            SCCOL nColStart, nColEnd;
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index d1d5500..0cad636 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -459,9 +459,9 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,

        //! Link-Dialog muss Default-Parent setzen
        //  "kann keine Zeilen einfuegen"
        InfoBox aBox( Application::GetDefDialogParent(),
                        ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_2 ) );
        aBox.Execute();
        VclPtr<InfoBox> aBox(new InfoBox( Application::GetDefDialogParent(),
                        ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_2 ) ) );
        aBox->Execute();
    }

    //  aufraeumen
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index bb97463..7de3f6a 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1269,9 +1269,9 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
        // OutRange of pOldObj (pDestObj) is still old area
        if (!lcl_EmptyExcept(&rDoc, aNewOut, pOldObj->GetOutRange()))
        {
            QueryBox aBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
                             ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) );
            if (aBox.Execute() == RET_NO)
            VclPtr<QueryBox> aBox(new QueryBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
                             ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) ) );
            if (aBox->Execute() == RET_NO)
            {
                //! like above (not editable)
                *pOldObj = aUndoDPObj;
@@ -1421,11 +1421,11 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool 

        if (!bEmpty)
        {
            QueryBox aBox(
            VclPtr<QueryBox> aBox(new QueryBox(
                rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
                ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY));
                ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY)));

            if (aBox.Execute() == RET_NO)
            if (aBox->Execute() == RET_NO)
            {
                //! like above (not editable)
                return false;
@@ -1495,9 +1495,9 @@ bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi)
    {
        if (!lcl_EmptyExcept(&rDoc, aNewOut, rDPObj.GetOutRange()))
        {
            QueryBox aBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
                             ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) );
            if (aBox.Execute() == RET_NO)
            VclPtr<QueryBox> aBox(new QueryBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
                             ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) ) );
            if (aBox->Execute() == RET_NO)
            {
                rDPObj = aUndoDPObj;
                return false;
@@ -1593,9 +1593,9 @@ void ScDBDocFunc::UpdateImport( const OUString& rTarget, const svx::ODataAccessD
    const ScDBData* pData = rDBColl.getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(rTarget));
    if (!pData)
    {
        InfoBox aInfoBox(rDocShell.GetActiveDialogParent(),
                    ScGlobal::GetRscString( STR_TARGETNOTFOUND ) );
        aInfoBox.Execute();
        VclPtr<InfoBox> aInfoBox(new InfoBox(rDocShell.GetActiveDialogParent(),
                    ScGlobal::GetRscString( STR_TARGETNOTFOUND ) ));
        aInfoBox->Execute();
        return;
    }

diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index 6c0b237..ffd7139 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -635,8 +635,8 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
                nErrStringId = STR_MSSG_IMPORTDATA_0;
            aErrorMessage = ScGlobal::GetRscString( nErrStringId );
        }
        InfoBox aInfoBox( rDocShell.GetActiveDialogParent(), aErrorMessage );
        aInfoBox.Execute();
        VclPtr<InfoBox> aInfoBox(new InfoBox( rDocShell.GetActiveDialogParent(), aErrorMessage ) );
        aInfoBox->Execute();
    }

    delete pImportDoc;
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 753fd6de..f7b0907 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -3757,8 +3757,8 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi )
        {
            if (!bApi)
            {
                InfoBox aBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) );
                aBox.Execute();
                VclPtr<InfoBox> aBox(new InfoBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) ) );
                aBox->Execute();
            }
            return false;
        }
@@ -3787,8 +3787,8 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi )
        {
            if (!bApi)
            {
                InfoBox aBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) );
                aBox.Execute();
                VclPtr<InfoBox> aBox(new InfoBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) ) );
                aBox->Execute();
            }
            return false;
        }
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 959837b..f5a44e4 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -472,14 +472,14 @@ bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::uno::R
        {
            // Generator is not LibreOffice.  Ask if the user wants to perform
            // full re-calculation.
            QueryBox aBox(
            VclPtr<QueryBox> aBox(new QueryBox(
                GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
                ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS));
            aBox.SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));
                ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS)));
            aBox->SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));

            bHardRecalc = aBox.Execute() == RET_YES;
            bHardRecalc = aBox->Execute() == RET_YES;

            if (aBox.GetCheckBoxState())
            if (aBox->GetCheckBoxState())
            {
                // Always perform selected action in the future.
                std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
@@ -689,11 +689,11 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
                        ScAppOptions aAppOptions = SC_MOD()->GetAppOptions();
                        if ( aAppOptions.GetShowSharedDocumentWarning() )
                        {
                            WarningBox aBox( GetActiveDialogParent(), WinBits( WB_OK ),
                                ScGlobal::GetRscString( STR_SHARED_DOC_WARNING ) );
                            aBox.SetDefaultCheckBoxText();
                            aBox.Execute();
                            bool bChecked = aBox.GetCheckBoxState();
                            VclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_OK ),
                                ScGlobal::GetRscString( STR_SHARED_DOC_WARNING ) ) );
                            aBox->SetDefaultCheckBoxText();
                            aBox->Execute();
                            bool bChecked = aBox->GetCheckBoxState();
                            if ( bChecked )
                            {
                                aAppOptions.SetShowSharedDocumentWarning( !bChecked );
@@ -821,8 +821,8 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
                                            OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_SAVE_LATER ) );
                                            aMessage = aMessage.replaceFirst( "%1", aUserName );

                                            WarningBox aBox( GetActiveDialogParent(), WinBits( WB_RETRY_CANCEL | WB_DEF_RETRY ), aMessage );
                                            if ( aBox.Execute() == RET_RETRY )
                                            VclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_RETRY_CANCEL | WB_DEF_RETRY ), aMessage ) );
                                            if ( aBox->Execute() == RET_RETRY )
                                            {
                                                bRetry = true;
                                            }
@@ -896,9 +896,9 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
                                    }
                                    else
                                    {
                                        WarningBox aBox( GetActiveDialogParent(), WinBits( WB_OK ),
                                            ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) );
                                        aBox.Execute();
                                        VclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_OK ),
                                            ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) ) );
                                        aBox->Execute();

                                        SfxBindings* pBindings = GetViewBindings();
                                        if ( pBindings )
@@ -937,10 +937,10 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
                {
                    if ( GetDocument().GetExternalRefManager()->containsUnsavedReferences() )
                    {
                        WarningBox aBox( GetActiveDialogParent(), WinBits( WB_YES_NO ),
                                ScGlobal::GetRscString( STR_UNSAVED_EXT_REF ) );
                        VclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_YES_NO ),
                                ScGlobal::GetRscString( STR_UNSAVED_EXT_REF ) ) );

                        if( RET_NO == aBox.Execute())
                        if( RET_NO == aBox->Execute())
                        {
                            SetError( ERRCODE_IO_ABORT, OUString( OSL_LOG_PREFIX ) ); // this error code will produce no error message, but will break the further saving process
                        }
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 66c3a86..2ee7231 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -1202,12 +1202,12 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
                while ( bLoop )
                {
                    bLoop = false;
                    ScConflictsDlg aDlg( GetActiveDialogParent(), GetViewData(), &rSharedDoc, aConflictsList );
                    if ( aDlg.Execute() == RET_CANCEL )
                    VclPtr<ScConflictsDlg> aDlg(new ScConflictsDlg( GetActiveDialogParent(), GetViewData(), &rSharedDoc, aConflictsList ) );
                    if ( aDlg->Execute() == RET_CANCEL )
                    {
                        QueryBox aBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
                            ScGlobal::GetRscString( STR_DOC_WILLNOTBESAVED ) );
                        if ( aBox.Execute() == RET_YES )
                        VclPtr<QueryBox> aBox(new QueryBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
                            ScGlobal::GetRscString( STR_DOC_WILLNOTBESAVED ) ) );
                        if ( aBox->Execute() == RET_YES )
                        {
                            return false;
                        }
@@ -1320,8 +1320,8 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
        PostPaintExtras();
        PostPaintGridAll();

        InfoBox aInfoBox( GetActiveDialogParent(), ScGlobal::GetRscString( STR_DOC_UPDATED ) );
        aInfoBox.Execute();
        VclPtr<InfoBox> aInfoBox(new InfoBox( GetActiveDialogParent(), ScGlobal::GetRscString( STR_DOC_UPDATED ) ) );
        aInfoBox->Execute();
    }

    return ( pThisAction != NULL );
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index c2077f7..8a4d958 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -222,8 +222,8 @@ void ScDocShell::Execute( SfxRequest& rReq )
                    aMessage += sTarget;
                    aMessage += aTemplate.getToken( 1, '#' );

                    QueryBox aBox( 0, WinBits(WB_YES_NO | WB_DEF_YES), aMessage );
                    bDo = ( aBox.Execute() == RET_YES );
                    VclPtr<QueryBox> aBox(new QueryBox( 0, WinBits(WB_YES_NO | WB_DEF_YES), aMessage ));
                    bDo = ( aBox->Execute() == RET_YES );
                }

                if (bDo)
@@ -427,10 +427,10 @@ void ScDocShell::Execute( SfxRequest& rReq )

                if(nSet==LM_ON_DEMAND)
                {
                    QueryBox aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
                                             ScGlobal::GetRscString(STR_RELOAD_TABLES) );
                    VclPtr<QueryBox> aBox(new QueryBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
                                             ScGlobal::GetRscString(STR_RELOAD_TABLES) ) );

                    nDlgRet=aBox.Execute();
                    nDlgRet=aBox->Execute();
                }

                if (nDlgRet == RET_YES || nSet==LM_ALWAYS)
@@ -476,9 +476,9 @@ void ScDocShell::Execute( SfxRequest& rReq )
                    OSL_ENSURE(pViewSh,"SID_REIMPORT_AFTER_LOAD: keine View");
                    if (pViewSh && pDBColl)
                    {
                        QueryBox aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
                                                ScGlobal::GetRscString(STR_REIMPORT_AFTER_LOAD) );
                        if (aBox.Execute() == RET_YES)
                        VclPtr<QueryBox> aBox(new QueryBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
                                                ScGlobal::GetRscString(STR_REIMPORT_AFTER_LOAD) ) );
                        if (aBox->Execute() == RET_YES)
                        {
                            ScDBCollection::NamedDBs& rDBs = pDBColl->getNamedDBs();
                            ScDBCollection::NamedDBs::iterator itr = rDBs.begin(), itrEnd = rDBs.end();
@@ -575,10 +575,10 @@ void ScDocShell::Execute( SfxRequest& rReq )
                    if ( !pItem )
                    {
                        // no dialog on playing the macro
                        WarningBox aBox( pParent ? pParent : GetActiveDialogParent(),
                        VclPtr<WarningBox> aBox(new WarningBox( pParent ? pParent : GetActiveDialogParent(),
                            WinBits(WB_YES_NO | WB_DEF_NO),
                            ScGlobal::GetRscString( STR_END_REDLINING ) );
                        bDo = ( aBox.Execute() == RET_YES );
                            ScGlobal::GetRscString( STR_END_REDLINING ) ) );
                        bDo = ( aBox->Execute() == RET_YES );
                    }

                    if ( bDo )
@@ -644,10 +644,10 @@ void ScDocShell::Execute( SfxRequest& rReq )
                {
                    if ( nSlot == SID_DOCUMENT_COMPARE )
                    {   //! old changes trace will be lost
                        WarningBox aBox( GetActiveDialogParent(),
                        VclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(),
                            WinBits(WB_YES_NO | WB_DEF_NO),
                            ScGlobal::GetRscString( STR_END_REDLINING ) );
                        if( aBox.Execute() == RET_YES )
                            ScGlobal::GetRscString( STR_END_REDLINING ) ) );
                        if( aBox->Execute() == RET_YES )
                            bDo = ExecuteChangeProtectionDialog( NULL, true );
                        else
                            bDo = false;
@@ -913,10 +913,10 @@ void ScDocShell::Execute( SfxRequest& rReq )
                    break;
                }

                ScShareDocumentDlg aDlg( GetActiveDialogParent(), pViewData );
                if ( aDlg.Execute() == RET_OK )
                VclPtr<ScShareDocumentDlg> aDlg(new ScShareDocumentDlg( GetActiveDialogParent(), pViewData ) );
                if ( aDlg->Execute() == RET_OK )
                {
                    bool bSetShared = aDlg.IsShareDocumentChecked();
                    bool bSetShared = aDlg->IsShareDocumentChecked();
                    if ( bSetShared != static_cast< bool >( IsDocShared() ) )
                    {
                        if ( bSetShared )
@@ -924,9 +924,9 @@ void ScDocShell::Execute( SfxRequest& rReq )
                            bool bContinue = true;
                            if ( HasName() )
                            {
                                QueryBox aBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
                                    ScGlobal::GetRscString( STR_DOC_WILLBESAVED ) );
                                if ( aBox.Execute() == RET_NO )
                                VclPtr<QueryBox> aBox(new QueryBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
                                    ScGlobal::GetRscString( STR_DOC_WILLBESAVED ) ) );
                                if ( aBox->Execute() == RET_NO )
                                {
                                    bContinue = false;
                                }
@@ -1016,14 +1016,14 @@ void ScDocShell::Execute( SfxRequest& rReq )
                                        OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_TRY_LATER ) );
                                        aMessage = aMessage.replaceFirst( "%1", aUserName );

                                        WarningBox aBox( GetActiveDialogParent(), WinBits( WB_OK ), aMessage );
                                        aBox.Execute();
                                        VclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_OK ), aMessage ) );
                                        aBox->Execute();
                                    }
                                    else
                                    {
                                        WarningBox aBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
                                            ScGlobal::GetRscString( STR_DOC_DISABLESHARED ) );
                                        if ( aBox.Execute() == RET_YES )
                                        VclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
                                            ScGlobal::GetRscString( STR_DOC_DISABLESHARED ) ) );
                                        if ( aBox->Execute() == RET_YES )
                                        {
                                            xCloseable->close( sal_True );

@@ -1055,9 +1055,9 @@ void ScDocShell::Execute( SfxRequest& rReq )
                                else
                                {
                                    xCloseable->close( sal_True );
                                    WarningBox aBox( GetActiveDialogParent(), WinBits( WB_OK ),
                                        ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) );
                                    aBox.Execute();
                                    VclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_OK ),
                                        ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) ) );
                                    aBox->Execute();
                                }
                            }
                            catch ( uno::Exception& )
@@ -1156,9 +1156,9 @@ bool ScDocShell::ExecuteChangeProtectionDialog( vcl::Window* _pParent, bool bJus
                }
                else
                {
                    InfoBox aBox( GetActiveDialogParent(),
                        OUString( ScResId( SCSTR_WRONGPASSWORD ) ) );
                    aBox.Execute();
                    VclPtr<InfoBox> aBox(new InfoBox( GetActiveDialogParent(),
                        OUString( ScResId( SCSTR_WRONGPASSWORD ) ) ) );
                    aBox->Execute();
                }
            }
            else
@@ -1486,9 +1486,9 @@ void ScDocShell::PageStyleModified( const OUString& rStyleName, bool bApi )
        if (bWarn && !bApi)
        {
            ScWaitCursorOff aWaitOff( GetActiveDialogParent() );
            InfoBox aInfoBox(GetActiveDialogParent(),
                             ScGlobal::GetRscString(STR_PRINT_INVALID_AREA));
            aInfoBox.Execute();
            VclPtr<InfoBox> aInfoBox(new InfoBox(GetActiveDialogParent(),
                             ScGlobal::GetRscString(STR_PRINT_INVALID_AREA)));
            aInfoBox->Execute();
        }
    }

diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index 79167bc..20aa6e4 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -81,8 +81,8 @@ void ScDocShell::ErrorMessage( sal_uInt16 nGlobStrId )
        }
    }

    InfoBox aBox( pParent, ScGlobal::GetRscString( nGlobStrId ) );
    aBox.Execute();
    VclPtr<InfoBox> aBox(new InfoBox( pParent, ScGlobal::GetRscString( nGlobStrId ) ) );
    aBox->Execute();
    if (bFocus)
        pParent->GrabFocus();
}
@@ -487,9 +487,9 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, bool bRecord )

    if (bErr)
    {
        InfoBox aBox( GetActiveDialogParent(),
                ScGlobal::GetRscString( STR_CONSOLIDATE_ERR1 ) );
        aBox.Execute();
        VclPtr<InfoBox> aBox(new InfoBox( GetActiveDialogParent(),
                ScGlobal::GetRscString( STR_CONSOLIDATE_ERR1 ) ) );
        aBox->Execute();
        return;
    }

@@ -697,16 +697,16 @@ void ScDocShell::UseScenario( SCTAB nTab, const OUString& rName, bool bRecord )
            }
            else
            {
                InfoBox aBox(GetActiveDialogParent(),
                    ScGlobal::GetRscString( STR_PROTECTIONERR ) );
                aBox.Execute();
                VclPtr<InfoBox> aBox(new InfoBox( GetActiveDialogParent(),
                    ScGlobal::GetRscString( STR_PROTECTIONERR ) ) );
                aBox->Execute();
            }
        }
        else
        {
            InfoBox aBox(GetActiveDialogParent(),
                ScGlobal::GetRscString( STR_SCENARIO_NOTFOUND ) );
            aBox.Execute();
            VclPtr<InfoBox> aBox(new InfoBox(GetActiveDialogParent(),
                ScGlobal::GetRscString( STR_SCENARIO_NOTFOUND ) ) );
            aBox->Execute();
        }
    }
    else
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 92b6e2a..b308e74 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -531,8 +531,8 @@ void ScDocShell::CheckConfigOptions()
        if (pViewShell)
        {
            vcl::Window* pParent = pViewShell->GetFrameWin();
            InfoBox aBox(pParent, ScGlobal::GetRscString(STR_OPTIONS_WARN_SEPARATORS));
            aBox.Execute();
            VclPtr<InfoBox> aBox(new InfoBox(pParent, ScGlobal::GetRscString(STR_OPTIONS_WARN_SEPARATORS)));
            aBox->Execute();
        }

        // For now, this is the only option setting that could launch info
diff --git a/sc/source/ui/docshell/documentlinkmgr.cxx b/sc/source/ui/docshell/documentlinkmgr.cxx
index 7da7c38..69b5f79 100644
--- a/sc/source/ui/docshell/documentlinkmgr.cxx
+++ b/sc/source/ui/docshell/documentlinkmgr.cxx
@@ -165,8 +165,8 @@ bool DocumentLinkManager::updateDdeLinks( vcl::Window* pWin )
            aBuf.append(aElem);
            aBuf.appendAscii("\nType : ");
            aBuf.append(aType);
            MessageDialog aBox(pWin, aBuf.makeStringAndClear());
            aBox.Execute();
            VclPtr<MessageDialog> aBox(new MessageDialog(pWin, aBuf.makeStringAndClear()));
            aBox->Execute();
        }
    }

diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index ff22d8d..9c5bcc6 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -3020,9 +3020,9 @@ void ScExternalRefManager::Notify( SfxBroadcaster&, const SfxHint& rHint )
                {
                    SfxObjectShell* pObjShell = static_cast<const SfxEventHint&>( rHint ).GetObjShell();
                    ScDocShell* pDocShell = static_cast< ScDocShell* >( pObjShell );
                    WarningBox aBox(  pDocShell->GetActiveDialogParent(), WinBits( WB_OK ),
                                        ScGlobal::GetRscString( STR_CLOSE_WITH_UNSAVED_REFS ) );
                    aBox.Execute();
                    VclPtr<WarningBox> aBox(new WarningBox(  pDocShell->GetActiveDialogParent(), WinBits( WB_OK ),
                                        ScGlobal::GetRscString( STR_CLOSE_WITH_UNSAVED_REFS ) ) );
                    aBox->Execute();
                }
                break;
            case SFX_EVENT_SAVEDOCDONE:
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 806c1b4..dd830e2 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -210,9 +210,9 @@ bool ScImportExport::StartPaste()
        ScEditableTester aTester( pDoc, aRange );
        if ( !aTester.IsEditable() )
        {
            InfoBox aInfoBox(Application::GetDefDialogParent(),
                                ScGlobal::GetRscString( aTester.GetMessageId() ) );
            aInfoBox.Execute();
            VclPtr<InfoBox> aInfoBox(new InfoBox(Application::GetDefDialogParent(),
                                ScGlobal::GetRscString( aTester.GetMessageId() ) ) );
            aInfoBox->Execute();
            return false;
        }
    }
@@ -1452,8 +1452,8 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
            if ( !mbApi && nStartCol != nEndCol &&
                 !pDoc->IsBlockEmpty( nTab, nStartCol + 1, nStartRow, nEndCol, nRow ) )
            {
                ScReplaceWarnBox aBox( pDocSh->GetActiveDialogParent() );
                if ( aBox.Execute() != RET_YES )
                VclPtr<ScReplaceWarnBox> aBox(new ScReplaceWarnBox( pDocSh->GetActiveDialogParent() ));
                if ( aBox->Execute() != RET_YES )
                {
                    return false;
                }
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index d53741d..ebdd0c9 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -271,8 +271,8 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell*   pViewSh,
                // really store as link only?
                if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() )
                {
                    SvxLinkWarningDialog aWarnDlg(pWin,aFileName);
                    if( aWarnDlg.Execute() != RET_OK )
                    VclPtr<SvxLinkWarningDialog> aWarnDlg(new SvxLinkWarningDialog(pWin,aFileName));
                    if( aWarnDlg->Execute() != RET_OK )
                        bAsLink = false; // don't store as link
                }

diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index b98f92b..85793b1 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -200,10 +200,10 @@ void ScGraphicShell::ExecuteCompressGraphic( SfxRequest& )
        if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
        {
            SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj);
            CompressGraphicsDialog dialog( GetViewData()->GetDialogParent(), pGraphicObj, GetViewData()->GetBindings() );
            if ( dialog.Execute() == RET_OK )
            VclPtr<CompressGraphicsDialog> dialog(new CompressGraphicsDialog( GetViewData()->GetDialogParent(), pGraphicObj, GetViewData()->GetBindings() ) );
            if ( dialog->Execute() == RET_OK )
            {
                SdrGrafObj* pNewObject = dialog.GetCompressedSdrGrafObj();
                SdrGrafObj* pNewObject = dialog->GetCompressedSdrGrafObj();
                SdrPageView* pPageView = pView->GetSdrPageView();
                OUString aUndoString = pView->GetDescriptionOfMarkedObjects() + " Compress";
                pView->BegUndo( aUndoString );
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index e65e0cb..f55c867 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -768,15 +768,15 @@ bool ScOptSolverDlg::CallSolver()       // return true -> close dialog after cal
{
    // show progress dialog

    ScSolverProgressDialog aProgress( this );
    VclPtr<ScSolverProgressDialog> aProgress(new ScSolverProgressDialog( this ) );
    sal_Int32 nTimeout = 0;
    if ( FindTimeout( nTimeout ) )
        aProgress.SetTimeLimit( nTimeout );
        aProgress->SetTimeLimit( nTimeout );
    else
        aProgress.HideTimeLimit();
    aProgress.Show();
    aProgress.Update();
    aProgress.Sync();
        aProgress->HideTimeLimit();
    aProgress->Show();
    aProgress->Update();
    aProgress->Sync();
    // try to make sure the progress dialog is painted before continuing
    Application::Reschedule(true);

@@ -967,7 +967,7 @@ bool ScOptSolverDlg::CallSolver()       // return true -> close dialog after cal
    xSolver->solve();
    bool bSuccess = xSolver->getSuccess();

    aProgress.Hide();
    aProgress->Hide();
    bool bClose = false;
    bool bRestore = true;   // restore old values unless a solution is accepted
    if ( bSuccess )
@@ -993,8 +993,8 @@ bool ScOptSolverDlg::CallSolver()       // return true -> close dialog after cal
            static_cast<SCCOL>(aObjective.Column), static_cast<SCROW>(aObjective.Row),
            static_cast<SCTAB>(aObjective.Sheet));

        ScSolverSuccessDialog aDialog( this, aResultStr );
        if ( aDialog.Execute() == RET_OK )
        VclPtr<ScSolverSuccessDialog> aDialog(new ScSolverSuccessDialog( this, aResultStr ) );
        if ( aDialog->Execute() == RET_OK )
        {
            // keep results and close dialog
            bRestore = false;
@@ -1007,8 +1007,8 @@ bool ScOptSolverDlg::CallSolver()       // return true -> close dialog after cal
        uno::Reference<sheet::XSolverDescription> xDesc( xSolver, uno::UNO_QUERY );
        if ( xDesc.is() )
            aError = xDesc->getStatusDescription();         // error description from component
        ScSolverNoSolutionDialog aDialog( this, aError );
        aDialog.Execute();
        VclPtr<ScSolverNoSolutionDialog> aDialog(new ScSolverNoSolutionDialog( this, aError ) );
        aDialog->Execute();
    }

    if ( bRestore )         // restore old values
diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx
index d804ea1..df764de 100644
--- a/sc/source/ui/miscdlgs/retypepassdlg.cxx
+++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx
@@ -283,11 +283,11 @@ IMPL_LINK( ScRetypePassDlg, RetypeBtnHdl, PushButton*, pBtn )
        // What the ... !?
        return 0;

    ScRetypePassInputDlg aDlg(this, pProtected);
    if (aDlg.Execute() == RET_OK)
    VclPtr<ScRetypePassInputDlg> aDlg(new ScRetypePassInputDlg(this, pProtected));
    if (aDlg->Execute() == RET_OK)
    {
        // OK is pressed.  Update the protected item.
        if (aDlg.IsRemovePassword())
        if (aDlg->IsRemovePassword())
        {
            // Remove password from this item.
            pProtected->setPassword(OUString());
@@ -295,7 +295,7 @@ IMPL_LINK( ScRetypePassDlg, RetypeBtnHdl, PushButton*, pBtn )
        else
        {
            // Set a new password.
            OUString aNewPass = aDlg.GetNewPassword();
            OUString aNewPass = aDlg->GetNewPassword();
            pProtected->setPassword(aNewPass);
        }

diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index b23c275..6e5660c 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -314,23 +314,23 @@ void ScSolverOptionsDialog::EditOption()
            {
                if ( pStringItem->IsDouble() )
                {
                    ScSolverValueDialog aValDialog( this );
                    aValDialog.SetOptionName( pStringItem->GetText() );
                    aValDialog.SetValue( pStringItem->GetDoubleValue() );
                    if ( aValDialog.Execute() == RET_OK )
                    VclPtr<ScSolverValueDialog> aValDialog(new ScSolverValueDialog( this ));
                    aValDialog->SetOptionName( pStringItem->GetText() );
                    aValDialog->SetValue( pStringItem->GetDoubleValue() );
                    if ( aValDialog->Execute() == RET_OK )
                    {
                        pStringItem->SetDoubleValue( aValDialog.GetValue() );
                        pStringItem->SetDoubleValue( aValDialog->GetValue() );
                        m_pLbSettings->InvalidateEntry( pEntry );
                    }
                }
                else
                {
                    ScSolverIntegerDialog aIntDialog( this );
                    aIntDialog.SetOptionName( pStringItem->GetText() );
                    aIntDialog.SetValue( pStringItem->GetIntValue() );
                    if ( aIntDialog.Execute() == RET_OK )
                    VclPtr<ScSolverIntegerDialog> aIntDialog(new ScSolverIntegerDialog( this ));
                    aIntDialog->SetOptionName( pStringItem->GetText() );
                    aIntDialog->SetValue( pStringItem->GetIntValue() );
                    if ( aIntDialog->Execute() == RET_OK )
                    {
                        pStringItem->SetIntValue( aIntDialog.GetValue() );
                        pStringItem->SetIntValue( aIntDialog->GetValue() );
                        m_pLbSettings->InvalidateEntry( pEntry );
                    }
                }
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index a1c40ce..325cad6 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -122,10 +122,10 @@ void ScTpFormulaOptions::UpdateCustomCalcRadioButtons(bool bDefault)

void ScTpFormulaOptions::LaunchCustomCalcSettings()
{
    ScCalcOptionsDialog aDlg(this, maCurrentConfig);
    if (aDlg.Execute() == RET_OK)
    VclPtr<ScCalcOptionsDialog> aDlg(new ScCalcOptionsDialog(this, maCurrentConfig));
    if (aDlg->Execute() == RET_OK)
    {
        maCurrentConfig = aDlg.GetConfig();
        maCurrentConfig = aDlg->GetConfig();
    }
}

diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 2fb91e4..9f6486d 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1960,9 +1960,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )

                    if(!pCondFormatDlg && bContainsExistingCondFormat)
                    {
                        QueryBox aBox( pTabViewShell->GetDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
                               ScGlobal::GetRscString(STR_EDIT_EXISTING_COND_FORMATS) );
                        bool bEditExisting = aBox.Execute() == RET_YES;
                        VclPtr<QueryBox> aBox(new QueryBox( pTabViewShell->GetDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
                               ScGlobal::GetRscString(STR_EDIT_EXISTING_COND_FORMATS) ) );
                        bool bEditExisting = aBox->Execute() == RET_YES;
                        if(bEditExisting)
                        {
                            // differentiate between ranges where one conditional format is defined
@@ -2652,10 +2652,10 @@ void ScCellShell::ExecuteDataPilotDialog()
                    {
                        //  confirm selection if it contains SubTotal cells

                        QueryBox aBox( pTabViewShell->GetDialogParent(),
                        VclPtr<QueryBox> aBox(new QueryBox( pTabViewShell->GetDialogParent(),
                                        WinBits(WB_YES_NO | WB_DEF_YES),
                                        ScGlobal::GetRscString(STR_DATAPILOT_SUBTOTAL) );
                        if (aBox.Execute() == RET_NO)
                                        ScGlobal::GetRscString(STR_DATAPILOT_SUBTOTAL) ) );
                        if (aBox->Execute() == RET_NO)
                            bOK = false;
                    }
                    if (bOK)
@@ -2682,8 +2682,8 @@ void ScCellShell::ExecuteDataPilotDialog()
        if (nSrcErrorId)
        {
            // Error occurred during data creation.  Launch an error and bail out.
            InfoBox aBox(pTabViewShell->GetDialogParent(), ScGlobal::GetRscString(nSrcErrorId));
            aBox.Execute();
            VclPtr<InfoBox> aBox(new InfoBox(pTabViewShell->GetDialogParent(), ScGlobal::GetRscString(nSrcErrorId)));
            aBox->Execute();
            return;
        }

diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 6e5bf88..89a92c8 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -740,15 +740,15 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
            break;
        case SID_DATA_STREAMS:
        {
            sc::DataStreamDlg aDialog( GetViewData()->GetDocShell(), pTabViewShell->GetDialogParent() );
            VclPtr<sc::DataStreamDlg> aDialog(new sc::DataStreamDlg( GetViewData()->GetDocShell(), pTabViewShell->GetDialogParent() ) );
            ScDocument *pDoc = GetViewData()->GetDocument();
            sc::DocumentLinkManager& rMgr = pDoc->GetDocLinkManager();
            sc::DataStream* pStrm = rMgr.getDataStream();
            if (pStrm)
                aDialog.Init(*pStrm);
                aDialog->Init(*pStrm);

            if (aDialog.Execute() == RET_OK)
                aDialog.StartStream();
            if (aDialog->Execute() == RET_OK)
                aDialog->StartStream();
        }
        break;
        case SID_DATA_STREAMS_PLAY:
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index a302534..30176f8 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -422,9 +422,9 @@ void ScCellShell::Execute( SfxRequest& rReq )
                    }
                    else if( ! rReq.IsAPI() )
                    {
                        MessageDialog aErrorBox(pTabViewShell->GetDialogParent(),
                                            ScGlobal::GetRscString(STR_NOAREASELECTED));
                        aErrorBox.Execute();
                        VclPtr<MessageDialog> aErrorBox(new MessageDialog(pTabViewShell->GetDialogParent(),
                                            ScGlobal::GetRscString(STR_NOAREASELECTED)));
                        aErrorBox->Execute();
                    }
                }
                else
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index b2099de..bf5fd64 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -383,9 +383,9 @@ void ScDBFunc::ToggleAutoFilter()
        }
        else
        {
            MessageDialog aErrorBox(GetViewData().GetDialogParent(),
                                ScGlobal::GetRscString(STR_ERR_AUTOFILTER));
            aErrorBox.Execute();
            VclPtr<MessageDialog> aErrorBox(new MessageDialog(GetViewData().GetDialogParent(),
                                ScGlobal::GetRscString(STR_ERR_AUTOFILTER)));
            aErrorBox->Execute();
        }
    }

diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx
index ad7e6bc..2d39db2 100644
--- a/sc/source/ui/view/spelleng.cxx
+++ b/sc/source/ui/view/spelleng.cxx
@@ -305,10 +305,10 @@ bool ScSpellingEngine::ShowTableWrapDialog()
{
    vcl::Window* pParent = GetDialogParent();
    ScWaitCursorOff aWaitOff( pParent );
    MessBox aMsgBox( pParent, WinBits( WB_YES_NO | WB_DEF_YES ),
    VclPtr<MessBox> aMsgBox(new MessBox( pParent, WinBits( WB_YES_NO | WB_DEF_YES ),
        ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ),
        ScGlobal::GetRscString( STR_SPELLING_BEGIN_TAB) );
    return aMsgBox.Execute() == RET_YES;
        ScGlobal::GetRscString( STR_SPELLING_BEGIN_TAB) ) );
    return aMsgBox->Execute() == RET_YES;
}

void ScSpellingEngine::ShowFinishDialog()
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index fc9b1a8..9f10ad2 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -1422,8 +1422,8 @@ void ScTabView::ErrorMessage( sal_uInt16 nGlobStrId )
        }
    }

    InfoBox aBox( pParent, ScGlobal::GetRscString( nGlobStrId ) );
    aBox.Execute();
    VclPtr<InfoBox> aBox(new InfoBox( pParent, ScGlobal::GetRscString( nGlobStrId ) ) );
    aBox->Execute();
    if (bFocus)
        pParent->GrabFocus();
}
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 4b21f41..8b0ce27 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1074,11 +1074,11 @@ bool ScViewFunc::MergeCells( bool bApi, bool& rDoContents, bool bRecord, bool bC
    {
        if (!bApi)
        {
            MessBox aBox( GetViewData().GetDialogParent(),
            VclPtr<MessBox> aBox(new MessBox( GetViewData().GetDialogParent(),
                            WinBits(WB_YES_NO_CANCEL | WB_DEF_NO),
                            ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ),
                            ScGlobal::GetRscString( STR_MERGE_NOTEMPTY ) );
            sal_uInt16 nRetVal = aBox.Execute();
                            ScGlobal::GetRscString( STR_MERGE_NOTEMPTY ) ) );
            sal_uInt16 nRetVal = aBox->Execute();

            if ( nRetVal == RET_YES )
                rDoContents = true;
@@ -1771,10 +1771,10 @@ void ScViewFunc::Solve( const ScSolveParam& rParam )
            aMsgStr += ScGlobal::GetRscString( STR_MSSG_SOLVE_4 );
        }

        MessBox aBox( GetViewData().GetDialogParent(),
        VclPtr<MessBox> aBox(new MessBox( GetViewData().GetDialogParent(),
                        WinBits(WB_YES_NO | WB_DEF_NO),
                        ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), aMsgStr );
        sal_uInt16 nRetVal = aBox.Execute();
                        ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), aMsgStr ) );
        sal_uInt16 nRetVal = aBox->Execute();

        if ( RET_YES == nRetVal )
            EnterValue( nDestCol, nDestRow, nDestTab, nSolveResult );
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 992e480..0fa755d 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -832,8 +832,8 @@ bool checkDestRangeForOverwrite(const ScRangeList& rDestRanges, const ScDocument

    if (!bIsEmpty)
    {
        ScReplaceWarnBox aBox(pParentWnd);
        if (aBox.Execute() != RET_YES)
        VclPtr<ScReplaceWarnBox> aBox(new ScReplaceWarnBox(pParentWnd));
        if (aBox->Execute() != RET_YES)
        {
            //  changing the configuration is within the ScReplaceWarnBox
            return false;
@@ -1041,9 +1041,9 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
        {
            ScWaitCursorOff aWaitOff( GetFrameWin() );
            OUString aMessage = ScGlobal::GetRscString( STR_PASTE_BIGGER );
            QueryBox aBox( GetViewData().GetDialogParent(),
                            WinBits(WB_YES_NO | WB_DEF_NO), aMessage );
            if ( aBox.Execute() != RET_YES )
            VclPtr<QueryBox> aBox(new QueryBox( GetViewData().GetDialogParent(),
                            WinBits(WB_YES_NO | WB_DEF_NO), aMessage ) );
            if ( aBox->Execute() != RET_YES )
            {
                return false;
            }
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 0317fa4..9d66601 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -99,8 +99,8 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
        if (pActWin)
        {
            pEngine->SetPaperSize(Size(100000,100000));
            vcl::Window aWin( pActWin );
            EditView aEditView( pEngine.get(), &aWin );
            VclPtr<vcl::Window> aWin(new vcl::Window( pActWin ));
            EditView aEditView( pEngine.get(), aWin.get() );
            aEditView.SetOutputArea(Rectangle(0,0,100000,100000));

            // same method now for clipboard or drag&drop
@@ -387,8 +387,8 @@ void ScViewFunc::DoThesaurus( bool bRecord )
        LanguageType eLnge = ScViewUtil::GetEffLanguage( &rDoc, ScAddress( nCol, nRow, nTab ) );
        OUString aErr = SvtLanguageTable::GetLanguageString(eLnge);
        aErr += ScGlobal::GetRscString( STR_SPELLING_NO_LANG );
        InfoBox aBox( GetViewData().GetDialogParent(), aErr );
        aBox.Execute();
        VclPtr<InfoBox> aBox(new InfoBox( GetViewData().GetDialogParent(), aErr ) );
        aBox->Execute();
    }
    if (pThesaurusEngine->IsModified())
    {
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index ee87396..83e318d 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 727fba4..4127f74f 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 bd27577..c592a42 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 7edbf12..4a36503 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 fd21601..c5e3a2e 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 a58a444..5d5682b 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 cbbbc34..09887ec 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 98df417..14b88f9 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 a3da722..4d75e6c8 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 2be1601..a84cfd9 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 e36c564..92c83ea 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 d1c023e..8cfd56d 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 4b8d11f..184cc15 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 9065e1e..6383700 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 bd21323..d47f025 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 d368f96..e47b22a 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 e8f441c..cc94ac4 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 8253ee5..670bbff 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 1157b29..92a8808 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 b49fffc..22a4e84 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 469d1f8..b469511 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 c0ab66f..3bd57dc 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 c210857..e442aeb 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 31c9f08..c76556e 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 d224c32..6674507 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 e969c84..e15f196 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
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 582a4b8..a307e81 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -462,8 +462,8 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
        bool bNewWin = false;
        vcl::Window* pTopWin = GetTopWindow();

        SfxTemplateManagerDlg aTemplDlg;
        int nRet = aTemplDlg.Execute();
        VclPtr<SfxTemplateManagerDlg> aTemplDlg(new SfxTemplateManagerDlg);
        int nRet = aTemplDlg->Execute();
        if ( nRet == RET_OK )
        {
            rReq.Done();
@@ -831,11 +831,11 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
                SolarMutexGuard aGuard;
                vcl::Window *pWindow = SfxGetpApp()->GetTopWindow();

                MessageDialog aSecurityWarningBox(pWindow,
                VclPtr<MessageDialog> aSecurityWarningBox(new MessageDialog(pWindow,
                                                  SfxResId(STR_SECURITY_WARNING_NO_HYPERLINKS),
                                                  VCL_MESSAGE_WARNING);
                aSecurityWarningBox.SetText( SfxResId(RID_SECURITY_WARNING_TITLE).toString() );
                aSecurityWarningBox.Execute();
                                                  VCL_MESSAGE_WARNING));
                aSecurityWarningBox->SetText( SfxResId(RID_SECURITY_WARNING_TITLE).toString() );
                aSecurityWarningBox->Execute();
                return;
            }

diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index e9b32c5..6fece61 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -451,8 +451,8 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )

        case SID_SHOW_LICENSE:
        {
            LicenseDialog aDialog;
            aDialog.Execute();
            VclPtr<LicenseDialog> aDialog(new LicenseDialog);
            aDialog->Execute();
            break;
        }

@@ -539,16 +539,16 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )

        case SID_TEMPLATE_MANAGER:
        {
            SfxTemplateManagerDlg dlg;
            dlg.Execute();
            VclPtr<SfxTemplateManagerDlg> dlg(new SfxTemplateManagerDlg);
            dlg->Execute();
            bDone = true;
            break;
        }

        case SID_TEMPLATE_ADDRESSBOKSOURCE:
        {
            svt::AddressBookSourceDialog aDialog(GetTopWindow(), ::comphelper::getProcessComponentContext());
            aDialog.Execute();
            VclPtr<svt::AddressBookSourceDialog> aDialog(new svt::AddressBookSourceDialog(GetTopWindow(), ::comphelper::getProcessComponentContext()));
            aDialog->Execute();
            bDone = true;
            break;
        }
diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx
index 4a3c0be..f66a2b0 100644
--- a/sfx2/source/appl/impldde.cxx
+++ b/sfx2/source/appl/impldde.cxx
@@ -255,10 +255,10 @@ bool SvDDEObject::Connect( SvBaseLink * pSvLink )

void SvDDEObject::Edit( vcl::Window* pParent, sfx2::SvBaseLink* pBaseLink, const Link& rEndEditHdl )
{
    SvDDELinkEditDialog aDlg( pParent, pBaseLink );
    if ( RET_OK == aDlg.Execute() && rEndEditHdl.IsSet() )
    VclPtr<SvDDELinkEditDialog> aDlg(new SvDDELinkEditDialog(pParent, pBaseLink) );
    if ( RET_OK == aDlg->Execute() && rEndEditHdl.IsSet() )
    {
        OUString sCommand = aDlg.GetCmd();
        OUString sCommand = aDlg->GetCmd();
        rEndEditHdl.Call( &sCommand );
    }
}
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index eb800ba..9a80a2e 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1048,8 +1048,8 @@ IMPL_LINK_NOARG(SearchTabPage_Impl, SearchHdl)

        if ( aFactories.empty() )
        {
            MessageDialog aBox( this, SfxResId( STR_INFO_NOSEARCHRESULTS ), VCL_MESSAGE_INFO );
            aBox.Execute();
            VclPtr<MessageDialog> aBox(new MessageDialog(this, SfxResId( STR_INFO_NOSEARCHRESULTS ), VCL_MESSAGE_INFO) );
            aBox->Execute();
        }
    }
    return 0;
@@ -1194,15 +1194,15 @@ void BookmarksBox_Impl::DoAction( sal_uInt16 nAction )
            sal_Int32 nPos = GetSelectEntryPos();
            if ( nPos != LISTBOX_ENTRY_NOTFOUND )
            {
                SfxAddHelpBookmarkDialog_Impl aDlg( this, true );
                aDlg.SetTitle( GetEntry( nPos ) );
                if ( aDlg.Execute() == RET_OK )
                VclPtr<SfxAddHelpBookmarkDialog_Impl> aDlg(new SfxAddHelpBookmarkDialog_Impl(this, true));
                aDlg->SetTitle( GetEntry( nPos ) );
                if ( aDlg->Execute() == RET_OK )
                {
                    OUString* pURL = static_cast<OUString*>(GetEntryData( nPos ));
                    RemoveEntry( nPos );
                    OUString aImageURL = IMAGE_URL;
                    aImageURL += INetURLObject( *pURL ).GetHost();
                    nPos = InsertEntry( aDlg.GetTitle(), SvFileInformationManager::GetImage( INetURLObject(aImageURL), false ) );
                    nPos = InsertEntry( aDlg->GetTitle(), SvFileInformationManager::GetImage( INetURLObject(aImageURL), false ) );
                    SetEntryData( nPos, new OUString( *pURL ) );
                    SelectEntryPos( nPos );
                    delete pURL;
@@ -2288,8 +2288,8 @@ IMPL_LINK( SfxHelpTextWindow_Impl, FindHdl, sfx2::SearchDialog*, pDlg )
                else
                {
                    DBG_ASSERT( pSrchDlg, "no search dialog" );
                    MessageDialog aBox( pSrchDlg, SfxResId( STR_INFO_NOSEARCHTEXTFOUND ), VCL_MESSAGE_INFO );
                    aBox.Execute();
                    VclPtr<MessageDialog> aBox(new MessageDialog(pSrchDlg, SfxResId( STR_INFO_NOSEARCHTEXTFOUND ), VCL_MESSAGE_INFO) );
                    aBox->Execute();
                    pSrchDlg->SetFocusOnEdit();
                }
            }
@@ -3167,11 +3167,11 @@ void SfxHelpWindow_Impl::DoAction( sal_uInt16 nActionId )
                        if ( aAny >>= aValue )
                        {
                            OUString aTitle( aValue );
                            SfxAddHelpBookmarkDialog_Impl aDlg( this, false );
                            aDlg.SetTitle( aTitle );
                            if ( aDlg.Execute() == RET_OK )
                            VclPtr<SfxAddHelpBookmarkDialog_Impl> aDlg(new SfxAddHelpBookmarkDialog_Impl(this, false));
                            aDlg->SetTitle( aTitle );
                            if ( aDlg->Execute() == RET_OK )
                            {
                                aTitle = aDlg.GetTitle();
                                aTitle = aDlg->GetTitle();
                                pIndexWin->AddBookmarks( aTitle, aURL );
                            }
                        }
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx
index 2a533bb..10c4d70 100644
--- a/sfx2/source/appl/opengrf.cxx
+++ b/sfx2/source/appl/opengrf.cxx
@@ -158,8 +158,8 @@ short SvxOpenGraphicDialog::Execute()
            // could not load?
            if ( nFound == USHRT_MAX )
            {
                WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, SfxResId( SvxOpenGrfErr2ResId(nImpRet) ).toString() );
                bQuitLoop = aWarningBox.Execute()==RET_RETRY ? sal_False : sal_True;
                VclPtr<WarningBox> aWarningBox(new WarningBox(NULL, WB_3DLOOK | WB_RETRY_CANCEL, SfxResId( SvxOpenGrfErr2ResId(nImpRet) ).toString()) );
                bQuitLoop = aWarningBox->Execute() != RET_RETRY;
            }
            else
            {
diff --git a/sfx2/source/appl/openuriexternally.cxx b/sfx2/source/appl/openuriexternally.cxx
index ecc347e..7394b8f 100644
--- a/sfx2/source/appl/openuriexternally.cxx
+++ b/sfx2/source/appl/openuriexternally.cxx
@@ -44,10 +44,10 @@ bool sfx2::openUriExternally(
                "unexpected IllegalArgumentException: " + e.Message);
        }
        SolarMutexGuard g;
        MessageDialog eb(
            SfxGetpApp()->GetTopWindow(), SfxResId(STR_NO_ABS_URI_REF));
        eb.set_primary_text(eb.get_primary_text().replaceFirst("$(ARG1)", uri));
        eb.Execute();
        VclPtr<MessageDialog> eb(new MessageDialog(
            SfxGetpApp()->GetTopWindow(), SfxResId(STR_NO_ABS_URI_REF)));
        eb->set_primary_text(eb->get_primary_text().replaceFirst("$(ARG1)", uri));
        eb->Execute();
    } catch (css::system::SystemShellExecuteException &) {
        if (!handleSystemShellExecuteException) {
            throw;
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 247e80e..ac82b98 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -605,8 +605,8 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
        if ( impl_showOnlineHelp( aHelpURL ) )
            return true;

        NoHelpErrorBox aErrBox( const_cast< vcl::Window* >( pWindow ) );
        aErrBox.Execute();
        VclPtr<NoHelpErrorBox> aErrBox(new NoHelpErrorBox(const_cast< vcl::Window* >( pWindow )) );
        aErrBox->Execute();
        return false;
    }

diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 9e0f8de..02da90c 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -534,8 +534,8 @@ bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter )
        // Here could a  re-installation be offered
        OUString aText( SfxResId(STR_FILTER_NOT_INSTALLED).toString() );
        aText = aText.replaceFirst( "$(FILTER)", pFilter->GetUIName() );
        QueryBox aQuery( NULL, WB_YES_NO | WB_DEF_YES, aText );
        short nRet = aQuery.Execute();
        VclPtr<QueryBox> aQuery(new QueryBox(NULL, WB_YES_NO | WB_DEF_YES, aText) );
        short nRet = aQuery->Execute();
        if ( nRet == RET_YES )
        {
#ifdef DBG_UTIL
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index ff9e9e5..4af32d2 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -858,8 +858,8 @@ SfxMailModel::SendMailResult SfxMailModel::Send( const css::uno::Reference< css:
                    SolarMutexGuard aGuard;
                    vcl::Window* pParentWindow = VCLUnoHelper::GetWindow( xParentWindow );

                    MessageDialog aBox(pParentWindow, "ErrorFindEmailDialog", "sfx/ui/errorfindemaildialog.ui");
                    aBox.Execute();
                    VclPtr<MessageDialog> aBox(new MessageDialog(pParentWindow, "ErrorFindEmailDialog", "sfx/ui/errorfindemaildialog.ui"));
                    aBox->Execute();
                    eResult = SEND_MAIL_CANCELLED;
                }
                else
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 91dbe40..c1a713d 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -633,8 +633,8 @@ int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )

        if (!pStyle->SetName(comphelper::string::stripStart(m_pNameRw->GetText(), ' ')))
        {
            MessageDialog aBox( this, SfxResId( STR_TABPAGE_INVALIDNAME ), VCL_MESSAGE_INFO );
            aBox.Execute();
            VclPtr<MessageDialog> aBox(new MessageDialog(this, SfxResId( STR_TABPAGE_INVALIDNAME ), VCL_MESSAGE_INFO));
            aBox->Execute();
            m_pNameRw->GrabFocus();
            m_pNameRw->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
            return SfxTabPage::KEEP_PAGE;
@@ -650,8 +650,8 @@ int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
        {
            if ( !pStyle->SetFollow( aFollowEntry ) )
            {
                MessageDialog aBox( this, SfxResId( STR_TABPAGE_INVALIDSTYLE ), VCL_MESSAGE_INFO );
                aBox.Execute();
                VclPtr<MessageDialog> aBox(new MessageDialog(this, SfxResId( STR_TABPAGE_INVALIDSTYLE ), VCL_MESSAGE_INFO));
                aBox->Execute();
                m_pFollowLb->GrabFocus();
                return SfxTabPage::KEEP_PAGE;
            }
@@ -670,8 +670,8 @@ int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
        {
            if ( !pStyle->SetParent( aParentEntry ) )
            {
                MessageDialog aBox( this, SfxResId( STR_TABPAGE_INVALIDPARENT ), VCL_MESSAGE_INFO );
                aBox.Execute();
                VclPtr<MessageDialog> aBox(new MessageDialog(this, SfxResId( STR_TABPAGE_INVALIDPARENT ), VCL_MESSAGE_INFO));
                aBox->Execute();
                m_pBaseLb->GrabFocus();
                return SfxTabPage::KEEP_PAGE;
            }
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index ca67649..56ba128 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -71,8 +71,8 @@ IMPL_LINK_NOARG(SfxPasswordDialog, OKHdl)
        bConfirmFailed = true;
    if ( bConfirmFailed )
    {
        MessageDialog aBox(this, SfxResId(STR_ERROR_WRONG_CONFIRM));
        aBox.Execute();
        VclPtr<MessageDialog> aBox(new MessageDialog(this, SfxResId(STR_ERROR_WRONG_CONFIRM)));
        aBox->Execute();
        mpConfirm1ED->SetText( OUString() );
        mpConfirm1ED->GrabFocus();
    }
diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx
index 8760a08..d63d1df 100644
--- a/sfx2/source/dialog/recfloat.cxx
+++ b/sfx2/source/dialog/recfloat.cxx
@@ -152,9 +152,9 @@ bool SfxRecordingFloatWrapper_Impl::QueryClose()
    com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > xRecorder = pBindings->GetRecorder();
    if ( xRecorder.is() && !xRecorder->getRecordedMacro().isEmpty() )
    {
        QueryBox aBox( GetWindow(), WB_YES_NO | WB_DEF_NO , SfxResId(STR_MACRO_LOSS).toString() );
        aBox.SetText( SfxResId(STR_CANCEL_RECORDING).toString() );
        bRet = ( aBox.Execute() == RET_YES );
        VclPtr<QueryBox> aBox(new QueryBox(GetWindow(), WB_YES_NO | WB_DEF_NO , SfxResId(STR_MACRO_LOSS).toString()));
        aBox->SetText( SfxResId(STR_CANCEL_RECORDING).toString() );
        bRet = ( aBox->Execute() == RET_YES );
    }

    return bRet;
diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx
index 2ddf168..b70ca3c 100644
--- a/sfx2/source/dialog/securitypage.cxx
+++ b/sfx2/source/dialog/securitypage.cxx
@@ -99,13 +99,13 @@ static bool lcl_GetPassword(
    /*out*/OUString &rPassword )
{
    bool bRes = false;
    SfxPasswordDialog aPasswdDlg( pParent );
    aPasswdDlg.SetMinLen( 1 );
    VclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog(pParent));
    aPasswdDlg->SetMinLen( 1 );
    if (bProtect)
        aPasswdDlg.ShowExtras( SHOWEXTRAS_CONFIRM );
    if (RET_OK == aPasswdDlg.Execute() && !aPasswdDlg.GetPassword().isEmpty())
        aPasswdDlg->ShowExtras( SHOWEXTRAS_CONFIRM );
    if (RET_OK == aPasswdDlg->Execute() && !aPasswdDlg->GetPassword().isEmpty())
    {
        rPassword = aPasswdDlg.GetPassword();
        rPassword = aPasswdDlg->GetPassword();
        bRes = true;
    }
    return bRes;
@@ -335,9 +335,9 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, RecordChangesCBToggleHdl)
        bool bAlreadyDone = false;
        if (!m_bEndRedliningWarningDone)
        {
            WarningBox aBox( m_rMyTabPage.GetParent(), WinBits(WB_YES_NO | WB_DEF_NO),
                    m_aEndRedliningWarning );
            if (aBox.Execute() != RET_YES)
            VclPtr<WarningBox> aBox(new WarningBox(m_rMyTabPage.GetParent(), WinBits(WB_YES_NO | WB_DEF_NO),
                    m_aEndRedliningWarning ));
            if (aBox->Execute() != RET_YES)
                bAlreadyDone = true;
            else
                m_bEndRedliningWarningDone = true;
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index c10a822..3409772 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1818,13 +1818,13 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl(void *)
        if ( bUsedStyle )
        {
        #if defined UNX
            MessageDialog aBox(SfxGetpApp()->GetTopWindow(), aMsg,
                               VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
            VclPtr<MessageDialog> aBox(new MessageDialog(SfxGetpApp()->GetTopWindow(), aMsg,
                               VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
        #else
            MessageDialog aBox(GetWindow(), aMsg,
                               VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
            VclPtr<MessageDialog> aBox(new MessageDialog(GetWindow(), aMsg,
                               VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
        #endif
            aApproved = aBox.Execute() == RET_YES;
            aApproved = aBox->Execute() == RET_YES;
        }

        // if there are no used styles selected or the user approved the changes
diff --git a/sfx2/source/doc/QuerySaveDocument.cxx b/sfx2/source/doc/QuerySaveDocument.cxx
index 63d458f..9ab89a78 100644
--- a/sfx2/source/doc/QuerySaveDocument.cxx
+++ b/sfx2/source/doc/QuerySaveDocument.cxx
@@ -29,9 +29,9 @@ short ExecuteQuerySaveDocument(vcl::Window* _pParent, const OUString& _rTitle)
        return RET_NO;
    }

    MessageDialog aQBox(_pParent, "QuerySaveDialog", "sfx/ui/querysavedialog.ui");
    aQBox.set_primary_text(aQBox.get_primary_text().replaceFirst("$(DOC)", _rTitle));
    return aQBox.Execute();
    VclPtr<MessageDialog> aQBox(new MessageDialog(_pParent, "QuerySaveDialog", "sfx/ui/querysavedialog.ui"));
    aQBox->set_primary_text(aQBox->get_primary_text().replaceFirst("$(DOC)", _rTitle));
    return aQBox->Execute();
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx
index e51854e..f336c22 100644
--- a/sfx2/source/doc/docinsert.cxx
+++ b/sfx2/source/doc/docinsert.cxx
@@ -190,12 +190,12 @@ IMPL_LINK_NOARG(DocumentInserter, DialogClosedHdl)
                if ( ( aValue >>= bPassWord ) && bPassWord )
                {
                    // ask for the password
                    SfxPasswordDialog aPasswordDlg( NULL );
                    aPasswordDlg.ShowExtras( SHOWEXTRAS_CONFIRM );
                    short nRet = aPasswordDlg.Execute();
                    VclPtr<SfxPasswordDialog> aPasswordDlg( new SfxPasswordDialog(NULL) );
                    aPasswordDlg->ShowExtras( SHOWEXTRAS_CONFIRM );
                    short nRet = aPasswordDlg->Execute();
                    if ( RET_OK == nRet )
                    {
                        OUString aPasswd = aPasswordDlg.GetPassword();
                        OUString aPasswd = aPasswordDlg->GetPassword();
                        m_pItemSet->Put( SfxStringItem( SID_PASSWORD, aPasswd ) );
                    }
                    else
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index c757869..8e36955 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -666,9 +666,9 @@ sal_Int8 ModelData_Impl::CheckSaveAcceptable( sal_Int8 nCurStatus )
        {
            // notify the user that SaveAs is going to be done
            vcl::Window* pWin = SfxStoringHelper::GetModelWindow( m_xModel );
            MessageDialog aMessageBox(pWin, SfxResId(STR_NEW_FILENAME_SAVE),
                                      VCL_MESSAGE_QUESTION, VCL_BUTTONS_OK_CANCEL);
            if ( aMessageBox.Execute() == RET_OK )
            VclPtr<MessageDialog> aMessageBox(new MessageDialog(pWin, SfxResId(STR_NEW_FILENAME_SAVE),
                                      VCL_MESSAGE_QUESTION, VCL_BUTTONS_OK_CANCEL));
            if ( aMessageBox->Execute() == RET_OK )
                nResult = STATUS_SAVEAS;
            else
                nResult = STATUS_NO_ACTION;
@@ -1856,9 +1856,9 @@ bool SfxStoringHelper::WarnUnacceptableFormat( const uno::Reference< frame::XMod
        return true;

    vcl::Window* pWin = SfxStoringHelper::GetModelWindow( xModel );
    SfxAlienWarningDialog aDlg( pWin, aOldUIName );
    VclPtr<SfxAlienWarningDialog> aDlg(new SfxAlienWarningDialog(pWin, aOldUIName));

    return aDlg.Execute() == RET_OK;
    return aDlg->Execute() == RET_OK;
}

vcl::Window* SfxStoringHelper::GetModelWindow( const uno::Reference< frame::XModel >& xModel )
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 3f54b39..2f5b220 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -464,8 +464,8 @@ void SfxObjectShell::UpdateFromTemplate_Impl(  )
                    {
                        OUString sMessage( SfxResId(STR_QRYTEMPL_MESSAGE).toString() );
                        sMessage = sMessage.replaceAll( "$(ARG1)", aTemplName );
                        sfx2::QueryTemplateBox aBox( GetDialogParent(), sMessage );
                        if ( RET_YES == aBox.Execute() )
                        VclPtr<sfx2::QueryTemplateBox> aBox(new sfx2::QueryTemplateBox(GetDialogParent(), sMessage) );
                        if ( RET_YES == aBox->Execute() )
                            bLoad = true;
                    }

diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 03b4e3a..4ab2629 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -364,11 +364,11 @@ void SfxObjectShell::CheckIn( )
    {
        uno::Reference< document::XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY_THROW );
        // Pop up dialog to ask for comment and major
        SfxCheckinDialog checkinDlg( &GetFrame( )->GetWindow( ) );
        if ( checkinDlg.Execute( ) == RET_OK )
        VclPtr<SfxCheckinDialog> checkinDlg(new SfxCheckinDialog(&GetFrame( )->GetWindow( )));
        if ( checkinDlg->Execute( ) == RET_OK )
        {
            OUString sComment = checkinDlg.GetComment( );
            bool bMajor = checkinDlg.IsMajor( );
            OUString sComment = checkinDlg->GetComment( );
            bool bMajor = checkinDlg->IsMajor( );
            xCmisDoc->checkIn( bMajor, sComment );
            uno::Reference< util::XModifiable > xModifiable( GetModel( ), uno::UNO_QUERY );
            if ( xModifiable.is( ) )
@@ -857,10 +857,10 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
        case SID_DOCTEMPLATE:
        {
            // save as document templates
            SfxTemplateManagerDlg aDlg;
            aDlg.setDocumentModel(GetModel());
            aDlg.setSaveMode();
            aDlg.Execute();
            VclPtr<SfxTemplateManagerDlg> aDlg(new SfxTemplateManagerDlg);
            aDlg->setDocumentModel(GetModel());
            aDlg->setSaveMode();
            aDlg->Execute();

            break;
        }
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 91c3855..c68a4b9 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3019,8 +3019,8 @@ sal_Int16 SfxObjectShell::QueryHiddenInformation( HiddenWarningFact eFact, vcl::
        {
            sMessage += "\n";
            sMessage += SfxResId(nResId).toString();
            WarningBox aWBox( pParent, WB_YES_NO | WB_DEF_NO, sMessage );
            nRet = aWBox.Execute();
            VclPtr<WarningBox> aWBox(new WarningBox(pParent, WB_YES_NO | WB_DEF_NO, sMessage));
            nRet = aWBox->Execute();
        }
    }

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 3d40de2..b1c416c2 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -614,9 +614,9 @@ IMPL_LINK(SfxTemplateManagerDlg, RepositoryMenuSelectHdl, Menu*, pMenu)
    }
    else if (nMenuId == MNI_REPOSITORY_NEW)
    {
        PlaceEditDialog dlg(this);
        VclPtr<PlaceEditDialog> dlg(new PlaceEditDialog(this));

        if (dlg.Execute())
        if (dlg->Execute())
        {
            std::shared_ptr<Place> xPlace = dlg.GetPlace();

@@ -628,8 +628,8 @@ IMPL_LINK(SfxTemplateManagerDlg, RepositoryMenuSelectHdl, Menu*, pMenu)
            else
            {
                OUString aMsg(SfxResId(STR_MSG_ERROR_REPOSITORY_NAME).toString());
                aMsg = aMsg.replaceFirst("$1", xPlace->GetName());
                MessageDialog(this, aMsg).Execute();
                aMsg = aMsg.replaceFirst("$1",xPlace->GetName());
                VclPtr<MessageDialog>(new MessageDialog(this, aMsg))->Execute();
            }
        }
    }
@@ -1158,16 +1158,16 @@ void SfxTemplateManagerDlg::OnTemplateProperties ()
{
    const TemplateViewItem *pItem = static_cast<const TemplateViewItem*>(*maSelTemplates.begin());

    SfxTemplateInfoDlg aDlg;
    aDlg.loadDocument(pItem->getPath());
    aDlg.Execute();
    VclPtr<SfxTemplateInfoDlg> aDlg(new SfxTemplateInfoDlg);
    aDlg->loadDocument(pItem->getPath());
    aDlg->Execute();
}

void SfxTemplateManagerDlg::OnTemplateDelete ()
{
    MessageDialog aQueryDlg(this, SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
    VclPtr<MessageDialog> aQueryDlg(new MessageDialog(this, SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));

    if ( aQueryDlg.Execute() != RET_YES )
    if ( aQueryDlg->Execute() != RET_YES )
        return;

    OUString aTemplateList;
@@ -1236,13 +1236,13 @@ void SfxTemplateManagerDlg::OnTemplateAsDefault ()

void SfxTemplateManagerDlg::OnFolderNew()
{
    InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this);
    VclPtr<InputDialog> dlg(new InputDialog(SfxResId(STR_INPUT_NEW).toString(),this));

    int ret = dlg.Execute();
    int ret = dlg->Execute();

    if (ret)
    {
        OUString aName = dlg.getEntryText();
        OUString aName = dlg->getEntryText();

        mpCurView->createRegion(aName);
    }
@@ -1250,9 +1250,9 @@ void SfxTemplateManagerDlg::OnFolderNew()

void SfxTemplateManagerDlg::OnFolderDelete()
{
    MessageDialog aQueryDlg(this, SfxResId(STR_QMSG_SEL_FOLDER_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
    VclPtr<MessageDialog> aQueryDlg(new MessageDialog(this, SfxResId(STR_QMSG_SEL_FOLDER_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));

    if ( aQueryDlg.Execute() != RET_YES )
    if ( aQueryDlg->Execute() != RET_YES )
        return;

    OUString aFolderList;
@@ -1303,17 +1303,17 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
        return;
    }

    InputDialog aDlg(SfxResId(STR_INPUT_TEMPLATE_NEW).toString(),this);
    VclPtr<InputDialog> aDlg(new InputDialog(SfxResId(STR_INPUT_TEMPLATE_NEW).toString(),this));

    if (aDlg.Execute())
    if (aDlg->Execute())
    {
        OUString aName = aDlg.getEntryText();
        OUString aName = aDlg->getEntryText();

        if (!aName.isEmpty())
        {
            OUString aFolderList;
            OUString aQMsg(SfxResId(STR_QMSG_TEMPLATE_OVERWRITE).toString());
            MessageDialog aQueryDlg(this, OUString(), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
            VclPtr<MessageDialog> aQueryDlg(new MessageDialog(this, OUString(), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));

            if (mpLocalView->isNonRootRegionVisible())
            {
@@ -1322,9 +1322,9 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
                if (!mpLocalView->isTemplateNameUnique(nRegionItemId,aName))
                {
                    aQMsg = aQMsg.replaceFirst("$1",aName);
                    aQueryDlg.set_primary_text(aQMsg.replaceFirst("$2",mpLocalView->getCurRegionName()));
                    aQueryDlg->set_primary_text(aQMsg.replaceFirst("$2",mpLocalView->getCurRegionName()));

                    if (aQueryDlg.Execute() == RET_NO)
                    if (aQueryDlg->Execute() == RET_NO)
                        return;
                }

@@ -1341,9 +1341,9 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
                    if (!mpLocalView->isTemplateNameUnique(pItem->mnId,aName))
                    {
                        OUString aDQMsg = aQMsg.replaceFirst("$1",aName);
                        aQueryDlg.set_primary_text(aDQMsg.replaceFirst("$2",pItem->maTitle));
                        aQueryDlg->set_primary_text(aDQMsg.replaceFirst("$2",pItem->maTitle));

                        if (aQueryDlg.Execute() == RET_NO)
                        if (aQueryDlg->Execute() == RET_NO)
                            continue;
                    }

@@ -1441,13 +1441,13 @@ void SfxTemplateManagerDlg::localMoveTo(sal_uInt16 nMenuId)

    if (nMenuId == MNI_MOVE_NEW)
    {
        InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this);
        VclPtr<InputDialog> dlg(new InputDialog(SfxResId(STR_INPUT_NEW).toString(),this));

        int ret = dlg.Execute();
        int ret = dlg->Execute();

        if (ret)
        {
            OUString aName = dlg.getEntryText();
            OUString aName = dlg->getEntryText();

            if (!aName.isEmpty())
                nItemId = mpLocalView->createRegion(aName);
@@ -1489,13 +1489,13 @@ void SfxTemplateManagerDlg::remoteMoveTo(const sal_uInt16 nMenuId)

    if (nMenuId == MNI_MOVE_NEW)
    {
        InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this);
        VclPtr<InputDialog> dlg(new InputDialog(SfxResId(STR_INPUT_NEW).toString(),this));

        int ret = dlg.Execute();
        int ret = dlg->Execute();

        if (ret)
        {
            OUString aName = dlg.getEntryText();
            OUString aName = dlg->getEntryText();

            if (!aName.isEmpty())
                nItemId = mpLocalView->createRegion(aName);
@@ -1543,13 +1543,13 @@ void SfxTemplateManagerDlg::localSearchMoveTo(sal_uInt16 nMenuId)

    if (nMenuId == MNI_MOVE_NEW)
    {
        InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this);
        VclPtr<InputDialog> dlg(new InputDialog(SfxResId(STR_INPUT_NEW).toString(),this));

        int ret = dlg.Execute();
        int ret = dlg->Execute();

        if (ret)
        {
            OUString aName = dlg.getEntryText();
            OUString aName = dlg->getEntryText();

            if (!aName.isEmpty())
                nItemId = mpLocalView->createRegion(aName);
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 434b387..5d7685a 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -495,9 +495,9 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
                    if ( nOpenMode == SFX_STREAM_READWRITE && !rReq.IsAPI() )
                    {
                        // ::com::sun::star::sdbcx::User offering to open it as a template
                        MessageDialog aBox(&GetWindow(), SfxResId(STR_QUERY_OPENASTEMPLATE),
                                           VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
                        if ( RET_YES == aBox.Execute() )
                        VclPtr<MessageDialog> aBox(new MessageDialog(&GetWindow(), SfxResId(STR_QUERY_OPENASTEMPLATE),
                                           VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
                        if ( RET_YES == aBox->Execute() )
                        {
                            SfxApplication* pApp = SfxGetpApp();
                            SfxAllItemSet aSet( pApp->GetPool() );
@@ -579,9 +579,9 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
            if ( bDo && GetFrame().DocIsModified_Impl() &&
                 !rReq.IsAPI() && ( !pSilentItem || !pSilentItem->GetValue() ) )
            {
                MessageDialog aBox(&GetWindow(), SfxResId(STR_QUERY_LASTVERSION),
                                   VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
                bDo = ( RET_YES == aBox.Execute() );
                VclPtr<MessageDialog> aBox(new MessageDialog(&GetWindow(), SfxResId(STR_QUERY_LASTVERSION),
                                   VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
                bDo = ( RET_YES == aBox->Execute() );
            }

            if ( bDo )
@@ -756,9 +756,9 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
                    if ( bForEdit && SID_EDITDOC == rReq.GetSlot() )
                    {
                        // ask user for opening as template
                        MessageDialog aBox(&GetWindow(), SfxResId(STR_QUERY_OPENASTEMPLATE),
                                           VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
                        if ( RET_YES == aBox.Execute() )
                        VclPtr<MessageDialog> aBox(new MessageDialog(&GetWindow(), SfxResId(STR_QUERY_OPENASTEMPLATE),
                                           VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
                        if ( RET_YES == aBox->Execute() )
                        {
                            SfxAllItemSet aSet( pApp->GetPool() );
                            aSet.Put( SfxStringItem( SID_FILE_NAME, pMedium->GetName() ) );
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index abfbbbc..34b1690d 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -595,8 +595,8 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )

            if ( eResult == SfxMailModel::SEND_MAIL_ERROR )
            {
                MessageDialog aBox( SfxGetpApp()->GetTopWindow(), SfxResId( STR_ERROR_SEND_MAIL ), VCL_MESSAGE_INFO);
                aBox.Execute();
                VclPtr<MessageDialog> aBox(new MessageDialog(SfxGetpApp()->GetTopWindow(), SfxResId( STR_ERROR_SEND_MAIL ), VCL_MESSAGE_INFO));
                aBox->Execute();
                rReq.Ignore();
            }
            else
@@ -615,8 +615,8 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
            SfxMailModel::SendMailResult eResult = aModel.SaveAndSend( xFrame, OUString() );
            if( eResult == SfxMailModel::SEND_MAIL_ERROR )
            {
                    MessageDialog aBox( SfxGetpApp()->GetTopWindow(), SfxResId( STR_ERROR_SEND_MAIL ), VCL_MESSAGE_INFO);
                    aBox.Execute();
                    VclPtr<MessageDialog> aBox(new MessageDialog(SfxGetpApp()->GetTopWindow(), SfxResId( STR_ERROR_SEND_MAIL ), VCL_MESSAGE_INFO));
                    aBox->Execute();
                    rReq.Ignore();
            }
            else
@@ -1311,8 +1311,8 @@ bool SfxViewShell::PrepareClose
    {
        if ( bUI )
        {
            MessageDialog aInfoBox( &GetViewFrame()->GetWindow(), SfxResId( STR_CANT_CLOSE ), VCL_MESSAGE_INFO );
            aInfoBox.Execute();
            VclPtr<MessageDialog> aInfoBox(new MessageDialog(&GetViewFrame()->GetWindow(), SfxResId( STR_CANT_CLOSE ), VCL_MESSAGE_INFO ));
            aInfoBox->Execute();
        }

        return false;
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index e5ffac4..e36c2f5 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -879,16 +879,16 @@ void ViewTabListBox_Impl::DeleteEntries()
        if ( eResult != svtools::QUERYDELETE_ALL )
        {
            INetURLObject aObj( aURL );
            svtools::QueryDeleteDlg_Impl aDlg( NULL, aObj.GetName( INetURLObject::DECODE_WITH_CHARSET ) );
            VclPtr<svtools::QueryDeleteDlg_Impl> aDlg(new svtools::QueryDeleteDlg_Impl(NULL, aObj.GetName( INetURLObject::DECODE_WITH_CHARSET ) ));
            if ( sDialogPosition.getLength() )
                aDlg.SetWindowState( sDialogPosition );
                aDlg->SetWindowState( sDialogPosition );

            if ( GetSelectionCount() > 1 )
                aDlg.EnableAllButton();
                aDlg->EnableAllButton();

            eResult = aDlg.Execute();
            eResult = aDlg->Execute();

            sDialogPosition = aDlg.GetWindowState( );
            sDialogPosition = aDlg->GetWindowState( );
        }

        if ( ( eResult == svtools::QUERYDELETE_ALL ) ||
diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx
index 15e797d..fc71117 100644
--- a/svtools/source/java/javainteractionhandler.cxx
+++ b/svtools/source/java/javainteractionhandler.cxx
@@ -122,9 +122,9 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
           // No suitable JRE found
            SolarMutexGuard aSolarGuard;
            m_bJavaNotFound_Handled = true;
            MessageDialog aWarningBox(NULL, SvtResId(STR_WARNING_JAVANOTFOUND), VCL_MESSAGE_WARNING);
            aWarningBox.SetText(SvtResId(STR_WARNING_JAVANOTFOUND_TITLE));
            nResult = aWarningBox.Execute();
            VclPtr<MessageDialog> aWarningBox(new MessageDialog(NULL, SvtResId(STR_WARNING_JAVANOTFOUND), VCL_MESSAGE_WARNING));
            aWarningBox->SetText(SvtResId(STR_WARNING_JAVANOTFOUND_TITLE));
            nResult = aWarningBox->Execute();
        }
        else
        {
@@ -139,12 +139,12 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
            SolarMutexGuard aSolarGuard;
            m_bInvalidSettings_Handled = true;
#ifdef MACOSX
            MessageDialog aWarningBox(NULL, SvtResId(STR_WARNING_INVALIDJAVASETTINGS_MAC), VCL_MESSAGE_WARNING);
            VclPtr<MessageDialog> aWarningBox(new MessageDialog(NULL, SvtResId(STR_WARNING_INVALIDJAVASETTINGS_MAC), VCL_MESSAGE_WARNING));
#else
            MessageDialog aWarningBox(NULL, SvtResId(STR_WARNING_INVALIDJAVASETTINGS), VCL_MESSAGE_WARNING);
            VclPtr<MessageDialog> aWarningBox(new MessageDialog(NULL, SvtResId(STR_WARNING_INVALIDJAVASETTINGS), VCL_MESSAGE_WARNING));
#endif
            aWarningBox.SetText(SvtResId(STR_WARNING_INVALIDJAVASETTINGS_TITLE));
            nResult = aWarningBox.Execute();
            aWarningBox->SetText(SvtResId(STR_WARNING_INVALIDJAVASETTINGS_TITLE));
            nResult = aWarningBox->Execute();
        }
        else
        {
@@ -158,9 +158,9 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
            SolarMutexGuard aSolarGuard;
            m_bJavaDisabled_Handled = true;
            // Java disabled. Give user a chance to enable Java inside Office.
            MessageDialog aQueryBox(NULL, "JavaDisabledDialog",
                                    "svt/ui/javadisableddialog.ui");
            nResult = aQueryBox.Execute();
            VclPtr<MessageDialog> aQueryBox(new MessageDialog(NULL, "JavaDisabledDialog",
                                    "svt/ui/javadisableddialog.ui"));
            nResult = aQueryBox->Execute();
            if ( nResult == RET_YES )
            {
                jfw_setEnabled(sal_True);
@@ -182,12 +182,12 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
            SolarMutexGuard aSolarGuard;
            m_bVMCreationFailure_Handled = true;
#ifdef MACOSX
            MessageDialog aErrorBox(NULL, SvtResId(STR_ERROR_JVMCREATIONFAILED_MAC));
            VclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, SvtResId(STR_ERROR_JVMCREATIONFAILED_MAC)));
#else
            MessageDialog aErrorBox(NULL, SvtResId(STR_ERROR_JVMCREATIONFAILED));
            VclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, SvtResId(STR_ERROR_JVMCREATIONFAILED)));
#endif
            aErrorBox.SetText(SvtResId(STR_ERROR_JVMCREATIONFAILED_TITLE));
            nResult = aErrorBox.Execute();
            aErrorBox->SetText(SvtResId(STR_ERROR_JVMCREATIONFAILED_TITLE));
            nResult = aErrorBox->Execute();
        }
        else
        {
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index 25016d3..ad604f2 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -295,8 +295,8 @@ bool SvxSuperContourDlg::Close()

    if (m_pTbx1->IsItemEnabled(mnApplyId))
    {
        MessageDialog aQBox( this,"QuerySaveContourChangesDialog","svx/ui/querysavecontchangesdialog.ui");
        const long  nRet = aQBox.Execute();
        VclPtr<MessageDialog> aQBox(new MessageDialog( this,"QuerySaveContourChangesDialog","svx/ui/querysavecontchangesdialog.ui") );
        const long  nRet = aQBox->Execute();

        if ( nRet == RET_YES )
        {
@@ -427,9 +427,9 @@ IMPL_LINK( SvxSuperContourDlg, Tbx1ClickHdl, ToolBox*, pTbx )
    {
        if (m_pTbx1->IsItemChecked(mnWorkSpaceId))
        {
            MessageDialog aQBox( this,"QueryDeleteContourDialog","svx/ui/querydeletecontourdialog.ui");
            VclPtr<MessageDialog> aQBox(new MessageDialog( this,"QueryDeleteContourDialog","svx/ui/querydeletecontourdialog.ui" ));

            if ( !m_pContourWnd->IsContourChanged() || ( aQBox.Execute() == RET_YES ) )
            if ( !m_pContourWnd->IsContourChanged() || ( aQBox->Execute() == RET_YES ) )
                m_pContourWnd->SetWorkplaceMode( true );
            else
                m_pTbx1->CheckItem(mnWorkSpaceId, false);
@@ -501,10 +501,10 @@ IMPL_LINK( SvxSuperContourDlg, Tbx1ClickHdl, ToolBox*, pTbx )
            m_pStbStatus->Invalidate();
        else if ( bGraphicLinked )
        {
            MessageDialog aQBox(this, "QueryUnlinkGraphicsDialog",
                "svx/ui/queryunlinkgraphicsdialog.ui");
            VclPtr<MessageDialog> aQBox(new MessageDialog(this, "QueryUnlinkGraphicsDialog",
                "svx/ui/queryunlinkgraphicsdialog.ui"));

            if (aQBox.Execute() != RET_YES)
            if (aQBox->Execute() != RET_YES)
            {
                bPipette = false;
                m_pTbx1->CheckItem(mnPipetteId, bPipette);
@@ -695,7 +695,7 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow*, pWnd )

            if( !!aMask )
            {
                MessageDialog aQBox( this,"QueryNewContourDialog","svx/ui/querynewcontourdialog.ui");
                VclPtr<MessageDialog> aQBox(new MessageDialog( this,"QueryNewContourDialog","svx/ui/querynewcontourdialog.ui" ));
                bool        bNewContour;

                aRedoGraphic = Graphic();
@@ -703,7 +703,7 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow*, pWnd )
                aGraphic = Graphic( BitmapEx( aBmp, aMask ) );
                nGrfChanged++;

                bNewContour = ( aQBox.Execute() == RET_YES );
                bNewContour = ( aQBox->Execute() == RET_YES );
                pWnd->SetGraphic( aGraphic, bNewContour );

                if( bNewContour )
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index 274bbaa..9542c99 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -831,8 +831,8 @@ void RecovDocList::InitEntry(SvTreeListEntry* pEntry,

short impl_askUserForWizardCancel(vcl::Window* pParent, sal_Int16 nRes)
{
    MessageDialog aQuery(pParent, SVX_RES(nRes), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
    if (aQuery.Execute() == RET_YES)
    VclPtr<MessageDialog> aQuery(new MessageDialog(pParent, SVX_RES(nRes), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
    if (aQuery->Execute() == RET_YES)
        return DLG_RET_OK;
    else
        return DLG_RET_CANCEL;
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index d6c3e7e..534b016 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -234,8 +234,8 @@ bool SvxIMapDlg::Close()

    if ( m_pTbxIMapDlg1->IsItemEnabled( mnApplyId ) )
    {
        MessageDialog aQBox( this,"QueryModifyImageMapChangesDialog","svx/ui/querymodifyimagemapchangesdialog.ui");
        const long  nRet = aQBox.Execute();
        VclPtr<MessageDialog> aQBox(new MessageDialog(this,"QueryModifyImageMapChangesDialog","svx/ui/querymodifyimagemapchangesdialog.ui"));
        const long  nRet = aQBox->Execute();

        if( nRet == RET_YES )
        {
@@ -248,8 +248,8 @@ bool SvxIMapDlg::Close()
    }
    else if( pIMapWnd->IsChanged() )
    {
        MessageDialog aQBox( this,"QuerySaveImageMapChangesDialog","svx/ui/querysaveimagemapchangesdialog.ui");
        const long  nRet = aQBox.Execute();
        VclPtr<MessageDialog> aQBox(new MessageDialog(this,"QuerySaveImageMapChangesDialog","svx/ui/querysaveimagemapchangesdialog.ui"));
        const long  nRet = aQBox->Execute();

        if( nRet == RET_YES )
            bRet = DoSave();
diff --git a/svx/source/form/databaselocationinput.cxx b/svx/source/form/databaselocationinput.cxx
index 8e32e9c..d59a5d7 100644
--- a/svx/source/form/databaselocationinput.cxx
+++ b/svx/source/form/databaselocationinput.cxx
@@ -128,8 +128,8 @@ namespace svx
        {
            if ( ::utl::UCBContentHelper::Exists( sURL ) )
            {
                QueryBox aBox( m_rLocationInput.GetSystemWindow(), WB_YES_NO, SVX_RESSTR(RID_STR_ALREADYEXISTOVERWRITE) );
                if ( aBox.Execute() != RET_YES )
                VclPtr<QueryBox> aBox(new QueryBox( m_rLocationInput.GetSystemWindow(), WB_YES_NO, SVX_RESSTR(RID_STR_ALREADYEXISTOVERWRITE) ) );
                if ( aBox->Execute() != RET_YES )
                    return false;
            }
        }
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 2554578..148a747 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -469,12 +469,12 @@ namespace svxform
            DBG_ASSERT( xModel.is(), "XFormsPage::DoToolBoxAction(): Action without model" );
            if ( DGTSubmission == m_eGroup )
            {
                AddSubmissionDialog aDlg( this, NULL, m_xUIHelper );
                if ( aDlg.Execute() == RET_OK && aDlg.GetNewSubmission().is() )
                VclPtr<AddSubmissionDialog> aDlg(new AddSubmissionDialog( this, NULL, m_xUIHelper ));
                if ( aDlg->Execute() == RET_OK && aDlg->GetNewSubmission().is() )
                {
                    try
                    {
                        Reference< css::xforms::XSubmission > xNewSubmission = aDlg.GetNewSubmission();
                        Reference< css::xforms::XSubmission > xNewSubmission = aDlg->GetNewSubmission();
                        Reference< XSet > xSubmissions( xModel->getSubmissions(), UNO_QUERY );
                        xSubmissions->insert( makeAny( xNewSubmission ) );
                        Reference< XPropertySet > xNewPropSet( xNewSubmission, UNO_QUERY );
@@ -501,8 +501,8 @@ namespace svxform
                {
                    if ( !m_sInstanceURL.isEmpty() )
                    {
                        LinkedInstanceWarningBox aMsgBox( this );
                        if ( aMsgBox.Execute() != RET_OK )
                        VclPtr<LinkedInstanceWarningBox> aMsgBox(new LinkedInstanceWarningBox( this ));
                        if ( aMsgBox->Execute() != RET_OK )
                            return bHandled;
                    }

@@ -596,10 +596,10 @@ namespace svxform
                    }
                }

                AddDataItemDialog aDlg( this, pNode, m_xUIHelper );
                aDlg.SetText( SVX_RESSTR( nResId ) );
                aDlg.InitText( eType );
                short nReturn = aDlg.Execute();
                VclPtr<AddDataItemDialog> aDlg(new AddDataItemDialog( this, pNode, m_xUIHelper ));
                aDlg->SetText( SVX_RESSTR( nResId ) );
                aDlg->InitText( eType );
                short nReturn = aDlg->Execute();
                if (  DGTInstance == m_eGroup )
                {
                    if ( RET_OK == nReturn )
@@ -664,12 +664,12 @@ namespace svxform
                {
                    if ( DGTInstance == m_eGroup && !m_sInstanceURL.isEmpty() )
                    {
                        LinkedInstanceWarningBox aMsgBox( this );
                        if ( aMsgBox.Execute() != RET_OK )
                        VclPtr<LinkedInstanceWarningBox> aMsgBox(new LinkedInstanceWarningBox( this ));
                        if ( aMsgBox->Execute() != RET_OK )
                            return bHandled;
                    }

                    AddDataItemDialog aDlg( this, pNode, m_xUIHelper );
                    VclPtr<AddDataItemDialog> aDlg(new AddDataItemDialog( this, pNode, m_xUIHelper ));
                    DataItemType eType = DITElement;
                    sal_uInt16 nResId = RID_STR_DATANAV_EDIT_ELEMENT;
                    if ( pNode && pNode->m_xNode.is() )
@@ -693,9 +693,9 @@ namespace svxform
                        nResId = RID_STR_DATANAV_EDIT_BINDING;
                        eType = DITBinding;
                    }
                    aDlg.SetText( SVX_RESSTR( nResId ) );
                    aDlg.InitText( eType );
                    if ( aDlg.Execute() == RET_OK )
                    aDlg->SetText( SVX_RESSTR( nResId ) );
                    aDlg->InitText( eType );
                    if ( aDlg->Execute() == RET_OK )
                    {
                        // Set the new name
                        OUString sNewName;
@@ -735,9 +735,9 @@ namespace svxform
                }
                else
                {
                    AddSubmissionDialog aDlg( this, pNode, m_xUIHelper );
                    aDlg.SetText( SVX_RESSTR( RID_STR_DATANAV_EDIT_SUBMISSION ) );
                    if ( aDlg.Execute() == RET_OK )
                    VclPtr<AddSubmissionDialog> aDlg(new AddSubmissionDialog( this, pNode, m_xUIHelper ));
                    aDlg->SetText( SVX_RESSTR( RID_STR_DATANAV_EDIT_SUBMISSION ) );
                    if ( aDlg->Execute() == RET_OK )
                    {
                        EditEntry( pNode->m_xPropSet );
                        bIsDocModified = true;
@@ -750,8 +750,8 @@ namespace svxform
            bHandled = true;
            if ( DGTInstance == m_eGroup && !m_sInstanceURL.isEmpty() )
            {
                LinkedInstanceWarningBox aMsgBox( this );
                if ( aMsgBox.Execute() != RET_OK )
                VclPtr<LinkedInstanceWarningBox> aMsgBox(new LinkedInstanceWarningBox( this ));
                if ( aMsgBox->Execute() != RET_OK )
                    return bHandled;
            }
            bIsDocModified = RemoveEntry();
@@ -942,12 +942,12 @@ namespace svxform
                    bool bIsElement = ( eChildType == css::xml::dom::NodeType_ELEMENT_NODE );
                    sal_uInt16 nResId = bIsElement ? RID_STR_QRY_REMOVE_ELEMENT : RID_STR_QRY_REMOVE_ATTRIBUTE;
                    OUString sVar = bIsElement ? OUString(ELEMENTNAME) : OUString(ATTRIBUTENAME);
                    MessageDialog aQBox(this, SVX_RES(nResId), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
                    OUString sMessText = aQBox.get_primary_text();
                    VclPtr<MessageDialog> aQBox(new MessageDialog(this, SVX_RES(nResId), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
                    OUString sMessText = aQBox->get_primary_text();
                    sMessText = sMessText.replaceFirst(
                        sVar, m_xUIHelper->getNodeDisplayName( pNode->m_xNode, sal_False ) );
                    aQBox.set_primary_text(sMessText);
                    if ( aQBox.Execute() == RET_YES )
                    aQBox->set_primary_text(sMessText);
                    if ( aQBox->Execute() == RET_YES )
                    {
                        SvTreeListEntry* pParent = m_pItemList->GetParent( pEntry );
                        DBG_ASSERT( pParent, "XFormsPage::RemoveEntry(): no parent entry" );
@@ -984,12 +984,12 @@ namespace svxform
                {
                    SAL_WARN( "svx.form", "XFormsPage::RemoveEntry(): exception caught" );
                }
                MessageDialog aQBox(this, SVX_RES(nResId),
                                    VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
                OUString sMessText = aQBox.get_primary_text();
                VclPtr<MessageDialog> aQBox(new MessageDialog(this, SVX_RES(nResId),
                                    VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
                OUString sMessText = aQBox->get_primary_text();
                sMessText = sMessText.replaceFirst( sSearch, sName);
                aQBox.set_primary_text(sMessText);
                if ( aQBox.Execute() == RET_YES )
                aQBox->set_primary_text(sMessText);
                if ( aQBox->Execute() == RET_YES )
                {
                    try
                    {
@@ -1475,22 +1475,22 @@ namespace svxform
            OString sIdent(pBtn->GetCurItemIdent());
            if (sIdent == "modelsadd")
            {
                AddModelDialog aDlg( this, false );
                VclPtr<AddModelDialog> aDlg(new AddModelDialog( this, false ));
                bool bShowDialog = true;
                while ( bShowDialog )
                {
                    bShowDialog = false;
                    if ( aDlg.Execute() == RET_OK )
                    if ( aDlg->Execute() == RET_OK )
                    {
                        OUString sNewName = aDlg.GetName();
                        bool bDocumentData = aDlg.GetModifyDoc();
                        OUString sNewName = aDlg->GetName();
                        bool bDocumentData = aDlg->GetModifyDoc();

                        if ( m_pModelsBox->GetEntryPos( sNewName ) != LISTBOX_ENTRY_NOTFOUND )
                        {
                            // error: model name already exists
                            MessageDialog aErrBox( this, SVX_RES( RID_STR_DOUBLE_MODELNAME ) );
                            aErrBox.set_primary_text(aErrBox.get_primary_text().replaceFirst(MSG_VARIABLE, sNewName));
                            aErrBox.Execute();
                            VclPtr<MessageDialog> aErrBox(new MessageDialog( this, SVX_RES( RID_STR_DOUBLE_MODELNAME ) ));
                            aErrBox->set_primary_text(aErrBox->get_primary_text().replaceFirst(MSG_VARIABLE, sNewName));
                            aErrBox->Execute();
                            bShowDialog = true;
                        }
                        else
@@ -1521,8 +1521,8 @@ namespace svxform
            }
            else if (sIdent == "modelsedit")
            {
                AddModelDialog aDlg( this, true );
                aDlg.SetName( sSelectedModel );
                VclPtr<AddModelDialog> aDlg(new AddModelDialog( this, true ));
                aDlg->SetName( sSelectedModel );

                bool bDocumentData( false );
                try
@@ -1539,13 +1539,13 @@ namespace svxform
                {
                    DBG_UNHANDLED_EXCEPTION();
                }
                aDlg.SetModifyDoc( bDocumentData );
                aDlg->SetModifyDoc( bDocumentData );

                if ( aDlg.Execute() == RET_OK )
                if ( aDlg->Execute() == RET_OK )
                {
                    if ( aDlg.GetModifyDoc() != bool( bDocumentData ) )
                    if ( aDlg->GetModifyDoc() != bool( bDocumentData ) )
                    {
                        bDocumentData = aDlg.GetModifyDoc();
                        bDocumentData = aDlg->GetModifyDoc();
                        try
                        {
                            Reference< css::xforms::XFormsSupplier > xFormsSupp( m_xFrameModel, UNO_QUERY_THROW );
@@ -1562,7 +1562,7 @@ namespace svxform
                        }
                    }

                    OUString sNewName = aDlg.GetName();
                    OUString sNewName = aDlg->GetName();
                    if ( !sNewName.isEmpty() && ( sNewName != sSelectedModel ) )
                    {
                        try
@@ -1583,12 +1583,12 @@ namespace svxform
            }
            else if (sIdent == "modelsremove")
            {
                MessageDialog aQBox(this, SVX_RES( RID_STR_QRY_REMOVE_MODEL),
                                    VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
                OUString sText = aQBox.get_primary_text();
                VclPtr<MessageDialog> aQBox(new MessageDialog(this, SVX_RES( RID_STR_QRY_REMOVE_MODEL),
                                    VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
                OUString sText = aQBox->get_primary_text();
                sText = sText.replaceFirst( MODELNAME, sSelectedModel );
                aQBox.set_primary_text(sText);
                if ( aQBox.Execute() == RET_YES )
                aQBox->set_primary_text(sText);
                if ( aQBox->Execute() == RET_YES )
                {
                    try
                    {
@@ -1616,13 +1616,13 @@ namespace svxform
            OString sIdent(pBtn->GetCurItemIdent());
            if (sIdent == "instancesadd")
            {
                AddInstanceDialog aDlg( this, false );
                if ( aDlg.Execute() == RET_OK )
                VclPtr<AddInstanceDialog> aDlg(new AddInstanceDialog( this, false ));
                if ( aDlg->Execute() == RET_OK )
                {
                    sal_uInt16 nInst = GetNewPageId();
                    OUString sName = aDlg.GetName();
                    OUString sURL = aDlg.GetURL();
                    bool bLinkOnce = aDlg.IsLinkInstance();
                    OUString sName = aDlg->GetName();
                    OUString sURL = aDlg->GetURL();
                    bool bLinkOnce = aDlg->IsLinkInstance();
                    try
                    {
                        Reference< css::xml::dom::XDocument > xNewInst =
@@ -1648,16 +1648,16 @@ namespace svxform
                XFormsPage* pPage = GetCurrentPage( nId );
                if ( pPage )
                {
                    AddInstanceDialog aDlg( this, true );
                    aDlg.SetName( pPage->GetInstanceName() );
                    aDlg.SetURL( pPage->GetInstanceURL() );
                    aDlg.SetLinkInstance( pPage->GetLinkOnce() );
                    OUString sOldName = aDlg.GetName();
                    if ( aDlg.Execute() == RET_OK )
                    VclPtr<AddInstanceDialog> aDlg(new AddInstanceDialog( this, true ));
                    aDlg->SetName( pPage->GetInstanceName() );
                    aDlg->SetURL( pPage->GetInstanceURL() );
                    aDlg->SetLinkInstance( pPage->GetLinkOnce() );
                    OUString sOldName = aDlg->GetName();
                    if ( aDlg->Execute() == RET_OK )
                    {
                        OUString sNewName = aDlg.GetName();
                        OUString sURL = aDlg.GetURL();
                        bool bLinkOnce = aDlg.IsLinkInstance();
                        OUString sNewName = aDlg->GetName();
                        OUString sURL = aDlg->GetURL();
                        bool bLinkOnce = aDlg->IsLinkInstance();
                        try
                        {
                            xUIHelper->renameInstance( sOldName,
@@ -1684,12 +1684,12 @@ namespace svxform
                if ( pPage )
                {
                    OUString sInstName = pPage->GetInstanceName();
                    MessageDialog aQBox(this, SVX_RES(RID_STR_QRY_REMOVE_INSTANCE),
                                        VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
                    OUString sMessText = aQBox.get_primary_text();
                    VclPtr<MessageDialog> aQBox(new MessageDialog(this, SVX_RES(RID_STR_QRY_REMOVE_INSTANCE),
                                        VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
                    OUString sMessText = aQBox->get_primary_text();
                    sMessText = sMessText.replaceFirst( INSTANCENAME, sInstName );
                    aQBox.set_primary_text(sMessText);
                    if ( aQBox.Execute() == RET_YES )
                    aQBox->set_primary_text(sMessText);
                    if ( aQBox->Execute() == RET_YES )
                    {
                        bool bDoRemove = false;
                        if (IsAdditionalPage(nId))
@@ -2364,7 +2364,7 @@ namespace svxform
            sPropName = PN_READONLY_EXPR;
        else if (m_pCalculateBtn == pBtn)
            sPropName = PN_CALCULATE_EXPR;
        AddConditionDialog aDlg( this, sPropName, m_xTempBinding );
        VclPtr<AddConditionDialog> aDlg(new AddConditionDialog(this, sPropName, m_xTempBinding));
        bool bIsDefBtn = ( m_pDefaultBtn == pBtn );
        OUString sCondition;
        if ( bIsDefBtn )
@@ -2376,11 +2376,11 @@ namespace svxform
                sTemp = TRUE_VALUE;
            sCondition = sTemp;
        }
        aDlg.SetCondition( sCondition );
        aDlg->SetCondition( sCondition );

        if ( aDlg.Execute() == RET_OK )
        if ( aDlg->Execute() == RET_OK )
        {
            OUString sNewCondition = aDlg.GetCondition();
            OUString sNewCondition = aDlg->GetCondition();
            if ( bIsDefBtn )
                m_pDefaultED->SetText( sNewCondition );
            else
@@ -2438,9 +2438,9 @@ namespace svxform
             ( bIsHandleBinding && sNewName.isEmpty() ) )
        {
            // Error and don't close the dialog
            MessageDialog aErrBox( this, SVX_RES( RID_STR_INVALID_XMLNAME ) );
            aErrBox.set_primary_text(aErrBox.get_primary_text().replaceFirst(MSG_VARIABLE, sNewName));
            aErrBox.Execute();
            VclPtr<MessageDialog> aErrBox(new MessageDialog( this, SVX_RES( RID_STR_INVALID_XMLNAME ) ) );
            aErrBox->set_primary_text(aErrBox->get_primary_text().replaceFirst(MSG_VARIABLE, sNewName));
            aErrBox->Execute();
            return 0;
        }

@@ -2791,8 +2791,8 @@ namespace svxform
        {
            SAL_WARN( "svx.form", "AddDataItemDialog::EditHdl(): exception caught" );
        }
        NamespaceItemDialog aDlg( this, xNameContnr );
        aDlg.Execute();
        VclPtr<NamespaceItemDialog> aDlg(new NamespaceItemDialog( this, xNameContnr ) );
        aDlg->Execute();
        try
        {
            m_xBinding->setPropertyValue( PN_BINDING_NAMESPACES, makeAny( xNameContnr ) );
@@ -2916,32 +2916,32 @@ namespace svxform
    {
        if ( m_pAddNamespaceBtn == pBtn )
        {
            ManageNamespaceDialog aDlg( this, m_pConditionDlg, false );
            if ( aDlg.Execute() == RET_OK )
            VclPtr<ManageNamespaceDialog> aDlg( new ManageNamespaceDialog(this, m_pConditionDlg, false) );
            if ( aDlg->Execute() == RET_OK )
            {
                OUString sEntry = aDlg.GetPrefix();
                OUString sEntry = aDlg->GetPrefix();
                sEntry += "\t";
                sEntry += aDlg.GetURL();
                sEntry += aDlg->GetURL();
                m_pNamespacesList->InsertEntry( sEntry );
            }
        }
        else if ( m_pEditNamespaceBtn == pBtn )
        {
            ManageNamespaceDialog aDlg( this, m_pConditionDlg, true );
            VclPtr<ManageNamespaceDialog> aDlg(new ManageNamespaceDialog( this, m_pConditionDlg, true ));
            SvTreeListEntry* pEntry = m_pNamespacesList->FirstSelected();
            DBG_ASSERT( pEntry, "NamespaceItemDialog::ClickHdl(): no entry" );
            OUString sPrefix( SvTabListBox::GetEntryText( pEntry, 0 ) );
            aDlg.SetNamespace(
            aDlg->SetNamespace(
                sPrefix,
                SvTabListBox::GetEntryText( pEntry, 1 ) );
            if ( aDlg.Execute() == RET_OK )
            if ( aDlg->Execute() == RET_OK )
            {
                // if a prefix was changed, mark the old prefix as 'removed'
                if( sPrefix != aDlg.GetPrefix() )
                if( sPrefix != aDlg->GetPrefix() )
                    m_aRemovedList.push_back( sPrefix );

                m_pNamespacesList->SetEntryText( aDlg.GetPrefix(), pEntry, 0 );
                m_pNamespacesList->SetEntryText( aDlg.GetURL(), pEntry, 1 );
                m_pNamespacesList->SetEntryText( aDlg->GetPrefix(), pEntry, 0 );
                m_pNamespacesList->SetEntryText( aDlg->GetURL(), pEntry, 1 );
            }
        }
        else if ( m_pDeleteNamespaceBtn == pBtn )
@@ -3048,9 +3048,9 @@ namespace svxform
        {
            if ( !m_pConditionDlg->GetUIHelper()->isValidPrefixName( sPrefix ) )
            {
                MessageDialog aErrBox( this, SVX_RES( RID_STR_INVALID_XMLPREFIX ) );
                aErrBox.set_primary_text(aErrBox.get_primary_text().replaceFirst(MSG_VARIABLE, sPrefix));
                aErrBox.Execute();
                VclPtr<MessageDialog> aErrBox(new MessageDialog(this, SVX_RES( RID_STR_INVALID_XMLPREFIX ) ) );
                aErrBox->set_primary_text(aErrBox->get_primary_text().replaceFirst(MSG_VARIABLE, sPrefix));
                aErrBox->Execute();
                return 0;
            }
        }
@@ -3103,10 +3103,10 @@ namespace svxform

    IMPL_LINK_NOARG(AddSubmissionDialog, RefHdl)
    {
        AddConditionDialog aDlg( this, PN_BINDING_EXPR, m_xTempBinding );
        aDlg.SetCondition( m_pRefED->GetText() );
        if ( aDlg.Execute() == RET_OK )
            m_pRefED->SetText( aDlg.GetCondition() );
        VclPtr<AddConditionDialog> aDlg(new AddConditionDialog(this, PN_BINDING_EXPR, m_xTempBinding ));
        aDlg->SetCondition( m_pRefED->GetText() );
        if ( aDlg->Execute() == RET_OK )
            m_pRefED->SetText( aDlg->GetCondition() );

        return 0;
    }
@@ -3117,9 +3117,9 @@ namespace svxform
        OUString sName(m_pNameED->GetText());
        if(sName.isEmpty()) {

            MessageDialog aErrorBox(this,SVX_RES(RID_STR_EMPTY_SUBMISSIONNAME));
            aErrorBox.set_primary_text( Application::GetDisplayName() );
            aErrorBox.Execute();
            VclPtr<MessageDialog> aErrorBox(new MessageDialog(this,SVX_RES(RID_STR_EMPTY_SUBMISSIONNAME)));
            aErrorBox->set_primary_text( Application::GetDisplayName() );
            aErrorBox->Execute();
            return 0;
        }

diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx
index fa95fc6..e2e04b2 100644
--- a/svx/source/form/fmshell.cxx
+++ b/svx/source/form/fmshell.cxx
@@ -269,9 +269,9 @@ bool FmFormShell::PrepareClose(bool bUI)

                    if ( bModified && bUI )
                    {
                        MessageDialog aQry(NULL, "SaveModifiedDialog",
                                           "svx/ui/savemodifieddialog.ui");
                        switch (aQry.Execute())
                        VclPtr<MessageDialog> aQry(new MessageDialog(NULL, "SaveModifiedDialog",
                                           "svx/ui/savemodifieddialog.ui"));
                        switch (aQry->Execute())
                        {
                            case RET_NO:
                                bModified = false;
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index 9eb9e5b..e03c344 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -732,23 +732,23 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView )
                    aCropDlgAttr.Put( SdrGrafCropItem( aLTSize.Width(), aLTSize.Height(),
                                                    aRBSize.Width(), aRBSize.Height() ) );

                    SfxSingleTabDialog  aCropDialog(
                    VclPtr<SfxSingleTabDialog>  aCropDialog(new SfxSingleTabDialog(
                        SfxViewShell::Current() ? SfxViewShell::Current()->GetWindow() : NULL,
                        aCropDlgAttr);
                        aCropDlgAttr));
                    const OUString aCropStr(SVX_RESSTR(RID_SVXSTR_GRAFCROP));

                    SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
                    assert(pFact && "Dialog creation failed!");
                    ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_GRFCROP );
                    assert(fnCreatePage && "Dialog creation failed!");
                    SfxTabPage* pTabPage = (*fnCreatePage)( aCropDialog.get_content_area(), &aCropDlgAttr );
                    SfxTabPage* pTabPage = (*fnCreatePage)( aCropDialog->get_content_area(), &aCropDlgAttr );

                    pTabPage->SetText( aCropStr );
                    aCropDialog.SetTabPage( pTabPage );
                    aCropDialog->SetTabPage( pTabPage );

                    if( aCropDialog.Execute() == RET_OK )
                    if( aCropDialog->Execute() == RET_OK )
                    {
                        const SfxItemSet* pOutAttr = aCropDialog.GetOutputItemSet();
                        const SfxItemSet* pOutAttr = aCropDialog->GetOutputItemSet();

                        if( pOutAttr )
                        {
diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx
index 70fbe73..91d1678 100644
--- a/svx/source/toolbars/extrusionbar.cxx
+++ b/svx/source/toolbars/extrusionbar.cxx
@@ -583,11 +583,11 @@ void ExtrusionBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rB
                double fDepth = static_cast<const SvxDoubleItem*>(rReq.GetArgs()->GetItem(SID_EXTRUSION_DEPTH))->GetValue();
                FieldUnit eUnit = (FieldUnit)static_cast<const SfxUInt16Item*>(rReq.GetArgs()->GetItem(SID_ATTR_METRIC))->GetValue();

                ExtrusionDepthDialog aDlg( 0L, fDepth, eUnit );
                sal_uInt16 nRet = aDlg.Execute();
                VclPtr<ExtrusionDepthDialog> aDlg(new ExtrusionDepthDialog(0L, fDepth, eUnit));
                sal_uInt16 nRet = aDlg->Execute();
                if( nRet != 0 )
                {
                    fDepth = aDlg.getDepth();
                    fDepth = aDlg->getDepth();

                    SvxDoubleItem aItem( fDepth, SID_EXTRUSION_DEPTH );
                    SfxPoolItem* aItems[] = { &aItem, 0 };
diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx
index 9177eb8..0948dcb 100644
--- a/svx/source/toolbars/fontworkbar.cxx
+++ b/svx/source/toolbars/fontworkbar.cxx
@@ -432,8 +432,8 @@ void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBi
    {
        case SID_FONTWORK_GALLERY_FLOATER:
        {
            FontWorkGalleryDialog aDlg( pSdrView, ImpGetViewWin(pSdrView), nSID );
            aDlg.Execute();
            VclPtr<FontWorkGalleryDialog> aDlg(new FontWorkGalleryDialog( pSdrView, ImpGetViewWin(pSdrView), nSID ) );
            aDlg->Execute();
        }
        break;

@@ -491,11 +491,11 @@ void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBi
            if( rReq.GetArgs() && ( rReq.GetArgs()->GetItemState( SID_FONTWORK_CHARACTER_SPACING ) == SfxItemState::SET ) )
            {
                sal_Int32 nCharSpacing = static_cast<const SfxInt32Item*>(rReq.GetArgs()->GetItem(SID_FONTWORK_CHARACTER_SPACING))->GetValue();
                FontworkCharacterSpacingDialog aDlg( 0L, nCharSpacing );
                sal_uInt16 nRet = aDlg.Execute();
                VclPtr<FontworkCharacterSpacingDialog> aDlg(new FontworkCharacterSpacingDialog( 0L, nCharSpacing ) );
                sal_uInt16 nRet = aDlg->Execute();
                if( nRet != 0 )
                {
                    SfxInt32Item aItem( SID_FONTWORK_CHARACTER_SPACING, aDlg.getScale() );
                    SfxInt32Item aItem( SID_FONTWORK_CHARACTER_SPACING, aDlg->getScale() );
                    SfxPoolItem* aItems[] = { &aItem, 0 };
                    rBindings.Execute( SID_FONTWORK_CHARACTER_SPACING, (const SfxPoolItem**)aItems );
                }
diff --git a/svx/workben/pixelctl.cxx b/svx/workben/pixelctl.cxx
index 4144488..731e6dc 100644
--- a/svx/workben/pixelctl.cxx
+++ b/svx/workben/pixelctl.cxx
@@ -98,9 +98,9 @@ public:

void Main()
{
    MyWin aMainWin( NULL, WB_STDWORK );
    aMainWin.SetText( OUString( "SvxPixelCtl" ) );
    aMainWin.Show();
    VclPtr<MyWin> aMainWin(new MyWin( NULL, WB_STDWORK ));
    aMainWin->SetText( OUString( "SvxPixelCtl" ) );
    aMainWin->Show();

    Application::Execute();
}
diff --git a/sw/qa/tiledrendering/tiledrendering.cxx b/sw/qa/tiledrendering/tiledrendering.cxx
new file mode 100644
index 0000000..f3c245d
--- /dev/null
+++ b/sw/qa/tiledrendering/tiledrendering.cxx
@@ -0,0 +1,202 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#include <comphelper/processfactory.hxx>
#include <cppuhelper/bootstrap.hxx>
#include <osl/file.hxx>
#include <vcl/builder.hxx>
#include <vcl/dialog.hxx>
#include <vcl/help.hxx>
#include <vcl/svapp.hxx>
#include <vcl/vclmain.hxx>
#include <vcl/field.hxx>
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <vcl/virdev.hxx>
#include <sfx2/filedlghelper.hxx>
#include <swmodule.hxx>
#include <wrtsh.hxx>

#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ucb/UniversalContentBroker.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>

using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ui::dialogs;
using namespace ::sfx2;

class TiledRenderingApp : public Application
{
private:
    uno::Reference<uno::XComponentContext> xContext;
    uno::Reference<lang::XMultiComponentFactory> xFactory;
    uno::Reference<lang::XMultiServiceFactory> xSFactory;
    uno::Reference<uno::XInterface> xDesktop;
    uno::Reference<frame::XComponentLoader> xLoader;
    uno::Reference<lang::XComponent> xComponent;
public:
    virtual void Init() SAL_OVERRIDE;
    virtual int Main() SAL_OVERRIDE;
    void Open(OUString & aFileUrl);
};

class TiledRenderingDialog: public ModalDialog
{
private:
    TiledRenderingApp *mpApp;
    NumericField *mpContextWidth;
    NumericField *mpContextHeight;
    NumericField *mpTilePosX;
    NumericField *mpTilePosY;
    NumericField *mpTileWidth;
    NumericField *mpTileHeight;
    FixedImage *mpImage;

public:
    TiledRenderingDialog(TiledRenderingApp * app) :
        ModalDialog(DIALOG_NO_PARENT, "TiledRendering", "qa/sw/ui/tiledrendering.ui"),
        mpApp(app)
    {
        PushButton * renderButton;
        get(renderButton, "buttonRenderTile");
        renderButton->SetClickHdl( LINK( this, TiledRenderingDialog, RenderHdl));

        PushButton * chooseDocumentButton;
        get(chooseDocumentButton, "buttonChooseDocument");
        chooseDocumentButton->SetClickHdl( LINK( this, TiledRenderingDialog, ChooseDocumentHdl));

        SetStyle(GetStyle()|WB_CLOSEABLE);

        get(mpContextWidth, "spinContextWidth");
        get(mpContextHeight, "spinContextHeight");
        get(mpTilePosX, "spinTilePosX");
        get(mpTilePosY, "spinTilePosY");
        get(mpTileWidth, "spinTileWidth");
        get(mpTileHeight, "spinTileHeight");
        get(mpImage, "imageTile");
    }

    virtual ~TiledRenderingDialog()
    {
    }

    DECL_LINK ( RenderHdl, Button * );
    DECL_LINK ( ChooseDocumentHdl, Button * );
};

IMPL_LINK ( TiledRenderingDialog, RenderHdl, Button *, EMPTYARG )
{
    int contextWidth = mpContextWidth->GetValue();
    int contextHeight = mpContextHeight->GetValue();
    int tilePosX = mpTilePosX->GetValue();
    int tilePosY = mpTilePosY->GetValue();
    long tileWidth = mpTileWidth->GetValue();
    long tileHeight = mpTileHeight->GetValue();

    // do the same thing we are doing in touch_lo_draw_tile()
    SwWrtShell *pViewShell = GetActiveWrtShell();

    if (pViewShell)
    {
        // TODO create a VirtualDevice based on SystemGraphicsData instead so
        // that we get direct rendering; something like:
        //
        // SystemGraphicsData aData;
        // [setup the aData]
        // VirtualDevice aDevice(&aData, [color depth]);
        VirtualDevice aDevice;

        // paint to it
        pViewShell->PaintTile(aDevice, contextWidth, contextHeight, tilePosX, tilePosY, tileWidth, tileHeight);

        // copy the aDevice content to mpImage
        Bitmap aBitmap(aDevice.GetBitmap(aDevice.PixelToLogic(Point(0,0)), aDevice.PixelToLogic(Size(contextWidth, contextHeight))));
        mpImage->SetImage(Image(aBitmap));

        // update the dialog size
        setOptimalLayoutSize();
    }

    return 1;
}

IMPL_LINK ( TiledRenderingDialog,  ChooseDocumentHdl, Button *, EMPTYARG )
{
    FileDialogHelper aDlgHelper( TemplateDescription::FILEOPEN_SIMPLE, 0 );
    uno::Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker();
    if( aDlgHelper.Execute() == ERRCODE_NONE )
    {
        OUString aFileUrl =xFP->getFiles().getConstArray()[0];
        mpApp->Open(aFileUrl);
    }
    return 1;
}

void TiledRenderingApp::Open(OUString & aFileUrl)
{
    static const char TARGET[] = "_default";
    static const Sequence<beans::PropertyValue> PROPS (0);
    if(xComponent.get())
    {
        xComponent->dispose();
        xComponent.clear();
    }
    xComponent.set(xLoader->loadComponentFromURL(aFileUrl, TARGET, 0, PROPS));
}

void TiledRenderingApp::Init()
{
    xContext.set(cppu::defaultBootstrap_InitialComponentContext());
    xFactory.set(xContext->getServiceManager());
    xSFactory.set(uno::Reference<lang::XMultiServiceFactory> (xFactory, uno::UNO_QUERY_THROW));
    comphelper::setProcessServiceFactory(xSFactory);

    // Create UCB (for backwards compatibility, in case some code still uses
    // plain createInstance w/o args directly to obtain an instance):
    ::ucb::UniversalContentBroker::create(comphelper::getProcessComponentContext() );

    xDesktop.set(xFactory->createInstanceWithContext(OUString("com.sun.star.frame.Desktop"), xContext));
    xLoader.set(frame::Desktop::create(xContext));
}

int TiledRenderingApp::Main()
{
    if(GetCommandLineParamCount()>0)
    {
        OUString aFileUrl;
        osl::File::getFileURLFromSystemPath(GetCommandLineParam(0), aFileUrl);
        Open(aFileUrl);
    }
    Help::EnableQuickHelp();
    try
    {
        VclPtr<TiledRenderingDialog> pDialog(new TiledRenderingDialog(this));
        pDialog->Execute();
    }
    catch (const uno::Exception &e)
    {
        fprintf(stderr, "fatal error: %s\n", OUStringToOString(e.Message, osl_getThreadTextEncoding()).getStr());
    }
    return EXIT_SUCCESS;
}

void vclmain::createApplication()
{
    static TiledRenderingApp aApp;
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index ba5ddad..b5c28ba 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -2665,8 +2665,8 @@ void DocumentRedlineManager::checkRedlining(RedlineMode_t& _rReadlineMode)
    if ( pParent && !mbReadlineChecked && rRedlineTbl.size() > MAX_REDLINE_COUNT
        && !((_rReadlineMode & nsRedlineMode_t::REDLINE_SHOW_DELETE) == nsRedlineMode_t::REDLINE_SHOW_DELETE) )
    {
        MessageDialog aQuery(pParent, "QueryShowChangesDialog", "modules/swriter/ui/queryshowchangesdialog.ui");
        sal_uInt16 nResult = aQuery.Execute();
        VclPtr<MessageDialog> aQuery(new MessageDialog(pParent, "QueryShowChangesDialog", "modules/swriter/ui/queryshowchangesdialog.ui"));
        sal_uInt16 nResult = aQuery->Execute();
        mbReadlineChecked = true;
        if ( nResult == RET_YES )
        {
diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx
index 7a70e37..4b006c0 100644
--- a/sw/source/ui/config/mailconfigpage.cxx
+++ b/sw/source/ui/config/mailconfigpage.cxx
@@ -204,8 +204,8 @@ IMPL_LINK(SwMailConfigPage, ReplyToHdl, CheckBox*, pBox)

IMPL_LINK_NOARG(SwMailConfigPage, AuthenticationHdl)
{
    SwAuthenticationSettingsDialog aDlg(this, *m_pConfigItem);
    aDlg.Execute();
    VclPtr<SwAuthenticationSettingsDialog> aDlg(new SwAuthenticationSettingsDialog(this, *m_pConfigItem));
    aDlg->Execute();
    return 0;
}

diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index a826fd0..a0deaa4 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -315,9 +315,9 @@ IMPL_LINK_NOARG(SwCompatibilityOptPage, SelectHdl)

IMPL_LINK_NOARG(SwCompatibilityOptPage, UseAsDefaultHdl)
{
    MessageDialog aQuery(this, "QueryDefaultCompatDialog",
        "modules/swriter/ui/querydefaultcompatdialog.ui");
    if (aQuery.Execute() == RET_YES)
    VclPtr<MessageDialog> aQuery(new MessageDialog(this, "QueryDefaultCompatDialog",
        "modules/swriter/ui/querydefaultcompatdialog.ui"));
    if (aQuery->Execute() == RET_YES)
    {
        for ( vector< CompatibilityItem >::iterator pItem = m_pImpl->m_aList.begin();
              pItem != m_pImpl->m_aList.end(); ++pItem )
diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index a08e103..c75a8d6 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -695,12 +695,12 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
        }

        SwView* pSourceView = rConfigItem.GetSourceView();
        PrintMonitor aSaveMonitor(this, false, PrintMonitor::MONITOR_TYPE_SAVE);
        aSaveMonitor.m_pDocName->SetText(pSourceView->GetDocShell()->GetTitle(22));
        aSaveMonitor.SetCancelHdl(LINK(this, SwMailMergeOutputPage, SaveCancelHdl_Impl));
        aSaveMonitor.m_pPrinter->SetText( INetURLObject( sPath ).getFSysPath( INetURLObject::FSYS_DETECT ) );
        VclPtr<PrintMonitor> aSaveMonitor(this, false, PrintMonitor::MONITOR_TYPE_SAVE);
        aSaveMonitor->m_pDocName->SetText(pSourceView->GetDocShell()->GetTitle(22));
        aSaveMonitor->SetCancelHdl(LINK(this, SwMailMergeOutputPage, SaveCancelHdl_Impl));
        aSaveMonitor->m_pPrinter->SetText( INetURLObject( sPath ).getFSysPath( INetURLObject::FSYS_DETECT ) );
        m_bCancelSaving = false;
        aSaveMonitor.Show();
        aSaveMonitor->Show();
        m_pWizard->enableButtons(WZB_CANCEL, false);

        for(sal_uInt32 nDoc = nBegin; nDoc < nEnd && !m_bCancelSaving; ++nDoc)
@@ -713,7 +713,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
                sPath += "." + sExtension;
            }
            OUString sStat = OUString(SW_RES(STR_STATSTR_LETTER)) + " " + OUString::number( nDoc );
            aSaveMonitor.m_pPrintInfo->SetText(sStat);
            aSaveMonitor->m_pPrintInfo->SetText(sStat);

            //now extract a document from the target document
            // the shell will be closed at the end, but it is more safe to use SfxObjectShellLock here
@@ -761,9 +761,9 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)

                if(bFailed)
                {
                    SwSaveWarningBox_Impl aWarning( pButton, sOutPath );
                    if(RET_OK == aWarning.Execute())
                        sOutPath = aWarning.GetFileName();
                    VclPtr<SwSaveWarningBox_Impl> aWarning(new SwSaveWarningBox_Impl( pButton, sOutPath ));
                    if(RET_OK == aWarning->Execute())
                        sOutPath = aWarning->GetFileName();
                    else
                    {
                        xTempDocShell->DoClose();
@@ -945,8 +945,8 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
    if(rConfigItem.GetMailServer().isEmpty() ||
            !SwMailMergeHelper::CheckMailAddress(rConfigItem.GetMailAddress()) )
    {
        QueryBox aQuery(pButton, WB_YES_NO_CANCEL, m_sConfigureMail);
        sal_uInt16 nRet = aQuery.Execute();
        VclPtr<QueryBox> aQuery(new QueryBox(pButton, WB_YES_NO_CANCEL, m_sConfigureMail));
        sal_uInt16 nRet = aQuery->Execute();
        if(RET_YES == nRet )
        {
            SfxAllItemSet aSet(pTargetView->GetPool());
@@ -1039,26 +1039,26 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)

    if(m_pSubjectED->GetText().isEmpty())
    {
        SwSendQueryBox_Impl aQuery(pButton, "SubjectDialog",
         "modules/swriter/ui/subjectdialog.ui");
        aQuery.SetIsEmptyTextAllowed(true);
        aQuery.SetValue(m_sNoSubjectST);
        if(RET_OK == aQuery.Execute())
        VclPtr<SwSendQueryBox_Impl> aQuery(new SwSendQueryBox_Impl(pButton, "SubjectDialog",
         "modules/swriter/ui/subjectdialog.ui"));
        aQuery->SetIsEmptyTextAllowed(true);
        aQuery->SetValue(m_sNoSubjectST);
        if(RET_OK == aQuery->Execute())
        {
            if(aQuery.GetValue() != m_sNoSubjectST)
                m_pSubjectED->SetText(aQuery.GetValue());
            if(aQuery->GetValue() != m_sNoSubjectST)
                m_pSubjectED->SetText(aQuery->GetValue());
        }
        else
            return 0;
    }
    if(!bAsBody && m_pAttachmentED->GetText().isEmpty())
    {
        SwSendQueryBox_Impl aQuery(pButton, "AttachNameDialog",
         "modules/swriter/ui/attachnamedialog.ui");
        aQuery.SetIsEmptyTextAllowed(false);
        if(RET_OK == aQuery.Execute())
        VclPtr<SwSendQueryBox_Impl> aQuery(new SwSendQueryBox_Impl(pButton, "AttachNameDialog",
         "modules/swriter/ui/attachnamedialog.ui"));
        aQuery->SetIsEmptyTextAllowed(false);
        if(RET_OK == aQuery->Execute())
        {
            OUString sAttach(aQuery.GetValue());
            OUString sAttach(aQuery->GetValue());
            sal_Int32 nTokenCount = comphelper::string::getTokenCount(sAttach, '.');
            if (2 > nTokenCount)
            {
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index 68ece38..8d16c7a 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -404,11 +404,11 @@ bool SwEditRegionDlg::CheckPasswd(CheckBox* pBox)
        if (!pRepr->GetTempPasswd().getLength()
            && pRepr->GetSectionData().GetPassword().getLength())
        {
            SfxPasswordDialog aPasswdDlg(this);
            VclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog(this));
            bRet = false;
            if (aPasswdDlg.Execute())
            if (aPasswdDlg->Execute())
            {
                const OUString sNewPasswd( aPasswdDlg.GetPassword() );
                const OUString sNewPasswd( aPasswdDlg->GetPassword() );
                ::com::sun::star::uno::Sequence <sal_Int8 > aNewPasswd;
                SvPasswordHelper::GetHashPassword( aNewPasswd, sNewPasswd );
                if (SvPasswordHelper::CompareHashPassword(
@@ -1059,10 +1059,10 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OptionsHdl)
        aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth));
        aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));

        SwSectionPropertyTabDialog aTabDlg(this, aSet, rSh);
        if(RET_OK == aTabDlg.Execute())
        VclPtr<SwSectionPropertyTabDialog> aTabDlg(new SwSectionPropertyTabDialog(this, aSet, rSh));
        if(RET_OK == aTabDlg->Execute())
        {
            const SfxItemSet* pOutSet = aTabDlg.GetOutputItemSet();
            const SfxItemSet* pOutSet = aTabDlg->GetOutputItemSet();
            if( pOutSet && pOutSet->Count() )
            {
                const SfxPoolItem *pColItem, *pBrushItem,
@@ -1238,12 +1238,12 @@ IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox )
        {
            if(!pRepr->GetTempPasswd().getLength() || bChange)
            {
                SfxPasswordDialog aPasswdDlg(this);
                aPasswdDlg.ShowExtras(SHOWEXTRAS_CONFIRM);
                if(RET_OK == aPasswdDlg.Execute())
                VclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog(this));
                aPasswdDlg->ShowExtras(SHOWEXTRAS_CONFIRM);
                if(RET_OK == aPasswdDlg->Execute())
                {
                    const OUString sNewPasswd( aPasswdDlg.GetPassword() );
                    if( aPasswdDlg.GetConfirm() == sNewPasswd )
                    const OUString sNewPasswd( aPasswdDlg->GetPassword() );
                    if( aPasswdDlg->GetConfirm() == sNewPasswd )
                    {
                        SvPasswordHelper::GetHashPassword( pRepr->GetTempPasswd(), sNewPasswd );
                    }
@@ -1682,12 +1682,12 @@ IMPL_LINK( SwInsertSectionTabPage, ChangePasswdHdl, Button *, pButton )
    {
        if(!m_aNewPasswd.getLength() || bChange)
        {
            SfxPasswordDialog aPasswdDlg(this);
            aPasswdDlg.ShowExtras(SHOWEXTRAS_CONFIRM);
            if(RET_OK == aPasswdDlg.Execute())
            VclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog(this));
            aPasswdDlg->ShowExtras(SHOWEXTRAS_CONFIRM);
            if(RET_OK == aPasswdDlg->Execute())
            {
                const OUString sNewPasswd( aPasswdDlg.GetPassword() );
                if( aPasswdDlg.GetConfirm() == sNewPasswd )
                const OUString sNewPasswd( aPasswdDlg->GetPassword() );
                if( aPasswdDlg->GetConfirm() == sNewPasswd )
                {
                    SvPasswordHelper::GetHashPassword( m_aNewPasswd, sNewPasswd );
                }
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index e5cc7dd..5f163c7 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -412,24 +412,24 @@ IMPL_LINK_NOARG_INLINE_END(SwLabPage, TypeHdl)

void SwLabPage::DisplayFormat()
{
    MetricField aField(this, WinBits(0));
    VclPtr<MetricField> aField(new MetricField(this, WinBits(0)));
    FieldUnit aMetric = ::GetDfltMetric(false);
    SetMetric(aField, aMetric);
    aField.SetDecimalDigits(2);
    aField.SetMin         (0);
    aField.SetMax         (LONG_MAX);
    SetMetric(*aField.get(), aMetric);
    aField->SetDecimalDigits(2);
    aField->SetMin         (0);
    aField->SetMax         (LONG_MAX);

    SwLabRec* pRec = GetSelectedEntryPos();
    aItem.aLstType = pRec->aType;
    SETFLDVAL(aField, pRec->lWidth);
    aField.Reformat();
    const OUString aWString = aField.GetText();
    SETFLDVAL(*aField.get(), pRec->lWidth);
    aField->Reformat();
    const OUString aWString = aField->GetText();

    SETFLDVAL(aField, pRec->lHeight);
    aField.Reformat();
    SETFLDVAL(*aField.get(), pRec->lHeight);
    aField->Reformat();

    OUString aText = pRec->aType + ": " + aWString +
           " x " + aField.GetText() +
           " x " + aField->GetText() +
           " (" + OUString::number( pRec->nCols ) +
           " x " + OUString::number( pRec->nRows ) + ")";
    m_pFormatInfo->SetText(aText);
diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx
index 4a83c78..f0ce862 100644
--- a/sw/source/ui/envelp/labfmt.cxx
+++ b/sw/source/ui/envelp/labfmt.cxx
@@ -614,15 +614,15 @@ IMPL_LINK_NOARG(SwSaveLabelDlg, OkHdl)
            return 0;
        }

        MessageDialog aQuery(this, "QuerySaveLabelDialog",
            "modules/swriter/ui/querysavelabeldialog.ui");
        VclPtr<MessageDialog> aQuery(new MessageDialog(this, "QuerySaveLabelDialog",
            "modules/swriter/ui/querysavelabeldialog.ui"));

        aQuery.set_primary_text(aQuery.get_primary_text().
        aQuery->set_primary_text(aQuery->get_primary_text().
            replaceAll("%1", sMake).replaceAll("%2", sType));
        aQuery.set_secondary_text(aQuery.get_secondary_text().
        aQuery->set_secondary_text(aQuery->get_secondary_text().
            replaceAll("%1", sMake).replaceAll("%2", sType));

        if (RET_YES != aQuery.Execute())
        if (RET_YES != aQuery->Execute())
            return 0;
    }
    rLabRec.aType = sType;
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index 0fef7a5..553dcf9f 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -540,15 +540,15 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
        aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
        aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
        // collect character styles
        ListBox rCharFmtLB(this);
        rCharFmtLB.Clear();
        rCharFmtLB.InsertEntry( SwViewShell::GetShellRes()->aStrNone );
        VclPtr<ListBox> rCharFmtLB(new ListBox(this));
        rCharFmtLB->Clear();
        rCharFmtLB->InsertEntry( SwViewShell::GetShellRes()->aStrNone );
        SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
        ::FillCharStyleListBox(rCharFmtLB,  pDocShell);
        ::FillCharStyleListBox(*rCharFmtLB.get(),  pDocShell);

        std::vector<OUString> aList;
        for(sal_Int32 j = 0; j < rCharFmtLB.GetEntryCount(); j++)
             aList.push_back( rCharFmtLB.GetEntry(j) );
        for(sal_Int32 j = 0; j < rCharFmtLB->GetEntryCount(); j++)
             aList.push_back( rCharFmtLB->GetEntry(j) );

        aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ;
        FieldUnit eMetric = ::GetDfltMetric(pDocShell->ISA(SwWebDocShell));
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index b30f2be..89b798c 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -284,17 +284,17 @@ IMPL_LINK_INLINE_START( SwCaptionDialog, OptionHdl, Button*, pButton )
    OUString sFldTypeName = m_pCategoryBox->GetText();
    if(sFldTypeName == m_sNone)
        sFldTypeName = OUString();
    SwSequenceOptionDialog  aDlg( pButton, rView, sFldTypeName );
    aDlg.SetApplyBorderAndShadow(bCopyAttributes);
    aDlg.SetCharacterStyle( sCharacterStyle );
    aDlg.SetOrderNumberingFirst( bOrderNumberingFirst );
    aDlg.Execute();
    bCopyAttributes = aDlg.IsApplyBorderAndShadow();
    sCharacterStyle = aDlg.GetCharacterStyle();
    VclPtr<SwSequenceOptionDialog> aDlg( pButton, rView, sFldTypeName );
    aDlg->SetApplyBorderAndShadow(bCopyAttributes);
    aDlg->SetCharacterStyle( sCharacterStyle );
    aDlg->SetOrderNumberingFirst( bOrderNumberingFirst );
    aDlg->Execute();
    bCopyAttributes = aDlg->IsApplyBorderAndShadow();
    sCharacterStyle = aDlg->GetCharacterStyle();
    //#i61007# order of captions
    if( bOrderNumberingFirst != aDlg.IsOrderNumberingFirst() )
    if( bOrderNumberingFirst != aDlg->IsOrderNumberingFirst() )
    {
        bOrderNumberingFirst = aDlg.IsOrderNumberingFirst();
        bOrderNumberingFirst = aDlg->IsOrderNumberingFirst();
        SW_MOD()->GetModuleConfig()->SetCaptionOrderNumberingFirst(bOrderNumberingFirst);
        ApplyCaptionOrder();
    }
@@ -338,8 +338,8 @@ IMPL_LINK_NOARG(SwCaptionDialog, ModifyHdl)
IMPL_LINK_NOARG(SwCaptionDialog, CaptionHdl)
{
    SfxItemSet  aSet( rView.GetDocShell()->GetDoc()->GetAttrPool() );
    SwCaptionOptDlg aDlg( this, aSet );
    aDlg.Execute();
    VclPtr<SwCaptionOptDlg> aDlg(new SwCaptionOptDlg( this, aSet ) );
    aDlg->Execute();

    return 0;
}
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 89db59c..9bcaa1f 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -488,8 +488,8 @@ IMPL_LINK_NOARG( SwMultiTOXTabDialog, ShowPreviewHdl )
                OUString sInfo(SW_RESSTR(STR_FILE_NOT_FOUND));
                sInfo = sInfo.replaceFirst( "%1", sTemplate );
                sInfo = sInfo.replaceFirst( "%2", aOpt.GetTemplatePath() );
                InfoBox aInfo(GetParent(), sInfo);
                aInfo.Execute();
                VclPtr<InfoBox> aInfo(new InfoBox(GetParent(), sInfo));
                aInfo->Execute();
            }
            else
            {
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index 701c6ae..9a5f798 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -1201,8 +1201,8 @@ IMPL_LINK_NOARG(SwAuthorMarkPane, InsertHdl)
                bDifferent |= m_sFields[i] != pEntry->GetAuthorField((ToxAuthorityField)i);
            if(bDifferent)
            {
                MessageDialog aQuery(&m_rDialog, SW_RES(STR_QUERY_CHANGE_AUTH_ENTRY), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
                if(RET_YES != aQuery.Execute())
                VclPtr<MessageDialog> aQuery(new MessageDialog(&m_rDialog, SW_RES(STR_QUERY_CHANGE_AUTH_ENTRY), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
                if(RET_YES != aQuery->Execute())
                    return 0;
            }
        }
@@ -1241,14 +1241,14 @@ IMPL_LINK(SwAuthorMarkPane, CreateEntryHdl, PushButton*, pButton)
    OUString sOldId = m_sCreatedEntry[0];
    for(int i = 0; i < AUTH_FIELD_END; i++)
        m_sCreatedEntry[i] = bCreate ? OUString() : m_sFields[i];
    SwCreateAuthEntryDlg_Impl aDlg(pButton,
    VclPtr<SwCreateAuthEntryDlg_Impl> aDlg(new SwCreateAuthEntryDlg_Impl(pButton,
                bCreate ? m_sCreatedEntry : m_sFields,
                *pSh, bNewEntry, bCreate);
                *pSh, bNewEntry, bCreate));
    if(bNewEntry)
    {
        aDlg.SetCheckNameHdl(LINK(this, SwAuthorMarkPane, IsEntryAllowedHdl));
        aDlg->SetCheckNameHdl(LINK(this, SwAuthorMarkPane, IsEntryAllowedHdl));
    }
    if(RET_OK == aDlg.Execute())
    if(RET_OK == aDlg->Execute())
    {
        if(bCreate && !sOldId.isEmpty())
        {
@@ -1256,7 +1256,7 @@ IMPL_LINK(SwAuthorMarkPane, CreateEntryHdl, PushButton*, pButton)
        }
        for(int i = 0; i < AUTH_FIELD_END; i++)
        {
            m_sFields[i] = aDlg.GetEntryText((ToxAuthorityField)i);
            m_sFields[i] = aDlg->GetEntryText((ToxAuthorityField)i);
            m_sCreatedEntry[i] = m_sFields[i];
        }
        if(bNewEntry && !m_pFromDocContentRB->IsChecked())
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index 11a3666..fcdec5a 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -139,8 +139,8 @@ void SwGlossaryGroupDlg::Apply()
        const OUString sMsg(SW_RESSTR(STR_QUERY_DELETE_GROUP1)
                            + sTitle
                            + SW_RESSTR(STR_QUERY_DELETE_GROUP2));
        QueryBox aQuery(this->GetParent(), WB_YES_NO|WB_DEF_NO, sMsg );
        if(RET_YES == aQuery.Execute())
        VclPtr<QueryBox> aQuery(new QueryBox(this->GetParent(), WB_YES_NO|WB_DEF_NO, sMsg ));
        if(RET_YES == aQuery->Execute())
            pGlosHdl->DelGroup( sDelGroup );
    }

diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 75db8cd..47fb568 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -494,8 +494,8 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
    }
    else if (sItemIdent == "delete")
    {
        MessageDialog aQuery(this, SW_RES(STR_QUERY_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
        if (RET_YES == aQuery.Execute())
        VclPtr<MessageDialog> aQuery(new MessageDialog(this, SW_RES(STR_QUERY_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
        if (RET_YES == aQuery->Execute())
        {
            const OUString aShortName(m_pShortNameEdit->GetText());
            const OUString aTitle(m_pNameED->GetText());
@@ -652,9 +652,9 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl)
        }
        else
        {
            MessageDialog aBox(this, sReadonlyPath, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
            VclPtr<MessageDialog> aBox(new MessageDialog(this, sReadonlyPath, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));

            if(RET_YES == aBox.Execute())
            if(RET_YES == aBox->Execute())
                PathHdl(m_pPathBtn);
        }
    }
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 87b535d..6554380 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -966,15 +966,15 @@ void SwSvxNumBulletTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage)
        aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
        aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
        // collect char styles
        ListBox rCharFmtLB(this);
        rCharFmtLB.Clear();
        rCharFmtLB.InsertEntry( SwViewShell::GetShellRes()->aStrNone );
        VclPtr<ListBox> rCharFmtLB(new ListBox(this));
        rCharFmtLB->Clear();
        rCharFmtLB->InsertEntry( SwViewShell::GetShellRes()->aStrNone );
        SwDocShell* pDocShell = rWrtSh.GetView().GetDocShell();
        ::FillCharStyleListBox(rCharFmtLB,  pDocShell);
        ::FillCharStyleListBox(*rCharFmtLB.get(),  pDocShell);

        std::vector<OUString> aList;
        for(sal_Int32 j = 0; j < rCharFmtLB.GetEntryCount(); j++)
             aList.push_back( rCharFmtLB.GetEntry(j) );
        for(sal_Int32 j = 0; j < rCharFmtLB->GetEntryCount(); j++)
             aList.push_back( rCharFmtLB->GetEntry(j) );

        aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ;

diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index f9fba49..cc2fe41 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -608,10 +608,10 @@ void SwDocShell::Execute(SfxRequest& rReq)
                        const SfxFilter* pFlt = GetMedium()->GetFilter();
                        if(!pFlt || pFlt->GetUserData() != pHtmlFlt->GetUserData())
                        {
                            MessageDialog aQuery(&pViewFrm->GetWindow(),
                                "SaveAsHTMLDialog", "modules/swriter/ui/saveashtmldialog.ui");
                            VclPtr<MessageDialog> aQuery(new MessageDialog(&pViewFrm->GetWindow(),
                                "SaveAsHTMLDialog", "modules/swriter/ui/saveashtmldialog.ui"));

                            if(RET_YES == aQuery.Execute())
                            if(RET_YES == aQuery->Execute())
                                bLocalHasName = false;
                            else
                                break;
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 1df19b7..0354530 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -388,8 +388,8 @@ namespace
            sal_uInt16 aRotation = aMetadata.getRotation();
            if (aRotation != 0)
            {
                MessageDialog aQueryBox( 0,"QueryRotateIntoStandardOrientationDialog","modules/swriter/ui/queryrotateintostandarddialog.ui");
                if (aQueryBox.Execute() == RET_YES)
                VclPtr<MessageDialog> aQueryBox(new MessageDialog( 0,"QueryRotateIntoStandardOrientationDialog","modules/swriter/ui/queryrotateintostandarddialog.ui") );
                if (aQueryBox->Execute() == RET_YES)
                {
                    GraphicNativeTransform aTransform( aGraphic );
                    aTransform.rotate( aRotation );
diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx
index e4edd46..a1cdc38 100644
--- a/sw/source/uibase/lingu/olmenu.cxx
+++ b/sw/source/uibase/lingu/olmenu.cxx
@@ -803,9 +803,9 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
            uno::Any exc( ::cppu::getCaughtException() );
            OUString msg( ::comphelper::anyToString( exc ) );
            const SolarMutexGuard guard;
            MessageDialog aErrorBox(NULL, msg);
            aErrorBox.SetText( "Explanations" );
            aErrorBox.Execute();
            VclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, msg));
            aErrorBox->SetText( "Explanations" );
            aErrorBox->Execute();
        }
    }
    else if (nId == FN_REDLINE_ACCEPT_DIRECT || nId == FN_REDLINE_REJECT_DIRECT
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index effa9f4..be54e67 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -163,19 +163,19 @@ void SwGrfShell::Execute(SfxRequest &rReq)

                Graphic aGraphic = Graphic( *pGraphic );

                CompressGraphicsDialog aDialog( GetView().GetWindow(), aGraphic, aSize, aCropRectangle, GetView().GetViewFrame()->GetBindings() );
                if( aDialog.Execute() == RET_OK )
                VclPtr<CompressGraphicsDialog> aDialog(new CompressGraphicsDialog( GetView().GetWindow(), aGraphic, aSize, aCropRectangle, GetView().GetViewFrame()->GetBindings() ) );
                if( aDialog->Execute() == RET_OK )
                {
                    rSh.StartAllAction();
                    rSh.StartUndo(UNDO_START);
                    Rectangle aScaledCropedRectangle = aDialog.GetScaledCropRectangle();
                    Rectangle aScaledCropedRectangle = aDialog->GetScaledCropRectangle();

                    aCrop.SetLeft(   convertMm100ToTwip( aScaledCropedRectangle.Left() ));
                    aCrop.SetTop(    convertMm100ToTwip( aScaledCropedRectangle.Top() ));
                    aCrop.SetRight(  convertMm100ToTwip( aScaledCropedRectangle.Right() ));
                    aCrop.SetBottom( convertMm100ToTwip( aScaledCropedRectangle.Bottom() ));

                    Graphic aCompressedGraphic( aDialog.GetCompressedGraphic() );
                    Graphic aCompressedGraphic( aDialog->GetCompressedGraphic() );
                    rSh.ReRead(OUString(), OUString(), (const Graphic*) &aCompressedGraphic);

                    rSh.SetAttrItem(aCrop);
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 888bf21..3a282df 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -735,9 +735,9 @@ void SwTableShell::Execute(SfxRequest &rReq)
                        break;
                    case TBLMERGE_TOOCOMPLEX:
                    {
                        MessageDialog aInfoBox( GetView().GetWindow(),
                                    SW_RES( STR_ERR_TABLE_MERGE ), VCL_MESSAGE_INFO );
                        aInfoBox.Execute();
                        VclPtr<MessageDialog> aInfoBox(new MessageDialog( GetView().GetWindow(),
                                    SW_RES( STR_ERR_TABLE_MERGE ), VCL_MESSAGE_INFO ) );
                        aInfoBox->Execute();
                        break;
                    }
                    default:
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 8ad15cf4..cbaf14a 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -257,23 +257,23 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const 

static short lcl_AskRedlineMode(vcl::Window *pWin)
{
    MessBox aQBox( pWin, 0,
    VclPtr<MessBox> aQBox(new MessBox( pWin, 0,
                    OUString( SW_RES( STR_REDLINE_TITLE ) ),
                    OUString( SW_RES( STR_REDLINE_MSG ) ) );
    aQBox.SetImage( QueryBox::GetStandardImage() );
                    OUString( SW_RES( STR_REDLINE_MSG ) ) ) );
    aQBox->SetImage( QueryBox::GetStandardImage() );
    const sal_uInt16 nBtnFlags = BUTTONDIALOG_DEFBUTTON |
                        BUTTONDIALOG_OKBUTTON |
                        BUTTONDIALOG_FOCUSBUTTON;

    aQBox.AddButton(OUString(SW_RES(STR_REDLINE_ACCEPT_ALL)), RET_OK, nBtnFlags);
    aQBox.GetPushButton( RET_OK )->SetHelpId(HID_AUTOFORMAT_ACCEPT);
    aQBox.AddButton(OUString(SW_RES(STR_REDLINE_REJECT_ALL)), RET_CANCEL, BUTTONDIALOG_CANCELBUTTON);
    aQBox.GetPushButton( RET_CANCEL )->SetHelpId(HID_AUTOFORMAT_REJECT  );
    aQBox.AddButton(OUString(SW_RES(STR_REDLINE_EDIT)), 2, 0);
    aQBox.GetPushButton( 2 )->SetHelpId(HID_AUTOFORMAT_EDIT_CHG);
    aQBox.SetButtonHelpText( RET_OK, OUString() );
    aQBox->AddButton(OUString(SW_RES(STR_REDLINE_ACCEPT_ALL)), RET_OK, nBtnFlags);
    aQBox->GetPushButton( RET_OK )->SetHelpId(HID_AUTOFORMAT_ACCEPT);
    aQBox->AddButton(OUString(SW_RES(STR_REDLINE_REJECT_ALL)), RET_CANCEL, BUTTONDIALOG_CANCELBUTTON);
    aQBox->GetPushButton( RET_CANCEL )->SetHelpId(HID_AUTOFORMAT_REJECT  );
    aQBox->AddButton(OUString(SW_RES(STR_REDLINE_EDIT)), 2, 0);
    aQBox->GetPushButton( 2 )->SetHelpId(HID_AUTOFORMAT_EDIT_CHG);
    aQBox->SetButtonHelpText( RET_OK, OUString() );

    return aQBox.Execute();
    return aQBox->Execute();
}

void SwTextShell::Execute(SfxRequest &rReq)
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 1953017..14698d8 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -240,8 +240,8 @@ int SwView::InsertGraphic( const OUString &rPath, const OUString &rFilter,
            const sal_uInt16 aRotation = aMetadata.getRotation();
            if (aRotation != 0)
            {
                MessageDialog aQueryBox( GetWindow(),"QueryRotateIntoStandardOrientationDialog","modules/swriter/ui/queryrotateintostandarddialog.ui");
                if (aQueryBox.Execute() == RET_YES)
                VclPtr<MessageDialog> aQueryBox(new MessageDialog( GetWindow(),"QueryRotateIntoStandardOrientationDialog","modules/swriter/ui/queryrotateintostandarddialog.ui") );
                if (aQueryBox->Execute() == RET_YES)
                {
                    GraphicNativeTransform aTransform( aGraphic );
                    aTransform.rotate( aRotation );
@@ -439,8 +439,8 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
            // really store as link only?
            if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() )
            {
                SvxLinkWarningDialog aWarnDlg(GetWindow(),pFileDlg->GetPath());
                if( aWarnDlg.Execute() != RET_OK )
                VclPtr<SvxLinkWarningDialog> aWarnDlg(new SvxLinkWarningDialog(GetWindow(),pFileDlg->GetPath()));
                if( aWarnDlg->Execute() != RET_OK )
                    bAsLink=false; // don't store as link
            }
        }
@@ -504,8 +504,8 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
        {
            if( bShowError )
            {
                MessageDialog aInfoBox( GetWindow(), SW_RESSTR( nResId ), VCL_MESSAGE_INFO);
                aInfoBox.Execute();
                VclPtr<MessageDialog> aInfoBox(new MessageDialog( GetWindow(), SW_RESSTR( nResId ), VCL_MESSAGE_INFO) );
                aInfoBox->Execute();
            }
            rReq.Ignore();
        }
@@ -585,11 +585,11 @@ void SwView::Execute(SfxRequest &rReq)
                        pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr();
                    else
                        pParent = &GetViewFrame()->GetWindow();
                    SfxPasswordDialog aPasswdDlg( pParent );
                    aPasswdDlg.SetMinLen( 1 );
                    VclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog( pParent ));
                    aPasswdDlg->SetMinLen( 1 );
                    //#i69751# the result of Execute() can be ignored
                    (void)aPasswdDlg.Execute();
                    OUString sNewPasswd( aPasswdDlg.GetPassword() );
                    (void)aPasswdDlg->Execute();
                    OUString sNewPasswd( aPasswdDlg->GetPassword() );
                    Sequence <sal_Int8> aNewPasswd = pIDRA->GetRedlinePassword();
                    SvPasswordHelper::GetHashPassword( aNewPasswd, sNewPasswd );
                    if(SvPasswordHelper::CompareHashPassword(aPasswd, sNewPasswd))
@@ -623,14 +623,14 @@ void SwView::Execute(SfxRequest &rReq)
                pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr();
            else
                pParent = &GetViewFrame()->GetWindow();
            SfxPasswordDialog aPasswdDlg( pParent );
            aPasswdDlg.SetMinLen( 1 );
            VclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog( pParent ));
            aPasswdDlg->SetMinLen( 1 );
            if(!aPasswd.getLength())
                aPasswdDlg.ShowExtras(SHOWEXTRAS_CONFIRM);
            if (aPasswdDlg.Execute())
                aPasswdDlg->ShowExtras(SHOWEXTRAS_CONFIRM);
            if (aPasswdDlg->Execute())
            {
                sal_uInt16 nOn = nsRedlineMode_t::REDLINE_ON;
                OUString sNewPasswd( aPasswdDlg.GetPassword() );
                OUString sNewPasswd( aPasswdDlg->GetPassword() );
                Sequence <sal_Int8> aNewPasswd =
                        pIDRA->GetRedlinePassword();
                SvPasswordHelper::GetHashPassword( aNewPasswd, sNewPasswd );
@@ -2287,11 +2287,11 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument)
            if ( lcl_NeedAdditionalDataSource( xDBContext ) )
            {
                // no data sources are available - create a new one
                MessageDialog aQuery(&GetViewFrame()->GetWindow(),
                VclPtr<MessageDialog> aQuery(new MessageDialog(&GetViewFrame()->GetWindow(),
                    "DataSourcesUnavailableDialog",
                    "modules/swriter/ui/datasourcesunavailabledialog.ui");
                    "modules/swriter/ui/datasourcesunavailabledialog.ui"));
                // no cancel allowed
                if (RET_OK != aQuery.Execute())
                if (RET_OK != aQuery->Execute())
                    return;
                bCallAddressPilot = true;
            }
@@ -2336,12 +2336,12 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument)
            OUString sSource;
            if(!GetWrtShell().IsFieldDataSourceAvailable(sSource))
            {
                MessageDialog aWarning(&GetViewFrame()->GetWindow(),
                VclPtr<MessageDialog> aWarning(new MessageDialog(&GetViewFrame()->GetWindow(),
                    "WarnDataSourceDialog",
                    "modules/swriter/ui/warndatasourcedialog.ui");
                OUString sTmp(aWarning.get_primary_text());
                aWarning.set_primary_text(sTmp.replaceFirst("%1", sSource));
                if (RET_OK == aWarning.Execute())
                    "modules/swriter/ui/warndatasourcedialog.ui"));
                OUString sTmp(aWarning->get_primary_text());
                aWarning->set_primary_text(sTmp.replaceFirst("%1", sSource));
                if (RET_OK == aWarning->Execute())
                {
                    SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
                    if ( pFact )
@@ -2390,8 +2390,8 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument)
        SfxApplication* pSfxApp = SfxGetpApp();
        vcl::Window* pTopWin = pSfxApp->GetTopWindow();

        SfxTemplateManagerDlg aDocTemplDlg;
        int nRet = aDocTemplDlg.Execute();
        VclPtr<SfxTemplateManagerDlg> aDocTemplDlg(new SfxTemplateManagerDlg);
        int nRet = aDocTemplDlg->Execute();
        bool bNewWin = false;
        if ( nRet == RET_OK )
        {
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index ccc39a4..1319bd7 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -177,9 +177,9 @@ void SwView::ExecDraw(SfxRequest& rReq)
        if ( pSdrView )
        {
            SdrObject* pObj = NULL;
            svx::FontWorkGalleryDialog aDlg( pSdrView, pWin, nSlotId );
            aDlg.SetSdrObjectRef( &pObj, pSdrView->GetModel() );
            aDlg.Execute();
            VclPtr<svx::FontWorkGalleryDialog> aDlg(new svx::FontWorkGalleryDialog( pSdrView, pWin, nSlotId ));
            aDlg->SetSdrObjectRef( &pObj, pSdrView->GetModel() );
            aDlg->Execute();
            if ( pObj )
            {
                Size            aDocSize( m_pWrtShell->GetDocSize() );
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index 7b3c95d..001f48d 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -459,8 +459,8 @@ void SwView::HyphenateDocument()
        // turned on no special area
        {
            // I want also in special areas hyphenation
            MessageDialog aBox(&GetEditWin(), SW_RES(STR_QUERY_SPECIAL_FORCED), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
            if( aBox.Execute() == RET_YES )
            VclPtr<MessageDialog> aBox(new MessageDialog(&GetEditWin(), SW_RES(STR_QUERY_SPECIAL_FORCED), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
            if( aBox->Execute() == RET_YES )
            {
                bOther = true;
                if (xProp.is())
diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx
index a9e63c3..0a3a4cf 100644
--- a/sw/source/uibase/uiview/viewprt.cxx
+++ b/sw/source/uibase/uiview/viewprt.cxx
@@ -175,10 +175,10 @@ void SwView::ExecutePrint(SfxRequest& rReq)
            }
            else
            {
                MessageDialog aInfoBox(&GetEditWin(), SW_RES(STR_ERR_NO_FAX), VCL_MESSAGE_INFO);
                VclPtr<MessageDialog> aInfoBox(new MessageDialog(&GetEditWin(), SW_RES(STR_ERR_NO_FAX), VCL_MESSAGE_INFO));
                sal_uInt16 nResNo = bWeb ? STR_WEBOPTIONS : STR_TEXTOPTIONS;
                aInfoBox.set_primary_text(aInfoBox.get_primary_text().replaceFirst("%1", OUString(SW_RES(nResNo))));
                aInfoBox.Execute();
                aInfoBox->set_primary_text(aInfoBox->get_primary_text().replaceFirst("%1", OUString(SW_RES(nResNo))));
                aInfoBox->Execute();
                SfxUInt16Item aDefPage(SID_SW_EDITOPTIONS, TP_OPTPRINT_PAGE);
                GetViewFrame()->GetDispatcher()->Execute(SID_SW_EDITOPTIONS,
                            SfxCallMode::SYNCHRON|SfxCallMode::RECORD,
@@ -201,9 +201,9 @@ void SwView::ExecutePrint(SfxRequest& rReq)
            if(!bSilent && !bFromMerge &&
                    SW_MOD()->GetModuleConfig()->IsAskForMailMerge() && pSh->IsAnyDatabaseFieldInDoc())
            {
                MessageDialog aBox(&GetEditWin(), "PrintMergeDialog",
                                   "modules/swriter/ui/printmergedialog.ui");
                short nRet = aBox.Execute();
                VclPtr<MessageDialog> aBox(new MessageDialog(&GetEditWin(), "PrintMergeDialog",
                                   "modules/swriter/ui/printmergedialog.ui"));
                short nRet = aBox->Execute();
                if(RET_YES == nRet)
                {
                    SfxBoolItem aBool(FN_QRY_MERGE, true);
diff --git a/sw/source/uibase/utlui/gloslst.cxx b/sw/source/uibase/utlui/gloslst.cxx
index 7f18c24..4951847 100644
--- a/sw/source/uibase/utlui/gloslst.cxx
+++ b/sw/source/uibase/utlui/gloslst.cxx
@@ -143,16 +143,16 @@ bool SwGlossaryList::GetShortName(const OUString& rLongName,
    }
    else if(1 < nCount)
    {
        SwGlossDecideDlg aDlg(0);
        OUString sTitle = aDlg.GetText() + " " + aTripleStrings.front().sBlock;
        aDlg.SetText(sTitle);
        VclPtr<SwGlossDecideDlg> aDlg(new SwGlossDecideDlg(0));
        OUString sTitle = aDlg->GetText() + " " + aTripleStrings.front().sBlock;
        aDlg->SetText(sTitle);

        ListBox& rLB = aDlg.GetListBox();
        ListBox& rLB = aDlg->GetListBox();
        for(std::vector<TripleString>::const_iterator i = aTripleStrings.begin(); i != aTripleStrings.end(); ++i)
            rLB.InsertEntry(i->sGroup.getToken(0, GLOS_DELIM));

        rLB.SelectEntryPos(0);
        if(RET_OK == aDlg.Execute() &&
        if(RET_OK == aDlg->Execute() &&
            LISTBOX_ENTRY_NOTFOUND != rLB.GetSelectEntryPos())
        {
            const TripleString& pTriple(aTripleStrings[rLB.GetSelectEntryPos()]);
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index f265fe6..64e18d8 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -1024,9 +1024,9 @@ executeMessageBox(
{
    SolarMutexGuard aGuard;

    MessBox xBox( pParent, nButtonMask, rTitle, rMessage );
    VclPtr<MessBox> xBox(new MessBox(pParent, nButtonMask, rTitle, rMessage));

    sal_uInt16 aResult = xBox.Execute();
    sal_uInt16 aResult = xBox->Execute();
    switch( aResult )
    {
    case RET_OK:
@@ -1059,11 +1059,11 @@ NameClashResolveDialogResult executeSimpleNameClashResolveDialog( vcl::Window *p
    if ( !xManager.get() )
        return ABORT;

    NameClashDialog aDialog( pParent, xManager.get(), rTargetFolderURL,
                             rClashingName, rProposedNewName, bAllowOverwrite );
    VclPtr<NameClashDialog> aDialog(new NameClashDialog(pParent, xManager.get(), rTargetFolderURL,
                             rClashingName, rProposedNewName, bAllowOverwrite) );

    NameClashResolveDialogResult eResult = (NameClashResolveDialogResult) aDialog.Execute();
    rProposedNewName = aDialog.getNewName();
    NameClashResolveDialogResult eResult = (NameClashResolveDialogResult) aDialog->Execute();
    rProposedNewName = aDialog->getNewName();
    return eResult;
}

@@ -1207,20 +1207,20 @@ UUIInteractionHelper::handleMacroConfirmRequest(
    if ( pResMgr.get() )
    {
        bool bShowSignatures = aSignInfo.getLength() > 0;
        MacroWarning aWarning(
            getParentProperty(), bShowSignatures, *pResMgr.get() );
        VclPtr<MacroWarning> aWarning(new MacroWarning(
            getParentProperty(), bShowSignatures, *pResMgr.get()) );

        aWarning.SetDocumentURL( aDocumentURL );
        aWarning->SetDocumentURL( aDocumentURL );
        if ( aSignInfo.getLength() > 1 )
        {
            aWarning.SetStorage( xZipStorage, aDocumentVersion, aSignInfo );
            aWarning->SetStorage( xZipStorage, aDocumentVersion, aSignInfo );
        }
        else if ( aSignInfo.getLength() == 1 )
        {
            aWarning.SetCertificate( aSignInfo[ 0 ].Signer );
            aWarning->SetCertificate( aSignInfo[ 0 ].Signer );
        }

        bApprove = aWarning.Execute() == RET_OK;
        bApprove = aWarning->Execute() == RET_OK;
    }

    if ( bApprove && xApprove.is() )
diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx
index a7acc01..f54078a 100644
--- a/uui/source/masterpasscrtdlg.cxx
+++ b/uui/source/masterpasscrtdlg.cxx
@@ -41,8 +41,8 @@ IMPL_LINK_NOARG(MasterPasswordCreateDialog, OKHdl_Impl)
    else
    {
        OUString aErrorMsg( ResId( STR_ERROR_PASSWORDS_NOT_IDENTICAL, *pResourceMgr ));
        MessageDialog aErrorBox(this, aErrorMsg);
        aErrorBox.Execute();
        VclPtr<MessageDialog> aErrorBox(new MessageDialog(this, aErrorMsg));
        aErrorBox->Execute();
        m_pEDMasterPasswordCrt->SetText( OUString() );
        m_pEDMasterPasswordRepeat->SetText( OUString() );
        m_pEDMasterPasswordCrt->GrabFocus();
diff --git a/uui/source/masterpassworddlg.cxx b/uui/source/masterpassworddlg.cxx
index 3b6a071..0b219a6 100644
--- a/uui/source/masterpassworddlg.cxx
+++ b/uui/source/masterpassworddlg.cxx
@@ -49,8 +49,8 @@ MasterPasswordDialog::MasterPasswordDialog
    if( nDialogMode == ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER )
    {
        OUString aErrorMsg( ResId( STR_ERROR_MASTERPASSWORD_WRONG, *pResourceMgr ));
        MessageDialog aErrorBox(pParent, aErrorMsg);
        aErrorBox.Execute();
        VclPtr<MessageDialog> aErrorBox(new MessageDialog(pParent, aErrorMsg));
        aErrorBox->Execute();
    }

    m_pOKBtn->SetClickHdl( LINK( this, MasterPasswordDialog, OKHdl_Impl ) );
diff --git a/uui/source/nameclashdlg.cxx b/uui/source/nameclashdlg.cxx
index 63ad092..105ba87 100644
--- a/uui/source/nameclashdlg.cxx
+++ b/uui/source/nameclashdlg.cxx
@@ -34,8 +34,8 @@ IMPL_LINK( NameClashDialog, ButtonHdl_Impl, PushButton *, pBtn )
        OUString aNewName = m_pEDNewName->GetText();
        if ( ( aNewName == maNewName ) || aNewName.isEmpty() )
        {
            MessageDialog aError(NULL, maSameName);
            aError.Execute();
            VclPtr<MessageDialog> aError(new MessageDialog(NULL, maSameName));
            aError->Execute();
            return 1;
        }
        maNewName = aNewName;
diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx
index 2e5ed49..421b846 100644
--- a/uui/source/passworddlg.cxx
+++ b/uui/source/passworddlg.cxx
@@ -44,8 +44,8 @@ PasswordDialog::PasswordDialog(vcl::Window* _pParent,
        const sal_uInt16 nOpenToModifyErrStrId = bOpenToModify ? STR_ERROR_PASSWORD_TO_MODIFY_WRONG : STR_ERROR_PASSWORD_TO_OPEN_WRONG;
        const sal_uInt16 nErrStrId = bIsSimplePasswordRequest ? STR_ERROR_SIMPLE_PASSWORD_WRONG : nOpenToModifyErrStrId;
        OUString aErrorMsg(ResId(nErrStrId, *pResourceMgr).toString());
        MessageDialog aErrorBox(GetParent(), aErrorMsg);
        aErrorBox.Execute();
        VclPtr<MessageDialog> aErrorBox(new MessageDialog(GetParent(), aErrorMsg));
        aErrorBox->Execute();
    }

    // default settings for enter password or reenter passwd...
@@ -91,8 +91,8 @@ IMPL_LINK_NOARG(PasswordDialog, OKHdl_Impl)

    if (m_pEDConfirmPassword->IsVisible() && bPasswdMismatch)
    {
        MessageDialog aErrorBox(this, aPasswdMismatch);
        aErrorBox.Execute();
        VclPtr<MessageDialog> aErrorBox(new MessageDialog(this, aPasswdMismatch));
        aErrorBox->Execute();
    }
    else if (bValid)
        EndDialog( RET_OK );
diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index 7a0ab922..a6f4822 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -136,8 +136,8 @@ namespace
    int QueryFaxNumber(OUString& rNumber)
    {
        OUString aTmpString(VclResId(SV_PRINT_QUERYFAXNUMBER_TXT));
        QueryString aQuery(NULL, aTmpString, rNumber);
        return aQuery.Execute();
        VclPtr<QueryString> aQuery(new QueryString(NULL, aTmpString, rNumber));
        return aQuery->Execute();
    }
}

diff --git a/vcl/generic/print/prtsetup.cxx b/vcl/generic/print/prtsetup.cxx
index ed5cadc..a22f912 100644
--- a/vcl/generic/print/prtsetup.cxx
+++ b/vcl/generic/print/prtsetup.cxx
@@ -464,11 +464,11 @@ void RTSDevicePage::FillValueBox( const PPDKey* pKey )
int SetupPrinterDriver(::psp::PrinterInfo& rJobData)
{
    int nRet = 0;
    RTSDialog aDialog( rJobData, NULL );
    VclPtr<RTSDialog> aDialog(new RTSDialog( rJobData, NULL ) );

    if( aDialog.Execute() )
    if( aDialog->Execute() )
    {
        rJobData = aDialog.getSetup();
        rJobData = aDialog->getSetup();
        nRet = 1;
    }

diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index 6dfe9b0..65e2d13 100644
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -352,10 +352,10 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton )
        }
        if( (aData.nTestFlags & ~IMMEDIATE_FLAGS) != (pData->nTestFlags & ~IMMEDIATE_FLAGS) )
        {
            MessageDialog aBox(this, OUString(
            VclPtr<MessageDialog> aBox(new MessageDialog(this, OUString(
                "Some of the changed settings will only be active after "
                "restarting the process"), VCL_MESSAGE_INFO);
            aBox.Execute();
                "restarting the process"), VCL_MESSAGE_INFO));
            aBox->Execute();
        }
        EndDialog( RET_OK );
    }
@@ -367,7 +367,7 @@ void DbgDialog::RequestHelp( const HelpEvent& rHEvt )
{
    if ( rHEvt.GetMode() & HelpEventMode::CONTEXT )
    {
        DbgInfoDialog aInfoDialog( this, true );
        VclPtr<DbgInfoDialog> aInfoDialog(new DbgInfoDialog( this, true ) );
        OUString aHelpText;
        const sal_Char** pHelpStrs = pDbgHelpText;
        while ( *pHelpStrs )
@@ -375,9 +375,9 @@ void DbgDialog::RequestHelp( const HelpEvent& rHEvt )
            aHelpText += OUString::createFromAscii(*pHelpStrs);
            pHelpStrs++;
        }
        aInfoDialog.SetText( "Debug Hilfe" );
        aInfoDialog.SetInfoText( aHelpText );
        aInfoDialog.Execute();
        aInfoDialog->SetText( "Debug Hilfe" );
        aInfoDialog->SetInfoText( aHelpText );
        aInfoDialog->Execute();
    }
}

diff --git a/vcl/source/app/stdtext.cxx b/vcl/source/app/stdtext.cxx
index 8093a6f..ca3ee6b 100644
--- a/vcl/source/app/stdtext.cxx
+++ b/vcl/source/app/stdtext.cxx
@@ -39,8 +39,8 @@ void ShowServiceNotAvailableError(vcl::Window* pParent,
{
    OUString aText  = GetStandardText(STANDARD_TEXT_SERVICE_NOT_AVAILABLE).
        replaceAll("%s", rServiceName);
    MessageDialog aBox(pParent, aText, bError ? VCL_MESSAGE_ERROR : VCL_MESSAGE_WARNING);
    aBox.Execute();
    VclPtr<MessageDialog> aBox(new MessageDialog(pParent, aText, bError ? VCL_MESSAGE_ERROR : VCL_MESSAGE_WARNING));
    aBox->Execute();
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index 155b5cc..b30848c 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -160,8 +160,8 @@ ResMgr* ImplGetResMgr()
                "Missing vcl resource. This indicates that files vital to localization are missing. "
                "You might have a corrupt installation.";
            fprintf( stderr, "%s\n", pMsg );
            MessageDialog aBox(NULL, OUString(pMsg, strlen(pMsg), RTL_TEXTENCODING_ASCII_US));
            aBox.Execute();
            VclPtr<MessageDialog> aBox(new MessageDialog(NULL, OUString(pMsg, strlen(pMsg), RTL_TEXTENCODING_ASCII_US)));
            aBox->Execute();
        }
    }
    return pSVData->mpResMgr;
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index f041d80b..8fe828e 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -805,8 +805,8 @@ void Edit::ShowTruncationWarning( vcl::Window* pParent )
    ResMgr* pResMgr = ImplGetResMgr();
    if( pResMgr )
    {
        MessageDialog aBox(pParent, ResId(SV_EDIT_WARNING_STR, *pResMgr), VCL_MESSAGE_WARNING);
        aBox.Execute();
        VclPtr<MessageDialog> aBox(new MessageDialog(pParent, ResId(SV_EDIT_WARNING_STR, *pResMgr), VCL_MESSAGE_WARNING));
        aBox->Execute();
    }
}

@@ -2784,8 +2784,8 @@ Size Edit::CalcMinimumSize() const
Size Edit::GetMinimumEditSize()
{
    vcl::Window* pDefWin = ImplGetDefaultWindow();
    Edit aEdit( pDefWin, WB_BORDER );
    Size aSize( aEdit.CalcMinimumSize() );
    VclPtr<Edit> aEdit(new Edit( pDefWin, WB_BORDER ) );
    Size aSize( aEdit->CalcMinimumSize() );
    return aSize;
}

diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 543ab88..52c097c 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -305,9 +305,9 @@ void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController,
    {
        if (xController->isShowDialogs())
        {
            MessageDialog aBox(NULL, "ErrorNoPrinterDialog",
                "vcl/ui/errornoprinterdialog.ui");
            aBox.Execute();
            VclPtr<MessageDialog> aBox(new MessageDialog(NULL, "ErrorNoPrinterDialog",
                "vcl/ui/errornoprinterdialog.ui"));
            aBox->Execute();
        }
        xController->setValue( OUString( "IsDirect" ),
                               makeAny( false ) );
@@ -454,9 +454,9 @@ void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController,
    {
        if( xController->getFilteredPageCount() == 0 )
        {
            MessageDialog aBox(NULL, "ErrorNoContentDialog",
                "vcl/ui/errornocontentdialog.ui");
            aBox.Execute();
            VclPtr<MessageDialog> aBox(new MessageDialog(NULL, "ErrorNoContentDialog",
                "vcl/ui/errornocontentdialog.ui"));
            aBox->Execute();
            return;
        }
    }
@@ -470,13 +470,13 @@ void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController,
    {
        try
        {
            PrintDialog aDlg( NULL, xController );
            if( ! aDlg.Execute() )
            VclPtr<PrintDialog> aDlg(new PrintDialog( NULL, xController ));
            if( ! aDlg->Execute() )
            {
                xController->abortJob();
                return;
            }
            if( aDlg.isPrintToFile() )
            if( aDlg->isPrintToFile() )
            {
                OUString aFile = queryFile( xController->getPrinter().get() );
                if( aFile.isEmpty() )
@@ -487,7 +487,7 @@ void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController,
                xController->setValue( OUString( "LocalFileName" ),
                                       makeAny( aFile ) );
            }
            else if( aDlg.isSingleJobs() )
            else if( aDlg->isSingleJobs() )
            {
                xController->setValue( OUString( "PrintCollateAsSingleJobs" ),
                                       makeAny( true ) );
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index d79b539..8178788 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1058,8 +1058,8 @@ void Dialog::GrabFocusToFirstControl()

void Dialog::GetDrawWindowBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder, sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const
{
    ImplBorderWindow aImplWin( (vcl::Window*)this, WB_BORDER|WB_STDWORK, BORDERWINDOW_STYLE_OVERLAP );
    aImplWin.GetBorder( rLeftBorder, rTopBorder, rRightBorder, rBottomBorder );
    VclPtr<ImplBorderWindow> aImplWin( new ImplBorderWindow( (vcl::Window*)this, WB_BORDER|WB_STDWORK, BORDERWINDOW_STYLE_OVERLAP ) );
    aImplWin->GetBorder( rLeftBorder, rTopBorder, rRightBorder, rBottomBorder );
}

void Dialog::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong )
@@ -1085,13 +1085,13 @@ void Dialog::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal

    if (!( GetStyle() & WB_NOBORDER ))
    {
        ImplBorderWindow aImplWin( this, WB_BORDER|WB_STDWORK, BORDERWINDOW_STYLE_OVERLAP );
        aImplWin.SetText( GetText() );
        aImplWin.setPosSizePixel( aPos.X(), aPos.Y(), aSize.Width(), aSize.Height() );
        aImplWin.SetDisplayActive( true );
        aImplWin.InitView();
        VclPtr<ImplBorderWindow> aImplWin( new ImplBorderWindow(this, WB_BORDER|WB_STDWORK, BORDERWINDOW_STYLE_OVERLAP) );
        aImplWin->SetText( GetText() );
        aImplWin->setPosSizePixel( aPos.X(), aPos.Y(), aSize.Width(), aSize.Height() );
        aImplWin->SetDisplayActive( true );
        aImplWin->InitView();

        aImplWin.Draw( Rectangle( aPos, aSize ), pDev, aPos );
        aImplWin->Draw( Rectangle( aPos, aSize ), pDev, aPos );
    }

    pDev->Pop();
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index 9e45c5d..9ea6a12 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -60,7 +60,7 @@ void DecoToolBox::DataChanged( const DataChangedEvent& rDCEvt )

void DecoToolBox::calcMinSize()
{
    ToolBox aTbx( GetParent() );
    VclPtr<ToolBox> aTbx( new ToolBox(GetParent()) );
    if( GetItemCount() == 0 )
    {
        ResMgr* pResMgr = ImplGetResMgr();
@@ -68,7 +68,7 @@ void DecoToolBox::calcMinSize()
        Bitmap aBitmap;
        if( pResMgr )
            aBitmap = Bitmap( ResId( SV_RESID_BITMAP_CLOSEDOC, *pResMgr ) );
        aTbx.InsertItem( IID_DOCUMENTCLOSE, Image( aBitmap ) );
        aTbx->InsertItem( IID_DOCUMENTCLOSE, Image( aBitmap ) );
    }
    else
    {
@@ -76,11 +76,11 @@ void DecoToolBox::calcMinSize()
        for( sal_uInt16 i = 0; i < nItems; i++ )
        {
            sal_uInt16 nId = GetItemId( i );
            aTbx.InsertItem( nId, GetItemImage( nId ) );
            aTbx->InsertItem( nId, GetItemImage( nId ) );
        }
    }
    aTbx.SetOutStyle( TOOLBOX_STYLE_FLAT );
    maMinSize = aTbx.CalcWindowSizePixel();
    aTbx->SetOutStyle( TOOLBOX_STYLE_FLAT );
    maMinSize = aTbx->CalcWindowSizePixel();
}

void DecoToolBox::SetImages( long nMaxHeight, bool bForce )
diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx
index 4611f37..92abca9 100644
--- a/vcl/unx/generic/printer/cupsmgr.cxx
+++ b/vcl/unx/generic/printer/cupsmgr.cxx
@@ -952,11 +952,11 @@ namespace
    {
        bool bRet = false;

        RTSPWDialog aDialog(rServer, rUserName, NULL);
        if (aDialog.Execute())
        VclPtr<RTSPWDialog> aDialog(new RTSPWDialog(rServer, rUserName, NULL));
        if (aDialog->Execute())
        {
            rUserName = aDialog.getUserName();
            rPassword = aDialog.getPassword();
            rUserName = aDialog->getUserName();
            rPassword = aDialog->getPassword();
            bRet = true;
        }

diff --git a/vcl/unx/x11/x11sys.cxx b/vcl/unx/x11/x11sys.cxx
index 5882fdb..1e6ebe5 100644
--- a/vcl/unx/x11/x11sys.cxx
+++ b/vcl/unx/x11/x11sys.cxx
@@ -134,19 +134,19 @@ int X11SalSystem::ShowNativeDialog( const OUString& rTitle, const OUString& rMes
    if( pSVData->mpIntroWindow )
        pSVData->mpIntroWindow->Hide();

    WarningBox aWarn( NULL, WB_STDWORK, rMessage );
    aWarn.SetText( rTitle );
    aWarn.Clear();
    VclPtr<WarningBox> aWarn(new WarningBox(NULL, WB_STDWORK, rMessage) );
    aWarn->SetText( rTitle );
    aWarn->Clear();

    sal_uInt16 nButton = 0;
    for( std::list< OUString >::const_iterator it = rButtons.begin(); it != rButtons.end(); ++it )
    {
            aWarn.AddButton( *it, nButton+1, nButton == (sal_uInt16)nDefButton ? BUTTONDIALOG_DEFBUTTON : 0 );
            aWarn->AddButton( *it, nButton+1, nButton == (sal_uInt16)nDefButton ? BUTTONDIALOG_DEFBUTTON : 0 );
            nButton++;
    }
    aWarn.SetFocusButton( (sal_uInt16)nDefButton+1 );
    aWarn->SetFocusButton( (sal_uInt16)nDefButton+1 );

    nRet = ((int)aWarn.Execute()) - 1;
    nRet = ((int)aWarn->Execute()) - 1;

    // normalize behaviour, actually this should never happen
    if( nRet < -1 || nRet >= int(rButtons.size()) )
diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx
index 72869d1..cf7a0d0e 100644
--- a/vcl/workben/outdevgrind.cxx
+++ b/vcl/workben/outdevgrind.cxx
@@ -898,8 +898,8 @@ sal_uInt16 GrindApp::Exception( sal_uInt16 nError )

int GrindApp::Main()
{
    TestWindow aWindow;
    aWindow.Execute();
    VclPtr<TestWindow> aWindow(new TestWindow);
    aWindow->Execute();
    return 0;
}

diff --git a/vcl/workben/svdem.cxx b/vcl/workben/svdem.cxx
index a06bf5c..6b2e233 100644
--- a/vcl/workben/svdem.cxx
+++ b/vcl/workben/svdem.cxx
@@ -81,9 +81,9 @@ public:

void Main()
{
    MyWin aMainWin( NULL, WB_APP | WB_STDWORK );
    aMainWin.SetText(OUString("VCL - Workbench"));
    aMainWin.Show();
    VclPtr<MyWin> aMainWin(new MyWin(NULL, WB_APP | WB_STDWORK) );
    aMainWin->SetText(OUString("VCL - Workbench"));
    aMainWin->Show();

    Application::Execute();
}
diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx
index 708efb9..7bbcdf2 100644
--- a/vcl/workben/svpclient.cxx
+++ b/vcl/workben/svpclient.cxx
@@ -120,9 +120,9 @@ public:

void Main()
{
    MyWin aMainWin( NULL, WB_STDWORK );
    aMainWin.SetText( OUString( "SvpClient" ) );
    aMainWin.Show();
    VclPtr<MyWin> aMainWin(new MyWin(NULL, WB_STDWORK) );
    aMainWin->SetText( OUString( "SvpClient" ) );
    aMainWin->Show();

    Application::Execute();
}
diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx
index ebf716c..ea69886 100644
--- a/vcl/workben/svptest.cxx
+++ b/vcl/workben/svptest.cxx
@@ -34,6 +34,7 @@
#include <vcl/bitmap.hxx>
#include <vcl/bmpacc.hxx>
#include <vcl/metric.hxx>
#include <vcl/vclptr.hxx>

#include <rtl/ustrbuf.hxx>

@@ -90,9 +91,9 @@ public:

void Main()
{
    MyWin aMainWin( NULL, WB_APP | WB_STDWORK );
    aMainWin.SetText( OUString( "VCL - Workbench" ) );
    aMainWin.Show();
    VclPtr<MyWin> aMainWin(new MyWin(NULL, WB_APP | WB_STDWORK) );
    aMainWin->SetText( OUString( "VCL - Workbench" ) );
    aMainWin->Show();

    Application::Execute();
}
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 9860d7d..14a5780 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1609,18 +1609,18 @@ public:
                }
            }

            DemoWin aMainWin(aRenderer, bThreads);
            VclPtr<DemoWin> aMainWin(new DemoWin(aRenderer, bThreads));
            std::unique_ptr<DemoWidgets> xWidgets;
            std::unique_ptr<DemoPopup> xPopup;

            aMainWin.SetText("Interactive VCL demo #1");
            aMainWin->SetText("Interactive VCL demo #1");

            if (bWidgets)
                xWidgets.reset(new DemoWidgets());
            else if (bPopup)
                xPopup.reset(new DemoPopup());
            else
                aMainWin.Show();
                aMainWin->Show();

            Application::Execute();
        }
diff --git a/writerperfect/source/writer/WordPerfectImportFilter.cxx b/writerperfect/source/writer/WordPerfectImportFilter.cxx
index 5294e2e..a8e7c3e 100644
--- a/writerperfect/source/writer/WordPerfectImportFilter.cxx
+++ b/writerperfect/source/writer/WordPerfectImportFilter.cxx
@@ -119,11 +119,11 @@ throw (RuntimeException, std::exception)
        int unsuccessfulAttempts = 0;
        while (true)
        {
            SfxPasswordDialog aPasswdDlg(0);
            aPasswdDlg.SetMinLen(0);
            if (!aPasswdDlg.Execute())
            VclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog(0));
            aPasswdDlg->SetMinLen(0);
            if (!aPasswdDlg->Execute())
                return false;
            OUString aPasswd = aPasswdDlg.GetPassword();
            OUString aPasswd = aPasswdDlg->GetPassword();
            aUtf8Passwd = OUStringToOString(aPasswd, RTL_TEXTENCODING_UTF8);
            if (libwpd::WPD_PASSWORD_MATCH_OK == libwpd::WPDocument::verifyPassword(&input, aUtf8Passwd.getStr()))
                break;
@@ -303,11 +303,11 @@ throw (RuntimeException, std::exception)
        int unsuccessfulAttempts = 0;
        while (true)
        {
            SfxPasswordDialog aPasswdDlg(0);
            aPasswdDlg.SetMinLen(0);
            if (!aPasswdDlg.Execute())
            VclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog(0));
            aPasswdDlg->SetMinLen(0);
            if (!aPasswdDlg->Execute())
                return com::sun::star::ui::dialogs::ExecutableDialogResults::CANCEL;
            msPassword = aPasswdDlg.GetPassword().getStr();
            msPassword = aPasswdDlg->GetPassword().getStr();
            aUtf8Passwd = OUStringToOString(msPassword, RTL_TEXTENCODING_UTF8);
            if (libwpd::WPD_PASSWORD_MATCH_OK == libwpd::WPDocument::verifyPassword(&input, aUtf8Passwd.getStr()))
                break;
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index acaac53e..16301d1 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -222,17 +222,17 @@ bool DocumentDigitalSignatures::ImplViewSignatures(
    DocumentSignatureMode eMode, bool bReadOnly ) throw (RuntimeException, std::exception)
{
    bool bChanges = false;
    DigitalSignaturesDialog aSignaturesDialog(
        NULL, mxCtx, eMode, bReadOnly, m_sODFVersion, m_bHasDocumentSignature);
    bool bInit = aSignaturesDialog.Init();
    VclPtr<DigitalSignaturesDialog> aSignaturesDialog(new DigitalSignaturesDialog(
        NULL, mxCtx, eMode, bReadOnly, m_sODFVersion, m_bHasDocumentSignature));
    bool bInit = aSignaturesDialog->Init();
    DBG_ASSERT( bInit, "Error initializing security context!" );
    if ( bInit )
    {
        aSignaturesDialog.SetStorage( rxStorage );
        aSignaturesDialog.SetSignatureStream( xSignStream );
        if ( aSignaturesDialog.Execute() )
        aSignaturesDialog->SetStorage( rxStorage );
        aSignaturesDialog->SetSignatureStream( xSignStream );
        if ( aSignaturesDialog->Execute() )
        {
            if ( aSignaturesDialog.SignaturesChanged() )
            if ( aSignaturesDialog->SignaturesChanged() )
            {
                bChanges = true;
                // If we have a storage and no stream, we are responsible for commit
@@ -246,8 +246,8 @@ bool DocumentDigitalSignatures::ImplViewSignatures(
    }
    else
    {
        MessageDialog aBox(NULL, XMLSEC_RES(RID_XMLSECWB_NO_MOZILLA_PROFILE), VCL_MESSAGE_WARNING);
        aBox.Execute();
        VclPtr<MessageDialog> aBox(new MessageDialog(NULL, XMLSEC_RES(RID_XMLSECWB_NO_MOZILLA_PROFILE), VCL_MESSAGE_WARNING));
        aBox->Execute();
    }

    return bChanges;
@@ -386,8 +386,8 @@ void DocumentDigitalSignatures::manageTrustedSources(  ) throw (RuntimeException
    if ( aSignatureHelper.Init() )
        xSecEnv = aSignatureHelper.GetSecurityEnvironment();

    MacroSecurity aDlg( NULL, mxCtx, xSecEnv );
    aDlg.Execute();
    VclPtr<MacroSecurity> aDlg(new MacroSecurity( NULL, mxCtx, xSecEnv ) );
    aDlg->Execute();
}

void DocumentDigitalSignatures::showCertificate(
@@ -401,8 +401,8 @@ void DocumentDigitalSignatures::showCertificate(

    if ( bInit )
    {
        CertificateViewer aViewer( NULL, aSignatureHelper.GetSecurityEnvironment(), _Certificate, false );
        aViewer.Execute();
        VclPtr<CertificateViewer> aViewer(new CertificateViewer( NULL, aSignatureHelper.GetSecurityEnvironment(), _Certificate, false ) );
        aViewer->Execute();
    }

}
@@ -441,12 +441,12 @@ Reference< css::security::XCertificate > DocumentDigitalSignatures::chooseCertif
    if ( aSignatureHelper.Init() )
        xSecEnv = aSignatureHelper.GetSecurityEnvironment();

    CertificateChooser aChooser( NULL, mxCtx, xSecEnv, aSignatureHelper.GetSignatureInformations());
    VclPtr<CertificateChooser> aChooser(new CertificateChooser( NULL, mxCtx, xSecEnv, aSignatureHelper.GetSignatureInformations()) );

    if (aChooser.Execute() != RET_OK)
    if (aChooser->Execute() != RET_OK)
        return Reference< css::security::XCertificate >(0);

    Reference< css::security::XCertificate > xCert = aChooser.GetSelectedCertificate();
    Reference< css::security::XCertificate > xCert = aChooser->GetSelectedCertificate();

    if ( !xCert.is() )
        return Reference< css::security::XCertificate >(0);
diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx
index dfd3a54..576013a 100644
--- a/xmlsecurity/source/dialogs/certificatechooser.cxx
+++ b/xmlsecurity/source/dialogs/certificatechooser.cxx
@@ -223,8 +223,8 @@ void CertificateChooser::ImplShowCertificateDetails()
    uno::Reference< css::security::XCertificate > xCert = GetSelectedCertificate();
    if( xCert.is() )
    {
        CertificateViewer aViewer( this, mxSecurityEnvironment, xCert, true );
        aViewer.Execute();
        VclPtr<CertificateViewer> aViewer(new CertificateViewer( this, mxSecurityEnvironment, xCert, true ));
        aViewer->Execute();
    }
}

diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx
index 4c67c84..6de4d96 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.cxx
+++ b/xmlsecurity/source/dialogs/certificateviewer.cxx
@@ -382,8 +382,8 @@ IMPL_LINK_NOARG(CertificateViewerCertPathTP, ViewCertHdl)
    SvTreeListEntry* pEntry = mpCertPathLB->FirstSelected();
    if( pEntry )
    {
        CertificateViewer aViewer( this, mpDlg->mxSecurityEnvironment, static_cast<CertPath_UserData*>(pEntry->GetUserData())->mxCert, false );
        aViewer.Execute();
        ScopedVclPtr<CertificateViewer> aViewer( this, mpDlg->mxSecurityEnvironment, static_cast<CertPath_UserData*>(pEntry->GetUserData())->mxCert, false );
        aViewer->Execute();
    }

    return 0;
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 948655c..ab127de 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -298,8 +298,8 @@ bool DigitalSignaturesDialog::canAddRemove()
    if ( (!bSave1_1  && bDoc1_1) || (bSave1_1 && bDoc1_1) )
    {
        //#4
        MessageDialog err(NULL, XMLSEC_RES(STR_XMLSECDLG_OLD_ODF_FORMAT));
        err.Execute();
        VclPtr<MessageDialog> err(new MessageDialog(NULL, XMLSEC_RES(STR_XMLSECDLG_OLD_ODF_FORMAT)));
        err->Execute();
        ret = false;
    }

@@ -417,10 +417,10 @@ IMPL_LINK_NOARG(DigitalSignaturesDialog, AddButtonHdl)

        uno::Reference<com::sun::star::security::XSerialNumberAdapter> xSerialNumberAdapter =
            ::com::sun::star::security::SerialNumberAdapter::create(mxCtx);
        CertificateChooser aChooser( this, mxCtx, xSecEnv, maCurrentSignatureInformations );
        if ( aChooser.Execute() == RET_OK )
        VclPtr<CertificateChooser> aChooser(new CertificateChooser( this, mxCtx, xSecEnv, maCurrentSignatureInformations ));
        if ( aChooser->Execute() == RET_OK )
        {
            uno::Reference< ::com::sun::star::security::XCertificate > xCert = aChooser.GetSelectedCertificate();
            uno::Reference< ::com::sun::star::security::XCertificate > xCert = aChooser->GetSelectedCertificate();
            if ( !xCert.is() )
            {
                SAL_WARN( "xmlsecurity.dialogs", "no certificate selected" );
@@ -752,8 +752,8 @@ void DigitalSignaturesDialog::ImplShowSignaturesDetails()
        DBG_ASSERT( xCert.is(), "Error getting cCertificate!" );
        if ( xCert.is() )
        {
            CertificateViewer aViewer( this, maSignatureHelper.GetSecurityEnvironment(), xCert, false );
            aViewer.Execute();
            VclPtr<CertificateViewer> aViewer(new CertificateViewer( this, maSignatureHelper.GetSecurityEnvironment(), xCert, false ));
            aViewer->Execute();
        }
    }
}
diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx
index 3fc6065..e5bcabc 100644
--- a/xmlsecurity/source/dialogs/macrosecurity.cxx
+++ b/xmlsecurity/source/dialogs/macrosecurity.cxx
@@ -208,8 +208,8 @@ IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, ViewCertPBHdl)

        if ( xCert.is() )
        {
            CertificateViewer aViewer( this, mpDlg->mxSecurityEnvironment, xCert, false );
            aViewer.Execute();
            VclPtr<CertificateViewer> aViewer(new CertificateViewer( this, mpDlg->mxSecurityEnvironment, xCert, false ));
            aViewer->Execute();
        }
    }
    return 0;