diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2020-05-09 20:27:35 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2020-05-10 09:33:06 +0200 |
commit | 0b81aaa36b5b78e208c5cc2cd36b4906b8d636a6 (patch) | |
tree | 4305ee38b8d9fd152d4e8875d537adfd303dd183 /dbaccess/source/ui/uno/copytablewizard.cxx | |
parent | drawinglayer: clean-up namespaces in textprimitive2d.hxx (diff) | |
download | core-0b81aaa36b5b78e208c5cc2cd36b4906b8d636a6.tar.gz core-0b81aaa36b5b78e208c5cc2cd36b4906b8d636a6.zip |
CopyTableWizard: make code less confusing
createTable looked into the requested operation, and depending on
that, either created the table or fetched the existing one. For a
function named createTable, that made for confusing reading.
Split that into:
* createTable that creates the table
* getTable that fetches the existing table
* returnTable that automagically creates or fetches an existing
table, depending on the requested operation.
Change-Id: I91be67c24026c850530dcaef5ec95ab508e81434
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93882
Tested-by: Jenkins
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Diffstat (limited to 'dbaccess/source/ui/uno/copytablewizard.cxx')
-rw-r--r-- | dbaccess/source/ui/uno/copytablewizard.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index d72b85da196f..22591dedc00d 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -1328,13 +1328,17 @@ void CopyTableWizard::impl_doCopy_nothrow() case CopyTableOperation::AppendData: { - + // note that the CopyDefinitionAndData case falls through to here. + assert((rWizard.getOperation() == CopyTableOperation::CopyDefinitionAndData) || + (rWizard.getOperation() == CopyTableOperation::AppendData)); + assert((rWizard.getOperation() == CopyTableOperation::CopyDefinitionAndData) == xTable.is()); if ( !xTable.is() ) { - xTable = rWizard.createTable(); + assert(rWizard.getOperation() == CopyTableOperation::AppendData); + xTable = rWizard.getTable(); if ( !xTable.is() ) { - SAL_WARN("dbaccess.ui", "CopyTableWizard::impl_doCopy_nothrow: createTable should throw here, shouldn't it?" ); + SAL_WARN("dbaccess.ui", "CopyTableWizard::impl_doCopy_nothrow: getTable should throw here, shouldn't it?" ); break; } } |