[Libreoffice-commits] core.git: Branch 'private/jmux/scheduler-fixes' - 117 commits - avmedia/inc avmedia/Library_avmediavlc.mk avmedia/source basctl/source basegfx/source basic/CppunitTest_basic_macros.mk basic/qa bridges/Library_cpp_uno.mk codemaker/source compilerplugins/clang config_host/config_global.h.in config_host/config_gpgme.h.in config_host.mk.in configure.ac cui/source desktop/source desktop/win32 editeng/source external/libepubgen filter/source framework/source helpcontent2 hwpfilter/source icon-themes/galaxy idlc/source include/basegfx include/codemaker include/filter include/LibreOfficeKit include/oox include/registry include/sfx2 include/svl include/svtools include/svx include/toolkit include/tools include/ucbhelper include/vcl libreofficekit/Module_libreofficekit.mk lotuswordpro/inc lotuswordpro/source Makefile.in offapi/com officecfg/registry oox/source registry/source sal/osl sal/rtl sal/textenc sc/Module_sc.mk sc/qa sc/source sd/inc sd/Library_sdfilt.mk sd/qa sd/source sfx2/so urce slideshow/source solenv/flatpak-manifest.in solenv/gbuild sot/source store/source svl/source svtools/source svx/sdi svx/source sw/inc sw/qa sw/sdi sw/source sw/uiconfig toolkit/inc translations ucb/source udkapi/com unoidl/source vcl/android vcl/Executable_ww2fuzzer.mk vcl/Executable_ww6fuzzer.mk vcl/Executable_ww8fuzzer.mk vcl/headless vcl/inc vcl/osx vcl/qa vcl/README.scheduler vcl/source vcl/unx vcl/win vcl/workben writerfilter/source writerperfect/qa xmloff/inc xmloff/source xmlsecurity/source

Katarina Behrens Katarina.Behrens at cib.de
Fri Oct 20 20:38:43 UTC 2017


Rebased ref, commits from common ancestor:
commit bb8de5570e651c8d0ad40ab3cec8ff1aa783cd61
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Wed Oct 18 12:50:59 2017 +0200

    WIP Don't merge tdf#67770: Read LastActiveDeck bits
    
    Change-Id: Id5e3c3cb4144b9fc56ab5e4a4e49f1fc69e70023

diff --git a/include/sfx2/sidebar/ResourceManager.hxx b/include/sfx2/sidebar/ResourceManager.hxx
index 8c50ecfe6316..2d68d3525783 100644
--- a/include/sfx2/sidebar/ResourceManager.hxx
+++ b/include/sfx2/sidebar/ResourceManager.hxx
@@ -51,6 +51,7 @@ public:
     void InitDeckContext(const Context& rContex);
     void SaveDecksSettings(const Context& rContext);
     void SaveDeckSettings(const DeckDescriptor* pDeckDesc);
+    void SaveLastActiveDeck(const Context& rContext, const OUString& rActiveDeck);
 
     void disposeDecks();
 
@@ -84,6 +85,8 @@ public:
                                             const OUString& rsDeckId,
                                             const css::uno::Reference<css::frame::XController>& rxController);
 
+    const OUString& GetLastActiveDeck( const Context& rContext );
+
     /** Remember the expansions state per panel and context.
     */
     void StorePanelExpansionState(const OUString& rsPanelId,
@@ -99,11 +102,13 @@ private:
     typedef std::vector<std::shared_ptr<PanelDescriptor>> PanelContainer;
     PanelContainer maPanels;
     mutable std::set<rtl::OUString> maProcessedApplications;
+    std::map<OUString, OUString> maLastActiveDecks;
 
     SvtMiscOptions maMiscOptions;
 
     void ReadDeckList();
     void ReadPanelList();
+    void ReadLastActive();
     static void ReadContextList(const utl::OConfigurationNode& rNode,
                          ContextList& rContextList,
                          const OUString& rsDefaultMenuCommand);
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx
index 1f8fb2863d4f..873aeb203781 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -20,9 +20,11 @@
 #include <sfx2/sidebar/ResourceManager.hxx>
 #include <sfx2/sidebar/Tools.hxx>
 
+#include <officecfg/Office/UI/Sidebar.hxx>
 #include <unotools/confignode.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/sequence.hxx>
 #include <comphelper/types.hxx>
 
 #include <rtl/ustrbuf.hxx>
@@ -98,6 +100,7 @@ ResourceManager::ResourceManager()
 {
     ReadDeckList();
     ReadPanelList();
+    ReadLastActive();
 }
 
 ResourceManager::~ResourceManager()
@@ -243,6 +246,14 @@ const ResourceManager::PanelContextDescriptorContainer& ResourceManager::GetMatc
     return rPanelIds;
 }
 
+const OUString& ResourceManager::GetLastActiveDeck( const Context& rContext )
+{
+    if( maLastActiveDecks.find( rContext.msApplication ) == maLastActiveDecks.end())
+        return maLastActiveDecks["any"];
+    else
+        return maLastActiveDecks[rContext.msApplication];
+}
+
 void ResourceManager::ReadDeckList()
 {
     const utl::OConfigurationTreeRoot aDeckRootNode(
@@ -394,6 +405,22 @@ void ResourceManager::SaveDeckSettings(const DeckDescriptor* pDeckDesc)
         aPanelRootNode.commit();
 }
 
+void ResourceManager::SaveLastActiveDeck(const Context& rContext, const OUString& rActiveDeck)
+{
+    //if( maLastActiveDecks.find( rContext.msApplication ) != maLastActiveDecks.end())
+    maLastActiveDecks[rContext.msApplication] = rActiveDeck;
+
+    std::set<OUString> aLastActiveDecks;
+    for ( auto rEntry : maLastActiveDecks )
+        aLastActiveDecks.insert( rEntry.first + "," +  rEntry.second);
+
+    std::shared_ptr<comphelper::ConfigurationChanges> cfgWriter( comphelper::ConfigurationChanges::create() );
+
+    officecfg::Office::UI::Sidebar::Content::LastActiveDeck::set(comphelper::containerToSequence(aLastActiveDecks), cfgWriter);
+    cfgWriter->commit();
+
+}
+
 void ResourceManager::ReadPanelList()
 {
     const utl::OConfigurationTreeRoot aPanelRootNode(
@@ -435,6 +462,30 @@ void ResourceManager::ReadPanelList()
     }
 }
 
+
+void ResourceManager::ReadLastActive()
+{
+    boost::optional< Sequence <OUString> > aLastActive (officecfg::Office::UI::Sidebar::Content::LastActiveDeck::get());
+
+    if (aLastActive)
+    {
+        const css::uno::Sequence<OUString>& rLastActiveDecks = aLastActive.get();
+        for (auto i = rLastActiveDecks.begin(); i != rLastActiveDecks.end(); ++i)
+        {
+            sal_Int32 nCharIdx = i->lastIndexOf(',');
+            if ( nCharIdx < 0 )
+            {
+                SAL_WARN("sfx.sidebar", "Expecting 2 values separated by comma");
+                continue;
+            }
+
+            const OUString sApplicationName = i->copy( 0, nCharIdx ).trim();
+            const OUString sLastUsed = i->copy( nCharIdx + 1 ).trim();
+            maLastActiveDecks.insert( std::make_pair(sApplicationName, sLastUsed ) );
+        }
+    }
+}
+
 void ResourceManager::ReadContextList (
                         const utl::OConfigurationNode& rParentNode,
                         ContextList& rContextList,
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index e5cc4296b74a..9ab3b39a6c5e 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -140,7 +140,8 @@ rtl::Reference<SidebarController> SidebarController::create(
     if (instance->mxReadOnlyModeDispatch.is())
         instance->mxReadOnlyModeDispatch->addStatusListener(instance.get(), aURL);
 
-    instance->SwitchToDeck(gsDefaultDeckId);
+
+    //instance->SwitchToDeck(gsDefaultDeckId);
 
     return instance;
 }
@@ -210,7 +211,10 @@ void SAL_CALL SidebarController::disposing()
     // so need to test if GetCurrentContext is still valid regarding msApplication
 
     if (GetCurrentContext().msApplication != "none")
+    {
         mpResourceManager->SaveDecksSettings(GetCurrentContext());
+        mpResourceManager->SaveLastActiveDeck(GetCurrentContext(), msCurrentDeckId);
+    }
 
     // clear decks
     ResourceManager::DeckContextDescriptorContainer aDecks;
@@ -437,6 +441,15 @@ void SidebarController::UpdateConfigurations()
         if (maCurrentContext.msApplication != "none")
             mpResourceManager->SaveDecksSettings(maCurrentContext);
 
+        // get last active deck for this application on first update
+        if (!maRequestedContext.msApplication.isEmpty() &&
+             (maCurrentContext.msApplication != maRequestedContext.msApplication))
+        {
+           OUString sLastActiveDeck = mpResourceManager->GetLastActiveDeck( maRequestedContext );
+           if (!sLastActiveDeck.isEmpty())
+               msCurrentDeckId = sLastActiveDeck;
+        }
+
         maCurrentContext = maRequestedContext;
 
         mpResourceManager->InitDeckContext(GetCurrentContext());
commit 9317c32ef42331428cb2f42d7b2913574abee44c
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Tue Oct 17 13:13:23 2017 +0200

    Implement processing of (all) current LO tasks
    
    Processing all current events is currently just implemented for
    LO user events and system events, which is inconsistent. This
    implements the same functionality in the scheduler to process all
    current LO tasks.
    
    Currently used by DoYield in the Mac and Windows backends.
    
    This also fixes the testTriggerIdleFromIdle test, as this now
    correctly wait-yields until the watchdog kicks in.
    
    Change-Id: Icab8671ceae724a96959fa092ad00bff20c919e1

diff --git a/include/vcl/scheduler.hxx b/include/vcl/scheduler.hxx
index ac429ed33b09..77396b90ae9c 100644
--- a/include/vcl/scheduler.hxx
+++ b/include/vcl/scheduler.hxx
@@ -43,16 +43,22 @@ class VCL_DLLPUBLIC Scheduler final
     static void Lock( sal_uInt32 nLockCount = 1 );
     static sal_uInt32 Unlock( bool bUnlockAll = false );
 
+    static bool ProcessSingleTask( sal_uInt64 nTime,
+                                   ImplSchedulerData ** const pLastDataPtr );
+
 public:
     static constexpr sal_uInt64 ImmediateTimeoutMs = 0;
     static constexpr sal_uInt64 InfiniteTimeoutMs  = SAL_MAX_UINT64;
 
     static void       ImplDeInitScheduler();
 
-    /// Process one pending Timer with highhest priority
-    static void       CallbackTaskScheduling();
-    /// Process one pending task ahead of time with highest priority.
-    static bool       ProcessTaskScheduling();
+    /**
+     * Process one or all current pending tasks, ranked by priority
+     *
+     * @param bHandleAllCurrentEvents process one or all pending tasks
+     * @return true, if any task was processed
+     */
+    static bool       ProcessTaskScheduling( bool bHandleAllCurrentEvents );
     /**
      * Process all events until none is pending
      *
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 60be08f83c09..64890b02129f 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -105,7 +105,7 @@ sd::DrawDocShellRef SdMiscTest::Load(const OUString& rURL, sal_Int32 nFormat)
     for (int i = 0; i < 1000; i++)
     {
         // Process all Tasks - slide sorter is created here
-        while (Scheduler::ProcessTaskScheduling());
+        Scheduler::ProcessEventsToIdle();
         if ((pSSVS = sd::slidesorter::SlideSorterViewShell::GetSlideSorter(pViewShell->GetViewShellBase())) != nullptr)
             break;
         osl::Thread::wait(std::chrono::milliseconds(100));
@@ -149,7 +149,7 @@ void SdMiscTest::testTdf96708()
 
     // Now wait for timers to trigger creation of auto-layout
     osl::Thread::wait(std::chrono::milliseconds(100));
-    Scheduler::ProcessTaskScheduling();
+    Scheduler::ProcessEventsToIdle();
 
     rSSController.GetClipboard().DoPaste();
     const sal_uInt16 nMasterPageCnt2 = xDocSh->GetDoc()->GetMasterSdPageCount(PageKind::Standard);
diff --git a/vcl/README.scheduler b/vcl/README.scheduler
index 80c14b032c54..ed44b66f5753 100644
--- a/vcl/README.scheduler
+++ b/vcl/README.scheduler
@@ -105,11 +105,8 @@ bool DoYield( bool bWait, bool bAllCurrent )
     if ( !bAllCurrent && bWasEvent )
         return true;
     bWasEvent = ProcessSystemEvents( bAllCurrent, &bWasSchedulerEvent ) || bWasEvent;
-    if ( !bWasSchedulerEvent && IsSchedulerEvent() )
-    {
-        ProcessSchedulerEvent()
-        bWasEvent = true;
-    }
+    if ( (!bWasSchedulerEvent || bAllCurrent) && IsSchedulerEvent() )
+        bWasEvent = ProcessSchedulerEvent( bAllCurrent ) || bWasEvent;
     if ( !bWasEvent && bWait )
     {
         WaitForSystemEvents();
@@ -118,6 +115,11 @@ bool DoYield( bool bWait, bool bAllCurrent )
     return bWasEvent;
 }
 
+Since the Scheduler works priority based, processing all current events
+might return before all current tasks are processed, if the next task
+has a higher priority then a current task, but was started after the
+current time!
+
 == General: main thread deferral ==
 
 Currently for Mac and Windows, we run main thread deferrals by disabling the
diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index 3c181ace2ff6..13ce4f83061f 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -69,7 +69,7 @@ AndroidSalInstance::~AndroidSalInstance()
 bool AndroidSalInstance::AnyInput( VclInputFlags nType )
 {
     if( nType & VclInputFlags::TIMER )
-        return CheckTimeout( false );
+        return HandleTimeout( HandleTimeoutMode::CheckOnly );
 
     // Unfortunately there is no way to check for a specific type of
     // input being queued. That information is too hidden, sigh.
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 44df78a7df60..478fcfd85c5e 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -164,7 +164,7 @@ void SvpSalInstance::Wakeup()
 #endif
 }
 
-bool SvpSalInstance::CheckTimeout( bool bExecuteTimers )
+bool SvpSalInstance::HandleTimeout( const HandleTimeoutMode eMode )
 {
     bool bRet = false;
     if( m_aTimeout.tv_sec ) // timer is started
@@ -174,7 +174,7 @@ bool SvpSalInstance::CheckTimeout( bool bExecuteTimers )
         if( aTimeOfDay >= m_aTimeout )
         {
             bRet = true;
-            if( bExecuteTimers )
+            if( eMode != HandleTimeoutMode::CheckOnly )
             {
                 // timed out, update timeout
                 m_aTimeout = aTimeOfDay;
@@ -183,9 +183,8 @@ bool SvpSalInstance::CheckTimeout( bool bExecuteTimers )
                 osl::Guard< comphelper::SolarMutex > aGuard( mpSalYieldMutex.get() );
 
                 // notify
-                ImplSVData* pSVData = ImplGetSVData();
-                if( pSVData->maSchedCtx.mpSalTimer )
-                    pSVData->maSchedCtx.mpSalTimer->CallCallback();
+                bRet = SalTimer::CallCallback(
+                    eMode == HandleTimeoutMode::ProcessAllCurrentTasks );
             }
         }
     }
@@ -269,7 +268,9 @@ bool SvpSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents)
     if ( !bHandleAllCurrentEvents &&bEvent )
         return true;
 
-    bEvent = CheckTimeout() || bEvent;
+    bEvent = HandleTimeout( bHandleAllCurrentEvents
+         ? HandleTimeoutMode::ProcessAllCurrentTasks
+         : HandleTimeoutMode::ProcessSingleTask ) || bEvent;
 
     if (bWait && ! bEvent )
     {
@@ -330,7 +331,7 @@ void SvpSalInstance::DoReleaseYield( int nTimeoutMS )
 bool SvpSalInstance::AnyInput( VclInputFlags nType )
 {
     if( nType & VclInputFlags::TIMER )
-        return CheckTimeout( false );
+        return HandleTimeout( HandleTimeoutMode::CheckOnly );
     return false;
 }
 
diff --git a/vcl/inc/headless/svpinst.hxx b/vcl/inc/headless/svpinst.hxx
index ba80960326dc..17ee24cd8107 100644
--- a/vcl/inc/headless/svpinst.hxx
+++ b/vcl/inc/headless/svpinst.hxx
@@ -85,7 +85,7 @@ public:
     inline void             registerFrame( SalFrame* pFrame );
     inline void             deregisterFrame( SalFrame* pFrame );
 
-    bool                    CheckTimeout( bool bExecuteTimers = true );
+    bool                    HandleTimeout( HandleTimeoutMode eMode );
 
     // Frame
     virtual SalFrame*       CreateChildFrame( SystemParentData* pParent, SalFrameStyleFlags nStyle ) override;
diff --git a/vcl/inc/osx/saldata.hxx b/vcl/inc/osx/saldata.hxx
index 357a2df6a74b..fea6d4908ea2 100644
--- a/vcl/inc/osx/saldata.hxx
+++ b/vcl/inc/osx/saldata.hxx
@@ -62,7 +62,6 @@ class SystemFontList;
 class SalData
 {
 public:
-    SALTIMERPROC                                  mpTimerProc;      // timer callback proc
     AquaSalInstance                              *mpInstance;
     std::list<AquaSalFrame*>                      maPresentationFrames;  // list of frames in presentation mode
     SalObject                                    *mpFirstObject;    // pointer of first object window
diff --git a/vcl/inc/osx/saltimer.h b/vcl/inc/osx/saltimer.h
index a9934f280636..97c8db397e9c 100644
--- a/vcl/inc/osx/saltimer.h
+++ b/vcl/inc/osx/saltimer.h
@@ -47,7 +47,7 @@ class AquaSalTimer final : public SalTimer, protected VersionedEvent
     bool        m_bDirectTimeout;    ///< timeout can be processed directly
 
     void queueDispatchTimerEvent( bool bAtStart );
-    void callTimerCallback();
+    bool callTimerCallback( bool bHandleAllCurrentEvents );
 
 public:
     AquaSalTimer();
@@ -58,7 +58,7 @@ public:
 
     void handleStartTimerEvent( NSEvent* pEvent );
     bool handleDispatchTimerEvent( NSEvent* pEvent );
-    void handleTimerElapsed();
+    bool handleTimerElapsed( bool bHandleAllCurrentEvents );
     void handleWindowShouldClose();
 
     bool IsTimerElapsed() const;
diff --git a/vcl/inc/saltimer.hxx b/vcl/inc/saltimer.hxx
index 983e0771ee9b..9fde8de82071 100644
--- a/vcl/inc/saltimer.hxx
+++ b/vcl/inc/saltimer.hxx
@@ -22,8 +22,9 @@
 
 #include <sal/config.h>
 #include <vcl/dllapi.h>
-#include <salwtype.hxx>
-#include <iostream>
+#include <svdata.hxx>
+
+typedef bool (*SALTIMERPROC)( bool bHandleAllCurrentEvents );
 
 /*
  * note: there will be only a single instance of SalTimer
@@ -40,19 +41,32 @@ public:
     virtual ~SalTimer() COVERITY_NOEXCEPT_FALSE;
 
     // AutoRepeat and Restart
-    virtual void            Start( sal_uLong nMS ) = 0;
-    virtual void            Stop() = 0;
+    virtual void Start( sal_uLong nMS ) = 0;
+    virtual void Stop() = 0;
 
     // Callbacks (indepen in \sv\source\app\timer.cxx)
-    void            SetCallback( SALTIMERPROC pProc )
+    void SetCallback( SALTIMERPROC pProc )
     {
         m_pProc = pProc;
     }
 
-    void            CallCallback()
+    bool Timeout( bool bHandleAllCurrentEvents )
     {
+        bool bRet = false;
         if( m_pProc )
-            m_pProc();
+            bRet = m_pProc( bHandleAllCurrentEvents );
+        return bRet;
+    }
+
+    static bool CallCallback( bool bHandleAllCurrentEvents )
+    {
+        ImplSVData* pSVData = ImplGetSVData();
+        bool bRet = false;
+        assert( pSVData );
+        SalTimer *pTimer = pSVData->maSchedCtx.mpSalTimer;
+        if( pTimer )
+            bRet = pTimer->Timeout( bHandleAllCurrentEvents );
+        return bRet;
     }
 };
 
diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx
index 1538c8e78a25..e4eca95dcfe8 100644
--- a/vcl/inc/salwtype.hxx
+++ b/vcl/inc/salwtype.hxx
@@ -215,7 +215,8 @@ struct SalQueryCharPositionEvent
 
 typedef bool (*SALFRAMEPROC)( vcl::Window* pInst, SalEvent nEvent, const void* pEvent );
 
-enum class SalObjEvent {
+enum class SalObjEvent
+{
     GetFocus           = 1,
     LoseFocus          = 2,
     ToTop              = 3
@@ -258,7 +259,12 @@ struct SalLongPressEvent
     long mnY;
 };
 
-typedef void (*SALTIMERPROC)();
+enum class HandleTimeoutMode
+{
+    CheckOnly,
+    ProcessSingleTask,
+    ProcessAllCurrentTasks
+};
 
 #endif // INCLUDED_VCL_INC_SALWTYPE_HXX
 
diff --git a/vcl/inc/unx/saldata.hxx b/vcl/inc/unx/saldata.hxx
index 6a7902dbf444..753f6ce8973b 100644
--- a/vcl/inc/unx/saldata.hxx
+++ b/vcl/inc/unx/saldata.hxx
@@ -72,8 +72,6 @@ public:
 
     SalXLib*        GetLib() const { return pXLib_; }
 
-    static void             Timeout();
-
     // X errors
     virtual void            ErrorTrapPush() override;
     virtual bool            ErrorTrapPop( bool bIgnoreError = true ) override;
diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx
index 54799149e25c..e8d0f7b67bb9 100644
--- a/vcl/inc/unx/saldisp.hxx
+++ b/vcl/inc/unx/saldisp.hxx
@@ -179,7 +179,7 @@ public:
     virtual void    StartTimer( sal_uLong nMS );
     virtual void    StopTimer();
 
-    virtual bool    CheckTimeout( bool bExecuteTimers = true );
+    virtual bool    HandleTimeout( HandleTimeoutMode eMode );
 
     SalI18N_InputMethod* GetInputMethod() const { return m_pInputMethod; }
     Display*             GetDisplay() const { return m_pDisplay; }
diff --git a/vcl/inc/win/saltimer.h b/vcl/inc/win/saltimer.h
index 61d284d82ddb..ec6b8faebd7a 100644
--- a/vcl/inc/win/saltimer.h
+++ b/vcl/inc/win/saltimer.h
@@ -43,7 +43,7 @@ class WinSalTimer final : public SalTimer, protected VersionedEvent
     void ImplStart( sal_uIntPtr nMS );
     void ImplStop();
     bool ImplHandleTimerEvent( WPARAM aWPARAM );
-    void ImplHandleElapsedTimer();
+    bool ImplHandleElapsedTimer( bool bHandleAllCurrentEvents );
     bool ImplHandle_WM_TIMER( WPARAM aWPARAM );
 
 public:
diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx
index a445e5cfb7ad..b35210bc6754 100644
--- a/vcl/osx/saldata.cxx
+++ b/vcl/osx/saldata.cxx
@@ -36,7 +36,6 @@ static void SAL_CALL releasePool( void* pPool )
 
 SalData::SalData()
 :
-    mpTimerProc( nullptr ),
     mpInstance( nullptr ),
     mpFirstObject( nullptr ),
     mpFirstVD( nullptr ),
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index c0d28fe4bc3f..5798f5b3e7a1 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -538,7 +538,7 @@ private:
         if ( bWasLiveResize != bIsLiveResize )
         {
             GetSalData()->mpInstance->mbIsLiveResize = bIsLiveResize;
-            Scheduler::ProcessTaskScheduling();
+            Scheduler::ProcessTaskScheduling( false );
         }
     }
 
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 922046bcbfe8..8add64168bb3 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -603,11 +603,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
         while( true );
 
         AquaSalTimer *pTimer = static_cast<AquaSalTimer*>( ImplGetSVData()->maSchedCtx.mpSalTimer );
-        if ( !mbTimerProcessed && pTimer && pTimer->IsDirectTimeout() )
-        {
-            pTimer->handleTimerElapsed();
-            bHadEvent = true;
-        }
+        if ( (!mbTimerProcessed || bHandleAllCurrentEvents) && pTimer && pTimer->IsDirectTimeout() )
+            bHadEvent = pTimer->handleTimerElapsed( bHandleAllCurrentEvents ) || bHadEvent;
 
         // if we had no event yet, wait for one if requested
         if( bWait && ! bHadEvent )
diff --git a/vcl/osx/salnstimer.mm b/vcl/osx/salnstimer.mm
index 9647bb6b87c1..b21e6a7e9695 100644
--- a/vcl/osx/salnstimer.mm
+++ b/vcl/osx/salnstimer.mm
@@ -32,7 +32,7 @@
     (void) pNSTimer;
     AquaSalTimer *pTimer = static_cast<AquaSalTimer*>( ImplGetSVData()->maSchedCtx.mpSalTimer );
     if (pTimer)
-        pTimer->handleTimerElapsed();
+        pTimer->handleTimerElapsed( false );
 }
 
 @end
diff --git a/vcl/osx/saltimer.cxx b/vcl/osx/saltimer.cxx
index 3d74da42a3dc..cd7ea2e58e12 100644
--- a/vcl/osx/saltimer.cxx
+++ b/vcl/osx/saltimer.cxx
@@ -137,32 +137,33 @@ void AquaSalTimer::Stop()
     InvalidateEvent();
 }
 
-void AquaSalTimer::callTimerCallback()
+bool AquaSalTimer::callTimerCallback( bool bHandleAllCurrentEvents )
 {
-    ImplSVData* pSVData = ImplGetSVData();
     SolarMutexGuard aGuard;
     m_bDirectTimeout = false;
-    if( pSVData->maSchedCtx.mpSalTimer )
-        pSVData->maSchedCtx.mpSalTimer->CallCallback();
+    return SalTimer::CallCallback( bHandleAllCurrentEvents );
 }
 
-void AquaSalTimer::handleTimerElapsed()
+bool AquaSalTimer::handleTimerElapsed( bool bHandleAllCurrentEvent )
 {
+    bool bRet = false;
+
     if ( m_bDirectTimeout || GetSalData()->mpInstance->mbIsLiveResize )
     {
-        // Stop the timer, as it is just invalidated after the firing function
-        Stop();
-        callTimerCallback();
-    }
-    else
-        queueDispatchTimerEvent( YES );
+         // Stop the timer, as it is just invalidated after the firing function
+         Stop();
+         bRet = callTimerCallback( bHandleAllCurrentEvent );
+     }
+     else
+         queueDispatchTimerEvent( YES );
+    return bRet;
 }
 
 bool AquaSalTimer::handleDispatchTimerEvent( NSEvent *pEvent )
 {
     bool bIsValidEvent = IsValidEventVersion( [pEvent data1] );
     if ( bIsValidEvent )
-        callTimerCallback();
+        callTimerCallback( false );
     return bIsValidEvent;
 }
 
diff --git a/vcl/qa/cppunit/lifecycle.cxx b/vcl/qa/cppunit/lifecycle.cxx
index 26f8796a57ea..18160ccdb056 100644
--- a/vcl/qa/cppunit/lifecycle.cxx
+++ b/vcl/qa/cppunit/lifecycle.cxx
@@ -212,7 +212,7 @@ void LifecycleTest::testFocus()
     xWin->Show();
     xChild->GrabFocus();
     // process asynchronous ToTop
-    Scheduler::ProcessTaskScheduling();
+    Scheduler::ProcessTaskScheduling( false );
     // FIXME: really awful to test focus issues without showing windows.
     // CPPUNIT_ASSERT(xChild->HasFocus());
 }
diff --git a/vcl/qa/cppunit/timer.cxx b/vcl/qa/cppunit/timer.cxx
index 7b712bd76c04..a94d44cb7a15 100644
--- a/vcl/qa/cppunit/timer.cxx
+++ b/vcl/qa/cppunit/timer.cxx
@@ -402,8 +402,10 @@ public:
     {
         Start();
         if (mpOther)
+        {
             mpOther->Start();
-        Application::Yield();
+            Application::Yield();
+        }
         if (mpTriggered)
             *mpTriggered = true;
     }
diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index 8fd26ec79a55..6c3059cedec1 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -236,7 +236,7 @@ void Scheduler::ImplStartTimer(sal_uInt64 nMS, bool bForce, sal_uInt64 nTime)
         rSchedCtx.mnTimerStart = 0;
         rSchedCtx.mnTimerPeriod = InfiniteTimeoutMs;
         rSchedCtx.mpSalTimer = pSVData->mpDefInst->CreateSalTimer();
-        rSchedCtx.mpSalTimer->SetCallback(Scheduler::CallbackTaskScheduling);
+        rSchedCtx.mpSalTimer->SetCallback( Scheduler::ProcessTaskScheduling );
     }
 
     assert(SAL_MAX_UINT64 - nMS >= nTime);
@@ -256,12 +256,6 @@ void Scheduler::ImplStartTimer(sal_uInt64 nMS, bool bForce, sal_uInt64 nTime)
     }
 }
 
-void Scheduler::CallbackTaskScheduling()
-{
-    // this function is for the saltimer callback
-    Scheduler::ProcessTaskScheduling();
-}
-
 static bool g_bDeterministicMode = false;
 
 void Scheduler::SetDeterministicMode(bool bDeterministic)
@@ -325,7 +319,8 @@ static inline ImplSchedulerData* DropSchedulerData(
     return pSchedulerDataNext;
 }
 
-bool Scheduler::ProcessTaskScheduling()
+bool Scheduler::ProcessSingleTask( const sal_uInt64 nTime,
+                                   ImplSchedulerData ** const pLastDataPtr )
 {
     ImplSVData *pSVData = ImplGetSVData();
     ImplSchedulerContext &rSchedCtx = pSVData->maSchedCtx;
@@ -336,25 +331,26 @@ bool Scheduler::ProcessTaskScheduling()
     if ( !rSchedCtx.mbActive || InfiniteTimeoutMs == rSchedCtx.mnTimerPeriod )
         return false;
 
-    sal_uInt64 nTime = tools::Time::GetSystemTicks();
     if ( nTime < rSchedCtx.mnTimerStart + rSchedCtx.mnTimerPeriod )
     {
-        SAL_WARN( "vcl.schedule", "we're too early - restart the timer!" );
+        SAL_WARN_IF( !pLastDataPtr,
+                     "vcl.schedule", "we're too early - restart the timer!" );
         UpdateSystemTimer( rSchedCtx,
                            rSchedCtx.mnTimerStart + rSchedCtx.mnTimerPeriod - nTime,
                            true, nTime );
         return false;
     }
 
-    ImplSchedulerData* pSchedulerData = nullptr;
+    ImplSchedulerData* pSchedulerData = rSchedCtx.mpFirstSchedulerData;
     ImplSchedulerData* pPrevSchedulerData = nullptr;
     ImplSchedulerData *pMostUrgent = nullptr;
     ImplSchedulerData *pPrevMostUrgent = nullptr;
     sal_uInt64         nMinPeriod = InfiniteTimeoutMs;
     sal_uInt64         nMostUrgentPeriod = InfiniteTimeoutMs;
     sal_uInt64         nReadyPeriod = InfiniteTimeoutMs;
+    bool               bAfterLastData = false;
+    bool               bInvokeMostUrgent = ( !pLastDataPtr || *pLastDataPtr );
 
-    pSchedulerData = rSchedCtx.mpFirstSchedulerData;
     while ( pSchedulerData )
     {
         const Timer *timer = dynamic_cast<Timer*>( pSchedulerData->mpTask );
@@ -386,6 +382,8 @@ bool Scheduler::ProcessTaskScheduling()
                     pSchedulerData->mpTask->mpSchedulerData = nullptr;
                 delete pSchedulerData;
             }
+            if ( pLastDataPtr && *pLastDataPtr == pSchedulerData )
+                bAfterLastData = true;
             pSchedulerData = pSchedulerDataNext;
             continue;
         }
@@ -404,11 +402,15 @@ bool Scheduler::ProcessTaskScheduling()
             pPrevMostUrgent = pPrevSchedulerData;
             pMostUrgent = pSchedulerData;
             nMostUrgentPeriod = nReadyPeriod;
+            if ( bAfterLastData || pMostUrgent->mnUpdateTime > nTime )
+                bInvokeMostUrgent = false;
         }
         else if ( nMinPeriod > nReadyPeriod )
             nMinPeriod = nReadyPeriod;
 
 next_entry:
+        if ( pLastDataPtr && *pLastDataPtr == pSchedulerData )
+            bAfterLastData = true;
         pPrevSchedulerData = pSchedulerData;
         pSchedulerData = pSchedulerData->mpNext;
     }
@@ -417,8 +419,19 @@ next_entry:
         SAL_INFO("vcl.schedule", "Calculated minimum timeout as " << nMinPeriod );
     UpdateSystemTimer( rSchedCtx, nMinPeriod, true, nTime );
 
-    if ( pMostUrgent )
+    if ( pMostUrgent && !bInvokeMostUrgent )
+    {
+        nReadyPeriod = pMostUrgent->mpTask->UpdateMinPeriod( nMinPeriod, nTime );
+        if ( nMinPeriod > nReadyPeriod )
+            nMinPeriod = nReadyPeriod;
+        UpdateSystemTimer( rSchedCtx, nMinPeriod, false, nTime );
+        pMostUrgent = nullptr;
+    }
+    else if ( pMostUrgent )
     {
+        if ( pLastDataPtr && *pLastDataPtr == pMostUrgent )
+            *pLastDataPtr = nullptr;
+
         SAL_INFO( "vcl.schedule", tools::Time::GetSystemTicks() << " "
                   << pMostUrgent << "  invoke-in  " << *pMostUrgent->mpTask );
 
@@ -460,6 +473,8 @@ next_entry:
             AppendSchedulerData( rSchedCtx, pSchedulerData );
             UpdateSystemTimer( rSchedCtx, ImmediateTimeoutMs, true,
                                tools::Time::GetSystemTicks() );
+            if ( pLastDataPtr && *pLastDataPtr && rSchedCtx.mpLastSchedulerData != *pLastDataPtr )
+                *pLastDataPtr = rSchedCtx.mpLastSchedulerData;
         }
         else
         {
@@ -484,6 +499,26 @@ next_entry:
     return !!pMostUrgent;
 }
 
+bool Scheduler::ProcessTaskScheduling( bool bHandleAllCurrentEvents )
+{
+    sal_uInt64 nTime = tools::Time::GetSystemTicks();
+    bool bWasEvent = false, bAnyEvent = false;
+    ImplSchedulerData *pLastData = ImplGetSVData()->maSchedCtx.mpLastSchedulerData;
+    ImplSchedulerData ** const pLastDataPtr = bHandleAllCurrentEvents ? &pLastData : nullptr;
+    SAL_INFO_IF( bHandleAllCurrentEvents, "vcl.schedule", tools::Time::GetSystemTicks()
+        << " process all current events - start" );
+    do
+    {
+        bWasEvent = ProcessSingleTask( nTime, pLastDataPtr );
+        if ( !bAnyEvent && bWasEvent )
+            bAnyEvent = bWasEvent;
+    }
+    while ( bWasEvent && bHandleAllCurrentEvents );
+    SAL_INFO_IF( bHandleAllCurrentEvents, "vcl.schedule", tools::Time::GetSystemTicks()
+        << " process all current events - done" );
+    return bAnyEvent;
+}
+
 void Task::StartTimer( sal_uInt64 nMS )
 {
     Scheduler::ImplStartTimer( nMS, false, tools::Time::GetSystemTicks() );
diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx
index 4ad2c02db54f..39bab4f7368f 100644
--- a/vcl/unx/generic/app/saldata.cxx
+++ b/vcl/unx/generic/app/saldata.cxx
@@ -560,13 +560,6 @@ void X11SalData::XError( Display *pDisplay, XErrorEvent *pEvent )
     m_aXErrorHandlerStack.back().m_bWas = true;
 }
 
-void X11SalData::Timeout()
-{
-    ImplSVData* pSVData = ImplGetSVData();
-    if( pSVData->maSchedCtx.mpSalTimer )
-        pSVData->maSchedCtx.mpSalTimer->CallCallback();
-}
-
 struct YieldEntry
 {
     int         fd;         // file descriptor for reading
@@ -622,7 +615,7 @@ void SalXLib::Remove( int nFD )
     }
 }
 
-bool SalXLib::CheckTimeout( bool bExecuteTimers )
+bool SalXLib::HandleTimeout( HandleTimeoutMode eMode )
 {
     bool bRet = false;
     if( m_aTimeout.tv_sec ) // timer is started
@@ -632,7 +625,7 @@ bool SalXLib::CheckTimeout( bool bExecuteTimers )
         if( aTimeOfDay >= m_aTimeout )
         {
             bRet = true;
-            if( bExecuteTimers )
+            if( eMode != HandleTimeoutMode::CheckOnly )
             {
                 // timed out, update timeout
                 m_aTimeout = aTimeOfDay;
@@ -644,7 +637,7 @@ bool SalXLib::CheckTimeout( bool bExecuteTimers )
                 */
                 m_aTimeout += m_nTimeoutMS;
                 // notify
-                X11SalData::Timeout();
+                bRet = SalTimer::CallCallback( eMode == HandleTimeoutMode::ProcessAllCurrentTasks );
             }
         }
     }
@@ -655,10 +648,7 @@ bool
 SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents )
 {
     // check for timeouts here if you want to make screenshots
-    static char* p_prioritize_timer = getenv ("SAL_HIGHPRIORITY_REPAINT");
     bool bHandledEvent = false;
-    if (p_prioritize_timer != nullptr)
-        bHandledEvent = CheckTimeout();
 
     const int nMaxEvents = bHandleAllCurrentEvents ? 100 : 1;
 
@@ -724,8 +714,9 @@ SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents )
     }
 
     // usually handle timeouts here (as in 5.2)
-    if (p_prioritize_timer == nullptr)
-        bHandledEvent = CheckTimeout() || bHandledEvent;
+    bHandledEvent = HandleTimeout( bHandleAllCurrentEvents
+                  ? HandleTimeoutMode::ProcessAllCurrentTasks
+                  : HandleTimeoutMode::ProcessSingleTask ) || bHandledEvent;
 
     // handle wakeup events.
     if ((nFound > 0) && FD_ISSET(m_pTimeoutFDS[0], &ReadFDS))
diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx
index 0d30e1d17a99..b1615b052e94 100644
--- a/vcl/unx/generic/app/salinst.cxx
+++ b/vcl/unx/generic/app/salinst.cxx
@@ -145,7 +145,8 @@ bool X11SalInstance::AnyInput(VclInputFlags nType)
     Display *pDisplay  = vcl_sal::getSalDisplay(pData)->GetDisplay();
     bool bRet = false;
 
-    if( (nType & VclInputFlags::TIMER) && (mpXLib && mpXLib->CheckTimeout(false)) )
+    if( (nType & VclInputFlags::TIMER)
+            && mpXLib && mpXLib->HandleTimeout( HandleTimeoutMode::CheckOnly ) )
         bRet = true;
 
     if( !bRet && XPending(pDisplay) )
diff --git a/vcl/unx/gtk/gtkdata.cxx b/vcl/unx/gtk/gtkdata.cxx
index 97541eed22c1..6f849f212eaa 100644
--- a/vcl/unx/gtk/gtkdata.cxx
+++ b/vcl/unx/gtk/gtkdata.cxx
@@ -728,9 +728,7 @@ extern "C" {
 
         sal_gtk_timeout_defer( pTSource );
 
-        ImplSVData* pSVData = ImplGetSVData();
-        if( pSVData->maSchedCtx.mpSalTimer )
-            pSVData->maSchedCtx.mpSalTimer->CallCallback();
+        SalTimer::CallCallback( false );
 
         return G_SOURCE_REMOVE;
     }
diff --git a/vcl/unx/gtk3/gtk3gtkdata.cxx b/vcl/unx/gtk3/gtk3gtkdata.cxx
index f4d41a53d2c0..bf69882d181f 100644
--- a/vcl/unx/gtk3/gtk3gtkdata.cxx
+++ b/vcl/unx/gtk3/gtk3gtkdata.cxx
@@ -693,9 +693,7 @@ extern "C" {
 
         sal_gtk_timeout_defer( pTSource );
 
-        ImplSVData* pSVData = ImplGetSVData();
-        if( pSVData->maSchedCtx.mpSalTimer )
-            pSVData->maSchedCtx.mpSalTimer->CallCallback();
+        SalTimer::CallCallback( false );
 
         return G_SOURCE_REMOVE;
     }
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 43e055a2c0bb..8be84f99a925 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -42,6 +42,8 @@
 
 #include "KDESalDisplay.hxx"
 
+#include <saltimer.hxx>
+
 #if KDE4_HAVE_GLIB
 #include "KDE4FilePicker.hxx"
 #include "tst_exclude_socket_notifiers.moc"
@@ -356,11 +358,11 @@ void KDEXLib::StopTimer()
     timeoutTimer.stop();
 }
 
-bool KDEXLib::CheckTimeout( bool bExecuteTimers )
+bool KDEXLib::HandleTimeout( HandleTimeoutMode eMode )
 {
     if( !m_isGlibEventLoopType )
-        return SalXLib::CheckTimeout( bExecuteTimers );
-    assert( !bExecuteTimers );
+        return SalXLib::HandleTimeout( eMode );
+    assert( eMode == HandleTimeoutMode::CheckOnly );
     return m_bTimedOut;
 }
 
@@ -376,7 +378,7 @@ void KDEXLib::customEvent(QEvent* e)
     if( e->type() == m_timerEventId )
     {
         m_bTimedOut = false;
-        X11SalData::Timeout();
+        SalTimer::CallCallback( false );
     }
 }
 
diff --git a/vcl/unx/kde4/KDEXLib.hxx b/vcl/unx/kde4/KDEXLib.hxx
index 452aae8b3286..e2d6d6b024fb 100644
--- a/vcl/unx/kde4/KDEXLib.hxx
+++ b/vcl/unx/kde4/KDEXLib.hxx
@@ -84,7 +84,7 @@ public:
         virtual void Remove( int fd ) override;
         virtual void StartTimer( sal_uLong nMS ) override;
         virtual void StopTimer() override;
-        virtual bool CheckTimeout( bool bExecuteTimers = true ) override;
+        virtual bool HandleTimeout( HandleTimeoutMode eMode ) override;
         virtual void Wakeup() override;
         void TriggerUserEventProcessing();
 
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 68ad7deb994d..12529337268c 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -512,11 +512,8 @@ bool ImplSalYield( bool bWait, bool bHandleAllCurrentEvents )
     // event loop with timeout messages.
     // We ensure we never handle more then one timeout per call.
     // This way we'll always process a normal system message.
-    if ( !bWasTimeoutMsg && pTimer && pTimer->IsDirectTimeout() )
-    {
-        pTimer->ImplHandleElapsedTimer();
-        bWasMsg = true;
-    }
+    if ( (!bWasTimeoutMsg || bHandleAllCurrentEvents) && pTimer && pTimer->IsDirectTimeout() )
+        bWasMsg = pTimer->ImplHandleElapsedTimer( bHandleAllCurrentEvents ) || bWasMsg;
 
     if ( bHandleAllCurrentEvents )
         nLastTicks = nCurTicks;
diff --git a/vcl/win/app/saltimer.cxx b/vcl/win/app/saltimer.cxx
index 9c67e841956e..2098e757d953 100644
--- a/vcl/win/app/saltimer.cxx
+++ b/vcl/win/app/saltimer.cxx
@@ -147,15 +147,16 @@ void CALLBACK SalTimerProc(PVOID data, BOOLEAN)
     }
 }
 
-void WinSalTimer::ImplHandleElapsedTimer()
+bool WinSalTimer::ImplHandleElapsedTimer( bool bHandleAllCurrentEvents )
 {
     // Test for MouseLeave
     SalTestMouseLeave();
 
     m_bDirectTimeout = false;
     ImplSalYieldMutexAcquireWithWait();
-    CallCallback();
+    bool bRet = Timeout( bHandleAllCurrentEvents );
     ImplSalYieldMutexRelease();
+    return bRet;
 }
 
 bool WinSalTimer::ImplHandleTimerEvent( const WPARAM aWPARAM )
@@ -163,9 +164,7 @@ bool WinSalTimer::ImplHandleTimerEvent( const WPARAM aWPARAM )
     assert( aWPARAM <= SAL_MAX_INT32 );
     if ( !IsValidEventVersion( static_cast<sal_Int32>( aWPARAM ) ) )
         return false;
-
-    ImplHandleElapsedTimer();
-    return true;
+    return ImplHandleElapsedTimer( false );
 }
 
 void WinSalTimer::SetForceRealTimer( const bool bVal )
@@ -185,9 +184,7 @@ bool WinSalTimer::ImplHandle_WM_TIMER( const WPARAM aWPARAM )
     assert( m_aWmTimerId == aWPARAM );
     if ( !(m_aWmTimerId == aWPARAM && m_bDirectTimeout && m_bForceRealTimer) )
         return false;
-
-    ImplHandleElapsedTimer();
-    return true;
+    return ImplHandleElapsedTimer( false );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 28cdca987fc7e0eeadeb158fc20ea03e5d67ac19
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Mon Oct 16 19:03:59 2017 +0200

    tdf#105062 prevent AutoRecovery DB deadlock
    
    AutoRecovery document event notification - at least for Firebird
    DB files - needs the SolarMutex for getLocation().
    
    If I place the SolarMutex inside the CacheLockGuard I get a the
    css::uno::RuntimeException from CacheLockGuard::lock.
    
    Change-Id: I3341a80ecf144d29e0a68de6695d1ca6a7241c60

diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index d1b106592d4e..53f02f4e3d5f 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -2606,6 +2606,7 @@ void AutoRecovery::implts_updateDocumentUsedForSavingState(const css::uno::Refer
 
 void AutoRecovery::implts_markDocumentAsSaved(const css::uno::Reference< css::frame::XModel >& xDocument)
 {
+    SolarMutexGuard aSolarGuard;
     CacheLockGuard aCacheLock(this, cppu::WeakComponentImplHelperBase::rBHelper.rMutex, m_nDocCacheLock, LOCK_FOR_CACHE_USE);
 
     AutoRecovery::TDocumentInfo aInfo;
commit b85b19b273eeed6d24ffea2225c9c2cc87b17ce4
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Wed Oct 18 14:54:20 2017 +0200

    Prefer ACE over Jet ODBC Excel drivers in VB tests
    
    The Jet drivers are deprectated and unsupported, but still
    shipped in Windows 10 - for whatever reason...
    
    This seems totally in contrast to the position in the MSDN blog:
    
    https://blogs.msdn.microsoft.com/dataaccesstechnologies/2017/10/
    18/unexpected-error-from-external-database-driver-1-microsoft-jet-
    database-engine-after-applying-october-security-updates/
    
    The original MSDN thread mentiones, that the msexcl40.dll
    actually broke the MS Jet driver:
    
    https://social.msdn.microsoft.com/Forums/en-US/2feac7ff-3fbd-4d46-
    afdc-65341762f753/odbc-excel-driver-stopped-working-with-
    unexpected-error-from-external-database-driver-1?forum=sqldataaccess
    
    So we detect the incompatible Excel DLL version used via Jet and
    eventually skip the ODBC tests.
    
    The ole_dfltObjDflMethod.vb is adapted to use the driver name from
    the macro call, instead of the fixed "Microsoft.Jet.OLEDB.4.0".
    
    Essentially commit 66b3970c946bd25647484ea1ac2c2e62bd9fb7b4 is
    reverted.
    
    Change-Id: I2dfc525c7cdf7ceb7f46521905933f9ce67aa2e6

diff --git a/basic/CppunitTest_basic_macros.mk b/basic/CppunitTest_basic_macros.mk
index 8b0dccece557..6c418d76a993 100644
--- a/basic/CppunitTest_basic_macros.mk
+++ b/basic/CppunitTest_basic_macros.mk
@@ -44,6 +44,7 @@ $(eval $(call gb_CppunitTest_use_system_win32_libs,basic_macros, \
 	$(if $(filter 140 150,$(VCVER)),legacy_stdio_definitions) \
 	odbc32 \
 	odbccp32 \
+	version \
 ))
 endif
 
diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx
index d153a1d62f82..e7464d04d9b3 100644
--- a/basic/qa/cppunit/test_vba.cxx
+++ b/basic/qa/cppunit/test_vba.cxx
@@ -30,13 +30,17 @@ namespace
         public:
         VBATest() : BootstrapFixture(true, false) {}
         void testMiscVBAFunctions();
+#ifdef _WIN32
         void testMiscOLEStuff();
+#endif
         // Adds code needed to register the test suite
         CPPUNIT_TEST_SUITE(VBATest);
 
         // Declares the method as a test to call
         CPPUNIT_TEST(testMiscVBAFunctions);
+#ifdef _WIN32
         CPPUNIT_TEST(testMiscOLEStuff);
+#endif
 
         // End of test suite definition
         CPPUNIT_TEST_SUITE_END();
@@ -175,16 +179,67 @@ void VBATest::testMiscVBAFunctions()
     }
 }
 
-void VBATest::testMiscOLEStuff()
-{
 // Not much point even trying to run except on Windows.
 // (Without Excel doesn't really do anything anyway,
-// see "so skip test" below.)
+#ifdef _WIN32
+static bool IsIncompatibleExcelJetDriver( const wchar_t *pODBCDriverName )
+{
+    ULONG nError;
+    HKEY hKey;
+
+    if ( wcscmp( pODBCDriverName, L"Microsoft Excel Driver (*.xls)" ) )
+        return false;
+
+    // All lookup failures will result in a aborted test!
+
+    // Find registered Jet Excel DLL in registry
+    std::wstring strValueName( L"SOFTWARE\\Microsoft\\Jet\\4.0\\Engines\\Excel" );
+    nError = RegOpenKeyExW( HKEY_LOCAL_MACHINE, strValueName.c_str(),
+                            0, KEY_QUERY_VALUE, &hKey );
+    if( ERROR_SUCCESS != nError )
+        return true;
+
+    wchar_t dll_name[ 1024 ];
+    DWORD dll_name_size = sizeof( dll_name );
+    nError = RegQueryValueEx( hKey, "Win32", NULL, NULL,
+                              reinterpret_cast<LPBYTE>( dll_name ) , &dll_name_size );
+    RegCloseKey( hKey );
+    if( ERROR_SUCCESS != nError )
+        return true;
+    dll_name[ dll_name_size ] = '\0';
+
+    TCHAR dll_name_expanded[ 1024 ];
+    if ( !ExpandEnvironmentStrings( reinterpret_cast<LPCTSTR>( dll_name ),
+             dll_name_expanded, sizeof( dll_name_expanded ) - 2 ) )
+        return true;
+
+    // Get DLL version
+    DWORD   verHandle     = 0;
+    UINT    size          = 0;
+    LPBYTE  lpBuffer      = NULL;
+    LPCTSTR szVersionFile = reinterpret_cast<LPCTSTR>( dll_name_expanded );
+
+    DWORD verSize = GetFileVersionInfoSize( szVersionFile, &verHandle );
+    if ( 0 == verSize )
+        return true;
+
+    LPSTR verData = static_cast<LPSTR>( alloca( verSize ) );
+    if( !GetFileVersionInfo( szVersionFile, verHandle, verSize, verData) )
+        return true;
+    if( !VerQueryValue( verData, "\\", (VOID FAR* FAR*) &lpBuffer, &size) || !size )
+        return true;
 
-// Since some time, on a properly updated Windows 10, this works
-// only with a 64-bit LibreOffice
+    VS_FIXEDFILEINFO *verInfo = (VS_FIXEDFILEINFO *) lpBuffer;
+    if( 0xfeef04bd != verInfo->dwSignature )
+        return true;
 
-#if defined(_WIN64)
+    // Incompatible version: 4.0.9801.1
+    return verInfo->dwFileVersionMS == 262144
+        && verInfo->dwFileVersionLS == 642318337;
+}
+
+void VBATest::testMiscOLEStuff()
+{
     // test if we have the necessary runtime environment
     // to run the OLE tests.
     uno::Reference< lang::XMultiServiceFactory > xOLEFactory;
@@ -203,27 +258,48 @@ void VBATest::testMiscOLEStuff()
         bOk = xADODB.is();
     }
     if ( !bOk )
-        return; // can't do anything, skip test
+        return; // can't do anything without OLE, so skip test
 
+    // search for the ODBC Excel drivers
     const int nBufSize = 1024 * 4;
     wchar_t sBuf[nBufSize];
-    SQLGetInstalledDriversW( sBuf, nBufSize, nullptr );
+    if( !SQLGetInstalledDriversW( sBuf, nBufSize, nullptr ) )
+        return;
+
+    const wchar_t *aExcelDriverNameList[]
+    {
+        L"Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)",
+        L"Microsoft Excel Driver (*.xls)"
+    };
+    const unsigned MAX_DRV = SAL_N_ELEMENTS( aExcelDriverNameList );
+    bool bFoundDrivers[ MAX_DRV ] = { false, };
 
     const wchar_t *pODBCDriverName = sBuf;
-    bool bFound = false;
-    for (; wcslen( pODBCDriverName ) != 0; pODBCDriverName += wcslen( pODBCDriverName ) + 1 ) {
-        if( wcscmp( pODBCDriverName, L"Microsoft Excel Driver (*.xls)" ) == 0 ||
-            wcscmp( pODBCDriverName, L"Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)" ) == 0 ) {
-            bFound = true;
+    for (; wcslen( pODBCDriverName ) != 0; pODBCDriverName += wcslen( pODBCDriverName ) + 1 )
+    {
+        for ( unsigned i = 0; i < MAX_DRV; ++i )
+            if ( !bFoundDrivers[ i ] && wcscmp( pODBCDriverName, aExcelDriverNameList[ i ] ) == 0 )
+                bFoundDrivers[ i ] = true;
+    }
+
+    pODBCDriverName = nullptr;
+    for ( unsigned i = 0; i < MAX_DRV; ++i )
+        if ( bFoundDrivers[ i ] )
+        {
+            pODBCDriverName = aExcelDriverNameList[ i ];
             break;
         }
-    }
-    if ( !bFound )
-        return; // can't find ODBC driver needed test, so skip test
+
+    if ( !pODBCDriverName )
+        return; // can't find any ODBC driver needed for the test, so skip it
+
+    if ( IsIncompatibleExcelJetDriver( pODBCDriverName ) )
+        return; // found incompatible Excel driver, so skip the tests
 
     const char* macroSource[] = {
         "ole_ObjAssignNoDflt.vb",
         "ole_ObjAssignToNothing.vb",
+        "ole_dfltObjDflMethod.vb",
     };
 
     OUString sMacroPathURL = m_directories.getURLFromSrc("/basic/qa/vba_tests/");
@@ -251,11 +327,8 @@ void VBATest::testMiscOLEStuff()
         CPPUNIT_ASSERT_MESSAGE("No return variable huh?", pReturn.get() != nullptr );
         CPPUNIT_ASSERT_EQUAL_MESSAGE("Result not as expected", OUString("OK"), pReturn->GetOUString() );
     }
-#else
-    // Avoid "this method is empty and should be removed" warning
-    (void) 42;
-#endif
 }
+#endif
 
   // Put the test suite in the registry
   CPPUNIT_TEST_SUITE_REGISTRATION(VBATest);
diff --git a/basic/qa/vba_tests/ole_dfltObjDflMethod.vb b/basic/qa/vba_tests/ole_dfltObjDflMethod.vb
new file mode 100644
index 000000000000..58809a781d7e
--- /dev/null
+++ b/basic/qa/vba_tests/ole_dfltObjDflMethod.vb
@@ -0,0 +1,25 @@
+Option VBASupport 1
+Option Explicit
+
+Rem Test accessing an object that has default object member
+Rem which in turn has a default member that is a method
+Function doUnitTest(TestData As String, Driver as String) As String
+doUnitTest = "Begin"
+Dim modifiedTimout As Long
+Dim cnn1 As New ADODB.Connection
+Dim rst1 As New ADODB.Recordset
+Dim conStr As String
+conStr = "Provider=MSDASQL;Driver={" & Driver & "};DBQ="
+conStr = conStr & TestData & "; ReadOnly=False;"
+conStr = conStr & "Extended Properties=""Excel 8.0;HDR=Yes"";"
+cnn1.Open conStr
+rst1.Open "SELECT * FROM [Sheet1$];", cnn1, adOpenStatic, adLockReadOnly
+Dim val
+val = rst1("FirstName")
+If val = "Paddy" Then
+    doUnitTest = "OK"
+Else
+    doUnitTest = "Failed, expected 'Paddy' got " & val
+End If
+
+End Function
commit 8ba60ca42d4d1873b8cd85c5d3b5ed2f0e19df60
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Mon Oct 16 17:04:24 2017 +0200

    WIN message handling cleanup and refactoring
    
    Replace a lot of duplicated case code with macros.
    Some minor constifications of function parameters.
    
    I restrained from shorten the SAL_MSG_* via preprocessor concat,
    so a grep will still find the whole names.
    
    Change-Id: If1f2477fc8817b4ae7816e807154e35004bb4da9
    Reviewed-on: https://gerrit.libreoffice.org/43531
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 01e50af77b99..a80af4fb5ee7 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -63,6 +63,8 @@ public:
 
 class AquaSalInstance : public SalInstance, public SalUserEventList
 {
+    friend class AquaSalFrame;
+
     bool RunInMainYield( bool bHandleAllCurrentEvents );
 
     virtual void TriggerUserEventProcessing() override;
@@ -81,7 +83,6 @@ public:
 
     static std::list<const ApplicationEvent*> aAppEventList;
 
-public:
     AquaSalInstance();
     virtual ~AquaSalInstance() override;
 
@@ -136,9 +137,6 @@ public:
     // this is needed to avoid duplicate open events through a) command line and b) NSApp's openFile
     static bool isOnCommandLine( const OUString& );
 
-public:
-    friend class AquaSalFrame;
-
     void delayedSettingsChanged( bool bInvalidate );
 
     // Is this the NSAppThread?
diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx
index 0f3e05b8f31a..659fd68f7dda 100644
--- a/vcl/inc/win/saldata.hxx
+++ b/vcl/inc/win/saldata.hxx
@@ -180,8 +180,8 @@ bool ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam, LPARAM lParam );
 bool ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT& rlResult );
 
 WinSalObject* ImplFindSalObject( HWND hWndChild );
-bool ImplSalPreDispatchMsg( MSG* pMsg );
-void ImplSalPostDispatchMsg( MSG* pMsg, LRESULT nDispatchResult );
+bool ImplSalPreDispatchMsg( const MSG* pMsg );
+void ImplSalPostDispatchMsg( const MSG* pMsg );
 
 void ImplSalLogFontToFontW( HDC hDC, const LOGFONTW& rLogFont, vcl::Font& rFont );
 
diff --git a/vcl/inc/win/saltimer.h b/vcl/inc/win/saltimer.h
index b7d1a1e0d0f1..61d284d82ddb 100644
--- a/vcl/inc/win/saltimer.h
+++ b/vcl/inc/win/saltimer.h
@@ -25,7 +25,7 @@
 class WinSalTimer final : public SalTimer, protected VersionedEvent
 {
     // for access to Impl* functions
-    friend LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, int& rDef );
+    friend LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, bool& rDef );
     // for access to GetNextVersionedEvent
     friend void CALLBACK SalTimerProc( PVOID data, BOOLEAN );
     // for access to ImplHandleElapsedTimer
diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm
index 4dd8ceac8169..23b22c360eeb 100644
--- a/vcl/osx/vclnsapp.mm
+++ b/vcl/osx/vclnsapp.mm
@@ -66,7 +66,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
     NSEvent* pEvent = [NSEvent otherEventWithType: NSApplicationDefined
                                location: NSZeroPoint
                                modifierFlags: 0
-                               timestamp: 0
+                               timestamp: [[NSProcessInfo processInfo] systemUptime]
                                windowNumber: 0
                                context: nil
                                subtype: AquaSalInstance::AppExecuteSVMain
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 693411a0583c..68ad7deb994d 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -459,14 +459,14 @@ void WinSalInstance::AcquireYieldMutex( sal_uInt32 nCount )
     mpSalYieldMutex->acquire( nCount );
 }
 
-static LRESULT ImplSalDispatchMessage( MSG* pMsg )
+static LRESULT ImplSalDispatchMessage( const MSG* pMsg )
 {
     SalData* pSalData = GetSalData();
     if ( pSalData->mpFirstObject && ImplSalPreDispatchMsg( pMsg ) )
         return 0;
     LRESULT lResult = DispatchMessageW( pMsg );
     if ( pSalData->mpFirstObject )
-        ImplSalPostDispatchMsg( pMsg, lResult );
+        ImplSalPostDispatchMsg( pMsg );
     return lResult;
 }
 
@@ -569,124 +569,108 @@ bool WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents)
     return bDidWork;
 }
 
-LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, int& rDef )
+#define CASE_NOYIELDLOCK( salmsg, function ) \
+    case salmsg: \
+        assert( !pInst->mbNoYieldLock ); \
+        pInst->mbNoYieldLock = true; \
+        function; \
+        pInst->mbNoYieldLock = false; \
+        break;
+
+#define CASE_NOYIELDLOCK_RESULT( salmsg, function ) \
+    case salmsg: \
+        assert( !pInst->mbNoYieldLock ); \
+        pInst->mbNoYieldLock = true; \
+        nRet = reinterpret_cast<LRESULT>( function ); \
+        pInst->mbNoYieldLock = false; \
+        break;
+
+LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, bool& rDef )
 {
     LRESULT nRet = 0;
     WinSalInstance *pInst = GetSalData()->mpInstance;
+    WinSalTimer *const pTimer = static_cast<WinSalTimer*>( ImplGetSVData()->maSchedCtx.mpSalTimer );
 
     switch ( nMsg )
     {
         case SAL_MSG_THREADYIELD:
             assert( !(bool)wParam );
-            nRet = static_cast<LRESULT>(ImplSalYield( false, (bool)lParam ));
-            rDef = FALSE;
+            nRet = static_cast<LRESULT>(ImplSalYield(
+                false, static_cast<bool>( lParam ) ));
             break;
+
         case SAL_MSG_STARTTIMER:
         {
             sal_uInt64 nTime = tools::Time::GetSystemTicks();
-            if ( nTime < (sal_uInt64) lParam )
-                nTime = (sal_uInt64) lParam - nTime;
+            if ( nTime < static_cast<sal_uInt64>( lParam ) )
+                nTime = static_cast<sal_uInt64>( lParam ) - nTime;
             else
                 nTime = 0;
-            static_cast<WinSalTimer*>(ImplGetSVData()->maSchedCtx.mpSalTimer)->ImplStart( nTime );
-            rDef = FALSE;
+            assert( pTimer != nullptr );
+            pTimer->ImplStart( nTime );
             break;
         }
+
         case SAL_MSG_STOPTIMER:
-            static_cast<WinSalTimer*>(ImplGetSVData()->maSchedCtx.mpSalTimer)->ImplStop();
-            break;
-        case SAL_MSG_CREATEFRAME:
-            assert( !pInst->mbNoYieldLock );
-            pInst->mbNoYieldLock = true;
-            nRet = reinterpret_cast<LRESULT>(ImplSalCreateFrame( GetSalData()->mpInstance, reinterpret_cast<HWND>(lParam), (SalFrameStyleFlags)wParam ));
-            pInst->mbNoYieldLock = false;
-            rDef = FALSE;
-            break;
-        case SAL_MSG_RECREATEHWND:
-            assert( !pInst->mbNoYieldLock );
-            pInst->mbNoYieldLock = true;
-            nRet = reinterpret_cast<LRESULT>(ImplSalReCreateHWND( reinterpret_cast<HWND>(wParam), reinterpret_cast<HWND>(lParam), false ));
-            pInst->mbNoYieldLock = false;
-            rDef = FALSE;
-            break;
-        case SAL_MSG_RECREATECHILDHWND:
-            assert( !pInst->mbNoYieldLock );
-            pInst->mbNoYieldLock = true;
-            nRet = reinterpret_cast<LRESULT>(ImplSalReCreateHWND( reinterpret_cast<HWND>(wParam), reinterpret_cast<HWND>(lParam), true ));
-            pInst->mbNoYieldLock = false;
-            rDef = FALSE;
-            break;
-        case SAL_MSG_DESTROYFRAME:
-            assert( !pInst->mbNoYieldLock );
-            pInst->mbNoYieldLock = true;
-            delete reinterpret_cast<SalFrame*>(lParam);
-            pInst->mbNoYieldLock = false;
-            rDef = FALSE;
+            assert( pTimer != nullptr );
+            pTimer->ImplStop();
             break;
+
+        CASE_NOYIELDLOCK_RESULT( SAL_MSG_CREATEFRAME, ImplSalCreateFrame( GetSalData()->mpInstance,
+            reinterpret_cast<HWND>(lParam), static_cast<SalFrameStyleFlags>(wParam)) )
+        CASE_NOYIELDLOCK_RESULT( SAL_MSG_RECREATEHWND, ImplSalReCreateHWND(
+            reinterpret_cast<HWND>(wParam), reinterpret_cast<HWND>(lParam), false) )
+        CASE_NOYIELDLOCK_RESULT( SAL_MSG_RECREATECHILDHWND, ImplSalReCreateHWND(
+            reinterpret_cast<HWND>(wParam), reinterpret_cast<HWND>(lParam), true) )
+        CASE_NOYIELDLOCK( SAL_MSG_DESTROYFRAME, delete reinterpret_cast<SalFrame*>(lParam) )
+
         case SAL_MSG_DESTROYHWND:
-            //We only destroy the native window here. We do NOT destroy the SalFrame contained
-            //in the structure (GetWindowPtr()).
+            // We only destroy the native window here. We do NOT destroy the SalFrame contained
+            // in the structure (GetWindowPtr()).
             if (DestroyWindow(reinterpret_cast<HWND>(lParam)) == 0)
             {
                 OSL_FAIL("DestroyWindow failed!");
-                //Failure: We remove the SalFrame from the window structure. So we avoid that
+                // Failure: We remove the SalFrame from the window structure. So we avoid that
                 // the window structure may contain an invalid pointer, once the SalFrame is deleted.
-               SetWindowPtr(reinterpret_cast<HWND>(lParam), nullptr);
+                SetWindowPtr(reinterpret_cast<HWND>(lParam), nullptr);
             }
-            rDef = FALSE;
-            break;
-        case SAL_MSG_CREATEOBJECT:
-            assert( !pInst->mbNoYieldLock );
-            pInst->mbNoYieldLock = true;
-            nRet = reinterpret_cast<LRESULT>(ImplSalCreateObject( GetSalData()->mpInstance, reinterpret_cast<WinSalFrame*>(lParam) ));
-            pInst->mbNoYieldLock = false;
-            rDef = FALSE;
-            break;
-        case SAL_MSG_DESTROYOBJECT:
-            assert( !pInst->mbNoYieldLock );
-            pInst->mbNoYieldLock = true;
-            delete reinterpret_cast<SalObject*>(lParam);
-            pInst->mbNoYieldLock = false;
-            rDef = FALSE;
-            break;
-        case SAL_MSG_GETDC:
-            assert( !pInst->mbNoYieldLock );
-            pInst->mbNoYieldLock = true;
-            nRet = reinterpret_cast<LRESULT>(GetDCEx( reinterpret_cast<HWND>(wParam), nullptr, DCX_CACHE ));
-            pInst->mbNoYieldLock = false;
-            rDef = FALSE;
-            break;
-        case SAL_MSG_RELEASEDC:
-            assert( !pInst->mbNoYieldLock );
-            pInst->mbNoYieldLock = true;
-            ReleaseDC( reinterpret_cast<HWND>(wParam), reinterpret_cast<HDC>(lParam) );
-            pInst->mbNoYieldLock = false;
-            rDef = FALSE;
             break;
+
+        CASE_NOYIELDLOCK_RESULT( SAL_MSG_CREATEOBJECT, ImplSalCreateObject(
+            GetSalData()->mpInstance, reinterpret_cast<WinSalFrame*>(lParam)) )
+        CASE_NOYIELDLOCK( SAL_MSG_DESTROYOBJECT, delete reinterpret_cast<SalObject*>(lParam) )
+        CASE_NOYIELDLOCK_RESULT( SAL_MSG_GETDC, GetDCEx(
+            reinterpret_cast<HWND>(wParam), nullptr, DCX_CACHE) )
+        CASE_NOYIELDLOCK( SAL_MSG_RELEASEDC, ReleaseDC(
+            reinterpret_cast<HWND>(wParam), reinterpret_cast<HDC>(lParam)) )
+
         case SAL_MSG_TIMER_CALLBACK:
-        {
-            WinSalTimer *const pTimer = static_cast<WinSalTimer*>( ImplGetSVData()->maSchedCtx.mpSalTimer );
             assert( pTimer != nullptr );
             nRet = static_cast<LRESULT>( pTimer->ImplHandleTimerEvent( wParam ) );
-            rDef = FALSE;
             break;
-        }
+
         case WM_TIMER:
-        {
-            WinSalTimer *const pTimer = static_cast<WinSalTimer*>( ImplGetSVData()->maSchedCtx.mpSalTimer );
             assert( pTimer != nullptr );
             nRet = static_cast<LRESULT>( pTimer->ImplHandle_WM_TIMER( wParam ) );
-            rDef = FALSE;
             break;
-        }
+
+        case SAL_MSG_DUMMY:
+            break;
+
+        default:
+            rDef = true;
+            break;
     }
 
     return nRet;
 }
 
+#undef CASE_NOYIELDLOCK
+#undef CASE_NOYIELDLOCK_RESULT
+
 LRESULT CALLBACK SalComWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
 {
-    int bDef = TRUE;
+    bool bDef = false;
     LRESULT nRet = 0;
     __try
     {
diff --git a/vcl/win/window/salobj.cxx b/vcl/win/window/salobj.cxx
index 172f61e923d3..75e406c33f61 100644
--- a/vcl/win/window/salobj.cxx
+++ b/vcl/win/window/salobj.cxx
@@ -145,7 +145,7 @@ LRESULT CALLBACK SalSysMsgProc( int nCode, WPARAM wParam, LPARAM lParam )
     return CallNextHookEx( pSalData->mhSalObjMsgHook, nCode, wParam, lParam );
 }
 
-bool ImplSalPreDispatchMsg( MSG* pMsg )
+bool ImplSalPreDispatchMsg( const MSG* pMsg )
 {
     // Used for Unicode and none Unicode
     SalData*        pSalData = GetSalData();
@@ -231,10 +231,10 @@ bool ImplSalPreDispatchMsg( MSG* pMsg )
     return FALSE;
 }
 
-void ImplSalPostDispatchMsg( MSG* pMsg, LRESULT /* nDispatchResult */ )
+void ImplSalPostDispatchMsg( const MSG* pMsg )
 {
     // Used for Unicode and none Unicode
-    SalData*        pSalData = GetSalData();
+    SalData *pSalData = GetSalData();
 
     if ( (pMsg->message == WM_KEYDOWN) || (pMsg->message == WM_KEYUP) )
     {
commit 4f05fdffbe4483ae0a466a6460b63560c3fb45ca
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Oct 20 22:14:39 2017 +0200

    tdf#113311 disable CppunitTest_libreofficekit_tiledrendering for now
    
    Change-Id: I0f6e284d232388019bfa33f07a4afc864e0040a9

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d84e09c9c7d9..b731f08fb426 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3557,6 +3557,8 @@ static void lo_destroy(LibreOfficeKit* pThis)
 
     comphelper::LibreOfficeKit::setStatusIndicatorCallback(nullptr, nullptr);
     uno::Reference <frame::XDesktop2> xDesktop = frame::Desktop::create ( ::comphelper::getProcessComponentContext() );
+    // FIXME: the terminate() call here is a no-op because it detects
+    // that LibreOfficeKit::isActive() and then returns early!
     bSuccess = xDesktop.is() && xDesktop->terminate();
 
     if (!bSuccess)
diff --git a/libreofficekit/Module_libreofficekit.mk b/libreofficekit/Module_libreofficekit.mk
index cc842b2f3f2c..c74c0681328e 100644
--- a/libreofficekit/Module_libreofficekit.mk
+++ b/libreofficekit/Module_libreofficekit.mk
@@ -15,7 +15,8 @@ $(eval $(call gb_Module_add_check_targets,libreofficekit, \
     CppunitTest_libreofficekit_checkapi \
 ))
 
-$(eval $(call gb_Module_add_subsequentcheck_targets,libreofficekit,\
+# tdf#113311 disabled because it can deadlock on shutdown
+#$(eval $(call gb_Module_add_subsequentcheck_targets,libreofficekit,\
     CppunitTest_libreofficekit_tiledrendering \
 ))
 
commit 22fa30c2f6aa541f6b1db002d276459d137490c8
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Oct 20 13:44:12 2017 +0200

    loplugin:finalclasses in toolkit,tools
    
    Change-Id: I365d9a5057b35bf0441ac8fbfef4447a25652760
    Reviewed-on: https://gerrit.libreoffice.org/43601
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/toolkit/awt/vclxbitmap.hxx b/include/toolkit/awt/vclxbitmap.hxx
index 891a8b42b536..cc83653e751a 100644
--- a/include/toolkit/awt/vclxbitmap.hxx
+++ b/include/toolkit/awt/vclxbitmap.hxx
@@ -32,17 +32,15 @@
 //  class VCLXBitmap
 
 
-class VCLXBitmap :  public css::awt::XBitmap,
+class VCLXBitmap final : public css::awt::XBitmap,
                     public css::awt::XDisplayBitmap,
                     public css::lang::XTypeProvider,
                     public css::lang::XUnoTunnel,
                     public ::cppu::OWeakObject
 {
-private:
     ::osl::Mutex    maMutex;
     BitmapEx        maBitmap;
 
-protected:
     ::osl::Mutex&   GetMutex() { return maMutex; }
 
 
diff --git a/include/toolkit/awt/vclxfont.hxx b/include/toolkit/awt/vclxfont.hxx
index 080f9feacc64..9b12b496a21b 100644
--- a/include/toolkit/awt/vclxfont.hxx
+++ b/include/toolkit/awt/vclxfont.hxx
@@ -34,19 +34,17 @@
 //  class VCLXFont
 
 
-class TOOLKIT_DLLPUBLIC VCLXFont :  public css::awt::XFont2,
+class TOOLKIT_DLLPUBLIC VCLXFont final : public css::awt::XFont2,
                     public css::lang::XTypeProvider,
                     public css::lang::XUnoTunnel,
                     public ::cppu::OWeakObject
 {
-private:
     ::osl::Mutex    maMutex;
     css::uno::Reference< css::awt::XDevice> mxDevice;
     vcl::Font       maFont;
     std::unique_ptr<FontMetric>
                     mpFontMetric;
 
-protected:
     bool            ImplAssertValidFontMetric();
     ::osl::Mutex&   GetMutex() { return maMutex; }
 
diff --git a/include/toolkit/awt/vclxpointer.hxx b/include/toolkit/awt/vclxpointer.hxx
index 23bcb1c122a0..951efeb7457c 100644
--- a/include/toolkit/awt/vclxpointer.hxx
+++ b/include/toolkit/awt/vclxpointer.hxx
@@ -33,14 +33,12 @@
 //  class VCLXPointer
 
 
-class VCLXPointer: public cppu::WeakImplHelper<
+class VCLXPointer final : public cppu::WeakImplHelper<
     css::awt::XPointer, css::lang::XUnoTunnel, css::lang::XServiceInfo>
 {
-private:
     ::osl::Mutex    maMutex;
     Pointer         maPointer;
 
-protected:
     ::osl::Mutex&   GetMutex() { return maMutex; }
 
 public:
diff --git a/include/toolkit/awt/vclxregion.hxx b/include/toolkit/awt/vclxregion.hxx
index 86dc44d4eaca..82ec095be43a 100644
--- a/include/toolkit/awt/vclxregion.hxx
+++ b/include/toolkit/awt/vclxregion.hxx
@@ -33,16 +33,14 @@
 //  class VCLXRegion
 
 
-class VCLXRegion :  public css::awt::XRegion,
+class VCLXRegion final : public css::awt::XRegion,
                     public css::lang::XTypeProvider,
                     public css::lang::XUnoTunnel,
                     public ::cppu::OWeakObject
 {
-private:
     ::osl::Mutex    maMutex;
     vcl::Region          maRegion;
 
-protected:
     ::osl::Mutex&   GetMutex() { return maMutex; }
 
 public:
diff --git a/include/toolkit/controls/accessiblecontrolcontext.hxx b/include/toolkit/controls/accessiblecontrolcontext.hxx
index cbd304a1334d..180fd538551c 100644
--- a/include/toolkit/controls/accessiblecontrolcontext.hxx
+++ b/include/toolkit/controls/accessiblecontrolcontext.hxx
@@ -47,31 +47,11 @@ namespace toolkit
         control model, and a weak reference to the control. The reference to the model is freed when the model
         is being disposed.</p>
     */
-    class OAccessibleControlContext
+    class OAccessibleControlContext final
             :public ::comphelper::OAccessibleImplementationAccess
             ,public OAccessibleControlContext_Base
             ,public OAccessibleControlContext_IBase
     {
-    private:
-        css::uno::Reference< css::beans::XPropertySet >
-                    m_xControlModel;        // the model of the control which's context we implement
-        css::uno::Reference< css::beans::XPropertySetInfo >
-                    m_xModelPropsInfo;      // the cached property set info of the model
-
-    protected:
-        /// ctor. @see Init
-        OAccessibleControlContext();
-        virtual ~OAccessibleControlContext() override;
-
-        /** late ctor
-        */
-        void Init(
-            const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator
-        );
-
-        // OCommonAccessibleComponent overridables
-        virtual css::awt::Rectangle implGetBounds(  ) override;
-
     public:
         /** creates an accessible context for an uno control
         @param _rxCreator
@@ -82,7 +62,7 @@ namespace toolkit
             const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator
         );
 
-    protected:
+    private:
         // XInterface
         DECLARE_XINTERFACE( )
         DECLARE_XTYPEPROVIDER( )
@@ -107,7 +87,6 @@ namespace toolkit
         using comphelper::OAccessibleContextHelper::disposing;
         virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
 
-    private:
         // retrieves the value of a string property from the model, if the property is present
         OUString getModelStringProperty( const sal_Char* _pPropertyName );
 
@@ -117,6 +96,24 @@ namespace toolkit
         void stopModelListening( );
 
         VclPtr< vcl::Window > implGetWindow( css::uno::Reference< css::awt::XWindow >* _pxUNOWindow = nullptr ) const;
+
+        /// ctor. @see Init
+        OAccessibleControlContext();
+        virtual ~OAccessibleControlContext() override;
+
+        /** late ctor
+        */
+        void Init(
+            const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator
+        );
+
+        // OCommonAccessibleComponent overridables
+        virtual css::awt::Rectangle implGetBounds(  ) override;
+
+        css::uno::Reference< css::beans::XPropertySet >
+                    m_xControlModel;        // the model of the control which's context we implement
+        css::uno::Reference< css::beans::XPropertySetInfo >
+                    m_xModelPropsInfo;      // the cached property set info of the model
     };
 
 
diff --git a/include/toolkit/controls/formattedcontrol.hxx b/include/toolkit/controls/formattedcontrol.hxx
index 0e9e87781ed5..f600702b3027 100644
--- a/include/toolkit/controls/formattedcontrol.hxx
+++ b/include/toolkit/controls/formattedcontrol.hxx
@@ -33,30 +33,8 @@ namespace toolkit
 
     // = UnoControlFormattedFieldModel
 
-    class UnoControlFormattedFieldModel : public UnoControlModel
+    class UnoControlFormattedFieldModel final : public UnoControlModel
     {
-    protected:
-        css::uno::Any      ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
-        ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
-        css::uno::Any      m_aCachedFormat;
-        bool                            m_bRevokedAsClient;
-        bool                            m_bSettingValueAndText;
-        css::uno::Reference< css::util::XNumberFormatter >
-                                        m_xCachedFormatter;
-
-    protected:
-        sal_Bool SAL_CALL convertFastPropertyValue(
-                    css::uno::Any& rConvertedValue,
-                    css::uno::Any& rOldValue,
-                    sal_Int32 nPropId,
-                    const css::uno::Any& rValue
-                ) override;
-
-        void SAL_CALL setFastPropertyValue_NoBroadcast(
-                    sal_Int32 nHandle,
-                    const css::uno::Any& rValue
-                ) override;
-
     public:
         UnoControlFormattedFieldModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
         UnoControlFormattedFieldModel( const UnoControlFormattedFieldModel& rModel )
@@ -80,11 +58,11 @@ namespace toolkit
 
         css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
 
-    protected:
+    private:
         virtual ~UnoControlFormattedFieldModel() override;
 
         // XComponent
-        void SAL_CALL dispose(  ) override;
+        void SAL_CALL dispose() override;
 
         // XPropertySet
         void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& PropertyNames, const css::uno::Sequence< css::uno::Any >& Values ) override;
@@ -96,10 +74,29 @@ namespace toolkit
                         css::uno::Any*     _pValues,       /// the values of the properties to set
                         sal_Int32*                      _pValidHandles  /// pointer to the valid handles, allowed to be adjusted
                     )   const override;
-    private:
         void    impl_updateTextFromValue_nothrow();
         void    impl_updateCachedFormatter_nothrow();
         void    impl_updateCachedFormatKey_nothrow();
+
+        css::uno::Any      ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
+        ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+        sal_Bool SAL_CALL convertFastPropertyValue(
+                    css::uno::Any& rConvertedValue,
+                    css::uno::Any& rOldValue,
+                    sal_Int32 nPropId,
+                    const css::uno::Any& rValue
+                ) override;
+
+        void SAL_CALL setFastPropertyValue_NoBroadcast(
+                    sal_Int32 nHandle,
+                    const css::uno::Any& rValue
+                ) override;
+
+        css::uno::Any      m_aCachedFormat;
+        bool               m_bRevokedAsClient;
+        bool               m_bSettingValueAndText;
+        css::uno::Reference< css::util::XNumberFormatter >
+                           m_xCachedFormatter;
     };
 
 
diff --git a/include/toolkit/controls/roadmapentry.hxx b/include/toolkit/controls/roadmapentry.hxx
index 64b95886798a..7695ecffdcba 100644
--- a/include/toolkit/controls/roadmapentry.hxx
+++ b/include/toolkit/controls/roadmapentry.hxx
@@ -34,7 +34,7 @@
 
 typedef cppu::WeakImplHelper< css::lang::XServiceInfo > ORoadmapEntry_Base;
 
-class ORoadmapEntry :public ORoadmapEntry_Base
+class ORoadmapEntry final : public ORoadmapEntry_Base
             ,public ::comphelper::OMutexAndBroadcastHelper
             ,public ::comphelper::OPropertyContainer
             ,public ::comphelper::OPropertyArrayUsageHelper< ORoadmapEntry >
@@ -43,7 +43,7 @@ class ORoadmapEntry :public ORoadmapEntry_Base
 public:
        ORoadmapEntry();
 
-protected:
+private:
     DECLARE_XINTERFACE()        // merge XInterface implementations
     DECLARE_XTYPEPROVIDER()     // merge XTypeProvider implementations
 
@@ -61,19 +61,10 @@ protected:
     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(  ) override;
 
-
-    // other stuff
-
-    // (e.g. DECLARE_SERVICE_INFO();)
-
-protected:
-    // <properties>
-    OUString     m_sLabel;
-    sal_Int32           m_nID;
+    OUString        m_sLabel;
+    sal_Int32       m_nID;
     bool            m_bEnabled;
     bool            m_bInteractive;
-
-    // </properties>
 };
 
 #endif
diff --git a/include/toolkit/controls/stdtabcontroller.hxx b/include/toolkit/controls/stdtabcontroller.hxx
index 69ce7482196c..c39c2da70871 100644
--- a/include/toolkit/controls/stdtabcontroller.hxx
+++ b/include/toolkit/controls/stdtabcontroller.hxx
@@ -32,7 +32,7 @@
 #include <toolkit/helper/servicenames.hxx>
 
 
-class StdTabController :    public css::awt::XTabController,
+class StdTabController final : public css::awt::XTabController,
                             public css::lang::XServiceInfo,
                             public css::lang::XTypeProvider,
                             public ::cppu::OWeakAggObject
@@ -42,7 +42,6 @@ private:
     css::uno::Reference< css::awt::XTabControllerModel >  mxModel;
     css::uno::Reference< css::awt::XControlContainer >    mxControlContainer;
 
-protected:
     ::osl::Mutex&               GetMutex() { return maMutex; }
     static bool                 ImplCreateComponentSequence( css::uno::Sequence< css::uno::Reference< css::awt::XControl > >& rControls, const css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& rModels, css::uno::Sequence< css::uno::Reference< css::awt::XWindow > >& rComponents, css::uno::Sequence< css::uno::Any>* pTabStops, bool bPeerComponent );
     // if sequence length of rModels is less than rControls, return only the matching elements in rModels sequence and remove corresponding elements from rControls
diff --git a/include/toolkit/controls/stdtabcontrollermodel.hxx b/include/toolkit/controls/stdtabcontrollermodel.hxx
index def33673d567..19884f505229 100644
--- a/include/toolkit/controls/stdtabcontrollermodel.hxx
+++ b/include/toolkit/controls/stdtabcontrollermodel.hxx
@@ -79,18 +79,16 @@ typedef ::std::vector< ComponentEntry* > ComponentEntryList;
 
 #define CONTROLPOS_NOTFOUND 0xFFFFFFFF
 
-class StdTabControllerModel :   public css::awt::XTabControllerModel,
+class StdTabControllerModel final : public css::awt::XTabControllerModel,
                                 public css::lang::XServiceInfo,
                                 public css::io::XPersistObject,
                                 public css::lang::XTypeProvider,
                                 public ::cppu::OWeakAggObject
 {
-private:
     ::osl::Mutex                maMutex;
     UnoControlModelEntryList    maControls;
     bool                    mbGroupControl;
 
-protected:
     ::osl::Mutex&           GetMutex() { return maMutex; }
     sal_uInt32              ImplGetControlCount( const UnoControlModelEntryList& rList ) const;
     void                    ImplGetControlModels( css::uno::Reference< css::awt::XControlModel > ** pRefs, const UnoControlModelEntryList& rList ) const;
diff --git a/include/toolkit/controls/unocontrols.hxx b/include/toolkit/controls/unocontrols.hxx
index 54082d8324b6..7da16557cde3 100644
--- a/include/toolkit/controls/unocontrols.hxx
+++ b/include/toolkit/controls/unocontrols.hxx
@@ -859,7 +859,7 @@ typedef ::cppu::AggImplInheritanceHelper5   <   UnoControlBase
                                             ,   css::awt::XTextLayoutConstrains
                                             ,   css::awt::XItemListListener
                                             >   UnoListBoxControl_Base;
-class TOOLKIT_DLLPUBLIC UnoListBoxControl : public UnoListBoxControl_Base
+class TOOLKIT_DLLPUBLIC UnoListBoxControl final : public UnoListBoxControl_Base
 {
 public:
                         UnoListBoxControl();
@@ -919,12 +919,11 @@ public:
     OUString SAL_CALL getImplementationName(  ) override;
     css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
 
-protected:
+private:
     void                ImplUpdateSelectedItemsProperty();
     virtual void        ImplSetPeerProperty( const OUString& rPropName, const css::uno::Any& rVal ) override;
     virtual void        updateFromModel() override;
 
-private:
     ActionListenerMultiplexer   maActionListeners;
     ItemListenerMultiplexer     maItemListeners;
 };
diff --git a/include/tools/b3dtrans.hxx b/include/tools/b3dtrans.hxx
index eca70105b248..64d273bcbfc0 100644
--- a/include/tools/b3dtrans.hxx
+++ b/include/tools/b3dtrans.hxx
@@ -174,15 +174,8 @@ protected:
 
 // B3D camera
 
-class SAL_WARN_UNUSED TOOLS_DLLPUBLIC B3dCamera : public B3dViewport
+class SAL_WARN_UNUSED TOOLS_DLLPUBLIC B3dCamera final : public B3dViewport
 {
-private:
-    basegfx::B3DPoint       aPosition;
-    basegfx::B3DPoint       aCorrectedPosition;
-    basegfx::B3DVector  aLookAt;
-    double                  fFocalLength;
-    double                  fBankAngle;
-
 public:
     B3dCamera(
         const basegfx::B3DPoint& rPos = basegfx::B3DPoint(0.0, 0.0, 1.0),
@@ -190,11 +183,18 @@ public:
         double fFocLen = 35.0, double fBnkAng = 0.0);
     virtual ~B3dCamera() override;
 
-protected:
+private:
     void CalcNewViewportValues();
     bool CalcFocalLength();
 
     virtual void DeviceRectangleChange() override;
+
+    basegfx::B3DPoint       aPosition;
+    basegfx::B3DPoint       aCorrectedPosition;
+    basegfx::B3DVector  aLookAt;
+    double                  fFocalLength;
+    double                  fBankAngle;
+
 };
 
 #endif
diff --git a/include/tools/color.hxx b/include/tools/color.hxx
index 592d69ad458d..0173840d80ff 100644
--- a/include/tools/color.hxx
+++ b/include/tools/color.hxx
@@ -28,9 +28,8 @@ class SvStream;
 
 // Color
 
-class SAL_WARN_UNUSED TOOLS_DLLPUBLIC Color
+class SAL_WARN_UNUSED TOOLS_DLLPUBLIC Color final
 {
-protected:
     ColorData mnColor;
 
 public:
diff --git a/toolkit/inc/helper/unopropertyarrayhelper.hxx b/toolkit/inc/helper/unopropertyarrayhelper.hxx
index a8dee674a308..99884d843243 100644
--- a/toolkit/inc/helper/unopropertyarrayhelper.hxx
+++ b/toolkit/inc/helper/unopropertyarrayhelper.hxx
@@ -29,12 +29,10 @@
 
 //  class UnoPropertyArrayHelper
 
-class TOOLKIT_DLLPUBLIC UnoPropertyArrayHelper : public ::cppu::IPropertyArrayHelper
+class TOOLKIT_DLLPUBLIC UnoPropertyArrayHelper final : public ::cppu::IPropertyArrayHelper
 {
-private:
     std::set<sal_Int32>       maIDs;
 
-protected:
     bool    ImplHasProperty( sal_uInt16 nPropId ) const;
 
 public:
commit 0dacfe29a5c8c93f8cf06c18e160cc464c17d15f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Oct 20 13:46:49 2017 +0200

    Add AllLangMoTarget to gbuild_TARGETS
    
    > Oct 20 13:40:08 <sberg> caolan, any reason in
    >  00657aef09d854c74fb426a935a3e8b1fc390bb0 you didn't add AllLangMoTarget to
    >  gbuild_TARGETS (Makefile.in) when removing AllLangResTargets from that list?
    > Oct 20 13:45:56 <caolan> sberg: don't know, if there was a reason I've
    >  forgotten it
    
    Change-Id: I6027be94962b6dbeca0db842b39f3d09762135c0
    Reviewed-on: https://gerrit.libreoffice.org/43602
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/Makefile.in b/Makefile.in
index 35f5d43b2af4..b9bf8da06b12 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -118,6 +118,7 @@ internal.clean: $(addsuffix .clean,$(gbuild_internal_modules))
 $(eval $(call gb_Top_GbuildModulesRules,$(gbuild_modules)))
 
 gbuild_TARGETS := AllLangHelp \
+	AllLangMoTarget \
 	AllLangPackage \
 	AutoInstall \
 	CliLibrary \
commit cd74225ddad06ca826a37c8ba91eedd9d2aa23ce
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Oct 20 14:09:47 2017 +0200

    tdf#113287 sw split sections in tables: fix missing invalidation on sect del
    
    The problem was that the Table1:A2 cell contents was wrapped in a
    section that was first split, then all the contents was moved to the
    next page, finally the empty master was also moved to the next page. At
    this point the master had 0 height, and when it was removed, the follow
    section frame had invalid positions, including all of its contents.
    
    Position invalidation for table contents works by first invalidating the
    table frame position, which triggers an invalidation chain for both all
    next frames and the lower frame. Other lower frames are not invalidated,
    that happens when the first lower is calculated, in
    SwLayoutFrame::MakeAll(), when the SwLayNotify dtor is executed. This
    mechanism did not help us here, as the master section frame was already
    marked for deletion, so SwLayoutFrame::MakeAll() was not called for it,
    so neither of its next frames were re-positioned.
    
    Fix the bug by explicitly invalidating the position of the next frame in
    SwSectionFrame::MakeAll(), for the "return early, this section will be
    deleted anyway" case. (The alternative could be to watch out for
    0-height sections in the SwLayNotify dtor, but the problem is specific
    to section frames, so SwSectionFrame is probably a more expected place
    for this change.)
    
    Change-Id: I5ab9475675d25bef7c0647893b1b5909da019f3f
    Reviewed-on: https://gerrit.libreoffice.org/43604
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sw/qa/extras/uiwriter/data/tdf113287.fodt b/sw/qa/extras/uiwriter/data/tdf113287.fodt
new file mode 100644
index 000000000000..041984e1741a
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf113287.fodt
@@ -0,0 +1,291 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oas
 is:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:
 experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
+  <office:meta>
+    <meta:generator>LibreOfficeDev/6.0.0.0.alpha0$Linux_X86_64 LibreOffice_project/9916abc7ca68d597ef260ea61a056b7360f70665</meta:generator>
+    <dc:date>2017-10-19T13:48:19.569869895</dc:date>
+    <meta:editing-duration>PT1M55S</meta:editing-duration>
+    <meta:editing-cycles>4</meta:editing-cycles>
+    <meta:document-statistic meta:table-count="1" meta:image-count="0" meta:object-count="0" meta:page-count="2" meta:paragraph-count="22" meta:word-count="26" meta:character-count="215" meta:non-whitespace-character-count="210"/>
+  </office:meta>
+  <office:settings>
+    <config:config-item-set config:name="ooo:view-settings">
+      <config:config-item config:name="ViewAreaTop" config:type="long">0</config:config-item>
+      <config:config-item config:name="ViewAreaLeft" config:type="long">0</config:config-item>
+      <config:config-item config:name="ViewAreaWidth" config:type="long">30535</config:config-item>
+      <config:config-item config:name="ViewAreaHeight" config:type="long">20851</config:config-item>
+      <config:config-item config:name="ShowRedlineChanges" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="InBrowseMode" config:type="boolean">false</config:config-item>
+      <config:config-item-map-indexed config:name="Views">
+        <config:config-item-map-entry>
+          <config:config-item config:name="ViewId" config:type="string">view2</config:config-item>
+          <config:config-item config:name="ViewLeft" config:type="long">8050</config:config-item>
+          <config:config-item config:name="ViewTop" config:type="long">901</config:config-item>
+          <config:config-item config:name="VisibleLeft" config:type="long">0</config:config-item>
+          <config:config-item config:name="VisibleTop" config:type="long">0</config:config-item>
+          <config:config-item config:name="VisibleRight" config:type="long">30533</config:config-item>
+          <config:config-item config:name="VisibleBottom" config:type="long">20849</config:config-item>
+          <config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
+          <config:config-item config:name="ViewLayoutColumns" config:type="short">0</config:config-item>
+          <config:config-item config:name="ViewLayoutBookMode" config:type="boolean">false</config:config-item>
+          <config:config-item config:name="ZoomFactor" config:type="short">100</config:config-item>
+          <config:config-item config:name="IsSelectedFrame" config:type="boolean">false</config:config-item>
+          <config:config-item config:name="AnchoredTextOverflowLegacy" config:type="boolean">false</config:config-item>
+        </config:config-item-map-entry>
+      </config:config-item-map-indexed>
+    </config:config-item-set>
+    <config:config-item-set config:name="ooo:configuration-settings">
+      <config:config-item config:name="PrintProspect" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="PrintLeftPages" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="PrintGraphics" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="PrintPageBackground" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="PrintControls" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="PrintAnnotationMode" config:type="short">0</config:config-item>
+      <config:config-item config:name="PrintRightPages" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="PrintFaxName" config:type="string"/>
+      <config:config-item config:name="PrintPaperFromSetup" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="PrintTextPlaceholder" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="ApplyParagraphMarkFormatToNumbering" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="PrintReversed" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="TabOverMargin" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="EmbedFonts" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="SurroundTextWrapSmall" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="BackgroundParaOverDrawings" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="ClippedPictures" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="FloattableNomargins" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="UnbreakableNumberings" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="EmbedSystemFonts" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="TabOverflow" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="PrintTables" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="PrintSingleJobs" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="SmallCapsPercentage66" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="CollapseEmptyCellPara" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="TreatSingleColumnBreakAsPageBreak" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="MathBaselineAlignment" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="AddFrameOffsets" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="IsLabelDocument" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="PrinterName" config:type="string"/>
+      <config:config-item config:name="OutlineLevelYieldsNumbering" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="MsWordCompTrailingBlanks" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="IgnoreFirstLineIndentInNumbering" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="UpdateFromTemplate" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="PrintBlackFonts" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="TableRowKeep" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="EmbeddedDatabaseName" config:type="string"/>
+      <config:config-item config:name="IgnoreTabsAndBlanksForLineCalculation" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="UseOldPrinterMetrics" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="InvertBorderSpacing" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="SaveGlobalDocumentLinks" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="TabsRelativeToIndent" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="Rsid" config:type="int">473003</config:config-item>
+      <config:config-item config:name="PrintProspectRTL" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="PrintEmptyPages" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="ApplyUserData" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="PrintHiddenText" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="AddParaTableSpacingAtStart" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="FieldAutoUpdate" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="UseOldNumbering" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="AddParaTableSpacing" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="CharacterCompressionType" config:type="short">0</config:config-item>
+      <config:config-item config:name="SaveVersionOnClose" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="ChartAutoUpdate" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="PrinterIndependentLayout" config:type="string">high-resolution</config:config-item>
+      <config:config-item config:name="IsKernAsianPunctuation" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="UseFormerObjectPositioning" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="AddVerticalFrameOffsets" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="SubtractFlysAnchoredAtFlys" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="AddParaSpacingToTableCells" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="AddExternalLeading" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="CurrentDatabaseDataSource" config:type="string">writer-data-source-ooxml</config:config-item>
+      <config:config-item config:name="AllowPrintJobCancel" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="ProtectForm" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="UseFormerLineSpacing" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="PrintDrawings" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="UseFormerTextWrapping" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="UnxForceZeroExtLeading" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="TabAtLeftIndentForParagraphsInList" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="RedlineProtectionKey" config:type="base64Binary"/>
+      <config:config-item config:name="PropLineSpacingShrinksFirstLine" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="ConsiderTextWrapOnObjPos" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="RsidRoot" config:type="int">104774</config:config-item>
+      <config:config-item config:name="StylesNoDefault" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="LinkUpdateMode" config:type="short">1</config:config-item>
+      <config:config-item config:name="AlignTabStopPosition" config:type="boolean">true</config:config-item>
+      <config:config-item config:name="DoNotJustifyLinesWithManualBreak" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="DoNotResetParaAttrsForNumFont" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="CurrentDatabaseCommandType" config:type="int">0</config:config-item>
+      <config:config-item config:name="LoadReadonly" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="DoNotCaptureDrawObjsOnPage" config:type="boolean">false</config:config-item>
+      <config:config-item config:name="CurrentDatabaseCommand" config:type="string"/>
+      <config:config-item config:name="PrinterSetup" config:type="base64Binary"/>
+      <config:config-item config:name="ClipAsCharacterAnchoredWriterFlyFrames" config:type="boolean">false</config:config-item>
+    </config:config-item-set>
+  </office:settings>
+  <office:scripts>
+    <office:script script:language="ooo:Basic">
+      <ooo:libraries xmlns:ooo="http://openoffice.org/2004/office" xmlns:xlink="http://www.w3.org/1999/xlink"/>
+    </office:script>
+  </office:scripts>
+  <office:font-face-decls>
+    <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/>
+  </office:font-face-decls>
+  <office:styles>
+    <style:default-style style:family="graphic">
+      <style:graphic-properties svg:stroke-color="#000000" draw:fill-color="#99ccff" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="true"/>
+      <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:font-independent-line-spacing="false">
+        <style:tab-stops/>
+      </style:paragraph-properties>
+      <style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="en" fo:country="US" style:letter-kerning="true" style:font-size-asian="12pt" style:language-asian="zxx" style:country-asian="none" style:font-size-complex="12pt" style:language-complex="zxx" style:country-complex="none"/>
+    </style:default-style>
+    <style:default-style style:family="paragraph">
+      <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/>
+      <style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="en" fo:country="US" style:letter-kerning="true" style:font-size-asian="12pt" style:language-asian="zxx" style:country-asian="none" style:font-size-complex="12pt" style:language-complex="zxx" style:country-complex="none" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/>
+    </style:default-style>
+    <style:default-style style:family="table">
+      <style:table-properties table:border-model="collapsing"/>
+    </style:default-style>
+    <style:default-style style:family="table-row">
+      <style:table-row-properties fo:keep-together="always"/>
+    </style:default-style>
+    <style:style style:name="Standard" style:family="paragraph" style:class="text">
+      <style:text-properties fo:language="en" fo:country="GB"/>
+    </style:style>

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list