https://bugs.documentfoundation.org/show_bug.cgi?id=71224

--- Comment #25 from Julien Nabet <[email protected]> ---
Created attachment 189617
  --> https://bugs.documentfoundation.org/attachment.cgi?id=189617&action=edit
incomplete prerequisite patch

Lionel: just an idea about preparing implementations

First I reverted locally my workaround patch + did this change:
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx
b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 55696fe36463..3e9d4d851315 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
-    sal_Int32 nPastePosition =
GetView()->getController().getFirstEmptyRowPosition();
-    if ( !GetView()->getController().getTable().is() )
-        nPastePosition = GetSelectRowCount() ? FirstSelectedRow() :
m_nDataPos;
+    //sal_Int32 nPastePosition =
GetView()->getController().getFirstEmptyRowPosition();
+    //if ( !GetView()->getController().getTable().is() )
+    sal_Int32 nPastePosition = GetSelectRowCount() ? FirstSelectedRow() :
m_nDataPos;

It allows to put the cursor to insert a field at the right pos (instead of it
jumps to the end), then of course if you can type a name field and choose var
type when saving, the new field is at the end.

Then I tried to add some columns and noticed this bt for hsqldb:
#0  connectivity::OColumnsHelper::appendObject(rtl::OUString const&,
com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> const&)
    (this=0x56357a993d90, _rForName="test", descriptor=uno::Reference to
(dbaccess::OTableColumnDescriptor *) 0x56357ab44d38) at
connectivity/source/commontools/TColumnsHelper.cxx:176
#1  0x00007f64b0eeddd0 in dbaccess::OColumns::appendObject(rtl::OUString
const&, com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>
const&)
    (this=0x56357a993d90, _rForName="test", descriptor=uno::Reference to
(dbaccess::OTableColumnDescriptor *) 0x56357ab44d38) at
dbaccess/source/core/api/column.cxx:356
#2  0x00007f64d3973c3b in
connectivity::sdbcx::OCollection::appendByDescriptor(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>
const&)
    (this=0x56357a993d90, descriptor=uno::Reference to
(dbaccess::OTableColumnDescriptor *) 0x56357ab44d38) at
connectivity/source/sdbcx/VCollection.cxx:373
#3  0x00007f64a3d59403 in dbaui::OTableController::alterColumns()
(this=0x56357aa546e0) at
dbaccess/source/ui/tabledesign/TableController.cxx:1197

appendObject is a generic method which can overloaded in the different DB
drivers located in connectivity.

Now between these lines in dbaccess/source/ui/tabledesign/TableController.cxx:
   1196                 ::dbaui::setColumnProperties(xColumn,pField);
   1197                 xAppend->appendByDescriptor(xColumn);
we could add 3 more info in xColumn (which is an XPropertySet):
- column name before (or empty if current is first column)
- column name after (or empty if current is last column)
- position (Firebird begins with 1,
https://firebirdsql.org/file/documentation/chunk/en/refdocs/fblangref30/fblangref30-ddl-table.html#fblangref40-ddl-tbl-altraltrpos)

Now drivers could use these infos or not so could be a first step.

To give a more precise idea, I attached an incomplete prerequisite patch.
Incomplete because it seems the extra info must be declared in some interface.

I don't think I'll know how keep on this but just wonder if it could be a
interesting way to follow for some coders.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to