View | Details | Raw Unified | Return to issue 120095
Collapse All | Expand All

(-)a/main/sfx2/source/appl/shutdownicon.cxx (-3 / +22 lines)
Lines 190-195 bool ShutdownIcon::LoadModule( osl::Module **pModule, Link Here
190
	return true;
190
	return true;
191
}
191
}
192
192
193
194
struct TerminateHdlData
195
{
196
    Reference< XDesktop > mxDesktop;
197
    TerminateHdlData( const Reference< XDesktop > &xDesktop )
198
    : mxDesktop( xDesktop ) {}
199
};
200
201
193
class IdleUnloader : Timer
202
class IdleUnloader : Timer
194
{
203
{
195
    ::osl::Module *m_pModule;
204
    ::osl::Module *m_pModule;
Lines 584-593 void ShutdownIcon::terminateDesktop() Link Here
584
    if ( xSupplier.is() )
593
    if ( xSupplier.is() )
585
    {
594
    {
586
        Reference< XIndexAccess > xTasks ( xSupplier->getFrames(), UNO_QUERY );
595
        Reference< XIndexAccess > xTasks ( xSupplier->getFrames(), UNO_QUERY );
587
        if( xTasks.is() )
596
        if( xTasks.is() && xTasks->getCount() < 1 )
588
        {
597
        {
589
            if( xTasks->getCount() < 1 )
598
            Application::PostUserEvent( STATIC_LINK(0, ShutdownIcon, TerminateHdl_Impl), new TerminateHdlData( xDesktop ) );
590
                xDesktop->terminate();
591
        }
599
        }
592
    }
600
    }
593
601
Lines 595-600 void ShutdownIcon::terminateDesktop() Link Here
595
    ShutdownIcon::pShutdownIcon = 0;
603
    ShutdownIcon::pShutdownIcon = 0;
596
}
604
}
597
605
606
607
IMPL_STATIC_LINK_NOINSTANCE( ShutdownIcon, TerminateHdl_Impl, TerminateHdlData*, pData )
608
{
609
    if ( pData->mxDesktop.is() )
610
        pData->mxDesktop->terminate();
611
    delete pData;
612
    return 0;
613
}
614
615
616
598
// ---------------------------------------------------------------------------
617
// ---------------------------------------------------------------------------
599
618
600
ShutdownIcon* ShutdownIcon::getInstance()
619
ShutdownIcon* ShutdownIcon::getInstance()
(-)a/main/sfx2/source/appl/shutdownicon.hxx (+4 lines)
Lines 44-50 Link Here
44
#include <sfx2/sfxuno.hxx>
44
#include <sfx2/sfxuno.hxx>
45
#include <cppuhelper/compbase4.hxx>
45
#include <cppuhelper/compbase4.hxx>
46
#include <sfx2/dllapi.h>
46
#include <sfx2/dllapi.h>
47
#include <tools/link.hxx>
47
48
49
struct TerminateHdlData;
48
class ResMgr;
50
class ResMgr;
49
namespace sfx2
51
namespace sfx2
50
{
52
{
Lines 102-107 class SFX2_DLLPUBLIC ShutdownIcon : public ShutdownIconServiceBase Link Here
102
104
103
		virtual ~ShutdownIcon();
105
		virtual ~ShutdownIcon();
104
106
107
        DECL_STATIC_LINK( ShutdownIcon, TerminateHdl_Impl, TerminateHdlData* );
108
105
        SFX_DECL_XSERVICEINFO
109
        SFX_DECL_XSERVICEINFO
106
110
107
		static ShutdownIcon* getInstance();
111
		static ShutdownIcon* getInstance();
(-)a/main/sfx2/source/appl/shutdowniconunx.cxx (-1 / +1 lines)
Lines 87-94 static void systray_disable_cb() Link Here
87
87
88
static void exit_quickstarter_cb( GtkWidget * )
88
static void exit_quickstarter_cb( GtkWidget * )
89
{
89
{
90
	ShutdownIcon::getInstance()->terminateDesktop();
91
	plugin_shutdown_sys_tray();
90
	plugin_shutdown_sys_tray();
91
    ShutdownIcon::getInstance()->terminateDesktop();
92
}
92
}
93
93
94
static void menu_deactivate_cb( GtkWidget *pMenu )
94
static void menu_deactivate_cb( GtkWidget *pMenu )

Return to issue 120095