diff options
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.c b/libreofficekit/source/gtk/lokdocview.c index 3e791a7b6705..c5f8dab53a71 100644 --- a/libreofficekit/source/gtk/lokdocview.c +++ b/libreofficekit/source/gtk/lokdocview.c @@ -330,24 +330,27 @@ static GdkRectangle lcl_payloadToRectangle(const char* pPayload) { GdkRectangle aRet; gchar** ppCoordinates; + gchar** ppCoordinate; aRet.width = aRet.height = aRet.x = aRet.y = 0; ppCoordinates = g_strsplit(pPayload, ", ", 4); - if (!*ppCoordinates) + ppCoordinate = ppCoordinates; + if (!*ppCoordinate) return aRet; - aRet.width = atoi(*ppCoordinates); - ++ppCoordinates; - if (!*ppCoordinates) + aRet.width = atoi(*ppCoordinate); + ++ppCoordinate; + if (!*ppCoordinate) return aRet; - aRet.height = atoi(*ppCoordinates); - ++ppCoordinates; - if (!*ppCoordinates) + aRet.height = atoi(*ppCoordinate); + ++ppCoordinate; + if (!*ppCoordinate) return aRet; - aRet.x = atoi(*ppCoordinates); - ++ppCoordinates; - if (!*ppCoordinates) + aRet.x = atoi(*ppCoordinate); + ++ppCoordinate; + if (!*ppCoordinate) return aRet; - aRet.y = atoi(*ppCoordinates); + aRet.y = atoi(*ppCoordinate); + g_strfreev(ppCoordinates); return aRet; } |