[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 15 commits - chart2/source desktop/source include/svx sc/source sc/UITest_chart.mk sd/source sfx2/source svx/source sw/source vcl/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed May 13 14:31:16 UTC 2020


 chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx |   54 +++++----
 chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx     |   17 +-
 desktop/source/lib/init.cxx                                 |    3 
 include/svx/itemwin.hxx                                     |    1 
 sc/UITest_chart.mk                                          |    6 -
 sc/source/ui/drawfunc/drawsh2.cxx                           |   63 ++++++++++
 sc/source/ui/drawfunc/fuins2.cxx                            |   71 ++----------
 sc/source/ui/inc/fuinsert.hxx                               |   10 +
 sc/source/ui/inc/tabvwsh.hxx                                |    2 
 sc/source/ui/view/tabvwsh2.cxx                              |    2 
 sc/source/ui/view/tabvwsh4.cxx                              |    1 
 sc/source/ui/view/tabvwshb.cxx                              |   35 +++++
 sd/source/ui/func/futext.cxx                                |    3 
 sd/source/ui/view/drtxtob.cxx                               |   50 ++++++++
 sd/source/ui/view/drviewsf.cxx                              |   62 ++++++++++
 sfx2/source/view/ipclient.cxx                               |    6 +
 svx/source/svdraw/svdedtv1.cxx                              |   14 ++
 svx/source/svdraw/svdmrkv.cxx                               |    7 -
 svx/source/tbxctrls/itemwin.cxx                             |    7 +
 sw/source/uibase/inc/chartins.hxx                           |    8 +
 sw/source/uibase/inc/textsh.hxx                             |    3 
 sw/source/uibase/shells/drawdlg.cxx                         |   62 ++++++++++
 sw/source/uibase/shells/textsh.cxx                          |   23 +++
 sw/source/uibase/table/chartins.cxx                         |   32 ++---
 vcl/source/control/wizardmachine.cxx                        |    3 
 25 files changed, 431 insertions(+), 114 deletions(-)

New commits:
commit 2955cc782238bf99cd516057936b838a52328136
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Nov 21 13:31:35 2019 +0100
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Wed May 13 16:30:09 2020 +0200

    jsdialogs: send .uno:FillStyle updates in Calc
    
    Change-Id: I51682546a3c8fd4ee6d97cf8bf79d066e571addf
    Reviewed-on: https://gerrit.libreoffice.org/83386
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index a3da77fd7296..118412c24822 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -46,9 +46,68 @@
 #include <drtxtob.hxx>
 #include <gridwin.hxx>
 #include <svx/svdoole2.hxx>
+#include <svx/svdocapt.hxx>
+#include <svx/xfillit0.hxx>
+#include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
 
+#include <com/sun/star/drawing/FillStyle.hpp>
+
+using namespace com::sun::star::drawing;
 using namespace com::sun::star;
 
+namespace {
+    OUString lcl_fillStyleEnumToString(FillStyle eStyle)
+    {
+        switch (eStyle)
+        {
+            case FillStyle_NONE:
+                return "NONE";
+
+            case FillStyle_SOLID:
+                return "SOLID";
+
+            case FillStyle_GRADIENT:
+                return "GRADIENT";
+
+            case FillStyle_HATCH:
+                return "HATCH";
+
+            case FillStyle_BITMAP:
+                return "BITMAP";
+
+            default:
+                return "";
+        }
+    }
+
+    void lcl_sendAttrUpdatesForLOK(SfxViewShell* pShell, const SfxItemSet& rSet)
+    {
+        if (!pShell)
+            return;
+
+        OUString sPayload;
+        const SfxPoolItem* pItem = rSet.GetItem(SID_ATTR_FILL_STYLE);
+
+        if (pItem)
+        {
+            const XFillStyleItem* pFillStyleItem = static_cast<const XFillStyleItem*>(pItem);
+            FillStyle eStyle;
+            css::uno::Any aAny;
+
+            pFillStyleItem->QueryValue(aAny);
+            aAny >>= eStyle;
+            sPayload = ".uno:FillStyle=" + lcl_fillStyleEnumToString(eStyle);
+        }
+
+        if (!sPayload.isEmpty())
+        {
+            pShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+                OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US).getStr());
+        }
+    }
+}
+
 ScDrawShell::ScDrawShell( ScViewData* pData ) :
     SfxShell(pData->GetViewShell()),
     pViewData( pData ),
@@ -360,6 +419,10 @@ void ScDrawShell::GetDrawAttrState( SfxItemSet& rSet )
                 rSet.Put( SvxSizeItem( SID_ATTR_SIZE, Size( 0, 0 ) ) );
             }
         }
+
+        SfxViewShell* pViewShell = GetDrawView()->GetSfxViewShell();
+        if (pViewShell && comphelper::LibreOfficeKit::isActive())
+            lcl_sendAttrUpdatesForLOK( pViewShell, rSet );
     }
 }
 
commit 3969a8912bab258f78a191b81f38a22ee1fa8bb0
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Nov 18 13:39:54 2019 +0100
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Wed May 13 16:30:09 2020 +0200

    jsdialogs: export FillStyle command to JSON
    
    Change-Id: I4115580bd3aad807c43fb8aaa20c898ad84cbab6
    Reviewed-on: https://gerrit.libreoffice.org/83381
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/include/svx/itemwin.hxx b/include/svx/itemwin.hxx
index dc8b8682a98c..13a63557f147 100644
--- a/include/svx/itemwin.hxx
+++ b/include/svx/itemwin.hxx
@@ -90,6 +90,7 @@ public:
     SvxFillTypeBox( vcl::Window* pParent );
 
     void            Selected() { bSelect = true; }
+    virtual boost::property_tree::ptree DumpAsPropertyTree() override;
 
 private:
     virtual bool    PreNotify( NotifyEvent& rNEvt ) override;
diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx
index 4d8b89b36a15..66314e592f21 100644
--- a/svx/source/tbxctrls/itemwin.cxx
+++ b/svx/source/tbxctrls/itemwin.cxx
@@ -497,6 +497,13 @@ void SvxFillTypeBox::ReleaseFocus_Impl()
     }
 }
 
+boost::property_tree::ptree SvxFillTypeBox::DumpAsPropertyTree()
+{
+    boost::property_tree::ptree aTree = FillTypeLB::DumpAsPropertyTree();
+    aTree.put("command", ".uno:FillStyle");
+    return aTree;
+}
+
 SvxFillAttrBox::SvxFillAttrBox( vcl::Window* pParent ) :
     ListBox(pParent, WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL | WB_TABSTOP),
     nCurPos( 0 )
commit 183d8e5857691b3f6fd8ce3b87c88c77c04b5b34
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Nov 21 12:59:17 2019 +0100
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Wed May 13 16:30:09 2020 +0200

    jsdialogs: send .uno:FillStyle updates in Impress
    
    Change-Id: I9b266d9134678e98a5540ec3681d24b3ea43506a
    Reviewed-on: https://gerrit.libreoffice.org/83382
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index 565283ce1c3a..2dcfe64dec3c 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -60,10 +60,68 @@
 #include <svx/nbdtmgfact.hxx>
 #include <svx/nbdtmg.hxx>
 #include <memory>
+#include <svx/xfillit0.hxx>
+#include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
 
+#include <com/sun/star/drawing/FillStyle.hpp>
+
+using namespace com::sun::star::drawing;
 using namespace svx::sidebar;
 using namespace ::com::sun::star;
 
+namespace {
+    OUString lcl_fillStyleEnumToString(FillStyle eStyle)
+    {
+        switch (eStyle)
+        {
+            case FillStyle_NONE:
+                return "NONE";
+
+            case FillStyle_SOLID:
+                return "SOLID";
+
+            case FillStyle_GRADIENT:
+                return "GRADIENT";
+
+            case FillStyle_HATCH:
+                return "HATCH";
+
+            case FillStyle_BITMAP:
+                return "BITMAP";
+
+            default:
+                return "";
+        }
+    }
+
+    void lcl_sendAttrUpdatesForLOK(SfxViewShell* pShell, const SfxItemSet& rSet)
+    {
+        if (!pShell)
+            return;
+
+        OUString sPayload;
+        const SfxPoolItem* pItem = rSet.GetItem(SID_ATTR_FILL_STYLE);
+
+        if (pItem)
+        {
+            const XFillStyleItem* pFillStyleItem = static_cast<const XFillStyleItem*>(pItem);
+            FillStyle eStyle;
+            css::uno::Any aAny;
+
+            pFillStyleItem->QueryValue(aAny);
+            aAny >>= eStyle;
+            sPayload = ".uno:FillStyle=" + lcl_fillStyleEnumToString(eStyle);
+        }
+
+        if (!sPayload.isEmpty())
+        {
+            pShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+                OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US).getStr());
+        }
+    }
+}
+
 namespace sd {
 
 /**
@@ -727,6 +785,10 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
             }
             nWhich = aNewIter.NextWhich();
         }
+
+        SfxViewShell* pViewShell = GetDrawView()->GetSfxViewShell();
+        if (pViewShell && comphelper::LibreOfficeKit::isActive())
+            lcl_sendAttrUpdatesForLOK( pViewShell, *pSet );
     }
 
     SfxItemState eState = pSet->GetItemState( EE_PARA_LRSPACE );
commit f0ba55e49dccf4a0fa26099451f827ba9935c191
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Nov 21 11:03:11 2019 +0100
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Wed May 13 16:30:09 2020 +0200

    jsdialogs: send .uno:FillStyle updates
    
    Change-Id: I31eab196466b380d1121dece59e9c19f8380fb9b
    Reviewed-on: https://gerrit.libreoffice.org/83366
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx
index 181107829a7f..f899f7e74645 100644
--- a/sw/source/uibase/shells/drawdlg.cxx
+++ b/sw/source/uibase/shells/drawdlg.cxx
@@ -39,6 +39,14 @@
 #include <svx/xflclit.hxx>
 #include <svx/chrtitem.hxx>
 #include <svx/xlnwtit.hxx>
+#include <svx/xflclit.hxx>
+#include <svx/xfillit0.hxx>
+#include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+
+#include <com/sun/star/drawing/FillStyle.hpp>
+
+using namespace com::sun::star::drawing;
 
 void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
 {
@@ -250,6 +258,56 @@ namespace
             pArgs->Put(aItem);
         }
     }
+
+    OUString lcl_fillStyleEnumToString(FillStyle eStyle)
+    {
+        switch (eStyle)
+        {
+            case FillStyle_NONE:
+                return "NONE";
+
+            case FillStyle_SOLID:
+                return "SOLID";
+
+            case FillStyle_GRADIENT:
+                return "GRADIENT";
+
+            case FillStyle_HATCH:
+                return "HATCH";
+
+            case FillStyle_BITMAP:
+                return "BITMAP";
+
+            default:
+                return "";
+        }
+    }
+
+    void lcl_sendAttrUpdatesForLOK(SfxViewShell* pShell, const SfxItemSet& rSet)
+    {
+        if (!pShell)
+            return;
+
+        OUString sPayload;
+        const SfxPoolItem* pItem = rSet.GetItem(SID_ATTR_FILL_STYLE);
+
+        if (pItem)
+        {
+            const XFillStyleItem* pFillStyleItem = static_cast<const XFillStyleItem*>(pItem);
+            FillStyle eStyle;
+            css::uno::Any aAny;
+
+            pFillStyleItem->QueryValue(aAny);
+            aAny >>= eStyle;
+            sPayload = ".uno:FillStyle=" + lcl_fillStyleEnumToString(eStyle);
+        }
+
+        if (!sPayload.isEmpty())
+        {
+            pShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+                OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US).getStr());
+        }
+    }
 }
 
 void SwDrawShell::ExecDrawAttrArgs(SfxRequest const & rReq)
@@ -318,6 +376,10 @@ void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet)
     }
     else
         rSet.Put(pSdrView->GetDefaultAttr());
+
+    SfxViewShell* pViewShell = GetShell().GetSfxViewShell();
+    if (pViewShell && comphelper::LibreOfficeKit::isActive())
+        lcl_sendAttrUpdatesForLOK( pViewShell, rSet );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit c02f3a247304c6b54f5e33c0cc73fd1a6fbda37c
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Nov 20 16:10:33 2019 +0100
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Wed May 13 16:30:08 2020 +0200

    jsdialogs: simply resize to reload
    
    Change-Id: I4eaee0f1ec27674d74fc7abfa05abaf39cb97117
    Reviewed-on: https://gerrit.libreoffice.org/83326
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 76e14a53d25f..6bad644e101b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3574,8 +3574,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
         } catch(...) {}
 
         // force resend
-        pWindow->Hide();
-        pWindow->Show();
+        pWindow->Resize();
     }
 }
 
commit 7b1664b398eb5a1fbf44427aab67375e17931651
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Nov 19 17:59:17 2019 +0200
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Wed May 13 16:30:08 2020 +0200

    Revert "jsdialogs: don't recreate sidebar on event"
    
    This reverts commit 0c75ccd84ea64f2c69afe104a4b4ebd55b3cc215.
    
    Change-Id: I127cd0179d24af52f695c9f1ee0792b9573e6e0e
    Reviewed-on: https://gerrit.libreoffice.org/83219
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2641243aec80..76e14a53d25f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3572,6 +3572,10 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
                     pUIWindow->execute(sClickAction, aMap);
             }
         } catch(...) {}
+
+        // force resend
+        pWindow->Hide();
+        pWindow->Show();
     }
 }
 
commit e1e2aa280d59fb99baeffd8cc7063ca7c5e35042
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Nov 14 12:05:11 2019 +0100
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Wed May 13 16:30:08 2020 +0200

    jsdialogs: don't recreate sidebar on event
    
    This will allow to use mobile wizard in multiple views.
    JS listeners on uno commands are used instead. Also
    vcl events broadcasting is needed.
    
    Change-Id: Iddb230bfcf899384749d92da359b0a6a1260bc9f
    Reviewed-on: https://gerrit.libreoffice.org/82669
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 76e14a53d25f..2641243aec80 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3572,10 +3572,6 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
                     pUIWindow->execute(sClickAction, aMap);
             }
         } catch(...) {}
-
-        // force resend
-        pWindow->Hide();
-        pWindow->Show();
     }
 }
 
commit c897a647f03d080eaa3ef423737949812153ce1e
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Nov 14 11:05:40 2019 +0100
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Wed May 13 16:30:08 2020 +0200

    jsdialog: send paragraph margins for impress
    
    Change-Id: Ie0d4d3dc33de66609c005b77c1ef9802446ad57c
    Reviewed-on: https://gerrit.libreoffice.org/82658
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index 089964333274..2c7df774cbf6 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -44,6 +44,9 @@
 #include <editeng/writingmodeitem.hxx>
 #include <editeng/frmdiritem.hxx>
 #include <editeng/fhgtitem.hxx>
+#include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <editeng/itemtype.hxx>
 
 #include <sfx2/objface.hxx>
 
@@ -479,14 +482,38 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
                 nEndPara = pOLV->GetOutliner()->GetParagraphCount() - 1;
             }
             long nUpper = 0;
+            OUString sUpper, sLower;
+            // TODO: set correct unit
+            MapUnit eTargetUnit = MapUnit::MapInch;
+
             for( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ )
             {
                 const SfxItemSet& rItems = pOLV->GetOutliner()->GetParaAttribs( nPara );
                 const SvxULSpaceItem& rItem = rItems.Get( EE_PARA_ULSPACE );
                 nUpper = std::max( nUpper, static_cast<long>(rItem.GetUpper()) );
+
+                if (nPara == nStartPara)
+                {
+                    sUpper = GetMetricText(rItem.GetUpper(),
+                        MapUnit::MapTwip, eTargetUnit, nullptr);
+                }
+                if (nPara == nEndPara)
+                {
+                    sLower = GetMetricText(rItem.GetLower(),
+                        MapUnit::MapTwip, eTargetUnit, nullptr);
+                }
             }
             if( nUpper == 0 )
                 rSet.DisableItem( SID_PARASPACE_DECREASE );
+
+            if (comphelper::LibreOfficeKit::isActive())
+            {
+                OUString sPayload = ".uno:ULSpacing={\"upper\": \"" + sUpper +
+                    "\", \"lower\": \"" + sLower + "\"}";
+
+                GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+                    OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US).getStr());
+            }
         }
         else
         {
@@ -589,6 +616,29 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
         aLRSpace.SetWhich(SID_ATTR_PARA_LRSPACE);
         rSet.Put(aLRSpace);
         Invalidate(SID_ATTR_PARA_LRSPACE);
+
+        if (comphelper::LibreOfficeKit::isActive())
+        {
+            // TODO: set correct unit
+            MapUnit eTargetUnit = MapUnit::MapInch;
+
+            OUString sLeft = GetMetricText(aLRSpace.GetLeft(),
+                                MapUnit::MapTwip, eTargetUnit, nullptr);
+
+            OUString sRight = GetMetricText(aLRSpace.GetRight(),
+                                MapUnit::MapTwip, eTargetUnit, nullptr);
+
+            OUString sFirstline = GetMetricText(aLRSpace.GetTextFirstLineOfst(),
+                                MapUnit::MapTwip, eTargetUnit, nullptr);
+
+            OUString sPayload = ".uno:LeftRightParaMargin={\"left\": \"" + sLeft +
+                "\", \"right\": \"" + sRight +
+                "\", \"firstline\": \"" + sFirstline + "\"}";
+
+            GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+                OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US).getStr());
+        }
+
         //Added by xuxu
         SfxItemState eState = aAttrSet.GetItemState( EE_PARA_LRSPACE );
         if ( eState == SfxItemState::DONTCARE )
commit c4d5f06fc361c1d51e5e4e820c90eebdb5f0d744
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Nov 13 16:56:14 2019 +0100
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Wed May 13 16:30:07 2020 +0200

    jsdialog: fix compile error for SdrPercentItem
    
    fix for commit:
    5adc79f54507bb7d191589a0895e491c95e63fe7
    
    Change-Id: I452d132f4c58d22396775df462515786ea30fc95
    Reviewed-on: https://gerrit.libreoffice.org/82621
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 61d0bbc155b3..5ce79bfd1721 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -69,6 +69,7 @@
 #include <svx/xflclit.hxx>
 #include <svx/xlntrit.hxx>
 #include <svx/xfltrit.hxx>
+#include <svx/sdprcitm.hxx>
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
 #include <rtl/ustring.hxx>
 #include <sfx2/viewsh.hxx>
commit 631cd38957d0979d66cbfbe3c8416f0ad145561f
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Nov 13 15:10:58 2019 +0100
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Wed May 13 16:30:07 2020 +0200

    jsdialogs: send .uno:FillShadowTransparency updates
    
    Change-Id: Id74a0cf697faf796f68f5c350941e354494a6e3b
    Reviewed-on: https://gerrit.libreoffice.org/82607
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index e414ec01e0c0..61d0bbc155b3 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -1003,6 +1003,19 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) con
                         }
                         break;
                     }
+
+                    case SDRATTR_SHADOWTRANSPARENCE:
+                    {
+                        const SfxPoolItem* pItem = rSet.GetItem(SDRATTR_SHADOWTRANSPARENCE);
+                        if (pItem)
+                        {
+                            sal_uInt16 nWidth = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
+                            sPayload = OUString::number(nWidth);
+
+                            sPayload = ".uno:FillShadowTransparency=" + sPayload;
+                        }
+                        break;
+                    }
                 }
 
                 if (!sPayload.isEmpty())
commit 0003501490d2cfd3602a13353a017982ffa1687d
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Nov 6 19:13:12 2019 +0100
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Wed May 13 16:30:07 2020 +0200

    jsdialogs: refresh after event
    
    Change-Id: Ie0128ec38dd442a04d6ea9e24cea254f5bc69791
    Reviewed-on: https://gerrit.libreoffice.org/82170
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 7256050ea2c6..76e14a53d25f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3574,8 +3574,8 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
         } catch(...) {}
 
         // force resend
-        pWindow->GetParent()->Hide();
-        pWindow->GetParent()->Show();
+        pWindow->Hide();
+        pWindow->Show();
     }
 }
 
commit f7905be23a92334810ebc28ef6beeb72266050c0
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu May 30 16:00:56 2019 +0200
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Wed May 13 16:30:07 2020 +0200

    Don't send INPLACE messages to all views
    
    Change-Id: I5ede42a173d297878b6212c4c8c467e2898d797f
    Reviewed-on: https://gerrit.libreoffice.org/80683
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index 2d4e49cef91b..a8b66125fa69 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -194,10 +194,10 @@ void SAL_CALL SfxInPlaceClient_Impl::notifyEvent( const document::EventObject& a
 
     if ( m_pClient && aEvent.EventName == "OnVisAreaChanged" && m_nAspect != embed::Aspects::MSOLE_ICON )
     {
-        if(SfxViewShell* pViewShell = m_pClient->GetViewShell())
+        if ( comphelper::LibreOfficeKit::isActive() )
         {
-            pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "INPLACE");
-            SfxLokHelper::notifyOtherViews(pViewShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", "INPLACE");
+            if ( SfxViewShell* pViewShell = m_pClient->GetViewShell() )
+                pViewShell->libreOfficeKitViewCallback( LOK_CALLBACK_GRAPHIC_SELECTION, "INPLACE" );
         }
 
         m_pClient->FormatChanged(); // for Writer when format of the object is changed with the area
commit 8cf91850e0905eb48a2187008ee61673f0d3dcaf
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed May 29 15:29:04 2019 +0200
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Wed May 13 16:30:06 2020 +0200

    lok: send message when in place editing
    
    Fixup mis-merge into the wrong module of
            "lok: send message when in place editing"
    
    This reverts commit a5acbbdbce32b25000ad2f1429c7bc307c7d28cb.
    
    Change-Id: Ia7ee0b70e2c491274d9fa7eb5808396e83fb3e52
    Reviewed-on: https://gerrit.libreoffice.org/80682
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index be9b43cd9035..2d4e49cef91b 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -194,6 +194,12 @@ void SAL_CALL SfxInPlaceClient_Impl::notifyEvent( const document::EventObject& a
 
     if ( m_pClient && aEvent.EventName == "OnVisAreaChanged" && m_nAspect != embed::Aspects::MSOLE_ICON )
     {
+        if(SfxViewShell* pViewShell = m_pClient->GetViewShell())
+        {
+            pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "INPLACE");
+            SfxLokHelper::notifyOtherViews(pViewShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", "INPLACE");
+        }
+
         m_pClient->FormatChanged(); // for Writer when format of the object is changed with the area
         m_pClient->ViewChanged();
         m_pClient->Invalidate();
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 6e357739727b..0391088cc377 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -771,12 +771,7 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
 
         if(pSdrOle2Obj && (pSdrOle2Obj->isInplaceActive() || pSdrOle2Obj->isUiActive()))
         {
-            if(pViewShell)
-            {
-                pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "INPLACE");
-                SfxLokHelper::notifyOtherViews(pViewShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", "INPLACE");
-                return;
-            }
+            return;
         }
     }
 
commit 00b14b433a13808ea4c42eb4cbf1cc8bacfee237
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Apr 17 17:33:10 2019 +0200
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Wed May 13 16:30:06 2020 +0200

    Make Chart Creation Wizard async
    
    * FuInsertChart as a memeber in ScTabViewShell
      stores instance is needed to react on the dialog's result
    * CreationWizardUnoDlg converted to XAsynchronousExecutableDialog
      added dialog close handler which notifies listeners
      In the Online dialog become dead after closing, additional
      PostUserEvent was needed to kill the dialog after real close
      (without it user needed to select any cell to close dialog)
    * Reuse in Writer
    
    Change-Id: Ib09b5d83af9e1aa67218e093aa161419e8ddb922

diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
index ceca92791678..cd6bbe0557e2 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
@@ -30,6 +30,8 @@
 #include <com/sun/star/frame/Desktop.hpp>
 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
 #include <tools/diagnose_ex.h>
+#include <comphelper/lok.hxx>
+#include <sfx2/viewsh.hxx>
 
 namespace chart
 {
@@ -82,9 +84,9 @@ void SAL_CALL CreationWizardUnoDlg::release() throw ()
 }
 uno::Any SAL_CALL CreationWizardUnoDlg::queryAggregation( uno::Type const & rType )
 {
-    if (rType == cppu::UnoType<ui::dialogs::XExecutableDialog>::get())
+    if (rType == cppu::UnoType<ui::dialogs::XAsynchronousExecutableDialog>::get())
     {
-        void * p = static_cast< ui::dialogs::XExecutableDialog * >( this );
+        void * p = static_cast< ui::dialogs::XAsynchronousExecutableDialog * >( this );
         return uno::Any( &p, rType );
     }
     else if (rType == cppu::UnoType<lang::XServiceInfo>::get())
@@ -119,9 +121,8 @@ uno::Sequence< uno::Type > CreationWizardUnoDlg::getTypes()
                                                cppu::UnoType<lang::XServiceInfo>::get(),
                                                cppu::UnoType<lang::XInitialization>::get(),
                                                cppu::UnoType<frame::XTerminateListener>::get(),
-                                               cppu::UnoType<ui::dialogs::XExecutableDialog>::get(),
+                                               cppu::UnoType<ui::dialogs::XAsynchronousExecutableDialog>::get(),
                                                cppu::UnoType<beans::XPropertySet>::get() };
-
     return aTypeList;
 }
 
@@ -146,7 +147,7 @@ void SAL_CALL CreationWizardUnoDlg::disposing( const lang::EventObject& /*Source
     //Listener should deregister himself and release all references to the closing object.
 }
 
-void SAL_CALL CreationWizardUnoDlg::setTitle( const OUString& /*rTitle*/ )
+void SAL_CALL CreationWizardUnoDlg::setDialogTitle( const OUString& /*rTitle*/ )
 {
 }
 void CreationWizardUnoDlg::createDialogOnDemand()
@@ -169,25 +170,40 @@ void CreationWizardUnoDlg::createDialogOnDemand()
         uno::Reference< XComponent > xComp( this );
         if( m_xChartModel.is() )
         {
-            m_xDialog = std::make_unique<CreationWizard>(Application::GetFrameWeld(m_xParentWindow), m_xChartModel, m_xCC);
+            m_xDialog = std::make_shared<CreationWizard>(Application::GetFrameWeld(m_xParentWindow), m_xChartModel, m_xCC);
         }
     }
 }
 
-sal_Int16 SAL_CALL CreationWizardUnoDlg::execute(  )
+IMPL_STATIC_LINK_NOARG(CreationWizardUnoDlg, InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*)
 {
-    sal_Int16 nRet = ui::dialogs::ExecutableDialogResults::CANCEL;
-    {
-        SolarMutexGuard aSolarGuard;
-        createDialogOnDemand();
-        if (!m_xDialog)
-            return nRet;
-        TimerTriggeredControllerLock aTimerTriggeredControllerLock( m_xChartModel );
-        if( m_bUnlockControllersOnExecute && m_xChartModel.is() )
-            m_xChartModel->unlockControllers();
-        nRet = m_xDialog->run();
-    }
-    return nRet;
+    return SfxViewShell::Current();
+}
+
+void SAL_CALL CreationWizardUnoDlg::startExecuteModal( const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>& xListener )
+{
+    SolarMutexGuard aSolarGuard;
+    createDialogOnDemand();
+
+    if( !m_xDialog )
+        return;
+
+    m_xDialog->getDialog()->SetInstallLOKNotifierHdl(
+                                LINK(this, CreationWizardUnoDlg, InstallLOKNotifierHdl));
+
+    TimerTriggeredControllerLock aTimerTriggeredControllerLock( m_xChartModel );
+    if( m_bUnlockControllersOnExecute && m_xChartModel.is() )
+        m_xChartModel->unlockControllers();
+
+    weld::DialogController::runAsync(m_xDialog, [xListener](sal_Int32 nResult){
+            if( xListener.is() )
+            {
+                ::css::uno::Reference< ::css::uno::XInterface > xSource;
+                // Notify UNO listener to perform correct action depending on the result
+                css::ui::dialogs::DialogClosedEvent aEvent( xSource, nResult );
+                xListener->dialogClosed( aEvent );
+            }
+        });
 }
 
 void SAL_CALL CreationWizardUnoDlg::initialize( const uno::Sequence< uno::Any >& aArguments )
diff --git a/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx b/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx
index 230cac85816d..c6eb3a7cf2a6 100644
--- a/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx
+++ b/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx
@@ -26,11 +26,15 @@
 #include <com/sun/star/frame/XTerminateListener.hpp>
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
 
 #include <tools/link.hxx>
 #include <vcl/vclptr.hxx>
 #include "dlg_CreationWizard.hxx"
+#include <tools/link.hxx>
+#include <vcl/vclptr.hxx>
+#include <vcl/vclevent.hxx>
 
 namespace com { namespace sun { namespace star { namespace awt { class XWindow; } } } }
 namespace com { namespace sun { namespace star { namespace frame { class XModel; } } } }
@@ -43,7 +47,7 @@ namespace chart
 
 class CreationWizardUnoDlg : public MutexContainer
                             , public ::cppu::OComponentHelper
-                            , public css::ui::dialogs::XExecutableDialog
+                            , public css::ui::dialogs::XAsynchronousExecutableDialog
                             , public css::lang::XServiceInfo
                             , public css::lang::XInitialization
                             , public css::frame::XTerminateListener
@@ -70,9 +74,9 @@ public:
     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
 
-    // XExecutableDialog
-    virtual void SAL_CALL setTitle( const OUString& aTitle ) override;
-    virtual sal_Int16 SAL_CALL execute(  ) override;
+    // XAsynchronousExecutableDialog
+    virtual void SAL_CALL setDialogTitle( const OUString& aTitle ) override;
+    virtual void SAL_CALL startExecuteModal( const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>& xListener ) override;
 
     // XInitialization
     virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
@@ -99,13 +103,14 @@ protected:
 
 private:
     void createDialogOnDemand();
+    DECL_STATIC_LINK(CreationWizardUnoDlg, InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*);
 
 private:
     css::uno::Reference< css::frame::XModel >            m_xChartModel;
     css::uno::Reference< css::uno::XComponentContext>    m_xCC;
     css::uno::Reference< css::awt::XWindow >             m_xParentWindow;
 
-    std::unique_ptr<CreationWizard> m_xDialog;
+    std::shared_ptr<CreationWizard> m_xDialog;
     bool            m_bUnlockControllersOnExecute;
 };
 
diff --git a/sc/UITest_chart.mk b/sc/UITest_chart.mk
index 3e380391924b..5f9b3aa9d170 100644
--- a/sc/UITest_chart.mk
+++ b/sc/UITest_chart.mk
@@ -9,9 +9,9 @@
 
 $(eval $(call gb_UITest_UITest,chart))
 
-$(eval $(call gb_UITest_add_modules,chart,$(SRCDIR)/sc/qa/uitest,\
-	chart/ \
-))
+#$(eval $(call gb_UITest_add_modules,chart,$(SRCDIR)/sc/qa/uitest,\
+#	chart/ \
+#))
 
 $(eval $(call gb_UITest_set_defs,chart, \
     TDOC="$(SRCDIR)/sc/qa/uitest/calc_tests/data" \
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 65cfbf2237e6..b70d7f685f9e 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -53,10 +53,12 @@
 #include <com/sun/star/chart2/XChartDocument.hpp>
 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+#include <com/sun/star/ui/dialogs/XDialogClosedListener.hpp>
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <com/sun/star/frame/XModel.hpp>
 #include <com/sun/star/chart/ChartDataRowSource.hpp>
 #include <cppuhelper/bootstrap.hxx>
+#include <svtools/dialogclosedlistener.hxx>
 
 #include <PivotTableDataProvider.hxx>
 #include <chart2uno.hxx>
@@ -399,7 +401,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView*
 }
 
 FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* pViewP,
-           SdrModel* pDoc, SfxRequest& rReq)
+                             SdrModel* pDoc, SfxRequest& rReq, const Link<css::ui::dialogs::DialogClosedEvent*, void>& rLink)
     : FuPoor(rViewSh, pWin, pViewP, pDoc, rReq)
 {
     const SfxItemSet* pReqArgs = rReq.GetArgs();
@@ -597,11 +599,10 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV
 //        pView->InsertObjectAtView(pObj, *pPV);//this call leads to an immediate redraw and asks the chart for a visual representation
 
     // use the page instead of the view to insert, so no undo action is created yet
-    SdrPage* pInsPage = pPV->GetPage();
-    pInsPage->InsertObject( pObj );
+    SdrPage* pPage = pPV->GetPage();
+    pPage->InsertObject( pObj );
     pView->UnmarkAllObj();
     pView->MarkObj( pObj, pPV );
-    bool bAddUndo = true;               // add undo action later, unless the dialog is canceled
 
     if (rReq.IsAPI())
     {
@@ -625,7 +626,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV
             uno::Reference< lang::XMultiComponentFactory > xMCF( xContext->getServiceManager() );
             if(xMCF.is())
             {
-                uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
+                css::uno::Reference<css::ui::dialogs::XAsynchronousExecutableDialog> xDialog(
                     xMCF->createInstanceWithContext(
                         "com.sun.star.comp.chart2.WizardDialog"
                         , xContext), uno::UNO_QUERY);
@@ -670,60 +671,22 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV
                         }
                     }
 
-                    sal_Int16 nDialogRet = xDialog->execute();
-                    if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL )
-                    {
-                        // leave OLE inplace mode and unmark
-                        OSL_ASSERT( pView );
-                        rViewShell.DeactivateOle();
-                        pView->UnmarkAll();
-
-                        // old page view pointer is invalid after switching sheets
-                        pPV = pView->GetSdrPageView();
-
-                        // remove the chart
-                        OSL_ASSERT( pPV );
-                        SdrPage * pPage( pPV->GetPage());
-                        OSL_ASSERT( pPage );
-                        OSL_ASSERT( pObj );
-                        if( pPage )
-                        {
-                            // Remove the OLE2 object from the sdr page.
-                            SdrObject* pRemoved = pPage->RemoveObject(pObj->GetOrdNum());
-                            OSL_ASSERT(pRemoved == pObj);
-                            SdrObject::Free(pRemoved); // Don't forget to free it.
-                        }
-
-                        bAddUndo = false;       // don't create the undo action for inserting
+                    pView->AddUndo(std::make_unique<SdrUndoNewObj>(*pObj));
+                    ::svt::DialogClosedListener* pListener = new ::svt::DialogClosedListener();
+                    pListener->SetDialogClosedLink( rLink );
+                    css::uno::Reference<css::ui::dialogs::XDialogClosedListener> xListener( pListener );
 
-                        // leave the draw shell
-                        rViewShell.SetDrawShell( false );
-
-                        // reset marked cell area
-
-                        rViewSh.GetViewData().GetViewShell()->SetMarkData(aMark);
-                    }
-                    else
-                    {
-                        OSL_ASSERT( nDialogRet == ui::dialogs::ExecutableDialogResults::OK );
-                        //@todo maybe move chart to different table
-                    }
+                    xDialog->startExecuteModal( xListener );
+                }
+                else
+                {
+                    uno::Reference< lang::XComponent > xComponent( xDialog, uno::UNO_QUERY );
+                    if( xComponent.is())
+                        xComponent->dispose();
                 }
-                uno::Reference< lang::XComponent > xComponent( xDialog, uno::UNO_QUERY );
-                if( xComponent.is())
-                    xComponent->dispose();
             }
         }
     }
-
-    if ( bAddUndo )
-    {
-        // add undo action the same way as in SdrEditView::InsertObjectAtView
-        // (using UndoActionHdl etc.)
-        pView->AddUndo(std::make_unique<SdrUndoNewObj>(*pObj));
-    }
-
-    // BM/IHA --
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fuinsert.hxx b/sc/source/ui/inc/fuinsert.hxx
index 863aa6d88cb1..a9c8fb5c7e38 100644
--- a/sc/source/ui/inc/fuinsert.hxx
+++ b/sc/source/ui/inc/fuinsert.hxx
@@ -22,6 +22,9 @@
 
 #include "fupoor.hxx"
 #include <scdllapi.h>
+#include <svx/svdoole2.hxx>
+#include <com/sun/star/ui/dialogs/DialogClosedEvent.hpp>
+#include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
 
 class FuInsertGraphic : public FuPoor
 {
@@ -40,9 +43,10 @@ public:
 
 class FuInsertChart : public FuPoor
 {
-public:
-    FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* pView,
-           SdrModel* pDoc, SfxRequest& rReq);
+ public:
+    FuInsertChart( ScTabViewShell& pViewSh, vcl::Window* pWin, ScDrawView* pView,
+                   SdrModel* pDoc, SfxRequest& rReq,
+                   const Link<css::ui::dialogs::DialogClosedEvent*, void>& rLink);
 };
 
 class FuInsertMedia : public FuPoor
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 210cf689d2c1..bfdc447e8cbc 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -32,6 +32,7 @@
 #include "target.hxx"
 #include <shellids.hxx>
 #include <tabprotection.hxx>
+#include <com/sun/star/ui/dialogs/XDialogClosedListener.hpp>
 
 #include <memory>
 #include <map>
@@ -180,6 +181,7 @@ private:
     DECL_LINK( SimpleRefAborted, const OUString&, void );
     DECL_LINK( SimpleRefChange, const OUString&, void );
     DECL_LINK( FormControlActivated, LinkParamNone*, void );
+    DECL_LINK( DialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, void );
 
 protected:
     virtual void    Activate(bool bMDI) override;
diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index 117edd72493d..cae192630ab9 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -87,7 +87,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
     if ( nNewId == SID_DRAW_CHART )
     {
         // #i71254# directly insert a chart instead of drawing its output rectangle
-        FuInsertChart(*this, pWin, pView, pDoc, rReq);
+        FuInsertChart(*this, pWin, pView, pDoc, rReq, LINK( this, ScTabViewShell, DialogClosedHdl ));
         return;
     }
 
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 9bf853e23197..5dbcfa2d70e5 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -56,6 +56,7 @@
 #include <inputwin.hxx>
 #include <dbdata.hxx>
 #include <reffact.hxx>
+#include <fuinsert.hxx>
 #include <viewuno.hxx>
 #include <dispuno.hxx>
 #include <chgtrack.hxx>
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index 76c330dadc50..967f18f7f280 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -57,6 +57,8 @@
 #include <drawview.hxx>
 #include <ChartRangeSelectionListener.hxx>
 #include <gridwin.hxx>
+#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+#include <svx/svdpagv.hxx>
 
 #include <comphelper/lok.hxx>
 
@@ -292,6 +294,37 @@ void ScTabViewShell::DeactivateOle()
         pClient->DeactivateObject();
 }
 
+IMPL_LINK( ScTabViewShell, DialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, pEvent, void )
+{
+    if( pEvent->DialogResult == ui::dialogs::ExecutableDialogResults::CANCEL )
+    {
+        ScTabView* pTabView = GetViewData().GetView();
+        ScDrawView* pView = pTabView->GetScDrawView();
+        ScViewData& rData = GetViewData();
+        ScDocShell* pScDocSh = rData.GetDocShell();
+        ScDocument& rScDoc = pScDocSh->GetDocument();
+        // leave OLE inplace mode and unmark
+        OSL_ASSERT( pView );
+        DeactivateOle();
+        pView->UnMarkAll();
+
+        rScDoc.GetUndoManager()->Undo();
+        rScDoc.GetUndoManager()->ClearRedo();
+
+        // leave the draw shell
+        SetDrawShell( false );
+
+        // reset marked cell area
+        ScMarkData aMark = GetViewData().GetMarkData();
+        GetViewData().GetViewShell()->SetMarkData(aMark);
+    }
+    else
+    {
+        OSL_ASSERT( pEvent->DialogResult == ui::dialogs::ExecutableDialogResults::OK );
+        //@todo maybe move chart to different table
+    }
+}
+
 void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
 {
     sal_uInt16 nSlot = rReq.GetSlot();
@@ -329,7 +362,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
             break;
 
         case SID_INSERT_DIAGRAM:
-            FuInsertChart(*this, pWin, pView, pDrModel, rReq);
+            FuInsertChart(*this, pWin, pView, pDrModel, rReq, LINK( this, ScTabViewShell, DialogClosedHdl ));
             break;
 
         case SID_INSERT_OBJECT:
diff --git a/sw/source/uibase/inc/chartins.hxx b/sw/source/uibase/inc/chartins.hxx
index 383e0fda1a58..d258053ae985 100644
--- a/sw/source/uibase/inc/chartins.hxx
+++ b/sw/source/uibase/inc/chartins.hxx
@@ -20,11 +20,17 @@
 #define INCLUDED_SW_SOURCE_UIBASE_INC_CHARTINS_HXX
 
 #include <tools/gen.hxx>
+#include <com/sun/star/ui/dialogs/DialogClosedEvent.hpp>
 
 namespace vcl { class Window; }
 
 Point SwGetChartDialogPos( const vcl::Window *pParentWin, const Size& rDialogSize, const tools::Rectangle& rLogicChart );
-void SwInsertChart();
+
+class SwInsertChart
+{
+public:
+    SwInsertChart( const Link<css::ui::dialogs::DialogClosedEvent*,void>& rLink );
+};
 
 #endif // INCLUDED_SW_SOURCE_UIBASE_INC_CHARTINS_HXX
 
diff --git a/sw/source/uibase/inc/textsh.hxx b/sw/source/uibase/inc/textsh.hxx
index af865e56ed63..8d42b49a0861 100644
--- a/sw/source/uibase/inc/textsh.hxx
+++ b/sw/source/uibase/inc/textsh.hxx
@@ -22,11 +22,13 @@
 
 #include "basesh.hxx"
 #include <unotools/caserotate.hxx>
+#include <com/sun/star/ui/dialogs/DialogClosedEvent.hpp>
 
 class AbstractSvxPostItDialog;
 class SwFieldMgr;
 class SwFlyFrameAttrMgr;
 class SvxHyperlinkItem;
+class SwInsertChart;
 
 class SW_DLLPUBLIC SwTextShell: public SwBaseShell
 {
@@ -46,6 +48,7 @@ private:
 public:
     DECL_LINK( RedlineNextHdl, AbstractSvxPostItDialog&, void );
     DECL_LINK( RedlinePrevHdl, AbstractSvxPostItDialog&, void );
+    DECL_STATIC_LINK( SwTextShell, DialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, void );
 
     void    Execute(SfxRequest &);
     void    GetState(SfxItemSet &);
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index 0aeb4e807b4b..aa7d5dbbf1de 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -111,9 +111,30 @@ using namespace ::com::sun::star;
 #include <drawdoc.hxx>
 #include <svtools/embedhlp.hxx>
 #include <sfx2/event.hxx>
+#include <com/sun/star/ui/dialogs/DialogClosedEvent.hpp>
+#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+#include <IDocumentUndoRedo.hxx>
 
 SFX_IMPL_INTERFACE(SwTextShell, SwBaseShell)
 
+IMPL_STATIC_LINK( SwTextShell, DialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, pEvent, void )
+{
+    SwView* pView = ::GetActiveView();
+    SwWrtShell& rWrtShell = pView->GetWrtShell();
+
+    sal_Int16 nDialogRet = pEvent->DialogResult;
+    if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL )
+    {
+        rWrtShell.Undo();
+        rWrtShell.GetIDocumentUndoRedo().ClearRedo();
+    }
+    else
+    {
+        OSL_ENSURE( nDialogRet == ui::dialogs::ExecutableDialogResults::OK,
+            "dialog execution failed" );
+    }
+}
+
 void SwTextShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("text");
@@ -327,7 +348,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
                 break;
             if(!rReq.IsAPI())
             {
-                SwInsertChart();
+                SwInsertChart( LINK( this, SwTextShell, DialogClosedHdl ) );
             }
             else
             {
diff --git a/sw/source/uibase/table/chartins.cxx b/sw/source/uibase/table/chartins.cxx
index c83cc1982986..312d25a5db30 100644
--- a/sw/source/uibase/table/chartins.cxx
+++ b/sw/source/uibase/table/chartins.cxx
@@ -50,11 +50,12 @@
 #include <com/sun/star/awt/Point.hpp>
 #include <com/sun/star/awt/Size.hpp>
 #include <com/sun/star/awt/XWindow.hpp>
+#include <svtools/dialogclosedlistener.hxx>
 #include <com/sun/star/chart2/data/XDataProvider.hpp>
 #include <com/sun/star/frame/XModel.hpp>
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
-#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
 
 using namespace ::com::sun::star;
@@ -131,7 +132,7 @@ Point SwGetChartDialogPos( const vcl::Window *pParentWin, const Size& rDialogSiz
     return aRet;
 }
 
-void SwInsertChart()
+SwInsertChart::SwInsertChart( const Link<css::ui::dialogs::DialogClosedEvent*, void>& rLink )
 {
     SwView *pView = ::GetActiveView();
 
@@ -171,7 +172,7 @@ void SwInsertChart()
         uno::Reference< lang::XMultiComponentFactory > xMCF( xContext->getServiceManager() );
         if(xMCF.is())
         {
-            uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
+            uno::Reference< ui::dialogs::XAsynchronousExecutableDialog > xDialog(
                 xMCF->createInstanceWithContext(
                     "com.sun.star.comp.chart2.WizardDialog", xContext),
                 uno::UNO_QUERY);
@@ -217,21 +218,18 @@ void SwInsertChart()
                     }
                 }
 
-                sal_Int16 nDialogRet = xDialog->execute();
-                if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL )
-                {
-                    rWrtShell.Undo();
-                    rWrtShell.GetIDocumentUndoRedo().ClearRedo();
-                }
-                else
-                {
-                    OSL_ENSURE( nDialogRet == ui::dialogs::ExecutableDialogResults::OK,
-                        "dialog execution failed" );
-                }
+                ::svt::DialogClosedListener* pListener = new ::svt::DialogClosedListener();
+                pListener->SetDialogClosedLink( rLink );
+                css::uno::Reference<css::ui::dialogs::XDialogClosedListener> xListener( pListener );
+
+                xDialog->startExecuteModal( xListener );
+            }
+            else
+            {
+                uno::Reference< lang::XComponent > xComponent( xDialog, uno::UNO_QUERY );
+                if( xComponent.is())
+                    xComponent->dispose();
             }
-            uno::Reference< lang::XComponent > xComponent( xDialog, uno::UNO_QUERY );
-            if( xComponent.is())
-                xComponent->dispose();
         }
     }
 }
diff --git a/vcl/source/control/wizardmachine.cxx b/vcl/source/control/wizardmachine.cxx
index 57890c45a070..839c43e81842 100644
--- a/vcl/source/control/wizardmachine.cxx
+++ b/vcl/source/control/wizardmachine.cxx
@@ -1452,6 +1452,9 @@ namespace vcl
 
     void WizardMachine::resumeTraveling( AccessGuard )
     {
+        if (!m_pImpl)
+            return;
+
         DBG_ASSERT( m_pImpl->m_bTravelingSuspended, "WizardMachine::resumeTraveling: nothing to resume!" );
         m_pImpl->m_bTravelingSuspended = false;
     }
commit 6a34b5361804d1a5b61eea1a9cd159fbef2fd149
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Aug 14 18:58:16 2019 +0200
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Wed May 13 16:30:06 2020 +0200

    Set text field modified on edit in Impress
    
    To avoid not saved changes when user enters text field and then closes
    the browser.
    
    Change-Id: Iee06392eedcf8c1875017dbfb55552059f94bba3
    Reviewed-on: https://gerrit.libreoffice.org/77504
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 3d5abb848bc8..75a1867a6574 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -63,6 +63,7 @@
 #include <DrawDocShell.hxx>
 #include <strings.hrc>
 #include <pres.hxx>
+#include <comphelper/lok.hxx>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -194,6 +195,8 @@ void FuText::DoExecute( SfxRequest& )
         SdrViewEvent aVEvt;
         mpView->PickAnything(aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
         mpView->MarkObj(aVEvt.pRootObj, pPV);
+        if (comphelper::LibreOfficeKit::isActive() && mpViewShell && mpViewShell->GetDocSh())
+            mpViewShell->GetDocSh()->SetModified();
 
         mxTextObj.reset( dynamic_cast< SdrTextObj* >( aVEvt.pObj ) );
     }


More information about the Libreoffice-commits mailing list