[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sc/source sd/source sw/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 9 09:42:59 UTC 2019


 sc/source/ui/view/tabvwsh2.cxx       |    9 ++++++++-
 sd/source/ui/view/drviewse.cxx       |    8 +++++++-
 sw/source/uibase/uiview/viewdraw.cxx |    8 +++++++-
 3 files changed, 22 insertions(+), 3 deletions(-)

New commits:
commit 94c82ded1944f8cfe333e5058e05acd70faa0d8f
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Nov 22 12:12:07 2018 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jul 9 11:42:14 2019 +0200

    lok: Insert shapes directly into the document.
    
    Change-Id: I182aa395ce0f4e4185c9c85a866dec89499842f9
    Reviewed-on: https://gerrit.libreoffice.org/74240
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index ea962224f9a8..531aa9052f9c 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <comphelper/lok.hxx>
 #include <sfx2/bindings.hxx>
 #include <sfx2/viewfrm.hxx>
 #include <svl/aeitem.hxx>
@@ -210,6 +211,9 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
 
     assert(nNewId != SID_DRAW_CHART); //#i71254# handled already above
 
+    // for LibreOfficeKit - choosing a shape should construct it directly
+    bool bCreateDirectly = false;
+
     switch (nNewId)
     {
         case SID_OBJECT_SELECT:
@@ -279,6 +283,9 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
         case SID_DRAW_CS_ID :
         {
             pTabView->SetDrawFuncPtr(new FuConstCustomShape(*this, pWin, pView, pDoc, aNewReq));
+
+            bCreateDirectly = comphelper::LibreOfficeKit::isActive();
+
             if ( nNewId != SID_DRAW_CS_ID )
             {
                 const SfxStringItem* pEnumCommand = rReq.GetArg<SfxStringItem>(nNewId);
@@ -309,7 +316,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
     // with qualifier construct directly
     FuPoor* pFuActual = GetDrawFuncPtr();
 
-    if(pFuActual && (rReq.GetModifier() & KEY_MOD1))
+    if(pFuActual && ((rReq.GetModifier() & KEY_MOD1) || bCreateDirectly))
     {
         // Create default drawing objects via keyboard
         const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 4645d63f6212..0d89b22eb3bd 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -27,6 +27,7 @@
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <com/sun/star/uno/Any.hxx>
 
+#include <comphelper/lok.hxx>
 #include <undo/undomanager.hxx>
 #include <vcl/waitobj.hxx>
 #include <svl/aeitem.hxx>
@@ -227,6 +228,9 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
         rBind.Update(nOldSId);
     }
 
+    // for LibreOfficeKit - choosing a shape should construct it directly
+    bool bCreateDirectly = false;
+
     switch ( nSId )
     {
         case SID_TEXTEDIT:  // BASIC ???
@@ -521,6 +525,8 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
             SetCurrentFunction( FuConstructCustomShape::Create( this, GetActiveWindow(), mpDrawView.get(), GetDoc(), rReq, bPermanent ) );
             rReq.Done();
 
+            bCreateDirectly = comphelper::LibreOfficeKit::isActive();
+
             if ( nSId != SID_DRAW_CS_ID )
             {
                 SfxBindings& rBind = GetViewFrame()->GetBindings();
@@ -598,7 +604,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
     }
 
     // with qualifier construct directly
-    if(HasCurrentFunction() && (rReq.GetModifier() & KEY_MOD1))
+    if(HasCurrentFunction() && ((rReq.GetModifier() & KEY_MOD1) || bCreateDirectly))
     {
         // get SdOptions
         SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType());
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index 5a836876255b..8420e9f3a9f5 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -229,6 +229,9 @@ void SwView::ExecDraw(SfxRequest& rReq)
 
     std::unique_ptr<SwDrawBase> pFuncPtr;
 
+    // for LibreOfficeKit - choosing a shape should construct it directly
+    bool bCreateDirectly = false;
+
     switch (nSlotId)
     {
         case SID_OBJECT_SELECT:
@@ -300,6 +303,9 @@ void SwView::ExecDraw(SfxRequest& rReq)
         case SID_DRAW_CS_ID :
         {
             pFuncPtr.reset( new ConstCustomShape(m_pWrtShell.get(), m_pEditWin, this, rReq ) );
+
+            bCreateDirectly = comphelper::LibreOfficeKit::isActive();
+
             m_nDrawSfxId = nSlotId;
             if ( nSlotId != SID_DRAW_CS_ID )
             {
@@ -334,7 +340,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
 
         pTempFuncPtr->Activate(nSlotId);
         NoRotate();
-        if(rReq.GetModifier() == KEY_MOD1)
+        if(rReq.GetModifier() == KEY_MOD1 || bCreateDirectly)
         {
             if(SID_OBJECT_SELECT == m_nDrawSfxId )
             {


More information about the Libreoffice-commits mailing list