summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-10-03 09:04:51 +0300
committerTor Lillqvist <tml@collabora.com>2018-10-05 20:21:05 +0300
commit27491822195e131d04cf117dcd84b7059f281309 (patch)
tree2f6a0ecde3eae6896d1f256579de18d956ce89ce /libreofficekit
parent61f1d1564c8a058f6b040f7cb392c4884e4613e2 (diff)
Call also initializeForRendering() and registerCallback()
... to make the LibreOfficeKit usage more like a real app, to make sure that calling these doesn't cause any change in behaviour. (It didn't, as far as I could see.) Change-Id: Idded20c06031b46d5194ffeeb17309f2dbcdbaac
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/qa/tilebench/tilebench.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/libreofficekit/qa/tilebench/tilebench.cxx b/libreofficekit/qa/tilebench/tilebench.cxx
index ee325c429267..2e0146da9f38 100644
--- a/libreofficekit/qa/tilebench/tilebench.cxx
+++ b/libreofficekit/qa/tilebench/tilebench.cxx
@@ -72,6 +72,7 @@ static void dumpTile(const int nWidth, const int nHeight, const int mode, const
static int counter = 0;
NSString *path = [NSString stringWithFormat:@"%@/dump_tile_%d.ppm", documentsDirectory, counter++];
std::ofstream ofs([path UTF8String]);
+ std::cerr << "---> Dumping tile\n";
#endif
ofs << "P6\n"
<< nWidth << " "
@@ -312,6 +313,11 @@ static void testDialog( Document *pDocument, const char *uno_cmd )
pDocument->destroyView(view);
}
+static void documentCallback(const int type, const char* p, void* data)
+{
+ std::cerr << "Document callback " << type << ": " << (p ? p : "(null)") << "\n";
+}
+
int main( int argc, char* argv[] )
{
int arg = 2;
@@ -381,6 +387,8 @@ int main( int argc, char* argv[] )
if (pDocument)
{
+ pDocument->initializeForRendering("{\".uno:Author\":{\"type\":\"string\",\"value\":\"Local Host #0\"}}");
+ pDocument->registerCallback(documentCallback, 0);
if (!strcmp(mode, "--tile"))
{
const int max_parts = (argc > arg ? atoi(argv[arg++]) : -1);