From fa177231cd20bf3c3f4bb9b50f6646da139c6766 Mon Sep 17 00:00:00 2001 From: Tamas Bunth Date: Fri, 30 Aug 2019 14:57:31 +0200 Subject: tdf#127093, tdf#127092 Fix pasting autoincremented MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix copy/paste functionality when trying to paste a table with auto incremental column in it. In that case we should let the DBMS handle the values in that column. Change-Id: Ia40a0056402ec540f469b94694629dd6db7d4e71 Reviewed-on: https://gerrit.libreoffice.org/78298 Tested-by: Jenkins Reviewed-by: Tamás Bunth --- dbaccess/source/ui/uno/copytablewizard.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'dbaccess/source/ui/uno') diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index 3c2a25af6a14..5f25b06ef784 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -1185,6 +1185,14 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou // otherwise we don't get the correct value when only the 2nd source column was selected continue; } + else if( xMeta->isAutoIncrement( rColumnPos.second ) ) + { + // it is auto incremented. Let the DBMS deal with it. + // TODO initial value could be set when defining the + // table + ++nSourceColumn; + continue; + } if ( bAutoIncrement && bInsertAutoIncrement ) { -- cgit