[Libreoffice-commits] core.git: Branch 'feature/screensaverinhibit-update' - 693 commits - accessibility/inc accessibility/source android/Bootstrap android/CustomTarget_lo_android.mk android/.gitignore android/Makefile android/README android/source animations/source avmedia/inc avmedia/source basctl/source basebmp/inc basebmp/source basebmp/test basegfx/source basegfx/test basic/inc basic/source bean/com binaryurp/source bin/findunusedcode bridges/inc bridges/source canvas/source chart2/inc chart2/qa chart2/source chart2/uiconfig cli_ure/source codemaker/source comphelper/qa comphelper/source compilerplugins/clang config_host/config_global.h.in config_host/config_liblangtag.h.in config_host.mk.in configmgr/qa configmgr/source configure.ac connectivity/com connectivity/Library_tdeab1.mk connectivity/Library_tdeabdrv1.mk connectivity/qa connectivity/source cppcanvas/qa cppcanvas/source cppuhelper/qa cppuhelper/source cppu/qa cppu/source cpputools/source cui/source cui/uiconfig dbaccess/qa dbaccess/ source desktop/inc desktop/Pagein_common.mk desktop/qa desktop/source dictionaries distro-configs/LibreOfficeAndroidAarch64.conf distro-configs/LibreOfficeAndroid.conf distro-configs/LibreOfficeAndroidX86.conf distro-configs/LibreOfficeCoverity.conf distro-configs/LibreOfficeEmscripten.conf distro-configs/LibreOfficeLinux.conf distro-configs/LibreOfficeOpenBSD.conf download.lst drawinglayer/source dtrans/source editeng/qa editeng/source embeddedobj/source embedserv/source eventattacher/source extensions/qa extensions/source extensions/test external/apache-commons external/hunspell external/liborcus extras/source filter/qa filter/source forms/qa forms/source formula/source fpicker/source fpicker/test framework/inc framework/qa framework/source .gitignore helpcontent2 hwpfilter/qa hwpfilter/source i18nlangtag/CppunitTest_i18nlangtag_test_languagetag.mk i18nlangtag/Library_i18nlangtag.mk i18nlangtag/qa i18nlangtag/source i18npool/inc i18npool/qa i18npool/source i18nutil/source icon-the mes/breeze icon-themes/galaxy icon-themes/sifr icon-themes/tango idlc/inc idl/inc include/avmedia include/basegfx include/basic include/canvas include/codemaker include/comphelper include/connectivity include/cppcanvas include/dbaccess include/drawinglayer include/editeng include/filter include/formula include/framework include/i18nutil include/jvmaccess include/LibreOfficeKit include/linguistic include/o3tl include/oox include/osl include/registry include/sal include/sax include/sfx2 include/sot include/svl include/svtools include/svx include/test include/toolkit include/tools include/ucbhelper include/unoidl include/unotest include/unotools include/vbahelper include/vcl include/xmloff include/xmlreader include/xmlscript instsetoo_native/inc_openoffice io/qa io/source javaunohelper/com javaunohelper/source jurt/com jvmfwk/plugins jvmfwk/source l10ntools/inc l10ntools/source libreofficekit/qa lingucomponent/source linguistic/inc linguistic/source lotuswordpro/qa lotuswordpro/source Makefile.fetch Makefile.in nlpsolver/src nlpsolver/ThirdParty odk/settings odk/source offapi/com offapi/UnoApi_offapi.mk officecfg/Configuration_officecfg.mk officecfg/registry onlineupdate/source oox/inc oox/qa oox/source package/inc package/qa package/source postprocess/CustomTarget_registry.mk postprocess/Rdb_services.mk pyuno/inc pyuno/source qadevOOo/Jar_OOoRunner.mk qadevOOo/runner qadevOOo/tests readlicense_oo/license README.Solaris registry/tools remotebridges/source reportbuilder/java reportdesign/inc reportdesign/source RepositoryExternal.mk Repository.mk ridljar/com ridljar/Jar_ridl.mk rsc/inc rsc/source sal/android sal/cppunittester salhelper/qa salhelper/source sal/osl sal/qa sax/qa sax/source scaddins/source sccomp/qa sccomp/source sc/inc scp2/AutoInstall.mk scp2/InstallModule_gnome.mk scp2/InstallScript_setup_osl.mk scp2/Module_scp2.mk scp2/source sc/qa scripting/java scripting/source sc/source sc/uiconfig sc/util sc/workben sd/CppunitTest_sd_import_tests.mk sdext/sou rce sd/inc sd/qa sd/source setup_native/scripts setup_native/source sfx2/inc sfx2/qa sfx2/source sfx2/uiconfig shell/inc shell/Library_gconfbe.mk shell/Module_shell.mk shell/Package_scripts.mk shell/Package_scripts_tde.mk shell/README shell/source slideshow/inc slideshow/source slideshow/test smoketest/org smoketest/smoketest.cxx solenv/bin solenv/gbuild sot/qa sot/source starmath/inc starmath/Library_sm.mk starmath/qa starmath/sdi starmath/source stoc/source store/source svgio/inc svgio/qa svgio/source svl/qa svl/source svtools/inc svtools/qa svtools/source svtools/uiconfig svx/inc svx/source svx/workben sw/CppunitTest_sw_uiwriter.mk sw/CppunitTest_sw_ww8export.mk swext/mediawiki sw/inc sw/qa sw/sdi sw/source sysui/CustomTarget_deb.mk test/source testtools/com testtools/source toolkit/inc toolkit/qa toolkit/source tools/qa tools/source translations tubes/source ucbhelper/source ucb/source UnoControls/inc UnoControls/source unoidl/source unotest/source unotools/qa unotools/source un oxml/qa unoxml/source uui/source vbahelper/source vcl/generic vcl/headless vcl/inc vcl/ios vcl/Library_vcl.mk vcl/opengl vcl/osx vcl/qa vcl/quartz vcl/source vcl/uiconfig vcl/UIConfig_vcl.mk vcl/unx vcl/win vcl/workben winaccessibility/inc wizards/com writerfilter/inc writerfilter/qa writerfilter/source writerperfect/inc writerperfect/qa writerperfect/source xmerge/source xmlhelp/source xmloff/inc xmloff/qa xmloff/source xmlscript/source xmlsecurity/inc xmlsecurity/source

Andrzej Hunt andrzej at ahunt.org
Tue Oct 20 09:04:05 PDT 2015


Rebased ref, commits from common ancestor:
commit ef56cb5b986857d067f3745c37c15adb60bf9e42
Author: Andrzej Hunt <andrzej at ahunt.org>
Date:   Tue Oct 20 17:24:44 2015 +0200

    Add org.mate.SessionManager support
    
    This is valid for Mate <= 1.10
    (As of writing, 1.10 is the current stable release - so we'll have
     to keep shipping this for quite a few years to come.)
    
    Change-Id: I4d1f81c50923148e710eac22f5428b2a1c41f0e9

diff --git a/vcl/inc/unx/screensaverinhibitor.hxx b/vcl/inc/unx/screensaverinhibitor.hxx
index f00e61f..286c18d 100644
--- a/vcl/inc/unx/screensaverinhibitor.hxx
+++ b/vcl/inc/unx/screensaverinhibitor.hxx
@@ -33,6 +33,7 @@ private:
     boost::optional<guint> mnFDOCookie; // FDO ScreenSaver Inhibit
     boost::optional<guint> mnFDOPMCookie; // FDO PowerManagement Inhibit
     boost::optional<guint> mnGSMCookie;
+    boost::optional<guint> mnMSMCookie;
 
     boost::optional<int> mnXScreenSaverTimeout;
 
@@ -53,11 +54,14 @@ private:
     // FDOPM: org.freedesktop.PowerManagement.Inhibit::Inhibit - XFCE, (KDE) ?
     //        (KDE: doesn't inhibit screensaver, but does inhibit PowerManagement)
     // GSM: org.gnome.SessionManager::Inhibit - gnome 3
+    // MSM: org.mate.Sessionmanager::Inhibit - Mate <= 1.10, is identical to GSM
+    //       (This is replaced by the GSM interface from Mate 1.12 onwards)
     //
     // Note: the Uninhibit call has different spelling in FDO (UnInhibit) vs GSM (Uninhibit)
     void inhibitFDO( bool bInhibit, const gchar* appname, const gchar* reason );
     void inhibitFDOPM( bool bInhibit, const gchar* appname, const gchar* reason );
     void inhibitGSM( bool bInhibit, const gchar* appname, const gchar* reason, const guint xid );
+    void inhibitMSM( bool bInhibit, const gchar* appname, const gchar* reason, const guint xid );
 
     void inhibitXScreenSaver( bool bInhibit, Display* pDisplay );
     static void inhibitXAutoLock( bool bInhibit, Display* pDisplay );
diff --git a/vcl/unx/generic/window/screensaverinhibitor.cxx b/vcl/unx/generic/window/screensaverinhibitor.cxx
index e26b17d..5346ac4 100644
--- a/vcl/unx/generic/window/screensaverinhibitor.cxx
+++ b/vcl/unx/generic/window/screensaverinhibitor.cxx
@@ -29,6 +29,11 @@
 #define GSM_DBUS_SERVICE        "org.gnome.SessionManager"
 #define GSM_DBUS_PATH           "/org/gnome/SessionManager"
 #define GSM_DBUS_INTERFACE      "org.gnome.SessionManager"
+
+// Mate <= 1.10 uses org.mate.SessionManager, > 1.10 will use org.gnome.SessionManager
+#define MSM_DBUS_SERVICE        "org.mate.SessionManager"
+#define MSM_DBUS_PATH           "/org/mate/SessionManager"
+#define MSM_DBUS_INTERFACE      "org.mate.SessionManager"
 #endif
 
 #include <sal/log.hxx>
@@ -54,6 +59,7 @@ void ScreenSaverInhibitor::inhibit( bool bInhibit, const OUString& sReason,
         if ( xid != boost::none )
         {
             inhibitGSM( bInhibit, appname, aReason.getStr(), xid.get() );
+            inhibitMSM( bInhibit, appname, aReason.getStr(), xid.get() );
         }
     }
 }
@@ -198,6 +204,31 @@ void ScreenSaverInhibitor::inhibitGSM( bool bInhibit, const gchar* appname, cons
                  mnGSMCookie );
 }
 
+void ScreenSaverInhibitor::inhibitMSM( bool bInhibit, const gchar* appname, const gchar* reason, const guint xid )
+{
+    dbusInhibit( bInhibit,
+                 MSM_DBUS_SERVICE, MSM_DBUS_PATH, MSM_DBUS_INTERFACE,
+                 [appname, reason, xid] ( DBusGProxy *proxy, guint& nCookie, GError*& error ) -> bool {
+                     return dbus_g_proxy_call( proxy,
+                                               "Inhibit", &error,
+                                               G_TYPE_STRING, appname,
+                                               G_TYPE_UINT, xid,
+                                               G_TYPE_STRING, reason,
+                                               G_TYPE_UINT, 8, //Inhibit the session being marked as idle
+                                               G_TYPE_INVALID,
+                                               G_TYPE_UINT, &nCookie,
+                                               G_TYPE_INVALID );
+                 },
+                 [] ( DBusGProxy *proxy, const guint nCookie, GError*& error ) -> bool {
+                     return dbus_g_proxy_call( proxy,
+                                               "Uninhibit", &error,
+                                               G_TYPE_UINT, nCookie,
+                                               G_TYPE_INVALID,
+                                               G_TYPE_INVALID );
+                 },
+                 mnMSMCookie );
+}
+
 /**
  * Disable screensavers using the XSetScreenSaver/XGetScreenSaver API.
  *
commit 9be320262f87f0e9e08e7d91835bee592f3cc81c
Author: Andrzej Hunt <andrzej at ahunt.org>
Date:   Tue Oct 20 16:36:33 2015 +0200

    Add support for org.freedesktop.PowerManagement.Inhibit too
    
    This one seems to be supported by KDE (partially) and XFCE.
    On KDE it doesn't inhibit the ScreenSaver, however it's the only
    inhibition that appears to be available on XFCE (untested due
    to lack of XFCE system at hand).
    
    Change-Id: I4eab04d8ef66fc4fa55f57add46cb1ad15a8e2b3

diff --git a/vcl/inc/unx/screensaverinhibitor.hxx b/vcl/inc/unx/screensaverinhibitor.hxx
index 2486961..f00e61f 100644
--- a/vcl/inc/unx/screensaverinhibitor.hxx
+++ b/vcl/inc/unx/screensaverinhibitor.hxx
@@ -30,7 +30,8 @@ public:
                   bool bIsX11, const boost::optional<guint> xid, boost::optional<Display*> pDisplay );
 
 private:
-    boost::optional<guint> mnFDOCookie;
+    boost::optional<guint> mnFDOCookie; // FDO ScreenSaver Inhibit
+    boost::optional<guint> mnFDOPMCookie; // FDO PowerManagement Inhibit
     boost::optional<guint> mnGSMCookie;
 
     boost::optional<int> mnXScreenSaverTimeout;
@@ -42,8 +43,20 @@ private:
     CARD16 mnDPMSOffTimeout;
 #endif
 
+    // There are a bunch of different dbus based inhibition APIs. Some call
+    // themselves ScreenSaver inhibition, some are PowerManagement inhibition,
+    // but they appear to have the same effect. There doesn't appear to be one
+    // all encompassing standard, hence we should just try all of tem.
+    //
+    // The current APIs we have: (note: the list of supported environments is incomplete)
+    // FDO: org.freedesktop.ScreenSaver::Inhibit - appears to be supported only by KDE?
+    // FDOPM: org.freedesktop.PowerManagement.Inhibit::Inhibit - XFCE, (KDE) ?
+    //        (KDE: doesn't inhibit screensaver, but does inhibit PowerManagement)
+    // GSM: org.gnome.SessionManager::Inhibit - gnome 3
+    //
     // Note: the Uninhibit call has different spelling in FDO (UnInhibit) vs GSM (Uninhibit)
     void inhibitFDO( bool bInhibit, const gchar* appname, const gchar* reason );
+    void inhibitFDOPM( bool bInhibit, const gchar* appname, const gchar* reason );
     void inhibitGSM( bool bInhibit, const gchar* appname, const gchar* reason, const guint xid );
 
     void inhibitXScreenSaver( bool bInhibit, Display* pDisplay );
diff --git a/vcl/unx/generic/window/screensaverinhibitor.cxx b/vcl/unx/generic/window/screensaverinhibitor.cxx
index 3b4b1db..e26b17d 100644
--- a/vcl/unx/generic/window/screensaverinhibitor.cxx
+++ b/vcl/unx/generic/window/screensaverinhibitor.cxx
@@ -22,6 +22,10 @@
 #define FDO_DBUS_PATH           "/org/freedesktop/ScreenSaver"
 #define FDO_DBUS_INTERFACE      "org.freedesktop.ScreenSaver"
 
+#define FDOPM_DBUS_SERVICE      "org.freedesktop.PowerManagement.Inhibit"
+#define FDOPM_DBUS_PATH         "/org/freedesktop/PowerManagement/Inhibit"
+#define FDOPM_DBUS_INTERFACE    "org.freedesktop.PowerManagement.Inhibit"
+
 #define GSM_DBUS_SERVICE        "org.gnome.SessionManager"
 #define GSM_DBUS_PATH           "/org/gnome/SessionManager"
 #define GSM_DBUS_INTERFACE      "org.gnome.SessionManager"
@@ -36,6 +40,7 @@ void ScreenSaverInhibitor::inhibit( bool bInhibit, const OUString& sReason,
     const OString aReason = OUStringToOString( sReason, RTL_TEXTENCODING_UTF8 );
 
     inhibitFDO( bInhibit, appname, aReason.getStr() );
+    inhibitFDOPM( bInhibit, appname, aReason.getStr() );
 
     if ( bIsX11 )
     {
@@ -145,6 +150,29 @@ void ScreenSaverInhibitor::inhibitFDO( bool bInhibit, const gchar* appname, cons
                  mnFDOCookie );
 }
 
+void ScreenSaverInhibitor::inhibitFDOPM( bool bInhibit, const gchar* appname, const gchar* reason )
+{
+    dbusInhibit( bInhibit,
+                 FDOPM_DBUS_SERVICE, FDOPM_DBUS_PATH, FDOPM_DBUS_INTERFACE,
+                 [appname, reason] ( DBusGProxy *proxy, guint& nCookie, GError*& error ) -> bool {
+                     return dbus_g_proxy_call( proxy,
+                                               "Inhibit", &error,
+                                               G_TYPE_STRING, appname,
+                                               G_TYPE_STRING, reason,
+                                               G_TYPE_INVALID,
+                                               G_TYPE_UINT, &nCookie,
+                                               G_TYPE_INVALID );
+                 },
+                 [] ( DBusGProxy *proxy, const guint nCookie, GError*& error ) -> bool {
+                     return dbus_g_proxy_call( proxy,
+                                               "UnInhibit", &error,
+                                               G_TYPE_UINT, nCookie,
+                                               G_TYPE_INVALID,
+                                               G_TYPE_INVALID );
+                 },
+                 mnFDOPMCookie );
+}
+
 void ScreenSaverInhibitor::inhibitGSM( bool bInhibit, const gchar* appname, const gchar* reason, const guint xid )
 {
     dbusInhibit( bInhibit,
commit f660ef504a85a831d05e9e512d2232a473dc9da4
Author: Andrzej Hunt <andrzej at ahunt.org>
Date:   Tue Oct 20 12:20:04 2015 +0200

    Move DPMS inhibition to ScreenSaverInhibitor
    
    We should also be doing this irregardless of vcl backend
    
    Change-Id: I46ec2c654dfd9ab3c6bcf6da19e7ffa2c05890b9

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index af0d545..c124f84 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -735,6 +735,7 @@ $(eval $(call gb_Library_add_libs,vcl,\
 	-lpthread \
     -lGL \
     -lX11 \
+	-lXext \
 ))
 
 $(eval $(call gb_Library_add_exception_objects,vcl,\
diff --git a/vcl/inc/unx/screensaverinhibitor.hxx b/vcl/inc/unx/screensaverinhibitor.hxx
index 8c9ad54..2486961 100644
--- a/vcl/inc/unx/screensaverinhibitor.hxx
+++ b/vcl/inc/unx/screensaverinhibitor.hxx
@@ -11,6 +11,9 @@
 #define INCLUDED_VCL_INC_UNX_SCREENSAVERINHIBITOR_HXX
 
 #include <prex.h>
+#if !defined(SOLARIS) && !defined(AIX)
+#include <X11/extensions/dpms.h>
+#endif
 #include <postx.h>
 
 #include <rtl/ustring.hxx>
@@ -32,12 +35,20 @@ private:
 
     boost::optional<int> mnXScreenSaverTimeout;
 
+#if !defined(SOLARIS) && !defined(AIX)
+    BOOL mbDPMSWasEnabled;
+    CARD16 mnDPMSStandbyTimeout;
+    CARD16 mnDPMSSuspendTimeout;
+    CARD16 mnDPMSOffTimeout;
+#endif
+
     // Note: the Uninhibit call has different spelling in FDO (UnInhibit) vs GSM (Uninhibit)
     void inhibitFDO( bool bInhibit, const gchar* appname, const gchar* reason );
     void inhibitGSM( bool bInhibit, const gchar* appname, const gchar* reason, const guint xid );
 
     void inhibitXScreenSaver( bool bInhibit, Display* pDisplay );
     static void inhibitXAutoLock( bool bInhibit, Display* pDisplay );
+    void inhibitDPMS( bool bInhibit, Display* pDisplay );
 };
 
 #endif // INCLUDED_VCL_INC_UNX_SCREENSAVERINHIBITOR_HXX
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index c1122f7..4be20a7 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -41,9 +41,6 @@
 #include <X11/keysym.h>
 #include "FWS.hxx"
 #include <X11/extensions/shape.h>
-#if !defined(SOLARIS) && !defined(AIX)
-#include <X11/extensions/dpms.h>
-#endif
 #include <postx.h>
 
 #include "unx/salunx.h"
@@ -2202,73 +2199,13 @@ void X11SalFrame::StartPresentation( bool bStart )
         doReparentPresentationDialogues( GetDisplay() );
     hPresentationWindow = (bStart && IsOverrideRedirect() ) ? GetWindow() : None;
 
-    // needs static here to save DPMS settings
-    int dummy;
-    static bool DPMSExtensionAvailable =
-#if !defined(SOLARIS) && !defined(AIX)
-        (DPMSQueryExtension(GetXDisplay(), &dummy, &dummy) != 0);
-    static sal_Bool DPMSEnabled = false;
-#else
-        false;
-    bool DPMSEnabled = false;
-    (void)dummy;
-#define CARD16 unsigned short
-#endif
-    static CARD16 dpms_standby_timeout=0;
-    static CARD16 dpms_suspend_timeout=0;
-    static CARD16 dpms_off_timeout=0;
-
-    if( bStart  || DPMSEnabled)
+    if( bStart && hPresentationWindow )
     {
-        if( hPresentationWindow )
-        {
-            /*  #i10559# workaround for WindowMaker: try to restore
-             *  current focus after presentation window is gone
-             */
-            int revert_to = 0;
-            XGetInputFocus( GetXDisplay(), &hPresFocusWindow, &revert_to );
-        }
-
-        // get the DPMS state right before the start
-        if (DPMSExtensionAvailable)
-        {
-#if !defined(SOLARIS) && !defined(AIX)
-            CARD16 state; // card16 is defined in Xdm.h
-            DPMSInfo(   GetXDisplay(),
-                        &state,
-                        &DPMSEnabled);
-#endif
-        }
-        if( bStart ) // start show
-        {
-#if !defined(SOLARIS) && !defined(AIX)
-            if( DPMSEnabled )
-            {
-                if ( DPMSExtensionAvailable )
-                {
-                    DPMSGetTimeouts(    GetXDisplay(),
-                                        &dpms_standby_timeout,
-                                        &dpms_suspend_timeout,
-                                        &dpms_off_timeout);
-                    DPMSSetTimeouts(GetXDisplay(), 0,0,0);
-                }
-            }
-#endif
-        }
-        else
-        {
-#if !defined(SOLARIS) && !defined(AIX)
-            if ( DPMSEnabled )
-            {
-                if ( DPMSExtensionAvailable )
-                {
-                // restore timeouts
-                    DPMSSetTimeouts(GetXDisplay(), dpms_standby_timeout,
-                        dpms_suspend_timeout, dpms_off_timeout);
-                }
-            }
-#endif
-        }
+        /*  #i10559# workaround for WindowMaker: try to restore
+         *  current focus after presentation window is gone
+         */
+        int revert_to = 0;
+        XGetInputFocus( GetXDisplay(), &hPresFocusWindow, &revert_to );
     }
 }
 
diff --git a/vcl/unx/generic/window/screensaverinhibitor.cxx b/vcl/unx/generic/window/screensaverinhibitor.cxx
index 4add4bd..3b4b1db 100644
--- a/vcl/unx/generic/window/screensaverinhibitor.cxx
+++ b/vcl/unx/generic/window/screensaverinhibitor.cxx
@@ -43,6 +43,7 @@ void ScreenSaverInhibitor::inhibit( bool bInhibit, const OUString& sReason,
         {
             inhibitXScreenSaver( bInhibit, pDisplay.get() );
             inhibitXAutoLock( bInhibit, pDisplay.get() );
+            inhibitDPMS( bInhibit, pDisplay.get() );
         }
 
         if ( xid != boost::none )
@@ -229,4 +230,44 @@ void ScreenSaverInhibitor::inhibitXAutoLock( bool bInhibit, Display* pDisplay )
                      sizeof( nMessage ) );
 }
 
+void ScreenSaverInhibitor::inhibitDPMS( bool bInhibit, Display* pDisplay )
+{
+#if !defined(SOLARIS) && !defined(AIX)
+    int dummy;
+    // This won't change while X11 is running, hence
+    // we can evaluate only once and store as static
+    static bool bDPMSExtensionAvailable = ( DPMSQueryExtension( pDisplay, &dummy, &dummy) != 0 );
+
+    if ( !bDPMSExtensionAvailable )
+    {
+        return;
+    }
+
+    if ( bInhibit )
+    {
+        CARD16 state; // unused by us
+        DPMSInfo( pDisplay, &state, &mbDPMSWasEnabled );
+
+        if ( mbDPMSWasEnabled )
+        {
+            DPMSGetTimeouts( pDisplay,
+                             &mnDPMSStandbyTimeout,
+                             &mnDPMSSuspendTimeout,
+                             &mnDPMSOffTimeout );
+            DPMSSetTimeouts( pDisplay,
+                             0,
+                             0,
+                             0 );
+        }
+    }
+    else if ( !bInhibit && mbDPMSWasEnabled )
+    {
+        DPMSSetTimeouts( pDisplay,
+                         mnDPMSStandbyTimeout,
+                         mnDPMSSuspendTimeout,
+                         mnDPMSOffTimeout );
+    }
+#endif // !defined(SOLARIS) && !defined(AIX)
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 6ae8a88c2ba523a5e59cc94acd542e3d73d2cd5c
Author: Andrzej Hunt <andrzej at ahunt.org>
Date:   Mon Oct 19 21:50:39 2015 +0200

    Deduplicate XGet/SetScreenSaver, move to ScreenSaverInhibitor
    
    I haven't been able to find anyone actually using this API,
    however it's probably best not to remove it either?
    
    Change-Id: I0ca11591bfd54f9882d8081a94b012f638936ce5

diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index e6cdbd7..4f73ac8 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -192,7 +192,6 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider
     GdkCursor                      *m_pCurrentCursor;
     GdkVisibilityState              m_nVisibility;
     PointerStyle                    m_ePointerStyle;
-    int                             m_nSavedScreenSaverTimeout;
     ScreenSaverInhibitor            m_ScreenSaverInhibitor;
     int                             m_nWorkArea;
     bool                            m_bFullscreen;
diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h
index b10bebd..d595c44 100644
--- a/vcl/inc/unx/salframe.h
+++ b/vcl/inc/unx/salframe.h
@@ -100,7 +100,6 @@ class VCLPLUG_GEN_PUBLIC X11SalFrame : public SalFrame, public X11WindowProvider
     int             m_nWorkArea;
     bool            m_bSetFocusOnMap;
 
-    int             nScreenSaversTimeout_;
     ScreenSaverInhibitor maScreenSaverInhibitor;
     Rectangle       maPaintRegion;
 
diff --git a/vcl/inc/unx/screensaverinhibitor.hxx b/vcl/inc/unx/screensaverinhibitor.hxx
index 56d1849..8c9ad54 100644
--- a/vcl/inc/unx/screensaverinhibitor.hxx
+++ b/vcl/inc/unx/screensaverinhibitor.hxx
@@ -30,10 +30,13 @@ private:
     boost::optional<guint> mnFDOCookie;
     boost::optional<guint> mnGSMCookie;
 
+    boost::optional<int> mnXScreenSaverTimeout;
+
     // Note: the Uninhibit call has different spelling in FDO (UnInhibit) vs GSM (Uninhibit)
     void inhibitFDO( bool bInhibit, const gchar* appname, const gchar* reason );
     void inhibitGSM( bool bInhibit, const gchar* appname, const gchar* reason, const guint xid );
 
+    void inhibitXScreenSaver( bool bInhibit, Display* pDisplay );
     static void inhibitXAutoLock( bool bInhibit, Display* pDisplay );
 };
 
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 331f82a..c1122f7 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -803,7 +803,6 @@ X11SalFrame::X11SalFrame( SalFrame *pParent, SalFrameStyleFlags nSalFrameStyle,
     mbInShow                    = false;
     m_bXEmbed                   = false;
 
-    nScreenSaversTimeout_       = 0;
 
     mpInputContext              = NULL;
     mbInputFocus                = False;
@@ -2219,7 +2218,7 @@ void X11SalFrame::StartPresentation( bool bStart )
     static CARD16 dpms_suspend_timeout=0;
     static CARD16 dpms_off_timeout=0;
 
-    if( bStart || nScreenSaversTimeout_ || DPMSEnabled)
+    if( bStart  || DPMSEnabled)
     {
         if( hPresentationWindow )
         {
@@ -2229,12 +2228,6 @@ void X11SalFrame::StartPresentation( bool bStart )
             int revert_to = 0;
             XGetInputFocus( GetXDisplay(), &hPresFocusWindow, &revert_to );
         }
-        int timeout, interval, prefer_blanking, allow_exposures;
-        XGetScreenSaver( GetXDisplay(),
-                         &timeout,
-                         &interval,
-                         &prefer_blanking,
-                         &allow_exposures );
 
         // get the DPMS state right before the start
         if (DPMSExtensionAvailable)
@@ -2248,16 +2241,6 @@ void X11SalFrame::StartPresentation( bool bStart )
         }
         if( bStart ) // start show
         {
-            if ( timeout )
-            {
-                nScreenSaversTimeout_ = timeout;
-                XResetScreenSaver( GetXDisplay() );
-                XSetScreenSaver( GetXDisplay(),
-                                 0,
-                                 interval,
-                                 prefer_blanking,
-                                 allow_exposures );
-            }
 #if !defined(SOLARIS) && !defined(AIX)
             if( DPMSEnabled )
             {
@@ -2274,15 +2257,6 @@ void X11SalFrame::StartPresentation( bool bStart )
         }
         else
         {
-            if( nScreenSaversTimeout_ )
-            {
-                XSetScreenSaver( GetXDisplay(),
-                             nScreenSaversTimeout_,
-                             interval,
-                             prefer_blanking,
-                             allow_exposures );
-                nScreenSaversTimeout_ = 0;
-            }
 #if !defined(SOLARIS) && !defined(AIX)
             if ( DPMSEnabled )
             {
diff --git a/vcl/unx/generic/window/screensaverinhibitor.cxx b/vcl/unx/generic/window/screensaverinhibitor.cxx
index 0636b06..4add4bd 100644
--- a/vcl/unx/generic/window/screensaverinhibitor.cxx
+++ b/vcl/unx/generic/window/screensaverinhibitor.cxx
@@ -41,6 +41,7 @@ void ScreenSaverInhibitor::inhibit( bool bInhibit, const OUString& sReason,
     {
         if ( pDisplay != boost::none )
         {
+            inhibitXScreenSaver( bInhibit, pDisplay.get() );
             inhibitXAutoLock( bInhibit, pDisplay.get() );
         }
 
@@ -168,6 +169,37 @@ void ScreenSaverInhibitor::inhibitGSM( bool bInhibit, const gchar* appname, cons
                  mnGSMCookie );
 }
 
+/**
+ * Disable screensavers using the XSetScreenSaver/XGetScreenSaver API.
+ *
+ * Worth noting: xscreensaver explicitly ignores this and does it's own
+ * timeout handling.
+ */
+void ScreenSaverInhibitor::inhibitXScreenSaver( bool bInhibit, Display* pDisplay )
+{
+    int nTimeout, nInterval, bPreferBlanking, bAllowExposures;
+    XGetScreenSaver( pDisplay, &nTimeout, &nInterval,
+                     &bPreferBlanking, &bAllowExposures );
+
+    // To disable/reenable we simply fiddle the timeout, whilst
+    // retaining all other properties.
+    if ( bInhibit && nTimeout)
+    {
+        mnXScreenSaverTimeout = nTimeout;
+        XResetScreenSaver( pDisplay );
+        XSetScreenSaver( pDisplay, 0, nInterval,
+                         bPreferBlanking, bAllowExposures );
+    }
+    else if ( !bInhibit && ( mnXScreenSaverTimeout != boost::none ) )
+    {
+        XSetScreenSaver( pDisplay, mnXScreenSaverTimeout.get(),
+                         nInterval, bPreferBlanking,
+                         bAllowExposures );
+        mnXScreenSaverTimeout = boost::none;
+    }
+}
+
+
 /* definitions from xautolock.c (pl15) */
 #define XAUTOLOCK_DISABLE 1
 #define XAUTOLOCK_ENABLE  2
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 498161e..e2d5507 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -1118,7 +1118,6 @@ void GtkSalFrame::InitCommon()
     m_bSendModChangeOnRelease = false;
     m_pIMHandler        = NULL;
     m_hBackgroundPixmap = None;
-    m_nSavedScreenSaverTimeout = 0;
     m_nExtStyle         = 0;
     m_pRegion           = NULL;
     m_ePointerStyle     = static_cast<PointerStyle>(0xffff);
@@ -2553,39 +2552,6 @@ void GtkSalFrame::StartPresentation( bool bStart )
                                     getDisplay()->IsX11Display(),
                                     aWindow,
                                     aDisplay );
-
-    if( !getDisplay()->IsX11Display() )
-        return;
-
-#if !GTK_CHECK_VERSION(3,0,0)
-    Display *pDisplay = GDK_DISPLAY_XDISPLAY( getGdkDisplay() );
-
-    int nTimeout, nInterval, bPreferBlanking, bAllowExposures;
-    XGetScreenSaver( pDisplay, &nTimeout, &nInterval,
-                     &bPreferBlanking, &bAllowExposures );
-#endif
-    if( bStart )
-    {
-#if !GTK_CHECK_VERSION(3,0,0)
-        if ( nTimeout )
-        {
-            m_nSavedScreenSaverTimeout = nTimeout;
-            XResetScreenSaver( pDisplay );
-            XSetScreenSaver( pDisplay, 0, nInterval,
-                             bPreferBlanking, bAllowExposures );
-        }
-#endif
-    }
-    else
-    {
-#if !GTK_CHECK_VERSION(3,0,0)
-        if( m_nSavedScreenSaverTimeout )
-            XSetScreenSaver( pDisplay, m_nSavedScreenSaverTimeout,
-                             nInterval, bPreferBlanking,
-                             bAllowExposures );
-#endif
-        m_nSavedScreenSaverTimeout = 0;
-    }
 }
 
 void GtkSalFrame::SetAlwaysOnTop( bool bOnTop )
commit aa25e16a423e4bc92c1cec46a893fc85fa157fe3
Author: Andrzej Hunt <andrzej at ahunt.org>
Date:   Mon Oct 19 20:11:53 2015 +0200

    Deduplicate XAutoLock inhibition and move to ScreenSaverInhibitor
    
    (Successfully tested with xautolock 2.2)
    
    Change-Id: I55a3703322dd6792689ff3c3e85b27840ee2bc55

diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 1a56cdf..e6cdbd7 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -262,7 +262,6 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider
 
     void            Center();
     void            SetDefaultSize();
-    void            setAutoLock( bool bLock );
 
     void            doKeyCallback( guint state,
                                    guint keyval,
diff --git a/vcl/inc/unx/screensaverinhibitor.hxx b/vcl/inc/unx/screensaverinhibitor.hxx
index b1c742f..56d1849 100644
--- a/vcl/inc/unx/screensaverinhibitor.hxx
+++ b/vcl/inc/unx/screensaverinhibitor.hxx
@@ -10,6 +10,9 @@
 #ifndef INCLUDED_VCL_INC_UNX_SCREENSAVERINHIBITOR_HXX
 #define INCLUDED_VCL_INC_UNX_SCREENSAVERINHIBITOR_HXX
 
+#include <prex.h>
+#include <postx.h>
+
 #include <rtl/ustring.hxx>
 #include <vcl/dllapi.h>
 
@@ -20,7 +23,8 @@
 class VCL_PLUGIN_PUBLIC ScreenSaverInhibitor
 {
 public:
-    void inhibit( bool bInhibit, const rtl::OUString& sReason, bool bIsX11, const boost::optional<guint> xid );
+    void inhibit( bool bInhibit, const rtl::OUString& sReason,
+                  bool bIsX11, const boost::optional<guint> xid, boost::optional<Display*> pDisplay );
 
 private:
     boost::optional<guint> mnFDOCookie;
@@ -29,6 +33,8 @@ private:
     // Note: the Uninhibit call has different spelling in FDO (UnInhibit) vs GSM (Uninhibit)
     void inhibitFDO( bool bInhibit, const gchar* appname, const gchar* reason );
     void inhibitGSM( bool bInhibit, const gchar* appname, const gchar* reason, const guint xid );
+
+    static void inhibitXAutoLock( bool bInhibit, Display* pDisplay );
 };
 
 #endif // INCLUDED_VCL_INC_UNX_SCREENSAVERINHIBITOR_HXX
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index c5881a1..331f82a 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -2189,87 +2189,15 @@ void X11SalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nScreen )
     }
 }
 
-/* ---------------------------------------------------------------------
-   the xautolock pseudo screen saver needs special treatment since it
-   doesn't cooperate with XxxxScreenSaver settings
-   ------------------------------------------------------------------- */
-
-static Bool
-IsRunningXAutoLock( Display *p_display, ::Window a_window )
-{
-    const char *p_atomname = "XAUTOLOCK_SEMAPHORE_PID";
-    Atom        a_pidatom;
-
-    // xautolock interns this atom
-    a_pidatom    = XInternAtom( p_display, p_atomname, True );
-    if ( a_pidatom == None )
-        return False;
-
-    Atom          a_type;
-    int           n_format;
-    unsigned long n_items;
-    unsigned long n_bytes_after;
-    pid_t        *p_pid;
-    pid_t         n_pid;
-    // get pid of running xautolock
-    XGetWindowProperty (p_display, a_window, a_pidatom, 0L, 2L, False,
-            AnyPropertyType, &a_type, &n_format, &n_items, &n_bytes_after,
-            reinterpret_cast<unsigned char**>(&p_pid) );
-    n_pid = *p_pid;
-    XFree( p_pid );
-
-      if ( a_type == XA_INTEGER )
-      {
-        // check if xautolock pid points to a running process
-        if ( kill(n_pid, 0) == -1 )
-            return False;
-        else
-            return True;
-    }
-
-    return False;
-}
-
-/* definitions from xautolock.c (pl15) */
-#define XAUTOLOCK_DISABLE 1
-#define XAUTOLOCK_ENABLE  2
-
-static Bool
-MessageToXAutoLock( Display *p_display, int n_message )
-{
-    const char *p_atomname = "XAUTOLOCK_MESSAGE" ;
-    Atom        a_messageatom;
-    ::Window    a_rootwindow;
-
-    a_rootwindow = RootWindowOfScreen( ScreenOfDisplay(p_display, 0) );
-    if ( ! IsRunningXAutoLock(p_display, a_rootwindow) )
-    {
-        // remove any pending messages
-        a_messageatom = XInternAtom( p_display, p_atomname, True );
-        if ( a_messageatom != None )
-            XDeleteProperty( p_display, a_rootwindow, a_messageatom );
-        return False;
-    }
-
-    a_messageatom = XInternAtom( p_display, p_atomname, False );
-    XChangeProperty (p_display, a_rootwindow, a_messageatom, XA_INTEGER,
-            8, PropModeReplace, reinterpret_cast<unsigned char*>(&n_message), sizeof(n_message) );
-
-    return True;
-}
-
 void X11SalFrame::StartPresentation( bool bStart )
 {
     maScreenSaverInhibitor.inhibit( bStart,
                                     "presentation",
                                     true, // isX11
-                                    mhWindow );
+                                    mhWindow,
+                                    GetXDisplay() );
 
     vcl::I18NStatus::get().show( !bStart, vcl::I18NStatus::presentation );
-    if ( bStart )
-        MessageToXAutoLock( GetXDisplay(), XAUTOLOCK_DISABLE );
-    else
-        MessageToXAutoLock( GetXDisplay(), XAUTOLOCK_ENABLE );
 
     if( ! bStart && hPresentationWindow != None )
         doReparentPresentationDialogues( GetDisplay() );
diff --git a/vcl/unx/generic/window/screensaverinhibitor.cxx b/vcl/unx/generic/window/screensaverinhibitor.cxx
index b352c1d..0636b06 100644
--- a/vcl/unx/generic/window/screensaverinhibitor.cxx
+++ b/vcl/unx/generic/window/screensaverinhibitor.cxx
@@ -10,6 +10,11 @@
 #include <generic/gensys.h>
 #include <unx/screensaverinhibitor.hxx>
 
+#include <prex.h>
+#include <X11/Xatom.h>
+#include <X11/Xlib.h>
+#include <postx.h>
+
 #ifdef ENABLE_DBUS
 #include <dbus/dbus-glib.h>
 
@@ -24,16 +29,25 @@
 
 #include <sal/log.hxx>
 
-void ScreenSaverInhibitor::inhibit( bool bInhibit, const OUString& sReason, bool bIsX11, const boost::optional<guint> xid )
+void ScreenSaverInhibitor::inhibit( bool bInhibit, const OUString& sReason,
+                                    bool bIsX11, const boost::optional<guint> xid, boost::optional<Display*> pDisplay )
 {
     const gchar* appname = SalGenericSystem::getFrameClassName();
     const OString aReason = OUStringToOString( sReason, RTL_TEXTENCODING_UTF8 );
 
     inhibitFDO( bInhibit, appname, aReason.getStr() );
 
-    if ( bIsX11 && ( xid != boost::none ) )
+    if ( bIsX11 )
     {
-        inhibitGSM( bInhibit, appname, aReason.getStr(), xid.get() );
+        if ( pDisplay != boost::none )
+        {
+            inhibitXAutoLock( bInhibit, pDisplay.get() );
+        }
+
+        if ( xid != boost::none )
+        {
+            inhibitGSM( bInhibit, appname, aReason.getStr(), xid.get() );
+        }
     }
 }
 
@@ -154,4 +168,33 @@ void ScreenSaverInhibitor::inhibitGSM( bool bInhibit, const gchar* appname, cons
                  mnGSMCookie );
 }
 
+/* definitions from xautolock.c (pl15) */
+#define XAUTOLOCK_DISABLE 1
+#define XAUTOLOCK_ENABLE  2
+
+void ScreenSaverInhibitor::inhibitXAutoLock( bool bInhibit, Display* pDisplay )
+{
+    ::Window aRootWindow = RootWindowOfScreen( ScreenOfDisplay( pDisplay, 0 ) );
+
+    Atom nAtom = XInternAtom( pDisplay,
+                              "XAUTOLOCK_MESSAGE",
+                              False );
+
+    if ( nAtom == None )
+    {
+        return;
+    }
+
+    int nMessage = bInhibit ? XAUTOLOCK_DISABLE : XAUTOLOCK_ENABLE;
+
+    XChangeProperty( pDisplay,
+                     aRootWindow,
+                     nAtom,
+                     XA_INTEGER,
+                     8, // format -- 8 bit quantity
+                     PropModeReplace,
+                     reinterpret_cast<unsigned char*>( &nMessage ),
+                     sizeof( nMessage ) );
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 4d74e67a..498161e 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -2538,40 +2538,21 @@ void GtkSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nScreen )
     }
 }
 
-/* definitions from xautolock.c (pl15) */
-#define XAUTOLOCK_DISABLE 1
-#define XAUTOLOCK_ENABLE  2
-
-void GtkSalFrame::setAutoLock( bool bLock )
-{
-    if( isChild() || !getDisplay()->IsX11Display() )
-        return;
-
-    GdkScreen  *pScreen = gtk_window_get_screen( GTK_WINDOW(m_pWindow) );
-    GdkDisplay *pDisplay = gdk_screen_get_display( pScreen );
-    GdkWindow  *pRootWin = gdk_screen_get_root_window( pScreen );
-
-    Atom nAtom = XInternAtom( GDK_DISPLAY_XDISPLAY( pDisplay ),
-                              "XAUTOLOCK_MESSAGE", False );
-
-    int nMessage = bLock ? XAUTOLOCK_ENABLE : XAUTOLOCK_DISABLE;
-
-    XChangeProperty( GDK_DISPLAY_XDISPLAY( pDisplay ),
-                     GDK_WINDOW_XID( pRootWin ),
-                     nAtom, XA_INTEGER,
-                     8, PropModeReplace,
-                     reinterpret_cast<unsigned char*>(&nMessage),
-                     sizeof( nMessage ) );
-}
-
 void GtkSalFrame::StartPresentation( bool bStart )
 {
+    boost::optional<guint> aWindow;
+    boost::optional<Display*> aDisplay;
+    if( getDisplay()->IsX11Display() )
+    {
+        aWindow = widget_get_xid(m_pWindow);
+        aDisplay = GDK_DISPLAY_XDISPLAY( getGdkDisplay() );
+    }
+
     m_ScreenSaverInhibitor.inhibit( bStart,
                                     "presentation",
                                     getDisplay()->IsX11Display(),
-                                    widget_get_xid(m_pWindow) );
-
-    setAutoLock( !bStart );
+                                    aWindow,
+                                    aDisplay );
 
     if( !getDisplay()->IsX11Display() )
         return;
commit ebfbf033e0eeb5c017946af6de40d7ad90d4acbc
Author: Andrzej Hunt <andrzej at ahunt.org>
Date:   Mon Oct 19 18:03:37 2015 +0200

    Lambda'ise the almost identical FDO and GSM screensaver inhibition
    
    This doesn't save us much for now, but could be useful when yet another
    screensaver inhibition standard is introduced. (The GSM/gnome inhibition
    currently requires passing the X11 window handle/id, which suggests that
    at some point they will have to update their screensaver inhibition api.)
    
    Change-Id: I4fa7bc15f089d112777fb166ab469045c002ae48

diff --git a/vcl/unx/generic/window/screensaverinhibitor.cxx b/vcl/unx/generic/window/screensaverinhibitor.cxx
index 4ac63fe..b352c1d 100644
--- a/vcl/unx/generic/window/screensaverinhibitor.cxx
+++ b/vcl/unx/generic/window/screensaverinhibitor.cxx
@@ -37,11 +37,15 @@ void ScreenSaverInhibitor::inhibit( bool bInhibit, const OUString& sReason, bool
     }
 }
 
-void ScreenSaverInhibitor::inhibitFDO( bool bInhibit, const gchar* appname, const gchar* reason )
+void dbusInhibit( bool bInhibit,
+                  const gchar* service, const gchar* path, const gchar* interface,
+                  std::function<bool( DBusGProxy*, guint&, GError*& )> fInhibit,
+                  std::function<bool( DBusGProxy*, const guint, GError*& )> fUnInhibit,
+                  boost::optional<guint>& rCookie )
 {
 #ifdef ENABLE_DBUS
-    if ( ( !bInhibit && ( mnFDOCookie == boost::none ) ) ||
-         ( bInhibit && ( mnFDOCookie != boost::none ) ) )
+    if ( ( !bInhibit && ( rCookie == boost::none ) ) ||
+         ( bInhibit && ( rCookie != boost::none ) ) )
     {
         return;
     }
@@ -58,46 +62,36 @@ void ScreenSaverInhibitor::inhibitFDO( bool bInhibit, const gchar* appname, cons
     }
 
     proxy = dbus_g_proxy_new_for_name( session_connection,
-                                       FDO_DBUS_SERVICE,
-                                       FDO_DBUS_PATH,
-                                       FDO_DBUS_INTERFACE );
+                                       service,
+                                       path,
+                                       interface );
     if (proxy == NULL) {
-        SAL_INFO( "vcl.screensaverinhibitor", "could not get dbus proxy: " FDO_DBUS_SERVICE );
+        SAL_INFO( "vcl.screensaverinhibitor", "could not get dbus proxy: " << service );
         return;
     }
 
     if ( bInhibit )
     {
         guint nCookie;
-        res = dbus_g_proxy_call( proxy,
-                                 "Inhibit", &error,
-                                 G_TYPE_STRING, appname,
-                                 G_TYPE_STRING, reason,
-                                 G_TYPE_INVALID,
-                                 G_TYPE_UINT, &nCookie,
-                                 G_TYPE_INVALID);
+        res = fInhibit( proxy, nCookie, error );
+
         if (res)
         {
-            mnFDOCookie = nCookie;
+            rCookie = nCookie;
         }
         else
         {
-            SAL_INFO( "vcl.screensaverinhibitor", FDO_DBUS_SERVICE ".Inhibit failed");
+            SAL_INFO( "vcl.screensaverinhibitor", service << ".Inhibit failed");
         }
     }
     else
     {
-        res = dbus_g_proxy_call (proxy,
-                                 "UnInhibit",
-                                 &error,
-                                 G_TYPE_UINT, mnFDOCookie.get(),
-                                 G_TYPE_INVALID,
-                                 G_TYPE_INVALID);
-        mnFDOCookie = boost::none;
+        res = fUnInhibit( proxy, rCookie.get(), error );
+        rCookie = boost::none;
 
         if (!res)
         {
-            SAL_INFO( "vcl.screensaverinhibitor", FDO_DBUS_SERVICE ".UnInhibit failed" );
+            SAL_INFO( "vcl.screensaverinhibitor", service << ".UnInhibit failed" );
         }
     }
 
@@ -112,81 +106,52 @@ void ScreenSaverInhibitor::inhibitFDO( bool bInhibit, const gchar* appname, cons
 #endif // ENABLE_DBUS
 }
 
-void ScreenSaverInhibitor::inhibitGSM( bool bInhibit, const gchar* appname, const gchar* reason, const guint xid )
+void ScreenSaverInhibitor::inhibitFDO( bool bInhibit, const gchar* appname, const gchar* reason )
 {
-#ifdef ENABLE_DBUS
-    if ( ( !bInhibit && ( mnGSMCookie == boost::none ) ) ||
-         ( bInhibit && ( mnGSMCookie != boost::none ) ) )
-    {
-        return;
-    }
-
-    gboolean         res;
-    GError          *error = NULL;
-    DBusGProxy      *proxy = NULL;
-
-    DBusGConnection *session_connection = dbus_g_bus_get( DBUS_BUS_SESSION, &error );
-    if (error != NULL) {
-        SAL_WARN( "vcl.screensaverinhibitor", "failed to connect to dbus session bus: " << error->message );
-        g_error_free( error );
-        return;
-    }
-
-    proxy = dbus_g_proxy_new_for_name( session_connection,
-                                       GSM_DBUS_SERVICE,
-                                       GSM_DBUS_PATH,
-                                       GSM_DBUS_INTERFACE );
-    if (proxy == NULL) {
-        SAL_INFO( "vcl.screensaverinhibitor", "could not get dbus proxy: " GSM_DBUS_SERVICE );
-        return;
-    }
-
-    if ( bInhibit )
-    {
-        guint nCookie;
-        res = dbus_g_proxy_call (proxy,
-                                 "Inhibit", &error,
-                                 G_TYPE_STRING, appname,
-                                 G_TYPE_UINT, xid,
-                                 G_TYPE_STRING, reason,
-                                 G_TYPE_UINT, 8, //Inhibit the session being marked as idle
-                                 G_TYPE_INVALID,
-                                 G_TYPE_UINT, &nCookie,
-                                 G_TYPE_INVALID);
-        if ( res )
-        {
-            mnGSMCookie = nCookie;
-        }
-        else
-        {
-            SAL_INFO( "vcl.screensaverinhibitor", GSM_DBUS_SERVICE ".Inhibit failed" );
-        }
-    }
-    else
-    {
-        res = dbus_g_proxy_call (proxy,
-                                 "Uninhibit",
-                                 &error,
-                                 G_TYPE_UINT, mnGSMCookie.get(),
-                                 G_TYPE_INVALID,
-                                 G_TYPE_INVALID);
-        mnGSMCookie = boost::none;
-
-        if ( !res )
-        {
-            SAL_INFO( "vcl.screensaverinhibitor", GSM_DBUS_SERVICE ".Uninhibit failed" );
-        }
-    }
-
-    if (error != NULL)
-    {
-        SAL_INFO( "vcl.screensaverinhibitor", "Error: " << error->message );
-        g_error_free( error );
-    }
-
-    g_object_unref( G_OBJECT( proxy ) );
+    dbusInhibit( bInhibit,
+                 FDO_DBUS_SERVICE, FDO_DBUS_PATH, FDO_DBUS_INTERFACE,
+                 [appname, reason] ( DBusGProxy *proxy, guint& nCookie, GError*& error ) -> bool {
+                     return dbus_g_proxy_call( proxy,
+                                               "Inhibit", &error,
+                                               G_TYPE_STRING, appname,
+                                               G_TYPE_STRING, reason,
+                                               G_TYPE_INVALID,
+                                               G_TYPE_UINT, &nCookie,
+                                               G_TYPE_INVALID );
+                 },
+                 [] ( DBusGProxy *proxy, const guint nCookie, GError*& error ) -> bool {
+                     return dbus_g_proxy_call( proxy,
+                                               "UnInhibit", &error,
+                                               G_TYPE_UINT, nCookie,
+                                               G_TYPE_INVALID,
+                                               G_TYPE_INVALID );
+                 },
+                 mnFDOCookie );
+}
 
-#endif // ENABLE_DBUS
+void ScreenSaverInhibitor::inhibitGSM( bool bInhibit, const gchar* appname, const gchar* reason, const guint xid )
+{
+    dbusInhibit( bInhibit,
+                 GSM_DBUS_SERVICE, GSM_DBUS_PATH, GSM_DBUS_INTERFACE,
+                 [appname, reason, xid] ( DBusGProxy *proxy, guint& nCookie, GError*& error ) -> bool {
+                     return dbus_g_proxy_call( proxy,
+                                               "Inhibit", &error,
+                                               G_TYPE_STRING, appname,
+                                               G_TYPE_UINT, xid,
+                                               G_TYPE_STRING, reason,
+                                               G_TYPE_UINT, 8, //Inhibit the session being marked as idle
+                                               G_TYPE_INVALID,
+                                               G_TYPE_UINT, &nCookie,
+                                               G_TYPE_INVALID );
+                 },
+                 [] ( DBusGProxy *proxy, const guint nCookie, GError*& error ) -> bool {
+                     return dbus_g_proxy_call( proxy,
+                                               "Uninhibit", &error,
+                                               G_TYPE_UINT, nCookie,
+                                               G_TYPE_INVALID,
+                                               G_TYPE_INVALID );
+                 },
+                 mnGSMCookie );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 147912fac963969c637d2b0243b0411fe8766bda
Author: Andrzej Hunt <andrzej at ahunt.org>
Date:   Mon Oct 19 17:50:24 2015 +0200

    Add comment on gsm vs fdo differences
    
    Change-Id: I30d1c24e84f1b28fad9933407b362be886821864

diff --git a/vcl/inc/unx/screensaverinhibitor.hxx b/vcl/inc/unx/screensaverinhibitor.hxx
index 896f49a..b1c742f 100644
--- a/vcl/inc/unx/screensaverinhibitor.hxx
+++ b/vcl/inc/unx/screensaverinhibitor.hxx
@@ -26,6 +26,7 @@ private:
     boost::optional<guint> mnFDOCookie;
     boost::optional<guint> mnGSMCookie;
 
+    // Note: the Uninhibit call has different spelling in FDO (UnInhibit) vs GSM (Uninhibit)
     void inhibitFDO( bool bInhibit, const gchar* appname, const gchar* reason );
     void inhibitGSM( bool bInhibit, const gchar* appname, const gchar* reason, const guint xid );
 };
commit 995f5828775722898bba4cd668202f459352f200
Author: Andrzej Hunt <andrzej at ahunt.org>
Date:   Mon Oct 19 17:04:13 2015 +0200

    Move org.gnome.SessionManager.Inhibit to ScreenSaverInhibitor
    
    We should be using the same inhibition code irregardless of
    vcl backend on Linux.
    
    Change-Id: I996630666e32c40a52958edb248466c815a5e0e5

diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 9cc7404..1a56cdf 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -193,7 +193,6 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider
     GdkVisibilityState              m_nVisibility;
     PointerStyle                    m_ePointerStyle;
     int                             m_nSavedScreenSaverTimeout;
-    guint                           m_nGSMCookie;
     ScreenSaverInhibitor            m_ScreenSaverInhibitor;
     int                             m_nWorkArea;
     bool                            m_bFullscreen;
diff --git a/vcl/inc/unx/screensaverinhibitor.hxx b/vcl/inc/unx/screensaverinhibitor.hxx
index 93b6027..896f49a 100644
--- a/vcl/inc/unx/screensaverinhibitor.hxx
+++ b/vcl/inc/unx/screensaverinhibitor.hxx
@@ -20,12 +20,14 @@
 class VCL_PLUGIN_PUBLIC ScreenSaverInhibitor
 {
 public:
-    void inhibit( bool bInhibit, bool bIsX11, const rtl::OUString& sReason );
+    void inhibit( bool bInhibit, const rtl::OUString& sReason, bool bIsX11, const boost::optional<guint> xid );
 
 private:
     boost::optional<guint> mnFDOCookie;
+    boost::optional<guint> mnGSMCookie;
 
     void inhibitFDO( bool bInhibit, const gchar* appname, const gchar* reason );
+    void inhibitGSM( bool bInhibit, const gchar* appname, const gchar* reason, const guint xid );
 };
 
 #endif // INCLUDED_VCL_INC_UNX_SCREENSAVERINHIBITOR_HXX
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index e913ccd..c5881a1 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -2260,7 +2260,10 @@ MessageToXAutoLock( Display *p_display, int n_message )
 
 void X11SalFrame::StartPresentation( bool bStart )
 {
-    maScreenSaverInhibitor.inhibit( bStart, /* isX11 */ true, "presentation" );
+    maScreenSaverInhibitor.inhibit( bStart,
+                                    "presentation",
+                                    true, // isX11
+                                    mhWindow );
 
     vcl::I18NStatus::get().show( !bStart, vcl::I18NStatus::presentation );
     if ( bStart )
diff --git a/vcl/unx/generic/window/screensaverinhibitor.cxx b/vcl/unx/generic/window/screensaverinhibitor.cxx
index 4f0523f..4ac63fe 100644
--- a/vcl/unx/generic/window/screensaverinhibitor.cxx
+++ b/vcl/unx/generic/window/screensaverinhibitor.cxx
@@ -16,17 +16,25 @@
 #define FDO_DBUS_SERVICE        "org.freedesktop.ScreenSaver"
 #define FDO_DBUS_PATH           "/org/freedesktop/ScreenSaver"
 #define FDO_DBUS_INTERFACE      "org.freedesktop.ScreenSaver"
+
+#define GSM_DBUS_SERVICE        "org.gnome.SessionManager"
+#define GSM_DBUS_PATH           "/org/gnome/SessionManager"
+#define GSM_DBUS_INTERFACE      "org.gnome.SessionManager"
 #endif
 
 #include <sal/log.hxx>
 
-void ScreenSaverInhibitor::inhibit( bool bInhibit, bool bIsX11, const OUString& sReason )
+void ScreenSaverInhibitor::inhibit( bool bInhibit, const OUString& sReason, bool bIsX11, const boost::optional<guint> xid )
 {
     const gchar* appname = SalGenericSystem::getFrameClassName();
     const OString aReason = OUStringToOString( sReason, RTL_TEXTENCODING_UTF8 );
 
-    (void ) bIsX11; // Will be needed once all inhibition tooling is moved here
     inhibitFDO( bInhibit, appname, aReason.getStr() );
+
+    if ( bIsX11 && ( xid != boost::none ) )
+    {
+        inhibitGSM( bInhibit, appname, aReason.getStr(), xid.get() );
+    }
 }
 
 void ScreenSaverInhibitor::inhibitFDO( bool bInhibit, const gchar* appname, const gchar* reason )
@@ -100,6 +108,84 @@ void ScreenSaverInhibitor::inhibitFDO( bool bInhibit, const gchar* appname, cons
     }
 
     g_object_unref( G_OBJECT( proxy ) );
+
+#endif // ENABLE_DBUS
+}
+
+void ScreenSaverInhibitor::inhibitGSM( bool bInhibit, const gchar* appname, const gchar* reason, const guint xid )
+{
+#ifdef ENABLE_DBUS
+    if ( ( !bInhibit && ( mnGSMCookie == boost::none ) ) ||
+         ( bInhibit && ( mnGSMCookie != boost::none ) ) )
+    {
+        return;
+    }
+
+    gboolean         res;
+    GError          *error = NULL;
+    DBusGProxy      *proxy = NULL;
+
+    DBusGConnection *session_connection = dbus_g_bus_get( DBUS_BUS_SESSION, &error );
+    if (error != NULL) {
+        SAL_WARN( "vcl.screensaverinhibitor", "failed to connect to dbus session bus: " << error->message );
+        g_error_free( error );
+        return;
+    }
+
+    proxy = dbus_g_proxy_new_for_name( session_connection,
+                                       GSM_DBUS_SERVICE,
+                                       GSM_DBUS_PATH,
+                                       GSM_DBUS_INTERFACE );
+    if (proxy == NULL) {
+        SAL_INFO( "vcl.screensaverinhibitor", "could not get dbus proxy: " GSM_DBUS_SERVICE );
+        return;
+    }
+
+    if ( bInhibit )
+    {
+        guint nCookie;
+        res = dbus_g_proxy_call (proxy,
+                                 "Inhibit", &error,
+                                 G_TYPE_STRING, appname,
+                                 G_TYPE_UINT, xid,
+                                 G_TYPE_STRING, reason,
+                                 G_TYPE_UINT, 8, //Inhibit the session being marked as idle
+                                 G_TYPE_INVALID,
+                                 G_TYPE_UINT, &nCookie,
+                                 G_TYPE_INVALID);
+        if ( res )
+        {
+            mnGSMCookie = nCookie;
+        }
+        else
+        {
+            SAL_INFO( "vcl.screensaverinhibitor", GSM_DBUS_SERVICE ".Inhibit failed" );
+        }
+    }
+    else
+    {
+        res = dbus_g_proxy_call (proxy,
+                                 "Uninhibit",
+                                 &error,
+                                 G_TYPE_UINT, mnGSMCookie.get(),
+                                 G_TYPE_INVALID,
+                                 G_TYPE_INVALID);
+        mnGSMCookie = boost::none;
+
+        if ( !res )
+        {
+            SAL_INFO( "vcl.screensaverinhibitor", GSM_DBUS_SERVICE ".Uninhibit failed" );
+        }
+    }
+
+    if (error != NULL)
+    {
+        SAL_INFO( "vcl.screensaverinhibitor", "Error: " << error->message );
+        g_error_free( error );
+    }
+
+    g_object_unref( G_OBJECT( proxy ) );
+
 #endif // ENABLE_DBUS
 }
 
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 332d6f5..4d74e67a 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -87,14 +87,6 @@
 #  include <gdk/gdkkeysyms-compat.h>
 #endif
 
-#ifdef ENABLE_DBUS
-#include <dbus/dbus-glib.h>
-
-#define GSM_DBUS_SERVICE        "org.gnome.SessionManager"
-#define GSM_DBUS_PATH           "/org/gnome/SessionManager"
-#define GSM_DBUS_INTERFACE      "org.gnome.SessionManager"
-#endif
-
 #include <config_folders.h>
 
 #if GTK_CHECK_VERSION(3,0,0)
@@ -1127,7 +1119,6 @@ void GtkSalFrame::InitCommon()
     m_pIMHandler        = NULL;
     m_hBackgroundPixmap = None;
     m_nSavedScreenSaverTimeout = 0;
-    m_nGSMCookie = 0;
     m_nExtStyle         = 0;
     m_pRegion           = NULL;
     m_ePointerStyle     = static_cast<PointerStyle>(0xffff);
@@ -2573,118 +2564,12 @@ void GtkSalFrame::setAutoLock( bool bLock )
                      sizeof( nMessage ) );
 }
 
-#ifdef ENABLE_DBUS
-/** cookie is returned as an unsigned integer */
-static guint
-dbus_inhibit_gsm (const gchar *appname,
-                  const gchar *reason,
-                  guint xid)
-{
-        gboolean         res;
-        guint            cookie;
-        GError          *error = NULL;
-        DBusGProxy      *proxy = NULL;
-
-        /* get the DBUS session connection */
-        DBusGConnection *session_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
-        if (error != NULL) {
-                g_debug ("DBUS cannot connect : %s", error->message);
-                g_error_free (error);
-                return -1;
-        }
-
-        /* get the proxy with gnome-session-manager */
-        proxy = dbus_g_proxy_new_for_name (session_connection,
-                                           GSM_DBUS_SERVICE,
-                                           GSM_DBUS_PATH,
-                                           GSM_DBUS_INTERFACE);
-        if (proxy == NULL) {
-                g_debug ("Could not get DBUS proxy: %s", GSM_DBUS_SERVICE);
-                return -1;
-        }
-
-        res = dbus_g_proxy_call (proxy,
-                                 "Inhibit", &error,
-                                 G_TYPE_STRING, appname,
-                                 G_TYPE_UINT, xid,
-                                 G_TYPE_STRING, reason,
-                                 G_TYPE_UINT, 8, //Inhibit the session being marked as idle
-                                 G_TYPE_INVALID,
-                                 G_TYPE_UINT, &cookie,
-                                 G_TYPE_INVALID);
-
-        /* check the return value */
-        if (! res) {
-                cookie = -1;
-                g_debug ("Inhibit method failed");
-        }
-
-        /* check the error value */
-        if (error != NULL) {
-                g_debug ("Inhibit problem : %s", error->message);
-                g_error_free (error);
-                cookie = -1;
-        }
-
-        g_object_unref (G_OBJECT (proxy));
-        return cookie;
-}
-
-static void
-dbus_uninhibit_gsm (guint cookie)
-{
-        gboolean         res;
-        GError          *error = NULL;
-        DBusGProxy      *proxy = NULL;
-        DBusGConnection *session_connection = NULL;
-
-        if (cookie == guint(-1)) {
-                g_debug ("Invalid cookie");
-                return;
-        }
-
-        /* get the DBUS session connection */
-        session_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
-        if (error) {
-                g_debug ("DBUS cannot connect : %s", error->message);
-                g_error_free (error);
-                return;
-        }
-
-        /* get the proxy with gnome-session-manager */
-        proxy = dbus_g_proxy_new_for_name (session_connection,
-                                           GSM_DBUS_SERVICE,
-                                           GSM_DBUS_PATH,
-                                           GSM_DBUS_INTERFACE);
-        if (proxy == NULL) {
-                g_debug ("Could not get DBUS proxy: %s", GSM_DBUS_SERVICE);
-                return;
-        }
-
-        res = dbus_g_proxy_call (proxy,
-                                 "Uninhibit",
-                                 &error,
-                                 G_TYPE_UINT, cookie,
-                                 G_TYPE_INVALID,
-                                 G_TYPE_INVALID);
-
-        /* check the return value */
-        if (! res) {
-                g_debug ("Uninhibit method failed");
-        }
-
-        /* check the error value */
-        if (error != NULL) {
-                g_debug ("Uninhibit problem : %s", error->message);
-                g_error_free (error);
-        }
-        g_object_unref (G_OBJECT (proxy));
-}
-#endif
-
 void GtkSalFrame::StartPresentation( bool bStart )
 {
-    m_ScreenSaverInhibitor.inhibit( bStart, getDisplay()->IsX11Display(), "presentation" );
+    m_ScreenSaverInhibitor.inhibit( bStart,
+                                    "presentation",
+                                    getDisplay()->IsX11Display(),
+                                    widget_get_xid(m_pWindow) );
 
     setAutoLock( !bStart );
 
@@ -2709,10 +2594,6 @@ void GtkSalFrame::StartPresentation( bool bStart )
                              bPreferBlanking, bAllowExposures );
         }
 #endif
-#ifdef ENABLE_DBUS
-        m_nGSMCookie = dbus_inhibit_gsm(g_get_application_name(), "presentation",
-                    widget_get_xid(m_pWindow));
-#endif
     }
     else
     {
@@ -2723,9 +2604,6 @@ void GtkSalFrame::StartPresentation( bool bStart )
                              bAllowExposures );
 #endif
         m_nSavedScreenSaverTimeout = 0;
-#ifdef ENABLE_DBUS
-        dbus_uninhibit_gsm(m_nGSMCookie);
-#endif
     }
 }
 
commit 84a19eb7003a6f0776e0da6fb7b6359ad1e6609e
Author: Andrzej Hunt <andrzej at ahunt.org>
Date:   Mon Oct 19 17:01:02 2015 +0200

    Implement org.freedesktop.ScreenSaver inhibition
    
    This is required for screensaver inhibition on kde (this might
    also be supported on further desktops).
    
    It would appear to make sense to move all screensaver inhibiting
    code here into one location, since it should be shared across
    the generic unx, and gtk vcl backends - currently we have completely
    independent implementations for gtk/gtk3 (which only supports
    XSetScreenSaver, and gnome's dbus inhibition), and the generic backend
    for all other plugins, which supports XSetScreenSaver, xautolock, DPMS,
    but no dbus inhibition.
    
    Change-Id: I9c5af8021b0b49b5c93ed75a7d25e3208d5e9629

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 010568a..af0d545 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -43,6 +43,12 @@ $(eval $(call gb_Library_set_include,vcl,\
 	$(if $(filter WNTGCC,$(OS)$(COM)),-I$(MINGW_SYSROOT)/include/gdiplus) \
 ))
 
+ifeq ($(ENABLE_DBUS),TRUE)
+$(eval $(call gb_Library_add_defs,vclplug_gen,\
+	-DENABLE_DBUS \
+))
+endif
+
 $(eval $(call gb_Library_add_defs,vcl,\
     -DVCL_DLLIMPLEMENTATION \
 	-DCUI_DLL_NAME=\"$(call gb_Library_get_runtime_filename,$(call gb_Library__get_name,cui))\" \
@@ -575,6 +581,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/unx/generic/printer/ppdparser \
     vcl/unx/generic/gdi/cairotextrender \
     vcl/unx/generic/gdi/x11windowprovider \
+    vcl/unx/generic/window/screensaverinhibitor \
     $(if $(filter TRUE,$(ENABLE_CUPS)),\
         vcl/unx/generic/printer/cupsmgr \
         vcl/unx/generic/printer/printerinfomanager \
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 8ccba66..9cc7404 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -35,6 +35,7 @@
 #include <vcl/sysdata.hxx>
 #include <unx/x11windowprovider.hxx>
 #include <unx/saltype.h>
+#include <unx/screensaverinhibitor.hxx>
 
 #include "tools/link.hxx"
 
@@ -193,6 +194,7 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider
     PointerStyle                    m_ePointerStyle;
     int                             m_nSavedScreenSaverTimeout;
     guint                           m_nGSMCookie;
+    ScreenSaverInhibitor            m_ScreenSaverInhibitor;
     int                             m_nWorkArea;
     bool                            m_bFullscreen;
     bool                            m_bSpanMonitorsWhenFullscreen;
diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h
index 489ee25..b10bebd 100644
--- a/vcl/inc/unx/salframe.h
+++ b/vcl/inc/unx/salframe.h
@@ -26,6 +26,7 @@
 #include <unx/salunx.h>
 #include <unx/saltype.h>
 #include <unx/saldisp.hxx>
+#include <unx/screensaverinhibitor.hxx>
 #include <unx/x11windowprovider.hxx>
 #include <salframe.hxx>
 #include <salwtype.hxx>
@@ -100,6 +101,7 @@ class VCLPLUG_GEN_PUBLIC X11SalFrame : public SalFrame, public X11WindowProvider
     bool            m_bSetFocusOnMap;
 
     int             nScreenSaversTimeout_;
+    ScreenSaverInhibitor maScreenSaverInhibitor;
     Rectangle       maPaintRegion;
 
     Timer           maAlwaysOnTopRaiseTimer;
diff --git a/vcl/inc/unx/screensaverinhibitor.hxx b/vcl/inc/unx/screensaverinhibitor.hxx
new file mode 100644
index 0000000..93b6027
--- /dev/null
+++ b/vcl/inc/unx/screensaverinhibitor.hxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_VCL_INC_UNX_SCREENSAVERINHIBITOR_HXX
+#define INCLUDED_VCL_INC_UNX_SCREENSAVERINHIBITOR_HXX
+
+#include <rtl/ustring.hxx>
+#include <vcl/dllapi.h>
+
+#include <boost/optional.hpp>
+
+#include <glib.h>
+
+class VCL_PLUGIN_PUBLIC ScreenSaverInhibitor
+{
+public:
+    void inhibit( bool bInhibit, bool bIsX11, const rtl::OUString& sReason );
+
+private:
+    boost::optional<guint> mnFDOCookie;
+
+    void inhibitFDO( bool bInhibit, const gchar* appname, const gchar* reason );
+};
+
+#endif // INCLUDED_VCL_INC_UNX_SCREENSAVERINHIBITOR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 604ab60..e913ccd 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -2260,6 +2260,8 @@ MessageToXAutoLock( Display *p_display, int n_message )
 
 void X11SalFrame::StartPresentation( bool bStart )
 {
+    maScreenSaverInhibitor.inhibit( bStart, /* isX11 */ true, "presentation" );
+
     vcl::I18NStatus::get().show( !bStart, vcl::I18NStatus::presentation );
     if ( bStart )
         MessageToXAutoLock( GetXDisplay(), XAUTOLOCK_DISABLE );
diff --git a/vcl/unx/generic/window/screensaverinhibitor.cxx b/vcl/unx/generic/window/screensaverinhibitor.cxx
new file mode 100644
index 0000000..4f0523f
--- /dev/null
+++ b/vcl/unx/generic/window/screensaverinhibitor.cxx
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <generic/gensys.h>
+#include <unx/screensaverinhibitor.hxx>
+
+#ifdef ENABLE_DBUS
+#include <dbus/dbus-glib.h>
+
+#define FDO_DBUS_SERVICE        "org.freedesktop.ScreenSaver"
+#define FDO_DBUS_PATH           "/org/freedesktop/ScreenSaver"
+#define FDO_DBUS_INTERFACE      "org.freedesktop.ScreenSaver"
+#endif
+
+#include <sal/log.hxx>
+
+void ScreenSaverInhibitor::inhibit( bool bInhibit, bool bIsX11, const OUString& sReason )
+{
+    const gchar* appname = SalGenericSystem::getFrameClassName();
+    const OString aReason = OUStringToOString( sReason, RTL_TEXTENCODING_UTF8 );
+
+    (void ) bIsX11; // Will be needed once all inhibition tooling is moved here
+    inhibitFDO( bInhibit, appname, aReason.getStr() );
+}
+
+void ScreenSaverInhibitor::inhibitFDO( bool bInhibit, const gchar* appname, const gchar* reason )
+{
+#ifdef ENABLE_DBUS
+    if ( ( !bInhibit && ( mnFDOCookie == boost::none ) ) ||
+         ( bInhibit && ( mnFDOCookie != boost::none ) ) )
+    {
+        return;
+    }
+
+    gboolean         res;
+    GError          *error = NULL;
+    DBusGProxy      *proxy = NULL;
+
+    DBusGConnection *session_connection = dbus_g_bus_get( DBUS_BUS_SESSION, &error );
+    if (error != NULL) {
+        SAL_WARN( "vcl.screensaverinhibitor", "failed to connect to dbus session bus: " << error->message );
+        g_error_free( error );
+        return;
+    }
+
+    proxy = dbus_g_proxy_new_for_name( session_connection,
+                                       FDO_DBUS_SERVICE,
+                                       FDO_DBUS_PATH,
+                                       FDO_DBUS_INTERFACE );
+    if (proxy == NULL) {
+        SAL_INFO( "vcl.screensaverinhibitor", "could not get dbus proxy: " FDO_DBUS_SERVICE );
+        return;
+    }
+
+    if ( bInhibit )
+    {
+        guint nCookie;
+        res = dbus_g_proxy_call( proxy,
+                                 "Inhibit", &error,
+                                 G_TYPE_STRING, appname,
+                                 G_TYPE_STRING, reason,
+                                 G_TYPE_INVALID,
+                                 G_TYPE_UINT, &nCookie,
+                                 G_TYPE_INVALID);
+        if (res)
+        {
+            mnFDOCookie = nCookie;
+        }
+        else
+        {
+            SAL_INFO( "vcl.screensaverinhibitor", FDO_DBUS_SERVICE ".Inhibit failed");
+        }
+    }
+    else
+    {
+        res = dbus_g_proxy_call (proxy,
+                                 "UnInhibit",
+                                 &error,
+                                 G_TYPE_UINT, mnFDOCookie.get(),
+                                 G_TYPE_INVALID,
+                                 G_TYPE_INVALID);
+        mnFDOCookie = boost::none;
+
+        if (!res)
+        {
+            SAL_INFO( "vcl.screensaverinhibitor", FDO_DBUS_SERVICE ".UnInhibit failed" );
+        }
+    }
+
+    if (error != NULL)
+    {
+        SAL_INFO( "vcl.screensaverinhibitor", "Error: " << error->message );
+        g_error_free( error );
+    }
+
+    g_object_unref( G_OBJECT( proxy ) );
+#endif // ENABLE_DBUS
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 25f3fe5..332d6f5 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -2684,6 +2684,8 @@ dbus_uninhibit_gsm (guint cookie)
 
 void GtkSalFrame::StartPresentation( bool bStart )
 {
+    m_ScreenSaverInhibitor.inhibit( bStart, getDisplay()->IsX11Display(), "presentation" );
+
     setAutoLock( !bStart );
 
     if( !getDisplay()->IsX11Display() )
commit ac0c2e26ce237991ada316e5b8edeb7a029f401b
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Oct 20 12:00:21 2015 +0200

    Resolves: tdf#84713 do not substitute separator in R1C1 notation hyperlinks
    
    During import, in hyperlinks all Sheet!xxx were converted to Sheet.xxx
    to fit CalcA1 notation, but in this case Sheet!R1C1 was used and
    Sheet.R1C1 is not a valid address notation, so the hyperlink didn't
    work. Do not attempt to convert R1C1 notation, the hyperlink handler
    does handle all known notations. On Excel export, handle that the
    separator can be both, '.' and '!'.
    
    Change-Id: I8428b2240912f42fd6789d249c90982127ee7c01

diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 9cb6248..af1bfae 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -410,10 +410,14 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU
     {
         OUString aTextMark( rUrl.copy( 1 ) );
 
-        sal_Int32 nSepPos = aTextMark.indexOf( '.' );
+        sal_Int32 nSepPos = aTextMark.lastIndexOf( '.' );
         if(nSepPos != -1)
-        {
             aTextMark = aTextMark.replaceAt( nSepPos, 1, "!" );
+        else
+            nSepPos = aTextMark.lastIndexOf( '!' );
+
+        if(nSepPos != -1)
+        {
             OUString aSheetName( aTextMark.copy(0, nSepPos));
 
             if ( aSheetName.indexOf(' ') != -1 && aSheetName[0] != '\'')
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 6b0f688..1e009ba 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -332,9 +332,24 @@ OUString XclImpHyperlink::ReadEmbeddedData( XclImpStream& rStrm )
         if( xTextMark.get() )
         {
             if( xLongName->isEmpty() )
-                xTextMark.reset( new OUString( xTextMark->replace( '!', '.' ) ) );
-            xLongName.reset( new OUString( *xLongName + "#" ) );
-            xLongName.reset( new OUString( *xLongName + *xTextMark  ) );
+            {
+                sal_Int32 nSepPos = xTextMark->lastIndexOf( '!' );
+                if( nSepPos > 0 )
+                {
+                    // Do not attempt to blindly convert '#SheetName!A1' to
+                    // '#SheetName.A1', it can be #SheetName!R1C1 as well.
+                    // Hyperlink handler has to handle all, but prefer
+                    // '#SheetName.A1' if possible.
+                    if (nSepPos < xTextMark->getLength() - 1)
+                    {
+                        ScRange aRange;
+                        if ((aRange.ParseAny( xTextMark->copy( nSepPos + 1 ), nullptr,
+                                        formula::FormulaGrammar::CONV_XL_R1C1) & SCA_VALID) != SCA_VALID)
+                            xTextMark.reset( new OUString( xTextMark->replaceAt( nSepPos, 1, OUString( '.' ))));
+                    }
+                }
+            }
+            xLongName.reset( new OUString( *xLongName + "#" + *xTextMark ) );
         }
         return( *xLongName );
     }
diff --git a/sc/source/filter/oox/worksheetbuffer.cxx b/sc/source/filter/oox/worksheetbuffer.cxx
index 00d789c..6c3a0dd 100644
--- a/sc/source/filter/oox/worksheetbuffer.cxx
+++ b/sc/source/filter/oox/worksheetbuffer.cxx
@@ -117,14 +117,22 @@ OUString WorksheetBuffer::getCalcSheetName( sal_Int32 nWorksheet ) const
 
 void WorksheetBuffer::convertSheetNameRef( OUString& sSheetNameRef ) const
 {
-    // convert '#SheetName!A1' to '#SheetName.A1'
     if( sSheetNameRef.startsWith("#") )
     {
         sal_Int32 nSepPos = sSheetNameRef.lastIndexOf( '!' );
         if( nSepPos > 0 )
         {
-            // replace the exclamation mark with a period
-            sSheetNameRef = sSheetNameRef.replaceAt( nSepPos, 1, OUString( '.' ) );
+            // Do not attempt to blindly convert '#SheetName!A1' to
+            // '#SheetName.A1', it can be #SheetName!R1C1 as well. Hyperlink
+            // handler has to handle all, but prefer '#SheetName.A1' if
+            // possible.
+            if (nSepPos < sSheetNameRef.getLength() - 1)
+            {
+                ScRange aRange;
+                if ((aRange.ParseAny( sSheetNameRef.copy( nSepPos + 1 ), nullptr,
+                                formula::FormulaGrammar::CONV_XL_R1C1) & SCA_VALID) != SCA_VALID)
+                    sSheetNameRef = sSheetNameRef.replaceAt( nSepPos, 1, OUString( '.' ) );
+            }
             // #i66592# convert sheet names that have been renamed on import
             OUString aSheetName = sSheetNameRef.copy( 1, nSepPos - 1 );
             OUString aCalcName = getCalcSheetName( aSheetName );
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 3dcaf1c..bf2d009 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -992,14 +992,22 @@ OUString WorksheetGlobals::getHyperlinkUrl( const HyperlinkModel& rHyperlink ) c
         aUrlBuffer.append( '#' ).append( rHyperlink.maLocation );
     OUString aUrl = aUrlBuffer.makeStringAndClear();
 
-    // convert '#SheetName!A1' to '#SheetName.A1'
     if( aUrl.startsWith("#") )
     {
         sal_Int32 nSepPos = aUrl.lastIndexOf( '!' );
         if( nSepPos > 0 )
         {
-            // replace the exclamation mark with a period
-            aUrl = aUrl.replaceAt( nSepPos, 1, OUString( '.' ) );
+            // Do not attempt to blindly convert '#SheetName!A1' to
+            // '#SheetName.A1', it can be #SheetName!R1C1 as well. Hyperlink
+            // handler has to handle all, but prefer '#SheetName.A1' if
+            // possible.
+            if (nSepPos < aUrl.getLength() - 1)
+            {
+                ScRange aRange;
+                if ((aRange.ParseAny( aUrl.copy( nSepPos + 1 ), nullptr,
+                                formula::FormulaGrammar::CONV_XL_R1C1) & SCA_VALID) != SCA_VALID)
+                    aUrl = aUrl.replaceAt( nSepPos, 1, OUString( '.' ) );
+            }
             // #i66592# convert sheet names that have been renamed on import
             OUString aSheetName = aUrl.copy( 1, nSepPos - 1 );
             OUString aCalcName = getWorksheets().getCalcSheetName( aSheetName );
commit 0500f7bcc868a6c9c5373e48f9e0b17328929433
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 20 11:47:26 2015 +0200

    loplugin:defaultparams
    
    Change-Id: I0f5d4deb3d6f8445251867638a4ec812762ced56

diff --git a/xmloff/source/core/nmspmap.cxx b/xmloff/source/core/nmspmap.cxx
index c05fd93..77fe129 100644
--- a/xmloff/source/core/nmspmap.cxx
+++ b/xmloff/source/core/nmspmap.cxx
@@ -430,7 +430,7 @@ sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName(
                             OUString *pLocalName,
                             sal_uInt16 /*nIdxGuess*/) const
 {
-    return _GetKeyByAttrName( rAttrName, 0, pLocalName, 0 );
+    return _GetKeyByAttrName( rAttrName, 0, pLocalName );
 }
 
 sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName( const OUString& rAttrName,
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 505e52c..705fd4f 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -2231,8 +2231,7 @@ OUString SvXMLExport::GetRelativeReference(const OUString& rValue)
         //conversion for matching schemes only
         if( xUriRef->getScheme() == mpImpl->msPackageURIScheme )
         {
-            sValue = INetURLObject::GetRelURL( msOrigFileName, sValue,
-                INetURLObject::WAS_ENCODED, INetURLObject::DECODE_TO_IURI );
+            sValue = INetURLObject::GetRelURL( msOrigFileName, sValue );
         }
     }
     return sValue;
diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx
index bbca3fe..27562d6 100644
--- a/xmloff/source/core/xmluconv.cxx
+++ b/xmloff/source/core/xmluconv.cxx
@@ -527,19 +527,19 @@ bool SvXMLUnitConverter::convertB3DVector( ::basegfx::B3DVector& rVector, const
     rtl_math_ConversionStatus eStatus;
 
     rVector.setX(::rtl::math::stringToDouble(aContentX, '.',
-            ',', &eStatus, NULL));
+            ',', &eStatus));
 
     if( eStatus != rtl_math_ConversionStatus_Ok )
         return false;
 
     rVector.setY(::rtl::math::stringToDouble(aContentY, '.',
-            ',', &eStatus, NULL));
+            ',', &eStatus));
 
     if( eStatus != rtl_math_ConversionStatus_Ok )
         return false;
 
     rVector.setZ(::rtl::math::stringToDouble(aContentZ, '.',
-            ',', &eStatus, NULL));
+            ',', &eStatus));
 
 
     return ( eStatus == rtl_math_ConversionStatus_Ok );
diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx
index e751697..5bb006c 100644
--- a/xmloff/source/draw/ximpcustomshape.cxx
+++ b/xmloff/source/draw/ximpcustomshape.cxx
@@ -144,7 +144,7 @@ void GetDoublePercentage( std::vector< com::sun::star::beans::PropertyValue >& r
     {
         rtl_math_ConversionStatus eStatus;
         double fAttrDouble = ::rtl::math::stringToDouble( rValue,
-            '.', ',', &eStatus, NULL );
+            '.', ',', &eStatus );
         if ( eStatus == rtl_math_ConversionStatus_Ok )
         {
             beans::PropertyValue aProp;
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index dcad869..fdca9f6 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -1528,7 +1528,7 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress )
         {
             Reference<XTextContent> xTxtCntnt(xTextFramesEnum->nextElement(), UNO_QUERY);
             if(xTxtCntnt.is())
-                exportTextFrame(xTxtCntnt, bAutoStyles, bIsProgress, bExportContent, 0);
+                exportTextFrame(xTxtCntnt, bAutoStyles, bIsProgress, bExportContent);
         }
 
     // Export graphic objects:
@@ -1538,7 +1538,7 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress )
         {
             Reference<XTextContent> xTxtCntnt(xGraphicsEnum->nextElement(), UNO_QUERY);
             if(xTxtCntnt.is())
-                exportTextGraphic(xTxtCntnt, true, 0);
+                exportTextGraphic(xTxtCntnt, true);
         }
 
     // Export embedded objects:
@@ -1548,7 +1548,7 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress )
         {
             Reference<XTextContent> xTxtCntnt(xEmbeddedsEnum->nextElement(), UNO_QUERY);
             if(xTxtCntnt.is())
-                exportTextEmbedded(xTxtCntnt, true, 0);
+                exportTextEmbedded(xTxtCntnt, true);
         }
 
     // Export shapes:
@@ -1561,7 +1561,7 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress )
             {
                 Reference<XServiceInfo> xServiceInfo(xTxtCntnt, UNO_QUERY);
                 if( xServiceInfo->supportsService(sShapeService))
-                    exportShape(xTxtCntnt, true, 0);
+                    exportShape(xTxtCntnt, true);
             }
         }
 
@@ -2147,7 +2147,7 @@ void XMLTextParagraphExport::exportParagraph(
         if( bHasContentEnum )
             exportTextContentEnumeration(
                                     xContentEnum, bAutoStyles, xSection,
-                                    bIsProgress, true, 0 );
+                                    bIsProgress );
         if ( bHasPortions )
             exportTextRangeEnumeration( xTextEnum, bAutoStyles, bIsProgress );
     }
diff --git a/xmloff/source/text/txtstyle.cxx b/xmloff/source/text/txtstyle.cxx
index 4ccef23..877efef 100644
--- a/xmloff/source/text/txtstyle.cxx
+++ b/xmloff/source/text/txtstyle.cxx
@@ -141,13 +141,13 @@ void XMLTextParagraphExport::exportTextStyles( bool bUsed, bool bProg )
         }
     }
     exportStyleFamily( "ParagraphStyles", GetXMLToken(XML_PARAGRAPH), GetParaPropMapper(),
-                       bUsed, XML_STYLE_FAMILY_TEXT_PARAGRAPH, 0);
+                       bUsed, XML_STYLE_FAMILY_TEXT_PARAGRAPH);
     exportStyleFamily( "CharacterStyles", GetXMLToken(XML_TEXT), GetTextPropMapper(),
                        bUsed, XML_STYLE_FAMILY_TEXT_TEXT );
     // get shape export to make sure the frame family is added correctly.
     GetExport().GetShapeExport();
     exportStyleFamily( "FrameStyles", OUString(XML_STYLE_FAMILY_SD_GRAPHICS_NAME), GetFramePropMapper(),
-                       bUsed, XML_STYLE_FAMILY_TEXT_FRAME, 0);
+                       bUsed, XML_STYLE_FAMILY_TEXT_FRAME);
     exportNumStyles( bUsed );
     if( !IsBlockMode() )
     {
commit 5fd044fc61271e744b9a443002d95db9e99ca903
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 20 11:47:22 2015 +0200

    loplugin:defaultparams
    
    Change-Id: Ic6ff01ec54fde1c6ac9f8b52d2cbca3ee4085b51

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index a343a2a..d8191cf 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -4285,47 +4285,47 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
     break;
     case RTF_PAPERH: // fall through: set the default + current value
         lcl_putNestedAttribute(m_aDefaultState.aSectionSprms,
-                               NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_h, pIntValue, RTFOverwrite::YES);
+                               NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_h, pIntValue);
     case RTF_PGHSXN:
         lcl_putNestedAttribute(m_aStates.top().aSectionSprms,
-                               NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_h, pIntValue, RTFOverwrite::YES);
+                               NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_h, pIntValue);
         break;
     case RTF_PAPERW: // fall through: set the default + current value
         lcl_putNestedAttribute(m_aDefaultState.aSectionSprms,
-                               NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_w, pIntValue, RTFOverwrite::YES);
+                               NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_w, pIntValue);
     case RTF_PGWSXN:
         lcl_putNestedAttribute(m_aStates.top().aSectionSprms,
-                               NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_w, pIntValue, RTFOverwrite::YES);
+                               NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_w, pIntValue);
         break;
     case RTF_MARGL: // fall through: set the default + current value
         lcl_putNestedAttribute(m_aDefaultState.aSectionSprms,
-                               NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_left, pIntValue, RTFOverwrite::YES);
+                               NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_left, pIntValue);
     case RTF_MARGLSXN:
         lcl_putNestedAttribute(m_aStates.top().aSectionSprms,
-                               NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_left, pIntValue, RTFOverwrite::YES);
+                               NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_left, pIntValue);
         break;
     case RTF_MARGR: // fall through: set the default + current value
         lcl_putNestedAttribute(m_aDefaultState.aSectionSprms,
-                               NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_right, pIntValue, RTFOverwrite::YES);
+                               NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_right, pIntValue);
     case RTF_MARGRSXN:
         lcl_putNestedAttribute(m_aStates.top().aSectionSprms,
-                               NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_right, pIntValue, RTFOverwrite::YES);
+                               NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_right, pIntValue);
         break;
     case RTF_MARGT: // fall through: set the default + current value
-        lcl_putNestedAttribute(m_aDefaultState.aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_top, pIntValue, RTFOverwrite::YES);
+        lcl_putNestedAttribute(m_aDefaultState.aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_top, pIntValue);
     case RTF_MARGTSXN:
-        lcl_putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_top, pIntValue, RTFOverwrite::YES);
+        lcl_putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_top, pIntValue);
         break;
     case RTF_MARGB: // fall through: set the default + current value
-        lcl_putNestedAttribute(m_aDefaultState.aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_bottom, pIntValue, RTFOverwrite::YES);
+        lcl_putNestedAttribute(m_aDefaultState.aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_bottom, pIntValue);
     case RTF_MARGBSXN:
-        lcl_putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_bottom, pIntValue, RTFOverwrite::YES);
+        lcl_putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_bottom, pIntValue);
         break;
     case RTF_HEADERY:
-        lcl_putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_header, pIntValue, RTFOverwrite::YES);
+        lcl_putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_header, pIntValue);
         break;
     case RTF_FOOTERY:
-        lcl_putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_footer, pIntValue, RTFOverwrite::YES);
+        lcl_putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_footer, pIntValue);
         break;
     case RTF_DEFTAB:
         m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Settings_defaultTabStop, pIntValue);
@@ -4487,10 +4487,10 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
         m_aStates.top().aPicture.eWMetafile = nParam;
         break;
     case RTF_SB:
-        lcl_putNestedAttribute(m_aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_spacing, NS_ooxml::LN_CT_Spacing_before, pIntValue, RTFOverwrite::YES);
+        lcl_putNestedAttribute(m_aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_spacing, NS_ooxml::LN_CT_Spacing_before, pIntValue);
         break;
     case RTF_SA:
-        lcl_putNestedAttribute(m_aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_spacing, NS_ooxml::LN_CT_Spacing_after, pIntValue, RTFOverwrite::YES);
+        lcl_putNestedAttribute(m_aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_spacing, NS_ooxml::LN_CT_Spacing_after, pIntValue);
         break;
     case RTF_DPX:
         m_aStates.top().aDrawingObject.nLeft = convertTwipToMm100(nParam);
@@ -4895,10 +4895,10 @@ RTFError RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int n
     }
     break;
     case RTF_SBAUTO:
-        lcl_putNestedAttribute(m_aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_spacing, NS_ooxml::LN_CT_Spacing_beforeAutospacing, pBoolValue, RTFOverwrite::YES);
+        lcl_putNestedAttribute(m_aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_spacing, NS_ooxml::LN_CT_Spacing_beforeAutospacing, pBoolValue);
         break;
     case RTF_SAAUTO:
-        lcl_putNestedAttribute(m_aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_spacing, NS_ooxml::LN_CT_Spacing_afterAutospacing, pBoolValue, RTFOverwrite::YES);
+        lcl_putNestedAttribute(m_aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_spacing, NS_ooxml::LN_CT_Spacing_afterAutospacing, pBoolValue);
         break;
     case RTF_FACINGP:
         m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Settings_evenAndOddHeaders, pBoolValue);
commit 666f732412e739fda6d0578752156dbb11931a2f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 20 11:47:18 2015 +0200

    loplugin:defaultparams
    
    Change-Id: I3e5ee77b51eb8e1207d3f95e6a1d9d8272532ba6

diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index c44a7cd..11d53c7 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -275,7 +275,7 @@ GraphiteFaceWrapper * FtFontInfo::GetGraphiteFace()
     if (mbCheckedGraphite)
         return mpGraphiteFace;
     // test for graphite here so that it is cached most efficiently
-    if (GetTable("Silf", 0))
+    if (GetTable("Silf"))
     {
         static const char* pGraphiteCacheStr = getenv( "SAL_GRAPHITE_CACHE_SIZE" );
         int graphiteSegCacheSize = pGraphiteCacheStr ? (atoi(pGraphiteCacheStr)) : 0;
diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index dffcd03..db35f31 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -1146,7 +1146,7 @@ bool PspSalPrinter::StartJob( const OUString* i_pFileName, const OUString& i_rJo
                               TenMuToPt( aNewParm.maPageSize.Height() ),
                               vcl::PDFWriter::Portrait );
 
-            xWriter->PlayMetafile( aPageFile, aMtfContext, NULL );
+            xWriter->PlayMetafile( aPageFile, aMtfContext );
         }
     }
 
diff --git a/vcl/generic/print/glyphset.cxx b/vcl/generic/print/glyphset.cxx
index 0c835e8..da7d0a3 100644
--- a/vcl/generic/print/glyphset.cxx
+++ b/vcl/generic/print/glyphset.cxx
@@ -724,7 +724,7 @@ static void CreatePSUploadableFont( TrueTypeFont* pSrcFont, FILE* pTmpFile,
     aInfo.LoadFont( pSrcFont );
 
     aInfo.CreateFontSubset( nTargetMask, pTmpFile, pGlyphSetName,
-        &aRequestedGlyphs[0], &aEncoding[0], nGlyphCount, NULL );
+        &aRequestedGlyphs[0], &aEncoding[0], nGlyphCount );
 }
 
 bool
diff --git a/vcl/generic/print/text_gfx.cxx b/vcl/generic/print/text_gfx.cxx
index 6b4e10f..30ae40d 100644
--- a/vcl/generic/print/text_gfx.cxx
+++ b/vcl/generic/print/text_gfx.cxx
@@ -501,7 +501,7 @@ bool PrinterGfx::drawVerticalizedText(
                     aPos.Y() += (sal_Int32)(-(nTextScale*fStretch - nD) * fCos);
                     break;
             }
-            drawText( aPos, pStr+i, 1, NULL );
+            drawText( aPos, pStr+i, 1 );
             if( i < nLen-1 && pDeltaArray )
             {
                 aPoint.X() = (sal_Int32)(rPoint.X() + ((double)pDeltaArray[i] * fCos));
diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx
index ae778fe..a7c4e034 100644
--- a/vcl/qa/cppunit/complextext.cxx
+++ b/vcl/qa/cppunit/complextext.cxx
@@ -51,7 +51,7 @@ void VclComplexTextTest::testArabic()
     vcl::Font aFont = OutputDevice::GetDefaultFont(
                         DefaultFontType::CTL_SPREADSHEET,
                         LANGUAGE_ARABIC_SAUDI_ARABIA,
-                        GetDefaultFontFlags::OnlyOne, 0 );
+                        GetDefaultFontFlags::OnlyOne );
     pOutDev->SetFont( aFont );
 
     // normal orientation
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 78278c5..5a259d0 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -2034,7 +2034,7 @@ void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
             }
 
             ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, 1,
-                                  nDrawFlags, nTextStyle, NULL );
+                                  nDrawFlags, nTextStyle );
 
             rMouseRect          = Rectangle( aPos, aSize );
             rMouseRect.Left()   = rPos.X();
@@ -3109,7 +3109,7 @@ void CheckBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
         }
 
         ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, 1,
-                              nDrawFlags, nTextStyle, NULL );
+                              nDrawFlags, nTextStyle );
         nLineY = aPos.Y() + aSize.Height()/2;
 
         rMouseRect          = Rectangle( aPos, aSize );
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 316ee8d..c65b38d 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -2589,7 +2589,7 @@ void TextEngine::RemoveAttribs( sal_uInt32 nPara, bool bIdleFormatAndUpdate )
             if ( bIdleFormatAndUpdate )
                 IdleFormatAndUpdate( NULL, 0xFFFF );
             else
-                FormatAndUpdate( NULL );
+                FormatAndUpdate();
         }
     }
 }
@@ -2613,7 +2613,7 @@ void TextEngine::RemoveAttribs( sal_uInt32 nPara, sal_uInt16 nWhich, bool bIdleF
             if(bIdleFormatAndUpdate)
                 IdleFormatAndUpdate( NULL, 0xFFFF );
             else
-                FormatAndUpdate( NULL );
+                FormatAndUpdate();
         }
     }
 }
@@ -2637,7 +2637,7 @@ void TextEngine::RemoveAttrib( sal_uInt32 nPara, const TextCharAttrib& rAttrib )
             TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
             pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().getLength() );
             mbFormatted = false;
-            FormatAndUpdate( NULL );
+            FormatAndUpdate();
         }
     }
 }
@@ -2668,7 +2668,7 @@ void TextEngine::SetAttrib( const TextAttrib& rAttr, sal_uInt32 nPara, sal_Int32
         if ( bIdleFormatAndUpdate )
             IdleFormatAndUpdate( NULL, 0xFFFF );
         else
-            FormatAndUpdate( NULL );
+            FormatAndUpdate();
     }
 }
 
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index e0da9aa..85c64a1 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -270,9 +270,9 @@ bool Bitmap::Convert( BmpConversion eConversion )
         case( BMP_CONVERSION_4BIT_COLORS ):
         {
             if( nBitCount < 4 )
-                bRet = ImplConvertUp( 4, NULL );
+                bRet = ImplConvertUp( 4 );
             else if( nBitCount > 4 )
-                bRet = ImplConvertDown( 4, NULL );
+                bRet = ImplConvertDown( 4 );
             else
                 bRet = true;
         }
@@ -318,7 +318,7 @@ bool Bitmap::Convert( BmpConversion eConversion )
         case( BMP_CONVERSION_24BIT ):
         {
             if( nBitCount < 24 )
-                bRet = ImplConvertUp( 24, NULL );
+                bRet = ImplConvertUp( 24 );
             else
                 bRet = true;
         }
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index c295549..37032f9 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -1567,7 +1567,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai
             Rectangle aRect;
             // hdu said base = index
             aMapVDev->GetTextBoundRect( aRect, pAct->GetText(), pAct->GetIndex(), pAct->GetIndex(), pAct->GetLen(),
-                                       pAct->GetWidth(), NULL );
+                                       pAct->GetWidth() );
             Point aPt( pAct->GetPoint() );
             aRect.Move( aPt.X(), aPt.Y() );
             ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev->GetMapMode(), GetPrefMapMode() ), aClipStack, 0 );
@@ -1582,7 +1582,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai
             OUString aStr( pStr );
 
             Rectangle aRect;
-            aMapVDev->GetTextBoundRect( aRect, aStr, 0, 0, aStr.getLength(), 0, NULL );
+            aMapVDev->GetTextBoundRect( aRect, aStr, 0, 0, aStr.getLength() );
             Point aPt( pAct->GetStartPoint() );
             aRect.Move( aPt.X(), aPt.Y() );
             aRect.Right() = aRect.Left() + pAct->GetWidth();
diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx
index 885bf71..c90f41c 100644
--- a/vcl/source/gdi/pdfwriter.cxx
+++ b/vcl/source/gdi/pdfwriter.cxx
@@ -467,7 +467,7 @@ PDFWriter::InitEncryption( const OUString& i_rOwnerPassword,
 
 void PDFWriter::PlayMetafile( const GDIMetaFile& i_rMTF, const vcl::PDFWriter::PlayMetafileContext& i_rPlayContext, PDFExtOutDevData* i_pData )
 {
-    xImplementation->playMetafile( i_rMTF, i_pData, i_rPlayContext, NULL);
+    xImplementation->playMetafile( i_rMTF, i_pData, i_rPlayContext );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/helper/evntpost.cxx b/vcl/source/helper/evntpost.cxx
index 1d4a657..5331eca 100644
--- a/vcl/source/helper/evntpost.cxx
+++ b/vcl/source/helper/evntpost.cxx
@@ -43,7 +43,7 @@ void EventPoster::Post()
 
 {
     DBG_TESTSOLARMUTEX();
-    m_nId = Application::PostUserEvent( ( LINK( this, EventPoster, DoEvent_Impl ) ), nullptr );
+    m_nId = Application::PostUserEvent( ( LINK( this, EventPoster, DoEvent_Impl ) ) );
 }
 
 IMPL_LINK_TYPED( EventPoster, DoEvent_Impl, void*, /*p*/, void )
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index d03f3cb..dc1bcfc 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -914,7 +914,7 @@ void OutputDevice::DrawText( const Point& rStartPt, const OUString& rStr,
     if ( !IsDeviceOutputNecessary() || pVector )
         return;
 
-    SalLayout* pSalLayout = ImplLayout(rStr, nIndex, nLen, rStartPt, 0, NULL);
+    SalLayout* pSalLayout = ImplLayout(rStr, nIndex, nLen, rStartPt);
     if( pSalLayout )
     {
         ImplDrawText( *pSalLayout );
@@ -1184,7 +1184,7 @@ void OutputDevice::DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
     if ( !IsDeviceOutputNecessary() )
         return;
 
-    SalLayout* pSalLayout = ImplLayout(rStr, nIndex, nLen, rStartPt, nWidth, NULL);
+    SalLayout* pSalLayout = ImplLayout(rStr, nIndex, nLen, rStartPt, nWidth);
     if( pSalLayout )
     {
         ImplDrawText( *pSalLayout );
@@ -1428,7 +1428,7 @@ std::shared_ptr<vcl::TextLayoutCache> OutputDevice::CreateTextLayoutCache(
         return nullptr;
     OUString copyBecausePrepareModifiesIt(rString);
     ImplLayoutArgs aLayoutArgs = ImplPrepareLayoutArgs(copyBecausePrepareModifiesIt,
-            0, rString.getLength(), 0, nullptr, SalLayoutFlags::NONE, nullptr);
+            0, rString.getLength(), 0, nullptr);
 
     SalLayout *const pSalLayout = mpGraphics->GetTextLayout( aLayoutArgs, 0 );
     if (!pSalLayout)
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 9967e9c..adb0621 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -56,7 +56,7 @@ static void ImplGetPinImage( DrawButtonFlags nStyle, bool bPinIn, Image& rImage
             Color aMaskColor( 0x00, 0x00, 0xFF );
             pSVData->maCtrlData.mpPinImgList->InsertFromHorizontalBitmap
                 ( ResId( SV_RESID_BITMAP_PIN, *pResMgr ), 4,
-                  &aMaskColor, NULL, NULL );
+                  &aMaskColor );
         }
     }
 
@@ -1937,8 +1937,7 @@ void ImplBorderWindow::Resize()
             }
             mpMenuBarWindow->setPosSizePixel(
                     nLeftBorder, nTopBorder,
-                    aSize.Width()-nLeftBorder-nRightBorder, nMenuHeight,
-                    PosSizeFlags::Pos | PosSizeFlags::Width | PosSizeFlags::Height);
+                    aSize.Width()-nLeftBorder-nRightBorder, nMenuHeight);
 
             // shift the notebookbar down accordingly
             nTopBorder += nMenuHeight;
@@ -1949,8 +1948,7 @@ void ImplBorderWindow::Resize()
             long nNotebookBarHeight = mpNotebookBarWindow->GetSizePixel().Height();
             mpNotebookBarWindow->setPosSizePixel(
                     nLeftBorder, nTopBorder,
-                    aSize.Width() - nLeftBorder - nRightBorder, nNotebookBarHeight,
-                    PosSizeFlags::Pos | PosSizeFlags::Width | PosSizeFlags::Height);
+                    aSize.Width() - nLeftBorder - nRightBorder, nNotebookBarHeight);
         }
 
         GetBorder( pClientWindow->mpWindowImpl->mnLeftBorder, pClientWindow->mpWindowImpl->mnTopBorder,
diff --git a/vcl/source/window/introwin.cxx b/vcl/source/window/introwin.cxx
index d8b4001..b7bd49b 100644
--- a/vcl/source/window/introwin.cxx
+++ b/vcl/source/window/introwin.cxx
@@ -35,7 +35,7 @@ IntroWindow::IntroWindow( ) :
     WorkWindow( WINDOW_INTROWINDOW )
 {
     ImplInitIntroWindowData();
-    WorkWindow::ImplInit( 0, WB_INTROWIN, NULL );
+    WorkWindow::ImplInit( 0, WB_INTROWIN );
 }
 
 IntroWindow::~IntroWindow()
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index ae6c6b8..67eba4e 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -148,7 +148,7 @@ MenuBarWindow::MenuBarWindow( vcl::Window* pParent ) :
         aCloseBtn->SetPaintTransparent(true);
         aCloseBtn->SetParentClipMode(ParentClipMode::NoClip);
 
-        aCloseBtn->InsertItem(IID_DOCUMENTCLOSE, aCloseBtn->maImage, ToolBoxItemBits::NONE);

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list