[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - sfx2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jan 9 10:50:17 UTC 2019


 sfx2/source/doc/objserv.cxx |   19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

New commits:
commit 8b25fa0e3051e2b168d66e40e485bd9e6e991341
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jan 8 17:11:50 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jan 9 11:49:53 2019 +0100

    Resolves: tdf#122308 ensure parent for message dialog
    
    Change-Id: Ie7e97d3beedfa007243e4a6b7408341857f2d903
    Reviewed-on: https://gerrit.libreoffice.org/65980
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
    Tested-by: Xisco Faulí <xiscofauli at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 3b9737c5ae5e..cb7bbfd75d75 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -392,13 +392,22 @@ uno::Sequence< document::CmisVersion > SfxObjectShell::GetCmisVersions( )
 
 void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
 {
+    weld::Window* pDialogParent = rReq.GetFrameWeld();
+    if (!pDialogParent)
+    {
+        SfxViewFrame* pFrame = GetFrame();
+        if (!pFrame)
+            pFrame = SfxViewFrame::GetFirst(this);
+        if (pFrame)
+            pDialogParent = pFrame->GetWindow().GetFrameWeld();
+    }
 
     sal_uInt16 nId = rReq.GetSlot();
 
     if( SID_SIGNATURE == nId || SID_MACRO_SIGNATURE == nId )
     {
         if ( QueryHiddenInformation( HiddenWarningFact::WhenSigning, nullptr ) == RET_YES )
-            ( SID_SIGNATURE == nId ) ? SignDocumentContent(rReq.GetFrameWeld()) : SignScriptingContent(rReq.GetFrameWeld());
+            ( SID_SIGNATURE == nId ) ? SignDocumentContent(pDialogParent) : SignScriptingContent(pDialogParent);
         return;
     }
 
@@ -425,7 +434,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
             if ( !IsOwnStorageFormat( *GetMedium() ) )
                 return;
 
-            SfxVersionDialog aDlg(rReq.GetFrameWeld(), pFrame, IsSaveVersionOnClose());
+            SfxVersionDialog aDlg(pDialogParent, pFrame, IsSaveVersionOnClose());
             aDlg.run();
             SetSaveVersionOnClose(aDlg.IsSaveVersionOnClose());
             rReq.Done();
@@ -713,7 +722,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
             if ( lErr != ERRCODE_IO_ABORT )
             {
                 SfxErrorContext aEc(ERRCTX_SFX_SAVEASDOC,GetTitle());
-                ErrorHandler::HandleError(lErr, rReq.GetFrameWeld());
+                ErrorHandler::HandleError(lErr, pDialogParent);
             }
 
             if ( nId == SID_EXPORTDOCASPDF )
@@ -802,7 +811,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
 
             SetModified( false );
             ErrCode lErr = GetErrorCode();
-            ErrorHandler::HandleError(lErr, rReq.GetFrameWeld());
+            ErrorHandler::HandleError(lErr, pDialogParent);
 
             rReq.SetReturnValue( SfxBoolItem(0, true) );
             rReq.Done();
@@ -815,7 +824,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
         case SID_DOCTEMPLATE:
         {
             // save as document templates
-            SfxSaveAsTemplateDialog aDlg(rReq.GetFrameWeld(), GetModel());
+            SfxSaveAsTemplateDialog aDlg(pDialogParent, GetModel());
             (void)aDlg.run();
             break;
         }


More information about the Libreoffice-commits mailing list