summaryrefslogtreecommitdiff
path: root/svx/source/stbctrls
diff options
context:
space:
mode:
authorAditya <adityasahu1511@gmail.com>2019-04-20 11:05:22 +0530
committerJim Raykowski <raykowj@gmail.com>2019-04-20 09:46:12 +0200
commit220ce1a5b1db6e456afe04b7e9002c524dcf1044 (patch)
tree72b2b8321905dd6336944c48d7fe2d8036d160a5 /svx/source/stbctrls
parentbcb0c9b4bee1d943d9c60f9d4512dba901f85f54 (diff)
tdf#122280: Hide Block selection mode from Calc
Currently, the Block Selection Mode in pop-up menu is dysfunctional in Calc. It is unreachable - when the user tries to choose "Block selection" from the pop-up menu that lies in the status bar, it shifts back to "Standard selection". Hide the Block Selection mode from Calc, simply because it is dysfunctional and useless. Change-Id: Ic31563109f602e0640fe73f08fe3390fe07787b8 Reviewed-on: https://gerrit.libreoffice.org/70846 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'svx/source/stbctrls')
-rw-r--r--svx/source/stbctrls/selctrl.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/svx/source/stbctrls/selctrl.cxx b/svx/source/stbctrls/selctrl.cxx
index 1e97e160f289..d9af2ef4ac2e 100644
--- a/svx/source/stbctrls/selctrl.cxx
+++ b/svx/source/stbctrls/selctrl.cxx
@@ -29,6 +29,7 @@
#include "stbctrls.h"
#include <bitmaps.hlst>
+#include <../sc/inc/sc.hrc>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -46,6 +47,7 @@ public:
OUString GetItemTextForState(sal_uInt16 nState) { return m_xMenu->GetItemText(state_to_id(nState)); }
sal_uInt16 GetState() const { return id_to_state(m_xMenu->GetCurItemIdent()); }
sal_uInt16 Execute(vcl::Window* pWindow, const Point& rPopupPos) { return m_xMenu->Execute(pWindow, rPopupPos); }
+ void HideSelectionType(const OString& rIdent) { m_xMenu->HideItem(m_xMenu->GetItemId(rIdent)); }
};
sal_uInt16 SelectionTypePopup::id_to_state(const OString& rIdent)
@@ -108,6 +110,12 @@ bool SvxSelectionModeControl::MouseButtonDown( const MouseEvent& rEvt )
SelectionTypePopup aPop(mnState);
StatusBar& rStatusbar = GetStatusBar();
+ // Check if Calc is opened and hide block selection state if true tdf#122280
+ if ( GetSlotId() == SID_STATUS_SELMODE )
+ {
+ aPop.HideSelectionType("block");
+ }
+
if (rEvt.IsMiddle() && aPop.Execute(&rStatusbar, rEvt.GetPosPixel()))
{
sal_uInt16 nNewState = aPop.GetState();