diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-06-06 12:17:59 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-06-06 16:09:57 +0200 |
commit | 584a9e962f3e6c306bb2ba03c7d3b3cdbd3f206e (patch) | |
tree | 4195a53a853dfcd80ecb1acdad340393be8b6470 /sc/source/ui/dbgui | |
parent | 524b570a21df6c08b5bb252a409cac8ffc2c1565 (diff) |
tdf#116552 restore copy on focus and jump focus to source
This is surely an utter abuse of focus and an a11y disaster, but it
used to work this way.
Change-Id: I265a2bafbc2cdd17ff4a5b7c2805def63c510d5c
Reviewed-on: https://gerrit.libreoffice.org/55373
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui/dbgui')
-rw-r--r-- | sc/source/ui/dbgui/PivotLayoutDialog.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx | 22 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx index 129969c926f3..70f436c0396e 100644 --- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx +++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx @@ -71,6 +71,7 @@ ScPivotLayoutDialog::ScPivotLayoutDialog( ScViewData* pViewData, const ScDPObject* pPivotTableObject, bool bNewPivotTable) : ScAnyRefDlg (pSfxBindings, pChildWindow, pParent, "PivotTableLayout", "modules/scalc/ui/pivottablelayoutdialog.ui"), maPivotTableObject (*pPivotTableObject), + mpPreviouslyFocusedListBox(nullptr), mpViewData (pViewData), mpDocument (pViewData->GetDocument()), mbNewPivotTable (bNewPivotTable), @@ -188,6 +189,7 @@ ScPivotLayoutDialog::~ScPivotLayoutDialog() void ScPivotLayoutDialog::dispose() { + mpPreviouslyFocusedListBox.clear(); mpListBoxField.clear(); mpListBoxPage.clear(); mpListBoxColumn.clear(); diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx index f1b02c8fef0e..85c8db0ce17a 100644 --- a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx +++ b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx @@ -114,4 +114,26 @@ void ScPivotLayoutTreeListBase::RemoveEntryForItem(const ScItemValue* pItemValue } } +void ScPivotLayoutTreeListBase::GetFocus() +{ + SvTreeListBox::GetFocus(); + + if (!mpParent || !mpParent->mpPreviouslyFocusedListBox) + return; + + if (GetGetFocusFlags() & GetFocusFlags::Mnemonic) + { + SvTreeListEntry* pEntry = mpParent->mpPreviouslyFocusedListBox->GetCurEntry(); + if (pEntry) + InsertEntryForSourceTarget(pEntry, nullptr); + mpParent->mpPreviouslyFocusedListBox->GrabFocus(); + } +} + +void ScPivotLayoutTreeListBase::LoseFocus() +{ + SvTreeListBox::LoseFocus(); + if (mpParent) + mpParent->mpPreviouslyFocusedListBox = this; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |