[Libreoffice-commits] core.git: Branch 'private/jmux/kf5' - include/sal vcl/unx

Jan-Marek Glogowski glogow at fbihome.de
Mon Oct 23 19:33:55 UTC 2017


 include/sal/log-areas.dox       |    2 
 vcl/unx/kf5/Kf5Bitmap.cxx       |  143 +++++++++++++++++++++++++++++-----------
 vcl/unx/kf5/Kf5Bitmap.hxx       |   10 +-
 vcl/unx/kf5/Kf5Data.hxx         |    6 -
 vcl/unx/kf5/Kf5Frame.cxx        |    9 ++
 vcl/unx/kf5/Kf5Graphics_GDI.cxx |    7 +
 vcl/unx/kf5/Kf5Instance.cxx     |  134 +++++++++++++++++++------------------
 vcl/unx/kf5/Kf5Instance.hxx     |    8 +-
 vcl/unx/kf5/Kf5Tools.hxx        |    7 +
 vcl/unx/kf5/Kf5Widget.cxx       |    1 
 10 files changed, 208 insertions(+), 119 deletions(-)

New commits:
commit fec065f1060846e952541b69bd9742be5d7a6944
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Mon Oct 23 21:33:19 2017 +0200

    KF5 various fixes
    
    Change-Id: Iaeb380ac37d080b1ae9ef61d9847c1b0cfb356a4

diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 8c0db9de0809..33b9c25f4d16 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -452,8 +452,8 @@ certain functionality.
 @li @c vcl.headless - bitmap-based backend
 @li @c vcl.helper
 @li @c vcl.icontest
- at li @c vcl.kde - KDE
 @li @c vcl.kde4 - KDE4
+ at li @c vcl.kf5 - KF5
 @li @c vcl.layout - Widget layout
 @li @c vcl.lazydelete
 @li @c vcl.opengl
diff --git a/vcl/unx/kf5/Kf5Bitmap.cxx b/vcl/unx/kf5/Kf5Bitmap.cxx
index e72750963b69..79a872458925 100644
--- a/vcl/unx/kf5/Kf5Bitmap.cxx
+++ b/vcl/unx/kf5/Kf5Bitmap.cxx
@@ -41,9 +41,38 @@ Kf5Bitmap::~Kf5Bitmap()
 bool Kf5Bitmap::Create( const Size& rSize, sal_uInt16 nBitCount,
                         const BitmapPalette& rPal )
 {
-    m_pImage.reset( new QImage( toQSize( rSize ), getBitFormat( nBitCount ) ) );
+    assert(
+          (nBitCount ==  1
+        || nBitCount ==  4
+        || nBitCount ==  8
+        || nBitCount == 16
+        || nBitCount == 24
+        || nBitCount == 32)
+        && "Unsupported BitCount!");
+
+    if ( nBitCount == 1 )
+        assert( 2 == rPal.GetEntryCount() );
+    if ( nBitCount == 4 )
+        assert( 16 == rPal.GetEntryCount() );
+    if ( nBitCount == 8 )
+        assert( 256 == rPal.GetEntryCount() );
+
+    if ( nBitCount == 4 )
+    {
+        m_pImage.reset( nullptr );
+        m_aSize = rSize;
+        m_nScanline = rSize.Width() / 2 + (rSize.Width() % 2) ? 0 : 1;
+        m_pBuffer.reset( new sal_uInt8[ m_nScanline * rSize.Height() ] );
+    }
+    else
+    {
+        m_pImage.reset( new QImage( toQSize( rSize ), getBitFormat( nBitCount ) ) );
+        m_pBuffer.reset( nullptr );
+    }
     m_aPalette = rPal;
-    if( unsigned count = rPal.GetEntryCount() )
+
+    auto count = rPal.GetEntryCount();
+    if( nBitCount != 4 && count )
     {
         QVector<QRgb> aColorTable( count );
         for ( unsigned i = 0; i < count; ++i )
@@ -56,8 +85,24 @@ bool Kf5Bitmap::Create( const Size& rSize, sal_uInt16 nBitCount,
 
 bool Kf5Bitmap::Create( const SalBitmap& rSalBmp )
 {
-    m_pImage.reset( new QImage(
-        *static_cast< const Kf5Bitmap*>( &rSalBmp )->m_pImage.get() ) );
+    const Kf5Bitmap *pBitmap = static_cast< const Kf5Bitmap*>( &rSalBmp );
+    sal_uInt16 nBitCount;
+    if ( pBitmap->m_pImage.get() )
+    {
+        m_pImage.reset( new QImage( *pBitmap->m_pImage.get() ) );
+        m_pBuffer.reset( nullptr );
+        nBitCount = getFormatBits( m_pImage->format() );
+    }
+    else
+    {
+        m_aSize = pBitmap->m_aSize;
+        m_nScanline = pBitmap->m_nScanline;
+        m_pBuffer.reset( new sal_uInt8[ m_nScanline * m_aSize.Height() ] );
+        memcpy( m_pBuffer.get(), pBitmap->m_pBuffer.get(), m_nScanline );
+        m_pImage.reset( nullptr );
+        nBitCount = 4;
+    }
+    m_aPalette = pBitmap->m_aPalette;
     return true;
 }
 
@@ -68,13 +113,26 @@ bool Kf5Bitmap::Create( const SalBitmap& rSalBmp,
     Kf5Graphics *pGraphics = static_cast< Kf5Graphics* >( pSalGraphics );
     QImage *pImage = static_cast< QImage* >( pGraphics->m_pDevice );
     m_pImage.reset( new QImage( pBitmap->m_pImage->convertToFormat( pImage->format() ) ) );
+    m_pBuffer.reset( nullptr );
     return true;
 }
 
 bool Kf5Bitmap::Create( const SalBitmap& rSalBmp,
                         sal_uInt16 nNewBitCount )
 {
+    assert(
+          (nNewBitCount ==  1
+        || nNewBitCount ==  4
+        || nNewBitCount ==  8
+        || nNewBitCount == 16
+        || nNewBitCount == 24
+        || nNewBitCount == 32)
+        && "Unsupported BitCount!");
+
     const Kf5Bitmap *pBitmap = static_cast< const Kf5Bitmap *>( &rSalBmp );
+    if ( pBitmap->m_pBuffer.get() )
+        return false;
+
     m_pImage.reset( new QImage( pBitmap->m_pImage->convertToFormat( getBitFormat( nNewBitCount ) ) ) );
     return true;
 }
@@ -88,89 +146,100 @@ bool Kf5Bitmap::Create( const css::uno::Reference< css::rendering::XBitmapCanvas
 void Kf5Bitmap::Destroy()
 {
     m_pImage.reset( nullptr );
+    m_pBuffer.reset( nullptr );
 }
 
 Size Kf5Bitmap::GetSize() const
 {
-    return toSize( m_pImage->size() );
+    if ( m_pBuffer.get() )
+        return m_aSize;
+    else
+        return toSize( m_pImage->size() );
 }
 
 sal_uInt16 Kf5Bitmap::GetBitCount() const
 {
-    return getFormatBits( m_pImage->format() );
+    if ( m_pBuffer.get() )
+        return 4;
+    else
+        return getFormatBits( m_pImage->format() );
 }
 
 BitmapBuffer* Kf5Bitmap::AcquireBuffer( BitmapAccessMode nMode )
 {
-    if ( !m_pImage.get() )
+    static const BitmapPalette aEmptyPalette;
+
+    if ( !(m_pImage.get() || m_pBuffer.get()) )
         return nullptr;
 
     BitmapBuffer* pBuffer = new BitmapBuffer;
-    pBuffer->mnWidth = m_pImage->width();
-    pBuffer->mnHeight = m_pImage->height();
-    pBuffer->maPalette = m_aPalette;
     pBuffer->mnScanlineSize = m_pImage->bytesPerLine();
-    pBuffer->mpBits = m_pImage->bits();
-    pBuffer->mnBitCount = getFormatBits( m_pImage->format() );
+
+    if ( m_pBuffer.get() )
+    {
+        pBuffer->mnWidth = m_aSize.Width();
+        pBuffer->mnHeight = m_aSize.Height();
+        pBuffer->mnBitCount = 4;
+        pBuffer->mpBits = m_pBuffer.get();
+        pBuffer->mnScanlineSize = m_nScanline;
+    }
+    else
+    {
+        pBuffer->mnWidth = m_pImage->width();
+        pBuffer->mnHeight = m_pImage->height();
+        pBuffer->mnBitCount = getFormatBits( m_pImage->format() );
+        pBuffer->mpBits = m_pImage->bits();
+        pBuffer->mnScanlineSize = m_pImage->bytesPerLine();
+    }
 
     switch( pBuffer->mnBitCount )
     {
         case 1:
             pBuffer->mnFormat = ScanlineFormat::N1BitMsbPal;
+            pBuffer->maPalette = m_aPalette;
             break;
         case 4:
             pBuffer->mnFormat = ScanlineFormat::N4BitMsnPal;
             break;
         case 8:
             pBuffer->mnFormat = ScanlineFormat::N8BitPal;
+            pBuffer->maPalette = m_aPalette;
             break;
-#if 0
         case 16:
         {
-            pBuffer->mnFormat = ScanlineFormat::N16BitTcMsbMask;
-            ColorMaskElement aRedMask(k16BitRedColorMask);
+#ifdef OSL_BIGENDIAN
+            pBuffer->mnFormat= ScanlineFormat::N16BitTcMsbMask;
+#else
+            pBuffer->mnFormat= ScanlineFormat::N16BitTcLsbMask;
+#endif
+            ColorMaskElement aRedMask(0xf800); // 5
             aRedMask.CalcMaskShift();
-            ColorMaskElement aGreenMask(k16BitGreenColorMask);
+            ColorMaskElement aGreenMask(0x07e0); // 6
             aGreenMask.CalcMaskShift();
-            ColorMaskElement aBlueMask(k16BitBlueColorMask);
+            ColorMaskElement aBlueMask(0x001f); // 5
             aBlueMask.CalcMaskShift();
             pBuffer->maColorMask = ColorMask(aRedMask, aGreenMask, aBlueMask);
+            pBuffer->maPalette = aEmptyPalette;
             break;
         }
-#endif
         case 24:
-            pBuffer->mnFormat = ScanlineFormat::N24BitTcBgr;
+            pBuffer->mnFormat = ScanlineFormat::N24BitTcRgb;
+            pBuffer->maPalette = aEmptyPalette;
             break;
         case 32:
         {
             pBuffer->mnFormat = ScanlineFormat::N32BitTcArgb;
-#if 0
-            ColorMaskElement aRedMask(k32BitRedColorMask);
-            aRedMask.CalcMaskShift();
-            ColorMaskElement aGreenMask(k32BitGreenColorMask);
-            aGreenMask.CalcMaskShift();
-            ColorMaskElement aBlueMask(k32BitBlueColorMask);
-            aBlueMask.CalcMaskShift();
-            pBuffer->maColorMask  = ColorMask(aRedMask, aGreenMask, aBlueMask);
-#endif
+            pBuffer->maPalette = aEmptyPalette;
             break;
         }
     }
 
-#if 0
-    // some BitmapBuffer users depend on a complete palette
-    if( (pBuffer->mnBitCount <= 8) && !m_aPalette )
-        pBuffer->maPalette = GetDefaultPalette( pBuffer->mnBitCount, true );
-#endif
     return pBuffer;
 }
 
 void Kf5Bitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode )
 {
-    // invalidate graphic context if we have different data
-    if( nMode == BitmapAccessMode::Write )
-        m_aPalette = pBuffer->maPalette;
-
+    m_aPalette = pBuffer->maPalette;
     delete pBuffer;
 }
 
diff --git a/vcl/unx/kf5/Kf5Bitmap.hxx b/vcl/unx/kf5/Kf5Bitmap.hxx
index 07ac7f021c4f..2ea4accc8e9c 100644
--- a/vcl/unx/kf5/Kf5Bitmap.hxx
+++ b/vcl/unx/kf5/Kf5Bitmap.hxx
@@ -27,9 +27,13 @@ class QImage;
 
 class VCL_DLLPUBLIC Kf5Bitmap : public SalBitmap
 {
-    std::unique_ptr< QImage > m_pImage;
-    BitmapPalette             m_aPalette;
-    bool                      m_bImageInUse;
+    std::unique_ptr< QImage >     m_pImage;
+    BitmapPalette                 m_aPalette;
+
+    // for 4bit support
+    std::unique_ptr< sal_uInt8 >  m_pBuffer;
+    Size                          m_aSize;
+    sal_uInt32                    m_nScanline;
 
 public:
     Kf5Bitmap();
diff --git a/vcl/unx/kf5/Kf5Data.hxx b/vcl/unx/kf5/Kf5Data.hxx
index 863fb45c2ce1..16f1e24ba710 100644
--- a/vcl/unx/kf5/Kf5Data.hxx
+++ b/vcl/unx/kf5/Kf5Data.hxx
@@ -25,10 +25,10 @@ class Kf5Data : public GenericUnixSalData
 {
 public:
     explicit Kf5Data( SalInstance *pInstance );
-    virtual ~Kf5Data();
+    virtual ~Kf5Data() override;
 
-    virtual void ErrorTrapPush();
-    virtual bool ErrorTrapPop( bool bIgnoreError = true );
+    virtual void ErrorTrapPush() override;
+    virtual bool ErrorTrapPop( bool bIgnoreError = true ) override;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kf5/Kf5Frame.cxx b/vcl/unx/kf5/Kf5Frame.cxx
index e008d2613fb1..82514345dd84 100644
--- a/vcl/unx/kf5/Kf5Frame.cxx
+++ b/vcl/unx/kf5/Kf5Frame.cxx
@@ -70,7 +70,12 @@ Kf5Frame::Kf5Frame( Kf5Frame* pParent, SalFrameStyleFlags nStyle )
     m_pQWidget.reset( new Kf5Widget( *this, pParent ? pParent->GetQWidget() : nullptr, aWinFlags ) );
 
     if (pParent && !(pParent->m_nStyle & SalFrameStyleFlags::PLUG))
-        m_pQWidget->windowHandle()->setTransientParent( pParent->GetQWidget()->window()->windowHandle() );
+    {
+        QWindow *pParentWindow = pParent->GetQWidget()->window()->windowHandle();
+        QWindow *pChildWindow = m_pQWidget->window()->windowHandle();
+        if ( pParentWindow != pChildWindow )
+            pChildWindow->setTransientParent( pParentWindow );
+    }
 }
 
 Kf5Frame::~Kf5Frame()
@@ -338,6 +343,7 @@ void Kf5Frame::EndExtTextInput( EndExtTextInputFlags nFlags )
 
 OUString Kf5Frame::GetKeyName( sal_uInt16 nKeyCode )
 {
+    return OUString();
 }
 
 bool Kf5Frame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode& rKeyCode )
@@ -347,6 +353,7 @@ bool Kf5Frame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType
 
 LanguageType Kf5Frame::GetInputLanguage()
 {
+    return LANGUAGE_DONTKNOW;
 }
 
 void Kf5Frame::UpdateSettings( AllSettings& rSettings )
diff --git a/vcl/unx/kf5/Kf5Graphics_GDI.cxx b/vcl/unx/kf5/Kf5Graphics_GDI.cxx
index 7a6d62341acc..69ac769e1c7d 100644
--- a/vcl/unx/kf5/Kf5Graphics_GDI.cxx
+++ b/vcl/unx/kf5/Kf5Graphics_GDI.cxx
@@ -192,21 +192,22 @@ void Kf5Graphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBi
         *pImage, QRect( rPosAry.mnSrcX, rPosAry.mnSrcY,
                         rPosAry.mnSrcWidth, rPosAry.mnSrcHeight) );
 
-    SAL_DEBUG( "Kf5Graphics::drawBitmap" );
+    if ( m_pFrame )
+        m_pFrame->GetQWidget()->update();
 }
 
 void Kf5Graphics::drawBitmap( const SalTwoRect& rPosAry,
                               const SalBitmap& rSalBitmap,
                               const SalBitmap& rTransparentBitmap )
 {
-assert( !"Impl" );
+// assert( !"Impl" );
 }
 
 void Kf5Graphics::drawMask( const SalTwoRect& rPosAry,
                                       const SalBitmap& rSalBitmap,
                                       SalColor nMaskColor )
 {
-assert( !"Impl" );
+// assert( !"Impl" );
 }
 
 SalBitmap* Kf5Graphics::getBitmap( long nX, long nY, long nWidth, long nHeight )
diff --git a/vcl/unx/kf5/Kf5Instance.cxx b/vcl/unx/kf5/Kf5Instance.cxx
index 3b1a41be69f5..da872c6b83bf 100644
--- a/vcl/unx/kf5/Kf5Instance.cxx
+++ b/vcl/unx/kf5/Kf5Instance.cxx
@@ -57,10 +57,9 @@ Kf5Instance::Kf5Instance( SalYieldMutex* pMutex )
 
 Kf5Instance::~Kf5Instance()
 {
-    for( int i = 0; i < m_nFakeCmdLineArgs; i++ )
-    {
-        free( m_pFreeCmdLineArgs[i] );
-    }
+    m_pQApplication.reset( nullptr );
+    for( int i = 0; i < *m_pFakeArgc; i++ )
+        free( m_pFakeArgvFreeable[i] );
 }
 
 SalFrame* Kf5Instance::CreateChildFrame( SystemParentData* /*pParent*/, SalFrameStyleFlags nStyle )
@@ -204,11 +203,66 @@ extern "C" {
         OString aVersion( qVersion() );
         SAL_INFO( "vcl.kf5", "qt version string is " << aVersion );
 
-        QApplication *pApplication;
-        char **pFreeCmdLineArgs = nullptr;
-        char **pAppCmdLineArgs;
-#if 1
-    KAboutData *kAboutData = new KAboutData( I18N_NOOP("LibreOffice"),
+        QApplication *pQApplication;
+        char **pFakeArgvFreeable = nullptr;
+
+        int nFakeArgc = 2;
+        const sal_uInt32 nParams = osl_getCommandArgCount();
+        OString aDisplay;
+        OUString aParam, aBin;
+
+        for ( sal_uInt32 nIdx = 0; nIdx < nParams; ++nIdx )
+        {
+            osl_getCommandArg( nIdx, &aParam.pData );
+            if ( aParam != "-display" )
+                continue;
+            if ( !pFakeArgvFreeable )
+            {
+                pFakeArgvFreeable = new char*[ nFakeArgc + 2 ];
+                pFakeArgvFreeable[ nFakeArgc++ ] = strdup( "-display" );
+            }
+            else
+                free( pFakeArgvFreeable[ nFakeArgc ] );
+
+            ++nIdx;
+            osl_getCommandArg( nIdx, &aParam.pData );
+            aDisplay = OUStringToOString( aParam, osl_getThreadTextEncoding() );
+            pFakeArgvFreeable[ nFakeArgc ] = strdup( aDisplay.getStr() );
+        }
+        if ( !pFakeArgvFreeable )
+            pFakeArgvFreeable = new char*[ nFakeArgc ];
+        else
+            nFakeArgc++;
+
+        osl_getExecutableFile( &aParam.pData );
+        osl_getSystemPathFromFileURL( aParam.pData, &aBin.pData );
+        OString aExec = OUStringToOString( aBin, osl_getThreadTextEncoding() );
+        pFakeArgvFreeable[ 0 ] = strdup( aExec.getStr() );
+        pFakeArgvFreeable[ 1 ] = strdup( "--nocrashhandler" );
+
+        char **pFakeArgv = new char*[ nFakeArgc ];
+        for( int i = 0; i < nFakeArgc; i++ )
+            pFakeArgv[ i ] = pFakeArgvFreeable[ i ];
+
+        char* session_manager = nullptr;
+        if( getenv( "SESSION_MANAGER" ) != nullptr )
+        {
+            session_manager = strdup( getenv( "SESSION_MANAGER" ));
+            unsetenv( "SESSION_MANAGER" );
+        }
+
+        int * pFakeArgc = new int;
+        *pFakeArgc = nFakeArgc;
+        pQApplication = new QApplication( *pFakeArgc, pFakeArgv );
+
+        if( session_manager != nullptr )
+        {
+            // coverity[tainted_string] - trusted source for setenv
+            setenv( "SESSION_MANAGER", session_manager, 1 );
+            free( session_manager );
+        }
+
+        KAboutData *kAboutData = new KAboutData( I18N_NOOP("LibreOffice"),
             i18n( "LibreOffice" ),
             "6.0.0",
             i18n( "LibreOffice with KF5 Native Widget Support." ),
@@ -218,71 +272,23 @@ extern "C" {
             "http://libreoffice.org",
             QLatin1String("libreoffice at lists.freedesktop.org") );
 
-    kAboutData->addAuthor( i18n( "Jan-Marek Glogowski" ),
+        kAboutData->addAuthor( i18n( "Jan-Marek Glogowski" ),
             i18n( "Original author and maintainer of the KF5 NWF." ),
             "glogow at fbihome.de" );
 
-    KAboutData::setApplicationData( *kAboutData );
-#endif
-    int nFakeCmdLineArgs = 2;
-    const unsigned nParams = osl_getCommandArgCount();
-    OString aDisplay;
-    OUString aParam, aBin;
-
-    for ( unsigned nIdx = 0; nIdx < nParams; ++nIdx )
-    {
-        osl_getCommandArg( nIdx, &aParam.pData );
-        if ( !pFreeCmdLineArgs && aParam == "-display" && nIdx + 1 < nParams )
-        {
-            osl_getCommandArg( nIdx + 1, &aParam.pData );
-            aDisplay = OUStringToOString( aParam, osl_getThreadTextEncoding() );
-
-            pFreeCmdLineArgs = new char*[ nFakeCmdLineArgs + 2 ];
-            pFreeCmdLineArgs[ nFakeCmdLineArgs + 0 ] = strdup( "-display" );
-            pFreeCmdLineArgs[ nFakeCmdLineArgs + 1 ] = strdup( aDisplay.getStr() );
-            nFakeCmdLineArgs += 2;
-        }
-    }
-    if ( !pFreeCmdLineArgs )
-        pFreeCmdLineArgs = new char*[ nFakeCmdLineArgs ];
-
-    osl_getExecutableFile( &aParam.pData );
-    osl_getSystemPathFromFileURL( aParam.pData, &aBin.pData );
-    OString aExec = OUStringToOString( aBin, osl_getThreadTextEncoding() );
-    pFreeCmdLineArgs[0] = strdup( aExec.getStr() );
-    pFreeCmdLineArgs[1] = strdup( "--nocrashhandler" );
-
-    pAppCmdLineArgs = new char*[ nFakeCmdLineArgs ];
-    for( int i = 0; i < nFakeCmdLineArgs; i++ )
-        pAppCmdLineArgs[i] = pFreeCmdLineArgs[i];
-
-    char* session_manager = nullptr;
-    if( getenv( "SESSION_MANAGER" ) != nullptr )
-    {
-        session_manager = strdup( getenv( "SESSION_MANAGER" ));
-        unsetenv( "SESSION_MANAGER" );
-    }
-
-    pApplication = new QApplication( nFakeCmdLineArgs, pAppCmdLineArgs );
-
-    if( session_manager != nullptr )
-    {
-        // coverity[tainted_string] - trusted source for setenv
-        setenv( "SESSION_MANAGER", session_manager, 1 );
-        free( session_manager );
-    }
+        KAboutData::setApplicationData( *kAboutData );
 
-    QApplication::setQuitOnLastWindowClosed(false);
+        QApplication::setQuitOnLastWindowClosed(false);
 
         Kf5Instance* pInstance = new Kf5Instance( new SalYieldMutex() );
 
         // initialize SalData
         new Kf5Data( pInstance );
 
-        pInstance->m_pApplication.reset( pApplication );
-        pInstance->m_pFreeCmdLineArgs.reset( pFreeCmdLineArgs );
-        pInstance->m_pAppCmdLineArgs.reset( pAppCmdLineArgs );
-        pInstance->m_nFakeCmdLineArgs = nFakeCmdLineArgs;
+        pInstance->m_pQApplication.reset( pQApplication );
+        pInstance->m_pFakeArgvFreeable.reset( pFakeArgvFreeable );
+        pInstance->m_pFakeArgv.reset( pFakeArgv );
+        pInstance->m_pFakeArgc.reset( pFakeArgc );
 
         return pInstance;
     }
diff --git a/vcl/unx/kf5/Kf5Instance.hxx b/vcl/unx/kf5/Kf5Instance.hxx
index 1aa0d2d30b44..98cfa31c1579 100644
--- a/vcl/unx/kf5/Kf5Instance.hxx
+++ b/vcl/unx/kf5/Kf5Instance.hxx
@@ -41,10 +41,10 @@ class Kf5Instance
     int m_postUserEventId;
 
 public:
-    std::unique_ptr<QApplication> m_pApplication;
-    std::unique_ptr<char*[]> m_pFreeCmdLineArgs;
-    std::unique_ptr<char*[]> m_pAppCmdLineArgs;
-    int m_nFakeCmdLineArgs;
+    std::unique_ptr< QApplication > m_pQApplication;
+    std::unique_ptr< char*[] >      m_pFakeArgvFreeable;
+    std::unique_ptr< char*[] >      m_pFakeArgv;
+    std::unique_ptr< int >          m_pFakeArgc;
 
 private Q_SLOTS:
     bool ImplYield( bool bWait, bool bHandleAllCurrentEvents );
diff --git a/vcl/unx/kf5/Kf5Tools.hxx b/vcl/unx/kf5/Kf5Tools.hxx
index 8d10cd84360e..40c34d9d4303 100644
--- a/vcl/unx/kf5/Kf5Tools.hxx
+++ b/vcl/unx/kf5/Kf5Tools.hxx
@@ -61,7 +61,7 @@ inline QImage::Format getBitFormat( sal_uInt16 nBitCount )
     {
     case 1  : return QImage::Format_Mono;
     case 8  : return QImage::Format_Indexed8;
-    case 16 : return QImage::Format_RGB555;
+    case 16 : return QImage::Format_RGB16;
     case 24 : return QImage::Format_RGB888;
     case 32 : return QImage::Format_ARGB32;
     default :
@@ -77,10 +77,11 @@ inline sal_uInt16 getFormatBits( QImage::Format eFormat )
     {
         case QImage::Format_Mono : return 1;
         case QImage::Format_Indexed8 : return 8;
-        case QImage::Format_RGB555 : return 16;
+        case QImage::Format_RGB16 : return 16;
         case QImage::Format_RGB888 : return 24;
         case QImage::Format_ARGB32 : return 32;
-        default:
+        default :
+            std::abort();
             return 0;
     }
 }
diff --git a/vcl/unx/kf5/Kf5Widget.cxx b/vcl/unx/kf5/Kf5Widget.cxx
index 0394c9fc2653..59f2d963a581 100644
--- a/vcl/unx/kf5/Kf5Widget.cxx
+++ b/vcl/unx/kf5/Kf5Widget.cxx
@@ -33,6 +33,7 @@ Kf5Widget::Kf5Widget( Kf5Frame &rFrame, QWidget *parent, Qt::WindowFlags f )
     , m_pFrame( &rFrame )
     , m_pObject( nullptr )
 {
+    create();
 }
 
 Kf5Widget::Kf5Widget( Kf5Object &rObject, QWidget *parent, Qt::WindowFlags f )


More information about the Libreoffice-commits mailing list