summaryrefslogtreecommitdiff
path: root/sfx2/source/appl/appserv.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-12-22 13:20:26 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-12-22 17:17:30 +0100
commitb9b2ab0f9f1ad91bba899068d2be7fc7767f41c9 (patch)
tree5bc6300d20e49609a85efc5aaedce00c3747478c /sfx2/source/appl/appserv.cxx
parentde6ccf060cc85a6ea154989bcc254e37854aa07b (diff)
Revert "unused SID command in sfx2"
This reverts commit 08f4ecd5823c420bb7157c238460d50f1f1f9791. Change-Id: I93c4e44de73ce62b4cad7e3c6c56943dafaaebb4 Reviewed-on: https://gerrit.libreoffice.org/46966 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/appl/appserv.cxx')
-rw-r--r--sfx2/source/appl/appserv.cxx101
1 files changed, 101 insertions, 0 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index eaa244153fc2..31de5352644b 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -324,12 +324,45 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
bool bDone = false;
switch ( rReq.GetSlot() )
{
+ case SID_SETOPTIONS:
+ {
+ if( rReq.GetArgs() )
+ SetOptions_Impl( *rReq.GetArgs() );
+ break;
+ }
+
case SID_QUITAPP:
+ case SID_LOGOUT:
{
// protect against reentrant calls
if ( pImpl->bInQuit )
return;
+ if ( rReq.GetSlot() == SID_LOGOUT )
+ {
+ for ( SfxObjectShell *pObjSh = SfxObjectShell::GetFirst();
+ pObjSh; pObjSh = SfxObjectShell::GetNext( *pObjSh ) )
+ {
+ if ( !pObjSh->IsModified() )
+ continue;
+
+ SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pObjSh );
+ if ( !pFrame || !pFrame->GetWindow().IsReallyVisible() )
+ continue;
+
+ if (pObjSh->PrepareClose())
+ pObjSh->SetModified( false );
+ else
+ return;
+ }
+
+ SfxStringItem aNameItem( SID_FILE_NAME, OUString("vnd.sun.star.cmd:logout") );
+ SfxStringItem aReferer( SID_REFERER, "private/user" );
+ pImpl->pAppDispat->ExecuteList(SID_OPENDOC,
+ SfxCallMode::SLOT, { &aNameItem, &aReferer });
+ return;
+ }
+
// try from nested requests again after 100ms
if( Application::GetDispatchLevel() > 1 )
{
@@ -361,6 +394,10 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
}
case SID_CONFIG:
+ case SID_TOOLBOXOPTIONS:
+ case SID_CONFIGSTATUSBAR:
+ case SID_CONFIGMENU:
+ case SID_CONFIGACCEL:
case SID_CONFIGEVENT:
{
SfxAbstractDialogFactory* pFact =
@@ -399,6 +436,40 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
break;
}
+ case SID_CLOSEDOCS:
+ {
+
+ Reference < XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() );
+ Reference< XIndexAccess > xTasks( xDesktop->getFrames(), UNO_QUERY );
+ if ( !xTasks.is() )
+ break;
+
+ sal_Int32 n=0;
+ do
+ {
+ if ( xTasks->getCount() <= n )
+ break;
+
+ Any aAny = xTasks->getByIndex(n);
+ Reference < XCloseable > xTask;
+ aAny >>= xTask;
+ try
+ {
+ xTask->close(true);
+ n++;
+ }
+ catch( CloseVetoException& )
+ {
+ }
+ }
+ while( true );
+
+ bool bOk = ( n == 0);
+ rReq.SetReturnValue( SfxBoolItem( 0, bOk ) );
+ bDone = true;
+ break;
+ }
+
case SID_SAVEDOCS:
{
bool bOK = true;
@@ -958,6 +1029,10 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
}
case SID_CONFIG:
+ case SID_TOOLBOXOPTIONS:
+ case SID_CONFIGSTATUSBAR:
+ case SID_CONFIGMENU:
+ case SID_CONFIGACCEL:
case SID_CONFIGEVENT:
{
if( SvtMiscOptions().DisableUICustomization() )
@@ -988,6 +1063,15 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
}
break;
+ case SID_CLOSEDOCS:
+ {
+ Reference < XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() );
+ Reference< XIndexAccess > xTasks( xDesktop->getFrames(), UNO_QUERY );
+ if ( !xTasks.is() || !xTasks->getCount() )
+ rSet.DisableItem(nWhich);
+ break;
+ }
+
case SID_SAVEDOCS:
{
bool bModified = false;
@@ -1485,6 +1569,23 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
break;
#endif // HAVE_FEATURE_SCRIPTING
+ case SID_OFFICE_CHECK_PLZ:
+ {
+ bool bRet = false;
+ const SfxStringItem* pStringItem = rReq.GetArg<SfxStringItem>(rReq.GetSlot());
+
+ if ( pStringItem )
+ {
+ bRet = true /*!!!SfxIniManager::CheckPLZ( aPLZ )*/;
+ }
+#if HAVE_FEATURE_SCRIPTING
+ else
+ SbxBase::SetError( ERRCODE_BASIC_WRONG_ARGS );
+#endif
+ rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), bRet ) );
+ }
+ break;
+
case SID_AUTO_CORRECT_DLG:
{
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();