Previously the dialog for inserting a relation behaved differently
depending on whether the query has two or more than two tables. If there
are only two, then you can select either table as the left table and the
right table will automatically flip to select the other table. If there
are more than two tables then instead it will remove the second table
from the list of options for the left table and remove the first table
for the list of options for the right table. As you change the values of
a combobox it would add and remove options in the other one so that you
can never select the same table in both boxes.
This behaviour is quite annoying if you happen to want to choose the
second table as the left part of the join. In that case you have to
first set the right table to something else so that it will appear in
the left combobox and let you select it. After that you can select the
table you actually wanted in the right box.
Instead of that behaviour, this patch makes it always have all the
tables available in each combobox. If you select the same one that is
already in the other combobox, it will now just shove the selection
along by one place including wrapping around back to zero if the last
one is already selected. I think this is easier to work with. It also
means we don’t have to have a special case to handle when there are only
two tables because the general case will have the same behaviour as
before the patch.
Change-Id: Ib02e4d169d7e2756ebfccd9d20a1ab244fa5688e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194039
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins