diff options
author | Andras Timar <atimar@suse.com> | 2012-06-28 12:33:25 +0200 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2012-06-28 20:27:46 +0200 |
commit | 677f10cdf0b6a7acb2f94fce8404b464061ccaf7 (patch) | |
tree | 92a65fdc832b0f3597d96ae7ef347a5ac2e057ad /desktop | |
parent | 1e0a880cfe5b9d724f1bb2b6bedb25da46d6c5ab (diff) |
fdo#46510 optionally turn on Quickstarter by installer
Change-Id: Ie002ab01a804cceea06e0a2ba7e6b2fe2a495344
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index e29e53518d29..d50507aa5b34 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -103,6 +103,18 @@ #include <sys/wait.h> #endif +#ifdef WNT +#ifdef _MSC_VER +#pragma warning(push, 1) /* disable warnings within system headers */ +#endif +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif //WNT + + using rtl::OUString; using rtl::OUStringBuffer; @@ -3039,6 +3051,30 @@ void Desktop::CheckFirstRun( ) m_firstRunTimer.SetTimeoutHdl(LINK(this, Desktop, AsyncInitFirstRun)); m_firstRunTimer.Start(); +#ifdef WNT + // Check if Quckstarter should be started (on Windows only) + TCHAR szValue[8192]; + DWORD nValueSize = sizeof(szValue); + HKEY hKey; + if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, "Software\\LibreOffice", &hKey ) ) + { + 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; + + Reference < XInitialization > xQuickstart( ::comphelper::getProcessServiceFactory()->createInstance( + OUString::createFromAscii( "com.sun.star.office.Quickstart" )),UNO_QUERY ); + if ( xQuickstart.is() ) + xQuickstart->initialize( aSeq ); + RegCloseKey( hKey ); + } + } +#endif + // -------------------------------------------------------------------- // reset the config flag |