[Libreoffice-commits] core.git: 9 commits - config_host/config_kde4.h.in config_host.mk.in configure.ac connectivity/source include/cppuhelper include/unotools shell/source sw/inc sw/qa sw/source unotools/source vcl/CustomTarget_tde_moc.mk vcl/inc vcl/Library_vclplug_kde4.mk vcl/source vcl/unx

Jan-Marek Glogowski glogow at fbihome.de
Fri Sep 23 21:29:20 UTC 2016


 config_host.mk.in                                      |   10 
 config_host/config_kde4.h.in                           |    2 
 configure.ac                                           |  140 ++++++-------
 connectivity/source/drivers/kab/KColumns.cxx           |    2 
 connectivity/source/drivers/kab/KConnection.cxx        |   16 -
 connectivity/source/drivers/kab/KConnection.hxx        |    2 
 connectivity/source/drivers/kab/KDEInit.cxx            |   10 
 connectivity/source/drivers/kab/KDatabaseMetaData.cxx  |  180 ++++++++---------
 connectivity/source/drivers/kab/KDatabaseMetaData.hxx  |    5 
 connectivity/source/drivers/kab/KDriver.cxx            |   30 +-
 connectivity/source/drivers/kab/KDriver.hxx            |    4 
 connectivity/source/drivers/kab/KPreparedStatement.cxx |   46 ++--
 connectivity/source/drivers/kab/KPreparedStatement.hxx |    2 
 connectivity/source/drivers/kab/KResultSet.cxx         |  100 ++++-----
 connectivity/source/drivers/kab/KResultSet.hxx         |    4 
 connectivity/source/drivers/kab/KResultSetMetaData.cxx |   20 -
 connectivity/source/drivers/kab/KResultSetMetaData.hxx |    2 
 connectivity/source/drivers/kab/KServices.cxx          |    4 
 connectivity/source/drivers/kab/KStatement.cxx         |   20 -
 connectivity/source/drivers/kab/KStatement.hxx         |    4 
 connectivity/source/drivers/kab/KTable.cxx             |   28 +-
 connectivity/source/drivers/kab/KTable.hxx             |   14 -
 connectivity/source/drivers/kab/KTables.cxx            |    2 
 connectivity/source/drivers/kab/kcondition.cxx         |    4 
 connectivity/source/drivers/kab/kcondition.hxx         |    2 
 connectivity/source/drivers/kab/kfields.cxx            |    2 
 connectivity/source/drivers/kab/korder.hxx             |    2 
 include/cppuhelper/implbase.hxx                        |   22 +-
 include/unotools/tempfile.hxx                          |    5 
 shell/source/backends/kdebe/kdebackend.cxx             |   11 -
 sw/inc/IDocumentFieldsAccess.hxx                       |    2 
 sw/qa/extras/mailmerge/data/10-testing-addresses.ods   |binary
 sw/qa/extras/mailmerge/mailmerge.cxx                   |   71 +++++-
 sw/source/core/doc/DocumentFieldsManager.cxx           |   33 +++
 sw/source/core/inc/DocumentFieldsManager.hxx           |    1 
 sw/source/uibase/dbui/dbmgr.cxx                        |   87 +++++---
 unotools/source/ucbhelper/tempfile.cxx                 |   42 +++
 vcl/CustomTarget_tde_moc.mk                            |    2 
 vcl/Library_vclplug_kde4.mk                            |    6 
 vcl/inc/unx/kde/kdedata.hxx                            |   23 +-
 vcl/inc/unx/saldisp.hxx                                |   17 +
 vcl/inc/unx/salinst.h                                  |    5 
 vcl/source/opengl/OpenGLHelper.cxx                     |    7 
 vcl/unx/generic/app/saldata.cxx                        |   24 +-
 vcl/unx/generic/app/saldisp.cxx                        |   34 +--
 vcl/unx/generic/app/salinst.cxx                        |   17 +
 vcl/unx/kde/UnxCommandThread.hxx                       |    2 
 vcl/unx/kde/UnxFilePicker.cxx                          |   37 +--
 vcl/unx/kde/UnxFilePicker.hxx                          |    2 
 vcl/unx/kde/fpicker/kdecommandthread.cxx               |    4 
 vcl/unx/kde/fpicker/kdecommandthread.hxx               |    2 
 vcl/unx/kde/fpicker/kdefilepicker.cxx                  |   18 -
 vcl/unx/kde/fpicker/kdefilepicker.hxx                  |    2 
 vcl/unx/kde/fpicker/kdefpmain.cxx                      |    2 
 vcl/unx/kde/fpicker/kdemodalityfilter.cxx              |    2 
 vcl/unx/kde/fpicker/kdemodalityfilter.hxx              |    2 
 vcl/unx/kde/kdedata.cxx                                |   15 -
 vcl/unx/kde/salnativewidgets-kde.cxx                   |  164 ++++++++-------
 vcl/unx/kde4/KDESalInstance.cxx                        |    8 
 vcl/unx/kde4/KDESalInstance.hxx                        |    3 
 vcl/unx/kde4/KDEXLib.cxx                               |   20 -
 61 files changed, 757 insertions(+), 592 deletions(-)

New commits:
commit c540ae79e0916479bc92b2659ff834adcad34041
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Mon Sep 5 15:37:36 2016 +0200

    MM don't crash on canceled SHELL documents
    
    We show canceled documents, as long as there wasn't an error.
    
    Change-Id: I821f89bc9355df5b2223876ad52fee2a717e670a

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 86e2d7e..a9a6da8 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1589,14 +1589,15 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
             lcl_PreparePrinterOptions( rMergeDescriptor.aPrintOptions, true, aOptions );
             pTargetView->ExecPrint( aOptions, bIsMergeSilent, false/*bPrintAsync*/ );
         }
-
-        if( IsMergeOk() && bMT_SHELL )
-            // leave docshell available for caller (e.g. MM wizard)
-            rMergeDescriptor.pMailMergeConfigItem->SetTargetView( pTargetView );
-        else
-            xTargetDocShell->DoClose();
     }
 
+    // we also show canceled documents, as long as there was no error
+    if( !IsMergeError() && bMT_SHELL )
+        // leave docshell available for caller (e.g. MM wizard)
+        rMergeDescriptor.pMailMergeConfigItem->SetTargetView( pTargetView );
+    else if( xTargetDocShell )
+        xTargetDocShell->DoClose();
+
     rescheduleGui();
 
     pProgressDlg.disposeAndClear();
commit 3c4dfb872d50413b605fb846dfdebd28947026e8
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Tue Aug 30 13:42:20 2016 +0200

    tdf#94987 Create directories for temp filenames
    
    Per default a temporary file is construted from a path and a leading
    pattern for the filename. For mail merge the filename can be read
    from a database column. If the path is not existing, a temporary
    directory is created.
    
    Normally the temp file function would fail, if the filename contains
    a slash and the sub-directory of the filename doesn't exists as a
    subdirectory of path.
    
    To implement tdf#94987, this adds an option to the temp file class
    to create the parent directories of the filename pattern.
    
    Change-Id: I02bf34294dac85598ee153d8cfcf00bc5d7775af

diff --git a/include/unotools/tempfile.hxx b/include/unotools/tempfile.hxx
index 4b8bff8..edb9c9f 100644
--- a/include/unotools/tempfile.hxx
+++ b/include/unotools/tempfile.hxx
@@ -66,8 +66,11 @@ public:
                     rLeadingChars="abc" means "abc0","abc1" and so on, depending on existing files in the folder ).
                     The extension string may be f.e. ".txt" or "", if no extension string is given, ".tmp" is used
                         @param  _bStartWithZero If set to false names will be generated like "abc","abc0","abc1"
+                        @param  bCreateParentDirs If rLeadingChars contains a slash, this will create the required
+                                parent directories.
                     */
-                    TempFile( const OUString& rLeadingChars, bool _bStartWithZero=true, const OUString* pExtension=nullptr, const OUString* pParent=nullptr);
+                    TempFile( const OUString& rLeadingChars, bool _bStartWithZero=true, const OUString* pExtension=nullptr,
+                              const OUString* pParent=nullptr, bool bCreateParentDirs=false );
 
                     /**
                     TempFile will be removed from disk in dtor if EnableKillingFile(true) was called before.
diff --git a/sw/qa/extras/mailmerge/data/10-testing-addresses.ods b/sw/qa/extras/mailmerge/data/10-testing-addresses.ods
index 33b82e6..6792da4 100644
Binary files a/sw/qa/extras/mailmerge/data/10-testing-addresses.ods and b/sw/qa/extras/mailmerge/data/10-testing-addresses.ods differ
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx
index 36009a1..bb4ec55 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -70,7 +70,8 @@ public:
      * The 'verify' method actually has to execute the mail merge by
      * calling executeMailMerge() after modifying the job arguments.
      */
-    void executeMailMergeTest(const char* filename, const char* datasource, const char* tablename, bool file, int selection)
+    void executeMailMergeTest( const char* filename, const char* datasource, const char* tablename,
+                               bool file, int selection, const char* column )
     {
         maMMtestFilename = filename;
         header();
@@ -79,8 +80,9 @@ public:
         utl::TempFile aTempDir(nullptr, true);
         const OUString aWorkDir = aTempDir.GetURL();
         const OUString aURI( m_directories.getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(datasource) );
-        OUString aDBName = registerDBsource( aURI, aWorkDir );
-        initMailMergeJobAndArgs( filename, tablename, aDBName, "LOMM_", aWorkDir, file, selection );
+        const OUString aPrefix = column ? OUString::createFromAscii( column ) : "LOMM_";
+        const OUString aDBName = registerDBsource( aURI, aWorkDir );
+        initMailMergeJobAndArgs( filename, tablename, aDBName, aPrefix, aWorkDir, file, selection, column != nullptr );
 
         verify();
         finish();
@@ -130,7 +132,8 @@ public:
     }
 
     void initMailMergeJobAndArgs( const char* filename, const char* tablename, const OUString &aDBName,
-                                  const OUString &aPrefix, const OUString &aWorkDir, bool file, int nDataSets )
+                                  const OUString &aPrefix, const OUString &aWorkDir, bool file, int nDataSets,
+                                  const bool bPrefixIsColumn )
     {
         uno::Reference< task::XJob > xJob( getMultiServiceFactory()->createInstance( "com.sun.star.text.MailMerge" ), uno::UNO_QUERY_THROW );
         mxJob.set( xJob );
@@ -144,6 +147,9 @@ public:
         args.push_back( beans::NamedValue( OUString( UNO_NAME_OUTPUT_URL ), uno::Any( aWorkDir ) ) );
         args.push_back( beans::NamedValue( OUString( UNO_NAME_FILE_NAME_PREFIX ), uno::Any( aPrefix )) );
 
+        if (bPrefixIsColumn)
+            args.push_back( beans::NamedValue( OUString( UNO_NAME_FILE_NAME_FROM_COLUMN ), uno::Any( true ) ) );
+
         if (tablename)
         {
             args.push_back( beans::NamedValue( OUString( UNO_NAME_DAD_COMMAND_TYPE ), uno::Any( sdb::CommandType::TABLE ) ) );
@@ -174,6 +180,7 @@ public:
 
         const beans::NamedValue *pArguments = mSeqMailMergeArgs.getConstArray();
         bool bOk = true;
+        bool bMMFilenameFromColumn = false;
         sal_Int32 nArgs = mSeqMailMergeArgs.getLength();
 
         for (sal_Int32 i = 0; i < nArgs; ++i) {
@@ -187,6 +194,8 @@ public:
                 bOk &= rValue >>= mailMergeOutputPrefix;
             else if (rName == UNO_NAME_OUTPUT_TYPE)
                 bOk &= rValue >>= mnCurOutputType;
+            else if (rName == UNO_NAME_FILE_NAME_FROM_COLUMN)
+                bOk &= rValue >>= bMMFilenameFromColumn;
         }
 
         CPPUNIT_ASSERT(bOk);
@@ -205,7 +214,8 @@ public:
         else
         {
             CPPUNIT_ASSERT(res == true);
-            loadMailMergeDocument( 0 );
+            if( !bMMFilenameFromColumn )
+                loadMailMergeDocument( 0 );
         }
     }
 
@@ -221,26 +231,31 @@ public:
         return parseExportInternal( mailMergeOutputURL + "/" + name, rStreamName );
     }
 
-    /**
-     Loads number-th document from mail merge. Requires file output from mail merge.
-    */
-    void loadMailMergeDocument( int number )
+    void loadMailMergeDocument( const OUString &filename )
     {
         assert( mnCurOutputType == text::MailMergeType::FILE );
         if (mxComponent.is())
             mxComponent->dispose();
-        OUString name = mailMergeOutputPrefix + OUString::number( number ) + ".odt";
         // Output name early, so in the case of a hang, the name of the hanging input file is visible.
-        std::cout << name << ",";
+        std::cout << filename << ",";
         mnStartTime = osl_getGlobalTimer();
-        mxComponent = loadFromDesktop(mailMergeOutputURL + "/" + name, "com.sun.star.text.TextDocument");
+        mxComponent = loadFromDesktop(mailMergeOutputURL + "/" + filename, "com.sun.star.text.TextDocument");
         CPPUNIT_ASSERT( mxComponent.is());
-        OString name2 = OUStringToOString( name, RTL_TEXTENCODING_UTF8 );
+        OString name2 = OUStringToOString( filename, RTL_TEXTENCODING_UTF8 );
         discardDumpedLayout();
         if (mustCalcLayoutOf(name2.getStr()))
             calcLayout();
     }
 
+    /**
+     Loads number-th document from mail merge. Requires file output from mail merge.
+    */
+    void loadMailMergeDocument( int number )
+    {
+        OUString name = mailMergeOutputPrefix + OUString::number( number ) + ".odt";
+        loadMailMergeDocument( name );
+    }
+
 protected:
     // Returns page number of the first page of a MM document inside the large MM document (used in the SHELL case).
     int documentStartPageNumber( int document ) const;
@@ -254,7 +269,7 @@ protected:
     const char* maMMtestFilename;
 };
 
-#define DECLARE_MAILMERGE_TEST(TestName, filename, datasource, tablename, file, BaseClass, selection) \
+#define DECLARE_MAILMERGE_TEST(TestName, filename, datasource, tablename, file, BaseClass, selection, column) \
     class TestName : public BaseClass { \
     protected: \
         virtual OUString getTestName() override { return OUString(#TestName); } \
@@ -264,7 +279,7 @@ protected:
         CPPUNIT_TEST_SUITE_END(); \
     \
         void MailMerge() { \
-            executeMailMergeTest(filename, datasource, tablename, file, selection); \
+            executeMailMergeTest(filename, datasource, tablename, file, selection, column); \
         } \
         void verify() override; \
     }; \
@@ -273,14 +288,17 @@ protected:
 
 // Will generate the resulting document in mxMMDocument.
 #define DECLARE_SHELL_MAILMERGE_TEST(TestName, filename, datasource, tablename) \
-    DECLARE_MAILMERGE_TEST(TestName, filename, datasource, tablename, false, MMTest, 0)
+    DECLARE_MAILMERGE_TEST(TestName, filename, datasource, tablename, false, MMTest, 0, nullptr)
 
 // Will generate documents as files, use loadMailMergeDocument().
 #define DECLARE_FILE_MAILMERGE_TEST(TestName, filename, datasource, tablename) \
-    DECLARE_MAILMERGE_TEST(TestName, filename, datasource, tablename, true, MMTest, 0)
+    DECLARE_MAILMERGE_TEST(TestName, filename, datasource, tablename, true, MMTest, 0, nullptr)
 
 #define DECLARE_SHELL_MAILMERGE_TEST_SELECTION(TestName, filename, datasource, tablename, selection) \
-    DECLARE_MAILMERGE_TEST(TestName, filename, datasource, tablename, false, MMTest, selection)
+    DECLARE_MAILMERGE_TEST(TestName, filename, datasource, tablename, false, MMTest, selection, nullptr)
+
+#define DECLARE_FILE_MAILMERGE_TEST_COLUMN(TestName, filename, datasource, tablename, column) \
+    DECLARE_MAILMERGE_TEST(TestName, filename, datasource, tablename, true, MMTest, 0, column)
 
 int MMTest::documentStartPageNumber( int document ) const
 {   // See documentStartPageNumber() .
@@ -568,5 +586,22 @@ DECLARE_SHELL_MAILMERGE_TEST(test_sections_first_last, "sections_first_last.odt"
     }
 }
 
+DECLARE_FILE_MAILMERGE_TEST_COLUMN(testDirMailMerge, "simple-mail-merge.odt", "10-testing-addresses.ods", "testing-addresses", "Filename")
+{
+    executeMailMerge();
+    for( int doc = 1;
+         doc <= 10;
+         ++doc )
+    {
+        OUString filename = "sub/lastname" + OUString::number( doc )
+                          + " firstname" + OUString::number( doc ) + ".odt";
+        loadMailMergeDocument( filename );
+        CPPUNIT_ASSERT_EQUAL( 1, getPages());
+        CPPUNIT_ASSERT_EQUAL( OUString( "Fixed text." ), getRun( getParagraph( 1 ), 1 )->getString());
+        CPPUNIT_ASSERT_EQUAL( OUString( "lastname" + OUString::number( doc )), getRun( getParagraph( 2 ), 1 )->getString());
+        CPPUNIT_ASSERT_EQUAL( OUString( "Another fixed text." ), getRun( getParagraph( 3 ), 1 )->getString());
+    }
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index ff90ea6..86e2d7e 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1314,7 +1314,6 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
     {
         nStartRow = pImpl->pMergeData ? pImpl->pMergeData->xResultSet->getRow() : 0;
 
-        OUString sPath = rMergeDescriptor.sPath;
         OUString sColumnData;
 
         // Read the indicated data column, which should contain a valid mail
@@ -1322,28 +1321,32 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
         if( bMT_EMAIL || bColumnName )
         {
             sColumnData = GetDBField( xColumnProp, aColumnDBFormat );
-            if( !bMT_EMAIL )
-            {
-                if (sColumnData.isEmpty())
-                    sColumnData = "_";
-                sPath += sColumnData;
-            }
         }
 
         // create a new temporary file name - only done once in case of bCreateSingleFile
         if( bNeedsTempFiles && ( !bWorkDocInitialized || !bCreateSingleFile ))
         {
-            INetURLObject aEntry(sPath);
+            OUString sPath = rMergeDescriptor.sPath;
             OUString sLeading;
+
             //#i97667# if the name is from a database field then it will be used _as is_
-            if( !sColumnData.isEmpty() )
-                sLeading = sColumnData;
+            if( bColumnName && !bMT_EMAIL )
+            {
+                if (!sColumnData.isEmpty())
+                    sLeading = sColumnData;
+                else
+                    sLeading = "_";
+            }
             else
+            {
+                INetURLObject aEntry( sPath );
                 sLeading = aEntry.GetBase();
-            aEntry.removeSegment();
-            sPath = aEntry.GetMainURL( INetURLObject::NO_DECODE );
+                aEntry.removeSegment();
+                sPath = aEntry.GetMainURL( INetURLObject::NO_DECODE );
+            }
+
             OUString sExt(comphelper::string::stripStart(pStoreToFilter->GetDefaultExtension(), '*'));
-            aTempFile.reset( new utl::TempFile(sLeading, sColumnData.isEmpty(), &sExt, &sPath) );
+            aTempFile.reset( new utl::TempFile(sLeading, sColumnData.isEmpty(), &sExt, &sPath, true) );
             if( !aTempFile->IsValid() )
             {
                 ErrorHandler::HandleError( ERRCODE_IO_NOTSUPPORTED );
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx
index dcc4068..fa2cbf5 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -225,11 +225,39 @@ private:
 
 sal_uInt32 UniqueTokens::globalValue = SAL_MAX_UINT32;
 
+namespace
+{
+    class TempDirCreatedObserver : public DirectoryCreationObserver
+    {
+    public:
+        virtual void DirectoryCreated(const rtl::OUString& aDirectoryUrl) override
+        {
+            File::setAttributes( aDirectoryUrl, osl_File_Attribute_OwnRead |
+                osl_File_Attribute_OwnWrite | osl_File_Attribute_OwnExe );
+        };
+    };
+};
+
 OUString lcl_createName(
     const OUString& rLeadingChars, Tokens & tokens, const OUString* pExtension,
-    const OUString* pParent, bool bDirectory, bool bKeep, bool bLock)
+    const OUString* pParent, bool bDirectory, bool bKeep, bool bLock,
+    bool bCreateParentDirs )
 {
-    OUString aName = ConstructTempDir_Impl( pParent ) + rLeadingChars;
+    OUString aName = ConstructTempDir_Impl( pParent );
+    if ( bCreateParentDirs )
+    {
+        sal_Int32 nOffset = rLeadingChars.lastIndexOf("/");
+        if (-1 != nOffset)
+        {
+            OUString aDirName = aName + OUString( rLeadingChars.getStr(), nOffset );
+            TempDirCreatedObserver observer;
+            FileBase::RC err = Directory::createPath( aDirName, &observer );
+            if ( err != FileBase::E_None && err != FileBase::E_EXIST )
+                return OUString();
+        }
+    }
+    aName += rLeadingChars;
+
     OUString token;
     while (tokens.next(&token))
     {
@@ -306,7 +334,8 @@ OUString CreateTempName_Impl( const OUString* pParent, bool bKeep, bool bDir = t
     aEyeCatcher += aPidString;
 #endif
     UniqueTokens t;
-    return lcl_createName(aEyeCatcher, t, nullptr, pParent, bDir, bKeep, false);
+    return lcl_createName( aEyeCatcher, t, nullptr, pParent, bDir, bKeep,
+                           false, false);
 }
 
 OUString TempFile::CreateTempName()
@@ -328,13 +357,16 @@ TempFile::TempFile( const OUString* pParent, bool bDirectory )
     aName = CreateTempName_Impl( pParent, true, bDirectory );
 }
 
-TempFile::TempFile( const OUString& rLeadingChars, bool _bStartWithZero, const OUString* pExtension, const OUString* pParent)
+TempFile::TempFile( const OUString& rLeadingChars, bool _bStartWithZero,
+                    const OUString* pExtension, const OUString* pParent,
+                    bool bCreateParentDirs )
     : pStream( nullptr )
     , bIsDirectory( false )
     , bKillingFileEnabled( false )
 {
     SequentialTokens t(_bStartWithZero);
-    aName = lcl_createName(rLeadingChars, t, pExtension, pParent, false/*bDirectory*/, true, true);
+    aName = lcl_createName( rLeadingChars, t, pExtension, pParent, false,
+                            true, true, bCreateParentDirs );
 }
 
 TempFile::~TempFile()
commit 260cd3aeea2d02507dd131ee2028c4f48f7562f8
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Thu Sep 1 20:37:51 2016 +0200

    MM account next record fields for progress dialog
    
    When calculating the maximum document count, we were not accounting
    "next record" fields in the document, like in labels etc.
    
    Also any selection of records was ignored.
    
    Fixes accounting part of tdf#101841.
    
    Change-Id: I703d2186d44d2e5426c4af0d4b2d89e0fe820039

diff --git a/sw/inc/IDocumentFieldsAccess.hxx b/sw/inc/IDocumentFieldsAccess.hxx
index f73e51c..83d65b5 100644
--- a/sw/inc/IDocumentFieldsAccess.hxx
+++ b/sw/inc/IDocumentFieldsAccess.hxx
@@ -130,6 +130,8 @@ namespace com { namespace sun { namespace star { namespace uno { class Any; } }
 
     virtual void InsDelFieldInFieldLst(bool bIns, const SwTextField& rField) = 0;
 
+    virtual sal_Int32 GetRecordsPerDocument() const = 0;
+
 protected:
     virtual ~IDocumentFieldsAccess() {};
  };
diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx
index c406231..49fef17 100644
--- a/sw/source/core/doc/DocumentFieldsManager.cxx
+++ b/sw/source/core/doc/DocumentFieldsManager.cxx
@@ -911,7 +911,6 @@ void DocumentFieldsManager::UpdateExpFields( SwTextField* pUpdateField, bool bUp
         SwSection* pSect = const_cast<SwSection*>((*it)->GetSection());
         if( pSect )
         {
-
             SwSbxValue aValue = aCalc.Calculate(
                                         pSect->GetCondition() );
             if(!aValue.IsVoidValue())
@@ -1184,6 +1183,38 @@ void DocumentFieldsManager::UpdateUsrFields()
     }
 }
 
+sal_Int32 DocumentFieldsManager::GetRecordsPerDocument() const
+{
+    sal_Int32 nRecords = 1;
+
+    mpUpdateFields->MakeFieldList( m_rDoc, true, GETFLD_ALL );
+    if( mpUpdateFields->GetSortLst()->empty() )
+        return nRecords;
+
+    for( SetGetExpFields::const_iterator it = mpUpdateFields->GetSortLst()->begin();
+        it != mpUpdateFields->GetSortLst()->end(); ++it )
+    {
+        const SwTextField *pTextField = (*it)->GetTextField();
+        if( !pTextField )
+            continue;
+
+        const SwFormatField &pFormatField = pTextField->GetFormatField();
+        const SwField* pField = pFormatField.GetField();
+
+        switch( pField->GetTyp()->Which() )
+        {
+        case RES_DBNEXTSETFLD:
+        case RES_DBNUMSETFLD:
+            nRecords++;
+            break;
+        default:
+            break;
+        }
+    }
+
+    return nRecords;
+}
+
 void DocumentFieldsManager::UpdatePageFields( SfxPoolItem* pMsgHint )
 {
     for( SwFieldTypes::size_type i = 0; i < INIT_FLDTYPES; ++i )
diff --git a/sw/source/core/inc/DocumentFieldsManager.hxx b/sw/source/core/inc/DocumentFieldsManager.hxx
index 260cb8b..fb1ad7c 100644
--- a/sw/source/core/inc/DocumentFieldsManager.hxx
+++ b/sw/source/core/inc/DocumentFieldsManager.hxx
@@ -60,6 +60,7 @@ public:
     virtual bool IsNewFieldLst() const override;
     virtual void SetNewFieldLst( bool bFlag) override;
     virtual void InsDelFieldInFieldLst(bool bIns, const SwTextField& rField) override;
+    virtual sal_Int32 GetRecordsPerDocument() const override;
 
     //Non Interface methods
 
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 238f62d..ff90ea6 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -178,10 +178,14 @@ static SfxObjectShell* lcl_CreateWorkingDocument(
     SwDBManager** const pDBManager,
     SwView** const pView, SwWrtShell** const pWrtShell, SwDoc** const pDoc );
 
-static bool lcl_getCountFromResultSet( sal_Int32& rCount, const uno::Reference<sdbc::XResultSet>& xResultSet )
+static bool lcl_getCountFromResultSet( sal_Int32& rCount, const SwDSParam* pParam )
 {
-    uno::Reference<beans::XPropertySet> xPrSet(xResultSet, uno::UNO_QUERY);
-    if(xPrSet.is())
+    rCount = pParam->aSelection.getLength();
+    if ( rCount > 0 )
+        return true;
+
+    uno::Reference<beans::XPropertySet> xPrSet(pParam->xResultSet, uno::UNO_QUERY);
+    if ( xPrSet.is() )
     {
         try
         {
@@ -190,8 +194,8 @@ static bool lcl_getCountFromResultSet( sal_Int32& rCount, const uno::Reference<s
             aFinal >>= bFinal;
             if(!bFinal)
             {
-                xResultSet->last();
-                xResultSet->first();
+                pParam->xResultSet->last();
+                pParam->xResultSet->first();
             }
             uno::Any aCount = xPrSet->getPropertyValue("RowCount");
             if( aCount >>= rCount )
@@ -1264,16 +1268,33 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
     }
 
     sal_Int32 nDocNo = 1;
-    sal_Int32 nDocCount = 0;
+
     // For single file mode, the number of pages in the target document so far, which is used
     // by AppendDoc() to adjust position of page-bound objects. Getting this information directly
     // from the target doc would require repeated layouts of the doc, which is expensive, but
     // it can be manually computed from the source documents (for which we do layouts, so the page
     // count is known, and there is a blank page between each of them in the target document).
     int targetDocPageCount = 0;
-    if( !bIsMergeSilent && !bMT_PRINTER &&
-            lcl_getCountFromResultSet( nDocCount, pImpl->pMergeData->xResultSet ) )
-        static_cast<CreateMonitor*>( pProgressDlg.get() )->SetTotalCount( nDocCount );
+
+    if( !bIsMergeSilent && !bMT_PRINTER )
+    {
+        sal_Int32 nRecordCount = 1;
+        lcl_getCountFromResultSet( nRecordCount, pImpl->pMergeData );
+
+        // syncronized docs don't auto-advance the record set, but there is a
+        // "security" check, which will always advance the record set, if there
+        // is no "next record" field in a synchronized doc => nRecordPerDoc > 0
+        sal_Int32 nRecordPerDoc = pSourceShell->GetDoc()
+                ->getIDocumentFieldsAccess().GetRecordsPerDocument();
+        if ( bSynchronizedDoc && (nRecordPerDoc > 1) )
+            --nRecordPerDoc;
+        assert( nRecordPerDoc > 0 );
+
+        sal_Int32 nMaxDocs = nRecordCount / nRecordPerDoc;
+        if ( 0 != nRecordCount % nRecordPerDoc )
+            nMaxDocs += 1;
+        static_cast<CreateMonitor*>( pProgressDlg.get() )->SetTotalCount( nMaxDocs );
+    }
 
     long nStartRow, nEndRow;
     bool bFreezedLayouts = false;
commit 178a23a827f16e046e5d5efb2aa2aa3fc990452a
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Thu Sep 1 20:35:51 2016 +0200

    MM just increment after a successful next record
    
    This correctly counts the record id from 1, while using 0
    for the first item in the selection array.
    
    Change-Id: I363eab048cb041bf46454ef685baab1eb3b2138a

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 077d4e6..238f62d 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -2178,7 +2178,7 @@ static bool lcl_ToNextRecord( SwDSParam* pParam, const SwDBNextRecord action )
             else
             {
                 sal_Int32 nPos = 0;
-                pParam->aSelection.getConstArray()[ pParam->nSelectionIndex++ ] >>= nPos;
+                pParam->aSelection.getConstArray()[ pParam->nSelectionIndex ] >>= nPos;
                 pParam->bEndOfDB = !pParam->xResultSet->absolute( nPos );
             }
         }
@@ -2193,11 +2193,11 @@ static bool lcl_ToNextRecord( SwDSParam* pParam, const SwDBNextRecord action )
             if( !pParam->bEndOfDB && nBefore == pParam->xResultSet->getRow() )
             {
                 // next returned true but it didn't move
-                pParam->bEndOfDB = true;
+                ::dbtools::throwFunctionSequenceException( pParam->xResultSet );
             }
-            ++pParam->nSelectionIndex;
         }
 
+        ++pParam->nSelectionIndex;
         bRet = !pParam->bEndOfDB;
     }
     catch( const uno::Exception &e )
commit 971947b38d1dbc6213e55403cf482a530cd9b449
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Thu Sep 1 12:21:08 2016 +0200

    tdf#101822 Revert "vcl: Stop-gap solution to ...
    
    ... start the gen / kde / kde4 plugins again."
    
    The patch was just hiding the real bug and introducing others,
    Ihe original bug is now fixed in all the X11 based VCL plugins,
    so it can be reverted.
    
    This reverts commit 37800290245fd0462295a8bbaabd9d761929fa65.
    
    Conflicts:
    	vcl/unx/generic/app/saldisp.cxx
    
    Change-Id: I95bea07e29293aaab178e30b5fb3cfe089d2d28f

diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 2f21308..ed1fb53 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -77,7 +77,6 @@
 #include <memory>
 #include <vector>
 
-#include <com/sun/star/uno/DeploymentException.hpp>
 #include <officecfg/Office/Common.hxx>
 
 /* From <X11/Intrinsic.h> */
@@ -223,15 +222,9 @@ bool SalDisplay::BestVisual( Display     *pDisplay,
     if( nVID && sal_GetVisualInfo( pDisplay, nVID, rVI ) )
         return rVI.visualid == nDefVID;
 
-    try {
-        bool bUseOpenGL = OpenGLHelper::isVCLOpenGLEnabled();
-        if (bUseOpenGL && BestOpenGLVisual(pDisplay, nScreen, rVI))
-            return rVI.visualid == nDefVID;
-    }
-    catch (const css::uno::DeploymentException&)
-    {
-        // too early to try to access configmgr
-    }
+    bool bUseOpenGL = OpenGLHelper::isVCLOpenGLEnabled();
+    if (bUseOpenGL && BestOpenGLVisual(pDisplay, nScreen, rVI))
+        return rVI.visualid == nDefVID;
 
     XVisualInfo aVI;
     aVI.screen = nScreen;
commit 06283e7b00f9f7b7ad1a3e30d2dcb85c8d550588
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Thu Sep 1 14:32:01 2016 +0200

    tdf#101822 X11 SalDisplay init => AfterAppInit
    
    This fixes all X11 based VCL plugins to move display
    initialization  into AfterAppInit (gen, TDE, KDE4),
    
    This is done by moving input method and display into
    SalXLib, so they are available in AfterAppInit.
    
    Otherwise the configmgr service won't be available in
    SalDisplay::BestVisual.
    
    Change-Id: I9380075b9770bceb8f453bbcb7fe31291634ff89

diff --git a/vcl/inc/unx/kde/kdedata.hxx b/vcl/inc/unx/kde/kdedata.hxx
index 025e0f9..cc238dc 100644
--- a/vcl/inc/unx/kde/kdedata.hxx
+++ b/vcl/inc/unx/kde/kdedata.hxx
@@ -71,6 +71,9 @@ public:
 
 class KDESalInstance : public X11SalInstance
 {
+protected:
+    virtual SalX11Display* CreateDisplay() const override;
+
 public:
     KDESalInstance( SalYieldMutex* pMutex )
             : X11SalInstance( pMutex ) {}
diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx
index 7be3df6..ee651b6 100644
--- a/vcl/inc/unx/saldisp.hxx
+++ b/vcl/inc/unx/saldisp.hxx
@@ -143,6 +143,8 @@ public:
     SalColor        GetColor( Pixel nPixel ) const;
 };
 
+class SalI18N_InputMethod;
+
 typedef int(*YieldFunc)(int fd, void* data);
 
 class VCLPLUG_GEN_PUBLIC SalXLib
@@ -157,6 +159,9 @@ protected:
     fd_set          aReadFDS_;
     fd_set          aExceptionFDS_;
 
+    Display             *m_pDisplay;
+    SalI18N_InputMethod *m_pInputMethod;
+
 public:
     SalXLib();
     virtual         ~SalXLib();
@@ -176,9 +181,12 @@ public:
     virtual void    StopTimer();
 
     bool            CheckTimeout( bool bExecuteTimers = true );
+
+    SalI18N_InputMethod* GetInputMethod() const { return m_pInputMethod; }
+    void                 SetInputMethod( SalI18N_InputMethod *pInputMethod );
+    Display*             GetDisplay() const { return m_pDisplay; }
 };
 
-class SalI18N_InputMethod;
 class SalI18N_KeyboardExtension;
 class AttributeProvider;
 
@@ -251,7 +259,6 @@ public:
 
 protected:
     SalXLib        *pXLib_;
-    SalI18N_InputMethod         *mpInputMethod;
     SalI18N_KeyboardExtension   *mpKbdExtension;
 
     AttributeProvider           *mpFactory;
@@ -359,10 +366,8 @@ public:
     bool            XIfEventWithTimeout( XEvent*, XPointer, X_if_predicate ) const;
     SalXLib*        GetXLib() const { return pXLib_; }
 
-    SalI18N_InputMethod*        GetInputMethod()  const { return mpInputMethod;  }
+    SalI18N_InputMethod*        GetInputMethod()  const { return pXLib_->GetInputMethod();  }
     SalI18N_KeyboardExtension*  GetKbdExtension() const { return mpKbdExtension; }
-    void            SetInputMethod( SalI18N_InputMethod *pInputMethod )
-    { mpInputMethod = pInputMethod; }
     void            SetKbdExtension(SalI18N_KeyboardExtension *pKbdExtension)
     { mpKbdExtension = pKbdExtension; }
     ::vcl_sal::WMAdaptor* getWMAdaptor() const { return m_pWMAdaptor; }
@@ -394,7 +399,7 @@ public:
     virtual void        PostUserEvent() override;
 
     bool                IsEvent();
-    void                SetupInput( SalI18N_InputMethod *pInputMethod );
+    void                SetupInput();
 };
 
 namespace vcl_sal {
diff --git a/vcl/inc/unx/salinst.h b/vcl/inc/unx/salinst.h
index fdb1dee..3c3934b 100644
--- a/vcl/inc/unx/salinst.h
+++ b/vcl/inc/unx/salinst.h
@@ -34,6 +34,7 @@ namespace com { namespace sun { namespace star { namespace datatransfer {
 
 class SalXLib;
 class X11SalGraphics;
+class SalX11Display;
 
 class VCLPLUG_GEN_PUBLIC X11SalInstance : public SalGenericInstance
 {
@@ -43,6 +44,8 @@ private:
 protected:
     SalXLib *mpXLib;
 
+    virtual SalX11Display* CreateDisplay() const;
+
 public:
     explicit X11SalInstance(SalYieldMutex* pMutex);
     virtual ~X11SalInstance() override;
@@ -77,6 +80,8 @@ public:
     virtual void*               GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) override;
     void                        SetLib( SalXLib *pXLib ) { mpXLib = pXLib; }
 
+    virtual void                AfterAppInit() override;
+
     // dtrans implementation
     virtual css::uno::Reference< css::uno::XInterface >
         CreateClipboard( const css::uno::Sequence< css::uno::Any >& i_rArguments ) override;
diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx
index b584f66..d607bd7 100644
--- a/vcl/unx/generic/app/saldata.cxx
+++ b/vcl/unx/generic/app/saldata.cxx
@@ -334,6 +334,9 @@ SalXLib::SalXLib()
     FD_ZERO( &aReadFDS_ );
     FD_ZERO( &aExceptionFDS_ );
 
+    m_pInputMethod          = nullptr;
+    m_pDisplay              = nullptr;
+
     m_pTimeoutFDS[0] = m_pTimeoutFDS[1] = -1;
     if (pipe (m_pTimeoutFDS) != -1)
     {
@@ -375,6 +378,14 @@ SalXLib::~SalXLib()
     // close 'wakeup' pipe.
     close (m_pTimeoutFDS[0]);
     close (m_pTimeoutFDS[1]);
+
+    delete m_pInputMethod;
+}
+
+void SalXLib::SetInputMethod( SalI18N_InputMethod *pInputMethod )
+{
+    delete m_pInputMethod;
+    m_pInputMethod = pInputMethod;
 }
 
 static Display *OpenX11Display(OString& rDisplay)
@@ -431,14 +442,14 @@ static Display *OpenX11Display(OString& rDisplay)
 
 void SalXLib::Init()
 {
-    SalI18N_InputMethod* pInputMethod = new SalI18N_InputMethod;
-    pInputMethod->SetLocale();
+    m_pInputMethod = new SalI18N_InputMethod;
+    m_pInputMethod->SetLocale();
     XrmInitialize();
 
     OString aDisplay;
-    Display *pDisp = OpenX11Display(aDisplay);
+    m_pDisplay = OpenX11Display(aDisplay);
 
-    if ( !pDisp )
+    if ( !m_pDisplay )
     {
         OUString aProgramFileURL;
         osl_getExecutableFile( &aProgramFileURL.pData );
@@ -455,11 +466,6 @@ void SalXLib::Init()
         std::fflush( stderr );
         exit(0);
     }
-
-    SalX11Display *pSalDisplay = new SalX11Display( pDisp );
-
-    pInputMethod->CreateMethod( pDisp );
-    pSalDisplay->SetupInput( pInputMethod );
 }
 
 extern "C" {
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 881827b..2f21308 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -285,7 +285,6 @@ bool SalDisplay::BestVisual( Display     *pDisplay,
 
 SalDisplay::SalDisplay( Display *display ) :
         pXLib_( nullptr ),
-        mpInputMethod( nullptr ),
         mpKbdExtension( nullptr ),
         mpFactory( nullptr ),
         pDisp_( display ),
@@ -343,8 +342,6 @@ void SalDisplay::doDestruct()
 
     if( IsDisplay() )
     {
-        delete mpInputMethod;
-        mpInputMethod = nullptr;
         delete mpKbdExtension;
         mpKbdExtension = nullptr;
 
@@ -662,10 +659,8 @@ void SalDisplay::Init()
 #endif
 }
 
-void SalX11Display::SetupInput( SalI18N_InputMethod *pInputMethod )
+void SalX11Display::SetupInput()
 {
-    SetInputMethod( pInputMethod );
-
     GetGenericData()->ErrorTrapPush();
     SalI18N_KeyboardExtension *pKbdExtension = new SalI18N_KeyboardExtension( pDisp_ );
     XSync( pDisp_, False );
@@ -1444,10 +1439,14 @@ KeySym SalDisplay::GetKeySym( XKeyEvent        *pEvent,
     memset( pPrintable, 0, *pLen );
     *pStatusReturn = 0;
 
+    SalI18N_InputMethod *pInputMethod = nullptr;
+    if ( pXLib_ )
+        pInputMethod = pXLib_->GetInputMethod();
+
     // first get the printable of the possibly modified KeySym
     if (   (aInputContext == nullptr)
         || (pEvent->type == KeyRelease)
-        || (mpInputMethod != nullptr && mpInputMethod->PosixLocale()) )
+        || (pInputMethod != nullptr && pInputMethod->PosixLocale()) )
     {
         // XmbLookupString must not be called for KeyRelease events
         // Cannot enter space in c locale problem #89616# #88978# btraq #4478197
@@ -1960,6 +1959,10 @@ void SalX11Display::Yield()
 
 bool SalX11Display::Dispatch( XEvent *pEvent )
 {
+    SalI18N_InputMethod *pInputMethod = nullptr;
+    if ( pXLib_ )
+        pInputMethod = pXLib_->GetInputMethod();
+
     if( pEvent->type == KeyPress || pEvent->type == KeyRelease )
     {
         ::Window aWindow = pEvent->xkey.window;
@@ -1976,12 +1979,12 @@ bool SalX11Display::Dispatch( XEvent *pEvent )
         }
         if( it != m_aFrames.end() )
         {
-            if ( mpInputMethod->FilterEvent( pEvent , aWindow ) )
+            if ( pInputMethod && pInputMethod->FilterEvent( pEvent , aWindow ) )
                 return false;
         }
     }
     else
-        if ( mpInputMethod->FilterEvent( pEvent, None ) )
+        if ( pInputMethod && pInputMethod->FilterEvent( pEvent, None ) )
             return false;
 
     SalInstance* pInstance = GetSalData()->m_pInstance;
diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx
index c995a48..7794135 100644
--- a/vcl/unx/generic/app/salinst.cxx
+++ b/vcl/unx/generic/app/salinst.cxx
@@ -31,6 +31,8 @@
 #include <unx/salframe.h>
 #include <unx/genprn.h>
 #include <unx/sm.hxx>
+#include <unx/i18n_im.hxx>
+#include <unx/saldisp.hxx>
 
 #include <vcl/inputtypes.hxx>
 #include <vcl/helper.hxx>
@@ -85,6 +87,11 @@ X11SalInstance::~X11SalInstance()
     GetGenericData()->Dispose();
 }
 
+SalX11Display* X11SalInstance::CreateDisplay() const
+{
+    return new SalX11Display( mpXLib->GetDisplay() );
+}
+
 // AnyInput from sv/mow/source/app/svapp.cxx
 
 struct PredicateReturn
@@ -195,6 +202,16 @@ void X11SalInstance::DestroyFrame( SalFrame* pFrame )
     delete pFrame;
 }
 
+void X11SalInstance::AfterAppInit()
+{
+    assert( mpXLib->GetDisplay() );
+    assert( mpXLib->GetInputMethod() );
+
+    SalX11Display *pSalDisplay = CreateDisplay();
+    mpXLib->GetInputMethod()->CreateMethod( mpXLib->GetDisplay() );
+    pSalDisplay->SetupInput();
+}
+
 extern "C" { static void SAL_CALL thisModule() {} }
 
 void X11SalInstance::AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType, const OUString& rDocumentService)
diff --git a/vcl/unx/kde/kdedata.cxx b/vcl/unx/kde/kdedata.cxx
index f136cc60..71955f5 100644
--- a/vcl/unx/kde/kdedata.cxx
+++ b/vcl/unx/kde/kdedata.cxx
@@ -104,8 +104,8 @@ KDEXLib::~KDEXLib()
 
 void KDEXLib::Init()
 {
-    SalI18N_InputMethod* pInputMethod = new SalI18N_InputMethod;
-    pInputMethod->SetLocale();
+    m_pInputMethod = new SalI18N_InputMethod;
+    m_pInputMethod->SetLocale();
     XrmInitialize();
 
     KAboutData *kAboutData = new KAboutData( "LibreOffice",
@@ -163,12 +163,7 @@ void KDEXLib::Init()
     m_pApplication = new VCLKDEApplication();
     kapp->disableSessionManagement();
 
-    Display* pDisp = QPaintDevice::x11AppDisplay();
-
-    SalX11Display *pSalDisplay = new SalKDEDisplay( pDisp );
-
-    pInputMethod->CreateMethod( pDisp );
-    pSalDisplay->SetupInput( pInputMethod );
+    m_pDisplay = QPaintDevice::x11AppDisplay();
 }
 
 void KDEXLib::doStartup()
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index 6fd0de5..77fd622 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -27,6 +27,7 @@
 #include <unx/salgdi.h>
 #include <unx/kde/kdedata.hxx>
 #include "unx/pixmap.hxx"
+#include <unx/i18n_im.hxx>
 
 #include <vcl/settings.hxx>
 #include "unx/fontmanager.hxx"
@@ -2106,6 +2107,11 @@ uno::Reference< ui::dialogs::XFilePicker2 > KDESalInstance::createFilePicker(
                 new UnxFilePicker( xMSF ) );
 }
 
+SalX11Display* KDESalInstance::CreateDisplay() const
+{
+    return new SalKDEDisplay( QPaintDevice::x11AppDisplay() );
+}
+
 // KDESalData pieces
 
 // Create the widget painter so we have some control over
diff --git a/vcl/unx/kde4/KDESalInstance.cxx b/vcl/unx/kde4/KDESalInstance.cxx
index 86c9d8f..f8bf400 100644
--- a/vcl/unx/kde4/KDESalInstance.cxx
+++ b/vcl/unx/kde4/KDESalInstance.cxx
@@ -23,6 +23,9 @@
 #include "KDESalFrame.hxx"
 
 #include "KDEXLib.hxx"
+#include "KDESalDisplay.hxx"
+
+#include <QX11Info>
 
 using namespace com::sun::star;
 
@@ -55,4 +58,9 @@ int KDESalInstance::getFrameWidth()
     return static_cast<KDEXLib*>( mpXLib )->getFrameWidth();
 }
 
+SalX11Display* KDESalInstance::CreateDisplay() const
+{
+    return new SalKDEDisplay( QX11Info::display() );
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde4/KDESalInstance.hxx b/vcl/unx/kde4/KDESalInstance.hxx
index 45acd78..2220816 100644
--- a/vcl/unx/kde4/KDESalInstance.hxx
+++ b/vcl/unx/kde4/KDESalInstance.hxx
@@ -26,6 +26,9 @@ class SalFrame;
 
 class KDESalInstance : public X11SalInstance
 {
+    protected:
+        virtual SalX11Display* CreateDisplay() const override;
+
     public:
         explicit KDESalInstance(SalYieldMutex* pMutex);
         virtual ~KDESalInstance() override {}
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 38f5150..510c5c9 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -96,8 +96,8 @@ KDEXLib::~KDEXLib()
 
 void KDEXLib::Init()
 {
-    SalI18N_InputMethod* pInputMethod = new SalI18N_InputMethod;
-    pInputMethod->SetLocale();
+    m_pInputMethod = new SalI18N_InputMethod;
+    m_pInputMethod->SetLocale();
     XrmInitialize();
 
     KAboutData *kAboutData = new KAboutData( "LibreOffice",
@@ -195,11 +195,7 @@ void KDEXLib::Init()
 
     setupEventLoop();
 
-    Display* pDisp = QX11Info::display();
-    SalKDEDisplay *pSalDisplay = new SalKDEDisplay(pDisp);
-
-    pInputMethod->CreateMethod( pDisp );
-    pSalDisplay->SetupInput( pInputMethod );
+    m_pDisplay = QX11Info::display();
 }
 
 // When we use Qt event loop, it can actually use its own event loop handling, or wrap
commit 3bc2b8c5e0c4213b53a974944189bdf7f8155502
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Thu Sep 1 12:15:44 2016 +0200

    tdf#101822 Always de-zombie the glxtest process
    
    Make sure we wait for the glxtest process.
    
    Change-Id: I143290b80ba83e35f8d0f95d133c25178c5fe563

diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index e498597..c302d06 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -1006,14 +1006,11 @@ bool OpenGLHelper::isVCLOpenGLEnabled()
     bForceOpenGL = !!getenv("SAL_FORCEGL") || officecfg::Office::Common::VCL::ForceOpenGL::get();
 
     bool bRet = false;
-    if (bForceOpenGL)
+    // always call supportsVCLOpenGL to de-zombie the glxtest child process on X11
+    if (supportsVCLOpenGL() || bForceOpenGL)
     {
         bRet = true;
     }
-    else if (!supportsVCLOpenGL())
-    {
-        bRet = false;
-    }
     else
     {
         static bool bEnableGLEnv = !!getenv("SAL_ENABLEGL");
commit 8dc174178fae4cc98bf7b95ce44bfafc40b5f39e
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Fri Dec 11 21:48:59 2015 +0100

    Clarify KDE4 and TDE config variables
    
    The configure flag is already --enable-kde4, so rename most build
    and configure variables, including the config headers, and the
    build module to include the major number.
    
    Also rename the TDE MOC stored as $MOC to $TDE_MOC to prevent
    conflicts.
    
    Change-Id: Ib947ae4b80349cc52eac7812cb93e8a42606b526

diff --git a/config_host.mk.in b/config_host.mk.in
index 25b9609..2e6d007 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -170,7 +170,6 @@ export ENABLE_SCRIPTING_BEANSHELL=@ENABLE_SCRIPTING_BEANSHELL@
 export ENABLE_SCRIPTING_JAVASCRIPT=@ENABLE_SCRIPTING_JAVASCRIPT@
 export ENABLE_SDREMOTE=@ENABLE_SDREMOTE@
 export ENABLE_SDREMOTE_BLUETOOTH=@ENABLE_SDREMOTE_BLUETOOTH@
-export SYSTEM_BLUEZ=@SYSTEM_BLUEZ@
 export ENABLE_SILENT_MSI=@ENABLE_SILENT_MSI@
 export ENABLE_SYMBOLS=@ENABLE_SYMBOLS@
 export ENABLE_SYSTRAY_GTK=@ENABLE_SYSTRAY_GTK@
@@ -300,9 +299,9 @@ export JITC_PROCESSOR_TYPE=@JITC_PROCESSOR_TYPE@
 export JVM_ONE_PATH_CHECK=@JVM_ONE_PATH_CHECK@
 export KDE4_CFLAGS=$(gb_SPACE)@KDE4_CFLAGS@
 export KDE4_LIBS=$(gb_SPACE)@KDE4_LIBS@
-export KDE_GLIB_CFLAGS=$(gb_SPACE)@KDE_GLIB_CFLAGS@
-export KDE_GLIB_LIBS=$(gb_SPACE)@KDE_GLIB_LIBS@
-export KDE_HAVE_GLIB=@KDE_HAVE_GLIB@
+export KDE4_GLIB_CFLAGS=$(gb_SPACE)@KDE4_GLIB_CFLAGS@
+export KDE4_GLIB_LIBS=$(gb_SPACE)@KDE4_GLIB_LIBS@
+export KDE4_HAVE_GLIB=@KDE4_HAVE_GLIB@
 export KRB5_LIBS=@KRB5_LIBS@
 export LCMS2_CFLAGS=$(gb_SPACE)@LCMS2_CFLAGS@
 export LCMS2_LIBS=$(gb_SPACE)@LCMS2_LIBS@
@@ -395,7 +394,6 @@ export MINGW_SHARED_LIBSTDCPP=@MINGW_SHARED_LIBSTDCPP@
 export MINGW_SYSROOT=@MINGW_SYSROOT@
 export ML_EXE=@ML_EXE@
 export MOC4=@MOC4@
-export MOC=@MOC@
 export MPL_SUBSET=@MPL_SUBSET@
 export MSM_PATH=@MSM_PATH@
 export MSPUB_CFLAGS=$(gb_SPACE)@MSPUB_CFLAGS@
@@ -499,6 +497,7 @@ export SYSBASE=@SYSBASE@
 export SYSTEM_ABW=@SYSTEM_ABW@
 export SYSTEM_APACHE_COMMONS=@SYSTEM_APACHE_COMMONS@
 export SYSTEM_APR=@SYSTEM_APR@
+export SYSTEM_BLUEZ=@SYSTEM_BLUEZ@
 export SYSTEM_BOOST=@SYSTEM_BOOST@
 export SYSTEM_BSH=@SYSTEM_BSH@
 export SYSTEM_BZIP2=@SYSTEM_BZIP2@
@@ -576,6 +575,7 @@ export SYSTEM_ZMF=@SYSTEM_ZMF@
 export TARFILE_LOCATION=@TARFILE_LOCATION@
 export TDE_CFLAGS=$(gb_SPACE)@TDE_CFLAGS@
 export TDE_LIBS=$(gb_SPACE)@TDE_LIBS@
+export TDE_MOC=$(gb_SPACE)@TDE_MOC@
 export TELEPATHY_CFLAGS=$(gb_SPACE)@TELEPATHY_CFLAGS@
 export TELEPATHY_LIBS=$(gb_SPACE)@TELEPATHY_LIBS@
 export TESTINSTALLDIR=@TESTINSTALLDIR@
diff --git a/config_host/config_kde4.h.in b/config_host/config_kde4.h.in
index 6e91b38..50e8553 100644
--- a/config_host/config_kde4.h.in
+++ b/config_host/config_kde4.h.in
@@ -5,6 +5,6 @@ Settings for KDE4 integration.
 #ifndef CONFIG_KDE4_H
 #define CONFIG_KDE4_H
 
-#define KDE_HAVE_GLIB 0
+#define KDE4_HAVE_GLIB 0
 
 #endif
diff --git a/configure.ac b/configure.ac
index df3e976..38b9b46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10991,7 +10991,7 @@ dnl ===================================================================
 TDE_CFLAGS=""
 TDE_LIBS=""
 if test "$_os" != "OpenBSD"; then
-    MOC="moc"
+    TDE_MOC="moc"
 fi
 if test "$test_tde" = "yes" -a "$ENABLE_TDE" = "TRUE"; then
     dnl Search paths for TQt and TDE
@@ -11111,7 +11111,7 @@ your TDE installation by exporting TDEDIR before running "configure".])
 fi
 AC_SUBST(TDE_CFLAGS)
 AC_SUBST(TDE_LIBS)
-AC_SUBST(MOC)
+AC_SUBST(TDE_MOC)
 
 dnl ===================================================================
 dnl KDE4 Integration
@@ -11121,108 +11121,108 @@ KDE4_CFLAGS=""
 KDE4_LIBS=""
 QMAKE4="qmake"
 MOC4="moc"
-KDE_GLIB_CFLAGS=""
-KDE_GLIB_LIBS=""
-KDE_HAVE_GLIB=""
+KDE4_GLIB_CFLAGS=""
+KDE4_GLIB_LIBS=""
+KDE4_HAVE_GLIB=""
 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE"; then
-    qt_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
-    qt_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
+    qt4_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
+    qt4_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
 
-    kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
-    kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
+    kde4_incdirs="/usr/include /usr/include/kde4 $x_includes"
+    kde4_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
 
     if test -n "$supports_multilib"; then
-        qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
-        kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
+        qt4_libdirs="$qt4_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
+        kde4_libdirs="$kde4_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
     fi
 
     if test -n "$QTDIR"; then
-        qt_incdirs="$QTDIR/include $qt_incdirs"
+        qt4_incdirs="$QTDIR/include $qt4_incdirs"
         if test -z "$supports_multilib"; then
-            qt_libdirs="$QTDIR/lib $qt_libdirs"
+            qt4_libdirs="$QTDIR/lib $qt4_libdirs"
         else
-            qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
+            qt4_libdirs="$QTDIR/lib64 $QTDIR/lib $qt4_libdirs"
         fi
     fi
     if test -n "$QT4DIR"; then
-        qt_incdirs="$QT4DIR/include $qt_incdirs"
+        qt4_incdirs="$QT4DIR/include $qt4_incdirs"
         if test -z "$supports_multilib"; then
-            qt_libdirs="$QT4DIR/lib $qt_libdirs"
+            qt4_libdirs="$QT4DIR/lib $qt4_libdirs"
         else
-            qt_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt_libdirs"
+            qt4_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt4_libdirs"
         fi
     fi
 
     if test -n "$KDEDIR"; then
-        kde_incdirs="$KDEDIR/include $kde_incdirs"
+        kde4_incdirs="$KDEDIR/include $kde4_incdirs"
         if test -z "$supports_multilib"; then
-            kde_libdirs="$KDEDIR/lib $kde_libdirs"
+            kde4_libdirs="$KDEDIR/lib $kde4_libdirs"
         else
-            kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
+            kde4_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde4_libdirs"
         fi
     fi
     if test -n "$KDE4DIR"; then
-        kde_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde_incdirs"
+        kde4_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde4_incdirs"
         if test -z "$supports_multilib"; then
-            kde_libdirs="$KDE4DIR/lib $kde_libdirs"
+            kde4_libdirs="$KDE4DIR/lib $kde4_libdirs"
         else
-            kde_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde_libdirs"
+            kde4_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde4_libdirs"
         fi
     fi
 
-    qt_test_include="Qt/qobject.h"
-    qt_test_library="libQtNetwork.so"
-    kde_test_include="kwindowsystem.h"
-    kde_test_library="libsolid.so"
+    qt4_test_include="Qt/qobject.h"
+    qt4_test_library="libQtNetwork.so"
+    kde4_test_include="kwindowsystem.h"
+    kde4_test_library="libsolid.so"
 
     AC_MSG_CHECKING([for Qt4 headers])
-    qt_header_dir="no"
-    for inc_dir in $qt_incdirs; do
-        if test -r "$inc_dir/$qt_test_include"; then
-            qt_header_dir="$inc_dir"
+    qt4_header_dir="no"
+    for inc_dir in $qt4_incdirs; do
+        if test -r "$inc_dir/$qt4_test_include"; then
+            qt4_header_dir="$inc_dir"
             break
         fi
     done
 
-    AC_MSG_RESULT([$qt_header_dir])
-    if test "x$qt_header_dir" = "xno"; then
+    AC_MSG_RESULT([$qt4_header_dir])
+    if test "x$qt4_header_dir" = "xno"; then
         AC_MSG_ERROR([Qt4 headers not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
     fi
 
     dnl Check for qmake
-    AC_PATH_PROG( QMAKEQT4, qmake-qt4, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
+    AC_PATH_PROG( QMAKEQT4, qmake-qt4, no, [`dirname $qt4_header_dir`/bin:$QT4DIR/bin:$PATH] )
     QMAKE4="$QMAKEQT4"
     if test "$QMAKE4" = "no"; then
-        AC_PATH_PROG( QMAKE4, qmake, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
+        AC_PATH_PROG( QMAKE4, qmake, no, [`dirname $qt4_header_dir`/bin:$QT4DIR/bin:$PATH] )
         if test "$QMAKE4" = "no"; then
             AC_MSG_ERROR([Qmake not found.  Please specify
 the root of your Qt installation by exporting QT4DIR before running "configure".])
         fi
     fi
 
-    qt_libdirs="`$QMAKE4 -query QT_INSTALL_LIBS` $qt_libdirs"
+    qt4_libdirs="`$QMAKE4 -query QT_INSTALL_LIBS` $qt4_libdirs"
     AC_MSG_CHECKING([for Qt4 libraries])
-    qt_lib_dir="no"
-    for lib_dir in $qt_libdirs; do
-        if test -r "$lib_dir/$qt_test_library"; then
-            qt_lib_dir="$lib_dir"
-            PKG_CONFIG_PATH="$qt_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
+    qt4_lib_dir="no"
+    for lib_dir in $qt4_libdirs; do
+        if test -r "$lib_dir/$qt4_test_library"; then
+            qt4_lib_dir="$lib_dir"
+            PKG_CONFIG_PATH="$qt4_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
             break
         fi
     done
 
-    AC_MSG_RESULT([$qt_lib_dir])
+    AC_MSG_RESULT([$qt4_lib_dir])
 
-    if test "x$qt_lib_dir" = "xno"; then
+    if test "x$qt4_lib_dir" = "xno"; then
         AC_MSG_ERROR([Qt4 libraries not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
     fi
 
     dnl Check for Meta Object Compiler
 
-    AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
+    AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt4_lib_dir`/bin:$QT4DIR/bin:$PATH] )
     MOC4="$MOCQT4"
     if test "$MOC4" = "no"; then
-        AC_PATH_PROG( MOC4, moc, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
+        AC_PATH_PROG( MOC4, moc, no, [`dirname $qt4_lib_dir`/bin:$QT4DIR/bin:$PATH] )
         if test "$MOC4" = "no"; then
             AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
 the root of your Qt installation by exporting QT4DIR before running "configure".])
@@ -11231,42 +11231,42 @@ the root of your Qt installation by exporting QT4DIR before running "configure".
 
     dnl Check for KDE4 headers
     AC_MSG_CHECKING([for KDE4 headers])
-    kde_incdir="no"
-    for kde_check in $kde_incdirs; do
-        if test -r "$kde_check/$kde_test_include"; then
-            kde_incdir="$kde_check"
+    kde4_incdir="no"
+    for kde4_check in $kde4_incdirs; do
+        if test -r "$kde4_check/$kde4_test_include"; then
+            kde4_incdir="$kde4_check"
             break
         fi
     done
-    AC_MSG_RESULT([$kde_incdir])
-    if test "x$kde_incdir" = "xno"; then
+    AC_MSG_RESULT([$kde4_incdir])
+    if test "x$kde4_incdir" = "xno"; then
         AC_MSG_ERROR([KDE4 headers not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
     fi
     if test "$kde_incdir" = "/usr/include"; then kde_incdir=; fi
 
     dnl Check for KDE4 libraries
     AC_MSG_CHECKING([for KDE4 libraries])
-    kde_libdir="no"
-    for kde_check in $kde_libdirs; do
-        if test -r "$kde_check/$kde_test_library"; then
-            kde_libdir="$kde_check"
+    kde4_libdir="no"
+    for kde4_check in $kde4_libdirs; do
+        if test -r "$kde4_check/$kde4_test_library"; then
+            kde4_libdir="$kde4_check"
             break
         fi
     done
 
-    AC_MSG_RESULT([$kde_libdir])
-    if test "x$kde_libdir" = "xno"; then
+    AC_MSG_RESULT([$kde4_libdir])
+    if test "x$kde4_libdir" = "xno"; then
         AC_MSG_ERROR([KDE4 libraries not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
     fi
 
     PKG_CHECK_MODULES([QT4],[QtNetwork QtGui])
-    if ! test -z "$kde_incdir"; then
-    	KDE4_CFLAGS="-I$kde_incdir $QT4_CFLAGS -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
+    if ! test -z "$kde4_incdir"; then
+    	KDE4_CFLAGS="-I$kde4_incdir $QT4_CFLAGS -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
     else
     	KDE4_CFLAGS="$QT4_CFLAGS -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
     fi
 
-    KDE4_LIBS="-L$kde_libdir -lkio -lkfile -lkdeui -lkdecore -L$qt_lib_dir $QT4_LIBS"
+    KDE4_LIBS="-L$kde4_libdir -lkio -lkfile -lkdeui -lkdecore -L$qt4_lib_dir $QT4_LIBS"
     KDE4_CFLAGS=$(printf '%s' "$KDE4_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
     FilterLibs "$KDE4_LIBS"
     KDE4_LIBS="$filteredlibs"
@@ -11287,14 +11287,14 @@ int main(int argc, char **argv) {
     AC_LANG_POP([C++])
 
     # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled.
-    # Sets also KDE_GLIB_CFLAGS/KDE_GLIB_LIBS if successful.
-    PKG_CHECK_MODULES(KDE_GLIB,[glib-2.0 >= 2.4],
+    # Sets also KDE4_GLIB_CFLAGS/KDE4_GLIB_LIBS if successful.
+    PKG_CHECK_MODULES(KDE4_GLIB,[glib-2.0 >= 2.4],
         [
-            KDE_HAVE_GLIB=1
-            AC_DEFINE(KDE_HAVE_GLIB,1)
-            KDE_GLIB_CFLAGS=$(printf '%s' "$KDE_GLIB_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
-            FilterLibs "${KDE_GLIB_LIBS}"
-            KDE_GLIB_LIBS="${filteredlibs}"
+            KDE4_HAVE_GLIB=1
+            AC_DEFINE(KDE4_HAVE_GLIB,1)
+            KDE4_GLIB_CFLAGS=$(printf '%s' "$KDE4_GLIB_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
+            FilterLibs "${KDE4_GLIB_LIBS}"
+            KDE4_GLIB_LIBS="${filteredlibs}"
 
             qt4_fix_warning=
 
@@ -11391,9 +11391,9 @@ fi
 AC_SUBST(KDE4_CFLAGS)
 AC_SUBST(KDE4_LIBS)
 AC_SUBST(MOC4)
-AC_SUBST(KDE_GLIB_CFLAGS)
-AC_SUBST(KDE_GLIB_LIBS)
-AC_SUBST(KDE_HAVE_GLIB)
+AC_SUBST(KDE4_GLIB_CFLAGS)
+AC_SUBST(KDE4_GLIB_LIBS)
+AC_SUBST(KDE4_HAVE_GLIB)
 
 dnl ===================================================================
 dnl Test whether to include Evolution 2 support
diff --git a/vcl/CustomTarget_tde_moc.mk b/vcl/CustomTarget_tde_moc.mk
index c6a44edefe..72c8699 100644
--- a/vcl/CustomTarget_tde_moc.mk
+++ b/vcl/CustomTarget_tde_moc.mk
@@ -16,6 +16,6 @@ $(call gb_CustomTarget_get_workdir,vcl/unx/kde/fpicker)/kdefilepicker.moc.cxx :\
 		$(SRCDIR)/vcl/unx/kde/fpicker/kdefilepicker.hxx \
 		| $(call gb_CustomTarget_get_workdir,vcl/unx/kde/fpicker)/.dir
 	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),MOC,1)
-	cat $< | grep -v 'FILTER_OUT_KDE' | $(MOC) -o $@ -f$<
+	cat $< | grep -v 'FILTER_OUT_KDE' | $(TDE_MOC) -o $@ -f$<
 
 # vim:set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/vcl/Library_vclplug_kde4.mk b/vcl/Library_vclplug_kde4.mk
index 645d6c9..30c4069 100644
--- a/vcl/Library_vclplug_kde4.mk
+++ b/vcl/Library_vclplug_kde4.mk
@@ -64,13 +64,13 @@ $(eval $(call gb_Library_add_libs,vclplug_kde4,\
 	-lICE \
 ))
 
-ifneq ($(KDE_HAVE_GLIB),)
+ifneq ($(KDE4_HAVE_GLIB),)
 $(eval $(call gb_Library_add_defs,vclplug_kde4,\
-    $(KDE_GLIB_CFLAGS) \
+    $(KDE4_GLIB_CFLAGS) \
 ))
 
 $(eval $(call gb_Library_add_libs,vclplug_kde4,\
-    $(KDE_GLIB_LIBS) \
+    $(KDE4_GLIB_LIBS) \
 ))
 endif
 
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 1d8f64a..38f5150 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -41,7 +41,7 @@
 
 #include "KDESalDisplay.hxx"
 
-#if KDE_HAVE_GLIB
+#if KDE4_HAVE_GLIB
 #include "KDE4FilePicker.hxx"
 #include "tst_exclude_socket_notifiers.moc"
 #include "tst_exclude_posted_events.moc"
@@ -181,7 +181,7 @@ void KDEXLib::Init()
 
     KApplication::setQuitOnLastWindowClosed(false);
 
-#if KDE_HAVE_GLIB
+#if KDE4_HAVE_GLIB
     m_isGlibEventLoopType = QAbstractEventDispatcher::instance()->inherits( "QEventDispatcherGlib" );
     // Using KDE dialogs (and their nested event loops) works only with a proper event loop integration
     // that will release SolarMutex when waiting for more events.
@@ -209,7 +209,7 @@ void KDEXLib::Init()
 // needs to be unlocked shortly before entering the main sleep (e.g. select()) and locked
 // immediately after. So we need to know which event loop implementation is used and
 // hook accordingly.
-#if KDE_HAVE_GLIB
+#if KDE4_HAVE_GLIB
 #include <glib.h>
 
 static GPollFunc old_gpoll = nullptr;
@@ -234,7 +234,7 @@ static bool qt_event_filter( void* m )
 void KDEXLib::setupEventLoop()
 {
     old_qt_event_filter = QAbstractEventDispatcher::instance()->setEventFilter( qt_event_filter );
-#if KDE_HAVE_GLIB
+#if KDE4_HAVE_GLIB
     if( m_isGlibEventLoopType )
     {
         old_gpoll = g_main_context_get_poll_func( nullptr );
@@ -416,7 +416,7 @@ using namespace com::sun::star;
 uno::Reference< ui::dialogs::XFilePicker2 > KDEXLib::createFilePicker(
         const uno::Reference< uno::XComponentContext >& xMSF )
 {
-#if KDE_HAVE_GLIB
+#if KDE4_HAVE_GLIB
     if( qApp->thread() != QThread::currentThread()) {
         SalYieldMutexReleaser aReleaser;
         return Q_EMIT createFilePickerSignal( xMSF );
commit f486329a03b8667bd958624937f02edc9af143d1
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Wed Sep 21 15:49:36 2016 +0200

    TDE fix some clang plugin based warnings
    
    Change-Id: I3b44038e8a889e4c13126fd8d721e53e71ea9ec6

diff --git a/connectivity/source/drivers/kab/KColumns.cxx b/connectivity/source/drivers/kab/KColumns.cxx
index f15b32f..fe675ad 100644
--- a/connectivity/source/drivers/kab/KColumns.cxx
+++ b/connectivity/source/drivers/kab/KColumns.cxx
@@ -44,7 +44,7 @@ sdbcx::ObjectType KabColumns::createObject(const OUString& _rName)
     Reference< XResultSet > xResult = m_pTable->getConnection()->getMetaData()->getColumns(
         aCatalog, sSchemaName, sTableName, _rName);
 
-    sdbcx::ObjectType xRet = NULL;
+    sdbcx::ObjectType xRet = nullptr;
     if (xResult.is())
     {
         Reference< XRow > xRow(xResult,UNO_QUERY);
diff --git a/connectivity/source/drivers/kab/KConnection.cxx b/connectivity/source/drivers/kab/KConnection.cxx
index 8d65407..2b40d1d 100644
--- a/connectivity/source/drivers/kab/KConnection.cxx
+++ b/connectivity/source/drivers/kab/KConnection.cxx
@@ -41,8 +41,8 @@ KabConnection::KabConnection(
     css::uno::Reference<css::sdbc::XDriver> const & driver)
          : OMetaConnection_BASE(m_aMutex),
          OSubComponent<KabConnection, KabConnection_BASE>(driver, this),
-         m_xMetaData(NULL),
-         m_pAddressBook(NULL),
+         m_xMetaData(nullptr),
+         m_pAddressBook(nullptr),
          m_xComponentContext(componentContext)
 {}
 
@@ -101,7 +101,7 @@ Reference< XPreparedStatement > SAL_CALL KabConnection::prepareCall( const OUStr
     checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
 
     // not implemented yet :-) a task to do
-    return NULL;
+    return nullptr;
 }
 
 OUString SAL_CALL KabConnection::nativeSQL( const OUString& _sSql ) throw(SQLException, RuntimeException, std::exception)
@@ -126,7 +126,7 @@ sal_Bool SAL_CALL KabConnection::getAutoCommit(  ) throw(SQLException, RuntimeEx
     // you have to distinguish which if you are in autocommit mode or not
     // at normal case true should be fine here
 
-    return sal_True;
+    return true;
 }
 
 void SAL_CALL KabConnection::commit(  ) throw(SQLException, RuntimeException, std::exception)
@@ -184,7 +184,7 @@ sal_Bool SAL_CALL KabConnection::isReadOnly(  ) throw(SQLException, RuntimeExcep
     checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
 
     // return if your connection to readonly
-    return sal_False;
+    return false;
 }
 
 void SAL_CALL KabConnection::setCatalog( const OUString& ) throw(SQLException, RuntimeException, std::exception)
@@ -231,7 +231,7 @@ Reference< css::container::XNameAccess > SAL_CALL KabConnection::getTypeMap(  )
 
     // if your driver has special database types you can return it here
 
-    return NULL;
+    return nullptr;
 }
 
 void SAL_CALL KabConnection::setTypeMap( const Reference< css::container::XNameAccess >& ) throw(SQLException, RuntimeException, std::exception)
@@ -274,10 +274,10 @@ void KabConnection::disposing()
     }
     m_aStatements.clear();
 
-    if (m_pAddressBook != NULL)
+    if (m_pAddressBook != nullptr)
     {
         KABC::StdAddressBook::close();
-        m_pAddressBook = NULL;
+        m_pAddressBook = nullptr;
     }
 
     m_xMetaData = css::uno::WeakReference< css::sdbc::XDatabaseMetaData>();
diff --git a/connectivity/source/drivers/kab/KConnection.hxx b/connectivity/source/drivers/kab/KConnection.hxx
index a9c67fe..1c6781a 100644
--- a/connectivity/source/drivers/kab/KConnection.hxx
+++ b/connectivity/source/drivers/kab/KConnection.hxx
@@ -81,7 +81,7 @@ namespace connectivity
                 css::uno::Reference<css::uno::XComponentContext> const &
                     componentContext,
                 css::uno::Reference<css::sdbc::XDriver> const & driver);
-            virtual ~KabConnection();
+            virtual ~KabConnection() override;
 
             void closeAllStatements () throw( css::sdbc::SQLException);
 
diff --git a/connectivity/source/drivers/kab/KDEInit.cxx b/connectivity/source/drivers/kab/KDEInit.cxx
index 3f86512..5317c62 100644
--- a/connectivity/source/drivers/kab/KDEInit.cxx
+++ b/connectivity/source/drivers/kab/KDEInit.cxx
@@ -43,7 +43,7 @@ namespace connectivity
         };
 
 
-        KApplication* KDEInit::s_pKApplication = NULL;
+        KApplication* KDEInit::s_pKApplication = nullptr;
         bool          KDEInit::s_bDidInsertCatalogue = false;
 
 
@@ -52,9 +52,9 @@ namespace connectivity
             // TODO: All this is not thread-safe
 
             // we create a KDE application only if it is not already done
-            if (KApplication::kApplication() == NULL)
+            if (KApplication::kApplication() == nullptr)
             {
-                OSL_ENSURE(s_pKApplication == NULL, "KDEInit::Init: inconsistency in the application pointers!");
+                OSL_ENSURE(s_pKApplication == nullptr, "KDEInit::Init: inconsistency in the application pointers!");
 
                 char *kabargs[1] = {const_cast<char*>("libkab1")};
                 KCmdLineArgs::init(1, kabargs, "KAddressBook", *kabargs, "Address Book driver", KAB_DRIVER_VERSION);
@@ -85,10 +85,10 @@ namespace connectivity
                 // which we did not previously insert
                 KGlobal::locale()->removeCatalogue("kaddressbook");
 
-            if ( s_pKApplication != NULL )
+            if ( s_pKApplication != nullptr )
             {
                 delete s_pKApplication;
-                s_pKApplication = NULL;
+                s_pKApplication = nullptr;
             }
         }
     }
diff --git a/connectivity/source/drivers/kab/KDatabaseMetaData.cxx b/connectivity/source/drivers/kab/KDatabaseMetaData.cxx
index c87e704..644f97b 100644
--- a/connectivity/source/drivers/kab/KDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/kab/KDatabaseMetaData.cxx
@@ -141,47 +141,47 @@ sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxTablesInSelect(  ) throw(SQLExcept
 
 sal_Bool SAL_CALL KabDatabaseMetaData::doesMaxRowSizeIncludeBlobs(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::storesLowerCaseQuotedIdentifiers(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::storesLowerCaseIdentifiers(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::storesMixedCaseQuotedIdentifiers(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::storesMixedCaseIdentifiers(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::storesUpperCaseQuotedIdentifiers(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::storesUpperCaseIdentifiers(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsAlterTableWithAddColumn(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsAlterTableWithDropColumn(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxIndexLength(  ) throw(SQLException, RuntimeException, std::exception)
@@ -192,7 +192,7 @@ sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxIndexLength(  ) throw(SQLException
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsNonNullableColumns(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 OUString SAL_CALL KabDatabaseMetaData::getCatalogTerm(  ) throw(SQLException, RuntimeException, std::exception)
@@ -219,7 +219,7 @@ OUString SAL_CALL KabDatabaseMetaData::getExtraNameCharacters(  ) throw(SQLExcep
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsDifferentTableCorrelationNames(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::isCatalogAtStart(  ) throw(SQLException, RuntimeException, std::exception)
@@ -233,107 +233,107 @@ sal_Bool SAL_CALL KabDatabaseMetaData::isCatalogAtStart(  ) throw(SQLException,
 
 sal_Bool SAL_CALL KabDatabaseMetaData::dataDefinitionIgnoredInTransactions(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_True;
+    return true;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::dataDefinitionCausesTransactionCommit(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_True;
+    return true;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsDataManipulationTransactionsOnly(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_True;
+    return true;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_True;
+    return true;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsPositionedDelete(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsPositionedUpdate(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsOpenStatementsAcrossRollback(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsOpenStatementsAcrossCommit(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsOpenCursorsAcrossCommit(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsOpenCursorsAcrossRollback(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsSchemasInDataManipulation(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsANSI92FullSQL(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsANSI92EntryLevelSQL(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_True; // should be supported at least
+    return true; // should be supported at least
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsIntegrityEnhancementFacility(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsSchemasInIndexDefinitions(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsSchemasInTableDefinitions(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsCatalogsInTableDefinitions(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsCatalogsInIndexDefinitions(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsCatalogsInDataManipulation(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsOuterJoins(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxStatements(  ) throw(SQLException, RuntimeException, std::exception)
@@ -356,198 +356,198 @@ sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxSchemaNameLength(  ) throw(SQLExce
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsTransactions(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::allProceduresAreCallable(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsStoredProcedures(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsSelectForUpdate(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::allTablesAreSelectable(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::isReadOnly(  ) throw(SQLException, RuntimeException, std::exception)
 {
     // for the moment, we have read-only addresses, but this might change in the future
-    return sal_True;
+    return true;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::usesLocalFiles(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::usesLocalFilePerTable(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsTypeConversion(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::nullPlusNonNullIsNull(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsColumnAliasing(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsTableCorrelationNames(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsConvert( sal_Int32, sal_Int32 ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsExpressionsInOrderBy(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsGroupBy(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsGroupByBeyondSelect(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsGroupByUnrelated(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsMultipleTransactions(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsMultipleResultSets(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsLikeEscapeClause(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsOrderByUnrelated(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsUnion(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsUnionAll(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsMixedCaseIdentifiers(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsMixedCaseQuotedIdentifiers(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::nullsAreSortedAtEnd(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::nullsAreSortedAtStart(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::nullsAreSortedHigh(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::nullsAreSortedLow(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsSchemasInProcedureCalls(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsSchemasInPrivilegeDefinitions(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsCatalogsInProcedureCalls(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsCatalogsInPrivilegeDefinitions(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsCorrelatedSubqueries(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsSubqueriesInComparisons(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsSubqueriesInExists(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsSubqueriesInIns(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsSubqueriesInQuantifieds(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsANSI92IntermediateSQL(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 OUString SAL_CALL KabDatabaseMetaData::getURL(  ) throw(SQLException, RuntimeException, std::exception)
@@ -649,27 +649,27 @@ OUString SAL_CALL KabDatabaseMetaData::getNumericFunctions(  ) throw(SQLExceptio
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsExtendedSQLGrammar(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsCoreSQLGrammar(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsMinimumSQLGrammar(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_True;
+    return true;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsFullOuterJoins(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsLimitedOuterJoins(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxColumnsInGroupBy(  ) throw(SQLException, RuntimeException, std::exception)
@@ -702,9 +702,9 @@ sal_Bool SAL_CALL KabDatabaseMetaData::supportsResultSetType( sal_Int32 setType
     {
         case ResultSetType::FORWARD_ONLY:
         case ResultSetType::SCROLL_INSENSITIVE:
-            return sal_True;
+            return true;
     }
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 ) throw(SQLException, RuntimeException, std::exception)
@@ -713,59 +713,59 @@ sal_Bool SAL_CALL KabDatabaseMetaData::supportsResultSetConcurrency( sal_Int32 s
     {
         case ResultSetType::FORWARD_ONLY:
         case ResultSetType::SCROLL_INSENSITIVE:
-            return sal_True;
+            return true;
     }
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::ownUpdatesAreVisible( sal_Int32 ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::ownDeletesAreVisible( sal_Int32 ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::ownInsertsAreVisible( sal_Int32 ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::othersUpdatesAreVisible( sal_Int32 ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::othersDeletesAreVisible( sal_Int32 ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::othersInsertsAreVisible( sal_Int32 ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::updatesAreDetected( sal_Int32 ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::deletesAreDetected( sal_Int32 ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::insertsAreDetected( sal_Int32 ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 sal_Bool SAL_CALL KabDatabaseMetaData::supportsBatchUpdates(  ) throw(SQLException, RuntimeException, std::exception)
 {
-    return sal_False;
+    return false;
 }
 
 Reference< XConnection > SAL_CALL KabDatabaseMetaData::getConnection(  ) throw(SQLException, RuntimeException, std::exception)
diff --git a/connectivity/source/drivers/kab/KDatabaseMetaData.hxx b/connectivity/source/drivers/kab/KDatabaseMetaData.hxx
index 3c7c927b..69976d1 100644
--- a/connectivity/source/drivers/kab/KDatabaseMetaData.hxx
+++ b/connectivity/source/drivers/kab/KDatabaseMetaData.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_KAB_KDATABASEMETADATA_HXX
 
 #include "KConnection.hxx"
+#include <com/sun/star/sdbc/XConnection.hpp>
 #include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
 #include <cppuhelper/implbase.hxx>
 
@@ -36,14 +37,14 @@ namespace connectivity
 
         class KabDatabaseMetaData : public KabDatabaseMetaData_BASE
         {
-            css::uno::Reference< KabConnection >   m_xConnection;
+            css::uno::Reference< css::sdbc::XConnection >   m_xConnection;
             bool                                   m_bUseCatalog;
 
         public:
 
             explicit KabDatabaseMetaData(KabConnection* _pCon);
             static const OUString & getAddressBookTableName();
-            virtual ~KabDatabaseMetaData();
+            virtual ~KabDatabaseMetaData() override;
 
             // this interface is really BIG
             // XDatabaseMetaData
diff --git a/connectivity/source/drivers/kab/KDriver.cxx b/connectivity/source/drivers/kab/KDriver.cxx
index 7698d3d..52c8492 100644
--- a/connectivity/source/drivers/kab/KDriver.cxx
+++ b/connectivity/source/drivers/kab/KDriver.cxx
@@ -140,11 +140,11 @@ KabImplModule::KabImplModule( const Reference< XComponentContext >& _rxContext )
     :m_xContext(_rxContext)
     ,m_bAttemptedLoadModule(false)
     ,m_bAttemptedInitialize(false)
-    ,m_hConnectorModule(NULL)
-    ,m_pConnectionFactoryFunc(NULL)
-    ,m_pApplicationInitFunc(NULL)
-    ,m_pApplicationShutdownFunc(NULL)
-    ,m_pKDEVersionCheckFunc(NULL)
+    ,m_hConnectorModule(nullptr)
+    ,m_pConnectionFactoryFunc(nullptr)
+    ,m_pApplicationInitFunc(nullptr)
+    ,m_pApplicationShutdownFunc(nullptr)
+    ,m_pKDEVersionCheckFunc(nullptr)
 {
     if ( !m_xContext.is() )
         throw NullPointerException();
@@ -178,7 +178,7 @@ namespace
     template< typename FUNCTION >
     void lcl_getFunctionFromModuleOrUnload( oslModule& _rModule, const sal_Char* _pAsciiSymbolName, FUNCTION& _rFunction )
     {
-        _rFunction = NULL;
+        _rFunction = nullptr;
         if ( _rModule )
         {
 
@@ -192,7 +192,7 @@ namespace
                 aBuf.append( _pAsciiSymbolName );
                 OSL_FAIL( aBuf.makeStringAndClear().getStr() );
                 osl_unloadModule( _rModule );
-                _rModule = NULL;
+                _rModule = nullptr;
             }
         }
     }
@@ -204,7 +204,7 @@ extern "C" { void SAL_CALL thisModule() {} }
 bool KabImplModule::impl_loadModule()
 {
     if ( m_bAttemptedLoadModule )
-        return ( m_hConnectorModule != NULL );
+        return ( m_hConnectorModule != nullptr );
     m_bAttemptedLoadModule = true;
 
     OSL_ENSURE( !m_hConnectorModule && !m_pConnectionFactoryFunc && !m_pApplicationInitFunc && !m_pApplicationShutdownFunc && !m_pKDEVersionCheckFunc,
@@ -231,15 +231,15 @@ bool KabImplModule::impl_loadModule()
 
 void KabImplModule::impl_unloadModule()
 {
-    OSL_PRECOND( m_hConnectorModule != NULL, "KabImplModule::impl_unloadModule: no module!" );
+    OSL_PRECOND( m_hConnectorModule != nullptr, "KabImplModule::impl_unloadModule: no module!" );
 
     osl_unloadModule( m_hConnectorModule );
-    m_hConnectorModule = NULL;
+    m_hConnectorModule = nullptr;
 
-    m_pConnectionFactoryFunc = NULL;
-    m_pApplicationInitFunc = NULL;
-    m_pApplicationShutdownFunc = NULL;
-    m_pKDEVersionCheckFunc = NULL;
+    m_pConnectionFactoryFunc = nullptr;
+    m_pApplicationInitFunc = nullptr;
+    m_pApplicationShutdownFunc = nullptr;
+    m_pKDEVersionCheckFunc = nullptr;
 
     m_bAttemptedLoadModule = false;
 }
@@ -413,7 +413,7 @@ sal_Bool SAL_CALL KabDriver::acceptsURL( const OUString& url )
     ::osl::MutexGuard aGuard(m_aMutex);
 
     if ( !m_aImplModule.isKDEPresent() )
-        return sal_False;
+        return false;
 
     // here we have to look whether we support this URL format
     return url.startsWith("sdbc:address:" KAB_SERVICE_NAME);
diff --git a/connectivity/source/drivers/kab/KDriver.hxx b/connectivity/source/drivers/kab/KDriver.hxx
index 5174c90..b061b00 100644
--- a/connectivity/source/drivers/kab/KDriver.hxx
+++ b/connectivity/source/drivers/kab/KDriver.hxx
@@ -117,8 +117,8 @@ namespace connectivity
             */
             bool    impl_loadModule();
 
-            /** unloads the implementation module, and resets all function pointers to <NULL/>
-                @precond m_hConnectorModule is not <NULL/>
+            /** unloads the implementation module, and resets all function pointers to <nullptr/>
+                @precond m_hConnectorModule is not <nullptr/>
             */
             void    impl_unloadModule();
 
diff --git a/connectivity/source/drivers/kab/KPreparedStatement.cxx b/connectivity/source/drivers/kab/KPreparedStatement.cxx
index d37b88b..b10cb82 100644
--- a/connectivity/source/drivers/kab/KPreparedStatement.cxx
+++ b/connectivity/source/drivers/kab/KPreparedStatement.cxx
@@ -39,7 +39,7 @@ void KabPreparedStatement::checkAndResizeParameters(sal_Int32 nParams) throw(SQL
         m_aParameterRow = new OValueVector();
 
     if (nParams < 1)
-        ::dbtools::throwInvalidIndexException(*this, Any());
+        ::dbtools::throwInvalidIndexException(*this);
 
     if (nParams >= (sal_Int32) (m_aParameterRow->get()).size())
         (m_aParameterRow->get()).resize(nParams);
@@ -56,7 +56,7 @@ void KabPreparedStatement::setKabFields() const throw(SQLException)
         const OUString sError( aResources.getResourceString(
                 STR_INVALID_COLUMN_SELECTION
              ) );
-        ::dbtools::throwGenericSQLException(sError,NULL);
+        ::dbtools::throwGenericSQLException(sError,nullptr);
     }
     m_xMetaData->setKabFields(xColumns);
 }
@@ -104,7 +104,7 @@ void KabPreparedStatement::disposing()
     if (m_aParameterRow.is())
     {
         m_aParameterRow->get().clear();
-        m_aParameterRow = NULL;
+        m_aParameterRow = nullptr;
     }
 }
 
@@ -189,42 +189,42 @@ void SAL_CALL KabPreparedStatement::setNull(sal_Int32 parameterIndex, sal_Int32)
 
 void SAL_CALL KabPreparedStatement::setObjectNull(sal_Int32, sal_Int32, const OUString&) throw(SQLException, RuntimeException, std::exception)
 {
-    ::dbtools::throwFunctionNotSupportedSQLException("setObjectNull", NULL);
+    ::dbtools::throwFunctionNotSupportedSQLException("setObjectNull", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setBoolean(sal_Int32, sal_Bool) throw(SQLException, RuntimeException, std::exception)
 {
-    ::dbtools::throwFunctionNotSupportedSQLException("setBoolean", NULL);
+    ::dbtools::throwFunctionNotSupportedSQLException("setBoolean", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setByte(sal_Int32, sal_Int8) throw(SQLException, RuntimeException, std::exception)
 {
-    ::dbtools::throwFunctionNotSupportedSQLException("setByte", NULL);
+    ::dbtools::throwFunctionNotSupportedSQLException("setByte", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setShort(sal_Int32, sal_Int16) throw(SQLException, RuntimeException, std::exception)
 {
-    ::dbtools::throwFunctionNotSupportedSQLException("setShort", NULL);
+    ::dbtools::throwFunctionNotSupportedSQLException("setShort", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setInt(sal_Int32, sal_Int32) throw(SQLException, RuntimeException, std::exception)
 {
-    ::dbtools::throwFunctionNotSupportedSQLException("setInt", NULL);
+    ::dbtools::throwFunctionNotSupportedSQLException("setInt", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setLong(sal_Int32, sal_Int64) throw(SQLException, RuntimeException, std::exception)
 {
-    ::dbtools::throwFunctionNotSupportedSQLException("", NULL);
+    ::dbtools::throwFunctionNotSupportedSQLException("", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setFloat(sal_Int32, float) throw(SQLException, RuntimeException, std::exception)
 {
-    ::dbtools::throwFunctionNotSupportedSQLException("setFloat", NULL);
+    ::dbtools::throwFunctionNotSupportedSQLException("setFloat", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setDouble(sal_Int32, double) throw(SQLException, RuntimeException, std::exception)
 {
-    ::dbtools::throwFunctionNotSupportedSQLException("setDouble", NULL);
+    ::dbtools::throwFunctionNotSupportedSQLException("setDouble", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setString(sal_Int32 parameterIndex, const OUString &x) throw(SQLException, RuntimeException, std::exception)
@@ -239,33 +239,33 @@ void SAL_CALL KabPreparedStatement::setString(sal_Int32 parameterIndex, const OU
 
 void SAL_CALL KabPreparedStatement::setBytes(sal_Int32, const Sequence< sal_Int8 >&) throw(SQLException, RuntimeException, std::exception)
 {
-   ::dbtools::throwFunctionNotSupportedSQLException("setBytes", NULL);
+   ::dbtools::throwFunctionNotSupportedSQLException("setBytes", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setDate(sal_Int32, const Date&) throw(SQLException, RuntimeException, std::exception)
 {
-   ::dbtools::throwFunctionNotSupportedSQLException("setDate", NULL);
+   ::dbtools::throwFunctionNotSupportedSQLException("setDate", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setTime(sal_Int32, const css::util::Time&) throw(SQLException, RuntimeException, std::exception)
 {
-    ::dbtools::throwFunctionNotSupportedSQLException("setTime", NULL);
+    ::dbtools::throwFunctionNotSupportedSQLException("setTime", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setTimestamp(sal_Int32, const DateTime&) throw(SQLException, RuntimeException, std::exception)
 {
 
-   ::dbtools::throwFunctionNotSupportedSQLException("setTimestamp", NULL);
+   ::dbtools::throwFunctionNotSupportedSQLException("setTimestamp", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setBinaryStream(sal_Int32, const Reference< css::io::XInputStream >&, sal_Int32) throw(SQLException, RuntimeException, std::exception)
 {
-    ::dbtools::throwFunctionNotSupportedSQLException("setBinaryStream", NULL);
+    ::dbtools::throwFunctionNotSupportedSQLException("setBinaryStream", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setCharacterStream(sal_Int32, const Reference< css::io::XInputStream >&, sal_Int32) throw(SQLException, RuntimeException, std::exception)
 {
-   ::dbtools::throwFunctionNotSupportedSQLException("setCharacterStream", NULL);
+   ::dbtools::throwFunctionNotSupportedSQLException("setCharacterStream", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setObject(sal_Int32 parameterIndex, const Any& x) throw(SQLException, RuntimeException, std::exception)
@@ -278,32 +278,32 @@ void SAL_CALL KabPreparedStatement::setObject(sal_Int32 parameterIndex, const An
 
 void SAL_CALL KabPreparedStatement::setObjectWithInfo(sal_Int32, const Any&, sal_Int32, sal_Int32) throw(SQLException, RuntimeException, std::exception)
 {
-    ::dbtools::throwFunctionNotSupportedSQLException("setObjectWithInfo", NULL);
+    ::dbtools::throwFunctionNotSupportedSQLException("setObjectWithInfo", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setRef(sal_Int32, const Reference< XRef >&) throw(SQLException, RuntimeException, std::exception)
 {
-    ::dbtools::throwFunctionNotSupportedSQLException("setRef", NULL);
+    ::dbtools::throwFunctionNotSupportedSQLException("setRef", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setBlob(sal_Int32, const Reference< XBlob >&) throw(SQLException, RuntimeException, std::exception)
 {
-    ::dbtools::throwFunctionNotSupportedSQLException("setBlob", NULL);
+    ::dbtools::throwFunctionNotSupportedSQLException("setBlob", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setClob(sal_Int32, const Reference< XClob >&) throw(SQLException, RuntimeException, std::exception)
 {
-    ::dbtools::throwFunctionNotSupportedSQLException("setClob", NULL);
+    ::dbtools::throwFunctionNotSupportedSQLException("setClob", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::setArray(sal_Int32, const Reference< XArray >&) throw(SQLException, RuntimeException, std::exception)
 {
-    ::dbtools::throwFunctionNotSupportedSQLException("setArray", NULL);
+    ::dbtools::throwFunctionNotSupportedSQLException("setArray", nullptr);
 }
 
 void SAL_CALL KabPreparedStatement::clearParameters() throw(SQLException, RuntimeException, std::exception)
 {
-   ::dbtools::throwFunctionNotSupportedSQLException("clearParameters", NULL);
+   ::dbtools::throwFunctionNotSupportedSQLException("clearParameters", nullptr);
 }
 
 void KabPreparedStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue) throw (Exception, std::exception)
diff --git a/connectivity/source/drivers/kab/KPreparedStatement.hxx b/connectivity/source/drivers/kab/KPreparedStatement.hxx
index 926ab79..2b4f801 100644
--- a/connectivity/source/drivers/kab/KPreparedStatement.hxx
+++ b/connectivity/source/drivers/kab/KPreparedStatement.hxx
@@ -57,7 +57,7 @@ namespace connectivity
 
             virtual void resetParameters() const throw(css::sdbc::SQLException) override;
             virtual void getNextParameter(OUString &rParameter) const throw(css::sdbc::SQLException) override;
-            virtual ~KabPreparedStatement();
+            virtual ~KabPreparedStatement() override;
 
         public:
             DECLARE_SERVICE_INFO();
diff --git a/connectivity/source/drivers/kab/KResultSet.cxx b/connectivity/source/drivers/kab/KResultSet.cxx
index 3c49289..8babcb4 100644
--- a/connectivity/source/drivers/kab/KResultSet.cxx
+++ b/connectivity/source/drivers/kab/KResultSet.cxx
@@ -48,7 +48,7 @@ KabResultSet::KabResultSet(KabCommonStatement* pStmt)
     : KabResultSet_BASE(m_aMutex),
       OPropertySetHelper(KabResultSet_BASE::rBHelper),
       m_xStatement(pStmt),
-      m_xMetaData(NULL),
+      m_xMetaData(nullptr),
       m_aKabAddressees(),
       m_nRowPos(-1),
       m_bWasNull(true)
@@ -192,7 +192,7 @@ return aRet;
             default:
                 aQtName = aFields[nFieldNumber - KAB_DATA_FIELDS]->value(m_aKabAddressees[m_nRowPos]);
         }
-// KDE address book currently does not use NULL values.
+// KDE address book currently does not use nullptr values.
 // But it might do it someday
         if (!aQtName.isNull())
         {
@@ -211,9 +211,9 @@ sal_Bool SAL_CALL KabResultSet::getBoolean(sal_Int32) throw(SQLException, Runtim
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
 
-::dbtools::throwFunctionNotSupportedSQLException("getBoolean", NULL);
+::dbtools::throwFunctionNotSupportedSQLException("getBoolean", nullptr);
 
-    return sal_False;
+    return false;
 }
 
 sal_Int8 SAL_CALL KabResultSet::getByte(sal_Int32) throw(SQLException, RuntimeException, std::exception)
@@ -221,7 +221,7 @@ sal_Int8 SAL_CALL KabResultSet::getByte(sal_Int32) throw(SQLException, RuntimeEx
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
 
-::dbtools::throwFunctionNotSupportedSQLException("getByte", NULL);
+::dbtools::throwFunctionNotSupportedSQLException("getByte", nullptr);
 
     sal_Int8 nRet = 0;
     return nRet;
@@ -232,7 +232,7 @@ sal_Int16 SAL_CALL KabResultSet::getShort(sal_Int32) throw(SQLException, Runtime
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
 
-::dbtools::throwFunctionNotSupportedSQLException("getShort", NULL);
+::dbtools::throwFunctionNotSupportedSQLException("getShort", nullptr);
 
     sal_Int16 nRet = 0;
     return nRet;
@@ -243,7 +243,7 @@ sal_Int32 SAL_CALL KabResultSet::getInt(sal_Int32) throw(SQLException, RuntimeEx
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
 
-::dbtools::throwFunctionNotSupportedSQLException("getInt", NULL);
+::dbtools::throwFunctionNotSupportedSQLException("getInt", nullptr);
 
     sal_Int32 nRet = 0;
     return nRet;
@@ -254,7 +254,7 @@ sal_Int64 SAL_CALL KabResultSet::getLong(sal_Int32) throw(SQLException, RuntimeE
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
 
-::dbtools::throwFunctionNotSupportedSQLException("getLong", NULL);
+::dbtools::throwFunctionNotSupportedSQLException("getLong", nullptr);
 
     return sal_Int64();
 }
@@ -264,7 +264,7 @@ float SAL_CALL KabResultSet::getFloat(sal_Int32) throw(SQLException, RuntimeExce
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
 
-::dbtools::throwFunctionNotSupportedSQLException("getFloat", NULL);
+::dbtools::throwFunctionNotSupportedSQLException("getFloat", nullptr);
 
     float nVal(0);
     return nVal;
@@ -275,7 +275,7 @@ double SAL_CALL KabResultSet::getDouble(sal_Int32) throw(SQLException, RuntimeEx
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
 
-::dbtools::throwFunctionNotSupportedSQLException("getDouble", NULL);
+::dbtools::throwFunctionNotSupportedSQLException("getDouble", nullptr);
 
     double nRet = 0;
     return nRet;
@@ -286,7 +286,7 @@ Sequence< sal_Int8 > SAL_CALL KabResultSet::getBytes(sal_Int32) throw(SQLExcepti
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
 
-::dbtools::throwFunctionNotSupportedSQLException("", NULL);
+::dbtools::throwFunctionNotSupportedSQLException("", nullptr);
 
     return Sequence< sal_Int8 >();
 }
@@ -296,7 +296,7 @@ cssu::Date SAL_CALL KabResultSet::getDate(sal_Int32) throw(SQLException, Runtime
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
 
-::dbtools::throwFunctionNotSupportedSQLException("getDate", NULL);
+::dbtools::throwFunctionNotSupportedSQLException("getDate", nullptr);
 
     cssu::Date aRet;
     return aRet;

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list