[Libreoffice-commits] core.git: basctl/source cui/source dbaccess/source desktop/source extensions/source filter/source fpicker/source scripting/source sc/source sd/source sfx2/source sot/source svx/source uui/source vcl/android vcl/ios vcl/source

Caolán McNamara caolanm at redhat.com
Mon Aug 18 02:57:52 PDT 2014


 basctl/source/basicide/baside2.cxx                         |    8 +--
 basctl/source/basicide/baside3.cxx                         |    3 -
 basctl/source/basicide/basobj2.cxx                         |    8 +--
 basctl/source/basicide/basobj3.cxx                         |    6 +-
 basctl/source/basicide/bastypes.cxx                        |    8 +--
 basctl/source/basicide/macrodlg.cxx                        |    8 +--
 basctl/source/basicide/moduldlg.cxx                        |   10 +---
 cui/source/dialogs/SpellDialog.cxx                         |    6 +-
 cui/source/dialogs/about.cxx                               |    4 -
 cui/source/dialogs/insdlg.cxx                              |    9 +--
 cui/source/dialogs/passwdomdlg.cxx                         |    7 +-
 cui/source/dialogs/scriptdlg.cxx                           |   14 ++---
 cui/source/options/doclinkdialog.cxx                       |    8 +--
 cui/source/options/optjava.cxx                             |    5 --
 cui/source/tabpages/tparea.cxx                             |    4 -
 dbaccess/source/ui/app/AppControllerDnD.cxx                |    4 -
 dbaccess/source/ui/dlg/TextConnectionHelper.cxx            |    4 -
 dbaccess/source/ui/dlg/UserAdmin.cxx                       |    4 -
 dbaccess/source/ui/dlg/adminpages.cxx                      |    4 -
 dbaccess/source/ui/dlg/directsql.cxx                       |    4 -
 dbaccess/source/ui/dlg/indexdialog.cxx                     |    6 +-
 dbaccess/source/ui/dlg/paramdialog.cxx                     |    4 -
 desktop/source/deployment/gui/dp_gui_dialog2.cxx           |    3 -
 desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx |    9 ++-
 desktop/source/deployment/gui/dp_gui_service.cxx           |    8 +--
 extensions/source/scanner/sanedlg.cxx                      |   13 ++---
 filter/source/xsltdialog/xmlfiltertabdialog.cxx            |    4 -
 fpicker/source/office/iodlg.cxx                            |    8 +--
 sc/source/core/data/documen8.cxx                           |    2 
 sc/source/core/data/validat.cxx                            |    7 +-
 sc/source/ui/dbgui/dbnamdlg.cxx                            |    2 
 sc/source/ui/dbgui/filtdlg.cxx                             |    5 --
 sc/source/ui/dbgui/sfiltdlg.cxx                            |    3 -
 sc/source/ui/dbgui/tpsort.cxx                              |    4 -
 sc/source/ui/docshell/documentlinkmgr.cxx                  |    4 -
 sc/source/ui/miscdlgs/crnrdlg.cxx                          |    2 
 sc/source/ui/miscdlgs/filldlg.cxx                          |    5 --
 sc/source/ui/miscdlgs/instbdlg.cxx                         |    2 
 sc/source/ui/miscdlgs/optsolver.cxx                        |    2 
 sc/source/ui/miscdlgs/scuiautofmt.cxx                      |   14 +++--
 sc/source/ui/miscdlgs/solvrdlg.cxx                         |    2 
 sc/source/ui/optdlg/tpcalc.cxx                             |    3 -
 sc/source/ui/optdlg/tpusrlst.cxx                           |    2 
 sc/source/ui/pagedlg/areasdlg.cxx                          |    3 -
 sc/source/ui/view/cellsh3.cxx                              |    6 +-
 sc/source/ui/view/dbfunc.cxx                               |    4 -
 sc/source/ui/view/tabvwshf.cxx                             |    3 -
 scripting/source/dlgprov/dlgevtatt.cxx                     |    4 -
 sd/source/core/drawdoc3.cxx                                |    3 -
 sd/source/filter/grf/sdgrffilter.cxx                       |    4 -
 sd/source/filter/html/pubdlg.cxx                           |    4 -
 sd/source/ui/app/sdmod1.cxx                                |    2 
 sd/source/ui/dlg/brkdlg.cxx                                |    2 
 sd/source/ui/dlg/sdtreelb.cxx                              |    4 -
 sd/source/ui/func/fuinsert.cxx                             |    2 
 sd/source/ui/func/fuinsfil.cxx                             |    8 +--
 sd/source/ui/func/futhes.cxx                               |    6 +-
 sd/source/ui/view/Outliner.cxx                             |    3 -
 sfx2/source/appl/lnkbase2.cxx                              |    4 -
 sfx2/source/appl/sfxhelp.cxx                               |    9 +--
 sfx2/source/doc/objserv.cxx                                |   10 ++--
 sfx2/source/doc/templatedlg.cxx                            |   32 ++++++-------
 sfx2/source/view/viewprn.cxx                               |   10 ++--
 sot/source/sdstor/stgcache.cxx                             |   28 -----------
 svx/source/dialog/passwd.cxx                               |    7 +-
 svx/source/form/fmshimp.cxx                                |    7 +-
 uui/source/masterpasscrtdlg.cxx                            |    8 ---
 uui/source/masterpassworddlg.cxx                           |    4 -
 uui/source/nameclashdlg.cxx                                |    4 -
 uui/source/passworddlg.cxx                                 |    6 +-
 vcl/android/androidinst.cxx                                |    6 +-
 vcl/ios/iosinst.cxx                                        |    8 +--
 vcl/source/app/dbggui.cxx                                  |    4 -
 vcl/source/app/stdtext.cxx                                 |   14 +----
 vcl/source/app/svdata.cxx                                  |    4 -
 75 files changed, 206 insertions(+), 259 deletions(-)

New commits:
commit a107bdfdfc1baf73f14055262d64bf616fc0a889
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 18 08:50:54 2014 +0100

    ErrorBox->MessageDialog
    
    Change-Id: I57d4e43460e40d3aff54873280eddbb18c12446b

diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index d820fe9..330d37b 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -52,7 +52,7 @@
 #include <vcl/xtextedt.hxx>
 #include <vcl/settings.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <cassert>
 #include <basic/codecompletecache.hxx>
 #include <svtools/miscopt.hxx>
@@ -317,7 +317,7 @@ bool ModulWindow::BasicExecute()
     {
         if ( !aDocument.allowMacros() )
         {
-            WarningBox( this, WB_OK, IDE_RESSTR(RID_STR_CANNOTRUNMACRO)).Execute();
+            MessageDialog(this, IDE_RESSTR(RID_STR_CANNOTRUNMACRO), VCL_MESSAGE_WARNING).Execute();
             return false;
         }
     }
@@ -455,7 +455,7 @@ bool ModulWindow::LoadBasic()
                 bDone = true;
         }
         else
-            ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_COULDNTREAD) ).Execute();
+            MessageDialog(this, IDE_RESSTR(RID_STR_COULDNTREAD)).Execute();
     }
     return bDone;
 }
@@ -501,7 +501,7 @@ bool ModulWindow::SaveBasicSource()
                 bDone = true;
         }
         else
-            ErrorBox( this, WB_OK | WB_DEF_OK, IDEResId(RID_STR_COULDNTWRITE).toString() ).Execute();
+            MessageDialog(this, IDEResId(RID_STR_COULDNTWRITE)).Execute();
     }
 
     return bDone;
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index ab106f6..1e1e84f 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -52,6 +52,7 @@
 #include <svl/whiter.hxx>
 #include <tools/diagnose_ex.h>
 #include <tools/urlobj.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/msgbox.hxx>
 #include <vcl/settings.hxx>
 #include <xmlscript/xmldlg_imexp.hxx>
@@ -858,7 +859,7 @@ bool DialogWindow::SaveDialog()
             }
         }
         else
-            ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_COULDNTWRITE)).Execute();
+            MessageDialog(this, IDE_RESSTR(RID_STR_COULDNTWRITE)).Execute();
     }
 
     return bDone;
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index 9fc771c..f2edd2b 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -38,7 +38,7 @@
 #include <framework/documentundoguard.hxx>
 #include <tools/diagnose_ex.h>
 #include <unotools/moduleoptions.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 
 #include <vector>
 #include <algorithm>
@@ -160,7 +160,7 @@ bool RenameModule (
 
     if ( rDocument.hasModule( rLibName, rNewName ) )
     {
-        ErrorBox aError( pErrorParent, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2) );
+        MessageDialog aError(pErrorParent, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2));
         aError.Execute();
         return false;
     }
@@ -168,7 +168,7 @@ bool RenameModule (
     // #i74440
     if ( rNewName.isEmpty() )
     {
-        ErrorBox aError( pErrorParent, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_BADSBXNAME) );
+        MessageDialog aError(pErrorParent, IDE_RESSTR(RID_STR_BADSBXNAME));
         aError.Execute();
         return false;
     }
@@ -342,7 +342,7 @@ OUString ChooseMacro( const uno::Reference< frame::XModel >& rxLimitToDocument,
                     {
                         // error
                         bError = true;
-                        ErrorBox( NULL, WB_OK | WB_DEF_OK, IDEResId(RID_STR_ERRORCHOOSEMACRO).toString() ).Execute();
+                        MessageDialog(NULL, IDEResId(RID_STR_ERRORCHOOSEMACRO)).Execute();
                     }
                 }
             }
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index 359f9df..1ac3d3d 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <algorithm>
 #include <basic/basmgr.hxx>
 #include <basic/sbmeth.hxx>
@@ -171,7 +171,7 @@ bool RenameDialog (
 
     if ( rDocument.hasDialog( rLibName, rNewName ) )
     {
-        ErrorBox aError( pErrorParent, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2) );
+        MessageDialog aError(pErrorParent, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2));
         aError.Execute();
         return false;
     }
@@ -179,7 +179,7 @@ bool RenameDialog (
     // #i74440
     if ( rNewName.isEmpty() )
     {
-        ErrorBox aError( pErrorParent, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_BADSBXNAME) );
+        MessageDialog aError(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 7da4f17..718b6e3 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -35,7 +35,7 @@
 #include <sfx2/viewfrm.hxx>
 #include <svl/intitem.hxx>
 #include <svl/stritem.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <tools/stream.hxx>
 
 namespace basctl
@@ -548,7 +548,7 @@ TabBarAllowRenamingReturnCode TabBar::AllowRenaming()
     bool const bValid = IsValidSbxName(GetEditText());
 
     if ( !bValid )
-        ErrorBox( this, WB_OK | WB_DEF_OK, IDEResId(RID_STR_BADSBXNAME).toString() ).Execute();
+        MessageDialog(this, IDEResId(RID_STR_BADSBXNAME)).Execute();
 
     return bValid ? TABBAR_RENAMING_YES : TABBAR_RENAMING_NO;
 }
@@ -789,7 +789,7 @@ bool QueryDel( const OUString& rName, const ResId& rId, Window* pParent )
     aNameBuf.append('\'');
     aNameBuf.insert(0, '\'');
     aQuery = aQuery.replaceAll("XX", aNameBuf.makeStringAndClear());
-    QueryBox aQueryBox( pParent, WB_YES_NO | WB_DEF_YES, aQuery );
+    MessageDialog aQueryBox(pParent, aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
     return ( aQueryBox.Execute() == RET_YES );
 }
 
@@ -854,7 +854,7 @@ bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer,
 
                     if ( !bOK )
                     {
-                        ErrorBox aErrorBox( Application::GetDefDialogParent(), WB_OK, IDE_RESSTR(RID_STR_WRONGPASSWORD) );
+                        MessageDialog aErrorBox(Application::GetDefDialogParent(), IDE_RESSTR(RID_STR_WRONGPASSWORD));
                         aErrorBox.Execute();
                     }
                 }
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx
index 8fd1b94..fb86212 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 
 #include <macrodlg.hxx>
 #include <macrodlg.hrc>
@@ -622,7 +622,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton )
                 ScriptDocument aDocument( ScriptDocument::getDocumentForBasicManager( pBasMgr ) );
                 if ( aDocument.isDocument() && !aDocument.allowMacros() )
                 {
-                    WarningBox( this, WB_OK, IDEResId(RID_STR_CANNOTRUNMACRO).toString() ).Execute();
+                    MessageDialog(this, IDEResId(RID_STR_CANNOTRUNMACRO), VCL_MESSAGE_WARNING).Execute();
                     return 0;
                 }
             }
@@ -631,7 +631,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton )
         {
             if ( !IsValidSbxName(m_pMacroNameEdit->GetText()) )
             {
-                ErrorBox( this, WB_OK | WB_DEF_OK, IDEResId(RID_STR_BADSBXNAME).toString() ).Execute();
+                MessageDialog(this, IDEResId(RID_STR_BADSBXNAME)).Execute();
                 m_pMacroNameEdit->SetSelection( Selection( 0, m_pMacroNameEdit->GetText().getLength() ) );
                 m_pMacroNameEdit->GrabFocus();
                 return 0;
@@ -699,7 +699,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton )
             {
                 if ( !IsValidSbxName(m_pMacroNameEdit->GetText()) )
                 {
-                    ErrorBox( this, WB_OK | WB_DEF_OK, IDEResId(RID_STR_BADSBXNAME).toString() ).Execute();
+                    MessageDialog(this, IDEResId(RID_STR_BADSBXNAME)).Execute();
                     m_pMacroNameEdit->SetSelection( Selection( 0, m_pMacroNameEdit->GetText().getLength() ) );
                     m_pMacroNameEdit->GrabFocus();
                     return 1;
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index dbae150..9586a4f 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -35,7 +35,7 @@
 #include <sfx2/viewfrm.hxx>
 #include <svl/itemset.hxx>
 #include <svl/stritem.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <tools/diagnose_ex.h>
 #include <xmlscript/xmldlg_imexp.hxx>
 #include <svtools/treelistentry.hxx>
@@ -99,7 +99,7 @@ bool ExtTreeListBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewT
 {
     if ( !IsValidSbxName(rNewText) )
     {
-        ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_BADSBXNAME) ).Execute();
+        MessageDialog(this, IDE_RESSTR(RID_STR_BADSBXNAME)).Execute();
         return false;
     }
 
@@ -816,8 +816,7 @@ void ObjectPage::NewDialog()
 
             if ( aDocument.hasDialog( aLibName, aDlgName ) )
             {
-                ErrorBox( this, WB_OK | WB_DEF_OK,
-                          IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2) ).Execute();
+                MessageDialog(this, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2)).Execute();
             }
             else
             {
@@ -1014,8 +1013,7 @@ SbModule* createModImpl( Window* pWin, const ScriptDocument& rDocument,
         }
         catch (const container::ElementExistException& )
         {
-            ErrorBox( pWin, WB_OK | WB_DEF_OK,
-                      IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2) ).Execute();
+            MessageDialog(pWin, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2)).Execute();
         }
         catch (const container::NoSuchElementException& )
         {
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index ddcdc42..bae28d3 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -20,7 +20,7 @@
 #include <tools/shl.hxx>
 #include <vcl/wrkwin.hxx>
 #include <vcl/menu.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/scrbar.hxx>
 #include <vcl/settings.hxx>
 #include <SpellAttrib.hxx>
@@ -2030,8 +2030,8 @@ IMPL_LINK( SpellDialog, HandleHyperlink, FixedHyperlink*, pHyperlink )
         uno::Any exc( ::cppu::getCaughtException() );
         OUString msg( ::comphelper::anyToString( exc ) );
         const SolarMutexGuard guard;
-        ErrorBox aErrorBox( NULL, WB_OK, msg );
-        aErrorBox.SetText( sTitle );
+        MessageDialog aErrorBox(NULL, msg);
+        aErrorBox.SetText(sTitle);
         aErrorBox.Execute();
     }
 
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index ff61962..06a9913 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -19,7 +19,7 @@
 
 #include <vcl/layout.hxx>
 #include <vcl/svapp.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/settings.hxx>
 
 #include <tools/stream.hxx>
@@ -127,7 +127,7 @@ IMPL_LINK( AboutDialog, HandleClick, PushButton*, pButton )
         Any exc( ::cppu::getCaughtException() );
         OUString msg( ::comphelper::anyToString( exc ) );
         const SolarMutexGuard guard;
-        ErrorBox aErrorBox( NULL, WB_OK, msg );
+        MessageDialog aErrorBox(NULL, msg);
         aErrorBox.SetText( GetText() );
         aErrorBox.Execute();
     }
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index fe7dfea..6a092a6 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -46,7 +46,6 @@
 #include <vcl/group.hxx>
 #include <vcl/layout.hxx>
 #include <vcl/lstbox.hxx>
-#include <vcl/msgbox.hxx>
 #include <vcl/svapp.hxx>
 #include <comphelper/classids.hxx>
 #include <sfx2/frmdescr.hxx>
@@ -280,7 +279,7 @@ short SvInsertOleDlg::Execute()
                         // global Resource from svtools (former so3 resource)
                         OUString aErr( impl_getSvtResString( STR_ERROR_OBJNOCREATE_FROM_FILE ) );
                         aErr = aErr.replaceFirst( "%", aFileName );
-                        ErrorBox( this, WB_3DLOOK | WB_OK, aErr ).Execute();
+                        MessageDialog(this, aErr).Execute();
                     }
                     else
                     {
@@ -288,7 +287,7 @@ short SvInsertOleDlg::Execute()
                         // global Resource from svtools (former so3 resource)
                         OUString aErr( impl_getSvtResString( STR_ERROR_OBJNOCREATE ) );
                         aErr = aErr.replaceFirst( "%", aServerName );
-                        ErrorBox( this, WB_3DLOOK | WB_OK, aErr ).Execute();
+                        MessageDialog(this, aErr).Execute();
                     }
                 }
             }
@@ -329,7 +328,7 @@ short SvInsertOleDlg::Execute()
                 // global Resource from svtools (former so3 resource)
                 OUString aErr( impl_getSvtResString( STR_ERROR_OBJNOCREATE_FROM_FILE ) );
                 aErr = aErr.replaceFirst( "%", aFileName );
-                ErrorBox( this, WB_3DLOOK | WB_OK, aErr ).Execute();
+                MessageDialog(this, aErr).Execute();
             }
         }
     }
@@ -466,7 +465,7 @@ short SvInsertPlugInDialog::Execute()
             // global Resource from svtools (former so3 resource)
             OUString aErr( impl_getSvtResString( STR_ERROR_OBJNOCREATE_PLUGIN ) );
             aErr = aErr.replaceFirst( "%", aURL );
-            ErrorBox( this, WB_3DLOOK | WB_OK, aErr ).Execute();
+            MessageDialog(this, aErr).Execute();
         }
     }
 
diff --git a/cui/source/dialogs/passwdomdlg.cxx b/cui/source/dialogs/passwdomdlg.cxx
index 1a86bc4..cf9faf8 100644
--- a/cui/source/dialogs/passwdomdlg.cxx
+++ b/cui/source/dialogs/passwdomdlg.cxx
@@ -28,7 +28,6 @@
 #include <vcl/button.hxx>
 #include <vcl/layout.hxx>
 #include <vcl/settings.hxx>
-#include <vcl/msgbox.hxx>
 
 struct PasswordToOpenModifyDialog_Impl
 {
@@ -102,8 +101,8 @@ IMPL_LINK( PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, OKButton *, EMPTYARG
             m_pPasswdToModifyED->GetText().isEmpty();
     if (bInvalidState)
     {
-        ErrorBox aErrorBox( m_pParent, WB_OK,
-            m_bIsPasswordToModify? m_aInvalidStateForOkButton : m_aInvalidStateForOkButton_v2 );
+        MessageDialog aErrorBox(m_pParent,
+            m_bIsPasswordToModify? m_aInvalidStateForOkButton : m_aInvalidStateForOkButton_v2);
         aErrorBox.Execute();
     }
     else // check for mismatched passwords...
@@ -113,7 +112,7 @@ IMPL_LINK( PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, OKButton *, EMPTYARG
         const int nMismatch = (bToOpenMatch? 0 : 1) + (bToModifyMatch? 0 : 1);
         if (nMismatch > 0)
         {
-            ErrorBox aErrorBox( m_pParent, WB_OK, nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch );
+            MessageDialog aErrorBox(m_pParent, nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch);
             aErrorBox.Execute();
 
             Edit* pEdit = !bToOpenMatch ? m_pPasswdToOpenED : m_pPasswdToModifyED;
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 1e43a57..358e5d5 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -21,7 +21,7 @@
 
 #include <sfx2/objsh.hxx>
 #include <vcl/svapp.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <osl/mutex.hxx>
 
 #include <cuires.hrc>
@@ -906,7 +906,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
                         bValid = false;
                         OUString aError( m_createErrStr );
                         aError += m_createDupStr;
-                        ErrorBox aErrorBox( static_cast<Window*>(this), WB_OK | RET_OK, aError );
+                        MessageDialog aErrorBox(static_cast<Window*>(this), aError);
                         aErrorBox.SetText( m_createErrTitleStr );
                         aErrorBox.Execute();
                         xNewDlg->SetObjectName( aNewName );
@@ -993,7 +993,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
     {
         //ISSUE L10N & message from exception?
         OUString aError( m_createErrStr );
-        ErrorBox aErrorBox( static_cast<Window*>(this), WB_OK | RET_OK, aError );
+        MessageDialog aErrorBox(static_cast<Window*>(this), aError);
         aErrorBox.SetText( m_createErrTitleStr );
         aErrorBox.Execute();
     }
@@ -1069,7 +1069,7 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry )
     {
         //ISSUE L10N & message from exception?
         OUString aError( m_renameErrStr );
-        ErrorBox aErrorBox( static_cast<Window*>(this), WB_OK | RET_OK, aError );
+        MessageDialog aErrorBox(static_cast<Window*>(this), aError);
         aErrorBox.SetText( m_renameErrTitleStr );
         aErrorBox.Execute();
     }
@@ -1080,7 +1080,7 @@ 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 );
-    QueryBox aQueryBox( static_cast<Window*>(this), WB_YES_NO | WB_DEF_YES, aQuery );
+    MessageDialog aQueryBox(static_cast<Window*>(this), aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
     aQueryBox.SetText( m_delQueryTitleStr );
     if ( aQueryBox.Execute() == RET_NO )
     {
@@ -1115,7 +1115,7 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
     else
     {
         //ISSUE L10N & message from exception?
-        ErrorBox aErrorBox( static_cast<Window*>(this), WB_OK | RET_OK, m_delErrStr );
+        MessageDialog aErrorBox(static_cast<Window*>(this), m_delErrStr);
         aErrorBox.SetText( m_delErrTitleStr );
         aErrorBox.Execute();
     }
@@ -1487,7 +1487,7 @@ IMPL_LINK( SvxScriptErrorDialog, ShowDialog, OUString*, pMessage )
         message = OUString( CUI_RES( RID_SVXSTR_ERROR_TITLE ) );
     }
 
-    MessBox* pBox = new WarningBox( NULL, WB_OK, message );
+    MessageDialog* pBox = new MessageDialog(NULL, message, VCL_MESSAGE_WARNING);
     pBox->SetText( CUI_RES( RID_SVXSTR_ERROR_TITLE ) );
     pBox->Execute();
 
diff --git a/cui/source/options/doclinkdialog.cxx b/cui/source/options/doclinkdialog.cxx
index 7c8c2e0..ad1ba1f 100644
--- a/cui/source/options/doclinkdialog.cxx
+++ b/cui/source/options/doclinkdialog.cxx
@@ -23,7 +23,7 @@
 #include <comphelper/processfactory.hxx>
 #include <cuires.hrc>
 #include <svl/filenotation.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <ucbhelper/content.hxx>
 #include <dialmgr.hxx>
 #include <tools/urlobj.hxx>
@@ -116,7 +116,7 @@ namespace svx
         {
             OUString sMsg = CUI_RES(STR_LINKEDDOC_DOESNOTEXIST);
             sMsg = sMsg.replaceFirst("$file$", m_pURL->GetText());
-            ErrorBox aError(this, WB_OK , sMsg);
+            MessageDialog aError(this, sMsg);
             aError.Execute();
             return 0L;
         } // if (!bFileExists)
@@ -125,7 +125,7 @@ namespace svx
         {
             OUString sMsg = CUI_RES(STR_LINKEDDOC_NO_SYSTEM_FILE);
             sMsg = sMsg.replaceFirst("$file$", m_pURL->GetText());
-            ErrorBox aError(this, WB_OK , sMsg);
+            MessageDialog aError(this, sMsg);
             aError.Execute();
             return 0L;
         }
@@ -137,7 +137,7 @@ namespace svx
             {
                 OUString sMsg = CUI_RES(STR_NAME_CONFLICT);
                 sMsg = sMsg.replaceFirst("$file$", sCurrentText);
-                InfoBox aError(this, sMsg);
+                MessageDialog aError(this, sMsg, VCL_MESSAGE_INFO);
                 aError.Execute();
 
                 m_pName->SetSelection(Selection(0,sCurrentText.getLength()));
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 77f9e69..533bd97 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -32,7 +32,6 @@
 #include <vcl/help.hxx>
 #include <tools/urlobj.hxx>
 #include <vcl/layout.hxx>
-#include <vcl/msgbox.hxx>
 #include <vcl/waitobj.hxx>
 #include <unotools/pathoptions.hxx>
 #include <svtools/imagemgr.hxx>
@@ -978,7 +977,7 @@ IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddArchiveHdl_Impl)
         {
             OUString sMsg( CUI_RES( RID_SVXSTR_MULTIFILE_DBL_ERR ) );
             sMsg = sMsg.replaceFirst( "%1", sFile );
-            ErrorBox( this, WB_OK, sMsg ).Execute();
+            MessageDialog(this, sMsg).Execute();
         }
     }
     EnableRemoveButton();
@@ -1015,7 +1014,7 @@ IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddPathHdl_Impl)
         {
             OUString sMsg( CUI_RES( RID_SVXSTR_MULTIFILE_DBL_ERR ) );
             sMsg = sMsg.replaceFirst( "%1", sNewFolder );
-            ErrorBox( this, WB_OK, sMsg ).Execute();
+            MessageDialog(this, sMsg).Execute();
         }
     }
     EnableRemoveButton();
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 1b7a65e..8094413 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -43,7 +43,7 @@
 
 //UUUU
 #include "sfx2/opengrf.hxx"
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <boost/scoped_ptr.hpp>
 
 using namespace com::sun::star;
@@ -2166,7 +2166,7 @@ IMPL_LINK_NOARG( SvxAreaTabPage, ClickImportHdl_Impl )
         else
         {
             // graphic could not be loaded
-            ErrorBox(this, WB_OK, OUString(ResId(RID_SVXSTR_READ_DATA_ERROR, rMgr))).Execute();
+            MessageDialog (this, OUString(ResId(RID_SVXSTR_READ_DATA_ERROR, rMgr))).Execute();
         }
     }
 
diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx
index c657474..e0c111a 100644
--- a/dbaccess/source/ui/app/AppControllerDnD.cxx
+++ b/dbaccess/source/ui/app/AppControllerDnD.cxx
@@ -43,7 +43,7 @@
 #include <unotools/ucbhelper.hxx>
 #include "dlgsave.hxx"
 #include <comphelper/types.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <cppuhelper/exc_hlp.hxx>
 #include <connectivity/dbexception.hxx>
@@ -175,7 +175,7 @@ void OApplicationController::deleteTables(const ::std::vector< OUString>& _rList
         else
         {
             OUString sMessage(ModuleRes(STR_MISSING_TABLES_XDROP));
-            ErrorBox aError(getView(), WB_OK, sMessage);
+            MessageDialog aError(getView(), sMessage);
             aError.Execute();
         }
     }
diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
index b399bf6..aab6965 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
@@ -32,7 +32,7 @@
 #include "dbfindex.hxx"
 #include "dbaccess_helpid.hrc"
 #include "localresaccess.hxx"
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/mnemonic.hxx>
 #include <svl/cjkoptions.hxx>
 #if HAVE_FEATURE_JAVA
@@ -304,7 +304,7 @@ namespace dbaui
         }
         else
             return true;
-        ErrorBox(NULL, WB_OK, MnemonicGenerator::EraseAllMnemonicChars( aErrorText)).Execute();
+        MessageDialog(NULL, MnemonicGenerator::EraseAllMnemonicChars(aErrorText)).Execute();
         pErrorWin->GrabFocus();
         return false;
     }
diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx
index 15267c2..83be777 100644
--- a/dbaccess/source/ui/dlg/UserAdmin.cxx
+++ b/dbaccess/source/ui/dlg/UserAdmin.cxx
@@ -36,8 +36,8 @@
 #include <tools/debug.hxx>
 #include "dbadmin.hxx"
 #include "moduledbu.hxx"
-#include <vcl/msgbox.hxx>
 #include <vcl/layout.hxx>
+#include <vcl/msgbox.hxx>
 #include <sfx2/passwd.hxx>
 
 using namespace ::com::sun::star::container;
@@ -93,7 +93,7 @@ IMPL_LINK_NOARG(OPasswordDialog, OKHdl_Impl)
     else
     {
         OUString aErrorMsg( ModuleRes( STR_ERROR_PASSWORDS_NOT_IDENTICAL));
-        ErrorBox aErrorBox( this, WB_OK, aErrorMsg );
+        MessageDialog aErrorBox(this, aErrorMsg);
         aErrorBox.Execute();
         m_pEDPassword->SetText( OUString() );
         m_pEDPasswordRepeat->SetText( OUString() );
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx
index 1b23afb..8a5991e 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -36,8 +36,8 @@
 #include <vcl/button.hxx>
 #include <vcl/edit.hxx>
 #include <vcl/field.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/lstbox.hxx>
-#include <vcl/msgbox.hxx>
 
 #include <algorithm>
 #include <stdlib.h>
@@ -117,7 +117,7 @@ namespace dbaui
             // show an error message
             OUString sError( ModuleRes( STR_COULD_NOT_LOAD_ODBC_LIB ) );
             sError = sError.replaceFirst("#lib#", aEnumeration.getLibraryName());
-            ErrorBox aDialog(this, WB_OK, sError);
+            MessageDialog aDialog(this, sError);
             aDialog.Execute();
             return false;
         }
diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx
index f5cbc0f..e78dd83 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -19,7 +19,7 @@
 
 #include "directsql.hxx"
 #include "dbu_dlg.hrc"
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <comphelper/types.hxx>
 #include <vcl/svapp.hxx>
 #include <osl/mutex.hxx>
@@ -94,7 +94,7 @@ namespace dbaui
 
         {
             OUString sMessage(ModuleRes(STR_DIRECTSQL_CONNECTIONLOST));
-            ErrorBox aError(this, WB_OK, sMessage);
+            MessageDialog aError(this, sMessage);
             aError.Execute();
         }
 
diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx
index 8537660..8c19cd8 100644
--- a/dbaccess/source/ui/dlg/indexdialog.cxx
+++ b/dbaccess/source/ui/dlg/indexdialog.cxx
@@ -409,7 +409,7 @@ namespace dbaui
             {
                 OUString sConfirm(ModuleRes(STR_CONFIRM_DROP_INDEX));
                 sConfirm = sConfirm.replaceFirst("$name$", m_pIndexList->GetEntryText(pSelected));
-                QueryBox aConfirm(this, WB_YES_NO, sConfirm);
+                MessageDialog aConfirm(this, sConfirm, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
                 if (RET_YES != aConfirm.Execute())
                     return;
             }
@@ -616,7 +616,7 @@ namespace dbaui
         {
             OUString sError(ModuleRes(STR_INDEX_NAME_ALREADY_USED));
             sError = sError.replaceFirst("$name$", sNewName);
-            ErrorBox aError(this, WB_OK, sError);
+            MessageDialog aError(this, sError);
             aError.Execute();
 
             updateToolbox();
@@ -695,7 +695,7 @@ 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);
-                ErrorBox aError(this, WB_OK, sMessage);
+                MessageDialog aError(this, sMessage);
                 aError.Execute();
                 m_pFields->GrabFocus();
                 return false;
diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx
index 6a6fa5c..0d4267e5f 100644
--- a/dbaccess/source/ui/dlg/paramdialog.cxx
+++ b/dbaccess/source/ui/dlg/paramdialog.cxx
@@ -27,7 +27,7 @@
 #include <connectivity/dbtools.hxx>
 #include "dbustrings.hrc"
 #include <vcl/svapp.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <osl/diagnose.h>
 #include <tools/diagnose_ex.h>
 #include "localresaccess.hxx"
@@ -196,7 +196,7 @@ namespace dbaui
 
                     OUString sMessage(ModuleRes(STR_COULD_NOT_CONVERT_PARAM));
                     sMessage = sMessage.replaceAll( "$name$", sName );
-                    ErrorBox(NULL, WB_OK, sMessage).Execute();
+                    MessageDialog(NULL, sMessage).Execute();
                     m_pParam->GrabFocus();
                     return 1L;
                 }
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index ea71dff..183e97b 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -35,6 +35,7 @@
 
 #include <vcl/ctrl.hxx>
 #include <vcl/menu.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/msgbox.hxx>
 #include <vcl/scrbar.hxx>
 #include <vcl/svapp.hxx>
@@ -624,7 +625,7 @@ void DialogHelper::openWebBrowser( const OUString & sURL, const OUString &sTitle
         uno::Any exc( ::cppu::getCaughtException() );
         OUString msg( ::comphelper::anyToString( exc ) );
         const SolarMutexGuard guard;
-        ErrorBox aErrorBox( NULL, WB_OK, msg );
+        MessageDialog aErrorBox(NULL, msg);
         aErrorBox.SetText( sTitle );
         aErrorBox.Execute();
     }
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index 147b5b6..51dfdb4 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -61,6 +61,7 @@
 #include <cppuhelper/exc_hlp.hxx>
 #include <cppuhelper/implbase3.hxx>
 #include <comphelper/anytostring.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/msgbox.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 
@@ -505,7 +506,7 @@ 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());
-        ErrorBox box( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, WB_OK, sMsg );
+        MessageDialog box(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, sMsg);
         box.Execute();
         approve = true;
     }
@@ -570,7 +571,7 @@ void ProgressCmdEnv::update_( uno::Any const & rStatus )
             text = ::comphelper::anyToString( rStatus ); // fallback
 
         const SolarMutexGuard aGuard;
-        const boost::scoped_ptr< ErrorBox > aBox( new ErrorBox( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, WB_OK, text ) );
+        const boost::scoped_ptr<MessageDialog> aBox(new MessageDialog(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, text));
         aBox->Execute();
     }
     ++m_nCurrentProgress;
@@ -812,8 +813,8 @@ void ExtensionCmdQueue::Thread::execute()
                     msg = ::comphelper::anyToString(exc);
 
                 const SolarMutexGuard guard;
-                boost::scoped_ptr<ErrorBox> box(
-                    new ErrorBox( currentCmdEnv->activeDialog(), WB_OK, msg ) );
+                boost::scoped_ptr<MessageDialog> box(
+                    new MessageDialog(currentCmdEnv->activeDialog(), msg));
                 if ( m_pDialogHelper )
                     box->SetText( m_pDialogHelper->getWindow()->GetText() );
                 box->Execute();
diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx
index d049f90..d42a05b 100644
--- a/desktop/source/deployment/gui/dp_gui_service.cxx
+++ b/desktop/source/deployment/gui/dp_gui_service.cxx
@@ -28,9 +28,9 @@
 #include <comphelper/servicedecl.hxx>
 #include <comphelper/unwrapargs.hxx>
 #include <i18nlangtag/languagetag.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/settings.hxx>
-#include <vcl/msgbox.hxx>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/task/XJobExecutor.hpp>
 #include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
@@ -223,9 +223,9 @@ void ServiceImpl::startExecuteModal(
         catch (const Exception & exc) {
             if (bAppUp) {
                 const SolarMutexGuard guard;
-                std::auto_ptr<ErrorBox> box(
-                    new ErrorBox( Application::GetActiveTopWindow(),
-                                  WB_OK, exc.Message ) );
+                boost::scoped_ptr<MessageDialog> box(
+                    new MessageDialog(Application::GetActiveTopWindow(),
+                                      exc.Message));
                 box->Execute();
             }
             throw;
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index 42b032b..9a8c3b5 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -22,7 +22,6 @@
 #include <tools/config.hxx>
 #include <vcl/dibtools.hxx>
 #include <vcl/layout.hxx>
-#include <vcl/msgbox.hxx>
 #include <sanedlg.hxx>
 #include <grid.hxx>
 #include <math.h>
@@ -246,8 +245,7 @@ short SaneDlg::Execute()
 {
     if( ! Sane::IsSane() )
     {
-        ErrorBox aErrorBox( NULL, WB_OK | WB_DEF_OK,
-                            "The SANE interface could not be initialized. Scanning is not possible." );
+        MessageDialog aErrorBox(NULL, "The SANE interface could not be initialized. Scanning is not possible.");
         aErrorBox.Execute();
         return sal_False;
     }
@@ -530,7 +528,7 @@ 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() ) );
-            InfoBox aInfoBox( this, aString );
+            MessageDialog aInfoBox(this, aString, VCL_MESSAGE_INFO);
             aInfoBox.Execute();
         }
         else if( pButton == mpPreviewButton )
@@ -811,8 +809,8 @@ void SaneDlg::AcquirePreview()
     if( nOption == -1 )
     {
         OUString aString("The device does not offer a preview option. Therefore, a normal scan will be used as a preview instead. This may take a considerable amount of time." );
-        WarningBox aBox( this, WB_OK_CANCEL | WB_DEF_OK, aString );
-        if( aBox.Execute() == RET_CANCEL )
+        MessageDialog aBox(this, aString, VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
+        if (aBox.Execute() == RET_CANCEL)
             return;
     }
     else
@@ -821,8 +819,7 @@ void SaneDlg::AcquirePreview()
     BitmapTransporter aTransporter;
     if( ! mrSane.Start( aTransporter ) )
     {
-        ErrorBox aErrorBox( this, WB_OK | WB_DEF_OK,
-                            "An error occurred while scanning." );
+        MessageDialog aErrorBox(this, "An error occurred while scanning.");
         aErrorBox.Execute();
     }
     else
diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.cxx b/filter/source/xsltdialog/xmlfiltertabdialog.cxx
index 2969b95..72b5218 100644
--- a/filter/source/xsltdialog/xmlfiltertabdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltertabdialog.cxx
@@ -21,7 +21,7 @@
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
 #include <tools/resid.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <osl/file.hxx>
 
 #include "xmlfilterdialogstrings.hrc"
@@ -257,7 +257,7 @@ bool XMLFilterTabDialog::onOk()
             aMessage = aMessage.replaceAll( "%s", aReplace1 );
         }
 
-        ErrorBox aBox(this, (WinBits)(WB_OK), aMessage );
+        MessageDialog aBox(this, aMessage);
         aBox.Execute();
 
         if( pFocusWindow )
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 00e638c..a147814 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -25,8 +25,8 @@
 #include <tools/stream.hxx>
 #include <tools/urlobj.hxx>
 #include <vcl/fixed.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/lstbox.hxx>
-#include <vcl/msgbox.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/timer.hxx>
 #include <unotools/ucbhelper.hxx>
@@ -1042,7 +1042,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid )
                     "$filename$",
                     aFileObj.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET)
                 );
-                QueryBox aBox( pThis, WB_YES_NO, aMsg );
+                MessageDialog aBox(pThis, aMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
                 if ( aBox.Execute() != RET_YES )
                     return 0;
             }
@@ -1087,7 +1087,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid )
                     }
                     sError = sError.replaceFirst( "$name$", sInvalidFile );
 
-                    ErrorBox aError( pThis, WB_OK, sError );
+                    MessageDialog aError(pThis, sError);
                     aError.Execute();
                     return 0;
                 }
@@ -1883,7 +1883,7 @@ short SvtFileDialog::PrepareExecute()
 
                 if ( bEmpty )
                 {
-                    ErrorBox aBox( this, WB_OK, SVT_RESSTR( STR_SVT_NOREMOVABLEDEVICE ) );
+                    MessageDialog aBox(this, SVT_RESSTR(STR_SVT_NOREMOVABLEDEVICE));
                     aBox.Execute();
                     return 0;
                 }
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 584c1f5..721ae43 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -830,7 +830,7 @@ void ScDocument::UpdateExternalRefLinks(Window* pWin)
         aBuf.append(OUString(ScResId(SCSTR_EXTDOC_NOT_LOADED)));
         aBuf.appendAscii("\n\n");
         aBuf.append(aFile);
-        ErrorBox aBox(pWin, WB_OK, aBuf.makeStringAndClear());
+        MessageDialog aBox(pWin, aBuf.makeStringAndClear());
         aBox.Execute();
     }
 
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index f1bd6bd..2c879b5 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -30,6 +30,7 @@
 #include <basic/sbx.hxx>
 #include <svl/zforlist.hxx>
 #include <svl/sharedstringpool.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/msgbox.hxx>
 #include <rtl/math.hxx>
 
@@ -250,8 +251,7 @@ bool ScValidationData::DoScript( const ScAddress& rPos, const OUString& rInput,
     {
         //! andere Fehlermeldung, wenn gefunden, aber nicht bAllowed ??
 
-        ErrorBox aBox( pParent, WinBits(WB_OK),
-                        ScGlobal::GetRscString( STR_VALID_MACRONOTFOUND ) );
+        MessageDialog aBox( pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND));
         aBox.Execute();
     }
 
@@ -357,8 +357,7 @@ bool ScValidationData::DoMacro( const ScAddress& rPos, const OUString& rInput,
     {
         //! andere Fehlermeldung, wenn gefunden, aber nicht bAllowed ??
 
-        ErrorBox aBox( pParent, WinBits(WB_OK),
-                        ScGlobal::GetRscString( STR_VALID_MACRONOTFOUND ) );
+        MessageDialog aBox(pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND));
         aBox.Execute();
     }
 
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index c70040f..022283e 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -43,7 +43,7 @@ class DBSaveData;
 
 static DBSaveData* pSaveObj = NULL;
 
-#define ERRORBOX(s) ErrorBox(this,WinBits(WB_OK|WB_DEF_OK),s).Execute()
+#define ERRORBOX(s) MessageDialog(this, s).Execute()
 
 //  class DBSaveData
 
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index f0860c2..c80dede 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -36,13 +36,12 @@
 #include "filter.hrc"
 
 #include "filtdlg.hxx"
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <svl/sharedstringpool.hxx>
 
 #include <limits>
 
-#define ERRORBOX(rid)   ErrorBox( this, WinBits( WB_OK|WB_DEF_OK), \
-                                   ScGlobal::GetRscString(rid) ).Execute()
+#define ERRORBOX(rid)   MessageDialog(this, ScGlobal::GetRscString(rid)).Execute()
 
 #define QUERY_ENTRY_COUNT 4
 #define INVALID_HEADER_POS std::numeric_limits<size_t>::max()
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index 620b54c..af6fe97 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -38,8 +38,7 @@
 
 // DEFINE --------------------------------------------------------------------
 
-#define ERRORBOX(rid) ErrorBox( this, WinBits( WB_OK|WB_DEF_OK),\
-                                    ScGlobal::GetRscString(rid) ).Execute()
+#define ERRORBOX(rid) MessageDialog(this, ScGlobal::GetRscString(rid)).Execute()
 
 //  class ScSpecialFilterDialog
 
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 5b805a5..271af19 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -778,9 +778,7 @@ int ScTabPageSortOptions::DeactivatePage( SfxItemSet* pSetP )
 
         if ( !bPosInputOk )
         {
-            ErrorBox( this, WinBits( WB_OK | WB_DEF_OK ),
-                     ScGlobal::GetRscString( STR_INVALID_TABREF )
-                    ).Execute();
+            MessageDialog(this, ScGlobal::GetRscString( STR_INVALID_TABREF)).Execute();
             m_pEdOutPos->GrabFocus();
             m_pEdOutPos->SetSelection( Selection( 0, SELECTION_MAX ) );
             theOutPos.Set(0,0,0);
diff --git a/sc/source/ui/docshell/documentlinkmgr.cxx b/sc/source/ui/docshell/documentlinkmgr.cxx
index 2709736..419778f 100644
--- a/sc/source/ui/docshell/documentlinkmgr.cxx
+++ b/sc/source/ui/docshell/documentlinkmgr.cxx
@@ -24,7 +24,7 @@
 #include <scresid.hxx>
 
 #include <sfx2/linkmgr.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 
 #include <boost/noncopyable.hpp>
 #include <boost/scoped_ptr.hpp>
@@ -165,7 +165,7 @@ bool DocumentLinkManager::updateDdeLinks( Window* pWin )
             aBuf.append(aElem);
             aBuf.appendAscii("\nType : ");
             aBuf.append(aType);
-            ErrorBox aBox(pWin, WB_OK, aBuf.makeStringAndClear());
+            MessageDialog aBox(pWin, aBuf.makeStringAndClear());
             aBox.Execute();
         }
     }
diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx
index dc4a3b8..ec6c4fd 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -26,7 +26,7 @@
 #include <vcl/msgbox.hxx>
 #include <boost/scoped_array.hpp>
 
-#define ERRORBOX(s) ErrorBox(this,WinBits(WB_OK|WB_DEF_OK),s).Execute()
+#define ERRORBOX(s) MessageDialog(this, s).Execute()
 #define QUERYBOX(m) QueryBox(this,WinBits(WB_YES_NO|WB_DEF_YES),m).Execute()
 
 const sal_uLong nEntryDataCol = 0;
diff --git a/sc/source/ui/miscdlgs/filldlg.cxx b/sc/source/ui/miscdlgs/filldlg.cxx
index 3b057da..deb798d 100644
--- a/sc/source/ui/miscdlgs/filldlg.cxx
+++ b/sc/source/ui/miscdlgs/filldlg.cxx
@@ -20,7 +20,7 @@
 #undef SC_DLLIMPLEMENTATION
 
 #include <svl/zforlist.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <limits.h>
 
 #include "scresid.hxx"
@@ -299,8 +299,7 @@ IMPL_LINK_NOARG(ScFillSeriesDlg, OKHdl)
         EndDialog( RET_OK );
     else
     {
-        ErrorBox( this,
-                  WinBits( WB_OK | WB_DEF_OK ),
+        MessageDialog(this,
                   aErrMsgInvalidVal
                 ).Execute();
         pEdWrong->GrabFocus();
diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx
index f480355..ffe119b 100644
--- a/sc/source/ui/miscdlgs/instbdlg.cxx
+++ b/sc/source/ui/miscdlgs/instbdlg.cxx
@@ -293,7 +293,7 @@ IMPL_LINK_NOARG(ScInsertTableDlg, DoEnterHdl)
     else
     {
         OUString aErrMsg ( ScGlobal::GetRscString( STR_INVALIDTABNAME ) );
-        (void)ErrorBox( this,WinBits( WB_OK | WB_DEF_OK ),aErrMsg).Execute();
+        (void)MessageDialog(this, aErrMsg).Execute();
     }
     return 0;
 }
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index db7d9f1..72cf968 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -721,7 +721,7 @@ IMPL_LINK( ScOptSolverDlg, CursorDownHdl, ScCursorRefEdit*, pEdit )
 void ScOptSolverDlg::ShowError( bool bCondition, formula::RefEdit* pFocus )
 {
     OUString aMessage = bCondition ? maConditionError : maInputError;
-    ErrorBox( this, WinBits( WB_OK | WB_DEF_OK ), aMessage ).Execute();
+    MessageDialog(this, aMessage).Execute();
     if (pFocus)
     {
         mpEdActive = pFocus;
diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx
index 381ce87..cfb0754 100644
--- a/sc/source/ui/miscdlgs/scuiautofmt.cxx
+++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx
@@ -245,9 +245,10 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, AddHdl)
 
                 if ( !bFmtInserted )
                 {
-                    sal_uInt16 nRet = ErrorBox( this,
-                                            WinBits( WB_OK_CANCEL | WB_DEF_OK),
-                                            ScGlobal::GetRscString(STR_INVALID_AFNAME)
+                    sal_uInt16 nRet = MessageDialog(this,
+                                            ScGlobal::GetRscString(STR_INVALID_AFNAME),
+                                            VCL_MESSAGE_ERROR,
+                                            VCL_BUTTONS_OK_CANCEL
                                           ).Execute();
 
                     bOk = ( nRet == RET_CANCEL );
@@ -369,9 +370,10 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RenameHdl)
             }
             if( !bFmtRenamed )
             {
-                bOk = RET_CANCEL == ErrorBox( this,
-                                    WinBits( WB_OK_CANCEL | WB_DEF_OK),
-                                    ScGlobal::GetRscString(STR_INVALID_AFNAME)
+                bOk = RET_CANCEL == MessageDialog( this,
+                                    ScGlobal::GetRscString(STR_INVALID_AFNAME),
+                                    VCL_MESSAGE_ERROR,
+                                    VCL_BUTTONS_OK_CANCEL
                                     ).Execute();
             }
         }
diff --git a/sc/source/ui/miscdlgs/solvrdlg.cxx b/sc/source/ui/miscdlgs/solvrdlg.cxx
index 0e93c2f..bd3fa62 100644
--- a/sc/source/ui/miscdlgs/solvrdlg.cxx
+++ b/sc/source/ui/miscdlgs/solvrdlg.cxx
@@ -35,7 +35,7 @@ namespace
 {
     void lclErrorDialog( Window* pParent, const OUString& aString )
     {
-        ErrorBox( pParent, WinBits( WB_OK | WB_DEF_OK), aString ).Execute();
+        MessageDialog(pParent, aString).Execute();
     }
 }
 
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index 68d2952..662eeab 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -170,8 +170,7 @@ int ScTpCalcOptions::DeactivatePage( SfxItemSet* pSetP )
 
     if ( nReturn == KEEP_PAGE )
     {
-        ErrorBox( this,
-                  WinBits( WB_OK | WB_DEF_OK ),
+        MessageDialog( this,
                   ScGlobal::GetRscString( STR_INVALID_EPS )
                 ).Execute();
 
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index a2b637d..71b038c 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -683,7 +683,7 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, PushButton*, pBtn )
         }
         else
         {
-            ErrorBox( this, WinBits( WB_OK | WB_DEF_OK ),
+            MessageDialog(this,
                       ScGlobal::GetRscString( STR_INVALID_TABREF )
                     ).Execute();
             mpEdCopyFrom->GrabFocus();
diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx
index fe7a88e..9828163 100644
--- a/sc/source/ui/pagedlg/areasdlg.cxx
+++ b/sc/source/ui/pagedlg/areasdlg.cxx
@@ -50,8 +50,7 @@ const sal_uInt16 SC_AREASDLG_RR_USER    = 1;
 const sal_uInt16 SC_AREASDLG_RR_OFFSET  = 2;
 
 #define HDL(hdl)            LINK( this, ScPrintAreasDlg, hdl )
-#define ERRORBOX(nId)       ErrorBox( this, WinBits(WB_OK|WB_DEF_OK), \
-                            ScGlobal::GetRscString( nId ) ).Execute()
+#define ERRORBOX(nId)       MessageDialog(this, ScGlobal::GetRscString(nId)).Execute()
 
 // globale Funktionen (->am Ende der Datei):
 
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 3291276..d1b7759 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -425,8 +425,8 @@ void ScCellShell::Execute( SfxRequest& rReq )
                     }
                     else if( ! rReq.IsAPI() )
                     {
-                        ErrorBox aErrorBox( pTabViewShell->GetDialogParent(), WinBits(WB_OK | WB_DEF_OK),
-                                            ScGlobal::GetRscString(STR_NOAREASELECTED) );
+                        MessageDialog aErrorBox(pTabViewShell->GetDialogParent(),
+                                            ScGlobal::GetRscString(STR_NOAREASELECTED));
                         aErrorBox.Execute();
                     }
                 }
@@ -838,7 +838,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
                     }
                 }
                 else
-                    ErrorBox( pDlgParent, WinBits( WB_OK | WB_DEF_OK ),
+                    MessageDialog (pDlgParent,
                               ScGlobal::GetRscString(STR_INVALID_AFAREA) ).Execute();
             }
             break;
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index 50d638c..b0c0efc 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -383,8 +383,8 @@ void ScDBFunc::ToggleAutoFilter()
         }
         else
         {
-            ErrorBox aErrorBox( GetViewData().GetDialogParent(), WinBits( WB_OK | WB_DEF_OK ),
-                                ScGlobal::GetRscString( STR_ERR_AUTOFILTER ) );
+            MessageDialog aErrorBox(GetViewData().GetDialogParent(),
+                                ScGlobal::GetRscString(STR_ERR_AUTOFILTER));
             aErrorBox.Execute();
         }
     }
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 5a67256..75b221e 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -410,8 +410,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
                                 }
                                 else
                                 {
-                                    nRet = ErrorBox( GetDialogParent(),
-                                                     WinBits( WB_OK | WB_DEF_OK ),
+                                    nRet = MessageDialog(GetDialogParent(),
                                                      aErrMsg
                                                    ).Execute();
                                 }
diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx
index d77ec5c..cc7bd09 100644
--- a/scripting/source/dlgprov/dlgevtatt.cxx
+++ b/scripting/source/dlgprov/dlgevtatt.cxx
@@ -23,7 +23,7 @@
 
 #include <sfx2/sfx.hrc>
 #include <sfx2/app.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <tools/diagnose_ex.h>
 
 #include <com/sun/star/awt/XControl.hpp>
@@ -646,7 +646,7 @@ namespace dlgprov
                 aOUFinal += aQuoteChar;
                 aOUFinal += aOURes.copy( nIndex + 2 );
 
-                ErrorBox( NULL, WinBits( WB_OK ), aOUFinal ).Execute();
+                MessageDialog(NULL, aOUFinal).Execute();
             }
         }
     }
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index e5533b8..c5b6fa9 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -38,6 +38,7 @@
 #include <svx/svdpagv.hxx>
 #include <svx/svdogrp.hxx>
 #include <svx/svdundo.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/msgbox.hxx>
 #include <sot/formats.hxx>
 
@@ -239,7 +240,7 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium)
 
     if (!bOK)
     {
-        ErrorBox aErrorBox( NULL, (WinBits)WB_OK, SD_RESSTR(STR_READ_DATA_ERROR));
+        MessageDialog aErrorBox(NULL, SD_RESSTR(STR_READ_DATA_ERROR));
         aErrorBox.Execute();
 
         CloseBookmarkDoc();
diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx
index feb67f6..322624a 100644
--- a/sd/source/filter/grf/sdgrffilter.cxx
+++ b/sd/source/filter/grf/sdgrffilter.cxx
@@ -29,7 +29,7 @@
 
 #include <unotools/localfilehelper.hxx>
 #include <tools/errinf.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/metaact.hxx>
 #include <vcl/virdev.hxx>
 #include <sfx2/docfile.hxx>
@@ -169,7 +169,7 @@ void SdGRFFilter::HandleGraphicFilterError( sal_uInt16 nFilterError, sal_uLong n
         ErrorHandler::HandleError( ERRCODE_IO_GENERAL );
     else
     {
-        ErrorBox aErrorBox(NULL, WB_OK, SD_RESSTR(nId));
+        MessageDialog aErrorBox(NULL, SD_RESSTR(nId));
         aErrorBox.Execute();
     }
 }
diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx
index 3537b02..4bcd1fb 100644
--- a/sd/source/filter/html/pubdlg.cxx
+++ b/sd/source/filter/html/pubdlg.cxx
@@ -1087,8 +1087,8 @@ IMPL_LINK_NOARG(SdPublishingDlg, FinishHdl)
 
                 if (iter != m_aDesignList.end())
                 {
-                    ErrorBox aErrorBox(this, WB_YES_NO,
-                                       SD_RESSTR(STR_PUBDLG_SAMENAME));
+                    MessageDialog aErrorBox(this, SD_RESSTR(STR_PUBDLG_SAMENAME),
+                        VCL_MESSAGE_ERROR, VCL_BUTTONS_YES_NO);
                     bRetry = aErrorBox.Execute() == RET_NO;
 
                     if(!bRetry)
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index 7ba47c4..cfe75ff 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -234,7 +234,7 @@ void SdModule::Execute(SfxRequest& rReq)
             }
             else
             {
-                ErrorBox(NULL, WB_OK, SD_RESSTR(STR_CANT_PERFORM_IN_LIVEMODE)).Execute();
+                MessageDialog(NULL, SD_RESSTR(STR_CANT_PERFORM_IN_LIVEMODE)).Execute();
 
                 SFX_REQUEST_ARG( rReq, pLinkItem, SfxLinkItem, SID_DONELINK, false );
                 if( pLinkItem )
diff --git a/sd/source/ui/dlg/brkdlg.cxx b/sd/source/ui/dlg/brkdlg.cxx
index abd5886..cebc2cc 100644
--- a/sd/source/ui/dlg/brkdlg.cxx
+++ b/sd/source/ui/dlg/brkdlg.cxx
@@ -93,7 +93,7 @@ IMPL_LINK( BreakDlg, UpDate, void*, nInit )
     // update status bar or show a error message?
     if(nInit == (void*)1L)
     {
-        ErrorBox aErrBox( this, WB_OK, SD_RESSTR( STR_BREAK_FAIL ) );
+        MessageDialog aErrBox(this, SD_RESSTR(STR_BREAK_FAIL));
         aErrBox.Execute();
     }
     else
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 72d152f..6836212 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -20,7 +20,7 @@
 #include <sal/types.h>
 #include <sot/formats.hxx>
 #include <sot/storage.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <svl/urihelper.hxx>
 #include <svx/svditer.hxx>
 #include <sfx2/docfile.hxx>
@@ -1009,7 +1009,7 @@ SdDrawDocument* SdPageObjsTLB::GetBookmarkDoc(SfxMedium* pMed)
 
         if ( !mpBookmarkDoc )
         {
-            ErrorBox aErrorBox( this, WB_OK, SD_RESSTR( STR_READ_DATA_ERROR ) );
+            MessageDialog aErrorBox(this, SD_RESSTR(STR_READ_DATA_ERROR));
             aErrorBox.Execute();
             mpMedium = 0; //On failure the SfxMedium is invalid
         }
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index e49ef0d..6a97b07 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -511,7 +511,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
                             // unable to create PlugIn
                             OUString aStrErr( SdResId( STR_ERROR_OBJNOCREATE_PLUGIN ) );
                             aStrErr = aStrErr.replaceFirst( "%", aStrURL );
-                            ErrorBox( mpWindow, WB_3DLOOK | WB_OK, aStrErr ).Execute();
+                            MessageDialog(mpWindow, aStrErr).Execute();
                         }
                     }
                 }
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index 7514812..7f81db0 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -306,7 +306,7 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
 
     if( !bInserted )
     {
-        ErrorBox aErrorBox( mpWindow, WB_OK, SD_RESSTR( STR_READ_DATA_ERROR ) );
+        MessageDialog aErrorBox(mpWindow, SD_RESSTR( STR_READ_DATA_ERROR));
         aErrorBox.Execute();
         delete pMedium;
     }
@@ -456,8 +456,7 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium)
 
         if (nErr || pOutliner->GetEditEngine().GetText().isEmpty())
         {
-            ErrorBox aErrorBox( mpWindow, (WinBits)WB_OK,
-                      SD_RESSTR(STR_READ_DATA_ERROR));
+            MessageDialog aErrorBox(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR));
             aErrorBox.Execute();
         }
         else
@@ -601,8 +600,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
 
     if (nErr || pOutliner->GetEditEngine().GetText().isEmpty())
     {
-        ErrorBox aErrorBox( mpWindow, (WinBits)WB_OK,
-                  SD_RESSTR(STR_READ_DATA_ERROR));
+        MessageDialog aErrorBox(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR));
         aErrorBox.Execute();
     }
     else
diff --git a/sd/source/ui/func/futhes.cxx b/sd/source/ui/func/futhes.cxx
index 01b0ae9..a6c1fb9 100644
--- a/sd/source/ui/func/futhes.cxx
+++ b/sd/source/ui/func/futhes.cxx
@@ -20,7 +20,7 @@
 #include "futhes.hxx"
 
 #include <editeng/outliner.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <svx/svdobj.hxx>
 #include <svx/svdotext.hxx>
 #include <editeng/eeitem.hxx>
@@ -113,7 +113,7 @@ void FuThesaurus::DoExecute( SfxRequest& )
 
             if (eState == EE_SPELL_NOLANGUAGE)
             {
-                ErrorBox(mpWindow, WB_OK, SD_RESSTR(STR_NOLANGUAGE)).Execute();
+                MessageDialog(mpWindow, SD_RESSTR(STR_NOLANGUAGE)).Execute();
             }
         }
     }
@@ -140,7 +140,7 @@ void FuThesaurus::DoExecute( SfxRequest& )
 
         if (eState == EE_SPELL_NOLANGUAGE)
         {
-            ErrorBox(mpWindow, WB_OK, SD_RESSTR(STR_NOLANGUAGE)).Execute();
+            MessageDialog(mpWindow, SD_RESSTR(STR_NOLANGUAGE)).Execute();
         }
     }
 }
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index bcbef49..ea831ac 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1158,8 +1158,7 @@ void Outliner::PrepareSpellCheck (void)
     {
         mbError = true;
         mbEndOfSearch = true;
-        ErrorBox aErrorBox (NULL,
-            WB_OK,
+        MessageDialog aErrorBox (NULL,
             SD_RESSTR(STR_NOLANGUAGE));
         ShowModalMessageBox (aErrorBox);
     }
diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
index 6da2265..81f960b 100644
--- a/sfx2/source/appl/lnkbase2.cxx
+++ b/sfx2/source/appl/lnkbase2.cxx
@@ -23,7 +23,7 @@
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <sfx2/linkmgr.hxx>
 #include <vcl/svapp.hxx>
 #include "app.hrc"
@@ -505,7 +505,7 @@ bool SvBaseLink::ExecuteEdit( const OUString& _rNewName )
             else
                 return false;
 
-            ErrorBox( pImpl->m_pParentWin, WB_OK, sError ).Execute();
+            MessageDialog(pImpl->m_pParentWin, sError).Execute();
         }
     }
     else if( !pImpl->m_bIsConnect )
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 7a1f175..94ed20d 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -53,7 +53,7 @@
 #include <osl/file.hxx>
 #include <unotools/bootstrap.hxx>
 #include <rtl/uri.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <svtools/ehdl.hxx>
 #include <svtools/sfxecode.hxx>
 
@@ -76,7 +76,7 @@ using namespace ::com::sun::star::util;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::system;
 
-class NoHelpErrorBox : public ErrorBox
+class NoHelpErrorBox : public MessageDialog
 {
 public:
     NoHelpErrorBox( Window* _pParent );
@@ -84,9 +84,8 @@ public:
     virtual void    RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE;
 };
 
-NoHelpErrorBox::NoHelpErrorBox( Window* _pParent ) :
-
-    ErrorBox( _pParent, WB_OK, SfxResId( RID_STR_HLPFILENOTEXIST ).toString() )
+NoHelpErrorBox::NoHelpErrorBox( Window* _pParent )
+    : MessageDialog(_pParent, SfxResId(RID_STR_HLPFILENOTEXIST))
 {
     // Error message: "No help available"
 }
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 3dcfd32..20395ea 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -333,7 +333,7 @@ void SfxObjectShell::CheckOut( )
     }
     catch ( const uno::RuntimeException& e )
     {
-        ErrorBox* pErrorBox = new ErrorBox( &GetFrame()->GetWindow(), WB_OK, e.Message );
+        MessageDialog* pErrorBox = new MessageDialog( &GetFrame()->GetWindow(), e.Message );
         pErrorBox->Execute( );
         delete pErrorBox;
     }
@@ -352,7 +352,7 @@ void SfxObjectShell::CancelCheckOut( )
     }
     catch ( const uno::RuntimeException& e )
     {
-        ErrorBox* pErrorBox = new ErrorBox( &GetFrame()->GetWindow(), WB_OK, e.Message );
+        MessageDialog* pErrorBox = new MessageDialog(&GetFrame()->GetWindow(), e.Message);
         pErrorBox->Execute( );
         delete pErrorBox;
     }
@@ -377,7 +377,7 @@ void SfxObjectShell::CheckIn( )
     }
     catch ( const uno::RuntimeException& e )
     {
-        ErrorBox* pErrorBox = new ErrorBox( &GetFrame()->GetWindow(), WB_OK, e.Message );
+        MessageDialog* pErrorBox = new MessageDialog(&GetFrame()->GetWindow(), e.Message);
         pErrorBox->Execute( );
         delete pErrorBox;
     }
@@ -392,7 +392,7 @@ uno::Sequence< document::CmisVersion > SfxObjectShell::GetCmisVersions( )
     }
     catch ( const uno::RuntimeException& e )
     {
-        ErrorBox* pErrorBox = new ErrorBox( &GetFrame()->GetWindow(), WB_OK, e.Message );
+        MessageDialog* pErrorBox = new MessageDialog(&GetFrame()->GetWindow(), e.Message);
         pErrorBox->Execute( );
         delete pErrorBox;
     }
@@ -1465,7 +1465,7 @@ void SfxObjectShell::ImplSign( bool bScriptingContent )
         }
         else
         {
-            ErrorBox( NULL, WB_OK, SfxResId(STR_XMLSEC_ODF12_EXPECTED).toString() ).Execute();
+            MessageDialog(NULL, SfxResId(STR_XMLSEC_ODF12_EXPECTED)).Execute();
             return;
         }
 
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 019fa7e..2cf0516 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -38,7 +38,7 @@
 #include <unotools/pathoptions.hxx>
 #include <unotools/viewoptions.hxx>
 #include <vcl/edit.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/toolbox.hxx>
 
 #include <com/sun/star/beans/PropertyValue.hpp>
@@ -622,7 +622,7 @@ IMPL_LINK(SfxTemplateManagerDlg, RepositoryMenuSelectHdl, Menu*, pMenu)
             {
                 OUString aMsg(SfxResId(STR_MSG_ERROR_REPOSITORY_NAME).toString());
                 aMsg = aMsg.replaceFirst("$1",pPlace->GetName());
-                ErrorBox(this,WB_OK,aMsg).Execute();
+                MessageDialog(this, aMsg).Execute();
             }
         }
     }
@@ -933,7 +933,7 @@ void SfxTemplateManagerDlg::OnTemplateImport ()
                     {
                         OUString aMsg(SfxResId(STR_MSG_ERROR_IMPORT).toString());
                         aMsg = aMsg.replaceFirst("$1",pFolder->maTitle);
-                        ErrorBox(this,WB_OK,aMsg.replaceFirst("$2",aTemplateList));
+                        MessageDialog(this, aMsg.replaceFirst("$2",aTemplateList));
                     }
                 }
             }
@@ -956,7 +956,7 @@ void SfxTemplateManagerDlg::OnTemplateImport ()
                 {
                     OUString aMsg(SfxResId(STR_MSG_ERROR_IMPORT).toString());
                     aMsg = aMsg.replaceFirst("$1",mpLocalView->getCurRegionName());
-                    ErrorBox(this,WB_OK,aMsg.replaceFirst("$2",aTemplateList));
+                    MessageDialog(this, aMsg.replaceFirst("$2",aTemplateList));
                 }
             }
 
@@ -1045,7 +1045,7 @@ void SfxTemplateManagerDlg::OnTemplateExport()
         if (!aTemplateList.isEmpty())
         {
             OUString aText( SfxResId(STR_MSG_ERROR_EXPORT).toString() );
-            ErrorBox(this, WB_OK,aText.replaceFirst("$1",aTemplateList)).Execute();
+            MessageDialog(this, aText.replaceFirst("$1",aTemplateList)).Execute();
         }
     }
 }
@@ -1158,7 +1158,7 @@ void SfxTemplateManagerDlg::OnTemplateProperties ()
 
 void SfxTemplateManagerDlg::OnTemplateDelete ()
 {
-    QueryBox aQueryDlg(this, WB_YES_NO | WB_DEF_YES, SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE).toString());
+    MessageDialog aQueryDlg(this, SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
 
     if ( aQueryDlg.Execute() == RET_NO )
         return;
@@ -1207,7 +1207,7 @@ void SfxTemplateManagerDlg::OnTemplateDelete ()
     if (!aTemplateList.isEmpty())
     {
         OUString aMsg( SfxResId(STR_MSG_ERROR_DELETE_TEMPLATE).toString() );
-        ErrorBox(this, WB_OK,aMsg.replaceFirst("$1",aTemplateList)).Execute();
+        MessageDialog(this, aMsg.replaceFirst("$1",aTemplateList)).Execute();
     }
 }
 
@@ -1243,7 +1243,7 @@ void SfxTemplateManagerDlg::OnFolderNew()
 
 void SfxTemplateManagerDlg::OnFolderDelete()
 {
-    QueryBox aQueryDlg(this, WB_YES_NO | WB_DEF_YES, SfxResId(STR_QMSG_SEL_FOLDER_DELETE).toString());
+    MessageDialog aQueryDlg(this, SfxResId(STR_QMSG_SEL_FOLDER_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
 
     if ( aQueryDlg.Execute() == RET_NO )
         return;
@@ -1271,7 +1271,7 @@ void SfxTemplateManagerDlg::OnFolderDelete()
     if (!aFolderList.isEmpty())
     {
         OUString aMsg( SfxResId(STR_MSG_ERROR_DELETE_FOLDER).toString() );
-        ErrorBox(this, WB_OK,aMsg.replaceFirst("$1",aFolderList)).Execute();
+        MessageDialog(this, aMsg.replaceFirst("$1",aFolderList)).Execute();
     }
 }
 
@@ -1292,7 +1292,7 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
 
     if (!mpLocalView->isNonRootRegionVisible() && maSelFolders.empty())
     {
-        ErrorBox(this, WB_OK,SfxResId(STR_MSG_ERROR_SELECT_FOLDER).toString()).Execute();
+        MessageDialog(this, SfxResId(STR_MSG_ERROR_SELECT_FOLDER)).Execute();
         return;
     }
 
@@ -1306,7 +1306,7 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
         {
             OUString aFolderList;
             OUString aQMsg(SfxResId(STR_QMSG_TEMPLATE_OVERWRITE).toString());
-            QueryBox aQueryDlg(this,WB_YES_NO | WB_DEF_YES, OUString());
+            MessageDialog aQueryDlg(this, OUString(), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
 
             if (mpLocalView->isNonRootRegionVisible())
             {
@@ -1315,7 +1315,7 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
                 if (!mpLocalView->isTemplateNameUnique(nRegionItemId,aName))
                 {
                     aQMsg = aQMsg.replaceFirst("$1",aName);
-                    aQueryDlg.SetMessText(aQMsg.replaceFirst("$2",mpLocalView->getCurRegionName()));
+                    aQueryDlg.set_primary_text(aQMsg.replaceFirst("$2",mpLocalView->getCurRegionName()));
 
                     if (aQueryDlg.Execute() == RET_NO)
                         return;
@@ -1334,7 +1334,7 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
                     if (!mpLocalView->isTemplateNameUnique(pItem->mnId,aName))
                     {
                         OUString aDQMsg = aQMsg.replaceFirst("$1",aName);
-                        aQueryDlg.SetMessText(aDQMsg.replaceFirst("$2",pItem->maTitle));
+                        aQueryDlg.set_primary_text(aDQMsg.replaceFirst("$2",pItem->maTitle));
 
                         if (aQueryDlg.Execute() == RET_NO)
                             continue;
@@ -1471,7 +1471,7 @@ void SfxTemplateManagerDlg::localMoveTo(sal_uInt16 nMenuId)
             OUString aDst = mpLocalView->getRegionItemName(nItemId);
             OUString aMsg(SfxResId(STR_MSG_ERROR_LOCAL_MOVE).toString());
             aMsg = aMsg.replaceFirst("$1",aDst);
-            ErrorBox(this, WB_OK,aMsg.replaceFirst( "$2",aTemplateList)).Execute();
+            MessageDialog(this, aMsg.replaceFirst( "$2",aTemplateList)).Execute();
         }
     }
 }
@@ -1525,7 +1525,7 @@ void SfxTemplateManagerDlg::remoteMoveTo(const sal_uInt16 nMenuId)
             OUString aMsg(SfxResId(STR_MSG_ERROR_REMOTE_MOVE).toString());
             aMsg = aMsg.replaceFirst("$1",mpRemoteView->getCurRegionName());
             aMsg = aMsg.replaceFirst("$2",mpLocalView->getRegionItemName(nItemId));
-            ErrorBox(this,WB_OK,aMsg.replaceFirst("$1",aTemplateList)).Execute();
+            MessageDialog(this, aMsg.replaceFirst("$1",aTemplateList)).Execute();
         }
     }
 }
@@ -1581,7 +1581,7 @@ void SfxTemplateManagerDlg::localSearchMoveTo(sal_uInt16 nMenuId)
             OUString aDst = mpLocalView->getRegionItemName(nItemId);
             OUString aMsg(SfxResId(STR_MSG_ERROR_LOCAL_MOVE).toString());
             aMsg = aMsg.replaceFirst("$1",aDst);
-            ErrorBox(this, WB_OK,aMsg.replaceFirst( "$2",aTemplateList)).Execute();
+            MessageDialog(this, aMsg.replaceFirst( "$2",aTemplateList)).Execute();
         }
     }
 
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 7ef21f9..362c819 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -21,7 +21,7 @@
 #include <com/sun/star/view/XRenderable.hpp>
 
 #include <svl/itempool.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <svtools/prnsetup.hxx>
 #include <svl/flagitem.hxx>
 #include <svl/stritem.hxx>
@@ -345,7 +345,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
                 // "real" problem (not simply printing cancelled by user)
                 OUString aMsg( SfxResId(STR_NOSTARTPRINTER).toString() );
                 if ( !m_bApi )
-                    ErrorBox( mpViewShell->GetWindow(), WB_OK | WB_DEF_OK,  aMsg ).Execute();
+                    MessageDialog(mpViewShell->GetWindow(), aMsg).Execute();
                 // intentionally no break
             }
             case view::PrintableState_JOB_ABORTED :
@@ -524,7 +524,7 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter )
 
     // Ask if possible, if page format should be taken over from printer.
     if ( ( bOriChg  || bPgSzChg ) &&
-        RET_YES == QueryBox(0, WB_YES_NO | WB_DEF_OK, aMsg).Execute() )
+        RET_YES == MessageDialog(NULL, aMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO).Execute() )
     {
         // Flags with changes for  <SetPrinter(SfxPrinter*)> are maintained
         nChangedFlags |= nNewOpt;
@@ -786,7 +786,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
             {
                 // no valid printer either in ItemSet or at the document
                 if ( !bSilent )
-                    ErrorBox( NULL, WB_OK | WB_DEF_OK, SfxResId(STR_NODEFPRINTER).toString() ).Execute();
+                    MessageDialog(NULL, SfxResId(STR_NODEFPRINTER)).Execute();
 
                 rReq.SetReturnValue(SfxBoolItem(0,false));
 
@@ -798,7 +798,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
             {
                 // if printer is busy, abort configuration
                 if ( !bSilent )
-                    InfoBox( NULL, SfxResId(STR_ERROR_PRINTER_BUSY).toString() ).Execute();
+                    MessageDialog(NULL, SfxResId(STR_ERROR_PRINTER_BUSY), VCL_MESSAGE_INFO).Execute();
                 rReq.SetReturnValue(SfxBoolItem(0,false));
 
                 return;
diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx
index 661f155..5e48966 100644
--- a/sot/source/sdstor/stgcache.cxx
+++ b/sot/source/sdstor/stgcache.cxx
@@ -28,9 +28,6 @@
 #include "stgdir.hxx"
 #include "stgio.hxx"
 
-//#define   CHECK_DIRTY 1
-//#define   READ_AFTER_WRITE 1
-
 ////////////////////////////// class StgPage
 // This class implements buffer functionality. The cache will always return
 // a page buffer, even if a read fails. It is up to the caller to determine
@@ -341,11 +338,7 @@ bool StgCache::Read( sal_Int32 nPage, void* pBuf, sal_Int32 nPg )
             }
             if( pStrm->Tell() != nPos )
             {
-                if( pStrm->Seek( nPos ) != nPos ) {
-    #ifdef CHECK_DIRTY
-                    ErrorBox( NULL, WB_OK, OUString("SO2: Seek failed") ).Execute();
-    #endif
-                }
+                pStrm->Seek(nPos);
             }
             pStrm->Read( pBuf, nBytes );
             if ( nPg != nPg2 )
@@ -372,30 +365,13 @@ bool StgCache::Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPg )
             nPos = 0L, nBytes = 512;
         if( pStrm->Tell() != nPos )
         {
-            if( pStrm->Seek( nPos ) != nPos ) {
-#ifdef CHECK_DIRTY
-                ErrorBox( NULL, WB_OK, OUString("SO2: Seek failed") ).Execute();
-#endif
-            }
+            pStrm->Seek(nPos);
         }
         sal_uLong nRes = pStrm->Write( pBuf, nBytes );
         if( nRes != nBytes )
             SetError( SVSTREAM_WRITE_ERROR );
         else
             SetError( pStrm->GetError() );
-#ifdef READ_AFTER_WRITE
-        sal_uInt8 cBuf[ 512 ];
-        pStrm->Flush();
-        pStrm->Seek( nPos );
-        bool bRes = ( pStrm->Read( cBuf, 512 ) == 512 );
-        if( bRes )
-            bRes = !memcmp( cBuf, pBuf, 512 );
-        if( !bRes )
-        {
-            ErrorBox( NULL, WB_OK, OUString("SO2: Read after Write failed") ).Execute();
-            pStrm->SetError( SVSTREAM_WRITE_ERROR );
-        }
-#endif
     }
     return Good();
 }
diff --git a/svx/source/dialog/passwd.cxx b/svx/source/dialog/passwd.cxx
index 5d186ba..9933dc0 100644
--- a/svx/source/dialog/passwd.cxx
+++ b/svx/source/dialog/passwd.cxx
@@ -18,8 +18,7 @@
  */
 
 #include <comphelper/string.hxx>
-#include <tools/shl.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include "svx/passwd.hxx"
 #include <svx/dialmgr.hxx>
 #include <svx/dialogs.hrc>
@@ -34,7 +33,7 @@ IMPL_LINK_NOARG(SvxPasswordDialog, ButtonHdl)
 
     if ( m_pNewPasswdED->GetText() != m_pRepeatPasswdED->GetText() )
     {
-        ErrorBox( this, WB_OK, aRepeatPasswdErrStr ).Execute();
+        MessageDialog(this, aRepeatPasswdErrStr).Execute();
         m_pNewPasswdED->SetText( aEmpty );
         m_pRepeatPasswdED->SetText( aEmpty );
         m_pNewPasswdED->GrabFocus();
@@ -43,7 +42,7 @@ IMPL_LINK_NOARG(SvxPasswordDialog, ButtonHdl)
 
     if ( bOK && aCheckPasswordHdl.IsSet() && !aCheckPasswordHdl.Call( this ) )
     {
-        ErrorBox( this, WB_OK, aOldPasswdErrStr ).Execute();
+        MessageDialog(this, aOldPasswdErrStr).Execute();
         m_pOldPasswdED->SetText( aEmpty );
         m_pOldPasswdED->GrabFocus();
         bOK = false;
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index dab6033..3c1798a 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -92,8 +92,7 @@
 #include <sfx2/viewsh.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 #include <tools/diagnose_ex.h>
-#include <tools/shl.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/waitobj.hxx>
 #include <vcl/settings.hxx>
 
@@ -1512,7 +1511,7 @@ void FmXFormShell::ExecuteSearch()
 
     if (m_aSearchForms.empty() )
     {   // es gibt keine Controls, die alle Bedingungen fuer eine Suche erfuellen
-        ErrorBox(NULL, WB_OK, SVX_RESSTR(RID_STR_NODATACONTROLS)).Execute();
+        MessageDialog(NULL, SVX_RESSTR(RID_STR_NODATACONTROLS)).Execute();
         return;
     }
 
@@ -3188,7 +3187,7 @@ void FmXFormShell::CreateExternalView()
 
         if (!bHaveUsableControls)
         {
-            ErrorBox(NULL, WB_OK, SVX_RESSTR(RID_STR_NOCONTROLS_FOR_EXTERNALDISPLAY)).Execute();
+            MessageDialog(NULL, SVX_RESSTR(RID_STR_NOCONTROLS_FOR_EXTERNALDISPLAY)).Execute();
             return;
         }
     }
diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx
index f954c74..1ec8c85 100644
--- a/uui/source/masterpasscrtdlg.cxx
+++ b/uui/source/masterpasscrtdlg.cxx
@@ -18,7 +18,7 @@
  */
 
 #include <sal/macros.h>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 
 #include "ids.hrc"
 #include "masterpasscrtdlg.hxx"
@@ -33,8 +33,6 @@ IMPL_LINK_NOARG(MasterPasswordCreateDialog, EditHdl_Impl)
     return 0;
 }
 
-
-
 IMPL_LINK_NOARG(MasterPasswordCreateDialog, OKHdl_Impl)
 {
     // compare both passwords and show message box if there are not equal!!
@@ -43,7 +41,7 @@ IMPL_LINK_NOARG(MasterPasswordCreateDialog, OKHdl_Impl)
     else
     {
         OUString aErrorMsg( ResId( STR_ERROR_PASSWORDS_NOT_IDENTICAL, *pResourceMgr ));
-        ErrorBox aErrorBox( this, WB_OK, aErrorMsg );
+        MessageDialog aErrorBox(this, aErrorMsg);
         aErrorBox.Execute();
         m_pEDMasterPasswordCrt->SetText( OUString() );
         m_pEDMasterPasswordRepeat->SetText( OUString() );
@@ -52,8 +50,6 @@ IMPL_LINK_NOARG(MasterPasswordCreateDialog, OKHdl_Impl)
     return 1;
 }
 
-
-
 MasterPasswordCreateDialog::MasterPasswordCreateDialog(Window* pParent, ResMgr* pResMgr)
     : ModalDialog(pParent, "SetMasterPasswordDialog", "uui/ui/setmasterpassworddlg.ui")
     , pResourceMgr(pResMgr)
diff --git a/uui/source/masterpassworddlg.cxx b/uui/source/masterpassworddlg.cxx
index 0b2a6af..ed297a8 100644
--- a/uui/source/masterpassworddlg.cxx
+++ b/uui/source/masterpassworddlg.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 
 #include "ids.hrc"
 #include "masterpassworddlg.hxx"
@@ -49,7 +49,7 @@ MasterPasswordDialog::MasterPasswordDialog
     if( nDialogMode == ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER )
     {
         OUString aErrorMsg( ResId( STR_ERROR_MASTERPASSWORD_WRONG, *pResourceMgr ));
-        ErrorBox aErrorBox( pParent, WB_OK, aErrorMsg );
+        MessageDialog aErrorBox(pParent, aErrorMsg);
         aErrorBox.Execute();
     }
 
diff --git a/uui/source/nameclashdlg.cxx b/uui/source/nameclashdlg.cxx
index 201c6ab..65244d7 100644
--- a/uui/source/nameclashdlg.cxx
+++ b/uui/source/nameclashdlg.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <osl/file.hxx>
 
 #include "ids.hrc"
@@ -35,7 +35,7 @@ IMPL_LINK( NameClashDialog, ButtonHdl_Impl, PushButton *, pBtn )
         OUString aNewName = maEDNewName.GetText();
         if ( ( aNewName == maNewName ) || aNewName.isEmpty() )
         {
-            ErrorBox aError( NULL, WB_OK, maSameName );
+            MessageDialog aError(NULL, maSameName);
             aError.Execute();
             return 1;
         }
diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx
index 19c08e0..3d4326e 100644
--- a/uui/source/passworddlg.cxx
+++ b/uui/source/passworddlg.cxx
@@ -20,7 +20,7 @@
 #include "passworddlg.hxx"
 #include "ids.hrc"
 
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 
 using namespace ::com::sun::star;
 
@@ -44,7 +44,7 @@ PasswordDialog::PasswordDialog(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());
-        ErrorBox aErrorBox( GetParent(), WB_OK, aErrorMsg );
+        MessageDialog aErrorBox(GetParent(), aErrorMsg);
         aErrorBox.Execute();
     }
 
@@ -91,7 +91,7 @@ IMPL_LINK_NOARG(PasswordDialog, OKHdl_Impl)
 
     if (m_pEDConfirmPassword->IsVisible() && bPasswdMismatch)
     {
-        ErrorBox aErrorBox( this, WB_OK, aPasswdMismatch );
+        MessageDialog aErrorBox(this, aPasswdMismatch);
         aErrorBox.Execute();
     }
     else if (bValid)
diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index 4f716e0..8305059 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -346,7 +346,7 @@ void DestroySalInstance( SalInstance *pInst )
     delete pInst;
 }
 
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 
 int AndroidSalSystem::ShowNativeDialog( const OUString& rTitle,
                                         const OUString& rMessage,
@@ -371,8 +371,8 @@ int AndroidSalSystem::ShowNativeDialog( const OUString& rTitle,
         // horror would be needed to use it directly here. Probably we
         // want some easier to use magic wrapper, hmm.
 
-        ErrorBox aVclErrBox( NULL, WB_OK, rTitle );
-        aVclErrBox.SetText( rMessage );
+        MessageDialog aVclErrBox(NULL, rMessage);
+        aVclErrBox.SetText(rTitle);
         aVclErrBox.Execute();
     }
     else
diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx
index af0df03..61cc1b1 100644
--- a/vcl/ios/iosinst.cxx
+++ b/vcl/ios/iosinst.cxx
@@ -22,7 +22,7 @@
 #include <postmac.h>
 
 #include <basebmp/scanlineformats.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <touch/touch.h>
 #include <touch/touch-impl.h>
 
@@ -30,6 +30,7 @@
 #include "headless/svpdummies.hxx"
 #include "generic/gendata.hxx"
 #include "quartz/utils.h"
+#include <vcl/layout.hxx>
 #include <vcl/settings.hxx>
 
 // Horrible hack
@@ -236,9 +237,8 @@ int IosSalSystem::ShowNativeDialog( const OUString& rTitle,
     if (IosSalInstance::getInstance() != NULL)
     {
         // Temporary...
-
-        ErrorBox aVclErrBox( NULL, WB_OK, rTitle );
-        aVclErrBox.SetText( rMessage );
+        MessageDialog aVclErrBox(NULL, rMessage);
+        aVclErrBox.SetTitle(rTitle);
         aVclErrBox.Execute();
     }
 
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index 9774573..9099258 100644
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -40,7 +40,7 @@
 #include "vcl/fixed.hxx"
 #include "vcl/group.hxx"
 #include "vcl/field.hxx"
-#include "vcl/msgbox.hxx"
+#include "vcl/layout.hxx"
 #include "vcl/settings.hxx"
 #include "vcl/wrkwin.hxx"
 #include "vcl/threadex.hxx"
@@ -819,7 +819,7 @@ void DbgGUIStart()
     }
     else
     {
-        ErrorBox( 0, WB_OK, OUString("TOOLS Library has no Debug-Routines") ).Execute();
+        MessageDialog(0, OUString("TOOLS Library has no Debug-Routines")).Execute();
     }
 }
 
diff --git a/vcl/source/app/stdtext.cxx b/vcl/source/app/stdtext.cxx
index edd115d..2327639 100644
--- a/vcl/source/app/stdtext.cxx
+++ b/vcl/source/app/stdtext.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/stdtext.hxx>
 
 #include <svids.hrc>
@@ -39,16 +39,8 @@ void ShowServiceNotAvailableError(Window* pParent,
 {
     OUString aText  = GetStandardText(STANDARD_TEXT_SERVICE_NOT_AVAILABLE).
         replaceAll("%s", rServiceName);
-    if (bError)
-    {
-        ErrorBox aBox( pParent, WB_OK | WB_DEF_OK, aText );
-        aBox.Execute();
-    }
-    else
-    {
-        WarningBox aBox( pParent, WB_OK | WB_DEF_OK, aText );
-        aBox.Execute();
-    }
+    MessageDialog aBox(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 6ff25c5b..6054d69 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -34,7 +34,7 @@
 #include "vcl/svapp.hxx"
 #include "vcl/settings.hxx"
 #include "vcl/wrkwin.hxx"
-#include "vcl/msgbox.hxx"
+#include "vcl/layout.hxx"
 #include "vcl/button.hxx"
 #include "vcl/dockwin.hxx"
 #include "salinst.hxx"
@@ -155,7 +155,7 @@ 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 );
-            ErrorBox aBox( NULL, WB_OK | WB_DEF_OK, OUString( pMsg, strlen( pMsg ), RTL_TEXTENCODING_ASCII_US ) );
+            MessageDialog aBox(NULL, OUString(pMsg, strlen(pMsg), RTL_TEXTENCODING_ASCII_US));
             aBox.Execute();
         }
     }


More information about the Libreoffice-commits mailing list