summaryrefslogtreecommitdiffstats
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-02-21 21:20:15 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-02-25 20:03:26 +0100
commitd75144cf44779a8f6cc9bccf9b0a6328b94a5b90 (patch)
tree25b9f3c677c50ad715e1a0bc6bef3d5bf79ef957 /sw
parenttdf#115353 layout fix (diff)
downloadcore-d75144cf44779a8f6cc9bccf9b0a6328b94a5b90.tar.gz
core-d75144cf44779a8f6cc9bccf9b0a6328b94a5b90.zip
convert remaining InfoBox to weld::MessageDialog
Change-Id: I91d828e38d96264cf4a76f30940942556b8f78d8 Reviewed-on: https://gerrit.libreoffice.org/50205 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/frmedt/fetab.cxx30
-rw-r--r--sw/source/ui/index/cnttab.cxx11
-rw-r--r--sw/source/ui/misc/bookmark.cxx7
-rw-r--r--sw/source/uibase/app/docsh.cxx12
-rw-r--r--sw/source/uibase/app/docsh2.cxx5
-rw-r--r--sw/source/uibase/dochdl/gloshdl.cxx8
-rw-r--r--sw/source/uibase/lingu/hyp.cxx9
-rw-r--r--sw/source/uibase/lingu/olmenu.cxx4
-rw-r--r--sw/source/uibase/uiview/viewling.cxx4
-rw-r--r--sw/source/uibase/utlui/unotools.cxx7
10 files changed, 67 insertions, 30 deletions
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 4334c08a76f2..bf312fe6a642 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -176,7 +176,8 @@ void SwFEShell::InsertRow( sal_uInt16 nCnt, bool bBehind )
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
{
- ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, GetWin(),
+ vcl::Window* pWin = GetWin();
+ ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, pWin ? pWin->GetFrameWeld() : nullptr,
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
return;
}
@@ -215,7 +216,8 @@ void SwFEShell::InsertCol( sal_uInt16 nCnt, bool bBehind )
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
{
- ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, GetWin(),
+ vcl::Window* pWin = GetWin();
+ ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, pWin ? pWin->GetFrameWeld() : nullptr,
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
return;
}
@@ -224,7 +226,8 @@ void SwFEShell::InsertCol( sal_uInt16 nCnt, bool bBehind )
if( !CheckSplitCells( *this, nCnt + 1, SwTableSearchType::Col ) )
{
- ErrorHandler::HandleError( ERR_TBLINSCOL_ERROR, GetWin(),
+ vcl::Window* pWin = GetWin();
+ ErrorHandler::HandleError( ERR_TBLINSCOL_ERROR, pWin ? pWin->GetFrameWeld() : nullptr,
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
return;
}
@@ -268,7 +271,8 @@ bool SwFEShell::DeleteCol()
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
{
- ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, GetWin(),
+ vcl::Window* pWin = GetWin();
+ ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, pWin ? pWin->GetFrameWeld() : nullptr,
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
return false;
}
@@ -319,7 +323,8 @@ bool SwFEShell::DeleteRow(bool bCompleteTable)
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
{
- ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, GetWin(),
+ vcl::Window* pWin = GetWin();
+ ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, pWin ? pWin->GetFrameWeld() : nullptr,
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
return false;
}
@@ -438,7 +443,8 @@ TableMergeErr SwFEShell::MergeTab()
const SwTableNode* pTableNd = pTableCursor->GetNode().FindTableNode();
if( dynamic_cast< const SwDDETable* >(&pTableNd->GetTable()) != nullptr )
{
- ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, GetWin(),
+ vcl::Window* pWin = GetWin();
+ ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, pWin ? pWin->GetFrameWeld() : nullptr,
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
}
else
@@ -469,7 +475,8 @@ void SwFEShell::SplitTab( bool bVert, sal_uInt16 nCnt, bool bSameHeight )
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
{
- ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, GetWin(),
+ vcl::Window* pWin = GetWin();
+ ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, pWin ? pWin->GetFrameWeld() : nullptr,
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
return;
}
@@ -478,7 +485,8 @@ void SwFEShell::SplitTab( bool bVert, sal_uInt16 nCnt, bool bSameHeight )
if( bVert && !CheckSplitCells( *this, nCnt + 1, SwTableSearchType::NONE ) )
{
- ErrorHandler::HandleError( ERR_TBLSPLIT_ERROR, GetWin(),
+ vcl::Window* pWin = GetWin();
+ ErrorHandler::HandleError( ERR_TBLSPLIT_ERROR, pWin ? pWin->GetFrameWeld() : nullptr,
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
return;
}
@@ -1271,7 +1279,8 @@ bool SwFEShell::DeleteTableSel()
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
{
- ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, GetWin(),
+ vcl::Window* pWin = GetWin();
+ ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, pWin ? pWin->GetFrameWeld() : nullptr,
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
return false;
}
@@ -2163,7 +2172,8 @@ void SwFEShell::SetColRowWidthHeight( TableChgWidthHeightType eType, sal_uInt16
if( (TableChgWidthHeightType::InsertDeleteMode & eType) &&
dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
{
- ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, GetWin(),
+ vcl::Window* pWin = GetWin();
+ ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, pWin ? pWin->GetFrameWeld() : nullptr,
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
return;
}
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 27278667bf80..e9a040450012 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -20,10 +20,10 @@
#include <config_folders.h>
#include <comphelper/string.hxx>
+#include <vcl/builderfactory.hxx>
#include <svl/style.hxx>
-#include <vcl/msgbox.hxx>
#include <vcl/help.hxx>
-#include <vcl/builderfactory.hxx>
+#include <vcl/weld.hxx>
#include <svl/stritem.hxx>
#include <svl/urihelper.hxx>
#include <unotools/pathoptions.hxx>
@@ -487,8 +487,11 @@ IMPL_LINK_NOARG( SwMultiTOXTabDialog, ShowPreviewHdl, Button*, void )
OUString sInfo(SwResId(STR_FILE_NOT_FOUND));
sInfo = sInfo.replaceFirst( "%1", sTemplate );
sInfo = sInfo.replaceFirst( "%2", aOpt.GetTemplatePath() );
- ScopedVclPtrInstance< InfoBox > aInfo(GetParent(), sInfo);
- aInfo->Execute();
+ vcl::Window* pWin = GetParent();
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+ VclMessageType::Info, VclButtonsType::Ok,
+ sInfo));
+ xInfoBox->run();
}
else
{
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 3e262e984b46..3720dba23a86 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -20,7 +20,7 @@
#include <comphelper/string.hxx>
#include <sfx2/request.hxx>
#include <svl/stritem.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <vcl/builderfactory.hxx>
#include <svtools/headbar.hxx>
#include <svtools/treelistentry.hxx>
@@ -63,7 +63,10 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, ModifyHdl, Edit&, void)
if (sTmp.getLength() != nLen)
{
m_pEditBox->SetText(sTmp);
- ScopedVclPtrInstance<InfoBox>(this, sRemoveWarning + sMsg)->Execute();
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Info, VclButtonsType::Ok,
+ sRemoveWarning + sMsg));
+ xInfoBox->run();
}
sal_Int32 nSelectedEntries = 0;
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 1cc101938fa9..9291e0a2f763 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -21,7 +21,7 @@
#include <hintids.hxx>
#include <vcl/layout.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/jobset.hxx>
@@ -177,7 +177,10 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr,
{
if(!bAPICall)
{
- ScopedVclPtrInstance<InfoBox>(nullptr, SwResId(STR_CANTOPEN))->Execute();
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(nullptr,
+ VclMessageType::Info, VclButtonsType::Ok,
+ SwResId(STR_CANTOPEN)));
+ xInfoBox->run();
}
return nullptr;
}
@@ -550,7 +553,10 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium )
SwReaderWriter::GetWriter( pFlt->GetUserData(), rMedium.GetBaseURL( true ), xWriter );
if( !xWriter.is() )
{ // Filter not available
- ScopedVclPtrInstance<InfoBox>(nullptr, SwResId(STR_DLLNOTFOUND))->Execute();
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(nullptr,
+ VclMessageType::Info, VclButtonsType::Ok,
+ SwResId(STR_DLLNOTFOUND)));
+ xInfoBox->run();
return false;
}
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index c52304ff341a..a78e295d0604 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -1099,7 +1099,10 @@ void SwDocShell::Execute(SfxRequest& rReq)
}
if( !bDone && !rReq.IsAPI() )
{
- ScopedVclPtrInstance<InfoBox>(nullptr, SwResId( STR_CANTCREATE))->Execute();
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(nullptr,
+ VclMessageType::Info, VclButtonsType::Ok,
+ SwResId(STR_CANTCREATE)));
+ xInfoBox->run();
}
}
}
diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx
index e583f189d5dc..f964d1b546cc 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -21,7 +21,7 @@
#include <editeng/wghtitem.hxx>
#include <editeng/adjustitem.hxx>
#include <vcl/errinf.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <svl/macitem.hxx>
#include <sfx2/fcontnr.hxx>
#include <sfx2/docfile.hxx>
@@ -478,7 +478,11 @@ bool SwGlossaryHdl::Expand( const OUString& rShortName,
}
OUString aTmp( SwResId(STR_NOGLOS));
aTmp = aTmp.replaceFirst("%1", aShortName);
- ScopedVclPtrInstance<InfoBox>(pWrtShell->GetView().GetWindow(), aTmp)->Execute();
+ vcl::Window* pWin = pWrtShell->GetView().GetWindow();
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+ VclMessageType::Info, VclButtonsType::Ok,
+ aTmp));
+ xInfoBox->run();
}
return false;
diff --git a/sw/source/uibase/lingu/hyp.cxx b/sw/source/uibase/lingu/hyp.cxx
index 56bd99b8471d..4c8ec00ad591 100644
--- a/sw/source/uibase/lingu/hyp.cxx
+++ b/sw/source/uibase/lingu/hyp.cxx
@@ -22,7 +22,7 @@
#include <edtwin.hxx>
#include <wrtsh.hxx>
#include <globals.hrc>
-#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <vcl/wrkwin.hxx>
#include <linguistic/lngprops.hxx>
#include <com/sun/star/linguistic2/XLinguProperties.hpp>
@@ -120,7 +120,12 @@ SwHyphWrapper::~SwHyphWrapper()
if( nPageCount )
::EndProgress( pView->GetDocShell() );
if( bInfoBox && !Application::IsHeadlessModeEnabled() )
- ScopedVclPtrInstance<InfoBox>(&pView->GetEditWin(), SwResId(STR_HYP_OK))->Execute();
+ {
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pView->GetEditWin().GetFrameWeld(),
+ VclMessageType::Info, VclButtonsType::Ok,
+ SwResId(STR_HYP_OK)));
+ xInfoBox->run();
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx
index a411f3b25c97..a4ede37f35a4 100644
--- a/sw/source/uibase/lingu/olmenu.cxx
+++ b/sw/source/uibase/lingu/olmenu.cxx
@@ -746,7 +746,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
sWord, false, OUString() );
if (linguistic::DictionaryError::NONE != nAddRes && !xDictionary->getEntry(sWord).is())
{
- SvxDicError(&m_pSh->GetView().GetViewFrame()->GetWindow(), nAddRes);
+ SvxDicError(m_pSh->GetView().GetViewFrame()->GetWindow().GetFrameWeld(), nAddRes);
}
}
}
@@ -778,7 +778,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
if (linguistic::DictionaryError::NONE != nAddRes && !xDic->getEntry(sWord).is())
{
- SvxDicError(&m_pSh->GetView().GetViewFrame()->GetWindow(), nAddRes);
+ SvxDicError(m_pSh->GetView().GetViewFrame()->GetWindow().GetFrameWeld(), nAddRes);
}
}
}
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index 895bf7e2ddab..4f2191f4027e 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -411,7 +411,7 @@ void SwView::HyphenateDocument()
return;
}
- SfxErrorContext aContext( ERRCTX_SVX_LINGU_HYPHENATION, OUString(), m_pEditWin,
+ SfxErrorContext aContext( ERRCTX_SVX_LINGU_HYPHENATION, OUString(), m_pEditWin->GetFrameWeld(),
RID_SVXERRCTX, SvxResLocale() );
Reference< XHyphenator > xHyph( ::GetHyphenator() );
@@ -535,7 +535,7 @@ void SwView::StartThesaurus()
if (!IsValidSelectionForThesaurus())
return;
- SfxErrorContext aContext( ERRCTX_SVX_LINGU_THESAURUS, OUString(), m_pEditWin,
+ SfxErrorContext aContext( ERRCTX_SVX_LINGU_THESAURUS, OUString(), m_pEditWin->GetFrameWeld(),
RID_SVXERRCTX, SvxResLocale() );
// Determine language
diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx
index 849511797d45..0aac42591a7d 100644
--- a/sw/source/uibase/utlui/unotools.cxx
+++ b/sw/source/uibase/utlui/unotools.cxx
@@ -24,7 +24,7 @@
#include <unotools.hxx>
#include <unoprnms.hxx>
#include <i18nutil/unicode.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
@@ -93,7 +93,10 @@ void SwOneExampleFrame::CreateErrorMessage()
{
OUString sInfo(SwResId(STR_SERVICE_UNAVAILABLE));
sInfo += "com.sun.star.frame.FrameControl";
- ScopedVclPtrInstance<InfoBox>(nullptr, sInfo)->Execute();
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(nullptr,
+ VclMessageType::Info, VclButtonsType::Ok,
+ sInfo));
+ xInfoBox->run();
SwOneExampleFrame::bShowServiceNotAvailableMessage = false;
}
}