mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
format: fix identation and alignment property mismatch
Fix issue where a horizontal alignment format was ignored if the indentation was also set.
This commit is contained in:
parent
d3c1443155
commit
b0c76b3396
4 changed files with 48 additions and 5 deletions
37
test/functional/src/test_format24.c
Normal file
37
test/functional/src/test_format24.c
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/*****************************************************************************
|
||||
* Test cases for libxlsxwriter.
|
||||
*
|
||||
* Test to compare output against Excel files.
|
||||
*
|
||||
* Copyright 2014-2024, John McNamara, jmcnamara@cpan.org
|
||||
*
|
||||
*/
|
||||
|
||||
#include "xlsxwriter.h"
|
||||
|
||||
int main() {
|
||||
|
||||
lxw_workbook *workbook = workbook_new("test_format24.xlsx");
|
||||
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
|
||||
|
||||
lxw_format *format1 = workbook_add_format(workbook);
|
||||
|
||||
/*
|
||||
'rotation': 270,
|
||||
'indent': 1,
|
||||
'align': "center",
|
||||
'valign': "top"
|
||||
*/
|
||||
|
||||
|
||||
format_set_rotation(format1, 270);
|
||||
format_set_indent(format1, 1);
|
||||
format_set_align(format1, LXW_ALIGN_CENTER);
|
||||
format_set_align(format1, LXW_ALIGN_VERTICAL_TOP);
|
||||
|
||||
worksheet_set_row(worksheet, 0, 75, NULL);
|
||||
|
||||
worksheet_write_string(worksheet, 0, 0, "ABCD", format1);
|
||||
|
||||
return workbook_close(workbook);
|
||||
}
|
||||
|
|
@ -49,6 +49,9 @@ class TestCompareXLSXFiles(base_test_class.XLSXBaseTest):
|
|||
def test_format18(self):
|
||||
self.run_exe_test('test_format18')
|
||||
|
||||
def test_format24(self):
|
||||
self.run_exe_test('test_format24')
|
||||
|
||||
def test_format50(self):
|
||||
self.run_exe_test('test_format50')
|
||||
|
||||
|
|
|
|||
BIN
test/functional/xlsx_files/format24.xlsx
Normal file
BIN
test/functional/xlsx_files/format24.xlsx
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue