Kaydet (Commit) 056c3bf2 authored tarafından Kshitij Pathania's avatar Kshitij Pathania Kaydeden (comit) Tamás Zolnai

tdf#111837 removed lag in navigator selection update

Change-Id: I0d15f8352ab1d8846df3b03334bda20550d117d2
Reviewed-on: https://gerrit.libreoffice.org/48717Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst 94823392
...@@ -746,6 +746,7 @@ public: ...@@ -746,6 +746,7 @@ public:
SvTreeListEntry* GetFirstEntryInView() const; SvTreeListEntry* GetFirstEntryInView() const;
SvTreeListEntry* GetNextEntryInView(SvTreeListEntry*) const; SvTreeListEntry* GetNextEntryInView(SvTreeListEntry*) const;
SvTreeListEntry* GetPrevEntryInView(SvTreeListEntry*) const;
SvTreeListEntry* GetLastEntryInView() const; SvTreeListEntry* GetLastEntryInView() const;
void ScrollToAbsPos( long nPos ); void ScrollToAbsPos( long nPos );
......
...@@ -222,13 +222,27 @@ IMPL_LINK_NOARG(SdNavigatorWin, SelectToolboxHdl, ToolBox *, void) ...@@ -222,13 +222,27 @@ IMPL_LINK_NOARG(SdNavigatorWin, SelectToolboxHdl, ToolBox *, void)
PageJump ePage = PAGE_NONE; PageJump ePage = PAGE_NONE;
if (sCommand == "first") if (sCommand == "first")
{
ePage = PAGE_FIRST; ePage = PAGE_FIRST;
maTlbObjects->Select( maTlbObjects->GetFirstEntryInView() );
}
else if (sCommand == "previous") else if (sCommand == "previous")
{
ePage = PAGE_PREVIOUS; ePage = PAGE_PREVIOUS;
if( maTlbObjects->GetPrevEntryInView( maTlbObjects->GetCurEntry() ) != nullptr )
maTlbObjects->Select( maTlbObjects->GetPrevEntryInView( maTlbObjects->GetCurEntry() ) );
}
else if (sCommand == "next") else if (sCommand == "next")
{
ePage = PAGE_NEXT; ePage = PAGE_NEXT;
if( maTlbObjects->GetNextEntryInView( maTlbObjects->GetCurEntry() ) != nullptr )
maTlbObjects->Select( maTlbObjects->GetNextEntryInView( maTlbObjects->GetCurEntry() ) );
}
else if (sCommand == "last") else if (sCommand == "last")
{
ePage = PAGE_LAST; ePage = PAGE_LAST;
maTlbObjects->Select( maTlbObjects->GetLastEntryInView() );
}
if (ePage != PAGE_NONE) if (ePage != PAGE_NONE)
{ {
......
...@@ -3489,6 +3489,19 @@ SvTreeListEntry* SvTreeListBox::GetNextEntryInView(SvTreeListEntry* pEntry ) con ...@@ -3489,6 +3489,19 @@ SvTreeListEntry* SvTreeListBox::GetNextEntryInView(SvTreeListEntry* pEntry ) con
return pNext; return pNext;
} }
SvTreeListEntry* SvTreeListBox::GetPrevEntryInView(SvTreeListEntry* pEntry ) const
{
SvTreeListEntry* pPrev = PrevVisible( pEntry );
if( pPrev )
{
Point aPos( GetEntryPosition(pPrev) );
const Size& rSize = pImpl->GetOutputSize();
if( aPos.Y() < 0 || aPos.Y() >= rSize.Height() )
return nullptr;
}
return pPrev;
}
SvTreeListEntry* SvTreeListBox::GetLastEntryInView() const SvTreeListEntry* SvTreeListBox::GetLastEntryInView() const
{ {
SvTreeListEntry* pEntry = GetFirstEntryInView(); SvTreeListEntry* pEntry = GetFirstEntryInView();
......
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