[Base] Access2base 1.1.0 RemoveItem ABORT

Discussions about using 3rd party extension with OpenOffice.org

[Base] Access2base 1.1.0 RemoveItem ABORT

Postby gonzolo » Wed Jan 28, 2015 3:00 pm

Hi all,
I'm using the method RemoveItem provided in Access2base 1.1.0 to clear listbox items.

Code: Select all   Expand viewCollapse view
olb.RemoveItem(olb.ListIndex)


But when we have only one item left in the list box, and we want to delete it (to have an empty listbox) the function nicely aborts with the following error message:

Error #9 (Index out of defined range) occurred at line 694 in Control.RemoveItem


This looks like to be a resizing error of the item array that goes negative...

Any fix for this? Is there a way to clear directly the listbox items?
thank you!
LibreOffice 4.3.5.2 on Windows7
gonzolo
 
Posts: 2
Joined: Wed Jan 28, 2015 2:10 pm

Re: [Base] Access2base 1.1.0 RemoveItem ABORT

Postby MTP » Wed Jan 28, 2015 6:19 pm

I suspect it's not possible to "delete" the last item in a listbox, maybe try instead replacing it with an empty string ("").
If you know from the start you're emptying the entire list, you can just replace the source array of the list box with an array of one item that holds an empty string; that would be quicker than removing the items one at a time.
OpenOffice 4.1.1 on Windows 10, HSQLDB 1.8 split database
User avatar
MTP
Volunteer
 
Posts: 1620
Joined: Mon Sep 10, 2012 7:31 pm
Location: Midwest USA

Re: [Base] Access2base 1.1.0 RemoveItem ABORT

Postby JPL » Fri Jan 30, 2015 1:16 pm

Hello,

I'm the author of the bug ... :(
... and also of what sometimes works fine in Access2Base (?).

The concerned line in the software is
Code: Select all   Expand viewCollapse view
ReDim Preserve vRowSource(0 To iCount - 1)

and this DOES NOT create an empty array when iCount = 0, as I maybe expected when I wrote this code.

I will prepare a patch that will be included, considering https://wiki.documentfoundation.org/ReleasePlan, probably in LO 4.3.7 and LO 4.4.1.
A correction has been pushed to LO 4.3.7 and LO 4.4.1. See https://wiki.documentfoundation.org/ReleasePlan for their availability.

Note that LO 4.4.0, which be was released recently in the next coming hours or days, will includes Access2Base 1.2.0. This is good news. Unfortunately it still includes above bug.

The workaround proposed by MTP looks smart to me, as soon as the control is not bound to a database field.

Sorry for the inconvenience.
Thanks for using Access2Base and helping me to make a better software. :super:

JPL
Last edited by JPL on Tue Feb 03, 2015 2:05 pm, edited 1 time in total.
Windows 7 / LibO 6.0 / AOO 4.1
Ubuntu 18.04 / LibO 6.1
Access2Base extension (AOO) or standard (LibO).
BaseDocumenter extension (LibO)
Documentation on http://www.access2base.com and http://www.access2base.com/basedocumenter
JPL
Volunteer
 
Posts: 98
Joined: Fri Mar 30, 2012 3:14 pm

Re: [Base] Access2base 1.1.0 RemoveItem ABORT

Postby karolus » Fri Jan 30, 2015 1:45 pm

LO4.4.0 is released since yesterday
4.4.0.png
AOO4, Libreoffice - 5.1 … 5.3.2.2 on Linux Mint17
User avatar
karolus
Volunteer
 
Posts: 845
Joined: Sat Jul 02, 2011 9:47 am

Re: [Base] Access2base 1.1.0 RemoveItem ABORT

Postby gonzolo » Wed Feb 04, 2015 5:55 pm

Many thanks JPL for the bug fix and for the access2base extention. I think that's a very useful one. :bravo:

Thanks also to MTP for his suggestion.

Keep coding, guys!

:)
LibreOffice 4.3.5.2 on Windows7
gonzolo
 
Posts: 2
Joined: Wed Jan 28, 2015 2:10 pm

Re: [Base] Access2base 1.1.0 RemoveItem ABORT

Postby MTP » Wed Feb 04, 2015 7:03 pm

gonzolo wrote:Thanks also to MTP for his her suggestion.
Fixed that for you ;)
Glad you found help in this thread!
OpenOffice 4.1.1 on Windows 10, HSQLDB 1.8 split database
User avatar
MTP
Volunteer
 
Posts: 1620
Joined: Mon Sep 10, 2012 7:31 pm
Location: Midwest USA


Return to Extensions

Who is online

Users browsing this forum: No registered users and 4 guests