summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-05-27 20:51:09 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-05-27 20:53:16 +0200
commit5af7ca55a3d06ab23df715346c9b24d1333907be (patch)
tree3170485dfafe61198a1be3fa9cd75b20a54109ab /libreofficekit
parent4a882796f0f22f365ce28612b4553115ca76f256 (diff)
loplugin:staticmethods
Change-Id: Idb1072ecedd9ab0315d67e296da6d306c098b183
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx39
1 files changed, 21 insertions, 18 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index b6ec8923d4eb..e3c03db14bf3 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -38,6 +38,26 @@
// We know that VirtualDevices use a DPI of 96.
static const int DPI = 96;
+namespace {
+
+/// Sets rWidth and rHeight from a "width, height" string.
+void payloadToSize(const char* pPayload, long& rWidth, long& rHeight)
+{
+ rWidth = rHeight = 0;
+ gchar** ppCoordinates = g_strsplit(pPayload, ", ", 2);
+ gchar** ppCoordinate = ppCoordinates;
+ if (!*ppCoordinate)
+ return;
+ rWidth = atoi(*ppCoordinate);
+ ++ppCoordinate;
+ if (!*ppCoordinate)
+ return;
+ rHeight = atoi(*ppCoordinate);
+ g_strfreev(ppCoordinates);
+}
+
+}
+
/// Holds data used by LOKDocView only.
struct LOKDocView_Impl
{
@@ -170,8 +190,6 @@ struct LOKDocView_Impl
* the tiles that intersect with pPartial.
*/
void renderDocument(GdkRectangle* pPartial);
- /// Sets rWidth and rHeight from a "width, height" string.
- static void payloadToSize(const char* pPayload, long& rWidth, long& rHeight);
/// Returns the GdkRectangle of a width,height,x,y string.
static GdkRectangle payloadToRectangle(const char* pPayload);
/// Returns the GdkRectangles of a w,h,x,y;w2,h2,x2,y2;... string.
@@ -846,21 +864,6 @@ void LOKDocView_Impl::renderDocument(GdkRectangle* pPartial)
}
}
-void LOKDocView_Impl::payloadToSize(const char* pPayload, long& rWidth, long& rHeight)
-{
- rWidth = rHeight = 0;
- gchar** ppCoordinates = g_strsplit(pPayload, ", ", 2);
- gchar** ppCoordinate = ppCoordinates;
- if (!*ppCoordinate)
- return;
- rWidth = atoi(*ppCoordinate);
- ++ppCoordinate;
- if (!*ppCoordinate)
- return;
- rHeight = atoi(*ppCoordinate);
- g_strfreev(ppCoordinates);
-}
-
GdkRectangle LOKDocView_Impl::payloadToRectangle(const char* pPayload)
{
GdkRectangle aRet;
@@ -1033,7 +1036,7 @@ gboolean LOKDocView_Impl::callbackImpl(CallbackData* pCallback)
break;
case LOK_CALLBACK_DOCUMENT_SIZE_CHANGED:
{
- LOKDocView_Impl::payloadToSize(pCallback->m_aPayload.c_str(), m_nDocumentWidthTwips, m_nDocumentHeightTwips);
+ payloadToSize(pCallback->m_aPayload.c_str(), m_nDocumentWidthTwips, m_nDocumentHeightTwips);
}
break;
case LOK_CALLBACK_SET_PART: