summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-06-18 21:39:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-06-20 21:25:11 +0200
commitcb95276e6e6bf12a1c06d5c252551e55c788fcb2 (patch)
tree9e54d9ddbd03f02f508af48ce8dce02d5c83a277 /desktop/source
parent292d9519bd368db69920cf0f8b94e0e51c3d14a1 (diff)
use JsonWriter for the rest of ITiledRenderable
and fix bug in buffer reallacotion where mPos pointing at the beginning of the new buffer instead of at the correct index inside it. Change-Id: Ie1ffaa176f6165e2cec85c93adc945312eff38e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96650 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/lib/init.cxx32
1 files changed, 18 insertions, 14 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 357111d220af..a9202a0c90b5 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3303,8 +3303,9 @@ static char* getPostIts(LibreOfficeKitDocument* pThis)
SetLastExceptionMsg("Document doesn't support tiled rendering");
return nullptr;
}
- OUString aComments = pDoc->getPostIts();
- return strdup(aComments.toUtf8().getStr());
+ tools::JsonWriter aJsonWriter;
+ pDoc->getPostIts(aJsonWriter);
+ return aJsonWriter.extractData();
}
/// Returns the JSON representation of the positions of all the comments in the document
@@ -3317,8 +3318,9 @@ static char* getPostItsPos(LibreOfficeKitDocument* pThis)
SetLastExceptionMsg("Document doesn't support tiled rendering");
return nullptr;
}
- OUString aComments = pDoc->getPostItsPos();
- return strdup(aComments.toUtf8().getStr());
+ tools::JsonWriter aJsonWriter;
+ pDoc->getPostItsPos(aJsonWriter);
+ return aJsonWriter.extractData();
}
static char* getRulerState(LibreOfficeKitDocument* pThis)
@@ -3330,8 +3332,9 @@ static char* getRulerState(LibreOfficeKitDocument* pThis)
SetLastExceptionMsg("Document doesn't support tiled rendering");
return nullptr;
}
- OUString state = pDoc->getRulerState();
- return strdup(state.toUtf8().getStr());
+ tools::JsonWriter aJsonWriter;
+ pDoc->getRulerState(aJsonWriter);
+ return aJsonWriter.extractData();
}
static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nCharCode, int nKeyCode)
@@ -4781,8 +4784,9 @@ static char* getTrackedChangeAuthors(LibreOfficeKitDocument* pThis)
SetLastExceptionMsg("Document doesn't support tiled rendering");
return nullptr;
}
- OUString aAuthors = pDoc->getTrackedChangeAuthors();
- return strdup(aAuthors.toUtf8().getStr());
+ tools::JsonWriter aJsonWriter;
+ pDoc->getTrackedChangeAuthors(aJsonWriter);
+ return aJsonWriter.extractData();
}
static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCommand)
@@ -4885,11 +4889,9 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
aRectangle = tools::Rectangle(nX, nY, nX + nWidth, nY + nHeight);
}
- OUString aHeaders = pDoc->getRowColumnHeaders(aRectangle);
- if (aHeaders.isEmpty())
- return nullptr;
- else
- return convertOUString(aHeaders);
+ tools::JsonWriter aJsonWriter;
+ pDoc->getRowColumnHeaders(aRectangle, aJsonWriter);
+ return aJsonWriter.extractData();
}
else if (aCommand.startsWith(aCellCursor))
{
@@ -4900,7 +4902,9 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
return nullptr;
}
// Ignore command's deprecated parameters.
- return convertOString(pDoc->getCellCursor());
+ tools::JsonWriter aJsonWriter;
+ pDoc->getCellCursor(aJsonWriter);
+ return aJsonWriter.extractData();
}
else if (aCommand.startsWith(aFontSubset))
{