[Libreoffice-commits] core.git: sw/source
Jim Raykowski (via logerrit)
logerrit at kemper.freedesktop.org
Mon Mar 2 06:20:17 UTC 2020
sw/source/uibase/utlui/content.cxx | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
New commits:
commit 201a7652092c6a7796a59e6ddee144e4f0c9ece9
Author: Jim Raykowski <raykowj at gmail..com>
AuthorDate: Thu Feb 27 19:16:27 2020 -0900
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Mar 2 07:19:44 2020 +0100
Stop Navigator content view flashing
Redraw flashing occurs in the content tree when outlines are moved during
promote/demote chapter/level and when switching content navigation view
mode. Also, the focus rectangle is briefly shown.
This patch uses the m_bIsInPromoteDemote flag, that indicates when
outline levels are in the process of being moved, to not redraw the
content tree until after the moved outlines are reselected. To stop
focus rectangle flashing a check for tree emptiness is used in the Paint
function.
Change-Id: I252c5a0032157c0a8287c748071d180675b3a70d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89659
Tested-by: Jenkins
Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index d55c38febdf9..f8b8fb7bf425 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1773,8 +1773,8 @@ void SwContentTree::Display( bool bActive )
nEntryRelPos = GetModel()->GetAbsPos(pOldSelEntry) - GetModel()->GetAbsPos(pParentEntry);
}
}
- Clear();
SetUpdateMode( false );
+ SvTreeListBox::Clear();
if (!bActive)
m_eState = State::HIDDEN;
else if (State::HIDDEN == m_eState)
@@ -1912,7 +1912,6 @@ void SwContentTree::Display( bool bActive )
SetCurEntry(pParent);
}
}
- SetUpdateMode( true );
ScrollBar* pVScroll = GetVScroll();
if(GetEntryCount() == nOldEntryCount &&
nOldScrollPos && pVScroll && pVScroll->IsVisible()
@@ -1921,6 +1920,8 @@ void SwContentTree::Display( bool bActive )
sal_Int32 nDelta = pVScroll->GetThumbPos() - nOldScrollPos;
ScrollOutputArea( static_cast<short>(nDelta) );
}
+ if (!m_bIsInPromoteDemote)
+ SetUpdateMode( true );
}
void SwContentTree::Clear()
@@ -2720,6 +2721,8 @@ void SwContentTree::ExecCommand(const OUString& rCmd, bool bOutlineWithChildren)
}
SvTreeListBox::Invalidate();
}
+ // SetUpdateMode is set false in the Display function
+ SetUpdateMode(true);
}
}
@@ -2731,6 +2734,10 @@ void SwContentTree::ShowTree()
void SwContentTree::Paint( vcl::RenderContext& rRenderContext,
const tools::Rectangle& rRect )
{
+ // prevent focus rect from flashing when tree is cleared
+ // SvTreeListBox::Paint shows focus rectangle when tree is empty
+ if (!GetEntryCount())
+ return;
// Start the update timer on the first paint; avoids
// flicker on the first reveal.
m_aUpdTimer.Start();
More information about the Libreoffice-commits
mailing list