[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - 2 commits - desktop/inc desktop/source reportdesign/source vcl/inc vcl/unx

Noel Grandin noel.grandin at collabora.co.uk
Thu Apr 26 14:17:40 UTC 2018


 desktop/inc/app.hxx                               |    1 
 desktop/source/app/app.cxx                        |    9 ++++++
 desktop/source/app/sofficemain.cxx                |    4 ++
 reportdesign/source/core/inc/FixedText.hxx        |   16 +++++++++++
 reportdesign/source/core/inc/FormatCondition.hxx  |   30 +++++++++++++++++++---
 reportdesign/source/core/inc/FormattedField.hxx   |   16 +++++++++++
 reportdesign/source/core/inc/ReportHelperImpl.hxx |    2 -
 reportdesign/source/core/inc/Shape.hxx            |   30 +++++++++++++++++++---
 vcl/inc/opengl/x11/glxtest.hxx                    |    2 +
 vcl/unx/glxtest.cxx                               |   16 +++++++++++
 10 files changed, 117 insertions(+), 9 deletions(-)

New commits:
commit 151e7be164774da3251ee06be872cc85a1a9dfb7
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Apr 24 16:27:17 2018 +0200

    tdf#117161 ReportBuilder horizontal align wrong when editing
    
    regression from
            commit 5d0e485e827057eee9fb2c997685690b710e7f34
            use actual UNO enums in reportdesign..svtools
    
    Also make some of the "template<> set" property helpers only fire on
    actual property change
    
    Reviewed-on: https://gerrit.libreoffice.org/53412
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit b4ba8dc9ef1635c75b363838b6016d3851387020)
    
    Change-Id: I930fd255d287c3c7e5b064823fd1e8d4b665eae0
    Reviewed-on: https://gerrit.libreoffice.org/53495
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/reportdesign/source/core/inc/FixedText.hxx b/reportdesign/source/core/inc/FixedText.hxx
index ff95757fcee9..e3d8082bf6aa 100644
--- a/reportdesign/source/core/inc/FixedText.hxx
+++ b/reportdesign/source/core/inc/FixedText.hxx
@@ -50,6 +50,22 @@ namespace reportdesign
         OFixedText(const OFixedText&) = delete;
         OFixedText& operator=(const OFixedText&) = delete;
 
+        // internally, we store PROPERTY_PARAADJUST as css::style::ParagraphAdjust, but externally the property is visible as a sal_Int16
+        void set(  const OUString& _sProperty
+                  ,sal_Int16 Value
+                  ,css::style::ParagraphAdjust& _member)
+        {
+            BoundListeners l;
+            {
+                ::osl::MutexGuard aGuard(m_aMutex);
+                if ( static_cast<sal_Int16>(_member) != Value )
+                {
+                    prepareSet(_sProperty, css::uno::makeAny(static_cast<sal_Int16>(_member)), css::uno::makeAny(Value), &l);
+                    _member = static_cast<css::style::ParagraphAdjust>(Value);
+                }
+            }
+            l.notify();
+        }
         template <typename T> void set(  const OUString& _sProperty
                                         ,const T& Value
                                         ,T& _member)
diff --git a/reportdesign/source/core/inc/FormatCondition.hxx b/reportdesign/source/core/inc/FormatCondition.hxx
index ab460f030d88..b4865e76b1af 100644
--- a/reportdesign/source/core/inc/FormatCondition.hxx
+++ b/reportdesign/source/core/inc/FormatCondition.hxx
@@ -48,6 +48,22 @@ namespace reportdesign
         OFormatCondition(const OFormatCondition&) = delete;
         OFormatCondition& operator=(const OFormatCondition&) = delete;
 
+        // internally, we store PROPERTY_PARAADJUST as css::style::ParagraphAdjust, but externally the property is visible as a sal_Int16
+        void set(  const OUString& _sProperty
+                   ,sal_Int16 Value
+                   ,css::style::ParagraphAdjust& _member)
+        {
+            BoundListeners l;
+            {
+                ::osl::MutexGuard aGuard(m_aMutex);
+                if ( static_cast<sal_Int16>(_member) != Value )
+                {
+                    prepareSet(_sProperty, css::uno::makeAny(static_cast<sal_Int16>(_member)), css::uno::makeAny(Value), &l);
+                    _member = static_cast<css::style::ParagraphAdjust>(Value);
+                }
+            }
+            l.notify();
+        }
         template <typename T> void set(  const OUString& _sProperty
                                         ,const T& Value
                                         ,T& _member)
@@ -55,8 +71,11 @@ namespace reportdesign
             BoundListeners l;
             {
                 ::osl::MutexGuard aGuard(m_aMutex);
-                prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l);
-                _member = Value;
+                if ( _member != Value )
+                {
+                    prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l);
+                    _member = Value;
+                }
             }
             l.notify();
         }
@@ -67,8 +86,11 @@ namespace reportdesign
             BoundListeners l;
             {
                 ::osl::MutexGuard aGuard(m_aMutex);
-                prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l);
-                _member = Value;
+                if ( _member != Value )
+                {
+                    prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l);
+                    _member = Value;
+                }
             }
             l.notify();
         }
diff --git a/reportdesign/source/core/inc/FormattedField.hxx b/reportdesign/source/core/inc/FormattedField.hxx
index 6ffe6f7a2e2c..0da3686effca 100644
--- a/reportdesign/source/core/inc/FormattedField.hxx
+++ b/reportdesign/source/core/inc/FormattedField.hxx
@@ -53,6 +53,22 @@ namespace reportdesign
         OFormattedField(const OFormattedField&) = delete;
         OFormattedField& operator=(const OFormattedField&) = delete;
 
+        // internally, we store PROPERTY_PARAADJUST as css::style::ParagraphAdjust, but externally the property is visible as a sal_Int16
+        void set(  const OUString& _sProperty
+                   ,sal_Int16 Value
+                   ,css::style::ParagraphAdjust& _member)
+        {
+            BoundListeners l;
+            {
+                ::osl::MutexGuard aGuard(m_aMutex);
+                if ( static_cast<sal_Int16>(_member) != Value )
+                {
+                    prepareSet(_sProperty, css::uno::makeAny(static_cast<sal_Int16>(_member)), css::uno::makeAny(Value), &l);
+                    _member = static_cast<css::style::ParagraphAdjust>(Value);
+                }
+            }
+            l.notify();
+        }
         template <typename T> void set(  const OUString& _sProperty
                                         ,const T& Value
                                         ,T& _member)
diff --git a/reportdesign/source/core/inc/ReportHelperImpl.hxx b/reportdesign/source/core/inc/ReportHelperImpl.hxx
index 67d59ba2703a..881e87a18b99 100644
--- a/reportdesign/source/core/inc/ReportHelperImpl.hxx
+++ b/reportdesign/source/core/inc/ReportHelperImpl.hxx
@@ -231,7 +231,7 @@ sal_Int16 SAL_CALL clazz::getParaAdjust() \
  \
 void SAL_CALL clazz::setParaAdjust( sal_Int16 _align ) \
 { \
-    set(PROPERTY_PARAADJUST,(css::style::ParagraphAdjust)_align,varName.nAlign); \
+    set(PROPERTY_PARAADJUST,_align,varName.nAlign); \
 } \
  \
 awt::FontDescriptor SAL_CALL clazz::getFontDescriptor() \
diff --git a/reportdesign/source/core/inc/Shape.hxx b/reportdesign/source/core/inc/Shape.hxx
index ae28b48d2060..1ea0b4f2bec5 100644
--- a/reportdesign/source/core/inc/Shape.hxx
+++ b/reportdesign/source/core/inc/Shape.hxx
@@ -59,6 +59,22 @@ namespace reportdesign
         OShape(const OShape&) = delete;
         OShape& operator=(const OShape&) = delete;
 
+        // internally, we store PROPERTY_PARAADJUST as css::style::ParagraphAdjust, but externally the property is visible as a sal_Int16
+        void set(  const OUString& _sProperty
+                   ,sal_Int16 Value
+                   ,css::style::ParagraphAdjust& _member)
+        {
+            BoundListeners l;
+            {
+                ::osl::MutexGuard aGuard(m_aMutex);
+                if ( static_cast<sal_Int16>(_member) != Value )
+                {
+                    prepareSet(_sProperty, css::uno::makeAny(static_cast<sal_Int16>(_member)), css::uno::makeAny(Value), &l);
+                    _member = static_cast<css::style::ParagraphAdjust>(Value);
+                }
+            }
+            l.notify();
+        }
         template <typename T> void set(  const OUString& _sProperty
                                         ,const T& Value
                                         ,T& _member)
@@ -66,8 +82,11 @@ namespace reportdesign
             BoundListeners l;
             {
                 ::osl::MutexGuard aGuard(m_aMutex);
-                prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l);
-                _member = Value;
+                if ( _member != Value )
+                {
+                    prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l);
+                    _member = Value;
+                }
             }
             l.notify();
         }
@@ -78,8 +97,11 @@ namespace reportdesign
             BoundListeners l;
             {
                 ::osl::MutexGuard aGuard(m_aMutex);
-                prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l);
-                _member = Value;
+                if ( _member != Value )
+                {
+                    prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l);
+                    _member = Value;
+                }
             }
             l.notify();
         }
commit 6839b7714b80cf28614dcd793edcdeb70dc6ed5f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 19 13:59:16 2018 +0200

    tdf#95843: Wait for fire_glxtest_process also in --headless mode
    
    Discussed with mmeeks on IRC that fire_glxtest_process is probably called as
    early as possible so that its reuslt is ready by the time it is needed in the
    non-headless case.  So best fix for headless is probably to just wait for the
    sub-process at an opportune point, instead of redesigning the whole mess so that
    fire_glxtest_process would only be called once its result is actually needed.
    
    Change-Id: I4ea9c9d54b83c9695a3b72317e68fed0c410da0e
    Reviewed-on: https://gerrit.libreoffice.org/53154
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 4bacf58f4af44ac8c4632b43289ccfcc07e5820c)
    Reviewed-on: https://gerrit.libreoffice.org/53170
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 0e5f8774d3c3..d0ef2a66818a 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -181,6 +181,7 @@ OUString ReplaceStringHookProc(const OUString& rStr);
 
 #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined LIBO_HEADLESS
 bool fire_glxtest_process();
+void reap_glxtest_process();
 #endif
 
 #endif // INCLUDED_DESKTOP_INC_APP_HXX
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 192793ea42f1..583ea189165f 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1595,6 +1595,15 @@ int Desktop::Main()
         CheckOpenCLCompute(xDesktop);
 #endif
 
+        // In headless mode, reap the process started by fire_glxtest_process() early in soffice_main
+        // (desktop/source/app/sofficemain.cxx), in a code block that needs to be covered by the same
+        // #if condition as this code block:
+#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS) && HAVE_FEATURE_OPENGL
+        if (rCmdLineArgs.IsHeadless()) {
+            reap_glxtest_process();
+        }
+#endif
+
         // Release solar mutex just before we wait for our client to connect
         {
             SolarMutexReleaser aReleaser;
diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index 657614962489..67c1efe4a799 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -122,6 +122,10 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main()
 #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS) && HAVE_FEATURE_OPENGL
     /* Run test for OpenGL support in own process to avoid crash with broken
      * OpenGL drivers. Start process as early as possible.
+     * In non-headless mode, the process will be reaped in X11OpenGLDeviceInfo::GetData
+     * (vcl/opengl/x11/X11DeviceInfo.cxx).  In headless mode, the process will be reaped late in
+     * Desktop::Main (desktop/source/app/app.cxx), in a code block that needs to be covered by the
+     * same #if condition as this code block.
      */
     bool bSuccess = fire_glxtest_process();
     SAL_WARN_IF(!bSuccess, "desktop.opengl", "problems with glxtest");
diff --git a/vcl/inc/opengl/x11/glxtest.hxx b/vcl/inc/opengl/x11/glxtest.hxx
index 979f795de139..d74436aae111 100644
--- a/vcl/inc/opengl/x11/glxtest.hxx
+++ b/vcl/inc/opengl/x11/glxtest.hxx
@@ -18,6 +18,8 @@ VCL_DLLPUBLIC pid_t* getGlxPid();
 
 bool fire_glxtest_process();
 
+void reap_glxtest_process();
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/glxtest.cxx b/vcl/unx/glxtest.cxx
index b0cdde234c2b..70d34fb7318d 100644
--- a/vcl/unx/glxtest.cxx
+++ b/vcl/unx/glxtest.cxx
@@ -27,6 +27,8 @@
 #include <string.h>
 #include <signal.h>
 
+#include <sys/wait.h>
+
 #include <opengl/x11/glxtest.hxx>
 
 #ifdef __SUNPRO_CC
@@ -36,6 +38,8 @@
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 
+#include <sal/log.hxx>
+
 // stuff from glx.h
 typedef struct __GLXcontextRec *GLXContext;
 typedef XID GLXPixmap;
@@ -275,3 +279,15 @@ bool fire_glxtest_process()
   *glxtest_pid = pid;
   return true;
 }
+
+void reap_glxtest_process() {
+    pid_t * pid = getGlxPid();
+    if (*pid != 0) {
+        // Use WNOHANG, as it is probably better to have a (rather harmless) zombie child process
+        // hanging around for the duration of the calling process, than to potentially block the
+        // calling process here:
+        pid_t e = waitpid(*pid, nullptr, WNOHANG);
+        SAL_INFO_IF(
+            e <= 0, "vcl.opengl", "waiting for glxtest process " << *pid << " failed with " << e);
+    }
+}


More information about the Libreoffice-commits mailing list