[PATCH] [PUSHED:3-5] fdo#46163 database form listbox only for VARCHAR

Petr Mladek pmladek at suse.cz
Tue Feb 21 04:03:09 PST 2012


Lionel Elie Mamane píše v Čt 16. 02. 2012 v 13:57 +0100:
> Just reported and fixed fdo#46163. A list box is a control that is
> supposed to match two sets of data:
> 
>  An entry in the "list content" property is matched to the
>  corresponding entry in the "list entries" property (yeah, that's
>  rather confusing naming...). The "list entries" entry is shown to the
>  user, but the "list content" entry is stored in the database.
> 
> The bug: This matching works only if the column is of type
> VARCHAR. Even "CHAR" does not work, and in particular integer types do
> not work; integer types are a common case: store a reference number in
> the database, but show the user a nice textual description.
> 
> To understand how stupid this sounds to the user, note that VARCHAR is
> the type of variable-length strings and CHAR the type of fixed-length
> strings, not "a single character" (unless the length is 1, obviously).

Sounds crazy :-)

> Attached patch 0003-fdo-46163-convert-bound-values-to-bound-column-s-typ.patch
> makes sure the values are converted to the right type before being
> compared to the value in the database.

Looks sane => pushed
http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-3-5&id=b5f33bb8fa14afa17c4694d587215cab4756aa1f

> Attached patch
> 0001-ORowSetValue-setTypeKind-correctly-convert-to-C-LOB-.patch
> avoids a crash under some conditions that can be triggered after
> application of other patch: instead of assuming the ORowSetValue
> already contains an Any, construct one if necessary. Note that the
> other cases already do type conversion "nicely", e.g. string to int or
> 8-bit int to 32-bit int.

To be honest, I am not 100% sure that I understand everything. Anyway,
the patch does sensible things. I did not find any logical or technical
problem. It made my test document working better => I have pushed it to
the 3-5 branch:
http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-3-5&id=b5f33bb8fa14afa17c4694d587215cab4756aa1f

BTW: I had troubles to create the test document. The description was not
clear. I expected that I will not see the values "One,Two,Three,Four" at
all. I saw them even without the patch. Though, with your patch, the
first entry was selected when opened in the non-design view. Also I was
able to go through the entries one by one via the "forward" and "back"
buttons. This does not work without the patch.

It might be better if you attach a simple test document instead of
describing complex steps how to create it.

Anyway, you do great work. Thanks for all your patches.

Best Regards,
Petr



More information about the LibreOffice mailing list