[Libreoffice-commits] core.git: 2 commits - libreofficekit/qa libreofficekit/source vcl/unx

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 19 06:30:38 UTC 2019


 libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx |    8 +-
 libreofficekit/source/gtk/lokdocview.cxx                    |   38 +++++++-----
 vcl/unx/gtk3/gtk3gloactiongroup.cxx                         |    9 +-
 3 files changed, 35 insertions(+), 20 deletions(-)

New commits:
commit 38f4df895ebcaceb4107a42a59006420633a29b3
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Nov 18 21:19:13 2019 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Nov 19 07:30:07 2019 +0100

    Improved loplugin:external, handling class types
    
    ...plus follow-up loplugin:fakebool and loplugin:consttobool findings
    
    Change-Id: I4b4045439fc9b19c42f6915b158540d2daf4cafb
    Reviewed-on: https://gerrit.libreoffice.org/83123
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gloactiongroup.cxx b/vcl/unx/gtk3/gtk3gloactiongroup.cxx
index 80f932ace1a1..c6d5eaf03fc5 100644
--- a/vcl/unx/gtk3/gtk3gloactiongroup.cxx
+++ b/vcl/unx/gtk3/gtk3gloactiongroup.cxx
@@ -20,20 +20,23 @@
 #define G_TYPE_LO_ACTION                                (g_lo_action_get_type ())
 #define G_LO_ACTION(inst)                               (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
                                                          G_TYPE_LO_ACTION, GLOAction))
+namespace {
 
 struct GLOAction
 {
     GObject         parent_instance;
 
     gint            item_id;            // Menu item ID.
-    gboolean        submenu;            // TRUE if action is a submenu action.
-    gboolean        enabled;            // TRUE if action is enabled.
+    bool            submenu;            // TRUE if action is a submenu action.
+    bool            enabled;            // TRUE if action is enabled.
     GVariantType*   parameter_type;     // A GVariantType with the action parameter type.
     GVariantType*   state_type;         // A GVariantType with item state type
     GVariant*       state_hint;         // A GVariant with state hints.
     GVariant*       state;              // A GVariant with current item state
 };
 
+}
+
 typedef GObjectClass GLOActionClass;
 
 #ifdef __GNUC__
@@ -60,7 +63,7 @@ static void
 g_lo_action_init (GLOAction *action)
 {
     action->item_id = -1;
-    action->submenu = FALSE;
+    action->submenu = false;
     action->enabled = true;
     action->parameter_type = nullptr;
     action->state_type = nullptr;
commit e3a3a931fe23eee9a70ffd807bc00a6ba4aad731
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Nov 18 21:12:02 2019 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Nov 19 07:29:56 2019 +0100

    Improved loplugin:external, handling class types
    
    ...plus follow-up loplugin:fakebool and loplugin:consttobool findings
    
    Change-Id: I2b19d80f7313d3d5b0e502581b39fe20147bdfcc
    Reviewed-on: https://gerrit.libreoffice.org/83121
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx b/libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx
index a527ad88f9a1..9d448f467ff2 100644
--- a/libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx
@@ -26,6 +26,8 @@
 #include <boost/property_tree/json_parser.hpp>
 #include <boost/optional.hpp>
 
+namespace {
+
 struct GtvApplicationWindowPrivate
 {
     GtkWidget* container;
@@ -34,8 +36,8 @@ struct GtvApplicationWindowPrivate
     GtkWidget* scrolledwindowcontainer;
     GtkWidget* lokDialog;
 
-    gboolean toolbarBroadcast;
-    gboolean partSelectorBroadcast;
+    bool toolbarBroadcast;
+    bool partSelectorBroadcast;
 
     GList* m_pChildWindows;
 
@@ -43,6 +45,8 @@ struct GtvApplicationWindowPrivate
     GtvRenderingArgs* m_pRenderingArgs;
 };
 
+}
+
 #if defined __clang__
 #if __has_warning("-Wdeprecated-volatile")
 #pragma clang diagnostic push
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index bec07e862538..8dc4516d0ca5 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -47,6 +47,8 @@
 /// This is expected to be locked during setView(), doSomethingElse() LOK calls.
 static std::mutex g_aLOKMutex;
 
+namespace {
+
 /// Same as a GdkRectangle, but also tracks in which part the rectangle is.
 struct ViewRectangle
 {
@@ -81,11 +83,11 @@ struct LOKDocViewPrivateImpl
     std::string m_aDocPath;
     std::string m_aRenderingArguments;
     gdouble m_nLoadProgress;
-    gboolean m_bIsLoading;
-    gboolean m_bInit; // initializeForRendering() has been called
-    gboolean m_bCanZoomIn;
-    gboolean m_bCanZoomOut;
-    gboolean m_bUnipoll;
+    bool m_bIsLoading;
+    bool m_bInit; // initializeForRendering() has been called
+    bool m_bCanZoomIn;
+    bool m_bCanZoomOut;
+    bool m_bUnipoll;
     LibreOfficeKit* m_pOffice;
     LibreOfficeKitDocument* m_pDocument;
 
@@ -96,7 +98,7 @@ struct LOKDocViewPrivateImpl
     glong m_nDocumentWidthTwips;
     glong m_nDocumentHeightTwips;
     /// View or edit mode.
-    gboolean m_bEdit;
+    bool m_bEdit;
     /// LOK Features
     guint64 m_nLOKFeatures;
     /// Number of parts in currently loaded document
@@ -107,9 +109,9 @@ struct LOKDocViewPrivateImpl
     /// them, can't modify them. Key is the view id.
     std::map<int, ViewRectangle> m_aViewCursors;
     /// Cursor overlay is visible or hidden (for blinking).
-    gboolean m_bCursorOverlayVisible;
+    bool m_bCursorOverlayVisible;
     /// Cursor is visible or hidden (e.g. for graphic selection).
-    gboolean m_bCursorVisible;
+    bool m_bCursorVisible;
     /// Visibility of view selections. The current view can only see / them,
     /// can't modify them. Key is the view id.
     std::map<int, bool> m_aViewCursorVisibilities;
@@ -138,7 +140,7 @@ struct LOKDocViewPrivateImpl
     /// Position and size of the cell view cursors. The current view can only
     /// see them, can't modify them. Key is the view id.
     std::map<int, ViewRectangle> m_aCellViewCursors;
-    gboolean m_bInDragGraphicSelection;
+    bool m_bInDragGraphicSelection;
     /// Position, size and color of the reference marks. The current view can only
     /// see them, can't modify them. Key is the view id.
     std::vector<std::pair<ViewRectangle, sal_uInt32>> m_aReferenceMarks;
@@ -150,19 +152,19 @@ struct LOKDocViewPrivateImpl
     /// Rectangle of the text selection start handle, to know if the user clicked on it or not
     GdkRectangle m_aHandleStartRect;
     /// If we are in the middle of a drag of the text selection end handle.
-    gboolean m_bInDragStartHandle;
+    bool m_bInDragStartHandle;
     /// Bitmap of the text selection middle handle.
     cairo_surface_t* m_pHandleMiddle;
     /// Rectangle of the text selection middle handle, to know if the user clicked on it or not
     GdkRectangle m_aHandleMiddleRect;
     /// If we are in the middle of a drag of the text selection middle handle.
-    gboolean m_bInDragMiddleHandle;
+    bool m_bInDragMiddleHandle;
     /// Bitmap of the text selection end handle.
     cairo_surface_t* m_pHandleEnd;
     /// Rectangle of the text selection end handle, to know if the user clicked on it or not
     GdkRectangle m_aHandleEndRect;
     /// If we are in the middle of a drag of the text selection end handle.
-    gboolean m_bInDragEndHandle;
+    bool m_bInDragEndHandle;
     ///@}
 
     /// @name Graphic handles.
@@ -170,7 +172,7 @@ struct LOKDocViewPrivateImpl
     /// Rectangle of a graphic selection handle, to know if the user clicked on it or not.
     GdkRectangle m_aGraphicHandleRects[8];
     /// If we are in the middle of a drag of a graphic selection handle.
-    gboolean m_bInDragGraphicHandles[8];
+    bool m_bInDragGraphicHandles[8];
     ///@}
 
     /// View ID, returned by createView() or 0 by default.
@@ -209,7 +211,7 @@ struct LOKDocViewPrivateImpl
         m_fZoom(0),
         m_nDocumentWidthTwips(0),
         m_nDocumentHeightTwips(0),
-        m_bEdit(FALSE),
+        m_bEdit(false),
         m_nLOKFeatures(0),
         m_nParts(0),
         m_aVisibleCursor({0, 0, 0, 0}),
@@ -226,7 +228,7 @@ struct LOKDocViewPrivateImpl
         m_bInDragGraphicSelection(false),
         m_pHandleStart(nullptr),
         m_aHandleStartRect({0, 0, 0, 0}),
-        m_bInDragStartHandle(0),
+        m_bInDragStartHandle(false),
         m_pHandleMiddle(nullptr),
         m_aHandleMiddleRect({0, 0, 0, 0}),
         m_bInDragMiddleHandle(false),
@@ -252,6 +254,8 @@ struct LOKDocViewPrivateImpl
     }
 };
 
+}
+
 /// Wrapper around LOKDocViewPrivateImpl, managed by malloc/memset/free.
 struct _LOKDocViewPrivate
 {
@@ -342,6 +346,8 @@ static LOKDocViewPrivate& getPrivate(LOKDocView* pDocView)
     return *priv;
 }
 
+namespace {
+
 /// Helper struct used to pass the data from soffice thread -> main thread.
 struct CallbackData
 {
@@ -355,6 +361,8 @@ struct CallbackData
           m_pDocView(pDocView) {}
 };
 
+}
+
 static void
 LOKPostCommand (LOKDocView* pDocView,
                 const gchar* pCommand,


More information about the Libreoffice-commits mailing list