diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-09-26 12:51:07 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-09-26 13:12:47 +0100 |
commit | 827ae65e8577e285b8ad30f4a81af087658e42fa (patch) | |
tree | 14456f13d1d7efdf77661fe6cf818f02b8ef38fa /svtools/source/brwbox | |
parent | 0014648fee6c2b499cbd20682b7f27cdc78e1123 (diff) |
Resolves: fdo#83943 avoid infinite recursion
when attempting to make a cell visible when
the parent simply isn't large enough to show
any part of the cell
Change-Id: I987c9b3be30a66a5e1e27ad9e452f2ca65330d9e
Diffstat (limited to 'svtools/source/brwbox')
-rw-r--r-- | svtools/source/brwbox/brwbox1.cxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 4416b2347537..3fedada33ca0 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -1560,7 +1560,6 @@ bool BrowseBox::GoToColumnId( sal_uInt16 nColId) bool BrowseBox::GoToColumnId( sal_uInt16 nColId, bool bMakeVisible, bool bRowColMove) { - if (!bColumnCursor) return false; @@ -1579,6 +1578,8 @@ bool BrowseBox::GoToColumnId( sal_uInt16 nColId, bool bMakeVisible, bool bRowCol DoHideCursor( "GoToColumnId" ); nCurColId = nColId; + bool bScrolled = false; + sal_uInt16 nFirstPos = nFirstCol; sal_uInt16 nWidth = (sal_uInt16)pColumn->Width(); sal_uInt16 nLastPos = GetColumnAtXPosPixel( @@ -1591,11 +1592,25 @@ bool BrowseBox::GoToColumnId( sal_uInt16 nColId, bool bMakeVisible, bool bRowCol ScrollColumns( nNewPos-nFirstPos ); else if ( nNewPos > nLastPos ) ScrollColumns( nNewPos-nLastPos ); + bScrolled = true; } DoShowCursor( "GoToColumnId" ); if (!bRowColMove) - CursorMoved(); + { + //try to move to nCurRow, nColId + CursorMoveAttempt aAttempt(nCurRow, nColId, bScrolled); + //Detect if we are already in a call to BrowseBox::GoToColumnId + //but the the attempt is impossible and we are simply recursing + //into BrowseBox::GoToColumnId with the same impossible to + //fulfill conditions + if (m_aGotoStack.empty() || aAttempt != m_aGotoStack.top()) + { + m_aGotoStack.push(aAttempt); + CursorMoved(); + m_aGotoStack.pop(); + } + } return true; } return true; |