diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2026-02-18 15:48:09 +0100 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2026-02-18 15:53:43 +0100 |
| commit | 85f95a21983a5570381cd1a179669958dff30ba3 (patch) | |
| tree | 472b25f61184666bc0be5e6a44eb550aabb66ba9 /ishtar_common | |
| parent | 069b8b6a9097186826ea2a1fc2ac6f5d61b3d4be (diff) | |
| download | Ishtar-85f95a21983a5570381cd1a179669958dff30ba3.tar.bz2 Ishtar-85f95a21983a5570381cd1a179669958dff30ba3.zip | |
✨ admin - price agreement: export all prices in a readable LO Calc document
Diffstat (limited to 'ishtar_common')
| -rw-r--r-- | ishtar_common/libreoffice.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ishtar_common/libreoffice.py b/ishtar_common/libreoffice.py index 573d99361..27b31c849 100644 --- a/ishtar_common/libreoffice.py +++ b/ishtar_common/libreoffice.py @@ -7,6 +7,7 @@ from com.sun.star.awt import Size from com.sun.star.beans import PropertyValue from com.sun.star.connection import NoConnectException from com.sun.star.sheet.ValidationType import LIST +from com.sun.star.table import BorderLineStyle # nosec: filename used is generated and sanitized import subprocess # nosec @@ -45,6 +46,7 @@ class UnoClient: self.service_manager = None self.remote_context = None self.desktop = None + self.__line_format = None self.connect() def connect(self): @@ -92,6 +94,10 @@ class UnoClient: class UnoCalc(UnoClient): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.__line_format = None + def create_calc(self): return self.create_document('scalc') @@ -192,6 +198,16 @@ class UnoCalc(UnoClient): # bitmap_component.removeByName(oo_id) return img_temp + def format_cell_border(self, cell): + if not self.__line_format: + self.__line_format = uno.createUnoStruct("com.sun.star.table.BorderLine2") + self.__line_format.LineStyle = BorderLineStyle.SOLID + self.__line_format.LineWidth = 20 + cell.TopBorder = self.__line_format + cell.RightBorder = self.__line_format + cell.LeftBorder = self.__line_format + cell.BottomBorder = self.__line_format + def test(self): self.test_2() |
