mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
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:
parent
f47a5aa1b3
commit
9701a56a43
10 changed files with 125 additions and 6 deletions
20
test/functional/src/test_top_left_cell01.c
Normal file
20
test/functional/src/test_top_left_cell01.c
Normal 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);
|
||||
}
|
||||
20
test/functional/src/test_top_left_cell02.c
Normal file
20
test/functional/src/test_top_left_cell02.c
Normal 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);
|
||||
}
|
||||
20
test/functional/src/test_top_left_cell03.c
Normal file
20
test/functional/src/test_top_left_cell03.c
Normal 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);
|
||||
}
|
||||
24
test/functional/test_top_left_cell.py
Normal file
24
test/functional/test_top_left_cell.py
Normal 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')
|
||||
|
||||
BIN
test/functional/xlsx_files/top_left_cell01.xlsx
Normal file
BIN
test/functional/xlsx_files/top_left_cell01.xlsx
Normal file
Binary file not shown.
BIN
test/functional/xlsx_files/top_left_cell02.xlsx
Normal file
BIN
test/functional/xlsx_files/top_left_cell02.xlsx
Normal file
Binary file not shown.
BIN
test/functional/xlsx_files/top_left_cell03.xlsx
Normal file
BIN
test/functional/xlsx_files/top_left_cell03.xlsx
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue