summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorAditya <adityasahu1511@gmail.com>2019-12-18 21:19:50 +0530
committerEike Rathke <erack@redhat.com>2019-12-20 22:53:28 +0100
commit0c21bf2b46b71816337fa4aba04e41126a08cd8e (patch)
treef7267b9a896d5b327d501ed5cd7741859734c59e /svx
parentb83d394a16a9a93b314f20ea8fb2ccbb99d9d07f (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: Ib8618b7f0281de13a5f6ef9d35b67330f43c4318 Reviewed-on: https://gerrit.libreoffice.org/84142 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 1e94d803f7a70027d03f1303c19818ca2de0d67f) Reviewed-on: https://gerrit.libreoffice.org/85629
Diffstat (limited to 'svx')
-rw-r--r--svx/source/stbctrls/selctrl.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/svx/source/stbctrls/selctrl.cxx b/svx/source/stbctrls/selctrl.cxx
index 1e97e160f289..9f6fc1135148 100644
--- a/svx/source/stbctrls/selctrl.cxx
+++ b/svx/source/stbctrls/selctrl.cxx
@@ -31,6 +31,8 @@
#include <bitmaps.hlst>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
SFX_IMPL_STATUSBAR_CONTROL(SvxSelectionModeControl, SfxUInt16Item);
@@ -46,6 +48,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 +111,16 @@ bool SvxSelectionModeControl::MouseButtonDown( const MouseEvent& rEvt )
SelectionTypePopup aPop(mnState);
StatusBar& rStatusbar = GetStatusBar();
+ // Check if Calc is opened; if true, hide block selection mode tdf#122280
+ const css::uno::Reference < css::frame::XModel > xModel = m_xFrame->getController()->getModel();
+ css::uno::Reference< css::lang::XServiceInfo > xServices( xModel, css::uno::UNO_QUERY );
+ if ( xServices.is() )
+ {
+ bool bSpecModeCalc = xServices->supportsService("com.sun.star.sheet.SpreadsheetDocument");
+ if (bSpecModeCalc)
+ aPop.HideSelectionType("block");
+ }
+
if (rEvt.IsMiddle() && aPop.Execute(&rStatusbar, rEvt.GetPosPixel()))
{
sal_uInt16 nNewState = aPop.GetState();