[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - include/sal svtools/source

Lionel Elie Mamane lionel at mamane.lu
Mon Jan 19 08:25:36 PST 2015


 include/sal/log-areas.dox         |    1 +
 svtools/source/brwbox/brwbox2.cxx |    7 +++++++
 2 files changed, 8 insertions(+)

New commits:
commit 75bc77bb35f46f8035edbf945f25f62148c518a7
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Fri Jan 16 17:08:07 2015 +0100

    fdo#88475 BrowseBox/grid: reposition data cursor to current row after paint
    
    Squash with (from master):
    
      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/13953
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index e7f762b..65f0b04 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -297,6 +297,7 @@ certain functionality.
 @section svtools
 
 @li @c svtools
+ at 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 b64b7c4..a3fe78c 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -888,6 +888,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 )
@@ -900,6 +901,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");
         }
@@ -1032,6 +1034,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


More information about the Libreoffice-commits mailing list