summaryrefslogtreecommitdiffstats
path: root/libreofficekit
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-11-18 21:12:02 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-11-19 07:29:56 +0100
commite3a3a931fe23eee9a70ffd807bc00a6ba4aad731 (patch)
tree7207e16e95f3e1dd90485192f093e587b4b349f9 /libreofficekit
parentRename GlyphCache to FreetypeManager (diff)
downloadcore-e3a3a931fe23eee9a70ffd807bc00a6ba4aad731.tar.gz
core-e3a3a931fe23eee9a70ffd807bc00a6ba4aad731.zip
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@redhat.com>
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx8
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx38
2 files changed, 29 insertions, 17 deletions
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,