Created attachment 64047 [details] Text document showing bug in getColumns.getByIndex() flaw. The following piece of BASIC returns a null object where it should not. REM ***** BASIC ***** Sub Main nLin = 10 nCol = 7 oText = ThisComponent.getText() oText.setString("") oText.getStart() 'Create tabela oTabela = ThisComponent.createInstance("com.sun.star.text.TextTable") oTabela.initialize ( nLin, nCol ) oTabela.setName("test") oCursorT = oText.createTextCursor() oText.insertTextContent(oCursorT, oTabela, True) oColuna = oTabela.getColumns().getByIndex(0) xray oColuna 'oColuna.IsAutoWidth = False 'oColuna.Width = 4440 End Sub oColuna returns NULL where it should have returned an object. xray is a well known macro to inspect objects. No way to set a column width, and other column properties. The attached document provides a living example. Please execute macro Main in Standard library.
getByIndex() is not working fot columns, work for rows.
A complete description of why this stupid situation is there: https://issues.apache.org/ooo/show_bug.cgi?id=21669. In a nutshell: the getByIndex() method is there to fulfill the API completness, but it wasn't implemented, and deliberately returns NULL.
https://issues.apache.org/ooo/show_bug.cgi?id=21669 status: CLOSED FIXED https://issues.apache.org/ooo/show_bug.cgi?id=21669#c7: [...] Fixed in CWS tl14. Files changed: - unotbl.cxx new revision: 1.91.168.1
adding BASIC expert to CC list
@Olivier - I get a basic runtime error with your sample - is this what you are referring to or should I be seeing something different?
(In reply to comment #4) > adding BASIC expert to CC list it's got nothing to do with basic, it's according to comment #2 and api implementation issue
sorry Noel for disturbing you. my bad :-)
I think according to comment 2 and comment 6 this report can be confirmed. As comment seven in the related Apache issue indicates, /core/sw/source/core/unocore/unotbl.cxx was changed back in 2005 to return null because "the internal table representation does not have columns". The related change appears to be 904d699f6d76154e541c35395c69d6c85712ec2a which states: 2005/07/13 13:37:25 tl 1.91.168.1: #i21669# SwXTableColumns::getByIndex returns an empty XInterface now. Exactly how the issue might be resolved remains a problem, but the report at least would seem accurate. Apache issue added to See Also list for reference. Status set to NEW.
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (5.0.0.5 or later) https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for your help! -- The LibreOffice QA Team This NEW Message was generated on: 2015-09-03
The bug is still valid as of today, any version.
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (5.1.5 or 5.2.1 https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug-20160920
Original macro seems to require Xray extension to be installed. I tested with MsgBox(oColuna) instead (empty result and "Object variable not set") Arch Linux 64-bit Version: 6.4.0.0.alpha0+ Build ID: 37fc9f51a8de11d40632e8cda17ccf1fa4b1f503 CPU threads: 8; OS: Linux 5.2; UI render: default; VCL: gtk3; Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US Calc: threaded Built on 6 August 2019
Dear Olivier Hallot, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
Dear Olivier Hallot, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
The problem still exists: BASIC-runtime-fout. Objectvariabele niet ingesteld. My macro: Sub test3 Dim oDoc As Object Dim oTables As Object Dim oTable As Object Dim i As Integer ' Haal het huidige document op oDoc = ThisComponent ' Haal alle tabellen in het document op oTables = oDoc.getTextTables() ' Loop door elke tabel en pas de kolombreedtes aan For i = 0 To oTables.getCount() - 1 oTable = oTables.getByIndex(i) oTable.Columns.getByIndex(0).Width = 8900 ' 8,9 cm oTable.Columns.getByIndex(1).Width = 1000 ' 1 cm oTable.Columns.getByIndex(2).Width = 9700 ' 9,7 cm Next i End Sub Error occurs on: oTable.Columns.getByIndex(0).Width