summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-30 15:57:26 +0200
committerNoel Grandin <noel@peralex.com>2013-06-03 10:00:01 +0200
commit1f79707438d84ba639a2c601ae9d25c4647d37f6 (patch)
treea52374a4ce43de7d0814325bf72074f3998e3598 /desktop
parentd7fa9ca787ee0ec5d0b9f2989f547ff37791afc6 (diff)
fdo#46808, Convert office::Quickstart service to new style
Service already existed, just needed an IDL file. Change-Id: Ief5563e53c7331b65dd429079180c4eed2f2c071
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/app.cxx28
-rw-r--r--desktop/source/app/appfirststart.cxx8
2 files changed, 6 insertions, 30 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 3f37a987e3b4..374a239af97f 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -71,6 +71,7 @@
#include <com/sun/star/frame/XUIControllerRegistration.hpp>
#include <com/sun/star/frame/ToolbarControllerFactory.hpp>
#include <com/sun/star/frame/PopupMenuControllerFactory.hpp>
+#include <com/sun/star/office/Quickstart.hpp>
#include <toolkit/unohlp.hxx>
#include <comphelper/configuration.hxx>
@@ -1916,11 +1917,7 @@ sal_Bool Desktop::InitializeQuickstartMode( const Reference< XComponentContext >
if ( bQuickstart )
#endif
{
- Sequence< Any > aSeq( 1 );
- aSeq[0] <<= bQuickstart;
- Reference < XComponent > xQuickstart(
- rxContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.office.Quickstart", aSeq, rxContext),
- UNO_QUERY );
+ css::office::Quickstart::createStart(rxContext, bQuickstart);
}
return sal_True;
}
@@ -2725,15 +2722,8 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
// NOTICE: The quickstart service must be initialized inside the "main thread", so we use the
// application events to do this (they are executed inside main thread)!!!
// Don't start quickstart service if the user specified "--invisible" on the command line!
- sal_Bool bQuickstart( sal_True );
- Sequence< Any > aSeq( 1 );
- aSeq[0] <<= bQuickstart;
-
Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
- Reference < XInitialization > xQuickstart( xContext->getServiceManager()->createInstanceWithContext("com.sun.star.office.Quickstart", xContext),
- UNO_QUERY );
- if ( xQuickstart.is() )
- xQuickstart->initialize( aSeq );
+ css::office::Quickstart::createStart(xContext, true/*Quickstart*/);
}
break;
case ApplicationEvent::TYPE_SHOWDIALOG:
@@ -2931,18 +2921,8 @@ void Desktop::CheckFirstRun( )
{
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("RunQuickstartAtFirstStart"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
{
- sal_Bool bQuickstart( sal_True );
- sal_Bool bAutostart( sal_True );
- Sequence< Any > aSeq( 2 );
- aSeq[0] <<= bQuickstart;
- aSeq[1] <<= bAutostart;
-
css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
- Reference < XInitialization > xQuickstart(
- xContext->getServiceManager()->createInstanceWithContext("com.sun.star.office.Quickstart", xContext),
- UNO_QUERY );
- if ( xQuickstart.is() )
- xQuickstart->initialize( aSeq );
+ css::office::Quickstart::createAutoStart(xContext, true/*Quickstart*/, true/*bAutostart*/);
RegCloseKey( hKey );
}
}
diff --git a/desktop/source/app/appfirststart.cxx b/desktop/source/app/appfirststart.cxx
index 97ca6e149e6d..a5e3e32c9047 100644
--- a/desktop/source/app/appfirststart.cxx
+++ b/desktop/source/app/appfirststart.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/util/XChangesBatch.hpp>
+#include <com/sun/star/office/Quickstart.hpp>
#include "app.hxx"
@@ -67,15 +68,10 @@ void Desktop::DoRestartActionsIfNecessary( sal_Bool bQuickStart )
xPSet->setPropertyValue( sPropName, makeAny( sal_False ) );
Reference< util::XChangesBatch >( xPSet, UNO_QUERY_THROW )->commitChanges();
- Sequence< Any > aSeq( 1 );
sal_Bool bQuickstart = shouldLaunchQuickstart();
- aSeq[0] <<= bQuickstart;
css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
- Reference < XInitialization > xQuickstart(
- xContext->getServiceManager()->createInstanceWithContext("com.sun.star.office.Quickstart", xContext),
- UNO_QUERY_THROW );
- xQuickstart->initialize( aSeq );
+ css::office::Quickstart::createStart(xContext, bQuickstart);
}
}
catch( const uno::Exception& )