From 976248379d5866d8d46f9ec7974d3766f5b8c209 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 18 Feb 2026 15:48:09 +0100 Subject: ✨ admin - price agreement: export all prices in a readable LO Calc document MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/libreoffice.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'ishtar_common') diff --git a/ishtar_common/libreoffice.py b/ishtar_common/libreoffice.py index 7ef33efba..97437bd9a 100644 --- a/ishtar_common/libreoffice.py +++ b/ishtar_common/libreoffice.py @@ -8,6 +8,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 @@ -46,6 +47,7 @@ class UnoClient: self.service_manager = None self.remote_context = None self.desktop = None + self.__line_format = None self.connect() def connect(self): @@ -93,6 +95,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') @@ -193,6 +199,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() -- cgit v1.2.3