diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-19 16:33:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-22 22:07:38 +0100 |
commit | 6a4c464b49dbfa2801818ead1b50bc9580824d00 (patch) | |
tree | 3d6381b6b13576bc536670992b36784436486e95 /sfx2/source/doc/guisaveas.cxx | |
parent | f7733528e88a6619f82b54b59e92a9bca72c0a89 (diff) |
weld native message dialogs
just the straight-forward MessageDialog cases first
a) remove border_width from message dialog .ui so as to take
the default border width
b) retain 12 as default message dialog border for vcl widget case
c) remove layour_style from message dialog button boxes so as to
take the default mode (a no-op for vcl widget case)
d) use gtk response ids (vcl builder will converts to vcl ones)
Change-Id: I7de281093a1b64f92f71ca11e7cbba42bb658154
Reviewed-on: https://gerrit.libreoffice.org/50143
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source/doc/guisaveas.cxx')
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 4f878d32f14d..824f8598f3cc 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -64,7 +64,7 @@ #include <tools/urlobj.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/mimeconfighelper.hxx> -#include <vcl/layout.hxx> +#include <vcl/weld.hxx> #include <vcl/window.hxx> #include <toolkit/awt/vclxwindow.hxx> #include <o3tl/char16_t2wchar_t.hxx> @@ -666,10 +666,10 @@ sal_Int8 ModelData_Impl::CheckSaveAcceptable( sal_Int8 nCurStatus ) && GetMediaDescr().find( OUString("VersionComment") ) == GetMediaDescr().end() ) { // notify the user that SaveAs is going to be done - vcl::Window* pWin = SfxStoringHelper::GetModelWindow( m_xModel ); - ScopedVclPtrInstance<MessageDialog> aMessageBox(pWin, SfxResId(STR_NEW_FILENAME_SAVE), - VclMessageType::Question, VclButtonsType::OkCancel); - if ( aMessageBox->Execute() == RET_OK ) + vcl::Window* pWin = SfxStoringHelper::GetModelWindow(m_xModel); + std::unique_ptr<weld::MessageDialog> xMessageBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Question, VclButtonsType::OkCancel, SfxResId(STR_NEW_FILENAME_SAVE))); + if (xMessageBox->run() == RET_OK) nResult = STATUS_SAVEAS; else nResult = STATUS_NO_ACTION; @@ -1388,8 +1388,9 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo || SignatureState::NOTVALIDATED == nDocumentSignatureState || SignatureState::PARTIAL_OK == nDocumentSignatureState) { - if (ScopedVclPtrInstance<MessageDialog>(nullptr, SfxResId(RID_SVXSTR_XMLSEC_QUERY_LOSINGSIGNATURE), - VclMessageType::Question, VclButtonsType::YesNo)->Execute() != RET_YES) + std::unique_ptr<weld::MessageDialog> xMessageBox(Application::CreateMessageDialog(nullptr, + VclMessageType::Question, VclButtonsType::YesNo, SfxResId(RID_SVXSTR_XMLSEC_QUERY_LOSINGSIGNATURE))); + if (xMessageBox->run() != RET_YES) { // the user has decided not to store the document throw task::ErrorCodeIOException( |