From 27491822195e131d04cf117dcd84b7059f281309 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 3 Oct 2018 09:04:51 +0300 Subject: 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 --- libreofficekit/qa/tilebench/tilebench.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libreofficekit/qa') 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); -- cgit