summaryrefslogtreecommitdiff
path: root/sc/source/ui/dbgui
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/dbgui')
-rw-r--r--sc/source/ui/dbgui/PivotLayoutDialog.cxx2
-rw-r--r--sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx22
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: */