Commit 30adda2b authored by CharlieC's avatar CharlieC
Browse files

Set the current row of the worksheet to the highest cell in it.

Resolves #1345

branch : 3.0
parent 8a40efa67af7
......@@ -337,7 +337,8 @@ class WorksheetReader(object):
c.data_type = cell['data_type'][(cell['row'], cell['column'])] = c = self.parser.array_formulae = self.parser.row_counter
if = # use cells not row dimensions
def bind_formatting(self):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<worksheet xmlns="" xmlns:r="">
<sheetPr filterMode="false">
<pageSetUpPr fitToPage="false"/>
<dimension ref="A1:R1048576"/>
<sheetView showFormulas="false" showGridLines="true" showRowColHeaders="true" showZeros="true" rightToLeft="false" tabSelected="false" showOutlineSymbols="true" defaultGridColor="true" view="normal" topLeftCell="A1" colorId="64" zoomScale="85" zoomScaleNormal="85" zoomScalePageLayoutView="100" workbookViewId="0">
<selection pane="topLeft" activeCell="A4" activeCellId="0" sqref="A4"/>
<sheetFormatPr defaultRowHeight="15" zeroHeight="false" outlineLevelRow="0" outlineLevelCol="0"/>
<col collapsed="false" customWidth="true" hidden="false" outlineLevel="0" max="1025" min="1" style="0" width="14.43"/>
<row r="1" >
<c r="A1" s="6">
<c r="B1" s="6"/>
<row r="2" >
<c r="A2" s="7">
<row r="3" >
<c r="B3" s="7" t="n">
<c r="C3" s="7" t="n">
<c r="D3" s="7" t="n">
<c r="R3" s="7" t="n">
<row r="1048576" customFormat="false" ht="12.8" hidden="false" customHeight="true" outlineLevel="0" collapsed="false"/>
......@@ -750,11 +750,16 @@ class TestWorksheetParser:
def PrimedWorksheetReader(Workbook, datadir):
def WorksheetReader():
from .._reader import WorksheetReader
return WorksheetReader
def PrimedWorksheetReader(Workbook, WorksheetReader, datadir):
wb = Workbook
ws = wb.create_sheet("Sheet")
src = "complex-styles-worksheet.xml"
reader = WorksheetReader(ws, src, wb.shared_strings, data_only=False)
return reader
......@@ -890,3 +895,11 @@ class TestWorksheetReader:
for k in ('page_margins', 'page_setup', 'views', 'sheet_format',
assert getattr(ws, k) == getattr(reader.parser, k)
def test_more_rows_than_cells(self, Workbook, WorksheetReader, datadir):
ws = Workbook.create_sheet("Sheet")
reader = WorksheetReader(ws, "more_rows_than_cells.xml", None, None)
assert ws._current_row == 3
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment