f325b2
From 17e3b1763321f5f338e415bb0d0d86f5e7f7d2c6 Mon Sep 17 00:00:00 2001
f325b2
From: Stephan Bergmann <sbergman@redhat.com>
f325b2
Date: Wed, 27 May 2015 20:51:09 +0200
f325b2
Subject: [PATCH 005/398] loplugin:staticmethods
f325b2
f325b2
Change-Id: Idb1072ecedd9ab0315d67e296da6d306c098b183
f325b2
(cherry picked from commit 5af7ca55a3d06ab23df715346c9b24d1333907be)
f325b2
---
f325b2
 libreofficekit/source/gtk/lokdocview.cxx | 39 +++++++++++++++++---------------
f325b2
 1 file changed, 21 insertions(+), 18 deletions(-)
f325b2
f325b2
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
f325b2
index 79cc649fa369..24f9d04a9024 100644
f325b2
--- a/libreofficekit/source/gtk/lokdocview.cxx
f325b2
+++ b/libreofficekit/source/gtk/lokdocview.cxx
f325b2
@@ -38,6 +38,26 @@
f325b2
 // We know that VirtualDevices use a DPI of 96.
f325b2
 static const int DPI = 96;
f325b2
 
f325b2
+namespace {
f325b2
+
f325b2
+/// Sets rWidth and rHeight from a "width, height" string.
f325b2
+void payloadToSize(const char* pPayload, long& rWidth, long& rHeight)
f325b2
+{
f325b2
+    rWidth = rHeight = 0;
f325b2
+    gchar** ppCoordinates = g_strsplit(pPayload, ", ", 2);
f325b2
+    gchar** ppCoordinate = ppCoordinates;
f325b2
+    if (!*ppCoordinate)
f325b2
+        return;
f325b2
+    rWidth = atoi(*ppCoordinate);
f325b2
+    ++ppCoordinate;
f325b2
+    if (!*ppCoordinate)
f325b2
+        return;
f325b2
+    rHeight = atoi(*ppCoordinate);
f325b2
+    g_strfreev(ppCoordinates);
f325b2
+}
f325b2
+
f325b2
+}
f325b2
+
f325b2
 /// Holds data used by LOKDocView only.
f325b2
 struct LOKDocView_Impl
f325b2
 {
f325b2
@@ -170,8 +190,6 @@ struct LOKDocView_Impl
f325b2
      * the tiles that intersect with pPartial.
f325b2
      */
f325b2
     void renderDocument(GdkRectangle* pPartial);
f325b2
-    /// Sets rWidth and rHeight from a "width, height" string.
f325b2
-    static void payloadToSize(const char* pPayload, long& rWidth, long& rHeight);
f325b2
     /// Returns the GdkRectangle of a width,height,x,y string.
f325b2
     static GdkRectangle payloadToRectangle(const char* pPayload);
f325b2
     /// Returns the GdkRectangles of a w,h,x,y;w2,h2,x2,y2;... string.
f325b2
@@ -846,21 +864,6 @@ void LOKDocView_Impl::renderDocument(GdkRectangle* pPartial)
f325b2
     }
f325b2
 }
f325b2
 
f325b2
-void LOKDocView_Impl::payloadToSize(const char* pPayload, long& rWidth, long& rHeight)
f325b2
-{
f325b2
-    rWidth = rHeight = 0;
f325b2
-    gchar** ppCoordinates = g_strsplit(pPayload, ", ", 2);
f325b2
-    gchar** ppCoordinate = ppCoordinates;
f325b2
-    if (!*ppCoordinate)
f325b2
-        return;
f325b2
-    rWidth = atoi(*ppCoordinate);
f325b2
-    ++ppCoordinate;
f325b2
-    if (!*ppCoordinate)
f325b2
-        return;
f325b2
-    rHeight = atoi(*ppCoordinate);
f325b2
-    g_strfreev(ppCoordinates);
f325b2
-}
f325b2
-
f325b2
 GdkRectangle LOKDocView_Impl::payloadToRectangle(const char* pPayload)
f325b2
 {
f325b2
     GdkRectangle aRet;
f325b2
@@ -1033,7 +1036,7 @@ gboolean LOKDocView_Impl::callbackImpl(CallbackData* pCallback)
f325b2
     break;
f325b2
     case LOK_CALLBACK_DOCUMENT_SIZE_CHANGED:
f325b2
     {
f325b2
-        LOKDocView_Impl::payloadToSize(pCallback->m_aPayload.c_str(), m_nDocumentWidthTwips, m_nDocumentHeightTwips);
f325b2
+        payloadToSize(pCallback->m_aPayload.c_str(), m_nDocumentWidthTwips, m_nDocumentHeightTwips);
f325b2
     }
f325b2
     break;
f325b2
     case LOK_CALLBACK_SET_PART:
f325b2
-- 
f325b2
2.12.0
f325b2