[Libreoffice-commits] .: svtools/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 14 00:56:55 PDT 2012


 svtools/source/table/tablecontrol_impl.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 5deceabaa6859e136c1954f56556ee5d0cd599f8
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Mon Sep 3 19:20:28 2012 -0500

    gridfixes: impl_ni_calculateColumnWidths: re-calculate the proper values
    
    for distributePixel/takeAwayPixel before finally using it to correct
    the rounding errors
    
    Change-Id: I6f3b178400db0696df0289331be94d69f1d4f0d2
    Reviewed-on: https://gerrit.libreoffice.org/555
    Reviewed-by: Miklos Vajna <vmiklos at suse.cz>
    Tested-by: Miklos Vajna <vmiklos at suse.cz>

diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx
index 17bf771..26ee5d0 100644
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -1069,6 +1069,7 @@ namespace svt { namespace table
                 while ( startOver );
 
                 // are there pixels left (might be caused by rounding errors)?
+                distributePixel = gridWidthPixel - ::std::accumulate( o_newColWidthsPixel.begin(), o_newColWidthsPixel.end(), 0 );
                 while ( ( distributePixel > 0 ) && ( flexibleColumnCount > 0 ) )
                 {
                     // yes => ignore relative flexibilities, and subsequently distribute single pixels to all flexible
@@ -1143,6 +1144,7 @@ namespace svt { namespace table
                 while ( startOver );
 
                 // are there pixels left (might be caused by rounding errors)?
+                takeAwayPixel = ::std::accumulate( o_newColWidthsPixel.begin(), o_newColWidthsPixel.end(), 0 ) - gridWidthPixel;
                 while ( ( takeAwayPixel > 0 ) && ( flexibleColumnCount > 0 ) )
                 {
                     // yes => ignore relative flexibilities, and subsequently take away pixels from all flexible


More information about the Libreoffice-commits mailing list