[Libreoffice-commits] core.git: sc/source

Maarten Bosmans mkbosmans at gmail.com
Wed Aug 31 14:45:46 UTC 2016


 sc/source/filter/oox/sheetdatabuffer.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit d16070a30d421098faedd51c4333d1d42163268f
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Thu Aug 25 12:47:26 2016 +0200

    Related: tdf#100709 Fix two bugs in SheetDataBuffer::addColXfStyle
    
    The addColXfStyle method is supposed to add a formatId to all the cells in a
    specified CellRange where there is no previously set formatId in the
    maStylesPerColumn member variable.
    
    There where two bugs in this function:
     - If there is overlap between the row ranges already in maStylesPerColumnBB and
       the given RowRange, it should be updated to only cover non-overlapping cells.
     - In the case when the given CellRange spans multiple columns, the RowRange
       should be applied to all these columns.  When the row range given to this
       method is changed because of earlier set RowRanges in
       maStylesPerColumn[nCol], the RowRange was not reset to the given method
       argument for a new column.
    
    Change-Id: I4244c4303ca983801c5116cbd26971dd641411ab
    Reviewed-on: https://gerrit.libreoffice.org/28509
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx
index 3182088..d5f29af 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -371,6 +371,10 @@ void SheetDataBuffer::addColXfStyle( sal_Int32 nXfId, sal_Int32 nFormatId, const
         else
         {
             RowStyles& rRowStyles =  maStylesPerColumn[ nCol ];
+            // Reset row range for each column
+            aStyleRows.mnStartRow = rAddress.StartRow;
+            aStyleRows.mnEndRow = rAddress.EndRow;
+
             // If the rowrange style includes rows already
             // allocated to a style then we need to split
             // the range style Rows into sections ( to
@@ -407,6 +411,8 @@ void SheetDataBuffer::addColXfStyle( sal_Int32 nXfId, sal_Int32 nFormatId, const
                         aRangeRowsSplits.push_back( aSplit );
                     }
                 }
+                if ( aStyleRows.mnStartRow <= r.mnEndRow && r.mnEndRow < aStyleRows.mnEndRow )
+                    aStyleRows.mnStartRow = r.mnEndRow + 1;
             }
             std::vector< RowRangeStyle >::iterator splits_it = aRangeRowsSplits.begin();
             std::vector< RowRangeStyle >::iterator splits_end = aRangeRowsSplits.end();


More information about the Libreoffice-commits mailing list