Kaydet (Commit) 869a85ad authored tarafından Caolán McNamara's avatar Caolán McNamara

weld: convert delete autotable entry message dialog

Change-Id: I58d70958872725ebbe27799b8e5158c5111e117b
Reviewed-on: https://gerrit.libreoffice.org/50005Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 1404b82e
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
#include <memory> #include <memory>
#include <vcl/edit.hxx> #include <vcl/edit.hxx>
#include <vcl/layout.hxx> #include <vcl/layout.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <vcl/settings.hxx> #include <vcl/settings.hxx>
#include <vcl/builderfactory.hxx> #include <vcl/builderfactory.hxx>
#include <vcl/weld.hxx>
#include <svl/zforlist.hxx> #include <svl/zforlist.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/i18n/BreakIterator.hpp> #include <com/sun/star/i18n/BreakIterator.hpp>
...@@ -370,8 +370,8 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, AddHdl, Button*, void) ...@@ -370,8 +370,8 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, AddHdl, Button*, void)
if( !bFormatInserted ) if( !bFormatInserted )
{ {
bOk = RET_CANCEL == ScopedVclPtrInstance<MessageDialog>(this, aStrInvalidFormat, VclMessageType::Error, VclButtonsType::OkCancel) std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), VclMessageType::Error, VclButtonsType::OkCancel, aStrInvalidFormat));
->Execute(); bOk = RET_CANCEL == xBox->run();
} }
} }
else else
...@@ -386,10 +386,11 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RemoveHdl, Button*, void) ...@@ -386,10 +386,11 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RemoveHdl, Button*, void)
aMessage += m_pLbFormat->GetSelectedEntry(); aMessage += m_pLbFormat->GetSelectedEntry();
aMessage += "\n"; aMessage += "\n";
VclPtrInstance<MessBox> pBox( this, MessBoxStyle::OkCancel, 0, std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), VclMessageType::Question,
aStrDelTitle, aMessage ); VclButtonsType::OkCancel, aStrDelTitle));
xBox->set_secondary_text(aMessage);
if ( pBox->Execute() == RET_OK ) if (xBox->run() == RET_OK)
{ {
m_pLbFormat->RemoveEntry( nDfltStylePos + nIndex ); m_pLbFormat->RemoveEntry( nDfltStylePos + nIndex );
m_pLbFormat->SelectEntryPos( nDfltStylePos + nIndex-1 ); m_pLbFormat->SelectEntryPos( nDfltStylePos + nIndex-1 );
...@@ -409,7 +410,6 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RemoveHdl, Button*, void) ...@@ -409,7 +410,6 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RemoveHdl, Button*, void)
bCoreDataChanged = true; bCoreDataChanged = true;
} }
} }
pBox.reset();
SelFormatHdl( *m_pLbFormat ); SelFormatHdl( *m_pLbFormat );
} }
...@@ -468,8 +468,8 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RenameHdl, Button*, void) ...@@ -468,8 +468,8 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RenameHdl, Button*, void)
if( !bFormatRenamed ) if( !bFormatRenamed )
{ {
bOk = RET_CANCEL == ScopedVclPtrInstance<MessageDialog>(this, aStrInvalidFormat, VclMessageType::Error, VclButtonsType::OkCancel) std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), VclMessageType::Error, VclButtonsType::OkCancel, aStrInvalidFormat));
->Execute(); bOk = RET_CANCEL == xBox->run();
} }
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment