parent
684a946b3a
commit
1e6cd0d277
@ -1,51 +0,0 @@
|
||||
@@ -, +, @@
|
||||
fix crash in exiting via disabling lone quick-starter, terminate at idle
|
||||
--- a/sfx2/source/appl/shutdownicon.cxx
|
||||
+++ a/sfx2/source/appl/shutdownicon.cxx
|
||||
@@ -182,6 +182,9 @@ bool ShutdownIcon::LoadModule( osl::Module **pModule,
|
||||
return true;
|
||||
}
|
||||
|
||||
+// These two timeouts are necessary to avoid there being
|
||||
+// plugin frames still on the stack, after unloading that
|
||||
+// code, causing a crash during disabling / termination.
|
||||
class IdleUnloader : Timer
|
||||
{
|
||||
::osl::Module *m_pModule;
|
||||
@@ -199,6 +202,22 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
+class IdleTerminate : Timer
|
||||
+{
|
||||
+ Reference< XDesktop > m_xDesktop;
|
||||
+public:
|
||||
+ IdleTerminate (Reference< XDesktop > xDesktop)
|
||||
+ {
|
||||
+ m_xDesktop = xDesktop;
|
||||
+ Start();
|
||||
+ }
|
||||
+ virtual void Timeout()
|
||||
+ {
|
||||
+ m_xDesktop->terminate();
|
||||
+ delete this;
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
void ShutdownIcon::initSystray()
|
||||
{
|
||||
if (m_bInitialized)
|
||||
@@ -576,11 +595,8 @@ void ShutdownIcon::terminateDesktop()
|
||||
if ( xSupplier.is() )
|
||||
{
|
||||
Reference< XIndexAccess > xTasks ( xSupplier->getFrames(), UNO_QUERY );
|
||||
- if( xTasks.is() )
|
||||
- {
|
||||
- if( xTasks->getCount() < 1 )
|
||||
- xDesktop->terminate();
|
||||
- }
|
||||
+ if( xTasks.is() && xTasks->getCount() < 1 )
|
||||
+ new IdleTerminate( xDesktop );
|
||||
}
|
||||
|
||||
// remove the instance pointer
|
@ -1,101 +0,0 @@
|
||||
diff --git a/sfx2/source/appl/makefile.mk b/sfx2/source/appl/makefile.mk
|
||||
index 72ac94a..a583102 100644
|
||||
--- a/sfx2/source/appl/makefile.mk
|
||||
+++ b/sfx2/source/appl/makefile.mk
|
||||
@@ -53,6 +53,10 @@ CFLAGS+=-DENABLE_QUICKSTART_APPLET
|
||||
CDEFS+=-DDLL_NAME=libsfx$(DLLPOSTFIX)$(DLLPOST)
|
||||
.IF "$(ENABLE_SYSTRAY_GTK)"=="TRUE"
|
||||
PKGCONFIG_MODULES=gtk+-2.0
|
||||
+.IF "$(ENABLE_GIO)"!=""
|
||||
+ PKGCONFIG_MODULES+=gio-2.0
|
||||
+ CDEFS+=-DENABLE_GIO
|
||||
+.ENDIF
|
||||
.INCLUDE: pkg_config.mk
|
||||
CFLAGS+=$(PKGCONFIG_CFLAGS)
|
||||
CFLAGS+=-DENABLE_QUICKSTART_APPLET
|
||||
diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx
|
||||
index e31c32f..1b78f9b 100644
|
||||
--- a/sfx2/source/appl/shutdowniconunx.cxx
|
||||
+++ b/sfx2/source/appl/shutdowniconunx.cxx
|
||||
@@ -19,6 +19,10 @@
|
||||
#include "shutdownicon.hxx"
|
||||
#endif
|
||||
|
||||
+#ifdef ENABLE_GIO
|
||||
+#include <gio/gio.h>
|
||||
+#endif
|
||||
+
|
||||
// Cut/paste from vcl/inc/svids.hrc
|
||||
#define SV_ICON_SMALL_START 25000
|
||||
|
||||
@@ -39,6 +43,9 @@
|
||||
static GtkWidget *pExitMenuItem = NULL;
|
||||
static GtkWidget *pOpenMenuItem = NULL;
|
||||
static GtkWidget *pDisableMenuItem = NULL;
|
||||
+#ifdef ENABLE_GIO
|
||||
+GFileMonitor* pMonitor = NULL;
|
||||
+#endif
|
||||
|
||||
static void open_url_cb( GtkWidget *, gpointer data )
|
||||
{
|
||||
@@ -354,6 +361,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
+#ifdef ENABLE_GIO
|
||||
+/*
|
||||
+ * See rhbz#610103. If the quickstarter is running, then LibreOffice is
|
||||
+ * upgraded, then the old quickstarter is still running, but is now unreliable
|
||||
+ * as the old install has been deleted. A fairly intractable problem but we
|
||||
+ * can avoid much of the pain if we turn off the quickstarter if we detect
|
||||
+ * that it has been physically deleted.
|
||||
+*/
|
||||
+static void notify_file_changed(GFileMonitor * /*gfilemonitor*/, GFile * /*arg1*/,
|
||||
+ GFile * /*arg2*/, GFileMonitorEvent event_type, gpointer /*user_data*/)
|
||||
+{
|
||||
+ if (event_type == G_FILE_MONITOR_EVENT_DELETED)
|
||||
+ exit_quickstarter_cb(GTK_WIDGET(pTrayIcon));
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
void SAL_DLLPUBLIC_EXPORT plugin_init_sys_tray()
|
||||
{
|
||||
::SolarMutexGuard aGuard;
|
||||
@@ -396,6 +419,20 @@
|
||||
// disable shutdown
|
||||
pShutdownIcon->SetVeto( true );
|
||||
pShutdownIcon->addTerminateListener();
|
||||
+
|
||||
+#ifdef ENABLE_GIO
|
||||
+ GFile* pFile = NULL;
|
||||
+ rtl::OUString sLibraryFileUrl;
|
||||
+ if (osl::Module::getUrlFromAddress(plugin_init_sys_tray, sLibraryFileUrl))
|
||||
+ pFile = g_file_new_for_uri(rtl::OUStringToOString(sLibraryFileUrl, RTL_TEXTENCODING_UTF8).getStr());
|
||||
+
|
||||
+ if (pFile)
|
||||
+ {
|
||||
+ if ((pMonitor = g_file_monitor_file(pFile, G_FILE_MONITOR_NONE, NULL, NULL)))
|
||||
+ g_signal_connect(pMonitor, "changed", (GCallback)notify_file_changed, NULL);
|
||||
+ g_object_unref(pFile);
|
||||
+ }
|
||||
+#endif
|
||||
}
|
||||
|
||||
void SAL_DLLPUBLIC_EXPORT plugin_shutdown_sys_tray()
|
||||
@@ -403,6 +440,16 @@
|
||||
::SolarMutexGuard aGuard;
|
||||
if( !pTrayIcon )
|
||||
return;
|
||||
+#ifdef ENABLE_GIO
|
||||
+ if (pMonitor)
|
||||
+ {
|
||||
+ g_signal_handlers_disconnect_by_func(pMonitor,
|
||||
+ (void*)notify_file_changed, pMonitor);
|
||||
+ g_file_monitor_cancel(pMonitor);
|
||||
+ g_object_unref(pMonitor);
|
||||
+ pMonitor = NULL;
|
||||
+ }
|
||||
+#endif
|
||||
gtk_widget_destroy( GTK_WIDGET( pTrayIcon ) );
|
||||
pTrayIcon = NULL;
|
||||
pExitMenuItem = NULL;
|
@ -1,21 +0,0 @@
|
||||
diff -r 98d427d68ce0 sw/source/core/txtnode/thints.cxx
|
||||
--- a/sw/source/core/txtnode/thints.cxx Thu Nov 04 14:44:14 2010 +0000
|
||||
+++ b/sw/source/core/txtnode/thints.cxx Sat Nov 27 16:03:40 2010 +0100
|
||||
@@ -2102,7 +2102,7 @@
|
||||
const SwTxtAttr* const pAutoStyle(i_rAttrSpan.second);
|
||||
SfxItemIter aIter(m_rAttrSet);
|
||||
const SfxPoolItem* pItem(aIter.GetCurItem());
|
||||
- while (true)
|
||||
+ while (pItem)
|
||||
{
|
||||
const USHORT nWhich(pItem->Which());
|
||||
if (CharFmt::IsItemIncluded(nWhich, pAutoStyle))
|
||||
@@ -2170,7 +2170,7 @@
|
||||
o_rClearIds.reserve(i_rAttrSet.Count());
|
||||
SfxItemIter aIter(i_rAttrSet);
|
||||
const SfxPoolItem* pItem(aIter.GetCurItem());
|
||||
- while (true)
|
||||
+ while (pItem)
|
||||
{
|
||||
o_rClearIds.push_back(pItem->Which());
|
||||
|
@ -1,71 +0,0 @@
|
||||
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
|
||||
index b657374..1f32f9b 100644
|
||||
--- a/desktop/inc/app.hxx
|
||||
+++ b/desktop/inc/app.hxx
|
||||
@@ -133,7 +133,6 @@ class Desktop : public Application
|
||||
static sal_Bool IsFirstStartWizardNeeded();
|
||||
static sal_Bool CheckExtensionDependencies();
|
||||
|
||||
- static void DoRestartActionsIfNecessary( sal_Bool bQuickStart );
|
||||
static void SetRestartState();
|
||||
|
||||
void SynchronizeExtensionRepositories();
|
||||
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
|
||||
index 9ec6e87..67834c3 100644
|
||||
--- a/desktop/source/app/app.cxx
|
||||
+++ b/desktop/source/app/app.cxx
|
||||
@@ -1919,9 +1921,8 @@ void Desktop::Main()
|
||||
|
||||
if ( !bRestartRequested )
|
||||
{
|
||||
- // if this run of the office is triggered by restart, some additional actions should be done
|
||||
- DoRestartActionsIfNecessary( !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoQuickstart() );
|
||||
-
|
||||
+ // if this run of the office is triggered by restart, some
|
||||
+ // additional actions should be done
|
||||
Execute();
|
||||
}
|
||||
}
|
||||
diff --git a/desktop/source/app/appfirststart.cxx b/desktop/source/app/appfirststart.cxx
|
||||
index 9ef0a8a..673dfa8 100644
|
||||
--- a/desktop/source/app/appfirststart.cxx
|
||||
+++ b/desktop/source/app/appfirststart.cxx
|
||||
@@ -269,38 +269,6 @@ sal_Bool Desktop::IsFirstStartWizardNeeded()
|
||||
return impl_isFirstStart() || !impl_isLicenseAccepted();
|
||||
}
|
||||
|
||||
-void Desktop::DoRestartActionsIfNecessary( sal_Bool bQuickStart )
|
||||
-{
|
||||
- if ( bQuickStart )
|
||||
- {
|
||||
- try
|
||||
- {
|
||||
- Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) );
|
||||
-
|
||||
- OUString sPropName( RTL_CONSTASCII_USTRINGPARAM( "OfficeRestartInProgress" ) );
|
||||
- Any aRestart = xPSet->getPropertyValue( sPropName );
|
||||
- sal_Bool bRestart = sal_False;
|
||||
- if ( ( aRestart >>= bRestart ) && bRestart )
|
||||
- {
|
||||
- xPSet->setPropertyValue( sPropName, makeAny( sal_False ) );
|
||||
- Reference< util::XChangesBatch >( xPSet, UNO_QUERY_THROW )->commitChanges();
|
||||
-
|
||||
- Sequence< Any > aSeq( 2 );
|
||||
- aSeq[0] <<= sal_True;
|
||||
- aSeq[1] <<= sal_True;
|
||||
-
|
||||
- Reference < XInitialization > xQuickstart( ::comphelper::getProcessServiceFactory()->createInstance(
|
||||
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.Quickstart" ) ) ),UNO_QUERY_THROW );
|
||||
- xQuickstart->initialize( aSeq );
|
||||
- }
|
||||
- }
|
||||
- catch( uno::Exception& )
|
||||
- {
|
||||
- // this is no critical operation so it should not prevent office from starting
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
-
|
||||
void Desktop::SetRestartState()
|
||||
{
|
||||
try
|
Loading…
Reference in new issue