[Libreoffice-commits] .: sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Feb 1 08:07:52 PST 2011
sc/source/ui/docshell/docsh.cxx | 12 ++++++------
sc/source/ui/view/tabview.cxx | 15 ++++++++++++---
2 files changed, 18 insertions(+), 9 deletions(-)
New commits:
commit 9959161d60a86e0fc7b667054ceb6de5029e6a71
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Tue Feb 1 11:05:01 2011 -0500
Alt-Down should do the data select popup by default. (n#666060)
As with other default key bindings changed from OOo's default to
provide familiarity for Excel users, we should assign Alt-Down to
the data select action by default. The legacy binding will continue
to use Ctrl-D for this.
Also, when the cell has autofilter button, it should launch the
autofilter popup instead. That was a bug.
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index e340124..674905e 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2829,11 +2829,11 @@ void ScDocShell::ResetKeyBindings( ScOptionsUtil::KeyBindingType eType )
aCtrlD.Modifiers = awt::KeyModifier::MOD1;
aKeys.push_back(&aCtrlD);
- // Ctrl-Shift-D
- awt::KeyEvent aCtrlShiftD;
- aCtrlShiftD.KeyCode = awt::Key::D;
- aCtrlShiftD.Modifiers = awt::KeyModifier::MOD1 | awt::KeyModifier::SHIFT;
- aKeys.push_back(&aCtrlShiftD);
+ // Alt-Down
+ awt::KeyEvent aAltDown;
+ aAltDown.KeyCode = awt::Key::DOWN;
+ aAltDown.Modifiers = awt::KeyModifier::MOD2;
+ aKeys.push_back(&aAltDown);
// Remove all involved keys first, because swapping commands don't work
// well without doing this.
@@ -2846,7 +2846,7 @@ void ScDocShell::ResetKeyBindings( ScOptionsUtil::KeyBindingType eType )
xScAccel->setKeyEvent(aDelete, OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:ClearContents")));
xScAccel->setKeyEvent(aBackspace, OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Delete")));
xScAccel->setKeyEvent(aCtrlD, OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FillDown")));
- xScAccel->setKeyEvent(aCtrlShiftD, OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:DataSelect")));
+ xScAccel->setKeyEvent(aAltDown, OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:DataSelect")));
break;
case ScOptionsUtil::KEY_OOO_LEGACY:
xScAccel->setKeyEvent(aDelete, OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Delete")));
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index fc0f9ad..ea2b263 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -143,6 +143,7 @@
#include "viewuno.hxx"
#include "AccessibilityHints.hxx"
#include "appoptio.hxx"
+#include "attrib.hxx"
#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
@@ -2398,14 +2399,22 @@ void ScTabView::StartDataSelect()
// no meaningful input is possible anyway, so this function
// can be used to select a page field entry.
pWin->LaunchPageFieldMenu( nCol, nRow );
- break;
+ return;
case sheet::DataPilotFieldOrientation_COLUMN:
case sheet::DataPilotFieldOrientation_ROW:
pWin->LaunchDPFieldMenu( nCol, nRow );
- break;
+ return;
default:
- pWin->DoAutoFilterMenue( nCol, nRow, TRUE );
+ ;
}
+
+ // Do autofilter if the current cell has autofilter button. Otherwise do
+ // a normal data select popup.
+ const ScMergeFlagAttr* pAttr = static_cast<const ScMergeFlagAttr*>(
+ aViewData.GetDocument()->GetAttr(
+ nCol, nRow, aViewData.GetTabNo(), ATTR_MERGE_FLAG));
+
+ pWin->DoAutoFilterMenue(nCol, nRow, !pAttr->HasAutoFilter());
}
void ScTabView::EnableRefInput(BOOL bFlag)
More information about the Libreoffice-commits
mailing list