diff options
Diffstat (limited to 'desktop/source/lib/init.cxx')
-rw-r--r-- | desktop/source/lib/init.cxx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 6830aa698e79..d82a44dd09f5 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2349,6 +2349,13 @@ static void doc_setPartMode(LibreOfficeKitDocument* pThis, } } +#if defined(ANDROID) +/// For the distinction if the LOK is used for the 'old' (JNI-based) or the +/// 'new' (loolwsd-based) app. Default to the 'new', ie. not used from JNI as +/// implemented in sal/android/libreofficekit-jni.c. +bool android_lok_from_jni = false; +#endif + static void doc_paintTile(LibreOfficeKitDocument* pThis, unsigned char* pBuffer, const int nCanvasWidth, const int nCanvasHeight, @@ -2403,10 +2410,15 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis, #else ScopedVclPtrInstance< VirtualDevice > pDevice(nullptr, Size(1, 1), DeviceFormat::DEFAULT) ; -#if !defined(ANDROID) - // Set background to transparent by default. - pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); +#if defined(ANDROID) + if (!android_lok_from_jni) #endif + { + // Set background to transparent by default. + // [Unless it is the 'old' (JNI-based) Android app - no idea why it + // needs avoiding this.] + pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); + } pDevice->SetOutputSizePixelScaleOffsetAndBuffer( Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), |