Kaydet (Commit) a384b21c authored tarafından Matúš Kukan's avatar Matúš Kukan

sfx: Use constructor feature for ShutdownIcon.

Change-Id: I3af683cdc273fa8cb9224a0f1f7d342a140c9dd7
üst cf51afb0
......@@ -44,7 +44,6 @@
#include <sfx2/unoctitm.hxx>
#include "sfxslots.hxx"
#include "sfxtypes.hxx"
#include "shutdownicon.hxx"
#include <sal/config.h>
#include <basic/basmgr.hxx>
......@@ -1795,7 +1794,6 @@ SFX2_DLLPUBLIC void* SAL_CALL sfx_component_getFactory(
//=============================================================================
IF_NAME_CREATECOMPONENTFACTORY( BackingComp )
IF_NAME_CREATECOMPONENTFACTORY( SfxGlobalEvents_Impl )
IF_NAME_CREATECOMPONENTFACTORY( ShutdownIcon )
#ifdef TEST_HANDLERS
IF_NAME_CREATECOMPONENTFACTORY( TestKeyHandler )
IF_NAME_CREATECOMPONENTFACTORY( TestMouseClickHandler )
......
......@@ -46,12 +46,14 @@
#include <sfx2/fcontnr.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/compbase1.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <sfx2/dispatch.hxx>
#include <comphelper/extract.hxx>
#include <tools/urlobj.hxx>
#include <osl/security.hxx>
#include <osl/file.hxx>
#include <rtl/bootstrap.hxx>
#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
#ifdef UNX // need symlink
#include <unistd.h>
......@@ -70,10 +72,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::ui::dialogs;
#ifdef WNT
#else
using namespace ::rtl;
#endif
using namespace ::sfx2;
#ifdef ENABLE_QUICKSTART_APPLET
......@@ -102,8 +100,25 @@ void SAL_CALL SfxNotificationListener_Impl::disposing( const EventObject& ) thro
{
}
SFX_IMPL_XSERVICEINFO_CTX( ShutdownIcon, "com.sun.star.office.Quickstart", "com.sun.star.comp.desktop.QuickstartWrapper" ) \
SFX_IMPL_ONEINSTANCEFACTORY( ShutdownIcon );
OUString SAL_CALL ShutdownIcon::getImplementationName()
throw (css::uno::RuntimeException)
{
return OUString("com.sun.star.comp.desktop.QuickstartWrapper");
}
sal_Bool SAL_CALL ShutdownIcon::supportsService(OUString const & ServiceName)
throw (css::uno::RuntimeException)
{
return cppu::supportsService(this, ServiceName);
}
css::uno::Sequence<OUString> SAL_CALL ShutdownIcon::getSupportedServiceNames()
throw (css::uno::RuntimeException)
{
css::uno::Sequence< OUString > aSeq(1);
aSeq[0] = OUString("com.sun.star.office.Quickstart");
return aSeq;
}
bool ShutdownIcon::bModalMode = false;
ShutdownIcon* ShutdownIcon::pShutdownIcon = NULL;
......@@ -863,7 +878,7 @@ void ShutdownIcon::SetAutostart( bool bActivate )
getAutostartDir( true );
OUString aPath( "${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/xdg/qstart.desktop" );
Bootstrap::expandMacros( aPath );
rtl::Bootstrap::expandMacros( aPath );
OUString aDesktopFile;
::osl::File::getSystemPathFromFileURL( aPath, aDesktopFile );
......@@ -956,4 +971,14 @@ void SAL_CALL ShutdownIcon::setFastPropertyValue( ::sal_Int32
return aValue;
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_desktop_QuickstartWrapper_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
rtl::Reference<ShutdownIcon> x(new ShutdownIcon(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -22,9 +22,6 @@
#include <com/sun/star/frame/XTerminateListener.hpp>
#include <com/sun/star/frame/XDesktop2.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
......@@ -94,7 +91,14 @@ class SFX2_DLLPUBLIC ShutdownIcon : public ShutdownIconServiceBase
virtual ~ShutdownIcon();
SFX_DECL_XSERVICEINFO
virtual OUString SAL_CALL getImplementationName()
throw (css::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
throw (css::uno::RuntimeException);
virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
throw (css::uno::RuntimeException);
static ShutdownIcon* getInstance();
static ShutdownIcon* createInstance();
......@@ -113,10 +117,6 @@ class SFX2_DLLPUBLIC ShutdownIcon : public ShutdownIconServiceBase
void init() throw( ::com::sun::star::uno::Exception );
static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory >
GetWrapperFactory( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSMgr );
static OUString GetImplementationName_static();
OUString GetResString( int id );
OUString GetUrlDescription( const OUString& aUrl );
......
......@@ -29,7 +29,8 @@
<implementation name="CompatWriterDocPropsImpl">
<service name="com.sun.star.writer.DocumentProperties"/>
</implementation>
<implementation name="com.sun.star.comp.desktop.QuickstartWrapper">
<implementation name="com.sun.star.comp.desktop.QuickstartWrapper"
constructor="com_sun_star_comp_desktop_QuickstartWrapper_get_implementation">
<service name="com.sun.star.office.Quickstart"/>
</implementation>
<implementation name="com.sun.star.comp.document.OwnSubFilter"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment