Kaydet (Commit) 6626281b authored tarafından Jim Raykowski's avatar Jim Raykowski

tdf#120231 Focus to document on sidebar tabbar deck tab click

Change-Id: Ic93b0171c9862f70311e93d64d1b93baf35a5182
Reviewed-on: https://gerrit.libreoffice.org/61457
Tested-by: Jenkins
Reviewed-by: 's avatarHeiko Tietze <tietze.heiko@gmail.com>
Tested-by: 's avatarHeiko Tietze <tietze.heiko@gmail.com>
Reviewed-by: 's avatarJim Raykowski <raykowj@gmail.com>
üst 044122de
......@@ -87,7 +87,6 @@ public:
void HighlightDeck (const OUString& rsDeckId);
void RemoveDeckHighlight ();
OUString const & GetDeckIdForIndex (const sal_Int32 nIndex) const;
sal_Int32 GetDeckIndexForId (const OUString& rsDeckId);
void ToggleHideFlag (const sal_Int32 nIndex);
void RestoreHideFlags();
......
......@@ -1111,12 +1111,7 @@ void SidebarController::RequestCloseDeck()
mbIsDeckRequestedOpen = false;
UpdateDeckOpenState();
if (mpCurrentDeck.get())
{
sal_Int32 nIndex(mpTabBar->GetDeckIndexForId(mpCurrentDeck->GetId()));
maFocusManager.GrabFocusButton(nIndex);
}
else
if (!mpCurrentDeck.get())
mpTabBar->RemoveDeckHighlight();
}
......
......@@ -37,6 +37,8 @@
#include <com/sun/star/graphic/XGraphicProvider.hpp>
#include <sfx2/app.hxx>
using namespace css;
using namespace css::uno;
......@@ -297,9 +299,10 @@ Image TabBar::GetItemImage(const DeckDescriptor& rDeckDescriptor) const
mxFrame);
}
IMPL_LINK(TabBar::Item, HandleClick, Button*, pBtn, void)
IMPL_LINK_NOARG(TabBar::Item, HandleClick, Button*, void)
{
pBtn->GrabFocus();
vcl::Window* pFocusWin = Application::GetFocusWindow();
pFocusWin->GrabFocusToDocument();
try
{
maDeckActivationFunctor(msDeckId);
......@@ -315,18 +318,6 @@ OUString const & TabBar::GetDeckIdForIndex (const sal_Int32 nIndex) const
return maItems[nIndex].msDeckId;
}
sal_Int32 TabBar::GetDeckIndexForId (const OUString& rsDeckId)
{
sal_Int32 nIndex(1);
for (auto const& item : maItems)
{
if (item.msDeckId == rsDeckId)
return nIndex;
nIndex++;
}
return 0;
}
void TabBar::ToggleHideFlag (const sal_Int32 nIndex)
{
if (nIndex<0 || static_cast<size_t>(nIndex) >= maItems.size())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment