[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - 14 commits - desktop/source fpicker/source framework/source include/LibreOfficeKit include/sfx2 include/vcl sc/source sd/source sfx2/source sw/qa sw/source vcl/inc vcl/quartz vcl/source

Mike Kaganski mike.kaganski at collabora.com
Fri Mar 23 06:51:47 UTC 2018


 desktop/source/lib/init.cxx                                      |  133 +++++++++-
 fpicker/source/office/iodlg.cxx                                  |    4 
 framework/source/accelerators/globalacceleratorconfiguration.cxx |    3 
 include/LibreOfficeKit/LibreOfficeKit.hxx                        |    5 
 include/sfx2/basedlgs.hxx                                        |    1 
 include/vcl/abstdlg.hxx                                          |    4 
 include/vcl/dialog.hxx                                           |    6 
 include/vcl/window.hxx                                           |    2 
 sc/source/ui/view/tabvwsha.cxx                                   |    2 
 sd/source/ui/func/fuarea.cxx                                     |    4 
 sd/source/ui/func/fuline.cxx                                     |    4 
 sd/source/ui/func/futransf.cxx                                   |   39 --
 sfx2/source/control/unoctitm.cxx                                 |    3 
 sfx2/source/dialog/basedlgs.cxx                                  |   29 --
 sfx2/source/dialog/tabdlg.cxx                                    |   21 -
 sfx2/source/view/viewfrm.cxx                                     |    5 
 sfx2/source/view/viewsh.cxx                                      |    9 
 sw/qa/extras/rtfexport/data/tdf115180.docx                       |binary
 sw/qa/extras/rtfexport/rtfexport3.cxx                            |   15 +
 sw/source/filter/inc/wrtswtbl.hxx                                |    1 
 sw/source/filter/ww8/rtfattributeoutput.cxx                      |    4 
 sw/source/uibase/app/docst.cxx                                   |    2 
 sw/source/uibase/shells/tabsh.cxx                                |   58 ++--
 sw/source/uibase/shells/textsh1.cxx                              |    4 
 sw/source/uibase/shells/txtnum.cxx                               |    2 
 sw/source/uibase/uiview/viewling.cxx                             |   23 +
 vcl/inc/quartz/salgdi.h                                          |    3 
 vcl/quartz/ctfonts.cxx                                           |   14 -
 vcl/source/window/dialog.cxx                                     |   38 ++
 vcl/source/window/window.cxx                                     |   19 -
 30 files changed, 306 insertions(+), 151 deletions(-)

New commits:
commit 6959ec94f147d9b7a975162df0255b05211538b6
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Wed Jan 24 15:25:36 2018 +0300

    tdf#115180: take table base width into account
    
    Reviewed-on: https://gerrit.libreoffice.org/48501
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit d91236ad8fc74e1ec15c39b90660717ebab013ac)
    
    Change-Id: I4238e6c757499e289193efa3498fb1e68d5f3e9c

diff --git a/sw/qa/extras/rtfexport/data/tdf115180.docx b/sw/qa/extras/rtfexport/data/tdf115180.docx
new file mode 100644
index 000000000000..2e41c7a24a1d
Binary files /dev/null and b/sw/qa/extras/rtfexport/data/tdf115180.docx differ
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx
index c8941ed26633..870650ab9b88 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -80,6 +80,21 @@ DECLARE_RTFEXPORT_TEST(testTdf114333, "tdf114333.rtf")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(8498), getProperty<sal_Int32>(xTable, "Width"));
 }
 
+DECLARE_RTFEXPORT_TEST(testTdf115180, "tdf115180.docx")
+{
+    // On export to RTF, column separator positions were written without taking base width
+    // into account and then arrived huge, ~64000, which resulted in wrong table and cell widths
+
+    sal_Int32 rowWidth = parseDump("/root/page/body/tab/row/infos/bounds", "width").toInt32();
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Row width", sal_Int32(9360), rowWidth);
+    sal_Int32 cell1Width
+        = parseDump("/root/page/body/tab/row/cell[1]/infos/bounds", "width").toInt32();
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("First cell width", sal_Int32(9142), cell1Width);
+    sal_Int32 cell2Width
+        = parseDump("/root/page/body/tab/row/cell[2]/infos/bounds", "width").toInt32();
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("First cell width", sal_Int32(218), cell2Width);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/inc/wrtswtbl.hxx b/sw/source/filter/inc/wrtswtbl.hxx
index ee1cbd771537..20b9554c582a 100644
--- a/sw/source/filter/inc/wrtswtbl.hxx
+++ b/sw/source/filter/inc/wrtswtbl.hxx
@@ -286,6 +286,7 @@ public:
 
     long GetAbsHeight(long nRawWidth, size_t nRow, sal_uInt16 nRowSpan) const;
 
+    double GetAbsWidthRatio() const { return m_nTabWidth == m_nBaseWidth ? 1.0 : double(m_nTabWidth) / m_nBaseWidth; }
 protected:
     long GetLineHeight( const SwTableLine *pLine );
     static long GetLineHeight( const SwTableBox *pBox );
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index d158cc91215e..07f57320db08 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -721,6 +721,7 @@ void RtfAttributeOutput::TableDefinition(
     }
 
     // The cell-dependent properties
+    const double fWidthRatio = m_pTableWrt->GetAbsWidthRatio();
     const SwWriteTableRows& aRows = m_pTableWrt->GetRows();
     SwWriteTableRow* pRow = aRows[pTableTextNodeInfoInner->getRow()];
     SwTwips nSz = 0;
@@ -740,7 +741,8 @@ void RtfAttributeOutput::TableDefinition(
         // value of nSz is needed.
         nSz += pCellFormat->GetFrameSize().GetWidth();
         m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CELLX);
-        m_aRowDefs.append((sal_Int32)(pFormat->GetLRSpace().GetLeft() + nSz));
+        m_aRowDefs.append(static_cast<sal_Int32>(pFormat->GetLRSpace().GetLeft()
+                                                 + rtl::math::round(nSz * fWidthRatio)));
     }
 }
 
commit 6e1fae5aa004e28d5822018b37e00d2ae17802d6
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Thu Jan 25 15:52:52 2018 +0530

    lokdialog: Disable filepicker for LOK
    
    We don't want people to browser their jails in the filepicker dialog.
    
    Change-Id: I2fdd3d948cc1f193098492d1a310424ac2d49317
    (cherry picked from commit 9711a8a35796d0d4ab4b69204bd4484686bf0707)

diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index ff486ddb3d0a..fe1e3ba9dcc1 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -69,6 +69,7 @@
 #include <com/sun/star/beans/XPropertySet.hpp>
 
 #include <comphelper/interaction.hxx>
+#include <comphelper/lok.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/string.hxx>
 
@@ -1798,6 +1799,9 @@ void SvtFileDialog::EnableControl( Control* _pControl, bool _bEnable )
 
 short SvtFileDialog::PrepareExecute()
 {
+    if (comphelper::LibreOfficeKit::isActive())
+        return 0;
+
     OUString aEnvValue;
     if ( getEnvironmentValue( "WorkDirMustContainRemovableMedia", aEnvValue ) && aEnvValue == "1" )
     {
commit 41edbd19a8e6710802618b32479fc363f6862a85
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Thu Jan 25 14:34:19 2018 +0530

    lokdialog: Fix incorrect dialog sizes sent to client
    
    GetSizePixel triggers pending resize handler and gives more correct
    sizes than GetOptimalSize(). Some of the dialog with inconsistencies in
    sizes like EditStyle, Manage Changes, etc. are fixed with this patch.
    
    Change-Id: I0661b7d2e98233edf0cd2c9c525b271d0724da08
    (cherry picked from commit 668deca97d8dd049bb17b6d8b73c4ea73f7b8b9c)

diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 32ba042b8b76..6d5319ed7b52 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -193,10 +193,9 @@ void SfxModalDialog::StateChanged( StateChangedType nType )
             // SfxModalDialog even though they are modeless, i.e., their Execute method
             // isn't called.
             SetLOKNotifier(SfxViewShell::Current());
-            const Size aSize = GetOptimalSize();
             std::vector<vcl::LOKPayloadItem> aItems;
             aItems.emplace_back("type", "dialog");
-            aItems.emplace_back("size", aSize.toString());
+            aItems.emplace_back("size", GetSizePixel().toString());
             if (!GetText().isEmpty())
                 aItems.emplace_back("title", GetText().toUtf8());
             SfxViewShell::Current()->notifyWindow(GetLOKWindowId(), "created", aItems);
@@ -259,7 +258,7 @@ void SfxModelessDialog::StateChanged( StateChangedType nStateChange )
             SetLOKNotifier(pViewShell);
             std::vector<vcl::LOKPayloadItem> aItems;
             aItems.emplace_back("type", "dialog");
-            aItems.emplace_back("size", GetOptimalSize().toString());
+            aItems.emplace_back("size", GetSizePixel().toString());
             if (!GetText().isEmpty())
                 aItems.emplace_back("title", GetText().toUtf8());
             pViewShell->notifyWindow(GetLOKWindowId(), "created", aItems);
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index fd1d1b0aa61a..0219f2a806d2 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -889,10 +889,9 @@ bool Dialog::ImplStartExecuteModal()
     {
         if(const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
         {
-            const Size aSize = GetOptimalSize();
             std::vector<vcl::LOKPayloadItem> aItems;
             aItems.emplace_back("type", "dialog");
-            aItems.emplace_back("size", aSize.toString());
+            aItems.emplace_back("size", GetSizePixel().toString());
             if (!GetText().isEmpty())
                 aItems.emplace_back("title", GetText().toUtf8());
             pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
@@ -1259,7 +1258,7 @@ void Dialog::Resize()
     if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
     {
         std::vector<vcl::LOKPayloadItem> aItems;
-        aItems.emplace_back("size", GetOptimalSize().toString());
+        aItems.emplace_back("size", GetSizePixel().toString());
         pNotifier->notifyWindow(GetLOKWindowId(), "size_changed", aItems);
     }
 }
commit e2e0ec0a01b5cb3f13349d364db9e643a7a1b295
Author: Henry Castro <hcastro at collabora.com>
Date:   Thu Jan 11 13:31:36 2018 -0400

    lok dialog: enable MessageDialog tunneling
    
    Reviewed-on: https://gerrit.libreoffice.org/47772
    Reviewed-by: pranavk <pranavk at collabora.co.uk>
    Tested-by: pranavk <pranavk at collabora.co.uk>
    (cherry picked from commit 072e3ce1cfea5bb61cc5f3001c288df6deb45613)
    
    Change-Id: I05b270a19e29c5ed3a2482fd8163e61e66bfdf74

diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index db885c7173a2..670fc10f7238 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -72,7 +72,6 @@ public:
     virtual ~SfxModalDialog() override;
     virtual void dispose() override;
 
-    virtual short       Execute() override;
     const SfxItemSet*   GetOutputItemSet() const { return pOutputSet; }
     const SfxItemSet*   GetInputItemSet() const { return pInputSet; }
     void                StateChanged( StateChangedType nStateChange ) override;
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 4417f8cca767..979c62c199dc 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -60,6 +60,7 @@ private:
     SAL_DLLPRIVATE void    RemoveFromDlgList();
     SAL_DLLPRIVATE void    ImplInitDialogData();
     SAL_DLLPRIVATE void    ImplInitSettings();
+    SAL_DLLPRIVATE inline  void ImplLOKNotifier(vcl::Window* pParent);
     SAL_DLLPRIVATE VclPtr<vcl::Window> AddBorderWindow(vcl::Window* pParent, WinBits nBits);
 
     virtual void ApplySettings(vcl::RenderContext& rRenderContext) override;
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 4285d0277da1..b6f53222ab82 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -1212,7 +1212,7 @@ public:
     void                        SetComponentInterface( css::uno::Reference< css::awt::XWindowPeer > const & xIFace );
 
     /// Interface to register for dialog / window tunneling.
-    void                                SetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier);
+    void                                SetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier, bool bParent = false);
     const vcl::ILibreOfficeKitNotifier* GetLOKNotifier() const;
     vcl::LOKWindowId                    GetLOKWindowId() const;
 
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 0f03e15ebf3a..32ba042b8b76 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -161,33 +161,9 @@ void SfxModalDialog::dispose()
     SetDialogData_Impl();
     delete pOutputSet;
 
-    if (comphelper::LibreOfficeKit::isActive() && GetLOKNotifier())
-    {
-        SfxViewShell::Current()->notifyWindow(GetLOKWindowId(), "close");
-        ReleaseLOKNotifier();
-    }
-
     ModalDialog::dispose();
 }
 
-short SfxModalDialog::Execute()
-{
-    SfxViewShell* pViewShell = SfxViewShell::Current();
-    if (comphelper::LibreOfficeKit::isActive() && pViewShell && !GetLOKNotifier())
-    {
-        SetLOKNotifier(pViewShell);
-        const Size aSize = GetOptimalSize();
-        std::vector<vcl::LOKPayloadItem> aItems;
-        aItems.emplace_back("type", "dialog");
-        aItems.emplace_back("size", aSize.toString());
-        if (!GetText().isEmpty())
-            aItems.emplace_back("title", GetText().toUtf8());
-        pViewShell->notifyWindow(GetLOKWindowId(), "created", aItems);
-    }
-
-    return ModalDialog::Execute();
-}
-
 void SfxModalDialog::CreateOutputItemSet( SfxItemPool& rPool )
 {
     DBG_ASSERT( !pOutputSet, "Double creation of OutputSet!" );
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index d1c366490e88..9fe10f844c14 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -403,13 +403,6 @@ void SfxTabDialog::dispose()
     m_pBaseFmtBtn.clear();
     m_pActionArea.clear();
 
-    SfxViewShell* pViewShell = SfxViewShell::Current();
-    if (comphelper::LibreOfficeKit::isActive() && pViewShell)
-    {
-        pViewShell->notifyWindow(GetLOKWindowId(), "close");
-        ReleaseLOKNotifier();
-    }
-
     TabDialog::dispose();
 }
 
@@ -587,20 +580,6 @@ void SfxTabDialog::Start_Impl()
 
     m_pTabCtrl->SetCurPageId( nActPage );
     ActivatePageHdl( m_pTabCtrl );
-
-    SfxViewShell* pViewShell = SfxViewShell::Current();
-
-    if (comphelper::LibreOfficeKit::isActive() && pViewShell && !GetLOKNotifier())
-    {
-        SetLOKNotifier(pViewShell);
-        const Size aSize = GetOptimalSize();
-        std::vector<vcl::LOKPayloadItem> aItems;
-        aItems.emplace_back("type", "dialog");
-        aItems.emplace_back("size", aSize.toString());
-        if (!GetText().isEmpty())
-            aItems.emplace_back("title", GetText().toUtf8());
-        pViewShell->notifyWindow(GetLOKWindowId(), "created", aItems);
-    }
 }
 
 void SfxTabDialog::AddTabPage( sal_uInt16 nId, const OUString &rRiderText )
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 36cb0dbf3f4d..8f4d56792435 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1255,8 +1255,13 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
             }
 
             case SfxHintId::Deinitializing:
+            {
+                if (GetWindow().GetLOKNotifier())
+                    GetWindow().ReleaseLOKNotifier();
+
                 GetFrame().DoClose();
                 break;
+            }
             case SfxHintId::Dying:
                 // when the Object is being deleted, destroy the view too
                 if ( m_xObjSh.is() )
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 3eb162ffe642..0174aa2caa40 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1071,6 +1071,9 @@ SfxViewShell::SfxViewShell
     // Insert into list
     SfxViewShellArr_Impl &rViewArr = SfxGetpApp()->GetViewShells_Impl();
     rViewArr.push_back(this);
+
+    if (comphelper::LibreOfficeKit::isActive())
+        pViewFrame->GetWindow().SetLOKNotifier(this, true);
 }
 
 
@@ -1094,6 +1097,9 @@ SfxViewShell::~SfxViewShell()
         pImpl->m_pController->ReleaseShell_Impl();
         pImpl->m_pController.clear();
     }
+
+    if (GetViewFrame()->GetWindow().GetLOKNotifier())
+        GetViewFrame()->GetWindow().ReleaseLOKNotifier();
 }
 
 bool SfxViewShell::PrepareClose
@@ -1101,6 +1107,9 @@ bool SfxViewShell::PrepareClose
     bool bUI     // TRUE: Allow Dialog and so on, FALSE: silent-mode
 )
 {
+    if (GetViewFrame()->GetWindow().GetLOKNotifier())
+        GetViewFrame()->GetWindow().ReleaseLOKNotifier();
+
     SfxPrinter *pPrinter = GetPrinter();
     if ( pPrinter && pPrinter->IsPrinting() )
     {
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index afaab2a21f9a..fd1d1b0aa61a 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -490,6 +490,17 @@ void Dialog::ImplInitSettings()
         SetBackground(GetSettings().GetStyleSettings().GetDialogColor());
 }
 
+void Dialog::ImplLOKNotifier(vcl::Window* pParent)
+{
+    if (comphelper::LibreOfficeKit::isActive() && pParent)
+    {
+        if (VclPtr<vcl::Window> pWin = pParent->GetParentWithLOKNotifier())
+        {
+            SetLOKNotifier(pWin->GetLOKNotifier());
+        }
+    }
+}
+
 Dialog::Dialog( WindowType nType )
     : SystemWindow( nType )
     , mbForceBorderWindow(false)
@@ -526,6 +537,7 @@ Dialog::Dialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXML
     , mbForceBorderWindow(false)
     , mnInitFlag(InitFlag::Default)
 {
+    ImplLOKNotifier(pParent);
     ImplInitDialogData();
     loadUI(pParent, OUStringToOString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription);
 }
@@ -535,6 +547,7 @@ Dialog::Dialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXML
     , mbForceBorderWindow(bBorder)
     , mnInitFlag(eFlag)
 {
+    ImplLOKNotifier(pParent);
     ImplInitDialogData();
     loadUI(pParent, OUStringToOString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription);
 }
@@ -544,6 +557,7 @@ Dialog::Dialog(vcl::Window* pParent, WinBits nStyle, InitFlag eFlag)
     , mbForceBorderWindow(false)
     , mnInitFlag(eFlag)
 {
+    ImplLOKNotifier(pParent);
     ImplInitDialogData();
     ImplInit( pParent, nStyle, eFlag );
 }
@@ -594,6 +608,15 @@ void Dialog::dispose()
     xEventBroadcaster->documentEventOccured(aObject);
     UITestLogger::getInstance().log("DialogClosed");
 
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        if(const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
+        {
+            pNotifier->notifyWindow(GetLOKWindowId(), "close");
+            ReleaseLOKNotifier();
+        }
+    }
+
     SystemWindow::dispose();
 }
 
@@ -862,6 +885,20 @@ bool Dialog::ImplStartExecuteModal()
     xEventBroadcaster->documentEventOccured(aObject);
     UITestLogger::getInstance().log("DialogExecute");
 
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        if(const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
+        {
+            const Size aSize = GetOptimalSize();
+            std::vector<vcl::LOKPayloadItem> aItems;
+            aItems.emplace_back("type", "dialog");
+            aItems.emplace_back("size", aSize.toString());
+            if (!GetText().isEmpty())
+                aItems.emplace_back("title", GetText().toUtf8());
+            pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
+        }
+    }
+
     return true;
 }
 
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 3aff52f67573..838727fd8296 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3194,19 +3194,22 @@ LOKWindowsMap& GetLOKWindowsMap()
 
 }
 
-void Window::SetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier)
+void Window::SetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier, bool bParent)
 {
     // don't allow setting this twice
     assert(mpWindowImpl->mpLOKNotifier == nullptr);
     assert(pNotifier);
 
-    // Counter to be able to have unique id's for each window.
-    static vcl::LOKWindowId sLastLOKWindowId = 1;
+    if (!bParent)
+    {
+        // Counter to be able to have unique id's for each window.
+        static vcl::LOKWindowId sLastLOKWindowId = 1;
 
-    // assign the LOK window id
-    assert(mpWindowImpl->mnLOKWindowId == 0);
-    mpWindowImpl->mnLOKWindowId = sLastLOKWindowId++;
-    GetLOKWindowsMap().insert(std::map<vcl::LOKWindowId, VclPtr<vcl::Window>>::value_type(mpWindowImpl->mnLOKWindowId, this));
+        // assign the LOK window id
+        assert(mpWindowImpl->mnLOKWindowId == 0);
+        mpWindowImpl->mnLOKWindowId = sLastLOKWindowId++;
+        GetLOKWindowsMap().insert(std::map<vcl::LOKWindowId, VclPtr<vcl::Window>>::value_type(mpWindowImpl->mnLOKWindowId, this));
+    }
 
     mpWindowImpl->mpLOKNotifier = pNotifier;
 }
@@ -3237,8 +3240,6 @@ const vcl::ILibreOfficeKitNotifier* Window::GetLOKNotifier() const
 
 vcl::LOKWindowId Window::GetLOKWindowId() const
 {
-    assert(mpWindowImpl->mnLOKWindowId > 0);
-
     return mpWindowImpl->mnLOKWindowId;
 }
 
commit 2f6a337139f60307057fcc44cb0d6d563ee9f28c
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Jan 24 20:07:40 2018 +0100

    lok: Send the enabled / disabled state of .uno:TransformDialog.
    
    Change-Id: If2d8e0da6c289deb65dc8a6b38a21dfd5bbfc1bd
    Reviewed-on: https://gerrit.libreoffice.org/48534
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    (cherry picked from commit dd42329b4a204d9d9dcac102095f144ea3eca791)

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 879dad11eabd..ffa74e8a1699 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1764,6 +1764,7 @@ static void doc_iniUnoCommands ()
         OUString(".uno:OutlineBullet"),
         OUString(".uno:InsertIndexesEntry"),
         OUString(".uno:DocumentRepair"),
+        OUString(".uno:TransformDialog"),
         OUString(".uno:InsertPageHeader"),
         OUString(".uno:InsertPageFooter")
     };
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 5e5b26170fda..31c5bd9c702f 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1092,7 +1092,8 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c
              aEvent.FeatureURL.Path == "FontDialog" ||
              aEvent.FeatureURL.Path == "ParagraphDialog" ||
              aEvent.FeatureURL.Path == "OutlineBullet" ||
-             aEvent.FeatureURL.Path == "InsertIndexesEntry")
+             aEvent.FeatureURL.Path == "InsertIndexesEntry" ||
+             aEvent.FeatureURL.Path == "TransformDialog")
 
     {
         aBuffer.append(aEvent.IsEnabled ? OUString("enabled") : OUString("disabled"));
commit 102161c5768764856aa9ddcb5ce080c1e9bbeeab
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Jan 24 19:13:46 2018 +0100

    lokdialog: Parents for the Impress async dialogs.
    
    After 072e3ce1cfea5bb61cc5f3001c288df6deb45613, the dialogs must have parents,
    otherwise the LOK notification does not work for them.
    
    Change-Id: I46774d05a7d47adaaa0e06104541e47daf68f3db
    Reviewed-on: https://gerrit.libreoffice.org/48533
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    (cherry picked from commit 7616b3dd942efad8fa20b30ab3a0833a21501ffd)

diff --git a/sd/source/ui/func/fuarea.cxx b/sd/source/ui/func/fuarea.cxx
index 042de7aa239f..29d8cb5311a3 100644
--- a/sd/source/ui/func/fuarea.cxx
+++ b/sd/source/ui/func/fuarea.cxx
@@ -65,7 +65,7 @@ void FuArea::DoExecute( SfxRequest& rReq )
     mpView->GetAttributes( aNewAttr );
 
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-    VclPtr<AbstractSvxAreaTabDialog> pDlg(pFact ? pFact->CreateSvxAreaTabDialog(nullptr, &aNewAttr, mpDoc, true) : nullptr);
+    VclPtr<AbstractSvxAreaTabDialog> pDlg(pFact ? pFact->CreateSvxAreaTabDialog(mpViewShell->GetActiveWindow(), &aNewAttr, mpDoc, true) : nullptr);
     if (!pDlg)
     {
         mpViewShell->Cancel();
diff --git a/sd/source/ui/func/fuline.cxx b/sd/source/ui/func/fuline.cxx
index 9fa501ce52c4..d4511fdcc610 100644
--- a/sd/source/ui/func/fuline.cxx
+++ b/sd/source/ui/func/fuline.cxx
@@ -79,7 +79,7 @@ void FuLine::DoExecute( SfxRequest& rReq )
 
     bool bHasMarked = mpView->AreObjectsMarked();
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-    VclPtr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSvxLineTabDialog(nullptr,pNewAttr.get(),mpDoc,pObj,bHasMarked) : nullptr);
+    VclPtr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSvxLineTabDialog(mpViewShell->GetActiveWindow(), pNewAttr.get(), mpDoc, pObj, bHasMarked) : nullptr);
     if (!pDlg)
     {
         mpViewShell->Cancel();
diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx
index 9dddef1dde4b..ef2894cc37f5 100644
--- a/sd/source/ui/func/futransf.cxx
+++ b/sd/source/ui/func/futransf.cxx
@@ -27,6 +27,7 @@
 #include <strings.hrc>
 #include <ViewShell.hxx>
 #include <View.hxx>
+#include <Window.hxx>
 #include <sdresid.hxx>
 #include <drawdoc.hxx>
 #include <svx/svxdlg.hxx>
@@ -101,7 +102,7 @@ void FuTransform::DoExecute( SfxRequest& rReq )
         if (!pFact)
             return;
 
-        pDlg.reset(pFact->CreateCaptionDialog(nullptr, mpView));
+        pDlg.reset(pFact->CreateCaptionDialog(mpViewShell->GetActiveWindow(), mpView));
 
         const sal_uInt16* pRange = pDlg->GetInputRanges( *aNewAttr.GetPool() );
         SfxItemSet aCombSet( *aNewAttr.GetPool(), pRange );
@@ -115,7 +116,7 @@ void FuTransform::DoExecute( SfxRequest& rReq )
         if (!pFact)
             return;
 
-        pDlg.reset(pFact->CreateSvxTransformTabDialog(nullptr, &aSet, mpView));
+        pDlg.reset(pFact->CreateSvxTransformTabDialog(mpViewShell->GetActiveWindow(), &aSet, mpView));
     }
 
     if (!pDlg)
commit 67a4b2e69ce9e34d95e9a41960df76670ed3d5be
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Dec 1 21:56:55 2017 +0000

    Initialize more for sharing during pre-init.
    
    Reviewed-on: https://gerrit.libreoffice.org/46120
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/48510
    (cherry picked from commit 5fc484a786a04d65811518b7effab66925dcec72)
    
    Change-Id: I12b90504ec9161318683ebad8f8e4dd1e614da89

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index e33226be7f8c..879dad11eabd 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -55,6 +55,7 @@
 #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
 #include <com/sun/star/text/TextContentAnchorType.hpp>
 #include <com/sun/star/document/XRedlinesSupplier.hpp>
+#include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp>
 
 #include <com/sun/star/linguistic2/LinguServiceManager.hpp>
 #include <com/sun/star/linguistic2/XSpellChecker.hpp>
@@ -84,6 +85,7 @@
 #include <vcl/ptrstyle.hxx>
 #include <vcl/sysdata.hxx>
 #include <vcl/virdev.hxx>
+#include <vcl/ImageTree.hxx>
 #include <vcl/ITiledRenderable.hxx>
 #include <vcl/IDialogRenderable.hxx>
 #include <unicode/uchar.h>
@@ -96,6 +98,8 @@
 #include <svl/undo.hxx>
 #include <unotools/datetime.hxx>
 #include <android/compatibility.hxx>
+#include <i18nlangtag/languagetag.hxx>
+
 
 #include <app.hxx>
 
@@ -3667,6 +3671,20 @@ static void preloadData()
         xThesaurus->queryMeanings("forcefed", it, aNone);
     }
     std::cerr << "\n";
+
+    css::uno::Reference< css::ui::XAcceleratorConfiguration > xGlobalCfg;
+    xGlobalCfg = css::ui::GlobalAcceleratorConfiguration::create(
+        comphelper::getProcessComponentContext());
+    xGlobalCfg->getAllKeyEvents();
+
+    std::cerr << "Preload icons\n";
+    ImageTree &images = ImageTree::get();
+    images.getImageUrl("forcefed.png", "style", "FO_oo");
+
+    std::cerr << "Preload languages\n";
+    // force load language singleton
+    SvtLanguageTable::HasLanguageType(LANGUAGE_SYSTEM);
+    LanguageTag::isValidBcp47("foo", nullptr);
 }
 
 static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char* pUserProfileUrl)
diff --git a/framework/source/accelerators/globalacceleratorconfiguration.cxx b/framework/source/accelerators/globalacceleratorconfiguration.cxx
index 08e861f0778b..f3956aeda98a 100644
--- a/framework/source/accelerators/globalacceleratorconfiguration.cxx
+++ b/framework/source/accelerators/globalacceleratorconfiguration.cxx
@@ -19,6 +19,7 @@
 
 #include <accelerators/acceleratorconfiguration.hxx>
 #include <accelerators/presethandler.hxx>
+#include <accelerators/keymapping.hxx>
 #include <helper/mischelper.hxx>
 
 #include <acceleratorconst.h>
@@ -81,6 +82,8 @@ private:
 GlobalAcceleratorConfiguration::GlobalAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext)
     : GlobalAcceleratorConfiguration_BASE(xContext)
 {
+    // force keyboard string registration.
+    KeyMapping::get();
 }
 
 void GlobalAcceleratorConfiguration::fillCache()
commit dcedc4ef100dffc87b6580d9a2f9e331a46b8455
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Jan 24 13:32:24 2018 +0100

    lok: Preload thesauri too.
    
    Change-Id: If2bfd3a024fc61900d3c12ff976df136d4e61bf6
    Reviewed-on: https://gerrit.libreoffice.org/48502
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>
    (cherry picked from commit fa72a3379d3641565ddab561d32d0a7d03b83665)

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ec00d9cc56c0..e33226be7f8c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3639,13 +3639,13 @@ static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit:
 /// Used only by LibreOfficeKit when used by Online to pre-initialize
 static void preloadData()
 {
-    // First: sit down and read all dictionaries: yum.
+    // preload all available dictionaries
     css::uno::Reference<css::linguistic2::XLinguServiceManager> xLngSvcMgr =
         css::linguistic2::LinguServiceManager::create(comphelper::getProcessComponentContext());
     css::uno::Reference<linguistic2::XSpellChecker> xSpellChecker(xLngSvcMgr->getSpellChecker());
 
-    css::uno::Reference<linguistic2::XSupportedLocales> xLocales(xSpellChecker, css::uno::UNO_QUERY_THROW);
-    uno::Sequence< css::lang::Locale > aLocales = xLocales->getLocales();
+    css::uno::Reference<linguistic2::XSupportedLocales> xSpellLocales(xSpellChecker, css::uno::UNO_QUERY_THROW);
+    uno::Sequence< css::lang::Locale > aLocales = xSpellLocales->getLocales();
     std::cerr << "Preloading dictionaries: ";
     for (auto &it : aLocales)
     {
@@ -3654,6 +3654,19 @@ static void preloadData()
         xSpellChecker->isValid("forcefed", it, aNone);
     }
     std::cerr << "\n";
+
+    // preload all available thesauri
+    css::uno::Reference<linguistic2::XThesaurus> xThesaurus(xLngSvcMgr->getThesaurus());
+    css::uno::Reference<linguistic2::XSupportedLocales> xThesLocales(xSpellChecker, css::uno::UNO_QUERY_THROW);
+    aLocales = xThesLocales->getLocales();
+    std::cerr << "Preloading thesauri: ";
+    for (auto &it : aLocales)
+    {
+        std::cerr << it.Language << "_" << it.Country << " ";
+        css::beans::PropertyValues aNone;
+        xThesaurus->queryMeanings("forcefed", it, aNone);
+    }
+    std::cerr << "\n";
 }
 
 static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char* pUserProfileUrl)
commit ad107e7b4c672f76d8eff62e32ebfe902b174b97
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Jan 24 13:19:41 2018 +0100

    sd: Kill an own scope guard impl. and use comphelper::ScopeGuard instead.
    
    Change-Id: I769c1c6c9d10081b706d0e1e0fbd7ad373a6e04f
    Reviewed-on: https://gerrit.libreoffice.org/48499
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>
    (cherry picked from commit 9f05a323d50c6750e25f2ca69f758ec7fc4313bc)

diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx
index f62c9788da8a..9dddef1dde4b 100644
--- a/sd/source/ui/func/futransf.cxx
+++ b/sd/source/ui/func/futransf.cxx
@@ -19,6 +19,7 @@
 
 #include <futransf.hxx>
 
+#include <comphelper/scopeguard.hxx>
 #include <svx/dialogs.hrc>
 #include <vcl/msgbox.hxx>
 #include <sfx2/request.hxx>
@@ -61,34 +62,15 @@ void setUndo(::sd::View* pView, const SfxItemSet* pArgs)
     pView->EndUndo();
 }
 
-class ScopeCleanup
-{
-    ViewShell* mpViewShell;
-public:
-    ScopeCleanup(ViewShell* pViewShell) : mpViewShell(pViewShell)
-    {
-    }
-
-    ~ScopeCleanup()
-    {
-        if (mpViewShell)
-        {
-            mpViewShell->Invalidate(SID_RULER_OBJECT);
-            mpViewShell->Cancel();
-        }
-    }
-
-    void ignore()
-    {
-        mpViewShell = nullptr;
-    }
-};
-
 }
 
 void FuTransform::DoExecute( SfxRequest& rReq )
 {
-    ScopeCleanup aCleanup(mpViewShell);
+    comphelper::ScopeGuard guard([&]() {
+        // cleanup when leaving
+        mpViewShell->Invalidate(SID_RULER_OBJECT);
+        mpViewShell->Cancel();
+    });
 
     if (!mpView->AreObjectsMarked())
         return;
@@ -141,7 +123,7 @@ void FuTransform::DoExecute( SfxRequest& rReq )
 
     std::shared_ptr<SfxRequest> pRequest(new SfxRequest(rReq));
     rReq.Ignore(); // the 'old' request is not relevant any more
-    aCleanup.ignore(); // the lambda does it
+    guard.dismiss(); // we'll invalidate explicitly after the dialog ends
 
     pDlg->StartExecuteAsync([=](sal_Int32 nResult){
         if (nResult == RET_OK)
commit 047a3a7bd9a67a9a1fbc60cf421f6ad0937573c2
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Jan 24 12:47:20 2018 +0100

    lokdialog: Convert the Tools -> Thesaurus... to async exec.
    
    Change-Id: Iee25e3fa970e5e28a14a95cfc8804ce944d4f762
    Reviewed-on: https://gerrit.libreoffice.org/48497
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>
    (cherry picked from commit 3a9c80c4cdcd4387ff07ddd4347973aaa7df9860)

diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index dc220a5bb684..63f41303f60a 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -28,6 +28,7 @@
 #include <comphelper/processfactory.hxx>
 #include <comphelper/propertyvalue.hxx>
 #include <comphelper/propertysequence.hxx>
+#include <comphelper/scopeguard.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 #include <vcl/msgbox.hxx>
 #include <svtools/ehdl.hxx>
@@ -560,8 +561,9 @@ void SwView::StartThesaurus()
     }
 
     SwViewOption* pVOpt = const_cast<SwViewOption*>(m_pWrtShell->GetViewOptions());
-    bool bOldIdle = pVOpt->IsIdle();
+    const bool bOldIdle = pVOpt->IsIdle();
     pVOpt->SetIdle( false );
+    comphelper::ScopeGuard guard([&]() { pVOpt->SetIdle(bOldIdle); }); // restore when leaving scope
 
     // get initial LookUp text
     const bool bSelection = static_cast<SwCursorShell*>(m_pWrtShell)->HasSelection();
@@ -573,20 +575,27 @@ void SwView::StartThesaurus()
         SpellError( eLang );
     else
     {
-        ScopedVclPtr<AbstractThesaurusDialog> pDlg;
+        VclPtr<AbstractThesaurusDialog> pDlg;
         // create dialog
         {   //Scope for SwWait-Object
             SwWait aWait( *GetDocShell(), true );
             // load library with dialog only on demand ...
             SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-            pDlg.disposeAndReset(pFact->CreateThesaurusDialog( &GetEditWin(), xThes, aTmp, eLang ));
+            pDlg.reset(pFact->CreateThesaurusDialog(&GetEditWin(), xThes, aTmp, eLang));
         }
 
-        if ( pDlg->Execute()== RET_OK )
-            InsertThesaurusSynonym( pDlg->GetWord(), aTmp, bSelection );
-    }
+        if (pDlg)
+        {
+            guard.dismiss(); // ignore, we'll call SetIdle() explictly after the dialog ends
 
-    pVOpt->SetIdle( bOldIdle );
+            pDlg->StartExecuteAsync([=](sal_Int32 nResult){
+                if (nResult == RET_OK )
+                    InsertThesaurusSynonym(pDlg->GetWord(), aTmp, bSelection);
+
+                pVOpt->SetIdle(bOldIdle);
+            });
+        }
+    }
 }
 
 // Offer online suggestions
commit 47b4fcc703dbe1c22663d7b264e00f65e367bc2b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Jan 24 22:05:17 2018 +0100

    desktop: always clear LOK error message on success
    
    Change-Id: Idefdbd3d9ae19f7cf5889017b111c12620ab08c2
    Reviewed-on: https://gerrit.libreoffice.org/48541
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit 027abe22f11a8c7dac38697f02d03156bb91a8a1)

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 1ea30de95dd0..ec00d9cc56c0 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1333,6 +1333,7 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
     SolarMutexGuard aGuard;
 
     LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
+    pLib->maLastExceptionMsg.clear();
 
     OUString aURL(getAbsoluteURL(pURL));
     if (aURL.isEmpty())
@@ -1436,6 +1437,7 @@ static int lo_runMacro(LibreOfficeKit* pThis, const char *pURL)
     SolarMutexGuard aGuard;
 
     LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
+    pLib->maLastExceptionMsg.clear();
 
     OUString sURL( pURL, strlen(pURL), RTL_TEXTENCODING_UTF8 );
     if (sURL.isEmpty())
@@ -1526,6 +1528,7 @@ static void lo_registerCallback (LibreOfficeKit* pThis,
     SolarMutexGuard aGuard;
 
     LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
+    pLib->maLastExceptionMsg.clear();
 
     pLib->mpCallback = pCallback;
     pLib->mpCallbackData = pData;
@@ -1534,6 +1537,8 @@ static void lo_registerCallback (LibreOfficeKit* pThis,
 static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const char* pFormat, const char* pFilterOptions)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
 
@@ -1661,6 +1666,8 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const cha
 static void doc_iniUnoCommands ()
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     OUString sUnoCommands[] =
     {
@@ -1800,6 +1807,8 @@ static void doc_iniUnoCommands ()
 static int doc_getDocumentType (LibreOfficeKitDocument* pThis)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
 
@@ -1852,6 +1861,8 @@ static int doc_getParts (LibreOfficeKitDocument* pThis)
 static int doc_getPart (LibreOfficeKitDocument* pThis)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
@@ -1866,6 +1877,8 @@ static int doc_getPart (LibreOfficeKitDocument* pThis)
 static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
@@ -1880,6 +1893,8 @@ static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart)
 static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
@@ -1899,6 +1914,8 @@ static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis)
 static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
@@ -1918,6 +1935,8 @@ static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart)
 static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
@@ -1938,6 +1957,8 @@ static void doc_setPartMode(LibreOfficeKitDocument* pThis,
                             int nPartMode)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
@@ -1977,6 +1998,8 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
                           const int nTileWidth, const int nTileHeight)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     SAL_INFO( "lok.tiledrendering", "paintTile: painting [" << nTileWidth << "x" << nTileHeight <<
               "]@(" << nTilePosX << ", " << nTilePosY << ") to [" <<
@@ -2029,6 +2052,8 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis,
                               const int nTileWidth, const int nTileHeight)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     SAL_INFO( "lok.tiledrendering", "paintPartTile: painting @ " << nPart << " ["
                << nTileWidth << "x" << nTileHeight << "]@("
@@ -2112,6 +2137,8 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis,
 
 static int doc_getTileMode(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/)
 {
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
     return LOK_TILEMODE_BGRA;
 }
 
@@ -2120,6 +2147,8 @@ static void doc_getDocumentSize(LibreOfficeKitDocument* pThis,
                                 long* pHeight)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (pDoc)
@@ -2138,6 +2167,8 @@ static void doc_initializeForRendering(LibreOfficeKitDocument* pThis,
                                        const char* pArguments)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (pDoc)
@@ -2153,6 +2184,8 @@ static void doc_registerCallback(LibreOfficeKitDocument* pThis,
                                  void* pData)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
 
@@ -2206,6 +2239,8 @@ static void doc_registerCallback(LibreOfficeKitDocument* pThis,
 /// Returns the JSON representation of all the comments in the document
 static char* getPostIts(LibreOfficeKitDocument* pThis)
 {
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
     {
@@ -2219,6 +2254,8 @@ static char* getPostIts(LibreOfficeKitDocument* pThis)
 /// Returns the JSON representation of the positions of all the comments in the document
 static char* getPostItsPos(LibreOfficeKitDocument* pThis)
 {
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
     {
@@ -2231,6 +2268,8 @@ static char* getPostItsPos(LibreOfficeKitDocument* pThis)
 
 static char* getRulerState(LibreOfficeKitDocument* pThis)
 {
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
     {
@@ -2244,6 +2283,8 @@ static char* getRulerState(LibreOfficeKitDocument* pThis)
 static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nCharCode, int nKeyCode)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
@@ -2257,6 +2298,8 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nChar
 static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nType, int nCharCode, int nKeyCode)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     VclPtr<Window> pWindow = vcl::Window::FindLOKWindow(nLOKWindowId);
     if (!pWindow)
@@ -2326,6 +2369,8 @@ public:
 static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pCommand, const char* pArguments, bool bNotifyWhenFinished)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     SfxObjectShell* pDocSh = SfxObjectShell::Current();
     OUString aCommand(pCommand, strlen(pCommand), RTL_TEXTENCODING_UTF8);
@@ -2403,6 +2448,8 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
 static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
@@ -2436,6 +2483,8 @@ static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX,
 static void doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     VclPtr<Window> pWindow = vcl::Window::FindLOKWindow(nLOKWindowId);
     if (!pWindow)
@@ -2472,6 +2521,8 @@ static void doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned
 static void doc_setTextSelection(LibreOfficeKitDocument* pThis, int nType, int nX, int nY)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
@@ -2486,6 +2537,8 @@ static void doc_setTextSelection(LibreOfficeKitDocument* pThis, int nType, int n
 static char* doc_getTextSelection(LibreOfficeKitDocument* pThis, const char* pMimeType, char** pUsedMimeType)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
@@ -2514,6 +2567,8 @@ static char* doc_getTextSelection(LibreOfficeKitDocument* pThis, const char* pMi
 static bool doc_paste(LibreOfficeKitDocument* pThis, const char* pMimeType, const char* pData, size_t nSize)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
@@ -2549,6 +2604,8 @@ static bool doc_paste(LibreOfficeKitDocument* pThis, const char* pMimeType, cons
 static void doc_setGraphicSelection(LibreOfficeKitDocument* pThis, int nType, int nX, int nY)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
@@ -2563,6 +2620,8 @@ static void doc_setGraphicSelection(LibreOfficeKitDocument* pThis, int nType, in
 static void doc_resetSelection(LibreOfficeKitDocument* pThis)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
@@ -2942,6 +3001,8 @@ static char* getTrackedChangeAuthors(LibreOfficeKitDocument* pThis)
 static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCommand)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     OString aCommand(pCommand);
     static const OString aViewRowColumnHeaders(".uno:ViewRowColumnHeaders");
@@ -3109,6 +3170,8 @@ static void doc_setClientZoom(LibreOfficeKitDocument* pThis, int nTilePixelWidth
         int nTileTwipWidth, int nTileTwipHeight)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
@@ -3123,6 +3186,8 @@ static void doc_setClientZoom(LibreOfficeKitDocument* pThis, int nTilePixelWidth
 static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int nY, int nWidth, int nHeight)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
@@ -3138,6 +3203,8 @@ static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int
 static void doc_setOutlineState(LibreOfficeKitDocument* pThis, bool bColumn, int nLevel, int nIndex, bool bHidden)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (!pDoc)
@@ -3152,6 +3219,8 @@ static void doc_setOutlineState(LibreOfficeKitDocument* pThis, bool bColumn, int
 static int doc_createView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     return SfxLokHelper::createView();
 }
@@ -3159,6 +3228,8 @@ static int doc_createView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/
 static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     SfxLokHelper::destroyView(nId);
 }
@@ -3166,6 +3237,8 @@ static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis
 static void doc_setView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     SfxLokHelper::setView(nId);
 }
@@ -3173,6 +3246,8 @@ static void doc_setView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/,
 static int doc_getView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     return SfxLokHelper::getView();
 }
@@ -3180,6 +3255,8 @@ static int doc_getView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/)
 static int doc_getViewsCount(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     return SfxLokHelper::getViewsCount();
 }
@@ -3187,6 +3264,8 @@ static int doc_getViewsCount(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThi
 static bool doc_getViewIds(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int* pArray, size_t nSize)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     return SfxLokHelper::getViewIds(pArray, nSize);
 }
@@ -3194,6 +3273,8 @@ static bool doc_getViewIds(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*
 static void doc_setViewLanguage(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId, const char* language)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     SfxLokHelper::setViewLanguage(nId, OStringToOUString(language, RTL_TEXTENCODING_UTF8));
 }
@@ -3205,6 +3286,8 @@ unsigned char* doc_renderFont(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pTh
                     int* pFontHeight)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     OString aSearchedFontName(pFontName);
     OUString aText(OStringToOUString(pChar, RTL_TEXTENCODING_UTF8));
@@ -3307,6 +3390,8 @@ static void doc_paintWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWind
                             const int nWidth, const int nHeight)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     VclPtr<Window> pWindow = vcl::Window::FindLOKWindow(nLOKWindowId);
     if (!pWindow)
@@ -3332,6 +3417,8 @@ static void doc_paintWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWind
 static void doc_postWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nAction)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     VclPtr<Window> pWindow = vcl::Window::FindLOKWindow(nLOKWindowId);
     if (!pWindow)
@@ -3366,6 +3453,8 @@ static void lo_freeError(char* pFree)
 static char* lo_getFilterTypes(LibreOfficeKit* pThis)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     LibLibreOffice_Impl* pImpl = static_cast<LibLibreOffice_Impl*>(pThis);
 
@@ -3404,6 +3493,8 @@ static char* lo_getFilterTypes(LibreOfficeKit* pThis)
 static void lo_setOptionalFeatures(LibreOfficeKit* pThis, unsigned long long const features)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     LibLibreOffice_Impl *const pLib = static_cast<LibLibreOffice_Impl*>(pThis);
     pLib->mOptionalFeatures = features;
@@ -3419,6 +3510,8 @@ static void lo_setDocumentPassword(LibreOfficeKit* pThis,
         const char* pURL, const char* pPassword)
 {
     SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
 
     assert(pThis);
     assert(pURL);
@@ -3429,6 +3522,8 @@ static void lo_setDocumentPassword(LibreOfficeKit* pThis,
 
 static char* lo_getVersionInfo(SAL_UNUSED_PARAMETER LibreOfficeKit* /*pThis*/)
 {
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
     const OUString sVersionStrTemplate(
         "{ "
         "\"ProductName\": \"%PRODUCTNAME\", "
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index e158ee62cab7..310b9cfcee88 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -583,11 +583,6 @@ public:
     }
 
     /// Returns the last error as a string, the returned pointer has to be freed by the caller.
-
-    /// Exact semantics somewhat unclear (sometimes the code clears the string that the next call to
-    /// getError() will return if no error happens in another function, sometimes not), and
-    /// unfortunately cleaning up that is harder than it seems, because of lovely global variables
-    /// and a unit test that uses the LibreOfficeKit API in an untypical manner.
     char* getError()
     {
         return mpThis->pClass->getError(mpThis);
commit ee37a9f7c219461e7042c84c21e1c9b95e464cd7
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Tue Jan 23 18:13:01 2018 +0100

    lokdialog: Convert the Table -> Properties... to async exec.
    
    Change-Id: Iac937f5032ddaa614f8364a85b0b8db2a0828cbd
    Reviewed-on: https://gerrit.libreoffice.org/48454
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit c3a085d22742f88e91ff92f319a26d6e8d1d9a98)

diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 61814a10b53a..a318d08e1234 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -579,7 +579,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
 
             FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( &rSh.GetView()) != nullptr );
             SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
-            std::unique_ptr<SwTableRep> pTableRep(::lcl_TableParamToItemSet( aCoreSet, rSh ));
+            std::shared_ptr<SwTableRep> pTableRep(::lcl_TableParamToItemSet(aCoreSet, rSh));
 
             aCoreSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
             rSh.GetTableAttr(aCoreSet);
@@ -590,37 +590,49 @@ void SwTableShell::Execute(SfxRequest &rReq)
             else
                 aCoreSet.InvalidateItem( RES_BACKGROUND );
 
-            ScopedVclPtr<SfxAbstractTabDialog> pDlg;
-            {
-                SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
+            SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
+            OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
-                pDlg.disposeAndReset(pFact->CreateSwTableTabDlg(GetView().GetWindow(), &aCoreSet, &rSh));
-                OSL_ENSURE(pDlg, "Dialog creation failed!");
+            VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTableTabDlg(GetView().GetWindow(), &aCoreSet, &rSh));
+            OSL_ENSURE(pDlg, "Dialog creation failed!");
 
+            if (pDlg)
+            {
                 if (pItem)
                     pDlg->SetCurPageId(OUStringToOString(static_cast<const SfxStringItem *>(pItem)->GetValue(), RTL_TEXTENCODING_UTF8));
-            }
 
+                std::shared_ptr<SfxRequest> pRequest(new SfxRequest(rReq));
+                rReq.Ignore(); // the 'old' request is not relevant any more
 
-            if ( (!pDlg && rReq.GetArgs()) || (pDlg && pDlg->Execute() == RET_OK) )
+                pDlg->StartExecuteAsync([pDlg, pRequest, pTableRep, &rBindings, &rSh](sal_Int32 nResult){
+                    if (RET_OK == nResult)
+                    {
+                        const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
+
+                        //to record FN_INSERT_TABLE correctly
+                        pRequest->SetSlot(FN_FORMAT_TABLE_DLG);
+                        pRequest->Done(*pOutSet);
+
+                        ItemSetToTableParam(*pOutSet, rSh);
+                    }
+
+                    rBindings.Update(SID_RULER_BORDERS);
+                    rBindings.Update(SID_ATTR_TABSTOP);
+                    rBindings.Update(SID_RULER_BORDERS_VERTICAL);
+                    rBindings.Update(SID_ATTR_TABSTOP_VERTICAL);
+                });
+            }
+            else
             {
-                const SfxItemSet* pOutSet = pDlg ? pDlg->GetOutputItemSet() : rReq.GetArgs();
-                if ( pDlg )
-                {
-                    //to record FN_INSERT_TABLE correctly
-                    rReq.SetSlot(FN_FORMAT_TABLE_DLG);
-                    rReq.Done( *pOutSet );
-                }
-                ItemSetToTableParam( *pOutSet, rSh );
+                if (rReq.GetArgs())
+                    ItemSetToTableParam(*rReq.GetArgs(), rSh);
+
+                rBindings.Update(SID_RULER_BORDERS);
+                rBindings.Update(SID_ATTR_TABSTOP);
+                rBindings.Update(SID_RULER_BORDERS_VERTICAL);
+                rBindings.Update(SID_ATTR_TABSTOP_VERTICAL);
             }
 
-            pDlg.disposeAndClear();
-            pTableRep.reset();
-            rBindings.Update(SID_RULER_BORDERS);
-            rBindings.Update(SID_ATTR_TABSTOP);
-            rBindings.Update(SID_RULER_BORDERS_VERTICAL);
-            rBindings.Update(SID_ATTR_TABSTOP_VERTICAL);
             break;
         }
         case SID_ATTR_BRUSH:
commit bd3372fa67bb6f9fcb4a5905981ed5fe5167fffb
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Jan 22 10:44:20 2018 +0200

    StartExecuteAsync doesn't need a second param
    
    we can just use this to store a keep-alive reference in AsyncContext
    
    Change-Id: I0152aef5386aa9753b48afdfc958790f10d13560
    Reviewed-on: https://gerrit.libreoffice.org/48294
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit 70c15946ac5b2f481fed3c6e79f496196feb1b22)

diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx
index 87336e0d5a5f..542930084e37 100644
--- a/include/vcl/abstdlg.hxx
+++ b/include/vcl/abstdlg.hxx
@@ -49,10 +49,10 @@ public:
         bool isSet() { return !!maEndDialogFn; }
     };
 
-    bool StartExecuteAsync(const std::function<void(sal_Int32)> &rEndDialogFn, VclPtr<VclReferenceBase> xOwner)
+    bool StartExecuteAsync(const std::function<void(sal_Int32)> &rEndDialogFn)
     {
         AsyncContext aCtx;
-        aCtx.mxOwner = xOwner;
+        aCtx.mxOwner = this;
         aCtx.maEndDialogFn = rEndDialogFn;
         return StartExecuteAsync(aCtx);
     }
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 7fe00ba1c8c3..4417f8cca767 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -141,11 +141,10 @@ public:
 
     // FIXME: Need to remove old StartExecuteModal in favour of this one.
     /// Returns true of the dialog successfully starts
-    bool StartExecuteAsync(const std::function<void(sal_Int32)> &rEndDialogFn,
-                           VclPtr<VclReferenceBase> xOwner = VclPtr<VclReferenceBase>())
+    bool StartExecuteAsync(const std::function<void(sal_Int32)> &rEndDialogFn)
     {
         VclAbstractDialog::AsyncContext aCtx;
-        aCtx.mxOwner = xOwner;
+        aCtx.mxOwner = this;
         aCtx.maEndDialogFn = rEndDialogFn;
         return StartExecuteAsync(aCtx);
     }
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index da1c35a3b33b..2e79fb16513b 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -562,7 +562,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
 
                 pRequest->Done(pOutSet);
             }
-        }, pDlg);
+        });
 }
 
 bool ScTabViewShell::IsRefInputMode() const
diff --git a/sd/source/ui/func/fuarea.cxx b/sd/source/ui/func/fuarea.cxx
index 1d9197871071..042de7aa239f 100644
--- a/sd/source/ui/func/fuarea.cxx
+++ b/sd/source/ui/func/fuarea.cxx
@@ -90,7 +90,7 @@ void FuArea::DoExecute( SfxRequest& rReq )
 
             mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
         }
-    }, pDlg);
+    });
 }
 
 void FuArea::Activate()
diff --git a/sd/source/ui/func/fuline.cxx b/sd/source/ui/func/fuline.cxx
index 67ad104ecc31..9fa501ce52c4 100644
--- a/sd/source/ui/func/fuline.cxx
+++ b/sd/source/ui/func/fuline.cxx
@@ -107,7 +107,7 @@ void FuLine::DoExecute( SfxRequest& rReq )
             mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
         }
         mpViewShell->Cancel();
-    }, pDlg);
+    });
 }
 
 void FuLine::Activate()
diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx
index 0d0a7788d43a..f62c9788da8a 100644
--- a/sd/source/ui/func/futransf.cxx
+++ b/sd/source/ui/func/futransf.cxx
@@ -152,7 +152,7 @@ void FuTransform::DoExecute( SfxRequest& rReq )
 
         mpViewShell->Invalidate(SID_RULER_OBJECT);
         mpViewShell->Cancel();
-    }, pDlg);
+    });
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index 4361dd18068c..8719f7444ece 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -868,7 +868,7 @@ void SwDocShell::Edit(
 
             if (pRequest)
                 pRequest->Done();
-        }, pDlg);
+        });
     }
     else
     {
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index a5d008596702..bbcecf5a3cf9 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -207,7 +207,7 @@ void sw_CharDialog(SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot, const
             {
                 sw_CharDialogResult(pDlg->GetOutputItemSet(), rWrtSh, pCoreSet, bSel, bSelectionPut, pRequest.get());
             }
-        }, pDlg);
+        });
     }
     else if (pArgs)
     {
@@ -1122,7 +1122,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
 
                         sw_ParagraphDialogResult(pSet, rWrtSh, *pRequest, pPaM);
                     }
-                }, pDlg);
+                });
             }
         }
         break;
diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx
index 866c439b8c6a..6a715a75ae94 100644
--- a/sw/source/uibase/shells/txtnum.cxx
+++ b/sw/source/uibase/shells/txtnum.cxx
@@ -237,7 +237,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
             }
             else if (RET_USER == nResult)
                 GetShell().DelNumRules();
-        }, pDlg);
+        });
     }
     break;
 
commit 84bb059dfb207f3d3e9ed5d2b6b687902b419ddf
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Jan 22 20:57:24 2018 +0200

    The CT prefix is used by the CoreText API
    
    Surely we should not be using it for our own things in our Quartz
    code, that is misleading.
    
    Also bin a silly typedef.
    
    Change-Id: Ie932e8784128246ca449608aad3dc96a575ec9d5
    (cherry picked from commit 43836528f445061d622b8edc7773ee40798d3a59)

diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 5a346b6a2098..39ba333c547a 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -127,8 +127,7 @@ private:
     CTFontCollectionRef mpCTFontCollection;
     CFArrayRef mpCTFontArray;
 
-    typedef std::unordered_map<sal_IntPtr,CoreTextFontFace*> CTFontContainer;
-    CTFontContainer maFontContainer;
+    std::unordered_map<sal_IntPtr,CoreTextFontFace*> maFontContainer;
 };
 
 
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index ee556a1fd2ae..2d5b103b8e63 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -469,7 +469,7 @@ FontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool* bFont
     return rDFA;
 }
 
-static void CTFontEnumCallBack( const void* pValue, void* pContext )
+static void fontEnumCallBack( const void* pValue, void* pContext )
 {
     CTFontDescriptorRef pFD = static_cast<CTFontDescriptorRef>(pValue);
 
@@ -492,8 +492,8 @@ SystemFontList::SystemFontList()
 
 SystemFontList::~SystemFontList()
 {
-    CTFontContainer::const_iterator it = maFontContainer.begin();
-    for(; it != maFontContainer.end(); ++it )
+    auto it = maFontContainer.cbegin();
+    for(; it != maFontContainer.cend(); ++it )
     {
         delete (*it).second;
     }
@@ -517,8 +517,8 @@ void SystemFontList::AddFont( CoreTextFontFace* pFontData )
 
 void SystemFontList::AnnounceFonts( PhysicalFontCollection& rFontCollection ) const
 {
-    CTFontContainer::const_iterator it = maFontContainer.begin();
-    for(; it != maFontContainer.end(); ++it )
+    auto it = maFontContainer.cbegin();
+    for(; it != maFontContainer.cend(); ++it )
     {
         rFontCollection.Add( (*it).second->Clone() );
     }
@@ -526,7 +526,7 @@ void SystemFontList::AnnounceFonts( PhysicalFontCollection& rFontCollection ) co
 
 CoreTextFontFace* SystemFontList::GetFontDataFromId( sal_IntPtr nFontId ) const
 {
-    CTFontContainer::const_iterator it = maFontContainer.find( nFontId );
+    auto it = maFontContainer.find( nFontId );
     if( it == maFontContainer.end() )
     {
         return nullptr;
@@ -550,7 +550,7 @@ bool SystemFontList::Init()
 
     const int nFontCount = CFArrayGetCount( mpCTFontArray );
     const CFRange aFullRange = CFRangeMake( 0, nFontCount );
-    CFArrayApplyFunction( mpCTFontArray, aFullRange, CTFontEnumCallBack, this );
+    CFArrayApplyFunction( mpCTFontArray, aFullRange, fontEnumCallBack, this );
 
     return true;
 }


More information about the Libreoffice-commits mailing list