Added worksheet_set_top_left_cell() function.

Added worksheet_set_top_left_cell() function to set the first
visible cell in the worksheet.
This commit is contained in:
John McNamara 2021-10-30 19:23:34 +01:00
parent f47a5aa1b3
commit 9701a56a43
10 changed files with 125 additions and 6 deletions

View file

@ -0,0 +1,20 @@
/*****************************************************************************
* Test cases for libxlsxwriter.
*
* Test to compare output against Excel files.
*
* Copyright 2014-2021, John McNamara, jmcnamara@cpan.org
*
*/
#include "xlsxwriter.h"
int main() {
lxw_workbook *workbook = workbook_new("test_top_left_cell01.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
worksheet_set_top_left_cell(worksheet, 15, 0);
return workbook_close(workbook);
}

View file

@ -0,0 +1,20 @@
/*****************************************************************************
* Test cases for libxlsxwriter.
*
* Test to compare output against Excel files.
*
* Copyright 2014-2021, John McNamara, jmcnamara@cpan.org
*
*/
#include "xlsxwriter.h"
int main() {
lxw_workbook *workbook = workbook_new("test_top_left_cell02.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
worksheet_set_top_left_cell(worksheet, 15, 6);
return workbook_close(workbook);
}

View file

@ -0,0 +1,20 @@
/*****************************************************************************
* Test cases for libxlsxwriter.
*
* Test to compare output against Excel files.
*
* Copyright 2014-2021, John McNamara, jmcnamara@cpan.org
*
*/
#include "xlsxwriter.h"
int main() {
lxw_workbook *workbook = workbook_new("test_top_left_cell03.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
worksheet_set_top_left_cell(worksheet, CELL("AA32"));
return workbook_close(workbook);
}

View file

@ -0,0 +1,24 @@
###############################################################################
#
# Tests for libxlsxwriter.
#
# Copyright 2014-2021, John McNamara, jmcnamara@cpan.org
#
import base_test_class
class TestCompareXLSXFiles(base_test_class.XLSXBaseTest):
"""
Test file created with libxlsxwriter against a file created by Excel.
"""
def test_top_left_cell01(self):
self.run_exe_test('test_top_left_cell01')
def test_top_left_cell02(self):
self.run_exe_test('test_top_left_cell02')
def test_top_left_cell03(self):
self.run_exe_test('test_top_left_cell03')

Binary file not shown.

Binary file not shown.

Binary file not shown.