diff options
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( |