https://bugs.freedesktop.org/show_bug.cgi?id=45644

--- Comment #4 from Dietmar <[email protected]> ---
I am actually the author of the extension.
Here are the code snippets that are relevant:

In "Borders.java" in Function SetBordersSingleCell, e.g. for the bottom border
which shows different behaviour:
    xTableProps.setPropertyValue("BottomBorder", sBorderWork);

sBorderWork is coming from GetBorderLine2:
           BL2.LineStyle = jBorderLiner.TB_SelectLS.GetLineStyle2();
           if (BL2.LineStyle == com.sun.star.table.BorderLineStyle.NONE) {
                BL2.LineWidth = 0; }
           else { BL2.LineWidth = jBorderLiner.TB_SelectLW.GetLineWidth(); }
           BL2.Color = jBorderLiner.TB_SelectColor.GetColor();

up to here it is independant on the type of cell. The difference is just in
xTableProps, which is coming from GetTheCell:
                                                                        // Calc
        if (xServiceInfo.supportsService("com.sun.star.sheet.SheetCell")  || 
            xServiceInfo.supportsService("com.sun.star.sheet.SheetCellRange") 
|| 
            xServiceInfo.supportsService("com.sun.star.sheet.SheetCellRanges"))
{
            oCellRange = oSelection;

                                                // selected cells in text table
        else if
(xServiceInfo.supportsService("com.sun.star.text.TextTableCursor")) {
            XTextViewCursorSupplier xTextViewCursorSupplier = 
                    (XTextViewCursorSupplier)UnoRuntime.queryInterface(
                    XTextViewCursorSupplier.class, xController);
            XTextViewCursor xTextViewCursor =
xTextViewCursorSupplier.getViewCursor();
            XPropertySet xPropertySet =  (XPropertySet)
UnoRuntime.queryInterface
                    (XPropertySet.class, xTextViewCursor); 
                    // NB: I might be in table (has value in "TextTable" or not
            if (sApplyTo == APPLYTO_TABLE) {            // get entire table 
                try {
                     Object oUnoObject =
xPropertySet.getPropertyValue("TextTable");
                     oCellRange = (XTextTable) AnyConverter.toObject
                            (XTextTable.class, oUnoObject);
                } catch (com.sun.star.lang.IllegalArgumentException ex) {
                     ex.printStackTrace();
                } catch (UnknownPropertyException ex) {
                     ex.printStackTrace();
                } catch (WrappedTargetException ex) {
                     ex.printStackTrace();
                }
            }
            else {                                    // get only selected
cells
                XTextTableCursor xTextTableCursor =  (XTextTableCursor) 
                    UnoRuntime.queryInterface(XTextTableCursor.class,
oSelection);
                String sSelectedRange = xTextTableCursor.getRangeName(); //
cells that are selected  
                        // NB: I might be in table (has value in "TextTable" or
not
                try {
                    Object oUnoObject =
xPropertySet.getPropertyValue("TextTable");
                    XTextTable xTextTable = (XTextTable) AnyConverter.toObject
                        (XTextTable.class, oUnoObject);
                     if (sSelectedRange.indexOf(":") < 0) { // single cell
                        oCellRange = xTextTable.getCellByName(sSelectedRange);  
                     }
                     else { // cell range
                        XCellRange xCellRange =  (XCellRange) 
                            UnoRuntime.queryInterface(XCellRange.class,
xTextTable);
                        oCellRange =
xCellRange.getCellRangeByName(sSelectedRange);    
                     }
                } catch (com.sun.star.lang.IllegalArgumentException ex) {
                     ex.printStackTrace();
                } catch (UnknownPropertyException ex) {
                     ex.printStackTrace();
                } catch (WrappedTargetException ex) {
                     ex.printStackTrace();
                }
            }
        }

Bottom line: no difference in applying the border style to text table cells and
calc cells, but different results.

Hope this helps a bit.
Maybe you can try to reproduce in Basic, should be the same:
- assign a bottom border to a cell in calc,
- assign a bottom border to a cell in a text table.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to