diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2015-01-16 17:08:07 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-20 13:44:40 +0000 |
commit | ec9603a1b3ffbdf82875bce7328712a786a8cc8d (patch) | |
tree | 51000bf1a4055711f0c8b8f61974cfacf59e401d | |
parent | 345c82aa2d7b7f551faa666475d1c9e351ed6f0e (diff) |
fdo#88475 BrowseBox/grid: reposition data cursor to current row after paint
Squash with (from master and libreoffice-4-3):
fixup previous commit:
OSL_ENSURE does not execute in non-debug builds (and is deprecated).
Do not try to seek back if paint did not seek.
This happens in particular when there is no data source attached (and thus trying to seek fails).
Change-Id: I3f4908c4dcae2bb120bf58c1218e3386c40d5721
Change-Id: I0deee2c3cfdb111b178c4254d7b0544c4ce5c966
Reviewed-on: https://gerrit.libreoffice.org/13956
Reviewed-by: Eike Rathke <erack@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | include/sal/log-areas.dox | 1 | ||||
-rw-r--r-- | svtools/source/brwbox/brwbox2.cxx | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index 62525e49bc8d..d42c8c202908 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -289,6 +289,7 @@ certain functionality. @section svtools @li @c svtools +@li @c svtools.brwbox @li @c svtools.config @li @c svtools.contnr @li @c svtools.control diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index ef9a6d419108..9ea90319669b 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -887,6 +887,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, bool Color aDelimiterLineColor( ::svtools::ColorConfig().GetColorValue( ::svtools::CALCGRID ).nColor ); // redraw the invalid fields + bool paint_seeked(false); for ( sal_uLong nRelRow = nRelTopRow; nRelRow <= nRelBottomRow && (sal_uLong)nTopRow+nRelRow < (sal_uLong)nRowCount; ++nRelRow, aPos.Y() += nDataRowHeigt ) @@ -899,6 +900,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, bool // prepare row sal_uLong nRow = nTopRow+nRelRow; + paint_seeked = true; if ( !SeekRow( nRow) ) { OSL_FAIL("BrowseBox::ImplPaintData: SeekRow failed"); } @@ -1031,6 +1033,11 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, bool } } + if (paint_seeked && !SeekRow(nCurRow)) + { + SAL_WARN("svtools.brwbox", "BrowseBox::ImplPaintData could not seek back to current row after paint"); + } + if (aPos.Y() > aOverallAreaBRPos.Y() + 1) aPos.Y() = aOverallAreaBRPos.Y() + 1; // needed for some of the following drawing |