[Libreoffice-commits] core.git: cui/source include/sfx2 sfx2/source

Caolán McNamara caolanm at redhat.com
Tue Apr 17 19:40:50 UTC 2018


 cui/source/dialogs/hldocntp.cxx  |    4 ++--
 include/sfx2/dispatch.hxx        |    7 ++++---
 sfx2/source/control/dispatch.cxx |   17 +++++++++++++++--
 sfx2/source/doc/objserv.cxx      |    4 ++--
 4 files changed, 23 insertions(+), 9 deletions(-)

New commits:
commit effa599086c38b3391d03dc5b6770b523e886b60
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 17 16:59:44 2018 +0100

    Related: tdf#116928 set specific parent for document warning dialog
    
    Change-Id: I827563c16a2ae59c698e1bfa82022a11f5256483
    Reviewed-on: https://gerrit.libreoffice.org/53055
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 99a24a1a8271..965198480d95 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -374,11 +374,11 @@ void SvxHyperlinkNewDocTp::DoApply ()
                         if (pViewFrame)
                         {
                             SfxStringItem aNewName( SID_FILE_NAME, aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
+                            SfxUnoFrameItem aDocFrame( SID_FILLFRAME, pViewFrame->GetFrame().GetFrameInterface() );
 
                             pViewFrame->GetDispatcher()->ExecuteList(
                                 SID_SAVEASDOC, SfxCallMode::SYNCHRON,
-                                { &aNewName });
-
+                                { &aNewName }, { &aDocFrame } );
                         }
                     }
                 }
diff --git a/include/sfx2/dispatch.hxx b/include/sfx2/dispatch.hxx
index 49777df94687..3ff8856985a2 100644
--- a/include/sfx2/dispatch.hxx
+++ b/include/sfx2/dispatch.hxx
@@ -130,9 +130,10 @@ public:
                                 SfxItemSet const * pInternalArgs,
                                 sal_uInt16 nModi);
 
-    const SfxPoolItem*  ExecuteList( sal_uInt16 nSlot,
-                                 SfxCallMode nCall,
-                                 std::initializer_list<SfxPoolItem const*> args);
+    const SfxPoolItem*  ExecuteList(sal_uInt16 nSlot,
+                                    SfxCallMode nCall,
+                                    std::initializer_list<SfxPoolItem const*> args,
+                                    std::initializer_list<SfxPoolItem const*> internalargs = std::initializer_list<SfxPoolItem const*>());
 
     const SfxPoolItem*  Execute( sal_uInt16 nSlot,
                                  SfxCallMode nCall,
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 6bc623a7b461..c05609f01ce7 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1079,7 +1079,8 @@ const SfxPoolItem* SfxDispatcher::Execute(sal_uInt16 nSlot, SfxCallMode eCall,
         });
 */
 const SfxPoolItem* SfxDispatcher::ExecuteList(sal_uInt16 nSlot, SfxCallMode eCall,
-        std::initializer_list<SfxPoolItem const*> args)
+        std::initializer_list<SfxPoolItem const*> args,
+        std::initializer_list<SfxPoolItem const*> internalargs)
 {
     if ( IsLocked() )
         return nullptr;
@@ -1097,7 +1098,19 @@ const SfxPoolItem* SfxDispatcher::ExecuteList(sal_uInt16 nSlot, SfxCallMode eCal
            MappedPut_Impl( aSet, *pArg );
        }
 
-       SfxRequest aReq( nSlot, eCall, aSet );
+       SfxRequest aReq(nSlot, eCall, aSet);
+
+       if (internalargs.begin() != internalargs.end())
+       {
+           SfxAllItemSet aInternalSet(SfxGetpApp()->GetPool());
+           for (const SfxPoolItem *pArg : internalargs)
+           {
+               assert(pArg);
+               aInternalSet.Put(*pArg);
+           }
+           aReq.SetInternalArgs_Impl(aInternalSet);
+       }
+
        Execute_( *pShell, *pSlot, aReq, eCall );
        return aReq.GetReturnValue();
     }
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index a8e4a94f8a63..7485cfe04a5f 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -698,7 +698,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
             if ( lErr != ERRCODE_IO_ABORT )
             {
                 SfxErrorContext aEc(ERRCTX_SFX_SAVEASDOC,GetTitle());
-                ErrorHandler::HandleError( lErr );
+                ErrorHandler::HandleError(lErr, rReq.GetFrameWeld());
             }
 
             if ( nId == SID_EXPORTDOCASPDF )
@@ -787,7 +787,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
 
             SetModified( false );
             ErrCode lErr = GetErrorCode();
-            ErrorHandler::HandleError(lErr);
+            ErrorHandler::HandleError(lErr, rReq.GetFrameWeld());
 
             rReq.SetReturnValue( SfxBoolItem(0, true) );
             rReq.Done();


More information about the Libreoffice-commits mailing list