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