see also https://issues.apache.org/ooo/show_bug.cgi?id=74826 the bug is still present in LibO 3.4.3 the bug has been transferred to Borderline2 I use an extension to assign borders to tables. Tables can be in WRITER and CALC. Both use the structure com.sun.star.table.BorderLine, but the behavior is different: Take a Border with 2 lines, the first thicker than the other (e.g. InnerLineWidth=35, OuterLineWidth=2, LineDistance=88). Now assign this line to the bottom, left, top, right border of a cell in a table. In Writer: InnerLineWidth is allways thicker (35), OuterLineWidth always thin (2). In Calc: Top and left line width is always thicker(35), bottom and right thin (2). What to do: - start writer or calc - (in writer create a table,) place the curser in a cell of a table - start BorderLiner - select a linestyle with 1 big and a small line (e.g. number 5) and width 5 (to easier see it) - put focus on document - press the keys ALT + 2 4 6 8 - this creates the border line around the cell - note that it looks different in writer and in calc - NB: the extension does not distinguish between tables in Calc and Writer, nevertheless the result is different
Thanks for bugreport This problems still reproducible? For example in 3.6 version?
just checked with 3.6.3.1, still there. Using a line style with one thick and one thin line, in Writer, the thin line is always on the inside of the cell, in Calc it is always bottom and right.
Thanks for additional testing. I have downloaded it from here: http://extensions.openoffice.org/en/project/BorderLiner And it written on Java. I hoped that it is on Basic. Therefore I can not debug it. May be author of this extension can somehow help?
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.
Created attachment 71717 [details] Basic macro containing some experiments with table borders I have done some experiments with table borders with Basic. In my case borders not work as expected. I do not know if it is bug in table or I working with borders in tables incorrectly.
Calc cells and writer tables are different pieces of functionality. I'd personally be surprised if they were visually identical when accessed like this programatically. Can you be more specific on your expectation ?
(In reply to comment #6) > ...Can you be more specific on your expectation ? Status -> NEEDINFO
(In reply to comment #6) > Calc cells and writer tables are different pieces of functionality. > I'd personally be surprised if they were visually identical when accessed > like this programatically. Can you be more specific on your expectation ? Well, they both respond to the command "BorderLineStyle", so programmatically the tables for Calc and Writer are the same. Also, the characteristic "InnerLineWidth" is in reality the OuterLineWidth in Writer for a line at the bottom of a cell, just for a line at the top it is inner. Anyway, changing this would probably involve too many changes in the code of LO and there is the new linestyle which sort of wraps this issue. Also developers obviously got used to it, so if you close with "wont fix", I don't mind.
(In reply to comment #8) > [...] > Anyway, changing this would probably involve too many changes in the code of > LO and there is the new linestyle which sort of wraps this issue. Also > developers obviously got used to it, so if you close with "wont fix", I > don't mind. Ok, closing as WontFix. Please, feel free to reopen if I am wrong. Best regards. JBF
Migrating Whiteboard tags to Keywords: (Need_Advice -> needAdvice) [NinjaEdit]
'needsConfirmationAdvice' is only used for unconfirmed bugs. Removing it from this bug. [NinjaEdit]