summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-04-17 16:59:44 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-04-17 21:40:19 +0200
commiteffa599086c38b3391d03dc5b6770b523e886b60 (patch)
treed13f374e8b203505491270abe552b4aa94d9fb46
parent79ee6c979dcb87228836964af4f153f42edba745 (diff)
Related: tdf#116928 set specific parent for document warning dialog
Change-Id: I827563c16a2ae59c698e1bfa82022a11f5256483 Reviewed-on: https://gerrit.libreoffice.org/53055 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--cui/source/dialogs/hldocntp.cxx4
-rw-r--r--include/sfx2/dispatch.hxx7
-rw-r--r--sfx2/source/control/dispatch.cxx17
-rw-r--r--sfx2/source/doc/objserv.cxx4
4 files changed, 23 insertions, 9 deletions
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();