diff options
-rw-r--r-- | sc/source/ui/view/tabvwsh2.cxx | 9 | ||||
-rw-r--r-- | sd/source/ui/view/drviewse.cxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewdraw.cxx | 8 |
3 files changed, 22 insertions, 3 deletions
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 ) { |