summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/CppunitTest_dbaccess_RowSetClones.mk3
-rw-r--r--dbaccess/CppunitTest_dbaccess_dialog_save.mk3
-rw-r--r--dbaccess/CppunitTest_dbaccess_empty_stdlib_save.mk7
-rw-r--r--dbaccess/CppunitTest_dbaccess_firebird_test.mk6
-rw-r--r--dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk3
-rw-r--r--dbaccess/CppunitTest_dbaccess_hsqldb_test.mk5
-rw-r--r--dbaccess/CppunitTest_dbaccess_hsqlschema_import.mk3
-rw-r--r--dbaccess/CppunitTest_dbaccess_macros_test.mk3
-rw-r--r--dbaccess/CppunitTest_dbaccess_nolib_save.mk3
-rw-r--r--dbaccess/CppunitTest_dbaccess_tdf119625.mk3
-rw-r--r--dbaccess/CppunitTest_dbaccess_tdf126268.mk7
-rw-r--r--dbaccess/Executable_odbcconfig.mk5
-rw-r--r--dbaccess/IwyuFilter_dbaccess.yaml38
-rw-r--r--dbaccess/Library_dba.mk2
-rw-r--r--dbaccess/Library_dbaxml.mk2
-rw-r--r--dbaccess/Library_dbu.mk2
-rw-r--r--dbaccess/Library_sdbt.mk2
-rw-r--r--dbaccess/Module_dbaccess.mk5
-rw-r--r--dbaccess/UIConfig_dbaccess.mk1
-rw-r--r--dbaccess/inc/bitmaps.hlst36
-rw-r--r--dbaccess/inc/core_resource.hxx27
-rw-r--r--dbaccess/inc/dbadllapi.hxx5
-rw-r--r--dbaccess/inc/helpids.h172
-rw-r--r--dbaccess/inc/pch/precompiled_dba.hxx3
-rw-r--r--dbaccess/inc/pch/precompiled_dbaxml.hxx2
-rw-r--r--dbaccess/inc/pch/precompiled_dbu.hxx26
-rw-r--r--dbaccess/inc/pch/precompiled_sdbt.hxx2
-rw-r--r--dbaccess/inc/query.hrc6
-rw-r--r--dbaccess/inc/strings.hrc29
-rw-r--r--dbaccess/inc/strings.hxx482
-rw-r--r--dbaccess/inc/templwin.hrc5
-rw-r--r--dbaccess/qa/complex/dbaccess/CopyTableWizard.java2
-rw-r--r--dbaccess/qa/complex/dbaccess/DatabaseDocument.java1
-rw-r--r--dbaccess/qa/complex/dbaccess/RowSet.java8
-rw-r--r--dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java2
-rw-r--r--dbaccess/qa/complex/dbaccess/TestCase.java2
-rw-r--r--dbaccess/qa/extras/dialog-save.cxx29
-rw-r--r--dbaccess/qa/extras/empty-stdlib-save.cxx27
-rw-r--r--dbaccess/qa/extras/hsql_schema_import.cxx16
-rw-r--r--dbaccess/qa/extras/macros-test.cxx11
-rw-r--r--dbaccess/qa/extras/nolib-save.cxx27
-rw-r--r--dbaccess/qa/extras/rowsetclones.cxx9
-rw-r--r--dbaccess/qa/python/fdo84315.py3
-rw-r--r--dbaccess/qa/unit/data/tdf132924.odbbin0 -> 3148 bytes
-rw-r--r--dbaccess/qa/unit/dbtest_base.cxx34
-rw-r--r--dbaccess/qa/unit/embeddeddb_performancetest.cxx9
-rw-r--r--dbaccess/qa/unit/firebird.cxx45
-rw-r--r--dbaccess/qa/unit/hsql_binary_import.cxx6
-rw-r--r--dbaccess/qa/unit/hsqldb.cxx6
-rw-r--r--dbaccess/qa/unit/tdf119625.cxx6
-rw-r--r--dbaccess/qa/unit/tdf126268.cxx6
-rw-r--r--dbaccess/source/core/api/BookmarkSet.cxx36
-rw-r--r--dbaccess/source/core/api/CIndexes.cxx3
-rw-r--r--dbaccess/source/core/api/CIndexes.hxx5
-rw-r--r--dbaccess/source/core/api/CRowSetColumn.cxx53
-rw-r--r--dbaccess/source/core/api/CRowSetDataColumn.cxx69
-rw-r--r--dbaccess/source/core/api/CRowSetDataColumn.hxx8
-rw-r--r--dbaccess/source/core/api/CacheSet.cxx7
-rw-r--r--dbaccess/source/core/api/FilteredContainer.cxx46
-rw-r--r--dbaccess/source/core/api/HelperCollections.cxx9
-rw-r--r--dbaccess/source/core/api/HelperCollections.hxx13
-rw-r--r--dbaccess/source/core/api/KeySet.cxx49
-rw-r--r--dbaccess/source/core/api/KeySet.hxx11
-rw-r--r--dbaccess/source/core/api/OptimisticSet.cxx24
-rw-r--r--dbaccess/source/core/api/PrivateRow.cxx27
-rw-r--r--dbaccess/source/core/api/PrivateRow.hxx2
-rw-r--r--dbaccess/source/core/api/RowSet.cxx208
-rw-r--r--dbaccess/source/core/api/RowSet.hxx20
-rw-r--r--dbaccess/source/core/api/RowSetBase.cxx95
-rw-r--r--dbaccess/source/core/api/RowSetBase.hxx28
-rw-r--r--dbaccess/source/core/api/RowSetCache.cxx25
-rw-r--r--dbaccess/source/core/api/RowSetCacheIterator.hxx5
-rw-r--r--dbaccess/source/core/api/RowSetRow.hxx5
-rw-r--r--dbaccess/source/core/api/SingleSelectQueryComposer.cxx128
-rw-r--r--dbaccess/source/core/api/StaticSet.cxx15
-rw-r--r--dbaccess/source/core/api/TableDeco.cxx42
-rw-r--r--dbaccess/source/core/api/View.cxx2
-rw-r--r--dbaccess/source/core/api/WrappedResultSet.cxx38
-rw-r--r--dbaccess/source/core/api/callablestatement.cxx47
-rw-r--r--dbaccess/source/core/api/column.cxx9
-rw-r--r--dbaccess/source/core/api/columnsettings.cxx18
-rw-r--r--dbaccess/source/core/api/datacolumn.cxx3
-rw-r--r--dbaccess/source/core/api/datasettings.cxx2
-rw-r--r--dbaccess/source/core/api/definitioncolumn.cxx82
-rw-r--r--dbaccess/source/core/api/preparedstatement.cxx62
-rw-r--r--dbaccess/source/core/api/query.cxx34
-rw-r--r--dbaccess/source/core/api/querycomposer.cxx3
-rw-r--r--dbaccess/source/core/api/querycontainer.cxx26
-rw-r--r--dbaccess/source/core/api/querydescriptor.cxx34
-rw-r--r--dbaccess/source/core/api/querydescriptor.hxx12
-rw-r--r--dbaccess/source/core/api/resultcolumn.cxx58
-rw-r--r--dbaccess/source/core/api/resultset.cxx24
-rw-r--r--dbaccess/source/core/api/statement.cxx67
-rw-r--r--dbaccess/source/core/api/table.cxx44
-rw-r--r--dbaccess/source/core/api/tablecontainer.cxx58
-rw-r--r--dbaccess/source/core/api/viewcontainer.cxx23
-rw-r--r--dbaccess/source/core/dataaccess/ComponentDefinition.cxx14
-rw-r--r--dbaccess/source/core/dataaccess/ContentHelper.cxx93
-rw-r--r--dbaccess/source/core/dataaccess/ModelImpl.cxx200
-rw-r--r--dbaccess/source/core/dataaccess/SharedConnection.cxx2
-rw-r--r--dbaccess/source/core/dataaccess/SharedConnection.hxx7
-rw-r--r--dbaccess/source/core/dataaccess/bookmarkcontainer.cxx26
-rw-r--r--dbaccess/source/core/dataaccess/commandcontainer.cxx12
-rw-r--r--dbaccess/source/core/dataaccess/commanddefinition.cxx33
-rw-r--r--dbaccess/source/core/dataaccess/connection.cxx11
-rw-r--r--dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx56
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.cxx48
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.cxx181
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.hxx25
-rw-r--r--dbaccess/source/core/dataaccess/databaseregistrations.cxx56
-rw-r--r--dbaccess/source/core/dataaccess/databaseregistrations.hxx4
-rw-r--r--dbaccess/source/core/dataaccess/datasource.cxx180
-rw-r--r--dbaccess/source/core/dataaccess/datasource.hxx3
-rw-r--r--dbaccess/source/core/dataaccess/definitioncontainer.cxx27
-rw-r--r--dbaccess/source/core/dataaccess/documentcontainer.cxx79
-rw-r--r--dbaccess/source/core/dataaccess/documentdefinition.cxx141
-rw-r--r--dbaccess/source/core/dataaccess/documentdefinition.hxx2
-rw-r--r--dbaccess/source/core/dataaccess/documenteventexecutor.cxx34
-rw-r--r--dbaccess/source/core/dataaccess/documenteventexecutor.hxx9
-rw-r--r--dbaccess/source/core/dataaccess/documenteventnotifier.cxx8
-rw-r--r--dbaccess/source/core/dataaccess/documentevents.cxx58
-rw-r--r--dbaccess/source/core/dataaccess/intercept.cxx44
-rw-r--r--dbaccess/source/core/dataaccess/intercept.hxx4
-rw-r--r--dbaccess/source/core/dataaccess/myucp_datasupplier.cxx146
-rw-r--r--dbaccess/source/core/dataaccess/myucp_datasupplier.hxx20
-rw-r--r--dbaccess/source/core/dataaccess/myucp_resultset.cxx9
-rw-r--r--dbaccess/source/core/dataaccess/myucp_resultset.hxx2
-rw-r--r--dbaccess/source/core/inc/ContentHelper.hxx15
-rw-r--r--dbaccess/source/core/inc/DatabaseDataProvider.hxx4
-rw-r--r--dbaccess/source/core/inc/ModelImpl.hxx104
-rw-r--r--dbaccess/source/core/inc/PropertyForward.hxx2
-rw-r--r--dbaccess/source/core/inc/SingleSelectQueryComposer.hxx6
-rw-r--r--dbaccess/source/core/inc/TableDeco.hxx4
-rw-r--r--dbaccess/source/core/inc/bookmarkcontainer.hxx4
-rw-r--r--dbaccess/source/core/inc/column.hxx4
-rw-r--r--dbaccess/source/core/inc/databasecontext.hxx11
-rw-r--r--dbaccess/source/core/inc/definitioncolumn.hxx2
-rw-r--r--dbaccess/source/core/inc/definitioncontainer.hxx3
-rw-r--r--dbaccess/source/core/inc/documentevents.hxx10
-rw-r--r--dbaccess/source/core/inc/object.hxx30
-rw-r--r--dbaccess/source/core/inc/objectnameapproval.hxx6
-rw-r--r--dbaccess/source/core/inc/recovery/dbdocrecovery.hxx4
-rw-r--r--dbaccess/source/core/inc/table.hxx6
-rw-r--r--dbaccess/source/core/inc/veto.hxx2
-rw-r--r--dbaccess/source/core/misc/ContainerMediator.cxx5
-rw-r--r--dbaccess/source/core/misc/DatabaseDataProvider.cxx59
-rw-r--r--dbaccess/source/core/misc/PropertyForward.cxx7
-rw-r--r--dbaccess/source/core/misc/apitools.cxx93
-rw-r--r--dbaccess/source/core/misc/dsntypes.cxx47
-rw-r--r--dbaccess/source/core/misc/objectnameapproval.cxx20
-rw-r--r--dbaccess/source/core/misc/sdbcoretools.cxx5
-rw-r--r--dbaccess/source/core/misc/veto.cxx5
-rw-r--r--dbaccess/source/core/recovery/dbdocrecovery.cxx50
-rw-r--r--dbaccess/source/core/recovery/settingsimport.cxx6
-rw-r--r--dbaccess/source/core/recovery/storagestream.cxx3
-rw-r--r--dbaccess/source/core/recovery/storagetextstream.cxx22
-rw-r--r--dbaccess/source/core/recovery/storagetextstream.hxx7
-rw-r--r--dbaccess/source/core/recovery/storagexmlstream.cxx56
-rw-r--r--dbaccess/source/core/recovery/storagexmlstream.hxx15
-rw-r--r--dbaccess/source/core/recovery/subcomponentloader.cxx2
-rw-r--r--dbaccess/source/core/recovery/subcomponentrecovery.cxx14
-rw-r--r--dbaccess/source/core/recovery/subcomponentrecovery.hxx5
-rw-r--r--dbaccess/source/core/resource/core_resource.cxx20
-rw-r--r--dbaccess/source/filter/hsqldb/columndef.cxx15
-rw-r--r--dbaccess/source/filter/hsqldb/columndef.hxx4
-rw-r--r--dbaccess/source/filter/hsqldb/createparser.cxx96
-rw-r--r--dbaccess/source/filter/hsqldb/createparser.hxx6
-rw-r--r--dbaccess/source/filter/hsqldb/fbalterparser.cxx6
-rw-r--r--dbaccess/source/filter/hsqldb/fbcreateparser.cxx35
-rw-r--r--dbaccess/source/filter/hsqldb/hsqlimport.cxx10
-rw-r--r--dbaccess/source/filter/hsqldb/hsqlimport.hxx2
-rw-r--r--dbaccess/source/filter/hsqldb/parseschema.cxx22
-rw-r--r--dbaccess/source/filter/hsqldb/rowinputbinary.cxx58
-rw-r--r--dbaccess/source/filter/hsqldb/utils.cxx24
-rw-r--r--dbaccess/source/filter/hsqldb/utils.hxx4
-rw-r--r--dbaccess/source/filter/xml/dbloader2.cxx19
-rw-r--r--dbaccess/source/filter/xml/xmlAutoStyle.cxx3
-rw-r--r--dbaccess/source/filter/xml/xmlAutoStyle.hxx2
-rw-r--r--dbaccess/source/filter/xml/xmlColumn.cxx7
-rw-r--r--dbaccess/source/filter/xml/xmlComponent.cxx5
-rw-r--r--dbaccess/source/filter/xml/xmlConnectionResource.cxx4
-rw-r--r--dbaccess/source/filter/xml/xmlDataSource.cxx8
-rw-r--r--dbaccess/source/filter/xml/xmlDataSourceInfo.cxx1
-rw-r--r--dbaccess/source/filter/xml/xmlDataSourceSetting.cxx4
-rw-r--r--dbaccess/source/filter/xml/xmlDocuments.cxx13
-rw-r--r--dbaccess/source/filter/xml/xmlDocuments.hxx6
-rw-r--r--dbaccess/source/filter/xml/xmlExport.cxx77
-rw-r--r--dbaccess/source/filter/xml/xmlExport.hxx19
-rw-r--r--dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx4
-rw-r--r--dbaccess/source/filter/xml/xmlHelper.cxx91
-rw-r--r--dbaccess/source/filter/xml/xmlHierarchyCollection.cxx11
-rw-r--r--dbaccess/source/filter/xml/xmlHierarchyCollection.hxx2
-rw-r--r--dbaccess/source/filter/xml/xmlLogin.cxx6
-rw-r--r--dbaccess/source/filter/xml/xmlQuery.cxx16
-rw-r--r--dbaccess/source/filter/xml/xmlServerDatabase.cxx4
-rw-r--r--dbaccess/source/filter/xml/xmlStyleImport.cxx4
-rw-r--r--dbaccess/source/filter/xml/xmlStyleImport.hxx5
-rw-r--r--dbaccess/source/filter/xml/xmlTable.cxx19
-rw-r--r--dbaccess/source/filter/xml/xmlTable.hxx2
-rw-r--r--dbaccess/source/filter/xml/xmlTableFilterList.cxx4
-rw-r--r--dbaccess/source/filter/xml/xmlTableFilterPattern.cxx3
-rw-r--r--dbaccess/source/filter/xml/xmlfilter.cxx62
-rw-r--r--dbaccess/source/inc/OAuthenticationContinuation.hxx7
-rw-r--r--dbaccess/source/inc/apitools.hxx155
-rw-r--r--dbaccess/source/inc/dsntypes.hxx17
-rw-r--r--dbaccess/source/inc/stringconstants.hxx5
-rw-r--r--dbaccess/source/sdbtools/connection/objectnames.cxx23
-rw-r--r--dbaccess/source/sdbtools/connection/tablename.cxx46
-rw-r--r--dbaccess/source/sdbtools/connection/tablename.hxx8
-rw-r--r--dbaccess/source/sdbtools/inc/connectiondependent.hxx5
-rw-r--r--dbaccess/source/shared/registrationhelper.cxx152
-rw-r--r--dbaccess/source/ui/app/AppController.cxx242
-rw-r--r--dbaccess/source/ui/app/AppController.hxx8
-rw-r--r--dbaccess/source/ui/app/AppControllerDnD.cxx18
-rw-r--r--dbaccess/source/ui/app/AppControllerGen.cxx40
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx54
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.hxx8
-rw-r--r--dbaccess/source/ui/app/AppDetailView.cxx20
-rw-r--r--dbaccess/source/ui/app/AppDetailView.hxx8
-rw-r--r--dbaccess/source/ui/app/AppIconControl.cxx8
-rw-r--r--dbaccess/source/ui/app/AppSwapWindow.cxx3
-rw-r--r--dbaccess/source/ui/app/AppTitleWindow.cxx4
-rw-r--r--dbaccess/source/ui/app/AppTitleWindow.hxx5
-rw-r--r--dbaccess/source/ui/app/AppView.cxx4
-rw-r--r--dbaccess/source/ui/app/AppView.hxx1
-rw-r--r--dbaccess/source/ui/app/ChildWindow.cxx2
-rw-r--r--dbaccess/source/ui/app/DocumentInfoPreview.cxx2
-rw-r--r--dbaccess/source/ui/app/subcomponentmanager.cxx27
-rw-r--r--dbaccess/source/ui/app/templwin.cxx11
-rw-r--r--dbaccess/source/ui/browser/AsynchronousLink.cxx14
-rw-r--r--dbaccess/source/ui/browser/brwctrlr.cxx152
-rw-r--r--dbaccess/source/ui/browser/brwview.cxx5
-rw-r--r--dbaccess/source/ui/browser/dataview.cxx14
-rw-r--r--dbaccess/source/ui/browser/dbexchange.cxx6
-rw-r--r--dbaccess/source/ui/browser/dbloader.cxx32
-rw-r--r--dbaccess/source/ui/browser/dbtreemodel.hxx3
-rw-r--r--dbaccess/source/ui/browser/dsEntriesNoExp.cxx58
-rw-r--r--dbaccess/source/ui/browser/dsbrowserDnD.cxx12
-rw-r--r--dbaccess/source/ui/browser/exsrcbrw.cxx11
-rw-r--r--dbaccess/source/ui/browser/formadapter.cxx336
-rw-r--r--dbaccess/source/ui/browser/genericcontroller.cxx142
-rw-r--r--dbaccess/source/ui/browser/sbagrid.cxx203
-rw-r--r--dbaccess/source/ui/browser/sbamultiplex.cxx500
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx326
-rw-r--r--dbaccess/source/ui/control/ColumnControlWindow.cxx3
-rw-r--r--dbaccess/source/ui/control/FieldControls.cxx8
-rw-r--r--dbaccess/source/ui/control/FieldDescControl.cxx57
-rw-r--r--dbaccess/source/ui/control/RelationControl.cxx11
-rw-r--r--dbaccess/source/ui/control/SqlNameEdit.cxx12
-rw-r--r--dbaccess/source/ui/control/TableGrantCtrl.cxx45
-rw-r--r--dbaccess/source/ui/control/charsetlistbox.cxx4
-rw-r--r--dbaccess/source/ui/control/dbtreelistbox.cxx50
-rw-r--r--dbaccess/source/ui/control/opendoccontrols.cxx18
-rw-r--r--dbaccess/source/ui/control/sqledit.cxx179
-rw-r--r--dbaccess/source/ui/control/tabletree.cxx9
-rw-r--r--dbaccess/source/ui/dlg/CollectionView.cxx18
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.cxx35
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.hxx4
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPage.cxx21
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPageSetup.cxx18
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPageSetup.hxx5
-rw-r--r--dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx148
-rw-r--r--dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx48
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.cxx75
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.hxx4
-rw-r--r--dbaccess/source/ui/dlg/DriverSettings.hxx1
-rw-r--r--dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx5
-rw-r--r--dbaccess/source/ui/dlg/RelationDlg.cxx4
-rw-r--r--dbaccess/source/ui/dlg/TablesSingleDlg.cxx2
-rw-r--r--dbaccess/source/ui/dlg/TextConnectionHelper.cxx38
-rw-r--r--dbaccess/source/ui/dlg/TextConnectionHelper.hxx4
-rw-r--r--dbaccess/source/ui/dlg/UserAdmin.cxx161
-rw-r--r--dbaccess/source/ui/dlg/UserAdmin.hxx6
-rw-r--r--dbaccess/source/ui/dlg/UserAdminDlg.cxx6
-rw-r--r--dbaccess/source/ui/dlg/adminpages.cxx15
-rw-r--r--dbaccess/source/ui/dlg/adminpages.hxx11
-rw-r--r--dbaccess/source/ui/dlg/adodatalinks.cxx183
-rw-r--r--dbaccess/source/ui/dlg/adtabdlg.cxx7
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.cxx8
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.hxx2
-rw-r--r--dbaccess/source/ui/dlg/dbadmin.cxx284
-rw-r--r--dbaccess/source/ui/dlg/dbfindex.cxx19
-rw-r--r--dbaccess/source/ui/dlg/dbfindex.hxx9
-rw-r--r--dbaccess/source/ui/dlg/dbwiz.cxx13
-rw-r--r--dbaccess/source/ui/dlg/dbwizsetup.cxx79
-rw-r--r--dbaccess/source/ui/dlg/detailpages.cxx15
-rw-r--r--dbaccess/source/ui/dlg/detailpages.hxx10
-rw-r--r--dbaccess/source/ui/dlg/directsql.cxx133
-rw-r--r--dbaccess/source/ui/dlg/dlgattr.cxx7
-rw-r--r--dbaccess/source/ui/dlg/dlgsave.cxx260
-rw-r--r--dbaccess/source/ui/dlg/dlgsize.cxx2
-rw-r--r--dbaccess/source/ui/dlg/dsselect.cxx8
-rw-r--r--dbaccess/source/ui/dlg/dsselect.hxx3
-rw-r--r--dbaccess/source/ui/dlg/generalpage.cxx46
-rw-r--r--dbaccess/source/ui/dlg/generalpage.hxx1
-rw-r--r--dbaccess/source/ui/dlg/indexdialog.cxx40
-rw-r--r--dbaccess/source/ui/dlg/indexfieldscontrol.cxx7
-rw-r--r--dbaccess/source/ui/dlg/odbcconfig.cxx16
-rw-r--r--dbaccess/source/ui/dlg/optionalboolitem.cxx1
-rw-r--r--dbaccess/source/ui/dlg/optionalboolitem.hxx2
-rw-r--r--dbaccess/source/ui/dlg/paramdialog.cxx17
-rw-r--r--dbaccess/source/ui/dlg/queryfilter.cxx104
-rw-r--r--dbaccess/source/ui/dlg/queryorder.cxx9
-rw-r--r--dbaccess/source/ui/dlg/sqlmessage.cxx30
-rw-r--r--dbaccess/source/ui/dlg/tablespage.cxx16
-rw-r--r--dbaccess/source/ui/inc/AppElementType.hxx16
-rw-r--r--dbaccess/source/ui/inc/ChildWindow.hxx4
-rw-r--r--dbaccess/source/ui/inc/CollectionView.hxx2
-rw-r--r--dbaccess/source/ui/inc/ConnectionLine.hxx2
-rw-r--r--dbaccess/source/ui/inc/ConnectionLineAccess.hxx31
-rw-r--r--dbaccess/source/ui/inc/ConnectionLineData.hxx2
-rw-r--r--dbaccess/source/ui/inc/DExport.hxx4
-rw-r--r--dbaccess/source/ui/inc/FieldControls.hxx9
-rw-r--r--dbaccess/source/ui/inc/FieldDescControl.hxx9
-rw-r--r--dbaccess/source/ui/inc/GeneralUndo.hxx2
-rw-r--r--dbaccess/source/ui/inc/HtmlReader.hxx2
-rw-r--r--dbaccess/source/ui/inc/JAccess.hxx14
-rw-r--r--dbaccess/source/ui/inc/JoinExchange.hxx2
-rw-r--r--dbaccess/source/ui/inc/JoinTableView.hxx20
-rw-r--r--dbaccess/source/ui/inc/RelationController.hxx4
-rw-r--r--dbaccess/source/ui/inc/RtfReader.hxx2
-rw-r--r--dbaccess/source/ui/inc/SqlNameEdit.hxx7
-rw-r--r--dbaccess/source/ui/inc/TableConnection.hxx2
-rw-r--r--dbaccess/source/ui/inc/TableConnectionData.hxx4
-rw-r--r--dbaccess/source/ui/inc/TableController.hxx2
-rw-r--r--dbaccess/source/ui/inc/TableCopyHelper.hxx2
-rw-r--r--dbaccess/source/ui/inc/TableRow.hxx1
-rw-r--r--dbaccess/source/ui/inc/TableRowExchange.hxx4
-rw-r--r--dbaccess/source/ui/inc/TableWindow.hxx2
-rw-r--r--dbaccess/source/ui/inc/TableWindowAccess.hxx33
-rw-r--r--dbaccess/source/ui/inc/TableWindowData.hxx8
-rw-r--r--dbaccess/source/ui/inc/TableWindowListBox.hxx2
-rw-r--r--dbaccess/source/ui/inc/TokenWriter.hxx2
-rw-r--r--dbaccess/source/ui/inc/UITools.hxx7
-rw-r--r--dbaccess/source/ui/inc/UserAdminDlg.hxx2
-rw-r--r--dbaccess/source/ui/inc/WColumnSelect.hxx4
-rw-r--r--dbaccess/source/ui/inc/WCopyTable.hxx8
-rw-r--r--dbaccess/source/ui/inc/WTabPage.hxx2
-rw-r--r--dbaccess/source/ui/inc/WTypeSelect.hxx1
-rw-r--r--dbaccess/source/ui/inc/advancedsettingsdlg.hxx2
-rw-r--r--dbaccess/source/ui/inc/callbacks.hxx2
-rw-r--r--dbaccess/source/ui/inc/charsetlistbox.hxx6
-rw-r--r--dbaccess/source/ui/inc/charsets.hxx6
-rw-r--r--dbaccess/source/ui/inc/curledit.hxx2
-rw-r--r--dbaccess/source/ui/inc/databaseobjectview.hxx2
-rw-r--r--dbaccess/source/ui/inc/datasourceconnector.hxx2
-rw-r--r--dbaccess/source/ui/inc/dbadmin.hxx11
-rw-r--r--dbaccess/source/ui/inc/dbexchange.hxx2
-rw-r--r--dbaccess/source/ui/inc/dbwiz.hxx1
-rw-r--r--dbaccess/source/ui/inc/dbwizsetup.hxx4
-rw-r--r--dbaccess/source/ui/inc/defaultobjectnamecheck.hxx9
-rw-r--r--dbaccess/source/ui/inc/directsql.hxx13
-rw-r--r--dbaccess/source/ui/inc/dlgattr.hxx2
-rw-r--r--dbaccess/source/ui/inc/dlgsave.hxx23
-rw-r--r--dbaccess/source/ui/inc/dsitems.hxx125
-rw-r--r--dbaccess/source/ui/inc/dsmeta.hxx3
-rw-r--r--dbaccess/source/ui/inc/exsrcbrw.hxx3
-rw-r--r--dbaccess/source/ui/inc/formadapter.hxx5
-rw-r--r--dbaccess/source/ui/inc/imageprovider.hxx16
-rw-r--r--dbaccess/source/ui/inc/indexcollection.hxx1
-rw-r--r--dbaccess/source/ui/inc/indexdialog.hxx2
-rw-r--r--dbaccess/source/ui/inc/indexfieldscontrol.hxx2
-rw-r--r--dbaccess/source/ui/inc/linkeddocuments.hxx2
-rw-r--r--dbaccess/source/ui/inc/querycontroller.hxx2
-rw-r--r--dbaccess/source/ui/inc/sbagrid.hrc4
-rw-r--r--dbaccess/source/ui/inc/sbagrid.hxx17
-rw-r--r--dbaccess/source/ui/inc/sbamultiplex.hxx537
-rw-r--r--dbaccess/source/ui/inc/singledoccontroller.hxx6
-rw-r--r--dbaccess/source/ui/inc/sqledit.hxx15
-rw-r--r--dbaccess/source/ui/inc/sqlmessage.hxx4
-rw-r--r--dbaccess/source/ui/inc/tabletree.hxx6
-rw-r--r--dbaccess/source/ui/inc/unoadmin.hxx3
-rw-r--r--dbaccess/source/ui/inc/unodatbr.hxx17
-rw-r--r--dbaccess/source/ui/misc/DExport.cxx51
-rw-r--r--dbaccess/source/ui/misc/HtmlReader.cxx8
-rw-r--r--dbaccess/source/ui/misc/RowSetDrop.cxx4
-rw-r--r--dbaccess/source/ui/misc/RtfReader.cxx4
-rw-r--r--dbaccess/source/ui/misc/TableCopyHelper.cxx43
-rw-r--r--dbaccess/source/ui/misc/TokenWriter.cxx273
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx255
-rw-r--r--dbaccess/source/ui/misc/WCPage.cxx5
-rw-r--r--dbaccess/source/ui/misc/WColumnSelect.cxx23
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx77
-rw-r--r--dbaccess/source/ui/misc/WExtendPages.cxx4
-rw-r--r--dbaccess/source/ui/misc/WNameMatch.cxx8
-rw-r--r--dbaccess/source/ui/misc/WTypeSelect.cxx46
-rw-r--r--dbaccess/source/ui/misc/asyncmodaldialog.cxx2
-rw-r--r--dbaccess/source/ui/misc/charsets.cxx14
-rw-r--r--dbaccess/source/ui/misc/controllerframe.cxx6
-rw-r--r--dbaccess/source/ui/misc/databaseobjectview.cxx75
-rw-r--r--dbaccess/source/ui/misc/datasourceconnector.cxx19
-rw-r--r--dbaccess/source/ui/misc/dbaundomanager.cxx1
-rw-r--r--dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx33
-rw-r--r--dbaccess/source/ui/misc/defaultobjectnamecheck.cxx44
-rw-r--r--dbaccess/source/ui/misc/dsmeta.cxx88
-rw-r--r--dbaccess/source/ui/misc/imageprovider.cxx40
-rw-r--r--dbaccess/source/ui/misc/indexcollection.cxx12
-rw-r--r--dbaccess/source/ui/misc/linkeddocuments.cxx65
-rw-r--r--dbaccess/source/ui/misc/singledoccontroller.cxx26
-rw-r--r--dbaccess/source/ui/querydesign/ConnectionLine.cxx7
-rw-r--r--dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx29
-rw-r--r--dbaccess/source/ui/querydesign/ConnectionLineData.cxx7
-rw-r--r--dbaccess/source/ui/querydesign/JAccess.cxx15
-rw-r--r--dbaccess/source/ui/querydesign/JoinController.cxx7
-rw-r--r--dbaccess/source/ui/querydesign/JoinDesignView.cxx5
-rw-r--r--dbaccess/source/ui/querydesign/JoinExchange.cxx16
-rw-r--r--dbaccess/source/ui/querydesign/JoinTableView.cxx57
-rw-r--r--dbaccess/source/ui/querydesign/QTableConnectionData.cxx3
-rw-r--r--dbaccess/source/ui/querydesign/QTableWindow.cxx5
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx4
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx2
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx102
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx2
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx5
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx2
-rw-r--r--dbaccess/source/ui/querydesign/QueryTableView.cxx18
-rw-r--r--dbaccess/source/ui/querydesign/QueryTextView.cxx7
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx58
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx6
-rw-r--r--dbaccess/source/ui/querydesign/TableConnection.cxx7
-rw-r--r--dbaccess/source/ui/querydesign/TableConnectionData.cxx9
-rw-r--r--dbaccess/source/ui/querydesign/TableFieldDescription.cxx6
-rw-r--r--dbaccess/source/ui/querydesign/TableFieldInfo.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/TableFieldInfo.hxx1
-rw-r--r--dbaccess/source/ui/querydesign/TableWindow.cxx21
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowAccess.cxx46
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowData.cxx13
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowListBox.cxx5
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowTitle.cxx5
-rw-r--r--dbaccess/source/ui/querydesign/limitboxcontroller.cxx40
-rw-r--r--dbaccess/source/ui/querydesign/limitboxcontroller.hxx9
-rw-r--r--dbaccess/source/ui/querydesign/querycontainerwindow.cxx3
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx94
-rw-r--r--dbaccess/source/ui/querydesign/querydlg.cxx14
-rw-r--r--dbaccess/source/ui/relationdesign/RTableConnectionData.cxx22
-rw-r--r--dbaccess/source/ui/relationdesign/RelationController.cxx11
-rw-r--r--dbaccess/source/ui/relationdesign/RelationDesignView.cxx6
-rw-r--r--dbaccess/source/ui/relationdesign/RelationTableView.cxx9
-rw-r--r--dbaccess/source/ui/tabledesign/FieldDescriptions.cxx45
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx53
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.hxx2
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx42
-rw-r--r--dbaccess/source/ui/tabledesign/TableDesignControl.cxx2
-rw-r--r--dbaccess/source/ui/tabledesign/TableDesignView.cxx4
-rw-r--r--dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx10
-rw-r--r--dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx4
-rw-r--r--dbaccess/source/ui/tabledesign/TableRow.cxx87
-rw-r--r--dbaccess/source/ui/tabledesign/TableRowExchange.cxx12
-rw-r--r--dbaccess/source/ui/tabledesign/TableUndo.cxx15
-rw-r--r--dbaccess/source/ui/tabledesign/TableUndo.hxx8
-rw-r--r--dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx1
-rw-r--r--dbaccess/source/ui/uno/ColumnControl.cxx19
-rw-r--r--dbaccess/source/ui/uno/ColumnControl.hxx2
-rw-r--r--dbaccess/source/ui/uno/ColumnModel.cxx36
-rw-r--r--dbaccess/source/ui/uno/ColumnModel.hxx6
-rw-r--r--dbaccess/source/ui/uno/ColumnPeer.cxx2
-rw-r--r--dbaccess/source/ui/uno/DBTypeWizDlg.cxx1
-rw-r--r--dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx2
-rw-r--r--dbaccess/source/ui/uno/TableFilterDlg.cxx1
-rw-r--r--dbaccess/source/ui/uno/UserSettingsDlg.cxx1
-rw-r--r--dbaccess/source/ui/uno/admindlg.cxx1
-rw-r--r--dbaccess/source/ui/uno/composerdialogs.cxx56
-rw-r--r--dbaccess/source/ui/uno/composerdialogs.hxx5
-rw-r--r--dbaccess/source/ui/uno/copytablewizard.cxx316
-rw-r--r--dbaccess/source/ui/uno/dbinteraction.cxx25
-rw-r--r--dbaccess/source/ui/uno/textconnectionsettings_uno.cxx30
-rw-r--r--dbaccess/source/ui/uno/unoDirectSql.cxx32
-rw-r--r--dbaccess/source/ui/uno/unoDirectSql.hxx5
-rw-r--r--dbaccess/source/ui/uno/unoadmin.cxx8
-rw-r--r--dbaccess/uiconfig/dbapp/menubar/menubar.xml3
-rw-r--r--dbaccess/uiconfig/dbquery/menubar/menubar.xml3
-rw-r--r--dbaccess/uiconfig/dbrelation/menubar/menubar.xml3
-rw-r--r--dbaccess/uiconfig/dbtable/menubar/menubar.xml3
-rw-r--r--dbaccess/uiconfig/dbtdata/menubar/menubar.xml3
-rw-r--r--dbaccess/uiconfig/ui/applycolpage.ui4
-rw-r--r--dbaccess/uiconfig/ui/connectionpage.ui162
-rw-r--r--dbaccess/uiconfig/ui/copytablepage.ui3
-rw-r--r--dbaccess/uiconfig/ui/dbaseindexdialog.ui4
-rw-r--r--dbaccess/uiconfig/ui/dbwizconnectionpage.ui83
-rw-r--r--dbaccess/uiconfig/ui/dbwizmysqlintropage.ui4
-rw-r--r--dbaccess/uiconfig/ui/dbwizmysqlnativepage.ui4
-rw-r--r--dbaccess/uiconfig/ui/directsqldialog.ui202
-rw-r--r--dbaccess/uiconfig/ui/generalpagewizard.ui174
-rw-r--r--dbaccess/uiconfig/ui/indexdesigndialog.ui7
-rw-r--r--dbaccess/uiconfig/ui/jdbcconnectionpage.ui103
-rw-r--r--dbaccess/uiconfig/ui/ldapconnectionpage.ui2
-rw-r--r--dbaccess/uiconfig/ui/ldappage.ui2
-rw-r--r--dbaccess/uiconfig/ui/parametersdialog.ui1
-rw-r--r--dbaccess/uiconfig/ui/postgrespage.ui285
-rw-r--r--dbaccess/uiconfig/ui/queryview.ui4
-rw-r--r--dbaccess/uiconfig/ui/specialjdbcconnectionpage.ui21
-rw-r--r--dbaccess/uiconfig/ui/specialsettingspage.ui384
-rw-r--r--dbaccess/uiconfig/ui/tabledesignrowmenu.ui4
-rw-r--r--dbaccess/uiconfig/ui/useradminpage.ui115
-rw-r--r--dbaccess/win32/source/odbcconfig/odbcconfig.cxx12
496 files changed, 8220 insertions, 7845 deletions
diff --git a/dbaccess/CppunitTest_dbaccess_RowSetClones.mk b/dbaccess/CppunitTest_dbaccess_RowSetClones.mk
index ac11256d6bfd..1b67411fb4bd 100644
--- a/dbaccess/CppunitTest_dbaccess_RowSetClones.mk
+++ b/dbaccess/CppunitTest_dbaccess_RowSetClones.mk
@@ -49,7 +49,8 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_RowSetClones, \
ucbhelper \
unotest \
utl \
- vbahelper \
+ $(call gb_Helper_optional,SCRIPTING, \
+ vbahelper) \
vcl \
xo \
))
diff --git a/dbaccess/CppunitTest_dbaccess_dialog_save.mk b/dbaccess/CppunitTest_dbaccess_dialog_save.mk
index 408366ecb445..81adbc733a20 100644
--- a/dbaccess/CppunitTest_dbaccess_dialog_save.mk
+++ b/dbaccess/CppunitTest_dbaccess_dialog_save.mk
@@ -49,7 +49,8 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_dialog_save, \
ucbhelper \
unotest \
utl \
- vbahelper \
+ $(call gb_Helper_optional,SCRIPTING, \
+ vbahelper) \
vcl \
xo \
))
diff --git a/dbaccess/CppunitTest_dbaccess_empty_stdlib_save.mk b/dbaccess/CppunitTest_dbaccess_empty_stdlib_save.mk
index 6d1e47df4a30..18cda6b38be9 100644
--- a/dbaccess/CppunitTest_dbaccess_empty_stdlib_save.mk
+++ b/dbaccess/CppunitTest_dbaccess_empty_stdlib_save.mk
@@ -49,7 +49,8 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_empty_stdlib_save, \
ucbhelper \
unotest \
utl \
- vbahelper \
+ $(call gb_Helper_optional,SCRIPTING, \
+ vbahelper) \
vcl \
xo \
))
@@ -99,6 +100,10 @@ $(eval $(call gb_CppunitTest_use_components,dbaccess_empty_stdlib_save,\
$(eval $(call gb_CppunitTest_use_configuration,dbaccess_empty_stdlib_save))
+$(eval $(call gb_CppunitTest_use_uiconfigs,dbaccess_empty_stdlib_save, \
+ dbaccess \
+))
+
$(call gb_CppunitTest_get_target,dbaccess_empty_stdlib_save) : $(WORKDIR)/CppunitTest/testEmptyStdlibSave.odb
$(WORKDIR)/CppunitTest/testEmptyStdlibSave.odb : $(SRCDIR)/dbaccess/qa/extras/testdocuments/testDialogSave.odb
mkdir -p $(dir $@)
diff --git a/dbaccess/CppunitTest_dbaccess_firebird_test.mk b/dbaccess/CppunitTest_dbaccess_firebird_test.mk
index 5065520993e2..a8d4704eb1e9 100644
--- a/dbaccess/CppunitTest_dbaccess_firebird_test.mk
+++ b/dbaccess/CppunitTest_dbaccess_firebird_test.mk
@@ -18,12 +18,14 @@ $(eval $(call gb_CppunitTest_add_exception_objects,dbaccess_firebird_test, \
$(eval $(call gb_CppunitTest_use_libraries,dbaccess_firebird_test, \
comphelper \
cppu \
+ cppuhelper \
dbaxml \
firebird_sdbc \
sal \
subsequenttest \
svt \
test \
+ tl \
unotest \
utl \
xo \
@@ -67,4 +69,8 @@ $(eval $(call gb_CppunitTest_use_components,dbaccess_firebird_test,\
$(eval $(call gb_CppunitTest_use_configuration,dbaccess_firebird_test))
+$(eval $(call gb_CppunitTest_use_uiconfigs,dbaccess_firebird_test, \
+ dbaccess \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk b/dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk
index ee10da23df90..23ec9e1e4e1e 100644
--- a/dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk
+++ b/dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk
@@ -48,7 +48,8 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_hsql_binary_import, \
ucbhelper \
unotest \
utl \
- vbahelper \
+ $(call gb_Helper_optional,SCRIPTING, \
+ vbahelper) \
vcl \
xo \
))
diff --git a/dbaccess/CppunitTest_dbaccess_hsqldb_test.mk b/dbaccess/CppunitTest_dbaccess_hsqldb_test.mk
index 500d8b376398..07b4f960b859 100644
--- a/dbaccess/CppunitTest_dbaccess_hsqldb_test.mk
+++ b/dbaccess/CppunitTest_dbaccess_hsqldb_test.mk
@@ -28,6 +28,7 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_hsqldb_test, \
utl \
test \
tk \
+ tl \
unotest \
xo \
))
@@ -77,4 +78,8 @@ $(eval $(call gb_CppunitTest_use_components,dbaccess_hsqldb_test,\
$(eval $(call gb_CppunitTest_use_configuration,dbaccess_hsqldb_test))
+$(eval $(call gb_CppunitTest_use_uiconfigs,dbaccess_hsqldb_test, \
+ dbaccess \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/dbaccess/CppunitTest_dbaccess_hsqlschema_import.mk b/dbaccess/CppunitTest_dbaccess_hsqlschema_import.mk
index 8c8d06698b38..7e131c81052f 100644
--- a/dbaccess/CppunitTest_dbaccess_hsqlschema_import.mk
+++ b/dbaccess/CppunitTest_dbaccess_hsqlschema_import.mk
@@ -46,7 +46,8 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_hsql_schema_import, \
ucbhelper \
unotest \
utl \
- vbahelper \
+ $(call gb_Helper_optional,SCRIPTING, \
+ vbahelper) \
vcl \
xo \
))
diff --git a/dbaccess/CppunitTest_dbaccess_macros_test.mk b/dbaccess/CppunitTest_dbaccess_macros_test.mk
index 8d8672e882fe..248a5520c66c 100644
--- a/dbaccess/CppunitTest_dbaccess_macros_test.mk
+++ b/dbaccess/CppunitTest_dbaccess_macros_test.mk
@@ -49,7 +49,8 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_macros_test, \
ucbhelper \
unotest \
utl \
- vbahelper \
+ $(call gb_Helper_optional,SCRIPTING, \
+ vbahelper) \
vcl \
xo \
))
diff --git a/dbaccess/CppunitTest_dbaccess_nolib_save.mk b/dbaccess/CppunitTest_dbaccess_nolib_save.mk
index 1490c024aeb2..088dc92c4310 100644
--- a/dbaccess/CppunitTest_dbaccess_nolib_save.mk
+++ b/dbaccess/CppunitTest_dbaccess_nolib_save.mk
@@ -49,7 +49,8 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_nolib_save, \
ucbhelper \
unotest \
utl \
- vbahelper \
+ $(call gb_Helper_optional,SCRIPTING, \
+ vbahelper) \
vcl \
xo \
))
diff --git a/dbaccess/CppunitTest_dbaccess_tdf119625.mk b/dbaccess/CppunitTest_dbaccess_tdf119625.mk
index b58aa973df52..b96ea797f27f 100644
--- a/dbaccess/CppunitTest_dbaccess_tdf119625.mk
+++ b/dbaccess/CppunitTest_dbaccess_tdf119625.mk
@@ -48,7 +48,8 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_tdf119625, \
ucbhelper \
unotest \
utl \
- vbahelper \
+ $(call gb_Helper_optional,SCRIPTING, \
+ vbahelper) \
vcl \
xo \
))
diff --git a/dbaccess/CppunitTest_dbaccess_tdf126268.mk b/dbaccess/CppunitTest_dbaccess_tdf126268.mk
index bdcec51f2f46..e2f6df6aeab9 100644
--- a/dbaccess/CppunitTest_dbaccess_tdf126268.mk
+++ b/dbaccess/CppunitTest_dbaccess_tdf126268.mk
@@ -48,7 +48,8 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_tdf126268, \
ucbhelper \
unotest \
utl \
- vbahelper \
+ $(call gb_Helper_optional,SCRIPTING, \
+ vbahelper) \
vcl \
xo \
))
@@ -110,4 +111,8 @@ $(eval $(call gb_CppunitTest_use_components,dbaccess_tdf126268,\
$(eval $(call gb_CppunitTest_use_configuration,dbaccess_tdf126268))
+$(eval $(call gb_CppunitTest_use_uiconfigs,dbaccess_tdf126268, \
+ dbaccess \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/dbaccess/Executable_odbcconfig.mk b/dbaccess/Executable_odbcconfig.mk
index 862c77b3b5af..2156128469e3 100644
--- a/dbaccess/Executable_odbcconfig.mk
+++ b/dbaccess/Executable_odbcconfig.mk
@@ -15,11 +15,6 @@ $(eval $(call gb_Executable_use_libraries,odbcconfig,\
comphelper \
))
-$(eval $(call gb_Executable_use_system_win32_libs,odbcconfig,\
- legacy_stdio_definitions \
- odbccp32 \
-))
-
$(eval $(call gb_Library_use_sdk_api,odbcconfig))
$(eval $(call gb_Executable_add_exception_objects,odbcconfig,\
diff --git a/dbaccess/IwyuFilter_dbaccess.yaml b/dbaccess/IwyuFilter_dbaccess.yaml
index 7d15949a9e78..18b61f7376d8 100644
--- a/dbaccess/IwyuFilter_dbaccess.yaml
+++ b/dbaccess/IwyuFilter_dbaccess.yaml
@@ -1,30 +1,12 @@
---
assumeFilename: dbaccess/source/ui/querydesign/QueryDesignView.cxx
excludelist:
- dbaccess/source/inc/dbu_reghelper.hxx:
- # Needed for registrationhelper.hxx
- - com/sun/star/lang/XSingleServiceFactory.hpp
- - com/sun/star/lang/XMultiServiceFactory.hpp
- - rtl/ustring.hxx
- - cppuhelper/factory.hxx
- dbaccess/source/inc/flt_reghelper.hxx:
- # Needed for registrationhelper.hxx
- - com/sun/star/lang/XSingleServiceFactory.hpp
- - com/sun/star/lang/XMultiServiceFactory.hpp
- - rtl/ustring.hxx
- - cppuhelper/factory.hxx
- dbaccess/source/inc/apitools.hxx:
- # Needed for macros to work
- - com/sun/star/beans/PropertyAttribute.hpp
- - com/sun/star/lang/XMultiServiceFactory.hpp
- - comphelper/sequence.hxx
- - strings.hxx
+ dbaccess/inc/strings.hrc:
+ # Needed for TranslateId macro to work
+ - unotools/resmgr.hxx
dbaccess/source/filter/xml/xmlExport.hxx:
# Needed for implicit dtor
- xmloff/txtprmap.hxx
- dbaccess/source/ui/inc/sbamultiplex.hxx:
- # Needed for macros
- - cppuhelper/queryinterface.hxx
dbaccess/source/ui/dlg/odbcconfig.hxx:
# Needed on WIN32
- tools/link.hxx
@@ -45,17 +27,9 @@ excludelist:
dbaccess/source/core/api/query.cxx:
# Actually used
- com/sun/star/sdbc/XConnection.hpp
- # Needed for inline OMultiTypeInterfaceContainerHelperVar
- - cppuhelper/interfacecontainer.hxx
dbaccess/source/core/api/querycontainer.cxx:
# Actually used
- com/sun/star/sdbc/XConnection.hpp
- dbaccess/source/core/dataaccess/ComponentDefinition.cxx:
- # Needed for inline OMultiTypeInterfaceContainerHelperVar
- - cppuhelper/interfacecontainer.hxx
- dbaccess/source/core/dataaccess/definitioncontainer.cxx:
- # Needed for inline OMultiTypeInterfaceContainerHelperVar
- - cppuhelper/interfacecontainer.hxx
dbaccess/source/core/dataaccess/databasedocument.cxx:
# Actually used
- com/sun/star/script/XStorageBasedLibraryContainer.hpp
@@ -82,12 +56,6 @@ excludelist:
dbaccess/source/filter/xml/xmlExport.cxx:
# Needed for template
- com/sun/star/frame/XModel.hpp
- dbaccess/source/shared/flt_reghelper.cxx:
- # Needed for weird included cxx file
- - comphelper/sequence.hxx
- dbaccess/source/shared/dbu_reghelper.cxx:
- # Needed for weird included cxx file
- - comphelper/sequence.hxx
dbaccess/source/ui/app/AppDetailPageHelper.cxx:
# Actually used
- com/sun/star/sdbc/XConnection.hpp
diff --git a/dbaccess/Library_dba.mk b/dbaccess/Library_dba.mk
index 90f775d146ef..2021bb22a876 100644
--- a/dbaccess/Library_dba.mk
+++ b/dbaccess/Library_dba.mk
@@ -55,7 +55,7 @@ $(eval $(call gb_Library_use_libraries,dba,\
xo \
))
-$(eval $(call gb_Library_set_componentfile,dba,dbaccess/util/dba))
+$(eval $(call gb_Library_set_componentfile,dba,dbaccess/util/dba,services))
$(eval $(call gb_Library_add_exception_objects,dba,\
dbaccess/source/core/api/BookmarkSet \
diff --git a/dbaccess/Library_dbaxml.mk b/dbaccess/Library_dbaxml.mk
index a9f2d96991c0..502c4058d8ac 100644
--- a/dbaccess/Library_dbaxml.mk
+++ b/dbaccess/Library_dbaxml.mk
@@ -39,7 +39,7 @@ $(eval $(call gb_Library_use_libraries,dbaxml,\
xo \
))
-$(eval $(call gb_Library_set_componentfile,dbaxml,dbaccess/source/filter/xml/dbaxml))
+$(eval $(call gb_Library_set_componentfile,dbaxml,dbaccess/source/filter/xml/dbaxml,services))
$(eval $(call gb_Library_add_exception_objects,dbaxml,\
dbaccess/source/filter/xml/dbloader2 \
diff --git a/dbaccess/Library_dbu.mk b/dbaccess/Library_dbu.mk
index 895343591bf4..1157c6ffa8e5 100644
--- a/dbaccess/Library_dbu.mk
+++ b/dbaccess/Library_dbu.mk
@@ -66,7 +66,7 @@ $(eval $(call gb_Library_use_system_win32_libs,dbu,\
))
endif
-$(eval $(call gb_Library_set_componentfile,dbu,dbaccess/util/dbu))
+$(eval $(call gb_Library_set_componentfile,dbu,dbaccess/util/dbu,services))
$(eval $(call gb_Library_add_exception_objects,dbu,\
dbaccess/source/ui/app/AppController \
diff --git a/dbaccess/Library_sdbt.mk b/dbaccess/Library_sdbt.mk
index d941cc05fc97..c6109b6e6c65 100644
--- a/dbaccess/Library_sdbt.mk
+++ b/dbaccess/Library_sdbt.mk
@@ -34,7 +34,7 @@ $(eval $(call gb_Library_use_libraries,sdbt,\
utl \
))
-$(eval $(call gb_Library_set_componentfile,sdbt,dbaccess/util/sdbt))
+$(eval $(call gb_Library_set_componentfile,sdbt,dbaccess/util/sdbt,services))
$(eval $(call gb_Library_add_exception_objects,sdbt,\
dbaccess/source/sdbtools/connection/connectiontools \
diff --git a/dbaccess/Module_dbaccess.mk b/dbaccess/Module_dbaccess.mk
index 2d2c9ae31c1b..c51b66c3522d 100644
--- a/dbaccess/Module_dbaccess.mk
+++ b/dbaccess/Module_dbaccess.mk
@@ -47,6 +47,7 @@ $(eval $(call gb_Module_add_check_targets,dbaccess,\
))
endif
+ifneq ($(filter SCRIPTING,$(BUILD_TYPE)),)
$(eval $(call gb_Module_add_check_targets,dbaccess,\
CppunitTest_dbaccess_dialog_save \
CppunitTest_dbaccess_empty_stdlib_save \
@@ -54,16 +55,14 @@ $(eval $(call gb_Module_add_check_targets,dbaccess,\
CppunitTest_dbaccess_macros_test \
CppunitTest_dbaccess_hsqlschema_import \
))
+endif
-# this test fails 50% of the time on the mac jenkins buildbots
ifeq ($(ENABLE_JAVA),TRUE)
-ifneq ($(OS),MACOSX)
$(eval $(call gb_Module_add_check_targets,dbaccess,\
CppunitTest_dbaccess_hsqldb_test \
CppunitTest_dbaccess_RowSetClones \
))
endif
-endif
# This runs a suite of performance tests on embedded firebird and HSQLDB.
# Instructions on running the test can be found in qa/unit/embeddedb_performancetest
diff --git a/dbaccess/UIConfig_dbaccess.mk b/dbaccess/UIConfig_dbaccess.mk
index c0e6a28f895f..db2af00cff08 100644
--- a/dbaccess/UIConfig_dbaccess.mk
+++ b/dbaccess/UIConfig_dbaccess.mk
@@ -71,6 +71,7 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \
dbaccess/uiconfig/ui/savedialog \
dbaccess/uiconfig/ui/savemodifieddialog \
dbaccess/uiconfig/ui/specialjdbcconnectionpage \
+ dbaccess/uiconfig/ui/postgrespage \
dbaccess/uiconfig/ui/specialsettingspage \
dbaccess/uiconfig/ui/sortdialog \
dbaccess/uiconfig/ui/sqlexception \
diff --git a/dbaccess/inc/bitmaps.hlst b/dbaccess/inc/bitmaps.hlst
index fb9c4567bb87..1f93e59f505c 100644
--- a/dbaccess/inc/bitmaps.hlst
+++ b/dbaccess/inc/bitmaps.hlst
@@ -10,24 +10,24 @@
#ifndef INCLUDED_DBACCESS_INC_BITMAPS_HRC
#define INCLUDED_DBACCESS_INC_BITMAPS_HRC
-#define BMP_FORMFOLDER_TREE_L "dbaccess/res/forms_32.png"
-#define BMP_REPORTFOLDER_TREE_L "dbaccess/res/reports_32.png"
-#define BMP_QUERYFOLDER_TREE_L "dbaccess/res/queries_32.png"
-#define BMP_TABLEFOLDER_TREE_L "dbaccess/res/tables_32.png"
-#define DATABASE_TREE_ICON "dbaccess/res/db.png"
-#define TABLE_TREE_ICON "res/sx03188.png"
-#define TABLEFOLDER_TREE_ICON "res/sx03187.png"
-#define VIEW_TREE_ICON "res/sx16670.png"
-#define QUERY_TREE_ICON "res/sx03202.png"
-#define QUERYFOLDER_TREE_ICON "res/sx03201.png"
-#define FORM_TREE_ICON "dbaccess/res/form_16.png"
-#define FORMFOLDER_TREE_ICON "dbaccess/res/forms_16.png"
-#define REPORT_TREE_ICON "dbaccess/res/report_16.png"
-#define REPORTFOLDER_TREE_ICON "dbaccess/res/reports_16.png"
-#define BMP_PRIMARY_KEY "dbaccess/res/jo01.png"
-#define BMP_PKEYICON "dbaccess/res/pkey.png"
-#define BMP_UP "dbaccess/res/sortup.png"
-#define BMP_DOWN "dbaccess/res/sortdown.png"
+inline constexpr OUString BMP_FORMFOLDER_TREE_L = u"dbaccess/res/forms_32.png"_ustr;
+inline constexpr OUString BMP_REPORTFOLDER_TREE_L = u"dbaccess/res/reports_32.png"_ustr;
+inline constexpr OUString BMP_QUERYFOLDER_TREE_L = u"dbaccess/res/queries_32.png"_ustr;
+inline constexpr OUString BMP_TABLEFOLDER_TREE_L = u"dbaccess/res/tables_32.png"_ustr;
+inline constexpr OUString DATABASE_TREE_ICON = u"dbaccess/res/db.png"_ustr;
+inline constexpr OUString TABLE_TREE_ICON = u"res/sx03188.png"_ustr;
+inline constexpr OUString TABLEFOLDER_TREE_ICON = u"res/sx03187.png"_ustr;
+inline constexpr OUString VIEW_TREE_ICON = u"res/sx16670.png"_ustr;
+inline constexpr OUString QUERY_TREE_ICON = u"res/sx03202.png"_ustr;
+inline constexpr OUString QUERYFOLDER_TREE_ICON = u"res/sx03201.png"_ustr;
+inline constexpr OUString FORM_TREE_ICON = u"dbaccess/res/form_16.png"_ustr;
+inline constexpr OUString FORMFOLDER_TREE_ICON = u"dbaccess/res/forms_16.png"_ustr;
+inline constexpr OUString REPORT_TREE_ICON = u"dbaccess/res/report_16.png"_ustr;
+inline constexpr OUString REPORTFOLDER_TREE_ICON = u"dbaccess/res/reports_16.png"_ustr;
+inline constexpr OUString BMP_PRIMARY_KEY = u"dbaccess/res/jo01.png"_ustr;
+inline constexpr OUString BMP_PKEYICON = u"dbaccess/res/pkey.png"_ustr;
+inline constexpr OUString BMP_UP = u"dbaccess/res/sortup.png"_ustr;
+inline constexpr OUString BMP_DOWN = u"dbaccess/res/sortdown.png"_ustr;
#endif
diff --git a/dbaccess/inc/core_resource.hxx b/dbaccess/inc/core_resource.hxx
index 0e1e80ee3efd..000a59bf1713 100644
--- a/dbaccess/inc/core_resource.hxx
+++ b/dbaccess/inc/core_resource.hxx
@@ -17,11 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_CORE_RESOURCE_HXX
-#define INCLUDED_DBACCESS_SOURCE_CORE_INC_CORE_RESOURCE_HXX
+#pragma once
#include <rtl/ustring.hxx>
#include "dbadllapi.hxx"
+#include <unotools/resmgr.hxx>
#define DBA_RES( id ) ::dbaccess::ResourceManager::loadString( id )
#define DBA_RES_PARAM( id, ascii, replace ) ::dbaccess::ResourceManager::loadString( id, ascii, replace )
@@ -30,7 +30,7 @@ namespace dbaccess
{
// ResourceManager
// handling resources within the DBA-Core library
- class OOO_DLLPUBLIC_DBA ResourceManager
+ class UNLESS_MERGELIBS_MORE(OOO_DLLPUBLIC_DBA) ResourceManager
{
private:
// no instantiation allowed
@@ -40,22 +40,7 @@ namespace dbaccess
public:
/** loads the string with the specified resource id
*/
- static OUString loadString(const char* pResId);
-
- /** loads a string from the resource file, substituting a placeholder with a given string
-
- @param pResId
- the resource ID of the string to load
- @param _pPlaceholderAscii
- the ASCII representation of the placeholder string
- @param _rReplace
- the string which should substitute the placeholder
- */
- static OUString loadString(
- const char* pResId,
- const char* _pPlaceholderAscii,
- std::u16string_view _rReplace
- );
+ static OUString loadString(TranslateId pResId);
/** loads a string from the resource file, substituting two placeholders with given strings
@@ -71,7 +56,7 @@ namespace dbaccess
the string which should substitute the second placeholder
*/
static OUString loadString(
- const char* pResId,
+ TranslateId pResId,
const char* _pPlaceholderAscii1,
std::u16string_view _rReplace1,
const char* _pPlaceholderAscii2,
@@ -80,6 +65,4 @@ namespace dbaccess
};
}
-#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_CORE_RESOURCE_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/inc/dbadllapi.hxx b/dbaccess/inc/dbadllapi.hxx
index 6388e579b36a..d742b9a3b1e9 100644
--- a/dbaccess/inc/dbadllapi.hxx
+++ b/dbaccess/inc/dbadllapi.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_DBACCESS_SOURCE_INC_DBADLLAPI_HXX
-#define INCLUDED_DBACCESS_SOURCE_INC_DBADLLAPI_HXX
+#pragma once
#include <sal/config.h>
@@ -30,6 +29,4 @@
#define OOO_DLLPUBLIC_DBA SAL_DLLPUBLIC_IMPORT
#endif
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/inc/helpids.h b/dbaccess/inc/helpids.h
index c2720688f9b3..8f496b98a138 100644
--- a/dbaccess/inc/helpids.h
+++ b/dbaccess/inc/helpids.h
@@ -20,91 +20,93 @@
#ifndef INCLUDED_DBACCESS_INC_HELPIDS_H
#define INCLUDED_DBACCESS_INC_HELPIDS_H
-
-#define HID_DATABROWSE_HEADER "DBACCESS_HID_DATABROWSE_HEADER"
-#define HID_CTL_TABBROWSER "DBACCESS_HID_CTL_TABBROWSER"
-#define HID_CTL_TREEVIEW "DBACCESS_HID_CTL_TREEVIEW"
-
-#define HID_DSADMIN_BROWSECONN "DBACCESS_HID_DSADMIN_BROWSECONN"
-
-#define HID_CTL_QRYSQLEDIT "DBACCESS_HID_CTL_QRYSQLEDIT"
-
-#define HID_CTL_QRYDGNTAB "DBACCESS_HID_CTL_QRYDGNTAB"
-#define HID_CTL_QRYDGNCRIT "DBACCESS_HID_CTL_QRYDGNCRIT"
-#define HID_QRYDGN_ROW_VISIBLE "DBACCESS_HID_QRYDGN_ROW_VISIBLE"
-#define HID_QRYDGN_ROW_TABLE "DBACCESS_HID_QRYDGN_ROW_TABLE"
-#define HID_QRYDGN_ROW_FIELD "DBACCESS_HID_QRYDGN_ROW_FIELD"
-#define HID_QRYDGN_ROW_ORDER "DBACCESS_HID_QRYDGN_ROW_ORDER"
-#define HID_QRYDGN_ROW_FUNCTION "DBACCESS_HID_QRYDGN_ROW_FUNCTION"
-#define HID_QRYDGN_ROW_ALIAS "DBACCESS_HID_QRYDGN_ROW_ALIAS"
-#define HID_QRYDGN_ROW_CRIT "DBACCESS_HID_QRYDGN_ROW_CRIT"
-
-#define HID_TAB_DESIGN_FIELDCONTROL "DBACCESS_HID_TAB_DESIGN_FIELDCONTROL"
-#define HID_TABLE_DESIGN_HELP_WINDOW "DBACCESS_HID_TABLE_DESIGN_HELP_WINDOW"
-#define HID_TAB_DESIGN_DESCWIN "DBACCESS_HID_TAB_DESIGN_DESCWIN"
-#define HID_TABDESIGN_BACKGROUND "DBACCESS_HID_TABDESIGN_BACKGROUND"
-#define HID_CTL_TABLEEDIT "DBACCESS_HID_CTL_TABLEEDIT"
-#define HID_TABDESIGN_NAMECELL "DBACCESS_HID_TABDESIGN_NAMECELL"
-#define HID_TABDESIGN_TYPECELL "DBACCESS_HID_TABDESIGN_TYPECELL"
-#define HID_TABDESIGN_COMMENTCELL "DBACCESS_HID_TABDESIGN_COMMENTCELL"
-#define HID_TAB_DESIGN_HELP_TEXT_FRAME "DBACCESS_HID_TAB_DESIGN_HELP_TEXT_FRAME"
-#define HID_TABLE_DESIGN_TABPAGE_GENERAL "DBACCESS_HID_TABLE_DESIGN_TABPAGE_GENERAL"
-#define HID_TAB_ENT_DEFAULT "DBACCESS_HID_TAB_ENT_DEFAULT"
-#define HID_TAB_ENT_FORMAT_SAMPLE "DBACCESS_HID_TAB_ENT_FORMAT_SAMPLE"
-#define HID_TAB_ENT_FORMAT "DBACCESS_HID_TAB_ENT_FORMAT"
-#define HID_TAB_ENT_BOOL_DEFAULT "DBACCESS_HID_TAB_ENT_BOOL_DEFAULT"
-#define HID_TAB_ENT_REQUIRED "DBACCESS_HID_TAB_ENT_REQUIRED"
-#define HID_TAB_ENT_AUTOINCREMENT "DBACCESS_HID_TAB_ENT_AUTOINCREMENT"
-#define HID_TAB_ENT_TEXT_LEN "DBACCESS_HID_TAB_ENT_TEXT_LEN"
-#define HID_TAB_ENT_TYPE "DBACCESS_HID_TAB_ENT_TYPE"
-#define HID_TAB_ENT_COLUMNNAME "DBACCESS_HID_TAB_ENT_COLUMNNAME"
-#define HID_TAB_ENT_NUMTYP "DBACCESS_HID_TAB_ENT_NUMTYP"
-#define HID_TAB_ENT_LEN "DBACCESS_HID_TAB_ENT_LEN"
-#define HID_TAB_ENT_SCALE "DBACCESS_HID_TAB_ENT_SCALE"
-#define HID_CTL_RELATIONTAB "DBACCESS_HID_CTL_RELATIONTAB"
-#define HID_RELATIONDIALOG_LEFTFIELDCELL "DBACCESS_HID_RELATIONDIALOG_LEFTFIELDCELL"
-#define HID_RELATIONDIALOG_RIGHTFIELDCELL "DBACCESS_HID_RELATIONDIALOG_RIGHTFIELDCELL"
-#define HID_CONFIRM_DROP_BUTTON_ALL "DBACCESS_HID_CONFIRM_DROP_BUTTON_ALL"
-#define HID_DSADMIN_LDAP_HOSTNAME "DBACCESS_HID_DSADMIN_LDAP_HOSTNAME"
-#define HID_DSADMIN_MOZILLA_PROFILE_NAME "DBACCESS_HID_DSADMIN_MOZILLA_PROFILE_NAME"
-#define HID_DSADMIN_THUNDERBIRD_PROFILE_NAME "DBACCESS_HID_DSADMIN_THUNDERBIRD_PROFILE_NAME"
-
-#define HID_DLGINDEX_INDEXDETAILS_FIELD "DBACCESS_HID_DLGINDEX_INDEXDETAILS_FIELD"
-#define HID_DLGINDEX_INDEXDETAILS_SORTORDER "DBACCESS_HID_DLGINDEX_INDEXDETAILS_SORTORDER"
-
-#define HID_TAB_AUTOINCREMENTVALUE "DBACCESS_HID_TAB_AUTOINCREMENTVALUE"
-
-#define HID_DSADMIN_DBASE_PATH "DBACCESS_HID_DSADMIN_DBASE_PATH"
-#define HID_DSADMIN_MYSQL_DATABASE "DBACCESS_HID_DSADMIN_MYSQL_DATABASE"
-#define HID_DSADMIN_MYSQL_ODBC_DATASOURCE "DBACCESS_HID_DSADMIN_MYSQL_ODBC_DATASOURCE"
-#define HID_DSADMIN_ODBC_DATASOURCE "DBACCESS_HID_DSADMIN_ODBC_DATASOURCE"
-#define HID_DSADMIN_MSACCESS_MDB_FILE "DBACCESS_HID_DSADMIN_MSACCESS_MDB_FILE"
-#define HID_DSADMIN_FLAT_PATH "DBACCESS_HID_DSADMIN_FLAT_PATH"
-#define HID_DSADMIN_CALC_PATH "DBACCESS_HID_DSADMIN_CALC_PATH"
-#define HID_DSADMIN_WRITER_PATH "DBACCESS_HID_DSADMIN_WRITER_PATH"
-#define HID_DSADMIN_ORACLE_DATABASE "DBACCESS_HID_DSADMIN_ORACLE_DATABASE"
-
-#define HID_APP_TABLE_TREE "DBACCESS_HID_APP_TABLE_TREE"
-#define HID_APP_FORM_TREE "DBACCESS_HID_APP_FORM_TREE"
-#define HID_APP_QUERY_TREE "DBACCESS_HID_APP_QUERY_TREE"
-#define HID_APP_REPORT_TREE "DBACCESS_HID_APP_REPORT_TREE"
-#define HID_APP_CREATION_LIST "DBACCESS_HID_APP_CREATION_LIST"
-#define HID_APP_SWAP_ICONCONTROL "DBACCESS_HID_APP_SWAP_ICONCONTROL"
-
-
-#define HID_APP_HELP_TEXT "DBACCESS_HID_APP_HELP_TEXT"
-#define HID_APP_DESCRIPTION_TEXT "DBACCESS_HID_APP_DESCRIPTION_TEXT"
-#define HID_APP_VIEW_PREVIEW_CB "DBACCESS_HID_APP_VIEW_PREVIEW_CB"
-#define HID_APP_VIEW_PREVIEW_1 "DBACCESS_HID_APP_VIEW_PREVIEW_1"
-#define HID_APP_VIEW_PREVIEW_2 "DBACCESS_HID_APP_VIEW_PREVIEW_2"
-#define HID_TABDESIGN_HELPTEXT "DBACCESS_HID_TABDESIGN_HELPTEXT"
-#define HID_APP_VIEW_PREVIEW_3 "DBACCESS_HID_APP_VIEW_PREVIEW_3"
-
-
-#define HID_DBWIZ_PREVIOUS "DBACCESS_HID_DBWIZ_PREVIOUS"
-#define HID_DBWIZ_NEXT "DBACCESS_HID_DBWIZ_NEXT"
-#define HID_DBWIZ_CANCEL "DBACCESS_HID_DBWIZ_CANCEL"
-#define HID_DBWIZ_FINISH "DBACCESS_HID_DBWIZ_FINISH"
+#include <rtl/ustring.hxx>
+
+inline constexpr OUString HID_DATABROWSE_HEADER = u"DBACCESS_HID_DATABROWSE_HEADER"_ustr;
+inline constexpr OUString HID_CTL_TABBROWSER = u"DBACCESS_HID_CTL_TABBROWSER"_ustr;
+inline constexpr OUString HID_CTL_TREEVIEW = u"DBACCESS_HID_CTL_TREEVIEW"_ustr;
+
+inline constexpr OUString HID_DSADMIN_BROWSECONN = u"DBACCESS_HID_DSADMIN_BROWSECONN"_ustr;
+
+inline constexpr OUString HID_CTL_QRYSQLEDIT = u"DBACCESS_HID_CTL_QRYSQLEDIT"_ustr;
+
+inline constexpr OUString HID_CTL_QRYDGNTAB = u"DBACCESS_HID_CTL_QRYDGNTAB"_ustr;
+inline constexpr OUString HID_CTL_QRYDGNCRIT = u"DBACCESS_HID_CTL_QRYDGNCRIT"_ustr;
+inline constexpr OUString HID_QRYDGN_ROW_VISIBLE = u"DBACCESS_HID_QRYDGN_ROW_VISIBLE"_ustr;
+inline constexpr OUString HID_QRYDGN_ROW_TABLE = u"DBACCESS_HID_QRYDGN_ROW_TABLE"_ustr;
+inline constexpr OUString HID_QRYDGN_ROW_FIELD = u"DBACCESS_HID_QRYDGN_ROW_FIELD"_ustr;
+inline constexpr OUString HID_QRYDGN_ROW_ORDER = u"DBACCESS_HID_QRYDGN_ROW_ORDER"_ustr;
+inline constexpr OUString HID_QRYDGN_ROW_FUNCTION = u"DBACCESS_HID_QRYDGN_ROW_FUNCTION"_ustr;
+inline constexpr OUString HID_QRYDGN_ROW_ALIAS = u"DBACCESS_HID_QRYDGN_ROW_ALIAS"_ustr;
+inline constexpr OUString HID_QRYDGN_ROW_CRIT = u"DBACCESS_HID_QRYDGN_ROW_CRIT"_ustr;
+
+inline constexpr OUString HID_TAB_DESIGN_FIELDCONTROL = u"DBACCESS_HID_TAB_DESIGN_FIELDCONTROL"_ustr;
+inline constexpr OUString HID_TAB_DESIGN_DESCWIN = u"DBACCESS_HID_TAB_DESIGN_DESCWIN"_ustr;
+inline constexpr OUString HID_TABDESIGN_BACKGROUND = u"DBACCESS_HID_TABDESIGN_BACKGROUND"_ustr;
+inline constexpr OUString HID_CTL_TABLEEDIT = u"DBACCESS_HID_CTL_TABLEEDIT"_ustr;
+inline constexpr OUString HID_TABDESIGN_NAMECELL = u"DBACCESS_HID_TABDESIGN_NAMECELL"_ustr;
+inline constexpr OUString HID_TABDESIGN_TYPECELL = u"DBACCESS_HID_TABDESIGN_TYPECELL"_ustr;
+inline constexpr OUString HID_TABDESIGN_COMMENTCELL = u"DBACCESS_HID_TABDESIGN_COMMENTCELL"_ustr;
+inline constexpr OUString HID_TAB_DESIGN_HELP_TEXT_FRAME = u"DBACCESS_HID_TAB_DESIGN_HELP_TEXT_FRAME"_ustr;
+inline constexpr OUString HID_TAB_ENT_DEFAULT = u"DBACCESS_HID_TAB_ENT_DEFAULT"_ustr;
+inline constexpr OUString HID_TAB_ENT_FORMAT_SAMPLE = u"DBACCESS_HID_TAB_ENT_FORMAT_SAMPLE"_ustr;
+inline constexpr OUString HID_TAB_ENT_FORMAT = u"DBACCESS_HID_TAB_ENT_FORMAT"_ustr;
+inline constexpr OUString HID_TAB_ENT_BOOL_DEFAULT = u"DBACCESS_HID_TAB_ENT_BOOL_DEFAULT"_ustr;
+inline constexpr OUString HID_TAB_ENT_REQUIRED = u"DBACCESS_HID_TAB_ENT_REQUIRED"_ustr;
+inline constexpr OUString HID_TAB_ENT_AUTOINCREMENT = u"DBACCESS_HID_TAB_ENT_AUTOINCREMENT"_ustr;
+inline constexpr OUString HID_TAB_ENT_TEXT_LEN = u"DBACCESS_HID_TAB_ENT_TEXT_LEN"_ustr;
+inline constexpr OUString HID_TAB_ENT_TYPE = u"DBACCESS_HID_TAB_ENT_TYPE"_ustr;
+inline constexpr OUString HID_TAB_ENT_COLUMNNAME = u"DBACCESS_HID_TAB_ENT_COLUMNNAME"_ustr;
+inline constexpr OUString HID_TAB_ENT_NUMTYP = u"DBACCESS_HID_TAB_ENT_NUMTYP"_ustr;
+inline constexpr OUString HID_TAB_ENT_LEN = u"DBACCESS_HID_TAB_ENT_LEN"_ustr;
+inline constexpr OUString HID_TAB_ENT_SCALE = u"DBACCESS_HID_TAB_ENT_SCALE"_ustr;
+inline constexpr OUString HID_CTL_RELATIONTAB = u"DBACCESS_HID_CTL_RELATIONTAB"_ustr;
+inline constexpr OUString HID_RELATIONDIALOG_LEFTFIELDCELL = u"DBACCESS_HID_RELATIONDIALOG_LEFTFIELDCELL"_ustr;
+inline constexpr OUString HID_RELATIONDIALOG_RIGHTFIELDCELL = u"DBACCESS_HID_RELATIONDIALOG_RIGHTFIELDCELL"_ustr;
+inline constexpr OUString HID_CONFIRM_DROP_BUTTON_ALL = u"DBACCESS_HID_CONFIRM_DROP_BUTTON_ALL"_ustr;
+inline constexpr OUString HID_DSADMIN_LDAP_HOSTNAME = u"DBACCESS_HID_DSADMIN_LDAP_HOSTNAME"_ustr;
+inline constexpr OUString HID_DSADMIN_MOZILLA_PROFILE_NAME = u"DBACCESS_HID_DSADMIN_MOZILLA_PROFILE_NAME"_ustr;
+inline constexpr OUString HID_DSADMIN_THUNDERBIRD_PROFILE_NAME = u"DBACCESS_HID_DSADMIN_THUNDERBIRD_PROFILE_NAME"_ustr;
+
+inline constexpr OUString HID_DLGINDEX_INDEXDETAILS_FIELD = u"DBACCESS_HID_DLGINDEX_INDEXDETAILS_FIELD"_ustr;
+inline constexpr OUString HID_DLGINDEX_INDEXDETAILS_SORTORDER = u"DBACCESS_HID_DLGINDEX_INDEXDETAILS_SORTORDER"_ustr;
+
+inline constexpr OUString HID_TAB_AUTOINCREMENTVALUE = u"DBACCESS_HID_TAB_AUTOINCREMENTVALUE"_ustr;
+
+inline constexpr OUString HID_DSADMIN_DBASE_PATH = u"DBACCESS_HID_DSADMIN_DBASE_PATH"_ustr;
+inline constexpr OUString HID_DSADMIN_MYSQL_DATABASE = u"DBACCESS_HID_DSADMIN_MYSQL_DATABASE"_ustr;
+inline constexpr OUString HID_DSADMIN_MYSQL_ODBC_DATASOURCE = u"DBACCESS_HID_DSADMIN_MYSQL_ODBC_DATASOURCE"_ustr;
+inline constexpr OUString HID_DSADMIN_ODBC_DATASOURCE = u"DBACCESS_HID_DSADMIN_ODBC_DATASOURCE"_ustr;
+inline constexpr OUString HID_DSADMIN_MSACCESS_MDB_FILE = u"DBACCESS_HID_DSADMIN_MSACCESS_MDB_FILE"_ustr;
+inline constexpr OUString HID_DSADMIN_FLAT_PATH = u"DBACCESS_HID_DSADMIN_FLAT_PATH"_ustr;
+inline constexpr OUString HID_DSADMIN_CALC_PATH = u"DBACCESS_HID_DSADMIN_CALC_PATH"_ustr;
+inline constexpr OUString HID_DSADMIN_WRITER_PATH = u"DBACCESS_HID_DSADMIN_WRITER_PATH"_ustr;
+inline constexpr OUString HID_DSADMIN_ORACLE_DATABASE = u"DBACCESS_HID_DSADMIN_ORACLE_DATABASE"_ustr;
+
+inline constexpr OUString HID_APP_TABLE_TREE = u"DBACCESS_HID_APP_TABLE_TREE"_ustr;
+inline constexpr OUString HID_APP_FORM_TREE = u"DBACCESS_HID_APP_FORM_TREE"_ustr;
+inline constexpr OUString HID_APP_QUERY_TREE = u"DBACCESS_HID_APP_QUERY_TREE"_ustr;
+inline constexpr OUString HID_APP_REPORT_TREE = u"DBACCESS_HID_APP_REPORT_TREE"_ustr;
+inline constexpr OUString HID_APP_CREATION_LIST = u"DBACCESS_HID_APP_CREATION_LIST"_ustr;
+inline constexpr OUString HID_APP_SWAP_ICONCONTROL = u"DBACCESS_HID_APP_SWAP_ICONCONTROL"_ustr;
+
+
+inline constexpr OUString HID_APP_HELP_TEXT = u"DBACCESS_HID_APP_HELP_TEXT"_ustr;
+inline constexpr OUString HID_APP_DESCRIPTION_TEXT = u"DBACCESS_HID_APP_DESCRIPTION_TEXT"_ustr;
+inline constexpr OUString HID_APP_VIEW_PREVIEW_CB = u"DBACCESS_HID_APP_VIEW_PREVIEW_CB"_ustr;
+inline constexpr OUString HID_APP_VIEW_PREVIEW_1 = u"DBACCESS_HID_APP_VIEW_PREVIEW_1"_ustr;
+inline constexpr OUString HID_APP_VIEW_PREVIEW_2 = u"DBACCESS_HID_APP_VIEW_PREVIEW_2"_ustr;
+inline constexpr OUString HID_TABDESIGN_HELPTEXT = u"DBACCESS_HID_TABDESIGN_HELPTEXT"_ustr;
+inline constexpr OUString HID_APP_VIEW_PREVIEW_3 = u"DBACCESS_HID_APP_VIEW_PREVIEW_3"_ustr;
+
+
+inline constexpr OUString HID_DBWIZ_PREVIOUS = u"DBACCESS_HID_DBWIZ_PREVIOUS"_ustr;
+inline constexpr OUString HID_DBWIZ_NEXT = u"DBACCESS_HID_DBWIZ_NEXT"_ustr;
+inline constexpr OUString HID_DBWIZ_CANCEL = u"DBACCESS_HID_DBWIZ_CANCEL"_ustr;
+inline constexpr OUString HID_DBWIZ_FINISH = u"DBACCESS_HID_DBWIZ_FINISH"_ustr;
+inline constexpr OUString HID_DBWIZ_HELP = u"DBACCESS_HID_DBWIZ_HELP"_ustr;
+
+inline constexpr OUString HID_DBWIZ_ROADMAP = u"DBACCESS_HID_DBWIZ_ROADMAP"_ustr;
#endif
diff --git a/dbaccess/inc/pch/precompiled_dba.hxx b/dbaccess/inc/pch/precompiled_dba.hxx
index 516dcef5f4c6..b281a8b51193 100644
--- a/dbaccess/inc/pch/precompiled_dba.hxx
+++ b/dbaccess/inc/pch/precompiled_dba.hxx
@@ -99,7 +99,6 @@
#include <vcl/dllapi.h>
#include <vcl/mapmod.hxx>
#include <vcl/region.hxx>
-#include <vcl/scopedbitmapaccess.hxx>
#include <vcl/vclenum.hxx>
#include <vcl/vclptr.hxx>
#endif // PCH_LEVEL >= 2
@@ -245,7 +244,7 @@
#include <svl/svldllapi.h>
#include <tools/color.hxx>
#include <tools/degree.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/gen.hxx>
#include <tools/link.hxx>
#include <tools/long.hxx>
diff --git a/dbaccess/inc/pch/precompiled_dbaxml.hxx b/dbaccess/inc/pch/precompiled_dbaxml.hxx
index fc06290f489d..f611bbfcbd1a 100644
--- a/dbaccess/inc/pch/precompiled_dbaxml.hxx
+++ b/dbaccess/inc/pch/precompiled_dbaxml.hxx
@@ -89,7 +89,7 @@
#include <sax/tools/converter.hxx>
#include <sfx2/docfile.hxx>
#include <svl/filenotation.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <unotools/pathoptions.hxx>
#include <xmloff/ProgressBarHelper.hxx>
#include <xmloff/dllapi.h>
diff --git a/dbaccess/inc/pch/precompiled_dbu.hxx b/dbaccess/inc/pch/precompiled_dbu.hxx
index 00d2edff1c4b..15a42d978df7 100644
--- a/dbaccess/inc/pch/precompiled_dbu.hxx
+++ b/dbaccess/inc/pch/precompiled_dbu.hxx
@@ -13,7 +13,7 @@
manual changes will be rewritten by the next run of update_pch.sh (which presumably
also fixes all possible problems, so it's usually better to use it).
- Generated on 2021-05-14 22:15:31 using:
+ Generated on 2023-07-19 09:21:53 using:
./bin/update_pch dbaccess dbu --cutoff=12 --exclude:system --exclude:module --exclude:local
If after updating build fails, use the following command to locate conflicting headers:
@@ -32,9 +32,11 @@
#include <limits>
#include <map>
#include <memory>
+#include <mutex>
#include <new>
#include <optional>
#include <ostream>
+#include <span>
#include <string_view>
#include <type_traits>
#include <unordered_map>
@@ -52,6 +54,7 @@
#include <osl/process.h>
#include <osl/thread.hxx>
#include <rtl/bootstrap.hxx>
+#include <rtl/character.hxx>
#include <rtl/instance.hxx>
#include <rtl/math.h>
#include <rtl/ref.hxx>
@@ -77,17 +80,16 @@
#include <vcl/bitmapex.hxx>
#include <vcl/cairo.hxx>
#include <vcl/ctrl.hxx>
-#include <vcl/devicecoordinate.hxx>
#include <vcl/dllapi.h>
#include <vcl/event.hxx>
#include <vcl/font.hxx>
#include <vcl/gradient.hxx>
#include <vcl/idle.hxx>
+#include <vcl/kernarray.hxx>
#include <vcl/keycodes.hxx>
#include <vcl/mapmod.hxx>
#include <vcl/metaactiontypes.hxx>
#include <vcl/outdev.hxx>
-#include <vcl/outdevstate.hxx>
#include <vcl/region.hxx>
#include <vcl/rendercontext/AddFontSubstituteFlags.hxx>
#include <vcl/rendercontext/AntialiasingFlags.hxx>
@@ -98,7 +100,10 @@
#include <vcl/rendercontext/GetDefaultFontFlags.hxx>
#include <vcl/rendercontext/ImplMapRes.hxx>
#include <vcl/rendercontext/InvertFlags.hxx>
+#include <vcl/rendercontext/RasterOp.hxx>
#include <vcl/rendercontext/SalLayoutFlags.hxx>
+#include <vcl/rendercontext/State.hxx>
+#include <vcl/rendercontext/SystemTextColorFlags.hxx>
#include <vcl/salnativewidgets.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
@@ -111,10 +116,12 @@
#include <vcl/wall.hxx>
#include <vcl/weld.hxx>
#include <vcl/window.hxx>
+#include <vcl/wintypes.hxx>
#endif // PCH_LEVEL >= 2
#if PCH_LEVEL >= 3
#include <basegfx/color/bcolor.hxx>
#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/vector/b2enums.hxx>
#include <com/sun/star/awt/DeviceInfo.hpp>
@@ -138,18 +145,17 @@
#include <com/sun/star/frame/FrameAction.hpp>
#include <com/sun/star/frame/XController2.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/frame/XStatusListener.hpp>
#include <com/sun/star/frame/XTerminateListener.hpp>
#include <com/sun/star/frame/XTitle.hpp>
#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/EventObject.hpp>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/sdbc/ColumnSearch.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
@@ -172,7 +178,7 @@
#include <com/sun/star/util/URL.hpp>
#include <com/sun/star/util/XNumberFormatter.hpp>
#include <comphelper/comphelperdllapi.h>
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/diagnose_ex.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/types.hxx>
@@ -181,15 +187,14 @@
#include <connectivity/dbtools.hxx>
#include <connectivity/dbtoolsdllapi.hxx>
#include <cppu/unotype.hxx>
-#include <cppuhelper/compbase.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/implbase_ex.hxx>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/weakref.hxx>
+#include <o3tl/safeint.hxx>
#include <o3tl/typed_flags_set.hxx>
#include <salhelper/simplereferenceobject.hxx>
-#include <salhelper/singletonref.hxx>
#include <sfx2/dllapi.h>
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
@@ -205,9 +210,9 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/color.hxx>
#include <tools/degree.hxx>
-#include <tools/diagnose_ex.h>
#include <tools/gen.hxx>
#include <tools/globname.hxx>
+#include <tools/lineend.hxx>
#include <tools/link.hxx>
#include <tools/long.hxx>
#include <tools/mapunit.hxx>
@@ -215,16 +220,15 @@
#include <tools/ref.hxx>
#include <tools/solar.h>
#include <tools/toolsdllapi.h>
-#include <tools/wintypes.hxx>
#include <typelib/typedescription.h>
#include <uno/data.h>
#include <unotools/eventlisteneradapter.hxx>
#include <unotools/fontdefs.hxx>
+#include <unotools/resmgr.hxx>
#include <unotools/sharedunocomponent.hxx>
#include <unotools/unotoolsdllapi.h>
#endif // PCH_LEVEL >= 3
#if PCH_LEVEL >= 4
-#include <ConnectionLineData.hxx>
#include <FieldDescriptions.hxx>
#include <IClipBoardTest.hxx>
#include <QEnumTypes.hxx>
diff --git a/dbaccess/inc/pch/precompiled_sdbt.hxx b/dbaccess/inc/pch/precompiled_sdbt.hxx
index f691c1fa5c65..66bc51bdece0 100644
--- a/dbaccess/inc/pch/precompiled_sdbt.hxx
+++ b/dbaccess/inc/pch/precompiled_sdbt.hxx
@@ -39,7 +39,7 @@
#include <connectivity/sqlerror.hxx>
#include <connectivity/statementcomposer.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#endif // PCH_LEVEL >= 3
#if PCH_LEVEL >= 4
#include <connectiontools.hxx>
diff --git a/dbaccess/inc/query.hrc b/dbaccess/inc/query.hrc
index fe4042517603..abb8bef8d1e8 100644
--- a/dbaccess/inc/query.hrc
+++ b/dbaccess/inc/query.hrc
@@ -19,9 +19,11 @@
#ifndef INCLUDED_VCL_INC_PRINTACCESSORYVIEW_HRC
#define INCLUDED_VCL_INC_PRINTACCESSORYVIEW_HRC
-#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String)
+#include <unotools/resmgr.hxx>
-const char* RSC_QUERY_OBJECT_TYPE[] =
+#define NC_(Context, String) TranslateId(Context, u8##String)
+
+const TranslateId RSC_QUERY_OBJECT_TYPE[] =
{
NC_("RSC_QUERY_OBJECT_TYPE", "The table view"),
NC_("RSC_QUERY_OBJECT_TYPE", "The query"),
diff --git a/dbaccess/inc/strings.hrc b/dbaccess/inc/strings.hrc
index 2ccc5a666717..0691ff9f7a8b 100644
--- a/dbaccess/inc/strings.hrc
+++ b/dbaccess/inc/strings.hrc
@@ -19,7 +19,9 @@
#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_CORE_RESOURCE_HRC
#define INCLUDED_DBACCESS_SOURCE_CORE_INC_CORE_RESOURCE_HRC
-#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String)
+#include <unotools/resmgr.hxx>
+
+#define NC_(Context, String) TranslateId(Context, u8##String)
#define RID_STR_CONNECTION_INVALID NC_("RID_STR_CONNECTION_INVALID", "No connection could be established.")
#define RID_STR_TABLE_IS_FILTERED NC_("RID_STR_TABLE_IS_FILTERED", "The table $name$ already exists. It is not visible because it has been filtered out.")
@@ -291,7 +293,6 @@
#define STR_JDBCDRIVER_SUCCESS NC_("STR_JDBCDRIVER_SUCCESS", "The JDBC driver was loaded successfully.")
#define STR_JDBCDRIVER_NO_SUCCESS NC_("STR_JDBCDRIVER_NO_SUCCESS", "The JDBC driver could not be loaded.")
#define STR_MSACCESS_FILTERNAME NC_("STR_MSACCESS_FILTERNAME", "MS Access file")
-#define STR_MSACCESS_2007_FILTERNAME NC_("STR_MSACCESS_2007_FILTERNAME", "MS Access 2007 file")
#define STR_FIREBIRD_FILTERNAME NC_("STR_FIREBIRD_FILTERNAME", "Firebird Database")
#define STR_RSC_CHARSETS NC_("STR_RSC_CHARSETS", "System")
@@ -328,13 +329,13 @@
#define STR_DBASE_PATH_OR_FILE NC_("STR_DBASE_PATH_OR_FILE", "Path to the dBASE files")
#define STR_FLAT_PATH_OR_FILE NC_("STR_FLAT_PATH_OR_FILE", "Path to the text files")
#define STR_CALC_PATH_OR_FILE NC_("STR_CALC_PATH_OR_FILE", "Path to the spreadsheet document")
-#define STR_NAME_OF_ODBC_DATASOURCE NC_("STR_NAME_OF_ODBC_DATASOURCE", "Name of the ODBC data source on your system")
+#define STR_NAME_OF_ODBC_DATASOURCE NC_("STR_NAME_OF_ODBC_DATASOURCE", "Name of the ODBC data source")
#define STR_WRITER_PATH_OR_FILE NC_("STR_WRITER_PATH_OR_FILE", "Path to the Writer document")
-#define STR_MYSQL_DATABASE_NAME NC_("STR_MYSQL_DATABASE_NAME", "Name of the MySQL database")
+#define STR_MYSQL_DATABASE_NAME NC_("STR_MYSQL_DATABASE_NAME", "Name of the MySQL/MariaDB database")
#define STR_ORACLE_DATABASE_NAME NC_("STR_ORACLE_DATABASE_NAME", "Name of the Oracle database")
#define STR_MSACCESS_MDB_FILE NC_("STR_MSACCESS_MDB_FILE", "Microsoft Access database file")
#define STR_NO_ADDITIONAL_SETTINGS NC_("STR_NO_ADDITIONAL_SETTINGS", "No more settings are necessary. To verify that the connection is working, click the '%test' button.")
-#define STR_COMMONURL NC_("STR_COMMONURL", "Datasource URL (e.g. host=$host:$port dbname=$database)" )
+#define STR_COMMONURL NC_("STR_COMMONURL", "Enter the DBMS/driver-specific connection string here" )
#define STR_HOSTNAME NC_("STR_HOSTNAME", "~Host name")
#define STR_MOZILLA_PROFILE_NAME NC_("STR_MOZILLA_PROFILE_NAME", "~Mozilla profile name")
#define STR_THUNDERBIRD_PROFILE_NAME NC_("STR_THUNDERBIRD_PROFILE_NAME", "~Thunderbird profile name")
@@ -363,16 +364,17 @@
#define STR_PAGETITLE_ADO NC_("STR_PAGETITLE_ADO", "Set up ADO connection" )
#define STR_PAGETITLE_JDBC NC_("STR_PAGETITLE_JDBC", "Set up JDBC connection" )
#define STR_PAGETITLE_ORACLE NC_("STR_PAGETITLE_ORACLE", "Set up Oracle database connection" )
-#define STR_PAGETITLE_MYSQL NC_("STR_PAGETITLE_MYSQL", "Set up MySQL connection" )
+#define STR_PAGETITLE_MYSQL NC_("STR_PAGETITLE_MYSQL", "Set up MySQL/MariaDB connection" )
+#define STR_PAGETITLE_POSTGRES NC_("STR_PAGETITLE_POSTGRES", "Set up PostgreSQL connection" )
#define STR_PAGETITLE_ODBC NC_("STR_PAGETITLE_ODBC", "Set up ODBC connection" )
#define STR_PAGETITLE_DOCUMENT_OR_SPREADSHEET NC_("STR_PAGETITLE_DOCUMENT_OR_SPREADSHEET", "Set up Writer Document or Spreadsheet connection" )
#define STR_PAGETITLE_AUTHENTIFICATION NC_("STR_PAGETITLE_AUTHENTIFICATION", "Set up user authentication" )
-#define STR_PAGETITLE_MYSQL_NATIVE NC_("STR_PAGETITLE_MYSQL_NATIVE", "Set up MySQL server data")
+#define STR_PAGETITLE_MYSQL_NATIVE NC_("STR_PAGETITLE_MYSQL_NATIVE", "Set up MySQL/MariaDB server data")
#define STR_PAGETITLE_FINAL NC_("STR_PAGETITLE_FINAL", "Save and proceed" )
#define STR_DATABASEDEFAULTNAME NC_("STR_DATABASEDEFAULTNAME", "New Database" )
-#define STR_MYSQLJDBC_HEADERTEXT NC_("STR_MYSQLJDBC_HEADERTEXT", "Set up connection to a MySQL database using JDBC" )
-#define STR_MYSQLJDBC_HELPTEXT NC_("STR_MYSQLJDBC_HELPTEXT", "Please enter the required information to connect to a MySQL database using JDBC. Note that a JDBC driver class must be installed on your system and registered with %PRODUCTNAME.\nPlease contact your system administrator if you are unsure about the following settings.")
-#define STR_MYSQL_DRIVERCLASSTEXT NC_("STR_MYSQL_DRIVERCLASSTEXT", "MySQL JDBC d~river class:")
+#define STR_MYSQLJDBC_HEADERTEXT NC_("STR_MYSQLJDBC_HEADERTEXT", "Set up connection to a MySQL/MariaDB database using JDBC" )
+#define STR_MYSQLJDBC_HELPTEXT NC_("STR_MYSQLJDBC_HELPTEXT", "Please enter the required information to connect to a MySQL/MariaDB database using JDBC. Note that a JDBC driver class must be installed on your system and registered with %PRODUCTNAME.\nPlease contact your system administrator if you are unsure about the following settings.")
+#define STR_MYSQL_DRIVERCLASSTEXT NC_("STR_MYSQL_DRIVERCLASSTEXT", "MySQL/MariaDB JDBC d~river class:")
#define STR_MYSQL_DEFAULT NC_("STR_MYSQL_DEFAULT", "Default: 3306")
#define STR_DBASE_HEADERTEXT NC_("STR_DBASE_HEADERTEXT", "Set up a connection to dBASE files" )
#define STR_DBASE_HELPTEXT NC_("STR_DBASE_HELPTEXT", "Select the folder where the dBASE files are stored." )
@@ -383,8 +385,8 @@
#define STR_MSACCESS_HELPTEXT NC_("STR_MSACCESS_HELPTEXT", "Please select the Microsoft Access file you want to access.")
#define STR_ADO_HEADERTEXT NC_("STR_ADO_HEADERTEXT", "Set up a connection to an ADO database" )
#define STR_ADO_HELPTEXT NC_("STR_ADO_HELPTEXT", "Please enter the URL of the ADO data source you want to connect to.\nClick 'Browse' to configure provider-specific settings.\nPlease contact your system administrator if you are unsure about the following settings." )
-#define STR_ODBC_HEADERTEXT NC_("STR_ODBC_HEADERTEXT", "Set up a connection to an ODBC database" )
-#define STR_ODBC_HELPTEXT NC_("STR_ODBC_HELPTEXT", "Enter the name of the ODBC database you want to connect to.\nClick 'Browse...' to select an ODBC database that is already registered in %PRODUCTNAME.\nPlease contact your system administrator if you are unsure about the following settings." )
+#define STR_ODBC_HEADERTEXT NC_("STR_ODBC_HEADERTEXT", "Set up a connection to an ODBC data source" )
+#define STR_ODBC_HELPTEXT NC_("STR_ODBC_HELPTEXT", "Enter the name of the ODBC data source you want to use.\nClick 'Browse...' to select an ODBC data source that is already registered in %PRODUCTNAME.\nPlease contact your system administrator if you are unsure about the following settings." )
#define STR_JDBC_HEADERTEXT NC_("STR_JDBC_HEADERTEXT", "Set up a connection to a JDBC database" )
#define STR_JDBC_HELPTEXT NC_("STR_JDBC_HELPTEXT", "Please enter the required information to connect to a JDBC database.\nPlease contact your system administrator if you are unsure about the following settings." )
#define STR_ORACLE_HEADERTEXT NC_("STR_ORACLE_HEADERTEXT", "Set up a connection to an Oracle database")
@@ -418,6 +420,9 @@
#define STR_EXCEPTION_INFO NC_("STR_EXCEPTION_INFO", "Information")
#define STR_EXCEPTION_DETAILS NC_("STR_EXCEPTION_DETAILS", "Details")
+#define STR_ADD_USER NC_("STR_ADD_USER", "Add User")
+#define STR_DELETE_USER NC_("STR_DELETE_USER", "Delete User")
+#define STR_CHANGE_PASSWORD NC_("STR_CHANGE_PASSWORD", "Change Password")
#define STR_QUERY_USERADMIN_DELETE_USER NC_("STR_QUERY_USERADMIN_DELETE_USER", "Do you really want to delete the user?")
#define STR_USERADMIN_NOT_AVAILABLE NC_("STR_USERADMIN_NOT_AVAILABLE", "The database does not support user administration." )
#define STR_ERROR_PASSWORDS_NOT_IDENTICAL NC_("STR_ERROR_PASSWORDS_NOT_IDENTICAL", "The passwords do not match. Please enter the password again.")
diff --git a/dbaccess/inc/strings.hxx b/dbaccess/inc/strings.hxx
index b70186d28863..9783f9e41030 100644
--- a/dbaccess/inc/strings.hxx
+++ b/dbaccess/inc/strings.hxx
@@ -6,278 +6,266 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#pragma once
-#ifndef INCLUDED_DBACCESS_INC_STRINGS_HXX
-#define INCLUDED_DBACCESS_INC_STRINGS_HXX
+#include <rtl/ustring.hxx>
// property names
-#define PROPERTY_URL "URL"
-#define PROPERTY_INFO "Info"
-#define PROPERTY_SETTINGS "Settings"
-#define PROPERTY_ISPASSWORDREQUIRED "IsPasswordRequired"
-#define PROPERTY_TABLEFILTER "TableFilter"
-#define PROPERTY_TABLETYPEFILTER "TableTypeFilter"
-#define PROPERTY_NAME "Name"
-#define PROPERTY_SCHEMANAME "SchemaName"
-#define PROPERTY_CATALOGNAME "CatalogName"
-#define PROPERTY_PRIVILEGES "Privileges"
-#define PROPERTY_ESCAPE_PROCESSING "EscapeProcessing"
-#define PROPERTY_COMMAND "Command"
-#define PROPERTY_TYPE "Type"
-#define PROPERTY_TYPENAME "TypeName"
-#define PROPERTY_PRECISION "Precision"
-#define PROPERTY_SCALE "Scale"
-#define PROPERTY_ISNULLABLE "IsNullable"
-#define PROPERTY_ISAUTOINCREMENT "IsAutoIncrement"
-#define PROPERTY_ISROWVERSION "IsRowVersion"
-#define PROPERTY_DESCRIPTION "Description"
-#define PROPERTY_DEFAULTVALUE "DefaultValue"
-#define PROPERTY_NUMBERFORMAT "FormatKey"
-#define PROPERTY_QUERYTIMEOUT "QueryTimeOut"
-#define PROPERTY_MAXFIELDSIZE "MaxFieldSize"
-#define PROPERTY_MAXROWS "MaxRows"
-#define PROPERTY_CURSORNAME "CursorName"
-#define PROPERTY_RESULTSETCONCURRENCY "ResultSetConcurrency"
-#define PROPERTY_RESULTSETTYPE "ResultSetType"
-#define PROPERTY_FETCHDIRECTION "FetchDirection"
-#define PROPERTY_FETCHSIZE "FetchSize"
-#define PROPERTY_USEBOOKMARKS "UseBookmarks"
-#define PROPERTY_ISSEARCHABLE "IsSearchable"
-#define PROPERTY_ISCURRENCY "IsCurrency"
-#define PROPERTY_ISSIGNED "IsSigned"
-#define PROPERTY_DISPLAYSIZE "DisplaySize"
-#define PROPERTY_LABEL "Label"
-#define PROPERTY_ISREADONLY "IsReadOnly"
-#define PROPERTY_ISWRITABLE "IsWritable"
-#define PROPERTY_ISDEFINITELYWRITABLE "IsDefinitelyWritable"
-#define PROPERTY_VALUE "Value"
-#define PROPERTY_TABLENAME "TableName"
-#define PROPERTY_ISCASESENSITIVE "IsCaseSensitive"
-#define PROPERTY_SERVICENAME "ServiceName"
-#define PROPERTY_ISBOOKMARKABLE "IsBookmarkable"
-#define PROPERTY_CANUPDATEINSERTEDROWS "CanUpdateInsertedRows"
-#define PROPERTY_ISSET "IsSet"
-#define PROPERTY_ISOUTPARAMETER "IsOutParameter"
-#define PROPERTY_NUMBERFORMATSSUPPLIER "NumberFormatsSupplier"
-#define PROPERTY_ISCALCULATED "IsCalculated"
-#define PROPERTY_DATASOURCENAME "DataSourceName"
-#define PROPERTY_DATABASE_LOCATION "DatabaseLocation"
-#define PROPERTY_CONNECTION_RESOURCE "ConnectionResource"
-#define PROPERTY_CONNECTION_INFO "ConnectionInfo"
-#define PROPERTY_RESULT_SET "ResultSet"
-#define PROPERTY_SELECTION "Selection"
-#define PROPERTY_BOOKMARK_SELECTION "BookmarkSelection"
-#define PROPERTY_COLUMN_NAME "ColumnName"
-#define PROPERTY_COLUMN "Column"
-#define PROPERTY_DATASOURCE "DataSource"
-#define PROPERTY_TRANSACTIONISOLATION "TransactionIsolation"
-#define PROPERTY_TYPEMAP "TypeMap"
-#define PROPERTY_USER "User"
-#define PROPERTY_PASSWORD "Password"
-#define PROPERTY_COMMAND_TYPE "CommandType"
-#define PROPERTY_ACTIVECOMMAND "ActiveCommand"
-#define PROPERTY_ACTIVE_CONNECTION "ActiveConnection"
-#define PROPERTY_FILTER "Filter"
-#define PROPERTY_APPLYFILTER "ApplyFilter"
-#define PROPERTY_ORDER "Order"
-#define PROPERTY_APPLYORDER "ApplyOrder"
-#define PROPERTY_ISMODIFIED "IsModified"
-#define PROPERTY_ISNEW "IsNew"
-#define PROPERTY_ROWCOUNT "RowCount"
-#define PROPERTY_ISROWCOUNTFINAL "IsRowCountFinal"
-#define PROPERTY_HELPFILENAME "HelpFileName"
-#define PROPERTY_WIDTH "Width"
-#define PROPERTY_ROW_HEIGHT "RowHeight"
-#define PROPERTY_AUTOGROW "AutoGrow"
-#define PROPERTY_FORMATKEY "FormatKey"
-#define PROPERTY_ALIGN "Align"
-#define PROPERTY_FONT "FontDescriptor"
-#define PROPERTY_TEXTCOLOR "TextColor"
-#define PROPERTY_BOUNDFIELD "BoundField"
-#define PROPERTY_CONTROLSOURCE "DataField"
-#define PROPERTY_REALNAME "RealName"
-#define PROPERTY_ISHIDDEN "IsHidden"
-#define PROPERTY_UPDATE_TABLENAME "UpdateTableName"
-#define PROPERTY_UPDATE_SCHEMANAME "UpdateSchemaName"
-#define PROPERTY_UPDATE_CATALOGNAME "UpdateCatalogName"
-#define PROPERTY_RELATIVEPOSITION "RelativePosition"
-#define PROPERTY_CONTROLMODEL "ControlModel"
-#define PROPERTY_ISASCENDING "IsAscending"
-#define PROPERTY_RELATEDCOLUMN "RelatedColumn"
-#define PROPERTY_ISUNIQUE "IsUnique"
-#define PROPERTY_ISPRIMARYKEYINDEX "IsPrimaryKeyIndex"
-#define PROPERTY_IGNORERESULT "IgnoreResult"
-#define PROPERTY_UPDATERULE "UpdateRule"
-#define PROPERTY_DELETERULE "DeleteRule"
-#define PROPERTY_REFERENCEDTABLE "ReferencedTable"
-#define PROPERTY_REFERENCEDCOLUMN "ReferencedColumn"
-#define PROPERTY_PARENTWINDOW "ParentWindow"
-#define PROPERTY_SQLEXCEPTION "SQLException"
-#define PROPERTY_BORDER "Border"
-#define PROPERTY_THREADSAFE "ThreadSafe"
-#define PROPERTY_HELPTEXT "HelpText"
-#define PROPERTY_CONTROLDEFAULT "ControlDefault"
-#define PROPERTY_HIDDEN "Hidden"
-#define PROPERTY_DEFAULTSTATE "DefaultState"
-#define PROPERTY_SUPPRESSVERSIONCL "SuppressVersionColumns"
-#define PROPERTY_SHOW_BROWSER "ShowBrowser"
-#define PROPERTY_ENABLE_BROWSER "EnableBrowser"
-#define PROPERTY_SHOWMENU "ShowMenu"
-#define PROPERTY_LAYOUTINFORMATION "LayoutInformation"
-#define PROPERTY_CURRENTTABLE "CurrentTable"
-#define PROPERTY_DATABASENAME "DatabaseName"
-#define PROPERTY_CONTROLUSER "ControlUser"
-#define PROPERTY_CONTROLPASSWORD "ControlPassword"
-#define PROPERTY_CACHESIZE "CacheSize"
-#define PROPERTY_TEXTLINECOLOR "TextLineColor"
-#define PROPERTY_TEXTEMPHASIS "FontEmphasisMark"
-#define PROPERTY_TEXTRELIEF "FontRelief"
-#define PROPERTY_DEFAULTTEXT "DefaultText"
-#define PROPERTY_EFFECTIVEDEFAULT "EffectiveDefault"
-#define PROPERTY_AUTOINCREMENTCREATION "AutoIncrementCreation"
-#define PROPERTY_BOOLEANCOMPARISONMODE "BooleanComparisonMode"
-#define PROPERTY_ENABLESQL92CHECK "EnableSQL92Check"
-#define PROPERTY_FONTCHARWIDTH "FontCharWidth"
-#define PROPERTY_FONTCHARSET "FontCharset"
-#define PROPERTY_FONTFAMILY "FontFamily"
-#define PROPERTY_FONTHEIGHT "FontHeight"
-#define PROPERTY_FONTKERNING "FontKerning"
-#define PROPERTY_FONTNAME "FontName"
-#define PROPERTY_FONTORIENTATION "FontOrientation"
-#define PROPERTY_FONTPITCH "FontPitch"
-#define PROPERTY_FONTSLANT "FontSlant"
-#define PROPERTY_FONTSTRIKEOUT "FontStrikeout"
-#define PROPERTY_FONTSTYLENAME "FontStyleName"
-#define PROPERTY_FONTUNDERLINE "FontUnderline"
-#define PROPERTY_FONTWEIGHT "FontWeight"
-#define PROPERTY_FONTWIDTH "FontWidth"
-#define PROPERTY_FONTWORDLINEMODE "FontWordLineMode"
-#define PROPERTY_FONTTYPE "FontType"
-#define PROPERTY_PERSISTENT_NAME "PersistentName"
-#define PROPERTY_EMBEDDEDOBJECT "EmbeddedObject"
-#define PROPERTY_ORIGINAL "Original"
-#define PROPERTY_USECATALOGINSELECT "UseCatalogInSelect"
-#define PROPERTY_USESCHEMAINSELECT "UseSchemaInSelect"
-#define PROPERTY_OUTERJOINESCAPE "EnableOuterJoinEscape"
-#define PROPERTY_AS_TEMPLATE "AsTemplate"
-#define PROPERTY_HAVING_CLAUSE "HavingClause"
-#define PROPERTY_GROUP_BY "GroupBy"
-#define PROPERTY_EDIT_WIDTH "EditWidth"
-#define PROPERTY_SINGLESELECTQUERYCOMPOSER "SingleSelectQueryComposer"
-#define PROPERTY_CHANGE_NOTIFICATION_ENABLED "PropertyChangeNotificationEnabled"
+inline constexpr OUString PROPERTY_URL(u"URL"_ustr);
+inline constexpr OUString PROPERTY_INFO(u"Info"_ustr);
+inline constexpr OUString PROPERTY_SETTINGS(u"Settings"_ustr);
+inline constexpr OUString PROPERTY_ISPASSWORDREQUIRED(u"IsPasswordRequired"_ustr);
+inline constexpr OUString PROPERTY_TABLEFILTER(u"TableFilter"_ustr);
+inline constexpr OUString PROPERTY_TABLETYPEFILTER(u"TableTypeFilter"_ustr);
+inline constexpr OUString PROPERTY_NAME(u"Name"_ustr);
+inline constexpr OUString PROPERTY_SCHEMANAME(u"SchemaName"_ustr);
+inline constexpr OUString PROPERTY_CATALOGNAME(u"CatalogName"_ustr);
+inline constexpr OUString PROPERTY_PRIVILEGES(u"Privileges"_ustr);
+inline constexpr OUString PROPERTY_ESCAPE_PROCESSING(u"EscapeProcessing"_ustr);
+inline constexpr OUString PROPERTY_COMMAND(u"Command"_ustr);
+inline constexpr OUString PROPERTY_TYPE(u"Type"_ustr);
+inline constexpr OUString PROPERTY_TYPENAME(u"TypeName"_ustr);
+inline constexpr OUString PROPERTY_PRECISION(u"Precision"_ustr);
+inline constexpr OUString PROPERTY_SCALE(u"Scale"_ustr);
+inline constexpr OUString PROPERTY_ISNULLABLE(u"IsNullable"_ustr);
+inline constexpr OUString PROPERTY_ISAUTOINCREMENT(u"IsAutoIncrement"_ustr);
+inline constexpr OUString PROPERTY_ISROWVERSION(u"IsRowVersion"_ustr);
+inline constexpr OUString PROPERTY_DESCRIPTION(u"Description"_ustr);
+inline constexpr OUString PROPERTY_DEFAULTVALUE(u"DefaultValue"_ustr);
+inline constexpr OUString PROPERTY_NUMBERFORMAT(u"FormatKey"_ustr);
+inline constexpr OUString PROPERTY_QUERYTIMEOUT(u"QueryTimeOut"_ustr);
+inline constexpr OUString PROPERTY_MAXFIELDSIZE(u"MaxFieldSize"_ustr);
+inline constexpr OUString PROPERTY_MAXROWS(u"MaxRows"_ustr);
+inline constexpr OUString PROPERTY_CURSORNAME(u"CursorName"_ustr);
+inline constexpr OUString PROPERTY_RESULTSETCONCURRENCY(u"ResultSetConcurrency"_ustr);
+inline constexpr OUString PROPERTY_RESULTSETTYPE(u"ResultSetType"_ustr);
+inline constexpr OUString PROPERTY_FETCHDIRECTION(u"FetchDirection"_ustr);
+inline constexpr OUString PROPERTY_FETCHSIZE(u"FetchSize"_ustr);
+inline constexpr OUString PROPERTY_USEBOOKMARKS(u"UseBookmarks"_ustr);
+inline constexpr OUString PROPERTY_ISSEARCHABLE(u"IsSearchable"_ustr);
+inline constexpr OUString PROPERTY_ISCURRENCY(u"IsCurrency"_ustr);
+inline constexpr OUString PROPERTY_ISSIGNED(u"IsSigned"_ustr);
+inline constexpr OUString PROPERTY_DISPLAYSIZE(u"DisplaySize"_ustr);
+inline constexpr OUString PROPERTY_LABEL(u"Label"_ustr);
+inline constexpr OUString PROPERTY_ISREADONLY(u"IsReadOnly"_ustr);
+inline constexpr OUString PROPERTY_ISWRITABLE(u"IsWritable"_ustr);
+inline constexpr OUString PROPERTY_ISDEFINITELYWRITABLE(u"IsDefinitelyWritable"_ustr);
+inline constexpr OUString PROPERTY_VALUE(u"Value"_ustr);
+inline constexpr OUString PROPERTY_TABLENAME(u"TableName"_ustr);
+inline constexpr OUString PROPERTY_ISCASESENSITIVE(u"IsCaseSensitive"_ustr);
+inline constexpr OUString PROPERTY_SERVICENAME(u"ServiceName"_ustr);
+inline constexpr OUString PROPERTY_ISBOOKMARKABLE(u"IsBookmarkable"_ustr);
+inline constexpr OUString PROPERTY_CANUPDATEINSERTEDROWS(u"CanUpdateInsertedRows"_ustr);
+inline constexpr OUString PROPERTY_NUMBERFORMATSSUPPLIER(u"NumberFormatsSupplier"_ustr);
+inline constexpr OUString PROPERTY_DATASOURCENAME(u"DataSourceName"_ustr);
+inline constexpr OUString PROPERTY_DATABASE_LOCATION(u"DatabaseLocation"_ustr);
+inline constexpr OUString PROPERTY_CONNECTION_RESOURCE(u"ConnectionResource"_ustr);
+inline constexpr OUString PROPERTY_CONNECTION_INFO(u"ConnectionInfo"_ustr);
+inline constexpr OUString PROPERTY_RESULT_SET(u"ResultSet"_ustr);
+inline constexpr OUString PROPERTY_SELECTION(u"Selection"_ustr);
+inline constexpr OUString PROPERTY_BOOKMARK_SELECTION(u"BookmarkSelection"_ustr);
+inline constexpr OUString PROPERTY_COLUMN_NAME(u"ColumnName"_ustr);
+inline constexpr OUString PROPERTY_COLUMN(u"Column"_ustr);
+inline constexpr OUString PROPERTY_DATASOURCE(u"DataSource"_ustr);
+inline constexpr OUString PROPERTY_TRANSACTIONISOLATION(u"TransactionIsolation"_ustr);
+inline constexpr OUString PROPERTY_TYPEMAP(u"TypeMap"_ustr);
+inline constexpr OUString PROPERTY_USER(u"User"_ustr);
+inline constexpr OUString PROPERTY_PASSWORD(u"Password"_ustr);
+inline constexpr OUString PROPERTY_COMMAND_TYPE(u"CommandType"_ustr);
+inline constexpr OUString PROPERTY_ACTIVECOMMAND(u"ActiveCommand"_ustr);
+inline constexpr OUString PROPERTY_ACTIVE_CONNECTION(u"ActiveConnection"_ustr);
+inline constexpr OUString PROPERTY_FILTER(u"Filter"_ustr);
+inline constexpr OUString PROPERTY_APPLYFILTER(u"ApplyFilter"_ustr);
+inline constexpr OUString PROPERTY_ORDER(u"Order"_ustr);
+inline constexpr OUString PROPERTY_APPLYORDER(u"ApplyOrder"_ustr);
+inline constexpr OUString PROPERTY_ISMODIFIED(u"IsModified"_ustr);
+inline constexpr OUString PROPERTY_ISNEW(u"IsNew"_ustr);
+inline constexpr OUString PROPERTY_ROWCOUNT(u"RowCount"_ustr);
+inline constexpr OUString PROPERTY_ISROWCOUNTFINAL(u"IsRowCountFinal"_ustr);
+inline constexpr OUString PROPERTY_WIDTH(u"Width"_ustr);
+inline constexpr OUString PROPERTY_ROW_HEIGHT(u"RowHeight"_ustr);
+inline constexpr OUString PROPERTY_AUTOGROW(u"AutoGrow"_ustr);
+inline constexpr OUString PROPERTY_FORMATKEY(u"FormatKey"_ustr);
+inline constexpr OUString PROPERTY_ALIGN(u"Align"_ustr);
+inline constexpr OUString PROPERTY_FONT(u"FontDescriptor"_ustr);
+inline constexpr OUString PROPERTY_TEXTCOLOR(u"TextColor"_ustr);
+inline constexpr OUString PROPERTY_BOUNDFIELD(u"BoundField"_ustr);
+inline constexpr OUString PROPERTY_CONTROLSOURCE(u"DataField"_ustr);
+inline constexpr OUString PROPERTY_REALNAME(u"RealName"_ustr);
+inline constexpr OUString PROPERTY_UPDATE_TABLENAME(u"UpdateTableName"_ustr);
+inline constexpr OUString PROPERTY_UPDATE_SCHEMANAME(u"UpdateSchemaName"_ustr);
+inline constexpr OUString PROPERTY_UPDATE_CATALOGNAME(u"UpdateCatalogName"_ustr);
+inline constexpr OUString PROPERTY_RELATIVEPOSITION(u"RelativePosition"_ustr);
+inline constexpr OUString PROPERTY_CONTROLMODEL(u"ControlModel"_ustr);
+inline constexpr OUString PROPERTY_RELATEDCOLUMN(u"RelatedColumn"_ustr);
+inline constexpr OUString PROPERTY_ISUNIQUE(u"IsUnique"_ustr);
+inline constexpr OUString PROPERTY_ISPRIMARYKEYINDEX(u"IsPrimaryKeyIndex"_ustr);
+inline constexpr OUString PROPERTY_IGNORERESULT(u"IgnoreResult"_ustr);
+inline constexpr OUString PROPERTY_UPDATERULE(u"UpdateRule"_ustr);
+inline constexpr OUString PROPERTY_DELETERULE(u"DeleteRule"_ustr);
+inline constexpr OUString PROPERTY_REFERENCEDTABLE(u"ReferencedTable"_ustr);
+inline constexpr OUString PROPERTY_SQLEXCEPTION(u"SQLException"_ustr);
+inline constexpr OUString PROPERTY_BORDER(u"Border"_ustr);
+inline constexpr OUString PROPERTY_HELPTEXT(u"HelpText"_ustr);
+inline constexpr OUString PROPERTY_CONTROLDEFAULT(u"ControlDefault"_ustr);
+inline constexpr OUString PROPERTY_HIDDEN(u"Hidden"_ustr);
+inline constexpr OUString PROPERTY_DEFAULTSTATE(u"DefaultState"_ustr);
+inline constexpr OUString PROPERTY_SUPPRESSVERSIONCL(u"SuppressVersionColumns"_ustr);
+inline constexpr OUString PROPERTY_SHOW_BROWSER(u"ShowBrowser"_ustr);
+inline constexpr OUString PROPERTY_ENABLE_BROWSER(u"EnableBrowser"_ustr);
+inline constexpr OUString PROPERTY_SHOWMENU(u"ShowMenu"_ustr);
+inline constexpr OUString PROPERTY_LAYOUTINFORMATION(u"LayoutInformation"_ustr);
+inline constexpr OUString PROPERTY_CURRENTTABLE(u"CurrentTable"_ustr);
+inline constexpr OUString PROPERTY_TEXTLINECOLOR(u"TextLineColor"_ustr);
+inline constexpr OUString PROPERTY_TEXTEMPHASIS(u"FontEmphasisMark"_ustr);
+inline constexpr OUString PROPERTY_TEXTRELIEF(u"FontRelief"_ustr);
+inline constexpr OUString PROPERTY_DEFAULTTEXT(u"DefaultText"_ustr);
+inline constexpr OUString PROPERTY_EFFECTIVEDEFAULT(u"EffectiveDefault"_ustr);
+inline constexpr OUString PROPERTY_AUTOINCREMENTCREATION(u"AutoIncrementCreation"_ustr);
+inline constexpr OUString PROPERTY_BOOLEANCOMPARISONMODE(u"BooleanComparisonMode"_ustr);
+inline constexpr OUString PROPERTY_ENABLESQL92CHECK(u"EnableSQL92Check"_ustr);
+inline constexpr OUString PROPERTY_FONTCHARWIDTH(u"FontCharWidth"_ustr);
+inline constexpr OUString PROPERTY_FONTCHARSET(u"FontCharset"_ustr);
+inline constexpr OUString PROPERTY_FONTFAMILY(u"FontFamily"_ustr);
+inline constexpr OUString PROPERTY_FONTHEIGHT(u"FontHeight"_ustr);
+inline constexpr OUString PROPERTY_FONTKERNING(u"FontKerning"_ustr);
+inline constexpr OUString PROPERTY_FONTNAME(u"FontName"_ustr);
+inline constexpr OUString PROPERTY_FONTORIENTATION(u"FontOrientation"_ustr);
+inline constexpr OUString PROPERTY_FONTPITCH(u"FontPitch"_ustr);
+inline constexpr OUString PROPERTY_FONTSLANT(u"FontSlant"_ustr);
+inline constexpr OUString PROPERTY_FONTSTRIKEOUT(u"FontStrikeout"_ustr);
+inline constexpr OUString PROPERTY_FONTSTYLENAME(u"FontStyleName"_ustr);
+inline constexpr OUString PROPERTY_FONTUNDERLINE(u"FontUnderline"_ustr);
+inline constexpr OUString PROPERTY_FONTWEIGHT(u"FontWeight"_ustr);
+inline constexpr OUString PROPERTY_FONTWIDTH(u"FontWidth"_ustr);
+inline constexpr OUString PROPERTY_FONTWORDLINEMODE(u"FontWordLineMode"_ustr);
+inline constexpr OUString PROPERTY_FONTTYPE(u"FontType"_ustr);
+inline constexpr OUString PROPERTY_PERSISTENT_NAME(u"PersistentName"_ustr);
+inline constexpr OUString PROPERTY_EMBEDDEDOBJECT(u"EmbeddedObject"_ustr);
+inline constexpr OUString PROPERTY_ORIGINAL(u"Original"_ustr);
+inline constexpr OUString PROPERTY_USECATALOGINSELECT(u"UseCatalogInSelect"_ustr);
+inline constexpr OUString PROPERTY_USESCHEMAINSELECT(u"UseSchemaInSelect"_ustr);
+inline constexpr OUString PROPERTY_OUTERJOINESCAPE(u"EnableOuterJoinEscape"_ustr);
+inline constexpr OUString PROPERTY_AS_TEMPLATE(u"AsTemplate"_ustr);
+inline constexpr OUString PROPERTY_HAVING_CLAUSE(u"HavingClause"_ustr);
+inline constexpr OUString PROPERTY_GROUP_BY(u"GroupBy"_ustr);
+inline constexpr OUString PROPERTY_EDIT_WIDTH(u"EditWidth"_ustr);
+inline constexpr OUString PROPERTY_SINGLESELECTQUERYCOMPOSER(u"SingleSelectQueryComposer"_ustr);
+inline constexpr OUString
+ PROPERTY_CHANGE_NOTIFICATION_ENABLED(u"PropertyChangeNotificationEnabled"_ustr);
+inline constexpr OUString PROPERTY_CHAR_STRIKEOUT(u"CharStrikeout"_ustr);
+inline constexpr OUString PROPERTY_CHAR_UNDERLINE(u"CharUnderline"_ustr);
+inline constexpr OUString PROPERTY_CHAR_UNDERLINE_COLOR(u"CharUnderlineColor"_ustr);
+inline constexpr OUString PROPERTY_CHAR_UNDERLINE_HAS_COLOR(u"CharUnderlineHasColor"_ustr);
// service names
-#define SERVICE_SDBC_RESULTSET "com.sun.star.sdbc.ResultSet"
-#define SERVICE_SDBC_ROWSET "com.sun.star.sdbc.RowSet"
-#define SERVICE_SDBC_STATEMENT "com.sun.star.sdbc.Statement"
-#define SERVICE_SDBC_PREPAREDSTATEMENT "com.sun.star.sdbc.PreparedStatement"
-#define SERVICE_SDBC_CALLABLESTATEMENT "com.sun.star.sdbc.CallableStatement"
-#define SERVICE_SDBC_CONNECTION "com.sun.star.sdbc.Connection"
-#define SERVICE_SDBCX_CONTAINER "com.sun.star.sdbcx.Container"
-#define SERVICE_SDBCX_TABLE "com.sun.star.sdbcx.Table"
-#define SERVICE_SDBCX_RESULTSET "com.sun.star.sdbcx.ResultSet"
-#define SERVICE_SDB_CONNECTION "com.sun.star.sdb.Connection"
-#define SERVICE_SDBCX_COLUMN "com.sun.star.sdbcx.Column"
-#define SERVICE_SDBCX_COLUMNDESCRIPTOR "com.sun.star.sdbcx.ColumnDescriptor"
-#define SERVICE_SDB_COLUMNSETTINGS "com.sun.star.sdb.ColumnSettings"
-#define SERVICE_SDB_RESULTCOLUMN "com.sun.star.sdb.ResultColumn"
-#define SERVICE_SDB_DATACOLUMN "com.sun.star.sdb.DataColumn"
-#define SERVICE_SDB_DATASOURCE "com.sun.star.sdb.DataSource"
-#define SERVICE_SDB_RESULTSET "com.sun.star.sdb.ResultSet"
-#define SERVICE_SDB_ROWSET "com.sun.star.sdb.RowSet"
-#define SERVICE_SDB_PREPAREDSTATMENT "com.sun.star.sdb.PreparedStatement"
-#define SERVICE_SDB_CALLABLESTATEMENT "com.sun.star.sdb.CallableStatement"
-#define SERVICE_SDB_SQLQUERYCOMPOSER "com.sun.star.sdb.SQLQueryComposer"
-#define SERVICE_SDB_DATASETTINGS "com.sun.star.sdb.DefinitionSettings"
-#define SERVICE_SDB_QUERYDESCRIPTOR "com.sun.star.sdb.QueryDescriptor"
-#define SERVICE_SDB_QUERY "com.sun.star.sdb.Query"
-#define SERVICE_SDBCX_COLUMNS "com.sun.star.sdbcx.Columns"
-#define SERVICE_SDBCX_TABLES "com.sun.star.sdbcx.Tables"
-#define SERVICE_SDB_QUERIES "com.sun.star.sdb.Queries"
-#define SERVICE_SDBCX_INDEXCOLUMN "com.sun.star.sdbcx.IndexColumn"
-#define SERVICE_SDBCX_KEYCOLUMN "com.sun.star.sdbcx.KeyColumn"
-#define SERVICE_SDB_DOCUMENTDEFINITION "com.sun.star.sdb.DocumentDefinition"
-#define SERVICE_NAME_FORM "com.sun.star.sdb.Form"
-#define SERVICE_NAME_FORM_COLLECTION "com.sun.star.sdb.Forms"
-#define SERVICE_NAME_REPORT "com.sun.star.sdb.Report"
-#define SERVICE_NAME_REPORT_COLLECTION "com.sun.star.sdb.Reports"
-#define SERVICE_NAME_QUERY_COLLECTION "com.sun.star.sdb.Queries"
-#define SERVICE_NAME_TABLE_COLLECTION "com.sun.star.sdb.Tables"
-#define SERVICE_NAME_SINGLESELECTQUERYCOMPOSER "com.sun.star.sdb.SingleSelectQueryComposer"
-#define SERVICE_SDB_APPLICATIONCONTROLLER "org.openoffice.comp.dbu.OApplicationController"
+inline constexpr OUString SERVICE_SDBC_RESULTSET = u"com.sun.star.sdbc.ResultSet"_ustr;
+inline constexpr OUString SERVICE_SDBC_ROWSET = u"com.sun.star.sdbc.RowSet"_ustr;
+inline constexpr OUString SERVICE_SDBC_STATEMENT = u"com.sun.star.sdbc.Statement"_ustr;
+inline constexpr OUString SERVICE_SDBC_PREPAREDSTATEMENT
+ = u"com.sun.star.sdbc.PreparedStatement"_ustr;
+inline constexpr OUString SERVICE_SDBC_CALLABLESTATEMENT
+ = u"com.sun.star.sdbc.CallableStatement"_ustr;
+inline constexpr OUString SERVICE_SDBCX_CONTAINER = u"com.sun.star.sdbcx.Container"_ustr;
+inline constexpr OUString SERVICE_SDBCX_TABLE = u"com.sun.star.sdbcx.Table"_ustr;
+inline constexpr OUString SERVICE_SDBCX_RESULTSET = u"com.sun.star.sdbcx.ResultSet"_ustr;
+inline constexpr OUString SERVICE_SDB_CONNECTION = u"com.sun.star.sdb.Connection"_ustr;
+inline constexpr OUString SERVICE_SDBCX_COLUMN = u"com.sun.star.sdbcx.Column"_ustr;
+inline constexpr OUString SERVICE_SDBCX_COLUMNDESCRIPTOR
+ = u"com.sun.star.sdbcx.ColumnDescriptor"_ustr;
+inline constexpr OUString SERVICE_SDB_COLUMNSETTINGS = u"com.sun.star.sdb.ColumnSettings"_ustr;
+inline constexpr OUString SERVICE_SDB_RESULTCOLUMN = u"com.sun.star.sdb.ResultColumn"_ustr;
+inline constexpr OUString SERVICE_SDB_DATACOLUMN = u"com.sun.star.sdb.DataColumn"_ustr;
+inline constexpr OUString SERVICE_SDB_DATASOURCE = u"com.sun.star.sdb.DataSource"_ustr;
+inline constexpr OUString SERVICE_SDB_RESULTSET = u"com.sun.star.sdb.ResultSet"_ustr;
+inline constexpr OUString SERVICE_SDB_ROWSET = u"com.sun.star.sdb.RowSet"_ustr;
+inline constexpr OUString SERVICE_SDB_PREPAREDSTATEMENT
+ = u"com.sun.star.sdb.PreparedStatement"_ustr;
+inline constexpr OUString SERVICE_SDB_CALLABLESTATEMENT
+ = u"com.sun.star.sdb.CallableStatement"_ustr;
+inline constexpr OUString SERVICE_SDB_SQLQUERYCOMPOSER = u"com.sun.star.sdb.SQLQueryComposer"_ustr;
+inline constexpr OUString SERVICE_SDB_DATASETTINGS = u"com.sun.star.sdb.DefinitionSettings"_ustr;
+inline constexpr OUString SERVICE_SDB_QUERYDESCRIPTOR = u"com.sun.star.sdb.QueryDescriptor"_ustr;
+inline constexpr OUString SERVICE_SDB_QUERY = u"com.sun.star.sdb.Query"_ustr;
+inline constexpr OUString SERVICE_SDBCX_TABLES = u"com.sun.star.sdbcx.Tables"_ustr;
+inline constexpr OUString SERVICE_SDB_QUERIES = u"com.sun.star.sdb.Queries"_ustr;
+inline constexpr OUString SERVICE_SDB_DOCUMENTDEFINITION
+ = u"com.sun.star.sdb.DocumentDefinition"_ustr;
+inline constexpr OUString SERVICE_NAME_FORM_COLLECTION = u"com.sun.star.sdb.Forms"_ustr;
+inline constexpr OUString SERVICE_NAME_REPORT_COLLECTION = u"com.sun.star.sdb.Reports"_ustr;
+inline constexpr OUString SERVICE_NAME_QUERY_COLLECTION = u"com.sun.star.sdb.Queries"_ustr;
+inline constexpr OUString SERVICE_NAME_SINGLESELECTQUERYCOMPOSER
+ = u"com.sun.star.sdb.SingleSelectQueryComposer"_ustr;
+inline constexpr OUString SERVICE_SDB_APPLICATIONCONTROLLER
+ = u"org.openoffice.comp.dbu.OApplicationController"_ustr;
// info properties
-#define INFO_JDBCDRIVERCLASS "JavaDriverClass"
-#define INFO_TEXTFILEEXTENSION "Extension"
-#define INFO_CHARSET "CharSet"
-#define INFO_TEXTFILEHEADER "HeaderLine"
-#define INFO_FIELDDELIMITER "FieldDelimiter"
-#define INFO_TEXTDELIMITER "StringDelimiter"
-#define INFO_DECIMALDELIMITER "DecimalDelimiter"
-#define INFO_THOUSANDSDELIMITER "ThousandDelimiter"
-#define INFO_SHOWDELETEDROWS "ShowDeleted"
-#define INFO_ALLOWLONGTABLENAMES "NoNameLengthLimit"
-#define INFO_ADDITIONALOPTIONS "SystemDriverSettings"
-#define INFO_AUTORETRIEVEVALUE "AutoRetrievingStatement"
-#define INFO_AUTORETRIEVEENABLED "IsAutoRetrievingEnabled"
-#define INFO_APPEND_TABLE_ALIAS "AppendTableAliasName"
-#define INFO_AS_BEFORE_CORRELATION_NAME "GenerateASBeforeCorrelationName"
-#define INFO_FORMS_CHECK_REQUIRED_FIELDS "FormsCheckRequiredFields"
-#define INFO_PARAMETERNAMESUBST "ParameterNameSubstitution"
-#define INFO_IGNOREDRIVER_PRIV "IgnoreDriverPrivileges"
-#define INFO_USECATALOG "UseCatalog"
-#define INFO_CONN_LDAP_BASEDN "BaseDN"
-#define INFO_CONN_LDAP_ROWCOUNT "MaxRowCount"
-#define INFO_PREVIEW "Preview"
-#define INFO_MEDIATYPE "MediaType"
-#define INFO_ESCAPE_DATETIME "EscapeDateTime"
+inline constexpr OUString INFO_JDBCDRIVERCLASS = u"JavaDriverClass"_ustr;
+inline constexpr OUString INFO_TEXTFILEEXTENSION = u"Extension"_ustr;
+inline constexpr OUString INFO_CHARSET = u"CharSet"_ustr;
+inline constexpr OUString INFO_TEXTFILEHEADER = u"HeaderLine"_ustr;
+inline constexpr OUString INFO_FIELDDELIMITER = u"FieldDelimiter"_ustr;
+inline constexpr OUString INFO_TEXTDELIMITER = u"StringDelimiter"_ustr;
+inline constexpr OUString INFO_DECIMALDELIMITER = u"DecimalDelimiter"_ustr;
+inline constexpr OUString INFO_THOUSANDSDELIMITER = u"ThousandDelimiter"_ustr;
+inline constexpr OUString INFO_SHOWDELETEDROWS = u"ShowDeleted"_ustr;
+inline constexpr OUString INFO_ALLOWLONGTABLENAMES = u"NoNameLengthLimit"_ustr;
+inline constexpr OUString INFO_ADDITIONALOPTIONS = u"SystemDriverSettings"_ustr;
+inline constexpr OUString INFO_AUTORETRIEVEVALUE = u"AutoRetrievingStatement"_ustr;
+inline constexpr OUString INFO_AUTORETRIEVEENABLED = u"IsAutoRetrievingEnabled"_ustr;
+inline constexpr OUString INFO_APPEND_TABLE_ALIAS = u"AppendTableAliasName"_ustr;
+inline constexpr OUString INFO_AS_BEFORE_CORRELATION_NAME = u"GenerateASBeforeCorrelationName"_ustr;
+inline constexpr OUString INFO_FORMS_CHECK_REQUIRED_FIELDS = u"FormsCheckRequiredFields"_ustr;
+inline constexpr OUString INFO_PARAMETERNAMESUBST = u"ParameterNameSubstitution"_ustr;
+inline constexpr OUString INFO_IGNOREDRIVER_PRIV = u"IgnoreDriverPrivileges"_ustr;
+inline constexpr OUString INFO_USECATALOG = u"UseCatalog"_ustr;
+inline constexpr OUString INFO_CONN_LDAP_BASEDN = u"BaseDN"_ustr;
+inline constexpr OUString INFO_CONN_LDAP_ROWCOUNT = u"MaxRowCount"_ustr;
+inline constexpr OUString INFO_PREVIEW = u"Preview"_ustr;
+inline constexpr OUString INFO_MEDIATYPE = u"MediaType"_ustr;
+inline constexpr OUString INFO_ESCAPE_DATETIME = u"EscapeDateTime"_ustr;
// other
-#define INFO_POOLURL "PoolURL"
-#define URL_INTERACTIVE "Interactive"
+inline constexpr OUString INFO_POOLURL = u"PoolURL"_ustr;
// URLs
-#define URL_COMPONENT_QUERYDESIGN ".component:DB/QueryDesign"
-#define URL_COMPONENT_VIEWDESIGN ".component:DB/ViewDesign"
-#define URL_COMPONENT_TABLEDESIGN ".component:DB/TableDesign"
-#define URL_COMPONENT_FORMGRIDVIEW ".component:DB/FormGridView"
-#define URL_COMPONENT_DATASOURCEBROWSER ".component:DB/DataSourceBrowser"
-#define URL_COMPONENT_RELATIONDESIGN ".component:DB/RelationDesign"
-#define URL_COMPONENT_APPLICATION ".component:DB/Application"
-#define URL_COMPONENT_REPORTDESIGN ".component:DB/ReportDesign"
+inline constexpr OUString URL_COMPONENT_QUERYDESIGN = u".component:DB/QueryDesign"_ustr;
+inline constexpr OUString URL_COMPONENT_VIEWDESIGN = u".component:DB/ViewDesign"_ustr;
+inline constexpr OUString URL_COMPONENT_TABLEDESIGN = u".component:DB/TableDesign"_ustr;
+inline constexpr OUString URL_COMPONENT_FORMGRIDVIEW = u".component:DB/FormGridView"_ustr;
+inline constexpr OUString URL_COMPONENT_DATASOURCEBROWSER = u".component:DB/DataSourceBrowser"_ustr;
+inline constexpr OUString URL_COMPONENT_RELATIONDESIGN = u".component:DB/RelationDesign"_ustr;
+inline constexpr OUString URL_COMPONENT_REPORTDESIGN(u".component:DB/ReportDesign"_ustr);
// service names
-#define SERVICE_SDB_DIRECTSQLDIALOG "org.openoffice.comp.dbu.DirectSqlDialog"
+inline constexpr OUString SERVICE_SDB_DIRECTSQLDIALOG
+ = u"org.openoffice.comp.dbu.DirectSqlDialog"_ustr;
// other DBU relevant strings
-#define FRAME_NAME_QUERY_PREVIEW "QueryPreview"
-#define SERVICE_CONTROLDEFAULT "com.sun.star.comp.dbu.OColumnControl"
-#define PROPERTY_QUERYDESIGNVIEW "QueryDesignView"
-#define PROPERTY_GRAPHICAL_DESIGN "GraphicalDesign"
-#define PROPERTY_HELP_URL "HelpURL"
+inline constexpr OUString PROPERTY_QUERYDESIGNVIEW(u"QueryDesignView"_ustr);
+inline constexpr OUString PROPERTY_GRAPHICAL_DESIGN(u"GraphicalDesign"_ustr);
+inline constexpr OUString PROPERTY_HELP_URL(u"HelpURL"_ustr);
+inline constexpr OUString FRAME_NAME_QUERY_PREVIEW = u"QueryPreview"_ustr;
+inline constexpr OUString SERVICE_CONTROLDEFAULT = u"com.sun.star.comp.dbu.OColumnControl"_ustr;
// other DBU properties
-#define PROPERTY_TRISTATE "TriState"
-#define PROPERTY_ENABLEOUTERJOIN "EnableOuterJoinEscape"
-#define PROPERTY_TABSTOP "TabStop"
-#define PROPERTY_DEFAULTCONTROL "DefaultControl"
-#define PROPERTY_ENABLED "Enabled"
-#define PROPERTY_MOUSE_WHEEL_BEHAVIOR "MouseWheelBehavior"
+inline constexpr OUString PROPERTY_ENABLEOUTERJOIN(u"EnableOuterJoinEscape"_ustr);
+inline constexpr OUString PROPERTY_TABSTOP(u"TabStop"_ustr);
+inline constexpr OUString PROPERTY_DEFAULTCONTROL(u"DefaultControl"_ustr);
+inline constexpr OUString PROPERTY_ENABLED(u"Enabled"_ustr);
+inline constexpr OUString PROPERTY_MOUSE_WHEEL_BEHAVIOR(u"MouseWheelBehavior"_ustr);
-#define SQLSTATE_GENERAL "01000"
+inline constexpr OUString SQLSTATE_GENERAL = u"01000"_ustr;
-#define PROPERTY_APPLYFORMDESIGNMODE "ApplyFormDesignMode"
-#define PROPERTY_IS_FORM "IsForm"
-#define PROPERTY_PERSISTENT_PATH "PersistentPath"
+inline constexpr OUString PROPERTY_IS_FORM(u"IsForm"_ustr);
+inline constexpr OUString PROPERTY_PERSISTENT_PATH(u"PersistentPath"_ustr);
-#define STR_AUTOTEXTSEPARATORLIST "\"\t34\t'\t39"
-
-#endif
+inline constexpr OUString STR_AUTOTEXTSEPARATORLIST = u"\"\t34\t'\t39"_ustr;
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/dbaccess/inc/templwin.hrc b/dbaccess/inc/templwin.hrc
index 0147a694ff5b..2cc76e395245 100644
--- a/dbaccess/inc/templwin.hrc
+++ b/dbaccess/inc/templwin.hrc
@@ -20,8 +20,9 @@
#pragma once
#include <utility>
+#include <unotools/resmgr.hxx>
-#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String)
+#define NC_(Context, String) TranslateId(Context, u8##String)
#define DI_TITLE 1
#define DI_FROM 2
@@ -36,7 +37,7 @@
#define DI_THEME 11
#define DI_SIZE 12
-const std::pair<const char*, int> STRARY_SVT_DOCINFO[] =
+const std::pair<TranslateId, int> STRARY_SVT_DOCINFO[] =
{
{ NC_("STRARY_SVT_DOCINFO", "Title") , DI_TITLE },
{ NC_("STRARY_SVT_DOCINFO", "By") , DI_FROM },
diff --git a/dbaccess/qa/complex/dbaccess/CopyTableWizard.java b/dbaccess/qa/complex/dbaccess/CopyTableWizard.java
index a9254fac33c9..f2620f645eab 100644
--- a/dbaccess/qa/complex/dbaccess/CopyTableWizard.java
+++ b/dbaccess/qa/complex/dbaccess/CopyTableWizard.java
@@ -166,7 +166,7 @@ public class CopyTableWizard extends CRMBasedTestCase
final UITools uiTools = new UITools(dialog);
final XAccessible root = uiTools.getRoot();
final XAccessibleContext accContext = root.getAccessibleContext();
- final int count = accContext.getAccessibleChildCount();
+ final long count = accContext.getAccessibleChildCount();
String buttonName = "Create";
final XAccessibleContext childContext = accContext.getAccessibleChild(count - 3).getAccessibleContext();
final String name = childContext.getAccessibleName();
diff --git a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java
index 5bd28053b77c..3087ad6374c2 100644
--- a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java
+++ b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java
@@ -174,6 +174,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
};
}
+ @SuppressWarnings("unchecked")
public void dispose()
{
final EventObject event = new EventObject(this);
diff --git a/dbaccess/qa/complex/dbaccess/RowSet.java b/dbaccess/qa/complex/dbaccess/RowSet.java
index 4c5fcc6da793..ed42a271b46f 100644
--- a/dbaccess/qa/complex/dbaccess/RowSet.java
+++ b/dbaccess/qa/complex/dbaccess/RowSet.java
@@ -365,7 +365,7 @@ public class RowSet extends TestCase
m_rowSet.addRowSetListener(pRow);
// do some movements to check if we got all notifications
- final Class cResSet = Class.forName("com.sun.star.sdbc.XResultSet");
+ final Class<?> cResSet = Class.forName("com.sun.star.sdbc.XResultSet");
final boolean moves[] = new boolean[9];
for (int i = 0; i < moves.length; ++i)
{
@@ -399,7 +399,7 @@ public class RowSet extends TestCase
testCursorMove(m_resultSet, cResSet.getMethod(NEXT, (Class[]) null), pRow, moves, null);
moves[RowSetEventListener.IS_MODIFIED] = false;
- final Class cupd = Class.forName("com.sun.star.sdbc.XResultSetUpdate");
+ final Class<?> cupd = Class.forName("com.sun.star.sdbc.XResultSetUpdate");
final XResultSetUpdate upd = UnoRuntime.queryInterface( XResultSetUpdate.class, m_resultSet );
testCursorMove(upd, cupd.getMethod("moveToInsertRow", (Class[]) null), pRow, moves, null);
@@ -445,7 +445,7 @@ public class RowSet extends TestCase
moves[RowSetEventListener.COLUMN_VALUE] = true;
moves[RowSetEventListener.CURSOR_MOVED] = true;
- final Class cloc = Class.forName("com.sun.star.sdbcx.XRowLocate");
+ final Class<?> cloc = Class.forName("com.sun.star.sdbcx.XRowLocate");
m_resultSet.first();
final Object bookmark = m_rowLocate.getBookmark();
m_resultSet.next();
@@ -470,7 +470,7 @@ public class RowSet extends TestCase
moves[RowSetEventListener.APPROVE_ROW_CHANGE] = true;
moves[RowSetEventListener.ROW_CHANGED] = true;
moves[RowSetEventListener.ROW_COUNT] = true;
- final Class cdelRows = Class.forName("com.sun.star.sdbcx.XDeleteRows");
+ final Class<?> cdelRows = Class.forName("com.sun.star.sdbcx.XDeleteRows");
ctemp[0] = Object[].class;
final XDeleteRows delRows = UnoRuntime.queryInterface( XDeleteRows.class, m_resultSet );
final Object bookmarks[] = new Object[5];
diff --git a/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java b/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java
index 2d05030b7e83..656b44d00c04 100644
--- a/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java
+++ b/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java
@@ -81,7 +81,7 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase
String realValue = null;
try
{
- final Class composerClass = m_composer.getClass();
+ final Class<?> composerClass = m_composer.getClass();
final Method attributeGetter = composerClass.getMethod("get" + _attributeName, new Class[]
{
});
diff --git a/dbaccess/qa/complex/dbaccess/TestCase.java b/dbaccess/qa/complex/dbaccess/TestCase.java
index a9768e7b47a2..8c284ae51f40 100644
--- a/dbaccess/qa/complex/dbaccess/TestCase.java
+++ b/dbaccess/qa/complex/dbaccess/TestCase.java
@@ -119,7 +119,7 @@ public abstract class TestCase
private void assureException( final String _message, final Object _object, final String _methodName,
final Class[] _argClasses, final Object[] _methodArgs, final Class _expectedExceptionClass )
{
- Class objectClass = _object.getClass();
+ Class<?> objectClass = _object.getClass();
boolean noExceptionAllowed = ( _expectedExceptionClass == null );
diff --git a/dbaccess/qa/extras/dialog-save.cxx b/dbaccess/qa/extras/dialog-save.cxx
index 1eb4720cbcd1..04c12b1c5e8b 100644
--- a/dbaccess/qa/extras/dialog-save.cxx
+++ b/dbaccess/qa/extras/dialog-save.cxx
@@ -10,17 +10,13 @@
#include <sal/config.h>
#include <test/unoapi_test.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/document/XEmbeddedScripts.hpp>
#include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
#include <com/sun/star/script/XLibraryContainer.hpp>
#include <com/sun/star/util/XModifiable.hpp>
-#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <vcl/svapp.hxx>
-
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -49,24 +45,18 @@ DialogSaveTest::DialogSaveTest()
void DialogSaveTest::test()
{
- // UnoApiTest::setUp (via InitVCL) puts each test under a locked SolarMutex,
- // but at least the below xDocCloseable->close call could lead to a deadlock
- // then, and it looks like none of the code here requires the SolarMutex to
- // be locked anyway:
- SolarMutexReleaser rel;
-
const OUString aFileName(m_directories.getURLFromWorkdir(u"CppunitTest/testDialogSave.odb"));
{
- uno::Reference< lang::XComponent > xComponent = loadFromDesktop(aFileName);
- uno::Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW);
- uno::Reference< document::XEmbeddedScripts > xDocScr(xComponent, UNO_QUERY_THROW);
+ mxComponent = loadFromDesktop(aFileName);
+ uno::Reference< frame::XStorable > xDocStorable(mxComponent, UNO_QUERY_THROW);
+ uno::Reference< document::XEmbeddedScripts > xDocScr(mxComponent, UNO_QUERY_THROW);
uno::Reference< script::XStorageBasedLibraryContainer > xStorBasLib(xDocScr->getBasicLibraries());
CPPUNIT_ASSERT(xStorBasLib.is());
uno::Reference< script::XLibraryContainer > xBasLib(xStorBasLib, UNO_QUERY_THROW);
uno::Reference< script::XStorageBasedLibraryContainer > xStorDlgLib(xDocScr->getDialogLibraries());
CPPUNIT_ASSERT(xStorDlgLib.is());
uno::Reference< script::XLibraryContainer > xDlgLib(xStorDlgLib, UNO_QUERY_THROW);
- static const OUStringLiteral sStandard(u"Standard");
+ static constexpr OUString sStandard(u"Standard"_ustr);
xBasLib->loadLibrary(sStandard);
CPPUNIT_ASSERT(xBasLib->isLibraryLoaded(sStandard));
// the whole point of this test is to test the "save" operation
@@ -74,26 +64,21 @@ void DialogSaveTest::test()
CPPUNIT_ASSERT(!xDlgLib->isLibraryLoaded(sStandard));
// make some change to enable a save
- // uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSuppl(xComponent, UNO_QUERY_THROW);
+ // uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSuppl(mxComponent, UNO_QUERY_THROW);
// uno::Reference< document::XDocumentPropertiesSupplier > xDocProps(xDocPropSuppl->getDocumentProperties());
// CPPUNIT_ASSERT(xDocProps.is());
// xDocProps.setTitle(xDocProps.getTitle() + " suffix");
- uno::Reference< util::XModifiable > xDocMod(xComponent, UNO_QUERY_THROW);
+ uno::Reference< util::XModifiable > xDocMod(mxComponent, UNO_QUERY_THROW);
xDocMod->setModified(true);
// now save; the code path to exercise in this test is the "store to same location"
// do *not* change to store(As|To|URL)!
xDocStorable->store();
- // close
- uno::Reference< util::XCloseable > xDocCloseable(xComponent, UNO_QUERY_THROW);
- xDocCloseable->close(false);
-
// All our uno::References are (should?) be invalid now -> let them go out of scope
}
{
- uno::Sequence<uno::Any> args(1);
- args[0] <<= aFileName;
+ uno::Sequence<uno::Any> args{ uno::Any(aFileName) };
Reference<container::XHierarchicalNameAccess> xHNA(getMultiServiceFactory()->createInstanceWithArguments("com.sun.star.packages.Package", args), UNO_QUERY_THROW);
Reference< beans::XPropertySet > xPS(xHNA->getByHierarchicalName("Dialogs/Standard/Dialog1.xml"), UNO_QUERY_THROW);
sal_Int64 nSize = 0;
diff --git a/dbaccess/qa/extras/empty-stdlib-save.cxx b/dbaccess/qa/extras/empty-stdlib-save.cxx
index 9339d3c4307e..5c3b5d028d8c 100644
--- a/dbaccess/qa/extras/empty-stdlib-save.cxx
+++ b/dbaccess/qa/extras/empty-stdlib-save.cxx
@@ -9,16 +9,12 @@
#include <sal/config.h>
#include <test/unoapi_test.hxx>
-#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/document/XEmbeddedScripts.hpp>
#include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
#include <com/sun/star/script/XLibraryContainer.hpp>
-#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <vcl/svapp.hxx>
-
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -47,24 +43,18 @@ DialogSaveTest::DialogSaveTest()
void DialogSaveTest::test()
{
- // UnoApiTest::setUp (via InitVCL) puts each test under a locked SolarMutex,
- // but at least the below xDocCloseable->close call could lead to a deadlock
- // then, and it looks like none of the code here requires the SolarMutex to
- // be locked anyway:
- SolarMutexReleaser rel;
-
const OUString aFileName(m_directories.getURLFromWorkdir(u"CppunitTest/testEmptyStdlibSave.odb"));
{
- uno::Reference< lang::XComponent > xComponent = loadFromDesktop(aFileName);
- uno::Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW);
- uno::Reference< document::XEmbeddedScripts > xDocScr(xComponent, UNO_QUERY_THROW);
+ mxComponent = loadFromDesktop(aFileName);
+ uno::Reference< frame::XStorable > xDocStorable(mxComponent, UNO_QUERY_THROW);
+ uno::Reference< document::XEmbeddedScripts > xDocScr(mxComponent, UNO_QUERY_THROW);
uno::Reference< script::XStorageBasedLibraryContainer > xStorBasLib(xDocScr->getBasicLibraries());
CPPUNIT_ASSERT(xStorBasLib.is());
uno::Reference< script::XLibraryContainer > xBasLib(xStorBasLib, UNO_QUERY_THROW);
uno::Reference< script::XStorageBasedLibraryContainer > xStorDlgLib(xDocScr->getDialogLibraries());
CPPUNIT_ASSERT(xStorDlgLib.is());
uno::Reference< script::XLibraryContainer > xDlgLib(xStorDlgLib, UNO_QUERY_THROW);
- static const OUStringLiteral sStandard(u"Standard");
+ static constexpr OUString sStandard(u"Standard"_ustr);
xBasLib->loadLibrary(sStandard);
xDlgLib->loadLibrary(sStandard);
CPPUNIT_ASSERT(xBasLib->isLibraryLoaded(sStandard));
@@ -89,7 +79,7 @@ void DialogSaveTest::test()
// uno::Reference< util::XModifiable > xScrMod(xDocScr, UNO_QUERY_THROW);
// xScrMod->setModified(sal_True);
- // uno::Reference< util::XModifiable > xDocMod(xComponent, UNO_QUERY_THROW);
+ // uno::Reference< util::XModifiable > xDocMod(mxComponent, UNO_QUERY_THROW);
// std::cerr << "** Modified: " << static_cast<bool>(xDocMod->isModified()) << std::endl;
// xDocMod->setModified(sal_True);
// std::cerr << "** Modified: " << static_cast<bool>(xDocMod->isModified()) << std::endl;
@@ -99,15 +89,10 @@ void DialogSaveTest::test()
// do *not* change to store(As|To|URL)!
xDocStorable->store();
- // close
- uno::Reference< util::XCloseable > xDocCloseable(xComponent, UNO_QUERY_THROW);
- xDocCloseable->close(false);
-
// All our uno::References are (should?) be invalid now -> let them go out of scope
}
{
- uno::Sequence<uno::Any> args(1);
- args[0] <<= aFileName;
+ uno::Sequence<uno::Any> args{ uno::Any(aFileName) };
Reference<container::XHierarchicalNameAccess> xHNA(getMultiServiceFactory()->createInstanceWithArguments("com.sun.star.packages.Package", args), UNO_QUERY_THROW);
CPPUNIT_ASSERT(!xHNA->hasByHierarchicalName("Basic/Standard"));
CPPUNIT_ASSERT(!xHNA->hasByHierarchicalName("Dialogs/Standard"));
diff --git a/dbaccess/qa/extras/hsql_schema_import.cxx b/dbaccess/qa/extras/hsql_schema_import.cxx
index 6d714ae9a8ae..f5f34d38b69a 100644
--- a/dbaccess/qa/extras/hsql_schema_import.cxx
+++ b/dbaccess/qa/extras/hsql_schema_import.cxx
@@ -62,7 +62,7 @@ public:
void HsqlSchemaImportTest::testIntegerPrimaryKeyNotNull()
{
FbCreateStmtParser aCreateParser;
- aCreateParser.parse("CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY)");
+ aCreateParser.parse(u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY)");
CPPUNIT_ASSERT_EQUAL(OUString{ "\"myTable\"" }, aCreateParser.getTableName());
const auto& columns = aCreateParser.getColumnDef();
@@ -79,7 +79,7 @@ void HsqlSchemaImportTest::testVarcharWithParam()
{
FbCreateStmtParser aCreateParser;
aCreateParser.parse(
- "CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, \"myText\" "
+ u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, \"myText\" "
"VARCHAR(50))");
const auto& columns = aCreateParser.getColumnDef();
@@ -101,7 +101,7 @@ void HsqlSchemaImportTest::testVarcharWithoutParam()
{
FbCreateStmtParser aCreateParser;
aCreateParser.parse(
- "CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, \"myText\" "
+ u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, \"myText\" "
"VARCHAR)");
const auto& columns = aCreateParser.getColumnDef();
@@ -116,7 +116,7 @@ void HsqlSchemaImportTest::testNumericWithTwoParam()
{
FbCreateStmtParser aCreateParser;
aCreateParser.parse(
- "CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, \"Betrag\" "
+ u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, \"Betrag\" "
"NUMERIC(8,2))");
const auto& columns = aCreateParser.getColumnDef();
@@ -137,7 +137,7 @@ void HsqlSchemaImportTest::testIntegerAutoincremental()
{
FbCreateStmtParser aCreateParser;
aCreateParser.parse(
- "CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY GENERATED "
+ u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY GENERATED "
"BY DEFAULT AS IDENTITY(START WITH 0), \"myText\" VARCHAR(50))");
const auto& columns = aCreateParser.getColumnDef();
@@ -157,7 +157,7 @@ void HsqlSchemaImportTest::testTimestampWithParam()
{
FbCreateStmtParser aCreateParser;
aCreateParser.parse(
- "CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, \"myText\" "
+ u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, \"myText\" "
"TIMESTAMP(0))");
const auto& columns = aCreateParser.getColumnDef();
@@ -179,7 +179,7 @@ void HsqlSchemaImportTest::testDefaultValueNow()
{
FbCreateStmtParser aCreateParser;
aCreateParser.parse(
- "CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, \"myDate\" "
+ u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, \"myDate\" "
"TIMESTAMP DEFAULT NOW)");
const auto& columns = aCreateParser.getColumnDef();
@@ -194,7 +194,7 @@ void HsqlSchemaImportTest::testDefaultValueNow()
void HsqlSchemaImportTest::testEvilNullColumnName()
{
FbCreateStmtParser aCreateParser;
- aCreateParser.parse("CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, "
+ aCreateParser.parse(u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, "
"\"myEvilNOT NULLName\" "
"VARCHAR(20))");
diff --git a/dbaccess/qa/extras/macros-test.cxx b/dbaccess/qa/extras/macros-test.cxx
index dee5919c3463..c2f75fa3c8f6 100644
--- a/dbaccess/qa/extras/macros-test.cxx
+++ b/dbaccess/qa/extras/macros-test.cxx
@@ -9,10 +9,8 @@
#include <sal/config.h>
#include <test/unoapi_test.hxx>
-#include <com/sun/star/util/XCloseable.hpp>
using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
#if !defined(MACOSX) && !defined(_WIN32)
@@ -33,14 +31,7 @@ DBAccessTest::DBAccessTest()
{
}
-void DBAccessTest::test()
-{
- OUString aFileName;
- createFileURL(u"testdb.odb", aFileName);
- uno::Reference<lang::XComponent> xComponent = loadFromDesktop(aFileName);
- uno::Reference<util::XCloseable> xDocCloseable(xComponent, UNO_QUERY_THROW);
- xDocCloseable->close(false);
-}
+void DBAccessTest::test() { loadFromFile(u"testdb.odb"); }
CPPUNIT_TEST_SUITE_REGISTRATION(DBAccessTest);
diff --git a/dbaccess/qa/extras/nolib-save.cxx b/dbaccess/qa/extras/nolib-save.cxx
index f441b608b31e..614c4f03794a 100644
--- a/dbaccess/qa/extras/nolib-save.cxx
+++ b/dbaccess/qa/extras/nolib-save.cxx
@@ -9,16 +9,12 @@
#include <sal/config.h>
#include <test/unoapi_test.hxx>
-#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/document/XEmbeddedScripts.hpp>
#include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
#include <com/sun/star/script/XLibraryContainer.hpp>
-#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <vcl/svapp.hxx>
-
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -47,24 +43,18 @@ DialogSaveTest::DialogSaveTest()
void DialogSaveTest::test()
{
- // UnoApiTest::setUp (via InitVCL) puts each test under a locked SolarMutex,
- // but at least the below xDocCloseable->close call could lead to a deadlock
- // then, and it looks like none of the code here requires the SolarMutex to
- // be locked anyway:
- SolarMutexReleaser rel;
-
const OUString aFileName(m_directories.getURLFromWorkdir(u"CppunitTest/testNolibSave.odb"));
{
- uno::Reference< lang::XComponent > xComponent = loadFromDesktop(aFileName);
- uno::Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW);
- uno::Reference< document::XEmbeddedScripts > xDocScr(xComponent, UNO_QUERY_THROW);
+ mxComponent = loadFromDesktop(aFileName);
+ uno::Reference< frame::XStorable > xDocStorable(mxComponent, UNO_QUERY_THROW);
+ uno::Reference< document::XEmbeddedScripts > xDocScr(mxComponent, UNO_QUERY_THROW);
uno::Reference< script::XStorageBasedLibraryContainer > xStorBasLib(xDocScr->getBasicLibraries());
CPPUNIT_ASSERT(xStorBasLib.is());
uno::Reference< script::XLibraryContainer > xBasLib(xStorBasLib, UNO_QUERY_THROW);
uno::Reference< script::XStorageBasedLibraryContainer > xStorDlgLib(xDocScr->getDialogLibraries());
CPPUNIT_ASSERT(xStorDlgLib.is());
uno::Reference< script::XLibraryContainer > xDlgLib(xStorDlgLib, UNO_QUERY_THROW);
- static const OUStringLiteral sStandard(u"Standard");
+ static constexpr OUString sStandard(u"Standard"_ustr);
xBasLib->loadLibrary(sStandard);
xDlgLib->loadLibrary(sStandard);
CPPUNIT_ASSERT(xBasLib->isLibraryLoaded(sStandard));
@@ -79,7 +69,7 @@ void DialogSaveTest::test()
// uno::Reference< util::XModifiable > xScrMod(xDocScr, UNO_QUERY_THROW);
// xScrMod->setModified(sal_True);
- // uno::Reference< util::XModifiable > xDocMod(xComponent, UNO_QUERY_THROW);
+ // uno::Reference< util::XModifiable > xDocMod(mxComponent, UNO_QUERY_THROW);
// std::cerr << "** Modified: " << static_cast<bool>(xDocMod->isModified()) << std::endl;
// xDocMod->setModified(sal_True);
// std::cerr << "** Modified: " << static_cast<bool>(xDocMod->isModified()) << std::endl;
@@ -89,15 +79,10 @@ void DialogSaveTest::test()
// do *not* change to store(As|To|URL)!
xDocStorable->store();
- // close
- uno::Reference< util::XCloseable > xDocCloseable(xComponent, UNO_QUERY_THROW);
- xDocCloseable->close(false);
-
// All our uno::References are (should?) be invalid now -> let them go out of scope
}
{
- uno::Sequence<uno::Any> args(1);
- args[0] <<= aFileName;
+ uno::Sequence<uno::Any> args{ uno::Any(aFileName) };
Reference<container::XHierarchicalNameAccess> xHNA(getMultiServiceFactory()->createInstanceWithArguments("com.sun.star.packages.Package", args), UNO_QUERY_THROW);
CPPUNIT_ASSERT(!xHNA->hasByHierarchicalName("Basic/Standard"));
CPPUNIT_ASSERT(!xHNA->hasByHierarchicalName("Dialogs/Standard"));
diff --git a/dbaccess/qa/extras/rowsetclones.cxx b/dbaccess/qa/extras/rowsetclones.cxx
index 21a30636961b..88afad9eab9e 100644
--- a/dbaccess/qa/extras/rowsetclones.cxx
+++ b/dbaccess/qa/extras/rowsetclones.cxx
@@ -10,7 +10,6 @@
#include <sal/config.h>
#include <test/unoapi_test.hxx>
#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
@@ -25,7 +24,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
class RowSetClones : public UnoApiTest
{
@@ -50,9 +48,8 @@ void RowSetClones::test()
{
const OUString sFilePath(m_directories.getURLFromWorkdir(u"CppunitTest/RowSetClones.odb"));
- uno::Reference< lang::XComponent > xComponent (loadFromDesktop(sFilePath));
- uno::Reference< XOfficeDatabaseDocument > xDocument(xComponent, UNO_QUERY);
- CPPUNIT_ASSERT(xDocument.is());
+ mxComponent = loadFromDesktop(sFilePath);
+ uno::Reference< XOfficeDatabaseDocument > xDocument(mxComponent, UNO_QUERY_THROW);
uno::Reference< XDataSource > xDataSource = xDocument->getDataSource();
CPPUNIT_ASSERT(xDataSource.is());
@@ -123,8 +120,6 @@ void RowSetClones::test()
CPPUNIT_ASSERT(xResultSetClone->isLast());
CPPUNIT_ASSERT(xResultSet->isFirst());
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xRow->getInt(1));
-
- closeDocument(uno::Reference<lang::XComponent>(xDocument, uno::UNO_QUERY));
}
CPPUNIT_TEST_SUITE_REGISTRATION(RowSetClones);
diff --git a/dbaccess/qa/python/fdo84315.py b/dbaccess/qa/python/fdo84315.py
index f58b16f51309..680ba7495c3b 100644
--- a/dbaccess/qa/python/fdo84315.py
+++ b/dbaccess/qa/python/fdo84315.py
@@ -10,7 +10,6 @@
import os
import unittest
from collections import deque
-import unohelper
from org.libreoffice.unotest import UnoInProcess
class Fdo84315(unittest.TestCase):
@@ -67,7 +66,7 @@ class Fdo84315(unittest.TestCase):
xResultset = xStatement.executeQuery('SELECT "id" FROM "test_table"')
expected_values = deque([0, 1])
- xMeta = self.__test_Query('id', INTEGER, xResultset)
+ self.__test_Query('id', INTEGER, xResultset)
self.__test_ResultSetInteger(xResultset, expected_values)
xCon.dispose()
diff --git a/dbaccess/qa/unit/data/tdf132924.odb b/dbaccess/qa/unit/data/tdf132924.odb
new file mode 100644
index 000000000000..8cee7bcbabfd
--- /dev/null
+++ b/dbaccess/qa/unit/data/tdf132924.odb
Binary files differ
diff --git a/dbaccess/qa/unit/dbtest_base.cxx b/dbaccess/qa/unit/dbtest_base.cxx
index c7992288cdbd..88da4b469742 100644
--- a/dbaccess/qa/unit/dbtest_base.cxx
+++ b/dbaccess/qa/unit/dbtest_base.cxx
@@ -30,11 +30,6 @@ class DBTestBase
public:
DBTestBase() : UnoApiTest("dbaccess/qa/unit/data") {};
- utl::TempFile createTempCopy(std::u16string_view pathname);
-
- uno::Reference< XOfficeDatabaseDocument >
- getDocumentForFileName(std::u16string_view sFileName);
-
uno::Reference<XOfficeDatabaseDocument> getDocumentForUrl(OUString const & url);
uno::Reference< XConnection >
@@ -42,34 +37,9 @@ public:
uno::Reference< XOfficeDatabaseDocument > const & xDocument);
};
-utl::TempFile DBTestBase::createTempCopy(std::u16string_view pathname) {
- OUString url;
- createFileURL(pathname, url);
- utl::TempFile tmp;
- tmp.EnableKillingFile();
- auto const e = osl::File::copy(url, tmp.GetURL());
- CPPUNIT_ASSERT_EQUAL_MESSAGE(
- (OString(
- "<" + OUStringToOString(url, RTL_TEXTENCODING_UTF8) + "> -> <"
- + OUStringToOString(tmp.GetURL(), RTL_TEXTENCODING_UTF8) + ">")
- .getStr()),
- osl::FileBase::E_None, e);
- return tmp;
-}
-
-uno::Reference< XOfficeDatabaseDocument >
- DBTestBase::getDocumentForFileName(std::u16string_view sFileName)
-{
- OUString sFilePath;
- createFileURL(sFileName, sFilePath);
- return getDocumentForUrl(sFilePath);
-}
-
uno::Reference<XOfficeDatabaseDocument> DBTestBase::getDocumentForUrl(OUString const & url) {
- uno::Reference< lang::XComponent > xComponent (loadFromDesktop(url));
- uno::Reference< XOfficeDatabaseDocument > xDocument(xComponent, UNO_QUERY);
- CPPUNIT_ASSERT(xDocument.is());
-
+ mxComponent = loadFromDesktop(url);
+ uno::Reference< XOfficeDatabaseDocument > xDocument(mxComponent, UNO_QUERY_THROW);
return xDocument;
}
diff --git a/dbaccess/qa/unit/embeddeddb_performancetest.cxx b/dbaccess/qa/unit/embeddeddb_performancetest.cxx
index 17eaa52aeb9d..184ef0831ad1 100644
--- a/dbaccess/qa/unit/embeddeddb_performancetest.cxx
+++ b/dbaccess/qa/unit/embeddeddb_performancetest.cxx
@@ -82,7 +82,7 @@ class EmbeddedDBPerformanceTest
: public DBTestBase
{
private:
- static constexpr OUStringLiteral our_sEnableTestEnvVar = u"DBA_PERFTEST";
+ static constexpr OUString our_sEnableTestEnvVar = u"DBA_PERFTEST"_ustr;
// We store the results and print them at the end due to the amount of warning
@@ -124,8 +124,7 @@ public:
SvFileStream* EmbeddedDBPerformanceTest::getWordListStream()
{
- OUString wlPath;
- createFileURL(u"wordlist", wlPath);
+ OUString wlPath = createFileURL(u"wordlist");
return new SvFileStream(wlPath, StreamMode::READ);
}
@@ -146,7 +145,7 @@ void EmbeddedDBPerformanceTest::printTimes(
void EmbeddedDBPerformanceTest::testPerformance()
{
OUString sEnabled;
- osl_getEnvironment(OUString(our_sEnableTestEnvVar).pData, &sEnabled.pData);
+ osl_getEnvironment(our_sEnableTestEnvVar.pData, &sEnabled.pData);
if (sEnabled.isEmpty())
return;
@@ -195,7 +194,7 @@ void EmbeddedDBPerformanceTest::doPerformanceTestOnODB(
std::u16string_view rDBName,
const bool bUsePreparedStatement)
{
- ::utl::TempFile aFile;
+ ::utl::TempFileNamed aFile;
aFile.EnableKillingFile();
{
diff --git a/dbaccess/qa/unit/firebird.cxx b/dbaccess/qa/unit/firebird.cxx
index e67a4d10c097..1b6b7172fdbd 100644
--- a/dbaccess/qa/unit/firebird.cxx
+++ b/dbaccess/qa/unit/firebird.cxx
@@ -15,6 +15,7 @@
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XStatement.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
using namespace ::com::sun::star;
using namespace ::com::sun::star::sdb;
@@ -27,10 +28,12 @@ class FirebirdTest
public:
void testEmptyDBConnection();
void testIntegerDatabase();
+ void testTdf132924();
CPPUNIT_TEST_SUITE(FirebirdTest);
CPPUNIT_TEST(testEmptyDBConnection);
CPPUNIT_TEST(testIntegerDatabase);
+ CPPUNIT_TEST(testTdf132924);
CPPUNIT_TEST_SUITE_END();
};
@@ -40,13 +43,14 @@ public:
*/
void FirebirdTest::testEmptyDBConnection()
{
- auto const tmp = createTempCopy(u"firebird_empty.odb");
+ createTempCopy(u"firebird_empty.odb");
uno::Reference< XOfficeDatabaseDocument > xDocument =
- getDocumentForUrl(tmp.GetURL());
+ getDocumentForUrl(maTempFile.GetURL());
getConnectionForDocument(xDocument);
- closeDocument(uno::Reference<lang::XComponent>(xDocument, uno::UNO_QUERY));
+ css::uno::Reference<util::XCloseable> xCloseable(mxComponent, css::uno::UNO_QUERY_THROW);
+ xCloseable->close(false);
}
/**
@@ -55,8 +59,8 @@ void FirebirdTest::testEmptyDBConnection()
*/
void FirebirdTest::testIntegerDatabase()
{
- uno::Reference< XOfficeDatabaseDocument > xDocument =
- getDocumentForFileName(u"firebird_integer_ods12.odb");
+ loadFromFile(u"firebird_integer_ods12.odb");
+ uno::Reference< XOfficeDatabaseDocument > xDocument(mxComponent, UNO_QUERY_THROW);
uno::Reference< XConnection > xConnection =
getConnectionForDocument(xDocument);
@@ -87,7 +91,36 @@ void FirebirdTest::testIntegerDatabase()
CPPUNIT_ASSERT(!xResultSet->next()); // Should only be one row
- closeDocument(uno::Reference<lang::XComponent>(xDocument, uno::UNO_QUERY));
+ css::uno::Reference<util::XCloseable> xCloseable(mxComponent, css::uno::UNO_QUERY_THROW);
+ xCloseable->close(false);
+}
+
+void FirebirdTest::testTdf132924()
+{
+ loadFromFile(u"tdf132924.odb");
+ uno::Reference< XOfficeDatabaseDocument > xDocument(mxComponent, UNO_QUERY_THROW);
+ uno::Reference<XConnection> xConnection = getConnectionForDocument(xDocument);
+
+ uno::Reference<XStatement> xStatement = xConnection->createStatement();
+ CPPUNIT_ASSERT(xStatement.is());
+
+ uno::Reference<XResultSet> xResultSet = xStatement->executeQuery("SELECT * FROM AliasTest");
+ CPPUNIT_ASSERT(xResultSet.is());
+ CPPUNIT_ASSERT(xResultSet->next());
+
+ uno::Reference<XRow> xRow(xResultSet, UNO_QUERY);
+ CPPUNIT_ASSERT(xRow.is());
+ uno::Reference<XColumnLocate> xColumnLocate(xRow, UNO_QUERY);
+ CPPUNIT_ASSERT(xColumnLocate.is());
+
+ // Without the fix in place, this test would have failed with:
+ // - Expected: 1
+ // - Actual : The column name 'TestId' is not valid
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xRow->getShort(xColumnLocate->findColumn("TestId")));
+ CPPUNIT_ASSERT_EQUAL(OUString("TestName"), xRow->getString(xColumnLocate->findColumn("TestName")));
+
+ css::uno::Reference<util::XCloseable> xCloseable(mxComponent, css::uno::UNO_QUERY_THROW);
+ xCloseable->close(false);
}
CPPUNIT_TEST_SUITE_REGISTRATION(FirebirdTest);
diff --git a/dbaccess/qa/unit/hsql_binary_import.cxx b/dbaccess/qa/unit/hsql_binary_import.cxx
index 4eac0cdc4130..569463e7e4ef 100644
--- a/dbaccess/qa/unit/hsql_binary_import.cxx
+++ b/dbaccess/qa/unit/hsql_binary_import.cxx
@@ -46,8 +46,9 @@ void HsqlBinaryImportTest::testBinaryImport()
}
// the migration requires the file to be writable
- utl::TempFile const temp(createTempCopy(u"hsqldb_migration_test.odb"));
- uno::Reference<XOfficeDatabaseDocument> const xDocument = getDocumentForUrl(temp.GetURL());
+ createTempCopy(u"hsqldb_migration_test.odb");
+ uno::Reference<XOfficeDatabaseDocument> const xDocument
+ = getDocumentForUrl(maTempFile.GetURL());
uno::Reference<XConnection> xConnection = getConnectionForDocument(xDocument);
// at this point migration is already done
@@ -86,7 +87,6 @@ void HsqlBinaryImportTest::testBinaryImport()
CPPUNIT_ASSERT_EQUAL(sal_uInt16{ 2 }, date.Month);
CPPUNIT_ASSERT_EQUAL(sal_Int16{ 1998 }, date.Year);
- closeDocument(uno::Reference<lang::XComponent>(xDocument, uno::UNO_QUERY));
if (!oldValue)
{
std::shared_ptr<comphelper::ConfigurationChanges> xChanges(
diff --git a/dbaccess/qa/unit/hsqldb.cxx b/dbaccess/qa/unit/hsqldb.cxx
index 5ee011af276e..eb553eac756e 100644
--- a/dbaccess/qa/unit/hsqldb.cxx
+++ b/dbaccess/qa/unit/hsqldb.cxx
@@ -32,12 +32,10 @@ public:
*/
void HSQLDBTest::testEmptyDBConnection()
{
- auto const file = createTempCopy(u"hsqldb_empty.odb");
- uno::Reference<XOfficeDatabaseDocument> xDocument = getDocumentForUrl(file.GetURL());
+ createTempCopy(u"hsqldb_empty.odb");
+ uno::Reference<XOfficeDatabaseDocument> xDocument = getDocumentForUrl(maTempFile.GetURL());
getConnectionForDocument(xDocument);
-
- css::uno::Reference<css::lang::XComponent>(xDocument, css::uno::UNO_QUERY_THROW)->dispose();
}
CPPUNIT_TEST_SUITE_REGISTRATION(HSQLDBTest);
diff --git a/dbaccess/qa/unit/tdf119625.cxx b/dbaccess/qa/unit/tdf119625.cxx
index 22fb5849305e..ba0c7b2ce345 100644
--- a/dbaccess/qa/unit/tdf119625.cxx
+++ b/dbaccess/qa/unit/tdf119625.cxx
@@ -66,8 +66,9 @@ void Tdf119625Test::testTime()
}
// the migration requires the file to be writable
- utl::TempFile const temp(createTempCopy(u"tdf119625.odb"));
- uno::Reference<XOfficeDatabaseDocument> const xDocument = getDocumentForUrl(temp.GetURL());
+ createTempCopy(u"tdf119625.odb");
+ uno::Reference<XOfficeDatabaseDocument> const xDocument
+ = getDocumentForUrl(maTempFile.GetURL());
uno::Reference<XConnection> xConnection = getConnectionForDocument(xDocument);
// at this point migration is already done
@@ -106,7 +107,6 @@ void Tdf119625Test::testTime()
}
CPPUNIT_ASSERT(!xRes->next());
- closeDocument(uno::Reference<lang::XComponent>(xDocument, uno::UNO_QUERY));
if (!oldValue)
{
std::shared_ptr<comphelper::ConfigurationChanges> xChanges(
diff --git a/dbaccess/qa/unit/tdf126268.cxx b/dbaccess/qa/unit/tdf126268.cxx
index a4ed9dc3b868..c06fdead79c7 100644
--- a/dbaccess/qa/unit/tdf126268.cxx
+++ b/dbaccess/qa/unit/tdf126268.cxx
@@ -60,8 +60,9 @@ void Tdf126268Test::testNumbers()
}
// the migration requires the file to be writable
- utl::TempFile const temp(createTempCopy(u"tdf126268.odb"));
- uno::Reference<XOfficeDatabaseDocument> const xDocument = getDocumentForUrl(temp.GetURL());
+ createTempCopy(u"tdf126268.odb");
+ uno::Reference<XOfficeDatabaseDocument> const xDocument
+ = getDocumentForUrl(maTempFile.GetURL());
uno::Reference<XConnection> xConnection = getConnectionForDocument(xDocument);
@@ -82,7 +83,6 @@ void Tdf126268Test::testNumbers()
}
CPPUNIT_ASSERT(!xRes->next());
- closeDocument(uno::Reference<lang::XComponent>(xDocument, uno::UNO_QUERY));
if (!oldValue)
{
std::shared_ptr<comphelper::ConfigurationChanges> xChanges(
diff --git a/dbaccess/source/core/api/BookmarkSet.cxx b/dbaccess/source/core/api/BookmarkSet.cxx
index b21d7cbbb666..75b369885e3b 100644
--- a/dbaccess/source/core/api/BookmarkSet.cxx
+++ b/dbaccess/source/core/api/BookmarkSet.cxx
@@ -27,12 +27,8 @@ using namespace dbaccess;
using namespace ::connectivity;
using namespace ::dbtools;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace ::osl;
void OBookmarkSet::construct(const Reference< XResultSet>& _xDriverSet,const OUString& i_sRowSetFilter)
{
@@ -142,56 +138,56 @@ void OBookmarkSet::updateColumn(sal_Int32 nPos, const Reference< XRowUpdate >& _
break;
case DataType::CHAR:
case DataType::VARCHAR:
- _xParameter->updateString(nPos,_rValue);
+ _xParameter->updateString(nPos,_rValue.getString());
break;
case DataType::BIGINT:
if ( _rValue.isSigned() )
- _xParameter->updateLong(nPos,_rValue);
+ _xParameter->updateLong(nPos,_rValue.getLong());
else
- _xParameter->updateString(nPos,_rValue);
+ _xParameter->updateString(nPos,_rValue.getString());
break;
case DataType::BIT:
case DataType::BOOLEAN:
- _xParameter->updateBoolean(nPos,bool(_rValue));
+ _xParameter->updateBoolean(nPos,_rValue.getBool());
break;
case DataType::TINYINT:
if ( _rValue.isSigned() )
- _xParameter->updateByte(nPos,_rValue);
+ _xParameter->updateByte(nPos,_rValue.getInt8());
else
- _xParameter->updateShort(nPos,_rValue);
+ _xParameter->updateShort(nPos,_rValue.getInt16());
break;
case DataType::SMALLINT:
if ( _rValue.isSigned() )
- _xParameter->updateShort(nPos,_rValue);
+ _xParameter->updateShort(nPos,_rValue.getInt16());
else
- _xParameter->updateInt(nPos,_rValue);
+ _xParameter->updateInt(nPos,_rValue.getInt32());
break;
case DataType::INTEGER:
if ( _rValue.isSigned() )
- _xParameter->updateInt(nPos,_rValue);
+ _xParameter->updateInt(nPos,_rValue.getInt32());
else
- _xParameter->updateLong(nPos,_rValue);
+ _xParameter->updateLong(nPos,_rValue.getLong());
break;
case DataType::FLOAT:
- _xParameter->updateFloat(nPos,_rValue);
+ _xParameter->updateFloat(nPos,_rValue.getFloat());
break;
case DataType::DOUBLE:
case DataType::REAL:
- _xParameter->updateDouble(nPos,_rValue);
+ _xParameter->updateDouble(nPos,_rValue.getDouble());
break;
case DataType::DATE:
- _xParameter->updateDate(nPos,_rValue);
+ _xParameter->updateDate(nPos,_rValue.getDate());
break;
case DataType::TIME:
- _xParameter->updateTime(nPos,_rValue);
+ _xParameter->updateTime(nPos,_rValue.getTime());
break;
case DataType::TIMESTAMP:
- _xParameter->updateTimestamp(nPos,_rValue);
+ _xParameter->updateTimestamp(nPos,_rValue.getDateTime());
break;
case DataType::BINARY:
case DataType::VARBINARY:
case DataType::LONGVARBINARY:
- _xParameter->updateBytes(nPos,_rValue);
+ _xParameter->updateBytes(nPos,_rValue.getSequence());
break;
case DataType::BLOB:
case DataType::CLOB:
diff --git a/dbaccess/source/core/api/CIndexes.cxx b/dbaccess/source/core/api/CIndexes.cxx
index 409d877288b8..9b3dd5aefa83 100644
--- a/dbaccess/source/core/api/CIndexes.cxx
+++ b/dbaccess/source/core/api/CIndexes.cxx
@@ -25,11 +25,8 @@ using namespace connectivity::sdbcx;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
using namespace dbaccess;
-using namespace cppu;
ObjectType OIndexes::createObject(const OUString& _rName)
diff --git a/dbaccess/source/core/api/CIndexes.hxx b/dbaccess/source/core/api/CIndexes.hxx
index f20da6cbefa9..d8dbeb82a8f6 100644
--- a/dbaccess/source/core/api/CIndexes.hxx
+++ b/dbaccess/source/core/api/CIndexes.hxx
@@ -20,6 +20,7 @@
#pragma once
#include <connectivity/TIndexes.hxx>
+#include <utility>
namespace dbaccess
{
@@ -35,9 +36,9 @@ namespace dbaccess
OIndexes(connectivity::OTableHelper* _pTable,
::osl::Mutex& _rMutex,
const std::vector< OUString> &_rVector,
- const css::uno::Reference< css::container::XNameAccess >& _rxIndexes
+ css::uno::Reference< css::container::XNameAccess > _rxIndexes
) : connectivity::OIndexesHelper(_pTable,_rMutex,_rVector)
- ,m_xIndexes(_rxIndexes)
+ ,m_xIndexes(std::move(_rxIndexes))
{}
virtual void disposing() override;
diff --git a/dbaccess/source/core/api/CRowSetColumn.cxx b/dbaccess/source/core/api/CRowSetColumn.cxx
index cef90a8e8521..98435b7c4498 100644
--- a/dbaccess/source/core/api/CRowSetColumn.cxx
+++ b/dbaccess/source/core/api/CRowSetColumn.cxx
@@ -19,9 +19,11 @@
#include <stringconstants.hxx>
-#include <apitools.hxx>
+#include <strings.hxx>
#include "CRowSetColumn.hxx"
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
@@ -42,31 +44,30 @@ ORowSetColumn::ORowSetColumn( const Reference < XResultSetMetaData >& _xMetaData
::cppu::IPropertyArrayHelper* ORowSetColumn::createArrayHelper( ) const
{
- BEGIN_PROPERTY_SEQUENCE(21)
-
- DECL_PROP1( CATALOGNAME, OUString, READONLY );
- DECL_PROP1( DISPLAYSIZE, sal_Int32, READONLY );
- DECL_PROP1_BOOL( ISAUTOINCREMENT, READONLY );
- DECL_PROP1_BOOL( ISCASESENSITIVE, READONLY );
- DECL_PROP1_BOOL( ISCURRENCY, READONLY );
- DECL_PROP1_BOOL( ISDEFINITELYWRITABLE, READONLY );
- DECL_PROP1( ISNULLABLE, sal_Int32, READONLY );
- DECL_PROP1_BOOL( ISREADONLY, BOUND );
- DECL_PROP1_BOOL( ISROWVERSION, READONLY );
- DECL_PROP1_BOOL( ISSEARCHABLE, READONLY );
- DECL_PROP1_BOOL( ISSIGNED, READONLY );
- DECL_PROP1_BOOL( ISWRITABLE, READONLY );
- DECL_PROP1( LABEL, OUString, READONLY );
- DECL_PROP1( PRECISION, sal_Int32, READONLY );
- DECL_PROP1( SCALE, sal_Int32, READONLY );
- DECL_PROP1( SCHEMANAME, OUString, READONLY );
- DECL_PROP1( SERVICENAME, OUString, READONLY );
- DECL_PROP1( TABLENAME, OUString, READONLY );
- DECL_PROP1( TYPE, sal_Int32, READONLY );
- DECL_PROP1( TYPENAME, OUString, READONLY );
- DECL_PROP2( VALUE, Any, READONLY, BOUND );
-
- END_PROPERTY_SEQUENCE()
+ css::uno::Sequence< css::beans::Property> aDescriptor
+ {
+ { PROPERTY_CATALOGNAME, PROPERTY_ID_CATALOGNAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_DISPLAYSIZE, PROPERTY_ID_DISPLAYSIZE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISAUTOINCREMENT, PROPERTY_ID_ISAUTOINCREMENT, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISCASESENSITIVE, PROPERTY_ID_ISCASESENSITIVE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISCURRENCY, PROPERTY_ID_ISCURRENCY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISDEFINITELYWRITABLE, PROPERTY_ID_ISDEFINITELYWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISNULLABLE, PROPERTY_ID_ISNULLABLE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISREADONLY, PROPERTY_ID_ISREADONLY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND },
+ { PROPERTY_ISROWVERSION, PROPERTY_ID_ISROWVERSION, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISSEARCHABLE, PROPERTY_ID_ISSEARCHABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISSIGNED, PROPERTY_ID_ISSIGNED, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISWRITABLE, PROPERTY_ID_ISWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_LABEL, PROPERTY_ID_LABEL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_PRECISION, PROPERTY_ID_PRECISION, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_SCALE, PROPERTY_ID_SCALE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_SCHEMANAME, PROPERTY_ID_SCHEMANAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_SERVICENAME, PROPERTY_ID_SERVICENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_TABLENAME, PROPERTY_ID_TABLENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_TYPE, PROPERTY_ID_TYPE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_TYPENAME, PROPERTY_ID_TYPENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_VALUE, PROPERTY_ID_VALUE, cppu::UnoType<Any>::get(), css::beans::PropertyAttribute::READONLY | css::beans::PropertyAttribute::BOUND}
+ };
Sequence< Property > aRegisteredProperties;
describeProperties( aRegisteredProperties );
diff --git a/dbaccess/source/core/api/CRowSetDataColumn.cxx b/dbaccess/source/core/api/CRowSetDataColumn.cxx
index f1d845e11517..693e1ad3dd75 100644
--- a/dbaccess/source/core/api/CRowSetDataColumn.cxx
+++ b/dbaccess/source/core/api/CRowSetDataColumn.cxx
@@ -20,11 +20,12 @@
#include "CRowSetDataColumn.hxx"
#include <stringconstants.hxx>
-#include <apitools.hxx>
+#include <strings.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <com/sun/star/sdbc/SQLException.hpp>
+#include <utility>
using namespace dbaccess;
using namespace comphelper;
@@ -34,7 +35,6 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::util;
using namespace cppu;
using namespace osl;
@@ -44,13 +44,13 @@ ORowSetDataColumn::ORowSetDataColumn( const Reference < XResultSetMetaData >& _x
const Reference < XRowUpdate >& _xRowUpdate,
sal_Int32 _nPos,
const Reference< XDatabaseMetaData >& _rxDBMeta,
- const OUString& _rDescription,
- const OUString& i_sLabel,
- const std::function<const ORowSetValue& (sal_Int32)> &_getValue)
+ OUString i_sDescription,
+ OUString i_sLabel,
+ std::function<const ORowSetValue& (sal_Int32)> _getValue)
:ODataColumn(_xMetaData,_xRow,_xRowUpdate,_nPos,_rxDBMeta)
- ,m_pGetValue(_getValue)
- ,m_sLabel(i_sLabel)
- ,m_aDescription(_rDescription)
+ ,m_pGetValue(std::move(_getValue))
+ ,m_sLabel(std::move(i_sLabel))
+ ,m_aDescription(std::move(i_sDescription))
{
OColumnSettings::registerProperties( *this );
registerProperty( PROPERTY_DESCRIPTION, PROPERTY_ID_DESCRIPTION, PropertyAttribute::READONLY, &m_aDescription, cppu::UnoType<decltype(m_aDescription)>::get() );
@@ -63,31 +63,30 @@ ORowSetDataColumn::~ORowSetDataColumn()
// comphelper::OPropertyArrayUsageHelper
::cppu::IPropertyArrayHelper* ORowSetDataColumn::createArrayHelper( ) const
{
- BEGIN_PROPERTY_SEQUENCE(21)
-
- DECL_PROP1( CATALOGNAME, OUString, READONLY );
- DECL_PROP1( DISPLAYSIZE, sal_Int32, READONLY );
- DECL_PROP1_BOOL( ISAUTOINCREMENT, READONLY );
- DECL_PROP1_BOOL( ISCASESENSITIVE, READONLY );
- DECL_PROP1_BOOL( ISCURRENCY, READONLY );
- DECL_PROP1_BOOL( ISDEFINITELYWRITABLE, READONLY );
- DECL_PROP1( ISNULLABLE, sal_Int32, READONLY );
- DECL_PROP1_BOOL( ISREADONLY, BOUND );
- DECL_PROP1_BOOL( ISROWVERSION, READONLY );
- DECL_PROP1_BOOL( ISSEARCHABLE, READONLY );
- DECL_PROP1_BOOL( ISSIGNED, READONLY );
- DECL_PROP1_BOOL( ISWRITABLE, READONLY );
- DECL_PROP1( LABEL, OUString, READONLY );
- DECL_PROP1( PRECISION, sal_Int32, READONLY );
- DECL_PROP1( SCALE, sal_Int32, READONLY );
- DECL_PROP1( SCHEMANAME, OUString, READONLY );
- DECL_PROP1( SERVICENAME, OUString, READONLY );
- DECL_PROP1( TABLENAME, OUString, READONLY );
- DECL_PROP1( TYPE, sal_Int32, READONLY );
- DECL_PROP1( TYPENAME, OUString, READONLY );
- DECL_PROP1( VALUE, Any, BOUND );
-
- END_PROPERTY_SEQUENCE()
+ css::uno::Sequence< css::beans::Property> aDescriptor
+ {
+ { PROPERTY_CATALOGNAME, PROPERTY_ID_CATALOGNAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_DISPLAYSIZE, PROPERTY_ID_DISPLAYSIZE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISAUTOINCREMENT, PROPERTY_ID_ISAUTOINCREMENT, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISCASESENSITIVE, PROPERTY_ID_ISCASESENSITIVE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISCURRENCY, PROPERTY_ID_ISCURRENCY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISDEFINITELYWRITABLE, PROPERTY_ID_ISDEFINITELYWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISNULLABLE, PROPERTY_ID_ISNULLABLE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISREADONLY, PROPERTY_ID_ISREADONLY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND },
+ { PROPERTY_ISROWVERSION, PROPERTY_ID_ISROWVERSION, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISSEARCHABLE, PROPERTY_ID_ISSEARCHABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISSIGNED, PROPERTY_ID_ISSIGNED, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISWRITABLE, PROPERTY_ID_ISWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_LABEL, PROPERTY_ID_LABEL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_PRECISION, PROPERTY_ID_PRECISION, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_SCALE, PROPERTY_ID_SCALE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_SCHEMANAME, PROPERTY_ID_SCHEMANAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_SERVICENAME, PROPERTY_ID_SERVICENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_TABLENAME, PROPERTY_ID_TABLENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_TYPE, PROPERTY_ID_TYPE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_TYPENAME, PROPERTY_ID_TYPENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_VALUE, PROPERTY_ID_VALUE, cppu::UnoType<Any>::get(), css::beans::PropertyAttribute::BOUND }
+ };
Sequence< Property > aRegisteredProperties;
describeProperties( aRegisteredProperties );
@@ -193,12 +192,12 @@ void ORowSetDataColumn::fireValueChange(const ORowSetValue& _rOldValue)
ORowSetDataColumns::ORowSetDataColumns(
bool _bCase,
- const ::rtl::Reference< ::connectivity::OSQLColumns>& _rColumns,
+ ::rtl::Reference< ::connectivity::OSQLColumns> _xColumns,
::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
const std::vector< OUString> &_rVector
) : connectivity::sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector)
- ,m_aColumns(_rColumns)
+ ,m_aColumns(std::move(_xColumns))
{
}
diff --git a/dbaccess/source/core/api/CRowSetDataColumn.hxx b/dbaccess/source/core/api/CRowSetDataColumn.hxx
index f0efcbf8d85c..a19aad8497e5 100644
--- a/dbaccess/source/core/api/CRowSetDataColumn.hxx
+++ b/dbaccess/source/core/api/CRowSetDataColumn.hxx
@@ -49,9 +49,9 @@ namespace dbaccess
const css::uno::Reference < css::sdbc::XRowUpdate >& _xRowUpdate,
sal_Int32 _nPos,
const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _rxDBMeta,
- const OUString& _rDescription,
- const OUString& i_sLabel,
- const std::function<const ::connectivity::ORowSetValue& (sal_Int32)> &_getValue);
+ OUString i_sDescription,
+ OUString i_sLabel,
+ std::function<const ::connectivity::ORowSetValue& (sal_Int32)> _getValue);
// css::lang::XTypeProvider
@@ -84,7 +84,7 @@ namespace dbaccess
public:
ORowSetDataColumns(
bool _bCase,
- const ::rtl::Reference< ::connectivity::OSQLColumns>& _rColumns,
+ ::rtl::Reference< ::connectivity::OSQLColumns> _xColumns,
::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
const std::vector< OUString> &_rVector
diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx
index 366a727be58d..dd266949cb7f 100644
--- a/dbaccess/source/core/api/CacheSet.cxx
+++ b/dbaccess/source/core/api/CacheSet.cxx
@@ -36,7 +36,7 @@
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
#include <osl/diagnose.h>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace comphelper;
@@ -50,7 +50,6 @@ using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::io;
-using namespace ::osl;
OCacheSet::OCacheSet(sal_Int32 i_nMaxRows)
@@ -167,7 +166,7 @@ void OCacheSet::insertRow( const ORowSetRow& _rInsertRow,const connectivity::OSQ
aSql[aSql.getLength() - 1] = ')';
aValues[aValues.getLength() - 1] = ')';
- aSql.append(aValues.makeStringAndClear());
+ aSql.append(aValues);
// now create end execute the prepared statement
{
Reference< XPreparedStatement > xPrep(m_xConnection->prepareStatement(aSql.makeStringAndClear()));
@@ -282,7 +281,7 @@ void OCacheSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOri
{
aCondition.setLength(aCondition.getLength()-5);
- aSql.append(" WHERE " + aCondition.makeStringAndClear());
+ aSql.append(" WHERE " + aCondition);
}
else
::dbtools::throwSQLException(
diff --git a/dbaccess/source/core/api/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx
index 3c923a706b8b..955a7f1c222f 100644
--- a/dbaccess/source/core/api/FilteredContainer.cxx
+++ b/dbaccess/source/core/api/FilteredContainer.cxx
@@ -26,7 +26,7 @@
#include <comphelper/types.hxx>
#include <connectivity/dbtools.hxx>
#include <tools/wldcrd.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <optional>
#include <sal/log.hxx>
@@ -34,12 +34,8 @@ namespace dbaccess
{
using namespace dbtools;
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::sdb;
- using namespace ::com::sun::star::sdbcx;
- using namespace ::com::sun::star::util;
using namespace ::com::sun::star::container;
using namespace ::osl;
using namespace ::comphelper;
@@ -117,8 +113,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::
TableInfo( const OUString& _catalog, const OUString& _schema, const OUString& _name,
const OUString& _type )
- :sComposedName()
- ,sType( _type )
+ :sType( _type )
,sCatalog( _catalog )
,sSchema( _schema )
,sName( _name )
@@ -133,7 +128,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::
static void lcl_ensureComposedName( TableInfo& _io_tableInfo, const Reference< XDatabaseMetaData >& _metaData )
{
if ( !_metaData.is() )
- throw RuntimeException();
+ throw RuntimeException("lcl_ensureComposedName: _metaData cannot be null!");
if ( !_io_tableInfo.sComposedName )
{
@@ -154,7 +149,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::
lcl_ensureComposedName( _io_tableInfo, _metaData );
if ( !_masterContainer.is() )
- throw RuntimeException();
+ throw RuntimeException("lcl_ensureType: _masterContainer cannot be null!");
OUString sTypeName;
try
@@ -169,7 +164,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::
_io_tableInfo.sType = OptionalString( sTypeName );
}
- static ::std::vector< OUString> lcl_filter( const TableInfos& _unfilteredTables,
+ static ::std::vector< OUString> lcl_filter( TableInfos&& _unfilteredTables,
const Sequence< OUString >& _tableFilter, const Sequence< OUString >& _tableTypeFilter,
const Reference< XDatabaseMetaData >& _metaData, const Reference< XNameAccess >& _masterContainer )
{
@@ -180,7 +175,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::
bool dontFilterTableNames = ( ( nTableFilterCount == 1 ) && _tableFilter[0] == "%" );
if( dontFilterTableNames )
{
- aFilteredTables = _unfilteredTables;
+ aFilteredTables = std::move(_unfilteredTables);
}
else
{
@@ -190,7 +185,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::
Sequence< OUString > aNonWildCardTableFilter = _tableFilter;
nTableFilterCount = createWildCardVector( aNonWildCardTableFilter, aWildCardTableFilter );
- TableInfos aUnfilteredTables( _unfilteredTables );
+ TableInfos aUnfilteredTables( std::move(_unfilteredTables) );
aUnfilteredTables.reserve( nTableFilterCount + ( aWildCardTableFilter.size() * 10 ) );
for (auto & unfilteredTable : aUnfilteredTables)
@@ -278,7 +273,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::
for ( ; name != nameEnd; ++name )
aUnfilteredTables.emplace_back( *name );
- reFill( lcl_filter( aUnfilteredTables,
+ reFill( lcl_filter( std::move(aUnfilteredTables),
_rTableFilter, _rTableTypeFilter, m_xMetaData, m_xMasterContainer ) );
m_bConstructed = true;
@@ -327,8 +322,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::
return;
}
}
- aTableTypeFilter.realloc( 1 );
- aTableTypeFilter[0] = sInherentTableTypeRestriction;
+ aTableTypeFilter = { sInherentTableTypeRestriction };
}
else
{
@@ -343,7 +337,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::
}
}
- static constexpr OUStringLiteral sAll = u"%";
+ static constexpr OUString sAll = u"%"_ustr;
Reference< XResultSet > xTables = m_xMetaData->getTables( Any(), sAll, sAll, aTableTypeFilter );
Reference< XRow > xCurrentRow( xTables, UNO_QUERY_THROW );
@@ -360,7 +354,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::
aUnfilteredTables.emplace_back( sCatalog, sSchema, sName, sType );
}
- reFill( lcl_filter( aUnfilteredTables,
+ reFill( lcl_filter( std::move(aUnfilteredTables),
_rTableFilter, aTableTypeFilter, m_xMetaData, nullptr ) );
disposeComponent( xTables );
@@ -432,9 +426,9 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::
OSL_VERIFY( aFilterModeSetting >>= nFilterMode );
}
- static const OUStringLiteral sAll( u"%" );
- static const OUStringLiteral sView( u"VIEW" );
- static const OUStringLiteral sTable( u"TABLE" );
+ static constexpr OUString sAll( u"%"_ustr );
+ static constexpr OUString sView( u"VIEW"_ustr );
+ static constexpr OUString sTable( u"TABLE"_ustr );
switch ( nFilterMode )
{
@@ -442,19 +436,13 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::
SAL_WARN("dbaccess", "OTableContainer::getAllTableTypeFilter: unknown TableTypeFilterMode!" );
[[fallthrough]];
case FILTER_MODE_MIX_ALL:
- _rFilter.realloc( 3 );
- _rFilter[0] = sView;
- _rFilter[1] = sTable;
- _rFilter[2] = sAll;
+ _rFilter = { sView, sTable, sAll };
break;
case FILTER_MODE_FIXED:
- _rFilter.realloc( 2 );
- _rFilter[0] = sView;
- _rFilter[1] = sTable;
+ _rFilter = { sView, sTable };
break;
case FILTER_MODE_WILDCARD:
- _rFilter.realloc( 1 );
- _rFilter[0] = sAll;
+ _rFilter = { sAll };
break;
case FILTER_MODE_STANDARD:
_rFilter.realloc( 0 );
diff --git a/dbaccess/source/core/api/HelperCollections.cxx b/dbaccess/source/core/api/HelperCollections.cxx
index dfc18badc688..2a04b632a7ce 100644
--- a/dbaccess/source/core/api/HelperCollections.cxx
+++ b/dbaccess/source/core/api/HelperCollections.cxx
@@ -20,6 +20,7 @@
#include "HelperCollections.hxx"
#include <strings.hxx>
+#include <utility>
#include <osl/diagnose.h>
@@ -30,23 +31,19 @@ namespace dbaccess
using namespace connectivity;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
- using namespace ::com::sun::star::sdbcx;
- using namespace ::com::sun::star::container;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::script;
using namespace ::cppu;
using namespace ::osl;
- OPrivateColumns::OPrivateColumns(const ::rtl::Reference< ::connectivity::OSQLColumns>& _rColumns,
+ OPrivateColumns::OPrivateColumns(::rtl::Reference< ::connectivity::OSQLColumns> _xColumns,
bool _bCase,
::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
const std::vector< OUString> &_rVector,
bool _bUseAsIndex
) : sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector,_bUseAsIndex)
- ,m_aColumns(_rColumns)
+ ,m_aColumns(std::move(_xColumns))
{
}
diff --git a/dbaccess/source/core/api/HelperCollections.hxx b/dbaccess/source/core/api/HelperCollections.hxx
index 18cf9d15ef93..2c066064de54 100644
--- a/dbaccess/source/core/api/HelperCollections.hxx
+++ b/dbaccess/source/core/api/HelperCollections.hxx
@@ -25,15 +25,10 @@
namespace dbaccess
{
using namespace dbtools;
- using namespace comphelper;
using namespace connectivity;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
- using namespace ::com::sun::star::sdbcx;
- using namespace ::com::sun::star::container;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::script;
using namespace ::cppu;
using namespace ::osl;
@@ -50,7 +45,7 @@ namespace dbaccess
return nullptr;
}
public:
- OPrivateColumns(const ::rtl::Reference< ::connectivity::OSQLColumns>& _rColumns,
+ OPrivateColumns(::rtl::Reference< ::connectivity::OSQLColumns> _xColumns,
bool _bCase,
::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
@@ -83,13 +78,13 @@ namespace dbaccess
return nullptr;
}
public:
- OPrivateTables( const OSQLTables& _rTables,
+ OPrivateTables( OSQLTables _rTables,
bool _bCase,
::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
- const std::vector< OUString> &_rVector
+ std::vector< OUString> && _rVector
) : sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector)
- ,m_aTables(_rTables)
+ ,m_aTables(std::move(_rTables))
{
}
virtual void disposing() override
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index 8999ded1e3c7..4ef85e0ce1af 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -46,6 +46,7 @@
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <composertools.hxx>
+#include <utility>
#include "PrivateRow.hxx"
using namespace dbaccess;
@@ -62,7 +63,6 @@ using namespace ::com::sun::star::util;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star;
using namespace ::cppu;
-using namespace ::osl;
using std::vector;
namespace
@@ -103,17 +103,17 @@ namespace
}
-OKeySet::OKeySet(const connectivity::OSQLTable& _xTable,
- const OUString& _rUpdateTableName, // this can be the alias or the full qualified name
+OKeySet::OKeySet(connectivity::OSQLTable _xTable,
+ OUString _sUpdateTableName, // this can be the alias or the full qualified name
const Reference< XSingleSelectQueryAnalyzer >& _xComposer,
const ORowSetValueVector& _aParameterValueForCache,
sal_Int32 i_nMaxRows,
sal_Int32& o_nRowCount)
:OCacheSet(i_nMaxRows)
,m_aParameterValueForCache(new ORowSetValueVector(_aParameterValueForCache))
- ,m_xTable(_xTable)
+ ,m_xTable(std::move(_xTable))
,m_xComposer(_xComposer)
- ,m_sUpdateTableName(_rUpdateTableName)
+ ,m_sUpdateTableName(std::move(_sUpdateTableName))
,m_rRowCount(o_nRowCount)
,m_bRowCountFinal(false)
{
@@ -161,10 +161,11 @@ void OKeySet::findTableColumnsMatching_throw( const Any& i_aTable,
Reference<XIndexAccess> xQueryParameters = xParaSup->getParameters();
const sal_Int32 nParaCount = xQueryParameters->getCount();
Sequence< OUString> aParameterColumns(nParaCount);
+ auto aParameterColumnsRange = asNonConstRange(aParameterColumns);
for(sal_Int32 i = 0; i< nParaCount;++i)
{
Reference<XPropertySet> xPara(xQueryParameters->getByIndex(i),UNO_QUERY_THROW);
- xPara->getPropertyValue(PROPERTY_REALNAME) >>= aParameterColumns[i];
+ xPara->getPropertyValue(PROPERTY_REALNAME) >>= aParameterColumnsRange[i];
}
OUString sUpdateTableName( i_rUpdateTableName );
@@ -281,7 +282,7 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet, const OUStrin
Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
Reference<XColumnsSupplier> xQueryColSup(m_xComposer, UNO_QUERY);
const Reference<XNameAccess> xQueryColumns = xQueryColSup->getColumns();
- findTableColumnsMatching_throw( makeAny(m_xTable), m_sUpdateTableName, xMeta, xQueryColumns, m_pKeyColumnNames );
+ findTableColumnsMatching_throw( Any(m_xTable), m_sUpdateTableName, xMeta, xQueryColumns, m_pKeyColumnNames );
Reference< XSingleSelectQueryComposer> xSourceComposer(m_xComposer,UNO_QUERY);
Reference< XMultiServiceFactory > xFactory(m_xConnection, UNO_QUERY_THROW);
@@ -405,7 +406,7 @@ Any OKeySet::getBookmark()
{
OSL_ENSURE(m_aKeyIter != m_aKeyMap.end() && m_aKeyIter != m_aKeyMap.begin(),
"getBookmark is only possible when we stand on a valid row!");
- return makeAny(m_aKeyIter->first);
+ return Any(m_aKeyIter->first);
}
bool OKeySet::moveToBookmark( const Any& bookmark )
@@ -443,9 +444,9 @@ void OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrigi
OUStringBuffer aSql = "UPDATE " + m_aComposedTableName + " SET ";
// list all columns that should be set
- static OUString aPara(" = ?,");
+ constexpr OUStringLiteral aPara(u" = ?,");
OUString aQuote = getIdentifierQuoteString();
- static OUString aAnd(" AND ");
+ constexpr OUString aAnd(u" AND "_ustr);
OUString sIsNull(" IS NULL");
OUString sParam(" = ?");
@@ -462,7 +463,6 @@ void OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrigi
std::vector<sal_Int32> aIndexColumnPositions;
const sal_Int32 nOldLength = aSql.getLength();
- sal_Int32 i = 1;
// here we build the condition part for the update statement
for (auto const& columnName : *m_pColumnNames)
{
@@ -498,7 +498,6 @@ void OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrigi
{
aSql.append(::dbtools::quoteName( aQuote,columnName.second.sRealName) + aPara);
}
- ++i;
}
if( aSql.getLength() != nOldLength )
@@ -513,15 +512,15 @@ void OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrigi
aSql.append(" WHERE ");
if(!sKeyCondition.isEmpty() && !sIndexCondition.isEmpty())
{
- aSql.append(sKeyCondition.makeStringAndClear() + sIndexCondition.makeStringAndClear());
+ aSql.append(sKeyCondition + sIndexCondition);
}
else if(!sKeyCondition.isEmpty())
{
- aSql.append(sKeyCondition.makeStringAndClear());
+ aSql.append(sKeyCondition);
}
else if(!sIndexCondition.isEmpty())
{
- aSql.append(sIndexCondition.makeStringAndClear());
+ aSql.append(sIndexCondition);
}
aSql.setLength(aSql.getLength()-5); // remove the last AND
}
@@ -539,7 +538,6 @@ void OKeySet::executeUpdate(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rO
Reference< XParameters > xParameter(xPrep,UNO_QUERY);
bool bRefetch = true;
- Reference<XRow> xRow;
sal_Int32 i = 1;
// first the set values
for (auto const& columnName : *m_pColumnNames)
@@ -583,8 +581,9 @@ void OKeySet::executeUpdate(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rO
{
const sal_Int32 nBookmark = ::comphelper::getINT32((*_rInsertRow)[0].getAny());
m_aKeyIter = m_aKeyMap.find(nBookmark);
+ assert(m_aKeyIter != m_aKeyMap.end());
m_aKeyIter->second.second.first = 2;
- m_aKeyIter->second.second.second = xRow;
+ m_aKeyIter->second.second.second.clear();
copyRowValue(_rInsertRow,m_aKeyIter->second.first,nBookmark);
tryRefetch(_rInsertRow,bRefetch);
}
@@ -621,7 +620,7 @@ void OKeySet::insertRow( const ORowSetRow& _rInsertRow,const connectivity::OSQLT
aSql[aSql.getLength() - 1] = ')';
aValues[aValues.getLength() - 1] = ')';
- aSql.append(aValues.makeStringAndClear());
+ aSql.append(aValues);
// now create,fill and execute the prepared statement
executeInsert(_rInsertRow,aSql.makeStringAndClear(),u"",bRefetch);
}
@@ -724,7 +723,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const OUString& i_sSQ
if(!sMaxStmt.isEmpty())
{
sMaxStmt[sMaxStmt.getLength()-1] = ' ';
- OUString sStmt = "SELECT " + sMaxStmt.makeStringAndClear() + "FROM ";
+ OUString sStmt = "SELECT " + sMaxStmt + "FROM ";
OUString sCatalog,sSchema,sTable;
::dbtools::qualifiedNameComponents(m_xConnection->getMetaData(),m_sUpdateTableName,sCatalog,sSchema,sTable,::dbtools::EComposeRule::InDataManipulation);
sStmt += ::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable );
@@ -762,7 +761,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const OUString& i_sSQ
m_aKeyIter = m_aKeyMap.emplace( aKeyIter->first + 1, OKeySetValue(aKeyRow,std::pair<sal_Int32,Reference<XRow> >(1,Reference<XRow>())) ).first;
// now we set the bookmark for this row
- (*_rInsertRow)[0] = makeAny(static_cast<sal_Int32>(m_aKeyIter->first));
+ (*_rInsertRow)[0] = Any(static_cast<sal_Int32>(m_aKeyIter->first));
tryRefetch(_rInsertRow,bRefetch);
}
}
@@ -782,7 +781,7 @@ void OKeySet::tryRefetch(const ORowSetRow& _rInsertRow,bool bRefetch)
}
if ( !bRefetch )
{
- m_aKeyIter->second.second.second = new OPrivateRow(*_rInsertRow);
+ m_aKeyIter->second.second.second = new OPrivateRow(std::vector(*_rInsertRow));
}
}
@@ -885,7 +884,7 @@ void OKeySet::deleteRow(const ORowSetRow& _rDeleteRow,const connectivity::OSQLTa
}
}
}
- aSql.append(sIndexCondition.makeStringAndClear());
+ aSql.append(sIndexCondition);
aSql.setLength(aSql.getLength()-5);
// now create end execute the prepared statement
@@ -911,7 +910,9 @@ void OKeySet::deleteRow(const ORowSetRow& _rDeleteRow,const connectivity::OSQLTa
if(m_bDeleted)
{
sal_Int32 nBookmark = ::comphelper::getINT32((*_rDeleteRow)[0].getAny());
- if(m_aKeyIter == m_aKeyMap.find(nBookmark) && m_aKeyIter != m_aKeyMap.end())
+ const auto iter = m_aKeyMap.find(nBookmark);
+ assert(iter != m_aKeyMap.end());
+ if(m_aKeyIter == iter && m_aKeyIter != m_aKeyMap.end())
++m_aKeyIter;
m_aKeyMap.erase(nBookmark);
m_bDeleted = true;
@@ -1380,7 +1381,7 @@ namespace dbaccess
void getColumnPositions(const Reference<XNameAccess>& _rxQueryColumns,
const css::uno::Sequence< OUString >& _aColumnNames,
- const OUString& _rsUpdateTableName,
+ std::u16string_view _rsUpdateTableName,
SelectColumnsMetaData& o_rColumnNames,
bool i_bAppendTableName)
{
diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx
index e5d3c61ea5ac..bd30f3960eb3 100644
--- a/dbaccess/source/core/api/KeySet.hxx
+++ b/dbaccess/source/core/api/KeySet.hxx
@@ -23,6 +23,7 @@
#include <memory>
#include <map>
+#include <utility>
#include <vector>
#include <com/sun/star/sdb/XSingleSelectQueryAnalyzer.hpp>
@@ -49,8 +50,8 @@ namespace dbaccess
{
}
- SelectColumnDescription( sal_Int32 _nPosition, sal_Int32 _nType, sal_Int32 _nScale,bool _bNullable, const OUString& _rDefaultValue )
- :sDefaultValue( _rDefaultValue )
+ SelectColumnDescription( sal_Int32 _nPosition, sal_Int32 _nType, sal_Int32 _nScale, bool _bNullable, OUString _sDefaultValue )
+ :sDefaultValue(std::move( _sDefaultValue ))
,nPosition( _nPosition )
,nType( _nType )
,nScale( _nScale )
@@ -63,7 +64,7 @@ namespace dbaccess
// the elements of _rxQueryColumns must have the properties PROPERTY_REALNAME and PROPERTY_TABLENAME
void getColumnPositions(const css::uno::Reference< css::container::XNameAccess >& _rxQueryColumns,
const css::uno::Sequence< OUString >& _rColumnNames,
- const OUString& _rsUpdateTableName,
+ std::u16string_view _rsUpdateTableName,
SelectColumnsMetaData& o_rColumnNames /* out */,
bool i_bAppendTableName = false);
@@ -142,8 +143,8 @@ namespace dbaccess
virtual ~OKeySet() override;
public:
- OKeySet(const connectivity::OSQLTable& _xTable,
- const OUString& _rUpdateTableName,
+ OKeySet(connectivity::OSQLTable _aTable,
+ OUString _sUpdateTableName,
const css::uno::Reference< css::sdb::XSingleSelectQueryAnalyzer >& _xComposer,
const ORowSetValueVector& _aParameterValueForCache,
sal_Int32 i_nMaxRows,
diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx
index c214402f50c5..df09d7b77588 100644
--- a/dbaccess/source/core/api/OptimisticSet.cxx
+++ b/dbaccess/source/core/api/OptimisticSet.cxx
@@ -41,17 +41,13 @@ using namespace dbaccess;
using namespace ::connectivity;
using namespace ::dbtools;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::util;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star;
-using namespace ::cppu;
-using namespace ::osl;
typedef std::map<OUString, OUStringBuffer> TSQLStatements;
namespace
@@ -208,7 +204,7 @@ void OptimisticSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _
OUString sCatalog,sSchema,sTable;
::dbtools::qualifiedNameComponents(xMetaData,elem.first,sCatalog,sSchema,sTable,::dbtools::EComposeRule::InDataManipulation);
OUStringBuffer sSql("UPDATE " + ::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable ) +
- " SET " + elem.second.toString());
+ " SET " + elem.second);
OUStringBuffer& rCondition = aKeyConditions[elem.first];
if ( !rCondition.isEmpty() )
sSql.append(" WHERE " + rCondition );
@@ -266,14 +262,14 @@ void OptimisticSet::insertRow( const ORowSetRow& _rInsertRow,const connectivity:
OUString sCatalog,sSchema,sTable;
::dbtools::qualifiedNameComponents(xMetaData,elem.first,sCatalog,sSchema,sTable,::dbtools::EComposeRule::InDataManipulation);
OUString sComposedTableName = ::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable );
- OUString sSql("INSERT INTO " + sComposedTableName + " ( " + elem.second.toString() +
- ") VALUES ( " + aParameter[elem.first].toString() + " )");
+ OUString sSql("INSERT INTO " + sComposedTableName + " ( " + elem.second +
+ ") VALUES ( " + aParameter[elem.first] + " )");
OUStringBuffer& rCondition = aKeyConditions[elem.first];
if ( !rCondition.isEmpty() )
{
- OUString sQuery("SELECT " + elem.second.toString() + " FROM " + sComposedTableName +
- " WHERE " + rCondition.toString());
+ OUString sQuery("SELECT " + elem.second + " FROM " + sComposedTableName +
+ " WHERE " + rCondition);
try
{
@@ -330,7 +326,7 @@ void OptimisticSet::deleteRow(const ORowSetRow& _rDeleteRow,const connectivity::
OUString sCatalog,sSchema,sTable;
::dbtools::qualifiedNameComponents(xMetaData,keyCondition.first,sCatalog,sSchema,sTable,::dbtools::EComposeRule::InDataManipulation);
OUString sSql("DELETE FROM " + ::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable ) +
- " WHERE " + rCondition.toString() );
+ " WHERE " + rCondition );
executeDelete(_rDeleteRow, sSql, keyCondition.first);
}
}
@@ -353,7 +349,9 @@ void OptimisticSet::executeDelete(const ORowSetRow& _rDeleteRow,const OUString&
if(m_bDeleted)
{
sal_Int32 nBookmark = ::comphelper::getINT32((*_rDeleteRow)[0].getAny());
- if(m_aKeyIter == m_aKeyMap.find(nBookmark) && m_aKeyIter != m_aKeyMap.end())
+ const auto iter = m_aKeyMap.find(nBookmark);
+ assert(iter != m_aKeyMap.end());
+ if(m_aKeyIter == iter && m_aKeyIter != m_aKeyMap.end())
++m_aKeyIter;
m_aKeyMap.erase(nBookmark);
m_bDeleted = true;
@@ -544,8 +542,8 @@ void OptimisticSet::fillMissingValues(ORowSetValueVector::Vector& io_aRow) const
OUString sCatalog,sSchema,sTable;
::dbtools::qualifiedNameComponents(xMetaData,elem.first,sCatalog,sSchema,sTable,::dbtools::EComposeRule::InDataManipulation);
OUString sComposedTableName = ::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable );
- OUString sQuery("SELECT " + elem.second.toString() + " FROM " + sComposedTableName + " WHERE " +
- rCondition.makeStringAndClear());
+ OUString sQuery("SELECT " + elem.second + " FROM " + sComposedTableName + " WHERE " + rCondition);
+ rCondition.setLength(0);
try
{
diff --git a/dbaccess/source/core/api/PrivateRow.cxx b/dbaccess/source/core/api/PrivateRow.cxx
index 22adc74f138a..7e2df82aaeed 100644
--- a/dbaccess/source/core/api/PrivateRow.cxx
+++ b/dbaccess/source/core/api/PrivateRow.cxx
@@ -21,12 +21,9 @@
using namespace dbaccess;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
-using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star;
@@ -37,62 +34,62 @@ sal_Bool SAL_CALL OPrivateRow::wasNull( )
OUString SAL_CALL OPrivateRow::getString( ::sal_Int32 columnIndex )
{
m_nPos = columnIndex;
- return m_aRow[m_nPos];
+ return m_aRow[m_nPos].getString();
}
sal_Bool SAL_CALL OPrivateRow::getBoolean( ::sal_Int32 columnIndex )
{
m_nPos = columnIndex;
- return bool(m_aRow[m_nPos]);
+ return m_aRow[m_nPos].getBool();
}
::sal_Int8 SAL_CALL OPrivateRow::getByte( ::sal_Int32 columnIndex )
{
m_nPos = columnIndex;
- return m_aRow[m_nPos];
+ return m_aRow[m_nPos].getInt8();
}
::sal_Int16 SAL_CALL OPrivateRow::getShort( ::sal_Int32 columnIndex )
{
m_nPos = columnIndex;
- return m_aRow[m_nPos];
+ return m_aRow[m_nPos].getInt16();
}
::sal_Int32 SAL_CALL OPrivateRow::getInt( ::sal_Int32 columnIndex )
{
m_nPos = columnIndex;
- return m_aRow[m_nPos];
+ return m_aRow[m_nPos].getInt32();
}
::sal_Int64 SAL_CALL OPrivateRow::getLong( ::sal_Int32 columnIndex )
{
m_nPos = columnIndex;
- return m_aRow[m_nPos];
+ return m_aRow[m_nPos].getLong();
}
float SAL_CALL OPrivateRow::getFloat( ::sal_Int32 columnIndex )
{
m_nPos = columnIndex;
- return m_aRow[m_nPos];
+ return m_aRow[m_nPos].getFloat();
}
double SAL_CALL OPrivateRow::getDouble( ::sal_Int32 columnIndex )
{
m_nPos = columnIndex;
- return m_aRow[m_nPos];
+ return m_aRow[m_nPos].getDouble();
}
Sequence< ::sal_Int8 > SAL_CALL OPrivateRow::getBytes( ::sal_Int32 columnIndex )
{
m_nPos = columnIndex;
- return m_aRow[m_nPos];
+ return m_aRow[m_nPos].getSequence();
}
css::util::Date SAL_CALL OPrivateRow::getDate( ::sal_Int32 columnIndex )
{
m_nPos = columnIndex;
- return m_aRow[m_nPos];
+ return m_aRow[m_nPos].getDate();
}
css::util::Time SAL_CALL OPrivateRow::getTime( ::sal_Int32 columnIndex )
{
m_nPos = columnIndex;
- return m_aRow[m_nPos];
+ return m_aRow[m_nPos].getTime();
}
css::util::DateTime SAL_CALL OPrivateRow::getTimestamp( ::sal_Int32 columnIndex )
{
m_nPos = columnIndex;
- return m_aRow[m_nPos];
+ return m_aRow[m_nPos].getDateTime();
}
Reference< css::io::XInputStream > SAL_CALL OPrivateRow::getBinaryStream( ::sal_Int32 columnIndex )
{
diff --git a/dbaccess/source/core/api/PrivateRow.hxx b/dbaccess/source/core/api/PrivateRow.hxx
index a9bf9e70e0ea..c5ce74f15f43 100644
--- a/dbaccess/source/core/api/PrivateRow.hxx
+++ b/dbaccess/source/core/api/PrivateRow.hxx
@@ -29,7 +29,7 @@ namespace dbaccess
ORowSetValueVector::Vector m_aRow;
sal_Int32 m_nPos;
public:
- explicit OPrivateRow(const ORowSetValueVector::Vector& i_aRow) : m_aRow(i_aRow),m_nPos(0)
+ explicit OPrivateRow(ORowSetValueVector::Vector&& i_aRow) : m_aRow(std::move(i_aRow)),m_nPos(0)
{
}
virtual sal_Bool SAL_CALL wasNull( ) override;
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index f7deaa0c1d5e..d9904071d64b 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -31,11 +31,13 @@
#include "CRowSetDataColumn.hxx"
#include "RowSetCache.hxx"
#include <strings.hrc>
+#include <strings.hxx>
#include <core_resource.hxx>
#include <tablecontainer.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/sdb/DatabaseContext.hpp>
#include <com/sun/star/sdb/ErrorCondition.hpp>
@@ -68,9 +70,8 @@
#include <i18nlangtag/languagetag.hxx>
#include <o3tl/safeint.hxx>
#include <unotools/syslocale.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
-using namespace utl;
using namespace dbaccess;
using namespace connectivity;
using namespace comphelper;
@@ -95,24 +96,6 @@ com_sun_star_comp_dba_ORowSet_get_implementation(css::uno::XComponentContext* co
return cppu::acquire(new ORowSet(context));
}
-#define NOTIFY_LISTENERS_CHECK(_rListeners,T,method) \
- std::vector< Reference< XInterface > > aListenerSeq = _rListeners.getElements(); \
- \
- _rGuard.clear(); \
- bool bCheck = std::all_of(aListenerSeq.rbegin(), aListenerSeq.rend(), \
- [&aEvt](Reference<XInterface>& rxItem) { \
- try \
- { \
- return static_cast<bool>(static_cast<T*>(rxItem.get())->method(aEvt)); \
- } \
- catch( RuntimeException& ) \
- { \
- return true; \
- } \
- }); \
- _rGuard.reset();
-
-
namespace dbaccess
{
ORowSet::ORowSet( const Reference< css::uno::XComponentContext >& _rxContext )
@@ -123,6 +106,7 @@ ORowSet::ORowSet( const Reference< css::uno::XComponentContext >& _rxContext )
,m_aRowsetListeners(*m_pMutex)
,m_aApproveListeners(*m_pMutex)
,m_aRowsChangeListener(*m_pMutex)
+ ,m_sErrorString(ResourceManager::loadString(RID_STR_COMMAND_LEADING_TO_ERROR))
,m_nFetchDirection(FetchDirection::FORWARD)
,m_nFetchSize(50)
,m_nMaxFieldSize(0)
@@ -434,22 +418,6 @@ void SAL_CALL ORowSet::release() noexcept
ORowSet_BASE1::release();
}
-// css::XUnoTunnel
-sal_Int64 SAL_CALL ORowSet::getSomething( const Sequence< sal_Int8 >& rId )
-{
- if (isUnoTunnelId<ORowSet>(rId))
- return reinterpret_cast<sal_Int64>(this);
-
- return 0;
-}
-
-Sequence< sal_Int8 > ORowSet::getUnoTunnelId()
-{
- static ::cppu::OImplementationId s_Id;
-
- return s_Id.getImplementationId();
-}
-
// css::XAggregation
Any SAL_CALL ORowSet::queryAggregation( const Type& rType )
{
@@ -637,7 +605,7 @@ void SAL_CALL ORowSet::close( )
MutexGuard aGuard( m_aMutex );
::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
}
- // additionals things to set
+ // additional things to set
freeResources( true );
}
@@ -664,7 +632,7 @@ void ORowSet::updateValue(sal_Int32 columnIndex,const ORowSetValue& x)
checkUpdateIterator();
ORowSetValueVector::Vector& rRow = **m_aCurrentRow;
- ORowSetNotifier aNotify(this,rRow);
+ ORowSetNotifier aNotify(this, std::vector(rRow));
m_pCache->updateValue(columnIndex,x,rRow,aNotify.getChangedColumns());
m_bModified = m_bModified || !aNotify.getChangedColumns().empty();
aNotify.firePropertyChange();
@@ -680,7 +648,7 @@ void SAL_CALL ORowSet::updateNull( sal_Int32 columnIndex )
checkUpdateIterator();
ORowSetValueVector::Vector& rRow = **m_aCurrentRow;
- ORowSetNotifier aNotify(this,rRow);
+ ORowSetNotifier aNotify(this, std::vector(rRow));
m_pCache->updateNull(columnIndex,rRow,aNotify.getChangedColumns());
m_bModified = m_bModified || !aNotify.getChangedColumns().empty();
aNotify.firePropertyChange();
@@ -768,7 +736,7 @@ void SAL_CALL ORowSet::updateCharacterStream( sal_Int32 columnIndex, const Refer
checkUpdateConditions(columnIndex);
checkUpdateIterator();
ORowSetValueVector::Vector& rRow = **m_aCurrentRow;
- ORowSetNotifier aNotify(this,rRow);
+ ORowSetNotifier aNotify(this, std::vector(rRow));
m_pCache->updateCharacterStream(columnIndex,x,length,rRow,aNotify.getChangedColumns());
m_bModified = m_bModified || !aNotify.getChangedColumns().empty();
aNotify.firePropertyChange();
@@ -812,7 +780,7 @@ void SAL_CALL ORowSet::updateObject( sal_Int32 columnIndex, const Any& x )
if (!::dbtools::implUpdateObject(this, columnIndex, aNewValue))
{ // there is no other updateXXX call which can handle the value in x
ORowSetValueVector::Vector& rRow = **m_aCurrentRow;
- ORowSetNotifier aNotify(this,rRow);
+ ORowSetNotifier aNotify(this, std::vector(rRow));
m_pCache->updateObject(columnIndex,aNewValue,rRow,aNotify.getChangedColumns());
m_bModified = m_bModified || !aNotify.getChangedColumns().empty();
aNotify.firePropertyChange();
@@ -826,7 +794,7 @@ void SAL_CALL ORowSet::updateNumericObject( sal_Int32 columnIndex, const Any& x,
checkUpdateConditions(columnIndex);
checkUpdateIterator();
ORowSetValueVector::Vector& rRow = **m_aCurrentRow;
- ORowSetNotifier aNotify(this,rRow);
+ ORowSetNotifier aNotify(this, std::vector(rRow));
m_pCache->updateNumericObject(columnIndex,x,rRow,aNotify.getChangedColumns());
m_bModified = m_bModified || !aNotify.getChangedColumns().empty();
aNotify.firePropertyChange();
@@ -993,7 +961,7 @@ void SAL_CALL ORowSet::deleteRow( )
// this call position the cache indirect
Any aBookmarkToDelete( m_aBookmark );
- positionCache( MOVE_NONE );
+ positionCache( CursorMoveDirection::Current );
sal_Int32 nDeletePosition = m_pCache->getRow();
notifyRowSetAndClonesRowDelete( aBookmarkToDelete );
@@ -1040,7 +1008,7 @@ void ORowSet::implCancelRowUpdates( bool _bNotifyModified )
if ( m_bNew || m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY )
throwFunctionSequenceException(*this);
- positionCache( MOVE_NONE );
+ positionCache( CursorMoveDirection::Current );
ORowSetRow aOldValues;
if ( !m_bModified && _bNotifyModified && !m_aCurrentRow.isNull() )
@@ -1112,13 +1080,40 @@ void ORowSet::notifyAllListenersRowChanged(::osl::ResettableMutexGuard& _rGuard,
bool ORowSet::notifyAllListenersCursorBeforeMove(::osl::ResettableMutexGuard& _rGuard)
{
EventObject aEvt(*m_pMySelf);
- NOTIFY_LISTENERS_CHECK(m_aApproveListeners,XRowSetApproveListener,approveCursorMove);
+ std::vector< Reference< css::sdb::XRowSetApproveListener > > aListenerSeq = m_aApproveListeners.getElements();
+ _rGuard.clear();
+ bool bCheck = std::all_of(aListenerSeq.rbegin(), aListenerSeq.rend(),
+ [&aEvt](Reference<css::sdb::XRowSetApproveListener>& rxItem) {
+ try
+ {
+ return static_cast<bool>(rxItem->approveCursorMove(aEvt));
+ }
+ catch( RuntimeException& )
+ {
+ return true;
+ }
+ });
+ _rGuard.reset();
return bCheck;
}
void ORowSet::notifyAllListenersRowBeforeChange(::osl::ResettableMutexGuard& _rGuard,const RowChangeEvent &aEvt)
{
- NOTIFY_LISTENERS_CHECK(m_aApproveListeners,XRowSetApproveListener,approveRowChange);
+ std::vector< Reference< css::sdb::XRowSetApproveListener > > aListenerSeq = m_aApproveListeners.getElements();
+ _rGuard.clear();
+ bool bCheck = std::all_of(aListenerSeq.rbegin(), aListenerSeq.rend(),
+ [&aEvt](Reference<css::sdb::XRowSetApproveListener>& rxItem) {
+ try
+ {
+ return static_cast<bool>(rxItem->approveRowChange(aEvt));
+ }
+ catch( RuntimeException& )
+ {
+ return true;
+ }
+ });
+ _rGuard.reset();
+
if ( !bCheck )
m_aErrors.raiseTypedException( sdb::ErrorCondition::ROW_SET_OPERATION_VETOED, *this, ::cppu::UnoType< RowSetVetoException >::get() );
}
@@ -1163,12 +1158,12 @@ void SAL_CALL ORowSet::moveToInsertRow( )
ORowSetRow aOldValues;
if ( rowDeleted() )
{
- positionCache( MOVE_FORWARD );
+ positionCache( CursorMoveDirection::Forward );
m_pCache->next();
setCurrentRow( true, false, aOldValues, aGuard);
}
else
- positionCache( MOVE_NONE );
+ positionCache( CursorMoveDirection::Current );
// check before because the resultset could be empty
if ( !m_bBeforeFirst
@@ -1218,18 +1213,18 @@ void ORowSet::impl_setDataColumnsWriteable_throw()
dataColumn->getPropertyValue(PROPERTY_ISREADONLY) >>= bReadOnly;
*aReadIter = bReadOnly;
- dataColumn->setPropertyValue(PROPERTY_ISREADONLY,makeAny(false));
+ dataColumn->setPropertyValue(PROPERTY_ISREADONLY,Any(false));
++aReadIter;
}
}
void ORowSet::impl_restoreDataColumnsWriteable_throw()
{
- assert(m_aDataColumns.size() == m_aReadOnlyDataColumns.size() || m_aReadOnlyDataColumns.size() == 0 );
+ assert(m_aDataColumns.size() == m_aReadOnlyDataColumns.size() || m_aReadOnlyDataColumns.empty());
TDataColumns::const_iterator aIter = m_aDataColumns.begin();
for (bool readOnlyDataColumn : m_aReadOnlyDataColumns)
{
- (*aIter)->setPropertyValue(PROPERTY_ISREADONLY, makeAny(readOnlyDataColumn) );
+ (*aIter)->setPropertyValue(PROPERTY_ISREADONLY, Any(readOnlyDataColumn) );
++aIter;
}
m_aReadOnlyDataColumns.clear();
@@ -1257,7 +1252,7 @@ void SAL_CALL ORowSet::moveToCurrentRow( )
if ( !notifyAllListenersCursorBeforeMove( aGuard ) )
return;
- positionCache( MOVE_NONE_REFRESH );
+ positionCache( CursorMoveDirection::CurrentRefresh );
ORowSetNotifier aNotifier( this );
@@ -1294,74 +1289,73 @@ const ORowSetValue& ORowSet::getInsertValue(sal_Int32 columnIndex)
OUString SAL_CALL ORowSet::getString( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getInsertValue(columnIndex);
+ return getInsertValue(columnIndex).getString();
}
sal_Bool SAL_CALL ORowSet::getBoolean( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- // the extra cast is to recognise the "true" or "false" strings
- return static_cast<bool>(getInsertValue(columnIndex));
+ return getInsertValue(columnIndex).getBool();
}
sal_Int8 SAL_CALL ORowSet::getByte( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getInsertValue(columnIndex);
+ return getInsertValue(columnIndex).getInt8();
}
sal_Int16 SAL_CALL ORowSet::getShort( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getInsertValue(columnIndex);
+ return getInsertValue(columnIndex).getInt16();
}
sal_Int32 SAL_CALL ORowSet::getInt( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getInsertValue(columnIndex);
+ return getInsertValue(columnIndex).getInt32();
}
sal_Int64 SAL_CALL ORowSet::getLong( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getInsertValue(columnIndex);
+ return getInsertValue(columnIndex).getLong();
}
float SAL_CALL ORowSet::getFloat( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getInsertValue(columnIndex);
+ return getInsertValue(columnIndex).getFloat();
}
double SAL_CALL ORowSet::getDouble( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getInsertValue(columnIndex);
+ return getInsertValue(columnIndex).getDouble();
}
Sequence< sal_Int8 > SAL_CALL ORowSet::getBytes( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getInsertValue(columnIndex);
+ return getInsertValue(columnIndex).getSequence();
}
css::util::Date SAL_CALL ORowSet::getDate( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getInsertValue(columnIndex);
+ return getInsertValue(columnIndex).getDate();
}
css::util::Time SAL_CALL ORowSet::getTime( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getInsertValue(columnIndex);
+ return getInsertValue(columnIndex).getTime();
}
css::util::DateTime SAL_CALL ORowSet::getTimestamp( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getInsertValue(columnIndex);
+ return getInsertValue(columnIndex).getDateTime();
}
Reference< css::io::XInputStream > SAL_CALL ORowSet::getBinaryStream( sal_Int32 columnIndex )
@@ -1512,13 +1506,13 @@ void ORowSet::approveExecution()
::osl::MutexGuard aGuard( m_aColumnsMutex );
EventObject aEvt(*this);
- OInterfaceIteratorHelper2 aApproveIter( m_aApproveListeners );
+ OInterfaceIteratorHelper3 aApproveIter( m_aApproveListeners );
while ( aApproveIter.hasMoreElements() )
{
- Reference< XRowSetApproveListener > xListener( static_cast< XRowSetApproveListener* >( aApproveIter.next() ) );
+ Reference< XRowSetApproveListener > xListener( aApproveIter.next() );
try
{
- if ( xListener.is() && !xListener->approveRowSetChange( aEvt ) )
+ if ( !xListener->approveRowSetChange( aEvt ) )
throw RowSetVetoException();
}
catch ( const DisposedException& e )
@@ -1609,8 +1603,8 @@ void ORowSet::setStatementResultSetType( const Reference< XPropertySet >& _rxSta
}
}
- _rxStatement->setPropertyValue( PROPERTY_RESULTSETTYPE, makeAny( nResultSetType ) );
- _rxStatement->setPropertyValue( PROPERTY_RESULTSETCONCURRENCY, makeAny( nResultSetConcurrency ) );
+ _rxStatement->setPropertyValue( PROPERTY_RESULTSETTYPE, Any( nResultSetType ) );
+ _rxStatement->setPropertyValue( PROPERTY_RESULTSETCONCURRENCY, Any( nResultSetConcurrency ) );
}
void ORowSet::impl_ensureStatement_throw()
@@ -1637,8 +1631,8 @@ void ORowSet::impl_ensureStatement_throw()
// set the result set type and concurrency
try
{
- xStatementProps->setPropertyValue( PROPERTY_USEBOOKMARKS, makeAny( true ) );
- xStatementProps->setPropertyValue( PROPERTY_MAXROWS, makeAny( m_nMaxRows ) );
+ xStatementProps->setPropertyValue( PROPERTY_USEBOOKMARKS, Any( true ) );
+ xStatementProps->setPropertyValue( PROPERTY_MAXROWS, Any( m_nMaxRows ) );
setStatementResultSetType( xStatementProps, m_nResultSetType, m_nResultSetConcurrency );
}
@@ -1648,21 +1642,17 @@ void ORowSet::impl_ensureStatement_throw()
// then the driver doesn't support this feature
}
}
- catch( const SQLException& )
+ catch (SQLException& rException)
{
- SQLExceptionInfo aError( ::cppu::getCaughtException() );
- OSL_ENSURE( aError.isValid(), "ORowSet::impl_makeNewStatement_throw: caught an SQLException which we cannot analyze!" );
+ css::sdbc::SQLException* pLastExceptionInChain = SQLExceptionInfo::getLastException(&rException);
+ assert(pLastExceptionInChain && "will at least be &rException");
// append information about what we were actually going to execute
- try
- {
- OUString sInfo(DBA_RES_PARAM( RID_STR_COMMAND_LEADING_TO_ERROR, "$command$", sCommandToExecute ) );
- aError.append( SQLExceptionInfo::TYPE::SQLContext, sInfo );
- }
- catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION("dbaccess"); }
+ OUString sInfo(m_sErrorString.replaceFirst("$command$", sCommandToExecute));
+ pLastExceptionInChain->NextException = SQLExceptionInfo::createException(SQLExceptionInfo::TYPE::SQLContext, sInfo, OUString(), 0);
// propagate
- aError.doThrow();
+ throw;
}
}
@@ -1716,8 +1706,8 @@ void ORowSet::impl_initializeColumnSettings_nothrow( const Reference< XPropertyS
// a number of properties is plain copied
const OUString aPropertyNames[] = {
- OUString(PROPERTY_ALIGN), OUString(PROPERTY_RELATIVEPOSITION), OUString(PROPERTY_WIDTH), OUString(PROPERTY_HIDDEN), OUString(PROPERTY_CONTROLMODEL),
- OUString(PROPERTY_HELPTEXT), OUString(PROPERTY_CONTROLDEFAULT)
+ PROPERTY_ALIGN, PROPERTY_RELATIVEPOSITION, PROPERTY_WIDTH, PROPERTY_HIDDEN, PROPERTY_CONTROLMODEL,
+ PROPERTY_HELPTEXT, PROPERTY_CONTROLDEFAULT
};
for (const auto & aPropertyName : aPropertyNames)
{
@@ -1737,7 +1727,7 @@ void ORowSet::impl_initializeColumnSettings_nothrow( const Reference< XPropertyS
}
if ( !nFormatKey && m_xNumberFormatTypes.is() )
nFormatKey = ::dbtools::getDefaultNumberFormat( _rxTemplateColumn, m_xNumberFormatTypes, SvtSysLocale().GetLanguageTag().getLocale() );
- _rxRowSetColumn->setPropertyValue( PROPERTY_NUMBERFORMAT, makeAny( nFormatKey ) );
+ _rxRowSetColumn->setPropertyValue( PROPERTY_NUMBERFORMAT, Any( nFormatKey ) );
}
catch(Exception&)
{
@@ -1869,7 +1859,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi
aNames.push_back(sName);
m_aDataColumns.push_back(pColumn.get());
- pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ISREADONLY,makeAny(rKeyColumns.find(i+1) != rKeyColumns.end()));
+ pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ISREADONLY,Any(rKeyColumns.find(i+1) != rKeyColumns.end()));
try
{
@@ -1878,10 +1868,10 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi
nFormatKey = ::dbtools::getDefaultNumberFormat(pColumn,m_xNumberFormatTypes,aLocale);
- pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_NUMBERFORMAT,makeAny(nFormatKey));
- pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_RELATIVEPOSITION,makeAny(sal_Int32(i+1)));
- pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_WIDTH,makeAny(sal_Int32(227)));
- pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ALIGN,makeAny(sal_Int32(0)));
+ pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_NUMBERFORMAT,Any(nFormatKey));
+ pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_RELATIVEPOSITION,Any(sal_Int32(i+1)));
+ pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_WIDTH,Any(sal_Int32(227)));
+ pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ALIGN,Any(sal_Int32(0)));
pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_HIDDEN, css::uno::Any(false));
}
catch(Exception&)
@@ -1969,7 +1959,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi
});
aColumns->emplace_back(pColumn);
- pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ISREADONLY,makeAny(rKeyColumns.find(i) != rKeyColumns.end()));
+ pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ISREADONLY,Any(rKeyColumns.find(i) != rKeyColumns.end()));
if(sColumnLabel.isEmpty())
{
@@ -2067,7 +2057,7 @@ Reference< XResultSet > SAL_CALL ORowSet::createResultSet( )
if(m_xStatement.is())
{
rtl::Reference<ORowSetClone> pClone = new ORowSetClone( m_aContext, *this, m_pMutex );
- m_aClones.emplace_back(static_cast<cppu::OWeakObject*>(pClone.get()));
+ m_aClones.emplace_back(css::uno::Reference< css::uno::XWeak >(pClone));
return pClone;
}
return Reference< XResultSet >();
@@ -2141,7 +2131,7 @@ void ORowSet::notifyRowSetAndClonesRowDelete( const Any& _rBookmark )
// notify the clones
for (auto const& elem : m_aClones)
{
- auto pClone = comphelper::getUnoTunnelImplementation<ORowSetClone>(elem.get());
+ rtl::Reference<ORowSetClone> pClone = dynamic_cast<ORowSetClone*>(elem.get().get());
if(pClone)
pClone->onDeleteRow( _rBookmark );
}
@@ -2154,7 +2144,7 @@ void ORowSet::notifyRowSetAndClonesRowDeleted( const Any& _rBookmark, sal_Int32
// notify the clones
for (auto const& clone : m_aClones)
{
- auto pClone = comphelper::getUnoTunnelImplementation<ORowSetClone>(clone.get());
+ rtl::Reference<ORowSetClone> pClone = dynamic_cast<ORowSetClone*>(clone.get().get());
if(pClone)
pClone->onDeletedRow( _rBookmark, _nPos );
}
@@ -2231,7 +2221,7 @@ Reference< XNameAccess > ORowSet::impl_getTables_throw()
DBG_UNHANDLED_EXCEPTION("dbaccess");
}
- m_xTables = new OTableContainer(*this,m_aMutex,m_xActiveConnection,bCase,nullptr,nullptr,m_nInAppend);
+ m_xTables.reset(new OTableContainer(*this,m_aMutex,m_xActiveConnection,bCase,nullptr,nullptr,m_nInAppend));
xTables = m_xTables.get();
Sequence<OUString> aTableFilter { "%" };
m_xTables->construct(aTableFilter,Sequence< OUString>());
@@ -2254,7 +2244,7 @@ void ORowSet::impl_resetTables_nothrow()
DBG_UNHANDLED_EXCEPTION("dbaccess");
}
- m_xTables.clear();
+ m_xTables.reset();
}
void ORowSet::impl_initComposer_throw( OUString& _out_rCommandToExecute )
@@ -2697,7 +2687,7 @@ void ORowSet::checkUpdateConditions(sal_Int32 columnIndex)
if ( m_aCurrentRow.isNull() )
::dbtools::throwSQLException( DBA_RES( RID_STR_INVALID_CURSOR_STATE ), StandardSQLState::INVALID_CURSOR_STATE, *this );
- if ( columnIndex <= 0 || sal_Int32((*m_aCurrentRow)->size()) <= columnIndex )
+ if ( columnIndex <= 0 || (*m_aCurrentRow)->size() <= o3tl::make_unsigned(columnIndex) )
::dbtools::throwSQLException( DBA_RES( RID_STR_INVALID_INDEX ), StandardSQLState::INVALID_DESCRIPTOR_INDEX, *this );
}
@@ -2733,7 +2723,7 @@ void ORowSet::impl_rebuild_throw(::osl::ResettableMutexGuard& _rGuard)
ORowSetClone::ORowSetClone( const Reference<XComponentContext>& _rContext, ORowSet& rParent, ::osl::Mutex* _pMutex )
:OSubComponent(m_aMutex, rParent)
- ,ORowSetBase( _rContext, OComponentHelper::rBHelper, _pMutex )
+ ,ORowSetBase( _rContext, WeakComponentImplHelper::rBHelper, _pMutex )
,m_pParent(&rParent)
,m_nFetchDirection(rParent.m_nFetchDirection)
,m_nFetchSize(rParent.m_nFetchSize)
@@ -2793,7 +2783,7 @@ ORowSetClone::ORowSetClone( const Reference<XComponentContext>& _rContext, ORowS
xColumn->getPropertyValue(PROPERTY_NUMBERFORMAT) >>= nFormatKey;
if(!nFormatKey && xColumn.is() && m_xNumberFormatTypes.is())
nFormatKey = ::dbtools::getDefaultNumberFormat(xColumn,m_xNumberFormatTypes,aLocale);
- pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_NUMBERFORMAT,makeAny(nFormatKey));
+ pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_NUMBERFORMAT,Any(nFormatKey));
pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_RELATIVEPOSITION,xColumn->getPropertyValue(PROPERTY_RELATIVEPOSITION));
pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_WIDTH,xColumn->getPropertyValue(PROPERTY_WIDTH));
pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_HIDDEN,xColumn->getPropertyValue(PROPERTY_HIDDEN));
@@ -2879,8 +2869,8 @@ void ORowSetClone::close()
{
{
MutexGuard aGuard( m_aMutex );
- if (OComponentHelper::rBHelper.bDisposed)
- throw DisposedException();
+ if (WeakComponentImplHelper::rBHelper.bDisposed)
+ return;
}
dispose();
}
@@ -2899,22 +2889,6 @@ void ORowSetClone::close()
return *::comphelper::OPropertyArrayUsageHelper<ORowSetClone>::getArrayHelper();
}
-Sequence< sal_Int8 > ORowSetClone::getUnoTunnelId()
-{
- static ::cppu::OImplementationId implId;
-
- return implId.getImplementationId();
-}
-
-// css::XUnoTunnel
-sal_Int64 SAL_CALL ORowSetClone::getSomething( const Sequence< sal_Int8 >& rId )
-{
- if (isUnoTunnelId<ORowSetClone>(rId))
- return reinterpret_cast<sal_Int64>(this);
-
- return 0;
-}
-
void SAL_CALL ORowSetClone::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)
{
if ( nHandle == PROPERTY_ID_FETCHSIZE )
diff --git a/dbaccess/source/core/api/RowSet.hxx b/dbaccess/source/core/api/RowSet.hxx
index a7d06a7a6567..3cf6fe690193 100644
--- a/dbaccess/source/core/api/RowSet.hxx
+++ b/dbaccess/source/core/api/RowSet.hxx
@@ -44,7 +44,7 @@
#include <cppuhelper/compbase12.hxx>
#include <cppuhelper/basemutex.hxx>
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/interfacecontainer3.hxx>
#include <connectivity/paramwrapper.hxx>
#include <connectivity/FValue.hxx>
#include <connectivity/warningscontainer.hxx>
@@ -94,13 +94,14 @@ namespace dbaccess
std::vector<bool> m_aParametersSet;
std::vector<bool> m_aReadOnlyDataColumns;
- ::comphelper::OInterfaceContainerHelper2 m_aRowsetListeners;
- ::comphelper::OInterfaceContainerHelper2 m_aApproveListeners;
- ::comphelper::OInterfaceContainerHelper2 m_aRowsChangeListener;
+ ::comphelper::OInterfaceContainerHelper3<css::sdbc::XRowSetListener> m_aRowsetListeners;
+ ::comphelper::OInterfaceContainerHelper3<css::sdb::XRowSetApproveListener> m_aApproveListeners;
+ ::comphelper::OInterfaceContainerHelper3<css::sdb::XRowsChangeListener> m_aRowsChangeListener;
::dbtools::WarningsContainer m_aWarnings;
- rtl::Reference<OTableContainer> m_xTables;
+ // no Reference! see OCollection::acquire
+ std::unique_ptr<OTableContainer> m_xTables;
OUString m_aCommand;
OUString m_aDataSourceName;
@@ -115,6 +116,7 @@ namespace dbaccess
OUString m_aUpdateCatalogName; // is set by a query
OUString m_aUpdateSchemaName; // is set by a query
OUString m_aUpdateTableName; // is set by a query
+ OUString m_sErrorString;
sal_Int32 m_nFetchDirection;
sal_Int32 m_nFetchSize;
@@ -253,10 +255,6 @@ namespace dbaccess
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
- // css::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
-
// css::uno::XAggregation
virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& aType ) override;
@@ -485,10 +483,6 @@ namespace dbaccess
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
- // css::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
-
// OComponentHelper
virtual void SAL_CALL disposing() override;
diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx
index 4eabb3eb0bee..042f1fabc2d0 100644
--- a/dbaccess/source/core/api/RowSetBase.cxx
+++ b/dbaccess/source/core/api/RowSetBase.cxx
@@ -34,7 +34,7 @@
#include <comphelper/seqstream.hxx>
#include <connectivity/dbexception.hxx>
#include <o3tl/safeint.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace dbaccess;
using namespace connectivity;
@@ -94,7 +94,7 @@ ORowSetBase::ORowSetBase( const Reference<XComponentContext>& _rContext, ::cppu:
{
sal_Int32 nRBT = PropertyAttribute::READONLY | PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT;
- registerPropertyNoMember( PROPERTY_ROWCOUNT, PROPERTY_ID_ROWCOUNT, nRBT, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0) );
+ registerPropertyNoMember( PROPERTY_ROWCOUNT, PROPERTY_ID_ROWCOUNT, nRBT, cppu::UnoType<sal_Int32>::get(), css::uno::Any(sal_Int32(0)) );
registerPropertyNoMember( PROPERTY_ISROWCOUNTFINAL, PROPERTY_ID_ISROWCOUNTFINAL, nRBT, cppu::UnoType<bool>::get(), css::uno::Any(false) );
}
@@ -207,7 +207,7 @@ const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 columnIndex)
if ( !bValidCurrentRow )
{
// currentrow is null when the clone moves the window
- positionCache( MOVE_NONE );
+ positionCache( CursorMoveDirection::Current );
m_aCurrentRow = m_pCache->m_aMatrixIter;
m_bIsInsertRow = false;
OSL_ENSURE(!m_aCurrentRow.isNull(),"ORowSetBase::getValue: we don't stand on a valid row! Row is null.");
@@ -228,7 +228,7 @@ const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 columnIndex)
for (; k != m_pCache->getEnd(); ++k)
{
ORowSetValueVector* pTemp = k->get();
- OSL_ENSURE( pTemp != reinterpret_cast<void*>(0xfeeefeee),"HALT!" );
+ OSL_ENSURE( pTemp != reinterpret_cast<void*>(sal_uIntPtr(0xfeeefeee)),"HALT!" );
}
OSL_ENSURE(!m_aCurrentRow.isNull() && m_aCurrentRow < m_pCache->getEnd() && aCacheIter != m_pCache->m_aCacheIterators.end(),"Invalid iterator set for currentrow!");
#endif
@@ -250,73 +250,73 @@ const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 columnIndex)
OUString SAL_CALL ORowSetBase::getString( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getValue(columnIndex);
+ return getValue(columnIndex).getString();
}
sal_Bool SAL_CALL ORowSetBase::getBoolean( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return bool(getValue(columnIndex));
+ return getValue(columnIndex).getBool();
}
sal_Int8 SAL_CALL ORowSetBase::getByte( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getValue(columnIndex);
+ return getValue(columnIndex).getInt8();
}
sal_Int16 SAL_CALL ORowSetBase::getShort( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getValue(columnIndex);
+ return getValue(columnIndex).getInt16();
}
sal_Int32 SAL_CALL ORowSetBase::getInt( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getValue(columnIndex);
+ return getValue(columnIndex).getInt32();
}
sal_Int64 SAL_CALL ORowSetBase::getLong( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getValue(columnIndex);
+ return getValue(columnIndex).getLong();
}
float SAL_CALL ORowSetBase::getFloat( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getValue(columnIndex);
+ return getValue(columnIndex).getFloat();
}
double SAL_CALL ORowSetBase::getDouble( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getValue(columnIndex);
+ return getValue(columnIndex).getDouble();
}
Sequence< sal_Int8 > SAL_CALL ORowSetBase::getBytes( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getValue(columnIndex);
+ return getValue(columnIndex).getSequence();
}
css::util::Date SAL_CALL ORowSetBase::getDate( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getValue(columnIndex);
+ return getValue(columnIndex).getDate();
}
css::util::Time SAL_CALL ORowSetBase::getTime( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getValue(columnIndex);
+ return getValue(columnIndex).getTime();
}
css::util::DateTime SAL_CALL ORowSetBase::getTimestamp( sal_Int32 columnIndex )
{
::osl::MutexGuard aGuard( *m_pMutex );
- return getValue(columnIndex);
+ return getValue(columnIndex).getDateTime();
}
Reference< css::io::XInputStream > SAL_CALL ORowSetBase::getBinaryStream( sal_Int32 columnIndex )
@@ -338,7 +338,7 @@ Reference< css::io::XInputStream > SAL_CALL ORowSetBase::getBinaryStream( sal_In
bool bValidCurrentRow = ( !m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd() && m_aCurrentRow->is() );
if ( !bValidCurrentRow )
{
- positionCache( MOVE_NONE );
+ positionCache( CursorMoveDirection::Current );
m_aCurrentRow = m_pCache->m_aMatrixIter;
m_bIsInsertRow = false;
OSL_ENSURE(!m_aCurrentRow.isNull(),"ORowSetBase::getBinaryStream: we don't stand on a valid row! Row is null.");
@@ -579,7 +579,7 @@ sal_Bool SAL_CALL ORowSetBase::next( )
ORowSetRow aOldValues = getOldRow(bWasNew);
- positionCache( MOVE_FORWARD );
+ positionCache( CursorMoveDirection::Forward );
bool bAfterLast = m_pCache->isAfterLast();
bRet = m_pCache->next();
doCancelModification( );
@@ -662,7 +662,7 @@ sal_Bool SAL_CALL ORowSetBase::isFirst( )
if ( impl_rowDeleted() )
return ( m_nDeletedPosition == 1 );
- positionCache( MOVE_NONE );
+ positionCache( CursorMoveDirection::Current );
bool bIsFirst = m_pCache->isFirst();
SAL_INFO("dbaccess", "ORowSetBase::isFirst() = " << bIsFirst << " Clone = " << m_bClone);
@@ -692,7 +692,7 @@ sal_Bool SAL_CALL ORowSetBase::isLast( )
return ( m_nDeletedPosition == impl_getRowCount() );
}
- positionCache( MOVE_NONE );
+ positionCache( CursorMoveDirection::Current );
bool bIsLast = m_pCache->isLast();
SAL_INFO("dbaccess", "ORowSetBase::isLast() = " << bIsLast << " Clone = " << m_bClone);
@@ -864,7 +864,7 @@ sal_Int32 ORowSetBase::impl_getRow()
nPos = 0;
else
{
- positionCache( MOVE_NONE );
+ positionCache( CursorMoveDirection::Current );
nPos = m_pCache->getRow();
}
SAL_INFO("dbaccess", "ORowSetBase::impl_getRow() = " << nPos << " Clone = " << m_bClone);
@@ -944,7 +944,7 @@ sal_Bool SAL_CALL ORowSetBase::relative( sal_Int32 rows )
ORowSetRow aOldValues = getOldRow(bWasNew);
- positionCache( rows > 0 ? MOVE_FORWARD : MOVE_BACKWARD );
+ positionCache( rows > 0 ? CursorMoveDirection::Forward : CursorMoveDirection::Backward );
bRet = m_pCache->relative(rows);
doCancelModification( );
@@ -992,7 +992,7 @@ sal_Bool SAL_CALL ORowSetBase::previous( )
ORowSetRow aOldValues = getOldRow(bWasNew);
- positionCache( MOVE_BACKWARD );
+ positionCache( CursorMoveDirection::Backward );
bRet = m_pCache->previous();
doCancelModification( );
@@ -1095,7 +1095,7 @@ void SAL_CALL ORowSetBase::refreshRow( )
{
bool bWasNew = m_pCache->m_bNew || impl_rowDeleted();
ORowSetRow aOldValues = getOldRow(bWasNew);
- positionCache( MOVE_NONE );
+ positionCache( CursorMoveDirection::Current );
m_pCache->refreshRow();
firePropertyChange(aOldValues);
}
@@ -1213,8 +1213,8 @@ bool ORowSetBase::isPropertyChangeNotificationEnabled() const
void ORowSetBase::fireProperty( sal_Int32 _nProperty, bool _bNew, bool _bOld )
{
- Any aNew = css::uno::makeAny( _bNew );
- Any aOld = css::uno::makeAny( _bOld );
+ Any aNew( _bNew );
+ Any aOld( _bOld );
fire( &_nProperty, &aNew, &aOld, 1, false );
}
@@ -1225,7 +1225,7 @@ void ORowSetBase::positionCache( CursorMoveDirection _ePrepareForDirection )
bool bSuccess = false;
if ( m_aBookmark.hasValue() )
{
- if (_ePrepareForDirection == MOVE_NONE_REFRESH ||
+ if (_ePrepareForDirection == CursorMoveDirection::CurrentRefresh ||
(m_pCache->isAfterLast() != bool(isAfterLast())) || ( m_pCache->isBeforeFirst() != bool(isBeforeFirst()) ) ||
m_pCache->compareBookmarks( m_aBookmark, m_pCache->getBookmark() ) != CompareBookmark::EQUAL )
bSuccess = m_pCache->moveToBookmark( m_aBookmark );
@@ -1249,7 +1249,7 @@ void ORowSetBase::positionCache( CursorMoveDirection _ePrepareForDirection )
OSL_ENSURE( m_nDeletedPosition >= 1, "ORowSetBase::positionCache: no bookmark, and no valid 'deleted position'!" );
switch ( _ePrepareForDirection )
{
- case MOVE_FORWARD:
+ case CursorMoveDirection::Forward:
if ( m_nDeletedPosition > 1 )
bSuccess = m_pCache->absolute( m_nDeletedPosition - 1 );
else
@@ -1259,7 +1259,7 @@ void ORowSetBase::positionCache( CursorMoveDirection _ePrepareForDirection )
}
break;
- case MOVE_BACKWARD:
+ case CursorMoveDirection::Backward:
if ( m_pCache->m_bRowCountFinal && ( m_nDeletedPosition == impl_getRowCount() ) )
{
m_pCache->afterLast();
@@ -1269,8 +1269,8 @@ void ORowSetBase::positionCache( CursorMoveDirection _ePrepareForDirection )
bSuccess = m_pCache->absolute( m_nDeletedPosition );
break;
- case MOVE_NONE:
- case MOVE_NONE_REFRESH:
+ case CursorMoveDirection::Current:
+ case CursorMoveDirection::CurrentRefresh:
bSuccess = false; // will be asserted below
break;
}
@@ -1324,7 +1324,7 @@ void ORowSetBase::onDeleteRow( const Any& _rBookmark )
//OSL_ENSURE( m_aBookmark.hasValue(), "ORowSetBase::onDeleteRow: Bookmark isn't valid!" );
if ( compareBookmarks( _rBookmark, m_aBookmark ) == CompareBookmark::EQUAL )
{
- positionCache( MOVE_NONE );
+ positionCache( CursorMoveDirection::Current );
m_nDeletedPosition = m_pCache->getRow();
}
}
@@ -1358,12 +1358,6 @@ sal_Int32 ORowSetBase::impl_getRowCount() const
return nRowCount;
}
-struct ORowSetNotifierImpl
-{
- std::vector<sal_Int32> aChangedColumns;
- ORowSetValueVector::Vector aRow;
-};
-
ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet )
:m_pRowSet( _pRowSet )
@@ -1382,15 +1376,13 @@ ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet )
m_pRowSet->doCancelModification( ORowSetBase::GrantNotifierAccess() );
}
-ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet,const ORowSetValueVector::Vector& i_aRow )
- :m_pImpl(new ORowSetNotifierImpl)
- ,m_pRowSet( _pRowSet )
+ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet, ORowSetValueVector::Vector&& i_aRow )
+ :m_pRowSet( _pRowSet )
,m_bWasNew( false )
,m_bWasModified( false )
{
-
OSL_ENSURE( m_pRowSet, "ORowSetNotifier::ORowSetNotifier: invalid row set. This will crash." );
- m_pImpl->aRow = i_aRow; // yes, create a copy to store the old values
+ aRow = std::move(i_aRow); // yes, create a copy to store the old values
}
ORowSetNotifier::~ORowSetNotifier( )
@@ -1413,24 +1405,19 @@ void ORowSetNotifier::fire()
m_pRowSet->fireProperty( PROPERTY_ID_ISNEW, false, true, ORowSetBase::GrantNotifierAccess() );
}
-std::vector<sal_Int32>& ORowSetNotifier::getChangedColumns() const
+std::vector<sal_Int32>& ORowSetNotifier::getChangedColumns()
{
- OSL_ENSURE(m_pImpl, "Illegal CTor call, use the other one!");
- return m_pImpl->aChangedColumns;
+ return aChangedColumns;
}
void ORowSetNotifier::firePropertyChange()
{
- OSL_ENSURE(m_pImpl, "Illegal CTor call, use the other one!");
- if (m_pImpl)
+ for (auto const& changedColumn : aChangedColumns)
{
- for (auto const& changedColumn : m_pImpl->aChangedColumns)
- {
- m_pRowSet->firePropertyChange(changedColumn-1 ,m_pImpl->aRow[changedColumn-1], ORowSetBase::GrantNotifierAccess());
- }
- if ( !m_pImpl->aChangedColumns.empty() )
- m_pRowSet->fireProperty(PROPERTY_ID_ISMODIFIED,true,false, ORowSetBase::GrantNotifierAccess());
+ m_pRowSet->firePropertyChange(changedColumn-1, aRow[changedColumn-1], ORowSetBase::GrantNotifierAccess());
}
+ if ( !aChangedColumns.empty() )
+ m_pRowSet->fireProperty(PROPERTY_ID_ISMODIFIED,true,false, ORowSetBase::GrantNotifierAccess());
}
} // namespace dbaccess
diff --git a/dbaccess/source/core/api/RowSetBase.hxx b/dbaccess/source/core/api/RowSetBase.hxx
index 58087a85bb14..13d6464cddbf 100644
--- a/dbaccess/source/core/api/RowSetBase.hxx
+++ b/dbaccess/source/core/api/RowSetBase.hxx
@@ -19,7 +19,7 @@
#pragma once
#include <memory>
-#include <cppuhelper/implbase10.hxx>
+#include <cppuhelper/implbase9.hxx>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XColumnLocate.hpp>
@@ -28,7 +28,6 @@
#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <cppuhelper/interfacecontainer.h>
#include <connectivity/sqlerror.hxx>
#include <connectivity/CommonTools.hxx>
@@ -51,7 +50,7 @@ namespace dbaccess
{
class OEmptyCollection;
- typedef ::cppu::ImplHelper10< css::sdbcx::XRowLocate,
+ typedef ::cppu::ImplHelper9< css::sdbcx::XRowLocate,
css::sdbc::XRow,
css::sdbc::XResultSetMetaDataSupplier,
css::sdbc::XWarningsSupplier,
@@ -59,8 +58,7 @@ namespace dbaccess
css::sdbcx::XColumnsSupplier,
css::lang::XServiceInfo,
css::sdbc::XRowSet,
- css::sdbc::XCloseable,
- css::lang::XUnoTunnel> ORowSetBase_BASE;
+ css::sdbc::XCloseable> ORowSetBase_BASE;
class ORowSetCache;
class ORowSetDataColumns;
@@ -143,16 +141,16 @@ namespace dbaccess
virtual void getPropertyDefaultByHandle( sal_Int32 _nHandle, css::uno::Any& _rDefault ) const override;
virtual void SAL_CALL getFastPropertyValue(css::uno::Any& rValue,sal_Int32 nHandle) const override;
- enum CursorMoveDirection
+ enum class CursorMoveDirection
{
/// denotes a cursor move forward
- MOVE_FORWARD,
+ Forward,
/// denotes a cursor move backwards
- MOVE_BACKWARD,
+ Backward,
/// denotes no cursor move at all, but move cache to current row (if it is not there already)
- MOVE_NONE,
+ Current,
/// denotes no cursor move at all, but force the cache to move to current row (and refresh the row)
- MOVE_NONE_REFRESH
+ CurrentRefresh
};
/** positions the cache in preparation of a cursor move
@@ -347,11 +345,11 @@ namespace dbaccess
<p>The class can only be used on the stack, within a method of ORowSetBase (or derivees)</p>
*/
- struct ORowSetNotifierImpl;
class ORowSetNotifier
{
private:
- std::unique_ptr<ORowSetNotifierImpl> m_pImpl;
+ std::vector<sal_Int32> aChangedColumns;
+ ORowSetValueVector::Vector aRow;
ORowSetBase* m_pRowSet;
// not acquired! This is not necessary because this class here is to be used on the stack within
// a method of ORowSetBase (or derivees)
@@ -367,7 +365,7 @@ namespace dbaccess
/** use this one to construct a vector for change value notification
*/
- ORowSetNotifier( ORowSetBase* m_pRowSet,const ORowSetValueVector::Vector& i_aRow );
+ ORowSetNotifier( ORowSetBase* m_pRowSet, ORowSetValueVector::Vector&& i_aRow );
// destructs the object. <member>fire</member> has to be called before.
~ORowSetNotifier( );
@@ -391,9 +389,9 @@ namespace dbaccess
*/
void firePropertyChange();
- /** use this one to store the inde of the changed column values
+ /** use this one to store the index of the changed column values
*/
- std::vector<sal_Int32>& getChangedColumns() const;
+ std::vector<sal_Int32>& getChangedColumns();
};
diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx
index a939cc1e48a4..a41d9e991964 100644
--- a/dbaccess/source/core/api/RowSetCache.cxx
+++ b/dbaccess/source/core/api/RowSetCache.cxx
@@ -45,7 +45,7 @@
#include <connectivity/sqlnode.hxx>
#include <connectivity/sqlparse.hxx>
#include <sqlbison.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
@@ -60,11 +60,7 @@ using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
using namespace ::cppu;
-using namespace ::osl;
-
-#define CHECK_MATRIX_POS(M) OSL_ENSURE(((M) >= static_cast<ORowSetMatrix::difference_type>(0)) && ((M) < static_cast<sal_Int32>(m_pMatrix->size())),"Position is invalid!")
// This class calls m_pCacheSet->FOO_checked(..., sal_False)
// (where FOO is absolute, last, previous)
@@ -209,7 +205,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData();
SelectColumnsMetaData aColumnNames(xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers());
::dbaccess::getColumnPositions(xSelColumns,xPrimaryKeyColumns->getElementNames(),aUpdateTableName,aColumnNames);
- bAllKeysFound = !aColumnNames.empty() && sal_Int32(aColumnNames.size()) == xPrimaryKeyColumns->getElementNames().getLength();
+ bAllKeysFound = !aColumnNames.empty() && aColumnNames.size() == o3tl::make_unsigned(xPrimaryKeyColumns->getElementNames().getLength());
}
}
}
@@ -406,7 +402,7 @@ void ORowSetCache::setFetchSize(sal_Int32 _nSize)
{
if ( rPosChange.second )
{
- CHECK_MATRIX_POS(*aIter);
+ OSL_ENSURE((*aIter >= static_cast<ORowSetMatrix::difference_type>(0)) && (*aIter < static_cast<sal_Int32>(m_pMatrix->size())),"Position is invalid!");
if ( *aIter < _nSize )
aCacheIter->second.aIterator = m_pMatrix->begin() + *aIter++;
else
@@ -457,7 +453,7 @@ static Any lcl_getBookmark(ORowSetValue& i_aValue,OCacheSet* i_pCacheSet)
case DataType::TINYINT:
case DataType::SMALLINT:
case DataType::INTEGER:
- return makeAny(static_cast<sal_Int32>(i_aValue));
+ return Any(i_aValue.getInt32());
default:
if ( i_pCacheSet && i_aValue.isNull())
i_aValue = i_pCacheSet->getBookmark();
@@ -593,7 +589,7 @@ void ORowSetCache::updateCharacterStream( sal_Int32 columnIndex, const Reference
rInsert[columnIndex].setBound(true);
rInsert[columnIndex] = aSeq;
rInsert[columnIndex].setModified(true);
- io_aRow[columnIndex] = makeAny(x);
+ io_aRow[columnIndex] = Any(x);
m_xCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns);
impl_updateRowFromCache_throw(io_aRow,o_ChangedColumns);
@@ -917,7 +913,8 @@ void ORowSetCache::moveWindow()
else
{
// Inside overlap area: move to correct position
- CHECK_MATRIX_POS( (nDist + nStartPosOffset) );
+ OSL_ENSURE(((nDist + nStartPosOffset) >= static_cast<ORowSetMatrix::difference_type>(0)) &&
+ ((nDist + nStartPosOffset) < static_cast<sal_Int32>(m_pMatrix->size())),"Position is invalid!");
rCacheIter.second.aIterator += nStartPosOffset;
OSL_ENSURE(rCacheIter.second.aIterator >= m_pMatrix->begin()
&& rCacheIter.second.aIterator < m_pMatrix->end(),"Iterator out of area!");
@@ -947,7 +944,7 @@ void ORowSetCache::moveWindow()
if ( nRowsInCache < m_nFetchSize )
{
// There is some unused space in *m_pMatrix; fill it
- CHECK_MATRIX_POS(nRowsInCache);
+ OSL_ENSURE((nRowsInCache >= static_cast<ORowSetMatrix::difference_type>(0)) && (o3tl::make_unsigned(nRowsInCache) < m_pMatrix->size()),"Position is invalid!");
sal_Int32 nPos = m_nEndPos + 1;
bool bCheck = m_xCacheSet->absolute(nPos);
ORowSetMatrix::iterator aIter = m_pMatrix->begin() + nRowsInCache;
@@ -965,7 +962,7 @@ void ORowSetCache::moveWindow()
// The rows behind this can be reused
ORowSetMatrix::iterator aIter = m_pMatrix->begin();
const sal_Int32 nNewStartPosInMatrix = nNewStartPos - m_nStartPos;
- CHECK_MATRIX_POS( nNewStartPosInMatrix );
+ OSL_ENSURE((nNewStartPosInMatrix >= static_cast<ORowSetMatrix::difference_type>(0)) && (o3tl::make_unsigned(nNewStartPosInMatrix) < m_pMatrix->size()),"Position is invalid!");
// first position we reuse
const ORowSetMatrix::const_iterator aEnd = m_pMatrix->begin() + nNewStartPosInMatrix;
// End of used portion of the matrix. Is < m_pMatrix->end() if less data than window size
@@ -1624,8 +1621,8 @@ void ORowSetCache::clearInsertRow()
ORowSetMatrix::iterator ORowSetCache::calcPosition() const
{
sal_Int32 nValue = (m_nPosition - m_nStartPos) - 1;
- CHECK_MATRIX_POS(nValue);
- return ( nValue < 0 || nValue >= static_cast<sal_Int32>(m_pMatrix->size()) ) ? m_pMatrix->end() : (m_pMatrix->begin() + nValue);
+ OSL_ENSURE((nValue >= static_cast<ORowSetMatrix::difference_type>(0)) && (o3tl::make_unsigned(nValue) < m_pMatrix->size()),"Position is invalid!");
+ return ( nValue < 0 || o3tl::make_unsigned(nValue) >= m_pMatrix->size() ) ? m_pMatrix->end() : (m_pMatrix->begin() + nValue);
}
TORowSetOldRowHelperRef ORowSetCache::registerOldRow()
diff --git a/dbaccess/source/core/api/RowSetCacheIterator.hxx b/dbaccess/source/core/api/RowSetCacheIterator.hxx
index 9c7a9afd4deb..f5d5e6783b65 100644
--- a/dbaccess/source/core/api/RowSetCacheIterator.hxx
+++ b/dbaccess/source/core/api/RowSetCacheIterator.hxx
@@ -21,6 +21,7 @@
#include <sal/config.h>
#include <map>
+#include <utility>
#include "RowSetRow.hxx"
@@ -43,8 +44,8 @@ namespace dbaccess
ORowSetCache* m_pCache;
ORowSetBase* m_pRowSet;
- ORowSetCacheIterator(const ORowSetCacheMap::iterator& _rIter,ORowSetCache* _pCache,ORowSetBase* _pRowSet)
- : m_aIter(_rIter)
+ ORowSetCacheIterator(ORowSetCacheMap::iterator _aIter, ORowSetCache* _pCache,ORowSetBase* _pRowSet)
+ : m_aIter(std::move(_aIter))
,m_pCache(_pCache)
,m_pRowSet(_pRowSet)
{
diff --git a/dbaccess/source/core/api/RowSetRow.hxx b/dbaccess/source/core/api/RowSetRow.hxx
index 7f24267b7530..a847399dd1e9 100644
--- a/dbaccess/source/core/api/RowSetRow.hxx
+++ b/dbaccess/source/core/api/RowSetRow.hxx
@@ -22,6 +22,7 @@
#include <connectivity/CommonTools.hxx>
#include <connectivity/FValue.hxx>
#include <salhelper/simplereferenceobject.hxx>
+#include <utility>
namespace dbaccess
{
@@ -36,8 +37,8 @@ namespace dbaccess
ORowSetOldRowHelper& operator=(const ORowSetOldRowHelper& _rRH) = delete;
ORowSetOldRowHelper(const ORowSetOldRowHelper& _rRh) = delete;
public:
- explicit ORowSetOldRowHelper(const ORowSetRow& _rRow)
- : m_aRow(_rRow)
+ explicit ORowSetOldRowHelper(ORowSetRow _aRow)
+ : m_aRow(std::move(_aRow))
{}
const ORowSetRow& getRow() const { return m_aRow; }
diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
index 2284f1db3e3f..f6dffbd1314a 100644
--- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
+++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
@@ -21,6 +21,7 @@
#include <sal/log.hxx>
#include <composertools.hxx>
#include <strings.hrc>
+#include <strings.hxx>
#include <core_resource.hxx>
#include <stringconstants.hxx>
#include "HelperCollections.hxx"
@@ -48,7 +49,7 @@
#include <connectivity/dbtools.hxx>
#include <connectivity/PColumn.hxx>
#include <connectivity/predicateinput.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <unotools/sharedunocomponent.hxx>
@@ -77,18 +78,18 @@ namespace dbaccess {
namespace BooleanComparisonMode = ::com::sun::star::sdb::BooleanComparisonMode;
}
-#define STR_SELECT "SELECT "
-#define STR_FROM " FROM "
-#define STR_WHERE " WHERE "
-#define STR_GROUP_BY " GROUP BY "
-#define STR_HAVING " HAVING "
-#define STR_ORDER_BY " ORDER BY "
-#define STR_AND " AND "
-#define STR_OR " OR "
+constexpr OUStringLiteral STR_SELECT = u"SELECT ";
+constexpr OUStringLiteral STR_FROM = u" FROM ";
+constexpr OUString STR_WHERE = u" WHERE "_ustr;
+constexpr OUStringLiteral STR_GROUP_BY = u" GROUP BY ";
+constexpr OUStringLiteral STR_HAVING = u" HAVING ";
+constexpr OUStringLiteral STR_ORDER_BY = u" ORDER BY ";
+constexpr OUString STR_AND = u" AND "_ustr;
+constexpr OUString STR_OR = u" OR "_ustr;
constexpr OUStringLiteral STR_LIKE = u" LIKE ";
-#define L_BRACKET "("
-#define R_BRACKET ")"
-#define COMMA ","
+constexpr OUString L_BRACKET = u"("_ustr;
+constexpr OUString R_BRACKET = u")"_ustr;
+constexpr OUStringLiteral COMMA = u",";
namespace
{
@@ -105,8 +106,8 @@ namespace
{
OUString sSQLStateGeneralError( getStandardSQLState( StandardSQLState::GENERAL_ERROR ) );
SQLException aError2( aErrorMsg, _rxContext, sSQLStateGeneralError, 1000, Any() );
- SQLException aError1( _rStatement, _rxContext, sSQLStateGeneralError, 1000, makeAny( aError2 ) );
- throw SQLException(_rParser.getContext().getErrorMessage(OParseContext::ErrorCode::General),_rxContext,sSQLStateGeneralError,1000,makeAny(aError1));
+ SQLException aError1( _rStatement, _rxContext, sSQLStateGeneralError, 1000, Any( aError2 ) );
+ throw SQLException(_rParser.getContext().getErrorMessage(OParseContext::ErrorCode::General),_rxContext,sSQLStateGeneralError,1000,Any(aError1));
}
return pNewSqlParseNode;
}
@@ -132,7 +133,7 @@ namespace
// and now really ...
SQLException aError1( _rOriginatingCommand, _rxContext, getStandardSQLState( StandardSQLState::GENERAL_ERROR ), 1000, Any() );
throw SQLException( DBA_RES( RID_STR_ONLY_QUERY ), _rxContext,
- getStandardSQLState( StandardSQLState::GENERAL_ERROR ), 1000, makeAny( aError1 ) );
+ getStandardSQLState( StandardSQLState::GENERAL_ERROR ), 1000, Any( aError1 ) );
}
delete pOldNode;
@@ -216,7 +217,7 @@ OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc
const Reference<XComponentContext>& _rContext )
:OSubComponent(m_aMutex,_xConnection)
,OPropertyContainer(m_aBHelper)
- ,m_aSqlParser( _rContext, &m_aParseContext )
+ ,m_aSqlParser( _rContext, &m_aParseContext, &m_aNeutralContext )
,m_aSqlIterator( _xConnection, _rxTables, m_aSqlParser )
,m_aAdditiveIterator( _xConnection, _rxTables, m_aSqlParser )
,m_aElementaryParts( size_t(SQLPartCount) )
@@ -244,7 +245,7 @@ OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc
{
Any aValue;
Reference<XInterface> xDs = dbaccess::getDataSource(_xConnection);
- if ( dbtools::getDataSourceSetting(xDs,static_cast <OUString> (PROPERTY_BOOLEANCOMPARISONMODE),aValue) )
+ if ( dbtools::getDataSourceSetting(xDs,PROPERTY_BOOLEANCOMPARISONMODE,aValue) )
{
OSL_VERIFY( aValue >>= m_nBoolCompareMode );
}
@@ -278,15 +279,54 @@ void SAL_CALL OSingleSelectQueryComposer::disposing()
}
IMPLEMENT_FORWARD_XINTERFACE3(OSingleSelectQueryComposer,OSubComponent,OSingleSelectQueryComposer_BASE,OPropertyContainer)
-IMPLEMENT_SERVICE_INFO1(OSingleSelectQueryComposer,"org.openoffice.comp.dba.OSingleSelectQueryComposer",SERVICE_NAME_SINGLESELECTQUERYCOMPOSER)
+OUString SAL_CALL OSingleSelectQueryComposer::getImplementationName()
+ {
+ return "org.openoffice.comp.dba.OSingleSelectQueryComposer";
+ }
+sal_Bool SAL_CALL OSingleSelectQueryComposer::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ }
+css::uno::Sequence< OUString > SAL_CALL OSingleSelectQueryComposer::getSupportedServiceNames()
+{
+ return { SERVICE_NAME_SINGLESELECTQUERYCOMPOSER };
+}
css::uno::Sequence<sal_Int8> OSingleSelectQueryComposer::getImplementationId()
{
return css::uno::Sequence<sal_Int8>();
}
-IMPLEMENT_GETTYPES3(OSingleSelectQueryComposer,OSubComponent,OSingleSelectQueryComposer_BASE,OPropertyContainer)
-IMPLEMENT_PROPERTYCONTAINER_DEFAULTS(OSingleSelectQueryComposer)
+css::uno::Sequence< css::uno::Type > OSingleSelectQueryComposer::getTypes()
+{
+ return ::comphelper::concatSequences(
+ OSubComponent::getTypes( ),
+ OSingleSelectQueryComposer_BASE::getTypes( ),
+ OPropertyContainer::getTypes( )
+ );
+}
+
+css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL OSingleSelectQueryComposer::getPropertySetInfo()
+{
+ Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+}
+::cppu::IPropertyArrayHelper& OSingleSelectQueryComposer::getInfoHelper()
+{
+ return *OSingleSelectQueryComposer::getArrayHelper();
+}
+::cppu::IPropertyArrayHelper* OSingleSelectQueryComposer::createArrayHelper( ) const
+{
+ css::uno::Sequence< css::beans::Property > aProps;
+ describeProperties(aProps);
+ return new ::cppu::OPropertyArrayHelper(aProps);
+}
+
// XSingleSelectQueryAnalyzer
OUString SAL_CALL OSingleSelectQueryComposer::getQuery( )
@@ -431,11 +471,11 @@ OUString OSingleSelectQueryComposer::impl_getColumnRealName_throw(const Referenc
|| !m_aCurrentColumns[SelectColumns]
|| !column->getPropertySetInfo()->hasPropertyByName(PROPERTY_NAME)
)
- {
- OUString sError(DBA_RES(RID_STR_COLUMN_UNKNOWN_PROP));
- SQLException aErr(sError.replaceAll("%value", PROPERTY_NAME),*this,SQLSTATE_GENERAL,1000,Any() );
- throw SQLException(DBA_RES(RID_STR_COLUMN_NOT_VALID),*this,SQLSTATE_GENERAL,1000,makeAny(aErr) );
- }
+ {
+ OUString sError(DBA_RES(RID_STR_COLUMN_UNKNOWN_PROP));
+ SQLException aErr(sError.replaceAll("%value", PROPERTY_NAME),*this,SQLSTATE_GENERAL,1000,Any() );
+ throw SQLException(DBA_RES(RID_STR_COLUMN_NOT_VALID),*this,SQLSTATE_GENERAL,1000,Any(aErr) );
+ }
OUString aName, aNewName;
column->getPropertyValue(PROPERTY_NAME) >>= aName;
@@ -471,9 +511,9 @@ OUString OSingleSelectQueryComposer::impl_getColumnRealName_throw(const Referenc
{
if(sTableName.indexOf('.') != -1)
{
- OUString aCatlog,aSchema,aTable;
- ::dbtools::qualifiedNameComponents(m_xMetaData,sTableName,aCatlog,aSchema,aTable,::dbtools::EComposeRule::InDataManipulation);
- sTableName = ::dbtools::composeTableName( m_xMetaData, aCatlog, aSchema, aTable, true, ::dbtools::EComposeRule::InDataManipulation );
+ OUString aCatalog,aSchema,aTable;
+ ::dbtools::qualifiedNameComponents(m_xMetaData,sTableName,aCatalog,aSchema,aTable,::dbtools::EComposeRule::InDataManipulation);
+ sTableName = ::dbtools::composeTableName( m_xMetaData, aCatalog, aSchema, aTable, true, ::dbtools::EComposeRule::InDataManipulation );
}
else if (!sTableName.isEmpty())
sTableName = ::dbtools::quoteName(aQuote,sTableName);
@@ -501,11 +541,11 @@ OUString OSingleSelectQueryComposer::impl_getColumnNameOrderBy_throw(const Refer
|| !m_aCurrentColumns[SelectColumns]
|| !column->getPropertySetInfo()->hasPropertyByName(PROPERTY_NAME)
)
- {
- OUString sError(DBA_RES(RID_STR_COLUMN_UNKNOWN_PROP));
- SQLException aErr(sError.replaceAll("%value", PROPERTY_NAME),*this,SQLSTATE_GENERAL,1000,Any() );
- throw SQLException(DBA_RES(RID_STR_COLUMN_NOT_VALID),*this,SQLSTATE_GENERAL,1000,makeAny(aErr) );
- }
+ {
+ OUString sError(DBA_RES(RID_STR_COLUMN_UNKNOWN_PROP));
+ SQLException aErr(sError.replaceAll("%value", PROPERTY_NAME),*this,SQLSTATE_GENERAL,1000,Any() );
+ throw SQLException(DBA_RES(RID_STR_COLUMN_NOT_VALID),*this,SQLSTATE_GENERAL,1000,Any(aErr) );
+ }
OUString aName;
column->getPropertyValue(PROPERTY_NAME) >>= aName;
@@ -717,7 +757,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getTables( )
for (auto const& elem : aTables)
aNames.push_back(elem.first);
- m_pTables.reset( new OPrivateTables(aTables,m_xMetaData->supportsMixedCaseQuotedIdentifiers(),*this,m_aMutex,aNames) );
+ m_pTables.reset( new OPrivateTables(aTables,m_xMetaData->supportsMixedCaseQuotedIdentifiers(),*this,m_aMutex,std::move(aNames)) );
}
return m_pTables.get();
@@ -752,7 +792,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( )
bCase = m_xMetaData->supportsMixedCaseQuotedIdentifiers();
aSelectColumns = m_aSqlIterator.getSelectColumns();
- OUStringBuffer aSQL( m_aPureSelectSQL + STR_WHERE " ( 0 = 1 )");
+ OUStringBuffer aSQL( m_aPureSelectSQL + STR_WHERE + " ( 0 = 1 )");
// preserve the original WHERE clause
// #i102234#
@@ -807,7 +847,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( )
{
xStatement.reset( Reference< XStatement >( m_xConnection->createStatement(), UNO_SET_THROW ) );
Reference< XPropertySet > xStatementProps( xStatement, UNO_QUERY_THROW );
- try { xStatementProps->setPropertyValue( PROPERTY_ESCAPE_PROCESSING, makeAny( false ) ); }
+ try { xStatementProps->setPropertyValue( PROPERTY_ESCAPE_PROCESSING, Any( false ) ); }
catch ( const Exception& ) { DBG_UNHANDLED_EXCEPTION("dbaccess"); }
xResMetaDataSup.set( xStatement->executeQuery( sSQL ), UNO_QUERY_THROW );
xResultSetMeta.set( xResMetaDataSup->getMetaData(), UNO_SET_THROW );
@@ -1484,9 +1524,9 @@ OUString OSingleSelectQueryComposer::getStatementPart( TGetParseNode const & _aG
namespace
{
- OUString lcl_getDecomposedColumnName(const OUString& rComposedName, const OUString& rQuoteString)
+ OUString lcl_getDecomposedColumnName(const OUString& rComposedName, std::u16string_view rQuoteString)
{
- const sal_Int32 nQuoteLength = rQuoteString.getLength();
+ const size_t nQuoteLength = rQuoteString.size();
OUString sName = rComposedName.trim();
OUString sColumnName;
sal_Int32 nPos, nRPos = 0;
@@ -1499,7 +1539,7 @@ namespace
nRPos = sName.indexOf( rQuoteString, nPos + nQuoteLength );
if ( nRPos > nPos )
{
- if ( nRPos + nQuoteLength < sName.getLength() )
+ if ( static_cast<sal_Int32>(nRPos + nQuoteLength) < sName.getLength() )
{
nRPos += nQuoteLength; // -1 + 1 skip dot
}
@@ -1521,7 +1561,7 @@ namespace
OUString lcl_getCondition(const Sequence< Sequence< PropertyValue > >& filter,
const OPredicateInputController& i_aPredicateInputController,
const Reference< XNameAccess >& i_xSelectColumns,
- const OUString& rQuoteString)
+ std::u16string_view rQuoteString)
{
OUStringBuffer sRet;
const Sequence< PropertyValue >* pOrIter = filter.getConstArray();
@@ -1620,9 +1660,9 @@ void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropert
xColumn->getPropertyValue(PROPERTY_TABLENAME) >>= sTableName;
if(sTableName.indexOf('.') != -1)
{
- OUString aCatlog,aSchema,aTable;
- ::dbtools::qualifiedNameComponents(m_xMetaData,sTableName,aCatlog,aSchema,aTable,::dbtools::EComposeRule::InDataManipulation);
- sTableName = ::dbtools::composeTableName( m_xMetaData, aCatlog, aSchema, aTable, true, ::dbtools::EComposeRule::InDataManipulation );
+ OUString aCatalog,aSchema,aTable;
+ ::dbtools::qualifiedNameComponents(m_xMetaData,sTableName,aCatalog,aSchema,aTable,::dbtools::EComposeRule::InDataManipulation);
+ sTableName = ::dbtools::composeTableName( m_xMetaData, aCatalog, aSchema, aTable, true, ::dbtools::EComposeRule::InDataManipulation );
}
else
sTableName = ::dbtools::quoteName(aQuote,sTableName);
@@ -1726,7 +1766,7 @@ void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropert
if ( !sFilter.isEmpty() && !aSQL.isEmpty() )
{
sFilter = L_BRACKET + sFilter + R_BRACKET +
- (andCriteria ? std::u16string_view(u"" STR_AND) : std::u16string_view(u"" STR_OR));
+ (andCriteria ? std::u16string_view(STR_AND) : std::u16string_view(STR_OR));
}
sFilter += aSQL;
diff --git a/dbaccess/source/core/api/StaticSet.cxx b/dbaccess/source/core/api/StaticSet.cxx
index 61cfb0af736f..57eea66f34cf 100644
--- a/dbaccess/source/core/api/StaticSet.cxx
+++ b/dbaccess/source/core/api/StaticSet.cxx
@@ -23,17 +23,14 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <connectivity/CommonTools.hxx>
#include <comphelper/types.hxx>
+#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
using namespace dbaccess;
using namespace connectivity;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace ::osl;
void OStaticSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 /*_nPosition*/)
{
@@ -43,7 +40,7 @@ void OStaticSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 /*_nPosition*/)
// css::sdbcx::XRowLocate
Any OStaticSet::getBookmark()
{
- return makeAny(getRow());
+ return Any(getRow());
}
bool OStaticSet::moveToBookmark( const Any& bookmark )
@@ -80,7 +77,7 @@ bool OStaticSet::fetchRow()
m_aSet.push_back(new connectivity::ORowVector< connectivity::ORowSetValue >(m_xSetMetaData->getColumnCount()));
m_aSetIter = m_aSet.end() - 1;
(**m_aSetIter)[0] = getRow();
- OCacheSet::fillValueRow(*m_aSetIter,(**m_aSetIter)[0]);
+ OCacheSet::fillValueRow(*m_aSetIter,(**m_aSetIter)[0].getInt32());
}
else
m_bEnd = true;
@@ -99,7 +96,7 @@ void OStaticSet::fillAllRows()
m_aSet.push_back(pRow);
m_aSetIter = m_aSet.end() - 1;
(*pRow)[0] = getRow();
- OCacheSet::fillValueRow(pRow,(*pRow)[0]);
+ OCacheSet::fillValueRow(pRow,(*pRow)[0].getInt32());
}
m_bEnd = true;
}
@@ -193,7 +190,7 @@ bool OStaticSet::absolute( sal_Int32 row )
}
else if(row > 0)
{
- if(row >= static_cast<sal_Int32>(m_aSet.size()))
+ if(o3tl::make_unsigned(row) >= m_aSet.size())
{
if(!m_bEnd)
{
@@ -202,7 +199,7 @@ bool OStaticSet::absolute( sal_Int32 row )
bNext = fetchRow();
}
- if(row > static_cast<sal_Int32>(m_aSet.size()))
+ if(o3tl::make_unsigned(row) > m_aSet.size())
m_aSetIter = m_aSet.end(); // check again
else
m_aSetIter = m_aSet.begin() + row;
diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx
index 6dff0b3b0964..92821750f9dc 100644
--- a/dbaccess/source/core/api/TableDeco.cxx
+++ b/dbaccess/source/core/api/TableDeco.cxx
@@ -18,15 +18,14 @@
*/
#include <TableDeco.hxx>
-#include <apitools.hxx>
#include <definitioncolumn.hxx>
#include <stringconstants.hxx>
+#include <strings.hxx>
#include <core_resource.hxx>
#include <strings.hrc>
#include <osl/diagnose.h>
#include <sal/log.hxx>
-#include <cppuhelper/typeprovider.hxx>
#include <comphelper/property.hxx>
#include <comphelper/servicehelper.hxx>
#include <com/sun/star/sdbc/SQLException.hpp>
@@ -311,7 +310,7 @@ void ODBTableDecorator::construct()
Reference<XPropertySetInfo> xInfo = xProp->getPropertySetInfo();
Sequence< Property > aTableProps = xInfo->getProperties();
- for (Property & prop : aTableProps)
+ for (Property & prop : asNonConstRange(aTableProps))
{
if (prop.Name == PROPERTY_CATALOGNAME)
prop.Handle = PROPERTY_ID_CATALOGNAME;
@@ -351,7 +350,24 @@ void ODBTableDecorator::construct()
}
// XServiceInfo
-IMPLEMENT_SERVICE_INFO1(ODBTableDecorator, "com.sun.star.sdb.dbaccess.ODBTableDecorator", SERVICE_SDBCX_TABLE)
+OUString SAL_CALL ODBTableDecorator::getImplementationName()
+ {
+ return "com.sun.star.sdb.dbaccess.ODBTableDecorator";
+ }
+sal_Bool SAL_CALL ODBTableDecorator::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ }
+css::uno::Sequence< OUString > SAL_CALL ODBTableDecorator::getSupportedServiceNames()
+{
+ return { SERVICE_SDBCX_TABLE };
+}
+
Any SAL_CALL ODBTableDecorator::queryInterface( const Type & rType )
{
@@ -451,8 +467,8 @@ OUString SAL_CALL ODBTableDecorator::getName()
sal_Int64 SAL_CALL ODBTableDecorator::getSomething( const Sequence< sal_Int8 >& rId )
{
- if (isUnoTunnelId<ODBTableDecorator>(rId))
- return reinterpret_cast<sal_Int64>(this);
+ if (comphelper::isUnoTunnelId<ODBTableDecorator>(rId))
+ return comphelper::getSomething_cast(this);
sal_Int64 nRet = 0;
Reference<XUnoTunnel> xTunnel(m_xTable,UNO_QUERY);
@@ -461,11 +477,10 @@ sal_Int64 SAL_CALL ODBTableDecorator::getSomething( const Sequence< sal_Int8 >&
return nRet;
}
-Sequence< sal_Int8 > ODBTableDecorator::getUnoTunnelId()
+const Sequence< sal_Int8 > & ODBTableDecorator::getUnoTunnelId()
{
- static ::cppu::OImplementationId implId;
-
- return implId.getImplementationId();
+ static const comphelper::UnoIdInit implId;
+ return implId.getSeq();
}
void ODBTableDecorator::fillPrivileges() const
@@ -534,11 +549,8 @@ void ODBTableDecorator::refreshColumns()
xNames = m_xTable->getColumns();
if(xNames.is())
{
- Sequence< OUString> aNames = xNames->getElementNames();
- const OUString* pIter = aNames.getConstArray();
- const OUString* pEnd = pIter + aNames.getLength();
- for(;pIter != pEnd;++pIter)
- aVector.push_back(*pIter);
+ const Sequence< OUString> aNames = xNames->getElementNames();
+ aVector.insert(aVector.end(), aNames.begin(), aNames.end());
}
}
if(!m_pColumns)
diff --git a/dbaccess/source/core/api/View.cxx b/dbaccess/source/core/api/View.cxx
index c52c4885c757..ce813b29ee82 100644
--- a/dbaccess/source/core/api/View.cxx
+++ b/dbaccess/source/core/api/View.cxx
@@ -24,7 +24,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaccess
{
diff --git a/dbaccess/source/core/api/WrappedResultSet.cxx b/dbaccess/source/core/api/WrappedResultSet.cxx
index a0999e5f32aa..a4ad9f363cae 100644
--- a/dbaccess/source/core/api/WrappedResultSet.cxx
+++ b/dbaccess/source/core/api/WrappedResultSet.cxx
@@ -23,12 +23,8 @@
using namespace dbaccess;
using namespace ::connectivity;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace ::osl;
void WrappedResultSet::construct(const Reference< XResultSet>& _xDriverSet,const OUString& i_sRowSetFilter)
{
@@ -49,7 +45,7 @@ Any WrappedResultSet::getBookmark()
{
return m_xRowLocate->getBookmark( );
}
- return makeAny(m_xDriverSet->getRow());
+ return Any(m_xDriverSet->getRow());
}
bool WrappedResultSet::moveToBookmark( const Any& bookmark )
@@ -122,56 +118,56 @@ void WrappedResultSet::updateColumn(sal_Int32 nPos, const Reference< XRowUpdate
break;
case DataType::CHAR:
case DataType::VARCHAR:
- _xParameter->updateString(nPos,_rValue);
+ _xParameter->updateString(nPos,_rValue.getString());
break;
case DataType::BIGINT:
if ( _rValue.isSigned() )
- _xParameter->updateLong(nPos,_rValue);
+ _xParameter->updateLong(nPos,_rValue.getLong());
else
- _xParameter->updateString(nPos,_rValue);
+ _xParameter->updateString(nPos,_rValue.getString());
break;
case DataType::BIT:
case DataType::BOOLEAN:
- _xParameter->updateBoolean(nPos,static_cast<bool>(_rValue));
+ _xParameter->updateBoolean(nPos,_rValue.getBool());
break;
case DataType::TINYINT:
if ( _rValue.isSigned() )
- _xParameter->updateByte(nPos,_rValue);
+ _xParameter->updateByte(nPos,_rValue.getInt8());
else
- _xParameter->updateShort(nPos,_rValue);
+ _xParameter->updateShort(nPos,_rValue.getInt16());
break;
case DataType::SMALLINT:
if ( _rValue.isSigned() )
- _xParameter->updateShort(nPos,_rValue);
+ _xParameter->updateShort(nPos,_rValue.getInt16());
else
- _xParameter->updateInt(nPos,_rValue);
+ _xParameter->updateInt(nPos,_rValue.getInt32());
break;
case DataType::INTEGER:
if ( _rValue.isSigned() )
- _xParameter->updateInt(nPos,_rValue);
+ _xParameter->updateInt(nPos,_rValue.getInt32());
else
- _xParameter->updateLong(nPos,_rValue);
+ _xParameter->updateLong(nPos,_rValue.getLong());
break;
case DataType::FLOAT:
- _xParameter->updateFloat(nPos,_rValue);
+ _xParameter->updateFloat(nPos,_rValue.getFloat());
break;
case DataType::DOUBLE:
case DataType::REAL:
- _xParameter->updateDouble(nPos,_rValue);
+ _xParameter->updateDouble(nPos,_rValue.getDouble());
break;
case DataType::DATE:
- _xParameter->updateDate(nPos,_rValue);
+ _xParameter->updateDate(nPos,_rValue.getDate());
break;
case DataType::TIME:
- _xParameter->updateTime(nPos,_rValue);
+ _xParameter->updateTime(nPos,_rValue.getTime());
break;
case DataType::TIMESTAMP:
- _xParameter->updateTimestamp(nPos,_rValue);
+ _xParameter->updateTimestamp(nPos,_rValue.getDateTime());
break;
case DataType::BINARY:
case DataType::VARBINARY:
case DataType::LONGVARBINARY:
- _xParameter->updateBytes(nPos,_rValue);
+ _xParameter->updateBytes(nPos,_rValue.getSequence());
break;
case DataType::BLOB:
case DataType::CLOB:
diff --git a/dbaccess/source/core/api/callablestatement.cxx b/dbaccess/source/core/api/callablestatement.cxx
index 8f864fbe04dd..25f3f405f8c1 100644
--- a/dbaccess/source/core/api/callablestatement.cxx
+++ b/dbaccess/source/core/api/callablestatement.cxx
@@ -24,10 +24,7 @@
using namespace dbaccess;
using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
using namespace ::cppu;
using namespace ::osl;
@@ -84,7 +81,7 @@ void SAL_CALL OCallableStatement::registerOutParameter( sal_Int32 parameterIndex
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
Reference< XOutParameters >(m_xAggregateAsSet, UNO_QUERY_THROW)->registerOutParameter( parameterIndex, sqlType, typeName );
}
@@ -92,7 +89,7 @@ void SAL_CALL OCallableStatement::registerOutParameter( sal_Int32 parameterIndex
void SAL_CALL OCallableStatement::registerNumericOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, sal_Int32 scale )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
Reference< XOutParameters >(m_xAggregateAsSet, UNO_QUERY_THROW)->registerNumericOutParameter( parameterIndex, sqlType, scale );
}
@@ -101,7 +98,7 @@ void SAL_CALL OCallableStatement::registerNumericOutParameter( sal_Int32 paramet
sal_Bool SAL_CALL OCallableStatement::wasNull( )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->wasNull();
}
@@ -109,7 +106,7 @@ sal_Bool SAL_CALL OCallableStatement::wasNull( )
OUString SAL_CALL OCallableStatement::getString( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getString( columnIndex );
}
@@ -117,7 +114,7 @@ OUString SAL_CALL OCallableStatement::getString( sal_Int32 columnIndex )
sal_Bool SAL_CALL OCallableStatement::getBoolean( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBoolean( columnIndex );
}
@@ -125,7 +122,7 @@ sal_Bool SAL_CALL OCallableStatement::getBoolean( sal_Int32 columnIndex )
sal_Int8 SAL_CALL OCallableStatement::getByte( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getByte( columnIndex );
}
@@ -133,63 +130,63 @@ sal_Int8 SAL_CALL OCallableStatement::getByte( sal_Int32 columnIndex )
sal_Int16 SAL_CALL OCallableStatement::getShort( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getShort( columnIndex );
}
sal_Int32 SAL_CALL OCallableStatement::getInt( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getInt( columnIndex );
}
sal_Int64 SAL_CALL OCallableStatement::getLong( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getLong( columnIndex );
}
float SAL_CALL OCallableStatement::getFloat( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getFloat( columnIndex );
}
double SAL_CALL OCallableStatement::getDouble( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getDouble( columnIndex );
}
Sequence< sal_Int8 > SAL_CALL OCallableStatement::getBytes( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBytes( columnIndex );
}
css::util::Date SAL_CALL OCallableStatement::getDate( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getDate( columnIndex );
}
css::util::Time SAL_CALL OCallableStatement::getTime( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getTime( columnIndex );
}
css::util::DateTime SAL_CALL OCallableStatement::getTimestamp( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getTimestamp( columnIndex );
}
@@ -197,7 +194,7 @@ css::util::DateTime SAL_CALL OCallableStatement::getTimestamp( sal_Int32 columnI
Reference< css::io::XInputStream > SAL_CALL OCallableStatement::getBinaryStream( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBinaryStream( columnIndex );
}
@@ -205,7 +202,7 @@ Reference< css::io::XInputStream > SAL_CALL OCallableStatement::getBinaryStream(
Reference< css::io::XInputStream > SAL_CALL OCallableStatement::getCharacterStream( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getCharacterStream( columnIndex );
}
@@ -213,7 +210,7 @@ Reference< css::io::XInputStream > SAL_CALL OCallableStatement::getCharacterStre
Any SAL_CALL OCallableStatement::getObject( sal_Int32 columnIndex, const Reference< css::container::XNameAccess >& typeMap )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getObject( columnIndex, typeMap );
}
@@ -221,28 +218,28 @@ Any SAL_CALL OCallableStatement::getObject( sal_Int32 columnIndex, const Referen
Reference< XRef > SAL_CALL OCallableStatement::getRef( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getRef( columnIndex );
}
Reference< XBlob > SAL_CALL OCallableStatement::getBlob( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBlob( columnIndex );
}
Reference< XClob > SAL_CALL OCallableStatement::getClob( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getClob( columnIndex );
}
Reference< XArray > SAL_CALL OCallableStatement::getArray( sal_Int32 columnIndex )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getArray( columnIndex );
}
diff --git a/dbaccess/source/core/api/column.cxx b/dbaccess/source/core/api/column.cxx
index 5bc70affbce0..ad205c3248fa 100644
--- a/dbaccess/source/core/api/column.cxx
+++ b/dbaccess/source/core/api/column.cxx
@@ -34,19 +34,16 @@
#include <connectivity/TTableHelper.hxx>
#include <connectivity/dbexception.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <utility>
#include <osl/diagnose.h>
using namespace dbaccess;
using namespace connectivity;
-using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::io;
using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::util;
using namespace ::osl;
using namespace ::comphelper;
using namespace ::cppu;
@@ -147,7 +144,7 @@ OColumns::OColumns(::cppu::OWeakObject& _rParent,
}
OColumns::OColumns(::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
- const css::uno::Reference< css::container::XNameAccess >& _rxDrvColumns,
+ css::uno::Reference< css::container::XNameAccess > _xDrvColumns,
bool _bCaseSensitive,const std::vector< OUString> &_rVector,
IColumnFactory* _pColFactory,
::connectivity::sdbcx::IRefreshableColumns* _pRefresh,
@@ -156,7 +153,7 @@ OColumns::OColumns(::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
bool _bUseHardRef)
: OColumns_BASE(_rParent,_bCaseSensitive,_rMutex,_rVector,_bUseHardRef)
,m_pMediator(nullptr)
- ,m_xDrvColumns(_rxDrvColumns)
+ ,m_xDrvColumns(std::move(_xDrvColumns))
,m_pColFactoryImpl(_pColFactory)
,m_pRefreshColumns(_pRefresh)
,m_bInitialized(false)
diff --git a/dbaccess/source/core/api/columnsettings.cxx b/dbaccess/source/core/api/columnsettings.cxx
index 3f62a5a691fe..505e0d36b98f 100644
--- a/dbaccess/source/core/api/columnsettings.cxx
+++ b/dbaccess/source/core/api/columnsettings.cxx
@@ -24,7 +24,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <comphelper/property.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaccess
{
@@ -121,14 +121,14 @@ namespace dbaccess
};
const PropertyDescriptor aProps[] =
{
- { OUString(PROPERTY_ALIGN), PROPERTY_ID_ALIGN },
- { OUString(PROPERTY_NUMBERFORMAT), PROPERTY_ID_NUMBERFORMAT },
- { OUString(PROPERTY_RELATIVEPOSITION), PROPERTY_ID_RELATIVEPOSITION },
- { OUString(PROPERTY_WIDTH), PROPERTY_ID_WIDTH },
- { OUString(PROPERTY_HELPTEXT), PROPERTY_ID_HELPTEXT },
- { OUString(PROPERTY_CONTROLDEFAULT), PROPERTY_ID_CONTROLDEFAULT },
- { OUString(PROPERTY_CONTROLMODEL), PROPERTY_ID_CONTROLMODEL },
- { OUString(PROPERTY_HIDDEN), PROPERTY_ID_HIDDEN }
+ { PROPERTY_ALIGN, PROPERTY_ID_ALIGN },
+ { PROPERTY_NUMBERFORMAT, PROPERTY_ID_NUMBERFORMAT },
+ { PROPERTY_RELATIVEPOSITION, PROPERTY_ID_RELATIVEPOSITION },
+ { PROPERTY_WIDTH, PROPERTY_ID_WIDTH },
+ { PROPERTY_HELPTEXT, PROPERTY_ID_HELPTEXT },
+ { PROPERTY_CONTROLDEFAULT, PROPERTY_ID_CONTROLDEFAULT },
+ { PROPERTY_CONTROLMODEL, PROPERTY_ID_CONTROLMODEL },
+ { PROPERTY_HIDDEN, PROPERTY_ID_HIDDEN }
};
for (const auto & aProp : aProps)
diff --git a/dbaccess/source/core/api/datacolumn.cxx b/dbaccess/source/core/api/datacolumn.cxx
index c597a40649bf..e0953449154a 100644
--- a/dbaccess/source/core/api/datacolumn.cxx
+++ b/dbaccess/source/core/api/datacolumn.cxx
@@ -25,12 +25,9 @@
using namespace dbaccess;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
-using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
using namespace ::osl;
-using namespace ::comphelper;
using namespace ::cppu;
diff --git a/dbaccess/source/core/api/datasettings.cxx b/dbaccess/source/core/api/datasettings.cxx
index 28167184442f..f810f8669917 100644
--- a/dbaccess/source/core/api/datasettings.cxx
+++ b/dbaccess/source/core/api/datasettings.cxx
@@ -27,7 +27,6 @@
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::comphelper;
using namespace ::cppu;
@@ -95,7 +94,6 @@ void ODataSettings::registerPropertiesFor(ODataSettings_Base* _pItem)
ODataSettings::ODataSettings(OBroadcastHelper& _rBHelper,bool _bQuery)
:OPropertyStateContainer(_rBHelper)
- ,ODataSettings_Base()
,m_bQuery(_bQuery)
{
}
diff --git a/dbaccess/source/core/api/definitioncolumn.cxx b/dbaccess/source/core/api/definitioncolumn.cxx
index 7854a97f1816..b952edca2e7a 100644
--- a/dbaccess/source/core/api/definitioncolumn.cxx
+++ b/dbaccess/source/core/api/definitioncolumn.cxx
@@ -19,8 +19,8 @@
#include <bitset>
-#include <apitools.hxx>
#include <stringconstants.hxx>
+#include <strings.hxx>
#include <definitioncolumn.hxx>
#include <sdbcoretools.hxx>
@@ -30,13 +30,13 @@
#include <comphelper/property.hxx>
#include <connectivity/dbtools.hxx>
#include <sal/log.hxx>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
using namespace ::cppu;
using namespace ::comphelper;
@@ -89,7 +89,7 @@ OUString OTableColumnDescriptor::getImplementationName( )
Sequence< OUString > OTableColumnDescriptor::getSupportedServiceNames( )
{
- return { m_bActAsDescriptor? OUString(SERVICE_SDBCX_COLUMNDESCRIPTOR) : OUString(SERVICE_SDBCX_COLUMN),
+ return { m_bActAsDescriptor? SERVICE_SDBCX_COLUMNDESCRIPTOR : SERVICE_SDBCX_COLUMN,
SERVICE_SDB_COLUMNSETTINGS };
}
@@ -156,9 +156,9 @@ OUString OTableColumn::getImplementationName( )
// OQueryColumn
-OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, const Reference< XConnection >& _rxConnection, const OUString &i_sLabel )
+OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, const Reference< XConnection >& _rxConnection, OUString i_sLabel )
:OTableColumnDescriptor( false /* do not act as descriptor */ )
- ,m_sLabel(i_sLabel)
+ ,m_sLabel(std::move(i_sLabel))
{
const sal_Int32 nPropAttr = PropertyAttribute::READONLY;
registerProperty( PROPERTY_CATALOGNAME, PROPERTY_ID_CATALOGNAME, nPropAttr, &m_sCatalogName, cppu::UnoType<decltype(m_sCatalogName)>::get() );
@@ -169,35 +169,35 @@ OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, co
if( ! (_rxParserColumn->getPropertyValue( PROPERTY_TYPENAME ) >>= m_aTypeName) )
- SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_TYPENAME);
+ SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_TYPENAME);
if( ! (_rxParserColumn->getPropertyValue( PROPERTY_ISNULLABLE ) >>= m_nIsNullable) )
- SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_ISNULLABLE);
+ SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_ISNULLABLE);
if( ! (_rxParserColumn->getPropertyValue( PROPERTY_PRECISION ) >>= m_nPrecision) )
- SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_PRECISION);
+ SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_PRECISION);
if( ! (_rxParserColumn->getPropertyValue( PROPERTY_SCALE ) >>= m_nScale) )
- SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_SCALE);
+ SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_SCALE);
if( ! (_rxParserColumn->getPropertyValue( PROPERTY_TYPE ) >>= m_nType) )
- SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_TYPE);
+ SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_TYPE);
if( ! (_rxParserColumn->getPropertyValue( PROPERTY_ISAUTOINCREMENT ) >>= m_bAutoIncrement) )
- SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_ISAUTOINCREMENT);
+ SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_ISAUTOINCREMENT);
if( ! (_rxParserColumn->getPropertyValue( PROPERTY_ISCURRENCY ) >>= m_bCurrency) )
- SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_ISCURRENCY);
+ SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_ISCURRENCY);
if( ! (_rxParserColumn->getPropertyValue( PROPERTY_NAME ) >>= m_sName) )
- SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_NAME);
+ SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_NAME);
m_bRowVersion = false;
Reference< XPropertySetInfo > xPSI( _rxParserColumn->getPropertySetInfo(), UNO_SET_THROW );
if ( xPSI->hasPropertyByName( PROPERTY_DEFAULTVALUE ) )
if( ! (_rxParserColumn->getPropertyValue( PROPERTY_DEFAULTVALUE ) >>= m_aDefaultValue) )
- SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_DEFAULTVALUE);
+ SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_DEFAULTVALUE);
// copy some optional properties from the parser column
struct PropertyDescriptor
@@ -207,10 +207,10 @@ OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, co
};
const PropertyDescriptor aProps[] =
{
- { OUString(PROPERTY_CATALOGNAME), PROPERTY_ID_CATALOGNAME },
- { OUString(PROPERTY_SCHEMANAME), PROPERTY_ID_SCHEMANAME },
- { OUString(PROPERTY_TABLENAME), PROPERTY_ID_TABLENAME },
- { OUString(PROPERTY_REALNAME), PROPERTY_ID_REALNAME }
+ { PROPERTY_CATALOGNAME, PROPERTY_ID_CATALOGNAME },
+ { PROPERTY_SCHEMANAME, PROPERTY_ID_SCHEMANAME },
+ { PROPERTY_TABLENAME, PROPERTY_ID_TABLENAME },
+ { PROPERTY_REALNAME, PROPERTY_ID_REALNAME }
};
for (const auto & aProp : aProps)
{
@@ -243,11 +243,11 @@ Reference< XPropertySet > OQueryColumn::impl_determineOriginalTableColumn( const
// respective properties
OUString sCatalog, sSchema, sTable;
if( ! (getPropertyValue( PROPERTY_CATALOGNAME ) >>= sCatalog) )
- SAL_WARN("dbaccess.core", "impl_determineOriginalTableColumn: unable to get property " PROPERTY_CATALOGNAME);
+ SAL_WARN("dbaccess.core", "impl_determineOriginalTableColumn: unable to get property " + PROPERTY_CATALOGNAME);
if( ! (getPropertyValue( PROPERTY_SCHEMANAME ) >>= sSchema) )
- SAL_WARN("dbaccess.core", "impl_determineOriginalTableColumn: unable to get property " PROPERTY_SCHEMANAME);
+ SAL_WARN("dbaccess.core", "impl_determineOriginalTableColumn: unable to get property " + PROPERTY_SCHEMANAME);
if( ! (getPropertyValue( PROPERTY_TABLENAME ) >>= sTable) )
- SAL_WARN("dbaccess.core", "impl_determineOriginalTableColumn: unable to get property " PROPERTY_TABLENAME);
+ SAL_WARN("dbaccess.core", "impl_determineOriginalTableColumn: unable to get property " + PROPERTY_TABLENAME);
if ( sCatalog.isEmpty() && sSchema.isEmpty() && sTable.isEmpty() )
return nullptr;
@@ -265,7 +265,7 @@ Reference< XPropertySet > OQueryColumn::impl_determineOriginalTableColumn( const
OUString sColumn;
if( ! (getPropertyValue( PROPERTY_REALNAME ) >>= sColumn) )
- SAL_WARN("dbaccess.core", "impl_determineOriginalTableColumn: unable to get property " PROPERTY_REALNAME);
+ SAL_WARN("dbaccess.core", "impl_determineOriginalTableColumn: unable to get property " + PROPERTY_REALNAME);
if ( !xColumns->hasByName( sColumn ) )
return nullptr;
@@ -444,50 +444,52 @@ Sequence< OUString > OTableColumnDescriptorWrapper::getSupportedServiceNames( )
// Which optional properties are contained?
const sal_Int32 nHaveOptionally (std::bitset<7>(nId).count());
- BEGIN_PROPERTY_SEQUENCE( nHaveAlways + nHaveOptionally )
+ css::uno::Sequence< css::beans::Property> aDescriptor(nHaveAlways + nHaveOptionally);
+ css::beans::Property* pDesc = aDescriptor.getArray();
+ sal_Int32 nPos = 0;
- DECL_PROP0_BOOL( ISAUTOINCREMENT );
- DECL_PROP0_BOOL( ISCURRENCY );
- DECL_PROP0( ISNULLABLE, sal_Int32 );
- DECL_PROP0( PRECISION, sal_Int32 );
- DECL_PROP0( SCALE, sal_Int32 );
- DECL_PROP0( TYPE, sal_Int32 );
- DECL_PROP0( TYPENAME, OUString );
+ pDesc[nPos++] = css::beans::Property(PROPERTY_ISAUTOINCREMENT, PROPERTY_ID_ISAUTOINCREMENT, cppu::UnoType<bool>::get(), 0);
+ pDesc[nPos++] = css::beans::Property(PROPERTY_ISCURRENCY, PROPERTY_ID_ISCURRENCY, cppu::UnoType<bool>::get(), 0);
+ pDesc[nPos++] = css::beans::Property(PROPERTY_ISNULLABLE, PROPERTY_ID_ISNULLABLE, cppu::UnoType<sal_Int32>::get(), 0);
+ pDesc[nPos++] = css::beans::Property(PROPERTY_PRECISION, PROPERTY_ID_PRECISION, cppu::UnoType<sal_Int32>::get(), 0);
+ pDesc[nPos++] = css::beans::Property(PROPERTY_SCALE, PROPERTY_ID_SCALE, cppu::UnoType<sal_Int32>::get(), 0);
+ pDesc[nPos++] = css::beans::Property(PROPERTY_TYPE, PROPERTY_ID_TYPE, cppu::UnoType<sal_Int32>::get(), 0);
+ pDesc[nPos++] = css::beans::Property(PROPERTY_TYPENAME, PROPERTY_ID_TYPENAME, cppu::UnoType<OUString >::get(), 0);
if ( nId & HAS_AUTOINCREMENT_CREATION )
{
- DECL_PROP1( AUTOINCREMENTCREATION, OUString, MAYBEVOID );
+ pDesc[nPos++] = css::beans::Property(PROPERTY_AUTOINCREMENTCREATION, PROPERTY_ID_AUTOINCREMENTCREATION, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID );
}
if ( nId & HAS_DEFAULTVALUE )
{
- DECL_PROP0( DEFAULTVALUE, OUString );
+ pDesc[nPos++] = css::beans::Property(PROPERTY_DEFAULTVALUE, PROPERTY_ID_DEFAULTVALUE, cppu::UnoType<OUString >::get(), 0);
}
if ( nId & HAS_DESCRIPTION )
{
- DECL_PROP0( DESCRIPTION, OUString );
+ pDesc[nPos++] = css::beans::Property(PROPERTY_DESCRIPTION, PROPERTY_ID_DESCRIPTION, cppu::UnoType<OUString >::get(), 0);
}
if ( nId & HAS_ROWVERSION )
{
- DECL_PROP0_BOOL( ISROWVERSION );
+ pDesc[nPos++] = css::beans::Property(PROPERTY_ISROWVERSION, PROPERTY_ID_ISROWVERSION, cppu::UnoType<bool>::get(), 0);
}
if ( nId & HAS_CATALOGNAME )
{
- DECL_PROP0( CATALOGNAME, OUString );
+ pDesc[nPos++] = css::beans::Property(PROPERTY_CATALOGNAME, PROPERTY_ID_CATALOGNAME, cppu::UnoType<OUString >::get(), 0);
}
if ( nId & HAS_SCHEMANAME )
{
- DECL_PROP0( SCHEMANAME, OUString );
+ pDesc[nPos++] = css::beans::Property(PROPERTY_SCHEMANAME, PROPERTY_ID_SCHEMANAME, cppu::UnoType<OUString >::get(), 0);
}
if ( nId & HAS_TABLENAME )
{
- DECL_PROP0( TABLENAME, OUString );
+ pDesc[nPos++] = css::beans::Property(PROPERTY_TABLENAME, PROPERTY_ID_TABLENAME, cppu::UnoType<OUString >::get(), 0);
}
- END_PROPERTY_SEQUENCE()
+ OSL_ENSURE(nPos == aDescriptor.getLength(), "forgot to adjust the count ?");
if ( !m_bIsDescriptor )
{
- for ( auto & prop : aDescriptor )
+ for ( auto & prop : asNonConstRange(aDescriptor) )
{
prop.Attributes |= PropertyAttribute::READONLY;
}
diff --git a/dbaccess/source/core/api/preparedstatement.cxx b/dbaccess/source/core/api/preparedstatement.cxx
index 52f099a4c88f..e7ec79a2ca87 100644
--- a/dbaccess/source/core/api/preparedstatement.cxx
+++ b/dbaccess/source/core/api/preparedstatement.cxx
@@ -28,13 +28,13 @@
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <preparedstatement.hxx>
+#include <strings.hxx>
#include "resultcolumn.hxx"
#include "resultset.hxx"
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::cppu;
@@ -116,7 +116,7 @@ sal_Bool OPreparedStatement::supportsService( const OUString& _rServiceName )
Sequence< OUString > OPreparedStatement::getSupportedServiceNames( )
{
- return { SERVICE_SDBC_PREPAREDSTATEMENT, SERVICE_SDB_PREPAREDSTATMENT };
+ return { SERVICE_SDBC_PREPAREDSTATEMENT, SERVICE_SDB_PREPAREDSTATEMENT };
}
// OComponentHelper
@@ -134,7 +134,7 @@ void OPreparedStatement::disposing()
Reference< css::container::XNameAccess > OPreparedStatement::getColumns()
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
// do we have to populate the columns
if (!m_pColumns->isInitialized())
@@ -174,7 +174,7 @@ Reference< css::container::XNameAccess > OPreparedStatement::getColumns()
Reference< XResultSetMetaData > OPreparedStatement::getMetaData()
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XResultSetMetaDataSupplier >( m_xAggregateAsSet, UNO_QUERY_THROW )->getMetaData();
}
@@ -182,7 +182,7 @@ Reference< XResultSetMetaData > OPreparedStatement::getMetaData()
Reference< XResultSet > OPreparedStatement::executeQuery()
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
disposeResultSet();
@@ -201,7 +201,7 @@ Reference< XResultSet > OPreparedStatement::executeQuery()
sal_Int32 OPreparedStatement::executeUpdate()
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
disposeResultSet();
@@ -211,7 +211,7 @@ sal_Int32 OPreparedStatement::executeUpdate()
sal_Bool OPreparedStatement::execute()
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
disposeResultSet();
@@ -227,7 +227,7 @@ Reference< XConnection > OPreparedStatement::getConnection()
void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 sqlType )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setNull(parameterIndex, sqlType);
}
@@ -235,7 +235,7 @@ void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 s
void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString& typeName )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setObjectNull(parameterIndex, sqlType, typeName);
}
@@ -243,7 +243,7 @@ void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_I
void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setBoolean(parameterIndex, x);
}
@@ -251,7 +251,7 @@ void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool
void SAL_CALL OPreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setByte(parameterIndex, x);
}
@@ -259,7 +259,7 @@ void SAL_CALL OPreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x
void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setShort(parameterIndex, x);
}
@@ -267,7 +267,7 @@ void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16
void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setInt(parameterIndex, x);
}
@@ -275,7 +275,7 @@ void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x
void SAL_CALL OPreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setLong(parameterIndex, x);
}
@@ -283,7 +283,7 @@ void SAL_CALL OPreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x
void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setFloat(parameterIndex, x);
}
@@ -291,7 +291,7 @@ void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x )
void SAL_CALL OPreparedStatement::setDouble( sal_Int32 parameterIndex, double x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setDouble(parameterIndex, x);
}
@@ -299,7 +299,7 @@ void SAL_CALL OPreparedStatement::setDouble( sal_Int32 parameterIndex, double x
void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const OUString& x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setString(parameterIndex, x);
}
@@ -307,7 +307,7 @@ void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const OUS
void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequence< sal_Int8 >& x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setBytes(parameterIndex, x);
}
@@ -315,7 +315,7 @@ void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequ
void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const css::util::Date& x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setDate(parameterIndex, x);
}
@@ -323,7 +323,7 @@ void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const css::
void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const css::util::Time& x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setTime(parameterIndex, x);
}
@@ -331,7 +331,7 @@ void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const css::
void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const css::util::DateTime& x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setTimestamp(parameterIndex, x);
}
@@ -339,7 +339,7 @@ void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const
void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, const Reference< css::io::XInputStream >& x, sal_Int32 length )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setBinaryStream(parameterIndex, x, length);
}
@@ -347,7 +347,7 @@ void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, con
void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 parameterIndex, const Reference< css::io::XInputStream >& x, sal_Int32 length )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setCharacterStream(parameterIndex, x, length);
}
@@ -355,7 +355,7 @@ void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 parameterIndex,
void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any& x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setObject(parameterIndex, x);
}
@@ -363,7 +363,7 @@ void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any
void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x, sal_Int32 targetSqlType, sal_Int32 scale )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setObjectWithInfo(parameterIndex, x, targetSqlType, scale);
}
@@ -371,7 +371,7 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, c
void SAL_CALL OPreparedStatement::setRef( sal_Int32 parameterIndex, const Reference< XRef >& x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setRef(parameterIndex, x);
}
@@ -379,7 +379,7 @@ void SAL_CALL OPreparedStatement::setRef( sal_Int32 parameterIndex, const Refere
void SAL_CALL OPreparedStatement::setBlob( sal_Int32 parameterIndex, const Reference< XBlob >& x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setBlob(parameterIndex, x);
}
@@ -387,7 +387,7 @@ void SAL_CALL OPreparedStatement::setBlob( sal_Int32 parameterIndex, const Refer
void SAL_CALL OPreparedStatement::setClob( sal_Int32 parameterIndex, const Reference< XClob >& x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setClob(parameterIndex, x);
}
@@ -395,7 +395,7 @@ void SAL_CALL OPreparedStatement::setClob( sal_Int32 parameterIndex, const Refer
void SAL_CALL OPreparedStatement::setArray( sal_Int32 parameterIndex, const Reference< XArray >& x )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->setArray(parameterIndex, x);
}
@@ -403,7 +403,7 @@ void SAL_CALL OPreparedStatement::setArray( sal_Int32 parameterIndex, const Refe
void SAL_CALL OPreparedStatement::clearParameters( )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
m_xAggregateAsParameters->clearParameters();
}
diff --git a/dbaccess/source/core/api/query.cxx b/dbaccess/source/core/api/query.cxx
index cc5e7753b262..c8e723853a7a 100644
--- a/dbaccess/source/core/api/query.cxx
+++ b/dbaccess/source/core/api/query.cxx
@@ -25,9 +25,9 @@
#include "HelperCollections.hxx"
#include <core_resource.hxx>
#include <strings.hrc>
+#include <strings.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <com/sun/star/sdbc/XConnection.hpp>
@@ -40,6 +40,7 @@
#include <definitioncolumn.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <ContainerMediator.hxx>
using namespace dbaccess;
@@ -48,7 +49,6 @@ using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::util;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
using namespace ::comphelper;
@@ -105,7 +105,15 @@ css::uno::Sequence<sal_Int8> OQuery::getImplementationId()
return css::uno::Sequence<sal_Int8>();
}
-IMPLEMENT_GETTYPES3(OQuery,OQueryDescriptor_Base,ODataSettings,OContentHelper);
+css::uno::Sequence< css::uno::Type > OQuery::getTypes()
+{
+ return ::comphelper::concatSequences(
+ OQueryDescriptor_Base::getTypes( ),
+ ODataSettings::getTypes( ),
+ OContentHelper::getTypes( )
+ );
+}
+
IMPLEMENT_FORWARD_XINTERFACE3( OQuery,OContentHelper,OQueryDescriptor_Base,ODataSettings)
void OQuery::rebuildColumns()
@@ -204,7 +212,23 @@ void OQuery::rebuildColumns()
}
// XServiceInfo
-IMPLEMENT_SERVICE_INFO3(OQuery, "com.sun.star.sdb.dbaccess.OQuery", SERVICE_SDB_DATASETTINGS, SERVICE_SDB_QUERY, "com.sun.star.sdb.QueryDefinition")
+OUString SAL_CALL OQuery::getImplementationName()
+ {
+ return "com.sun.star.sdb.dbaccess.OQuery";
+ }
+sal_Bool SAL_CALL OQuery::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ }
+css::uno::Sequence< OUString > SAL_CALL OQuery::getSupportedServiceNames( )
+{
+ return { SERVICE_SDB_DATASETTINGS, SERVICE_SDB_QUERY, "com.sun.star.sdb.QueryDefinition" };
+}
// css::beans::XPropertyChangeListener
void SAL_CALL OQuery::propertyChange( const PropertyChangeEvent& _rSource )
diff --git a/dbaccess/source/core/api/querycomposer.cxx b/dbaccess/source/core/api/querycomposer.cxx
index 5f33eefbd48d..9c41f344ccf5 100644
--- a/dbaccess/source/core/api/querycomposer.cxx
+++ b/dbaccess/source/core/api/querycomposer.cxx
@@ -18,6 +18,7 @@
*/
#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/sdbc/ColumnSearch.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
#include <comphelper/sequence.hxx>
@@ -26,6 +27,7 @@
#include <comphelper/types.hxx>
#include <com/sun/star/sdb/SQLFilterOperator.hpp>
#include <querycomposer.hxx>
+#include <strings.hxx>
#include <composertools.hxx>
#include <algorithm>
@@ -41,7 +43,6 @@ using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
using namespace ::cppu;
using namespace ::osl;
-using namespace ::utl;
OQueryComposer::OQueryComposer(const Reference< XConnection>& _xConnection)
diff --git a/dbaccess/source/core/api/querycontainer.cxx b/dbaccess/source/core/api/querycontainer.cxx
index cebb70cf1cb2..8e386dc411cd 100644
--- a/dbaccess/source/core/api/querycontainer.cxx
+++ b/dbaccess/source/core/api/querycontainer.cxx
@@ -19,6 +19,7 @@
#include <querycontainer.hxx>
#include "query.hxx"
+#include <strings.hxx>
#include <objectnameapproval.hxx>
#include <veto.hxx>
@@ -43,7 +44,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::util;
using namespace ::osl;
@@ -131,7 +131,23 @@ void OQueryContainer::disposing()
}
// XServiceInfo
-IMPLEMENT_SERVICE_INFO2(OQueryContainer, "com.sun.star.sdb.dbaccess.OQueryContainer", SERVICE_SDBCX_CONTAINER, SERVICE_SDB_QUERIES)
+OUString SAL_CALL OQueryContainer::getImplementationName()
+ {
+ return "com.sun.star.sdb.dbaccess.OQueryContainer";
+ }
+sal_Bool SAL_CALL OQueryContainer::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ }
+css::uno::Sequence< OUString > SAL_CALL OQueryContainer::getSupportedServiceNames()
+{
+ return { SERVICE_SDBCX_CONTAINER, SERVICE_SDB_QUERIES };
+}
// XDataDescriptorFactory
Reference< XPropertySet > SAL_CALL OQueryContainer::createDataDescriptor( )
@@ -179,7 +195,7 @@ void SAL_CALL OQueryContainer::appendByDescriptor( const Reference< XPropertySet
{
m_eDoingCurrently = AggregateAction::Inserting;
OAutoActionReset aAutoReset(*this);
- m_xCommandDefinitions->insertByName(sNewObjectName, makeAny(xCommandDefinitionPart));
+ m_xCommandDefinitions->insertByName(sNewObjectName, Any(xCommandDefinitionPart));
}
implAppend( sNewObjectName, xNewObject );
@@ -244,7 +260,7 @@ void SAL_CALL OQueryContainer::elementInserted( const css::container::ContainerE
// insert an own new element
xNewElement = implCreateWrapper(sElementName);
}
- insertByName(sElementName,makeAny(xNewElement));
+ insertByName(sElementName,Any(xNewElement));
}
void SAL_CALL OQueryContainer::elementRemoved( const css::container::ContainerEvent& _rEvent )
@@ -276,7 +292,7 @@ void SAL_CALL OQueryContainer::elementReplaced( const css::container::ContainerE
xNewElement = implCreateWrapper(sAccessor);
}
- replaceByName(sAccessor,makeAny(xNewElement));
+ replaceByName(sAccessor,Any(xNewElement));
}
Reference< XVeto > SAL_CALL OQueryContainer::approveInsertElement( const ContainerEvent& Event )
diff --git a/dbaccess/source/core/api/querydescriptor.cxx b/dbaccess/source/core/api/querydescriptor.cxx
index 2ba824d0afbd..0aff2b0aaba1 100644
--- a/dbaccess/source/core/api/querydescriptor.cxx
+++ b/dbaccess/source/core/api/querydescriptor.cxx
@@ -18,19 +18,15 @@
*/
#include "querydescriptor.hxx"
-#include <apitools.hxx>
#include <stringconstants.hxx>
+#include <strings.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <cppuhelper/typeprovider.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::util;
using namespace ::osl;
using namespace ::cppu;
@@ -64,7 +60,14 @@ css::uno::Sequence<sal_Int8> OQueryDescriptor::getImplementationId()
return css::uno::Sequence<sal_Int8>();
}
-IMPLEMENT_GETTYPES2(OQueryDescriptor,OQueryDescriptor_Base,ODataSettings);
+css::uno::Sequence< css::uno::Type > OQueryDescriptor::getTypes()
+{
+ return ::comphelper::concatSequences(
+ OQueryDescriptor_Base::getTypes( ),
+ ODataSettings::getTypes( )
+ );
+}
+
IMPLEMENT_FORWARD_XINTERFACE3( OQueryDescriptor,OWeakObject,OQueryDescriptor_Base,ODataSettings)
void OQueryDescriptor::registerProperties()
@@ -138,25 +141,6 @@ OQueryDescriptor_Base::~OQueryDescriptor_Base()
m_pColumns->disposing();
}
-sal_Int64 SAL_CALL OQueryDescriptor_Base::getSomething( const Sequence< sal_Int8 >& _rIdentifier )
-{
- if (isUnoTunnelId<OQueryDescriptor_Base>(_rIdentifier))
- return reinterpret_cast<sal_Int64>(this);
-
- return 0;
-}
-
-css::uno::Sequence<sal_Int8> OQueryDescriptor_Base::getUnoTunnelId()
-{
- static cppu::OImplementationId aId;
- return aId.getImplementationId();
-}
-
-css::uno::Sequence<sal_Int8> OQueryDescriptor_Base::getImplementationId()
-{
- return css::uno::Sequence<sal_Int8>();
-}
-
void OQueryDescriptor_Base::setColumnsOutOfDate( bool _bOutOfDate )
{
m_bColumnsOutOfDate = _bOutOfDate;
diff --git a/dbaccess/source/core/api/querydescriptor.hxx b/dbaccess/source/core/api/querydescriptor.hxx
index e0930c8335a3..181b8e4d436d 100644
--- a/dbaccess/source/core/api/querydescriptor.hxx
+++ b/dbaccess/source/core/api/querydescriptor.hxx
@@ -19,13 +19,12 @@
#pragma once
-#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <comphelper/proparrhlp.hxx>
#include <osl/mutex.hxx>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <apitools.hxx>
#include <column.hxx>
@@ -38,9 +37,8 @@ namespace dbaccess
{
// OQueryDescriptor_Base - a query descriptor (as the name suggests :)
-typedef ::cppu::ImplHelper3<
+typedef ::cppu::ImplHelper2<
css::sdbcx::XColumnsSupplier,
- css::lang::XUnoTunnel,
css::lang::XServiceInfo > OQueryDescriptor_BASE;
class OQueryDescriptor_Base
@@ -75,12 +73,6 @@ public:
// css::sdbcx::XColumnsSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getColumns( ) override;
-// css::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- virtual css::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
-
-
// css::lang::XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
diff --git a/dbaccess/source/core/api/resultcolumn.cxx b/dbaccess/source/core/api/resultcolumn.cxx
index afb2e3f574b5..fbc8cb8a343f 100644
--- a/dbaccess/source/core/api/resultcolumn.cxx
+++ b/dbaccess/source/core/api/resultcolumn.cxx
@@ -18,19 +18,18 @@
*/
#include "resultcolumn.hxx"
+#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/sdbc/SQLException.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <stringconstants.hxx>
-#include <apitools.hxx>
+#include <strings.hxx>
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
using namespace ::osl;
using namespace ::comphelper;
using namespace ::cppu;
@@ -67,7 +66,7 @@ void OResultColumn::impl_determineIsRowVersion_nothrow()
try
{
Reference< XResultSet > xVersionColumns = m_xDBMetaData->getVersionColumns(
- makeAny( sCatalog ), sSchema, sTable );
+ Any( sCatalog ), sSchema, sTable );
if ( xVersionColumns.is() ) // allowed to be NULL
{
Reference< XRow > xResultRow( xVersionColumns, UNO_QUERY_THROW );
@@ -124,29 +123,32 @@ void OResultColumn::disposing()
// comphelper::OPropertyArrayUsageHelper
::cppu::IPropertyArrayHelper* OResultColumn::createArrayHelper( ) const
{
- BEGIN_PROPERTY_HELPER(21)
- DECL_PROP1(CATALOGNAME, OUString, READONLY);
- DECL_PROP1(DISPLAYSIZE, sal_Int32, READONLY);
- DECL_PROP1_BOOL(ISAUTOINCREMENT, READONLY);
- DECL_PROP1_BOOL(ISCASESENSITIVE, READONLY);
- DECL_PROP1_BOOL(ISCURRENCY, READONLY);
- DECL_PROP1_BOOL(ISDEFINITELYWRITABLE, READONLY);
- DECL_PROP1(ISNULLABLE, sal_Int32, READONLY);
- DECL_PROP1_BOOL(ISREADONLY, READONLY);
- DECL_PROP1_BOOL(ISROWVERSION, READONLY);
- DECL_PROP1_BOOL(ISSEARCHABLE, READONLY);
- DECL_PROP1_BOOL(ISSIGNED, READONLY);
- DECL_PROP1_BOOL(ISWRITABLE, READONLY);
- DECL_PROP1(LABEL, OUString, READONLY);
- DECL_PROP1(NAME, OUString, READONLY);
- DECL_PROP1(PRECISION, sal_Int32, READONLY);
- DECL_PROP1(SCALE, sal_Int32, READONLY);
- DECL_PROP1(SCHEMANAME, OUString, READONLY);
- DECL_PROP1(SERVICENAME, OUString, READONLY);
- DECL_PROP1(TABLENAME, OUString, READONLY);
- DECL_PROP1(TYPE, sal_Int32, READONLY);
- DECL_PROP1(TYPENAME, OUString, READONLY);
- END_PROPERTY_HELPER();
+ return new ::cppu::OPropertyArrayHelper
+ {
+ {
+ { PROPERTY_CATALOGNAME, PROPERTY_ID_CATALOGNAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_DISPLAYSIZE, PROPERTY_ID_DISPLAYSIZE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISAUTOINCREMENT, PROPERTY_ID_ISAUTOINCREMENT, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISCASESENSITIVE, PROPERTY_ID_ISCASESENSITIVE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISCURRENCY, PROPERTY_ID_ISCURRENCY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISDEFINITELYWRITABLE, PROPERTY_ID_ISDEFINITELYWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISNULLABLE, PROPERTY_ID_ISNULLABLE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISREADONLY, PROPERTY_ID_ISREADONLY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISROWVERSION, PROPERTY_ID_ISROWVERSION, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISSEARCHABLE, PROPERTY_ID_ISSEARCHABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISSIGNED, PROPERTY_ID_ISSIGNED, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_ISWRITABLE, PROPERTY_ID_ISWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_LABEL, PROPERTY_ID_LABEL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_NAME, PROPERTY_ID_NAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_PRECISION, PROPERTY_ID_PRECISION, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_SCALE, PROPERTY_ID_SCALE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_SCHEMANAME, PROPERTY_ID_SCHEMANAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_SERVICENAME, PROPERTY_ID_SERVICENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_TABLENAME, PROPERTY_ID_TABLENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_TYPE, PROPERTY_ID_TYPE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_TYPENAME, PROPERTY_ID_TYPENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }
+ }
+ };
}
// cppu::OPropertySetHelper
diff --git a/dbaccess/source/core/api/resultset.cxx b/dbaccess/source/core/api/resultset.cxx
index 922f411d794e..cc6a6fe018f4 100644
--- a/dbaccess/source/core/api/resultset.cxx
+++ b/dbaccess/source/core/api/resultset.cxx
@@ -20,14 +20,15 @@
#include "resultset.hxx"
#include <sal/log.hxx>
#include <stringconstants.hxx>
-#include <apitools.hxx>
+#include <strings.hxx>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/sdbc/ResultSetType.hpp>
#include <com/sun/star/sdbc/SQLException.hpp>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/types.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include "datacolumn.hxx"
#include <connectivity/dbexception.hxx>
#include <connectivity/dbtools.hxx>
@@ -185,14 +186,17 @@ Reference< XPropertySetInfo > OResultSet::getPropertySetInfo()
// comphelper::OPropertyArrayUsageHelper
::cppu::IPropertyArrayHelper* OResultSet::createArrayHelper( ) const
{
- BEGIN_PROPERTY_HELPER(6)
- DECL_PROP1(CURSORNAME, OUString, READONLY);
- DECL_PROP0(FETCHDIRECTION, sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
- DECL_PROP1_BOOL(ISBOOKMARKABLE, READONLY);
- DECL_PROP1(RESULTSETCONCURRENCY, sal_Int32, READONLY);
- DECL_PROP1(RESULTSETTYPE, sal_Int32, READONLY);
- END_PROPERTY_HELPER();
+ return new ::cppu::OPropertyArrayHelper
+ {
+ {
+ { PROPERTY_CURSORNAME, PROPERTY_ID_CURSORNAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_FETCHDIRECTION, PROPERTY_ID_FETCHDIRECTION, cppu::UnoType<sal_Int32>::get(), 0 },
+ { PROPERTY_FETCHSIZE, PROPERTY_ID_FETCHSIZE, cppu::UnoType<sal_Int32>::get(), 0 },
+ { PROPERTY_ISBOOKMARKABLE, PROPERTY_ID_ISBOOKMARKABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_RESULTSETCONCURRENCY, PROPERTY_ID_RESULTSETCONCURRENCY, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_RESULTSETTYPE, PROPERTY_ID_RESULTSETTYPE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }
+ }
+ };
}
// cppu::OPropertySetHelper
diff --git a/dbaccess/source/core/api/statement.cxx b/dbaccess/source/core/api/statement.cxx
index 631f67501142..1a20823ab9dd 100644
--- a/dbaccess/source/core/api/statement.cxx
+++ b/dbaccess/source/core/api/statement.cxx
@@ -20,6 +20,8 @@
#include <statement.hxx>
#include "resultset.hxx"
#include <stringconstants.hxx>
+#include <strings.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
#include <com/sun/star/sdbc/SQLException.hpp>
#include <cppuhelper/queryinterface.hxx>
@@ -27,7 +29,7 @@
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/property.hxx>
#include <comphelper/types.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <connectivity/dbexception.hxx>
using namespace ::com::sun::star::sdb;
@@ -44,7 +46,7 @@ using namespace dbtools;
OStatementBase::OStatementBase(const Reference< XConnection > & _xConn,
const Reference< XInterface > & _xStatement)
:OSubComponent(m_aMutex, _xConn)
- ,OPropertySetHelper(OComponentHelper::rBHelper)
+ ,OPropertySetHelper(WeakComponentImplHelper::rBHelper)
,m_bUseBookmarks( false )
,m_bEscapeProcessing( true )
@@ -122,7 +124,7 @@ void OStatementBase::disposeResultSet()
Reference< XComponent > xComp(m_aResultSet.get(), UNO_QUERY);
if (xComp.is())
xComp->dispose();
- m_aResultSet = nullptr;
+ m_aResultSet.clear();
}
// OComponentHelper
@@ -162,7 +164,7 @@ void OStatementBase::close()
{
{
MutexGuard aGuard( m_aMutex );
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
}
dispose();
}
@@ -176,18 +178,21 @@ Reference< XPropertySetInfo > OStatementBase::getPropertySetInfo()
// comphelper::OPropertyArrayUsageHelper
::cppu::IPropertyArrayHelper* OStatementBase::createArrayHelper( ) const
{
- BEGIN_PROPERTY_HELPER(10)
- DECL_PROP0(CURSORNAME, OUString);
- DECL_PROP0_BOOL(ESCAPE_PROCESSING);
- DECL_PROP0(FETCHDIRECTION, sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
- DECL_PROP0(MAXFIELDSIZE, sal_Int32);
- DECL_PROP0(MAXROWS, sal_Int32);
- DECL_PROP0(QUERYTIMEOUT, sal_Int32);
- DECL_PROP0(RESULTSETCONCURRENCY, sal_Int32);
- DECL_PROP0(RESULTSETTYPE, sal_Int32);
- DECL_PROP0_BOOL(USEBOOKMARKS);
- END_PROPERTY_HELPER();
+ return new ::cppu::OPropertyArrayHelper
+ {
+ {
+ { PROPERTY_CURSORNAME, PROPERTY_ID_CURSORNAME, cppu::UnoType<OUString>::get(), 0 },
+ { PROPERTY_ESCAPE_PROCESSING, PROPERTY_ID_ESCAPE_PROCESSING, cppu::UnoType<bool>::get(), 0 },
+ { PROPERTY_FETCHDIRECTION, PROPERTY_ID_FETCHDIRECTION, cppu::UnoType<sal_Int32>::get(), 0 },
+ { PROPERTY_FETCHSIZE, PROPERTY_ID_FETCHSIZE, cppu::UnoType<sal_Int32>::get(), 0 },
+ { PROPERTY_MAXFIELDSIZE, PROPERTY_ID_MAXFIELDSIZE, cppu::UnoType<sal_Int32>::get(), 0 },
+ { PROPERTY_MAXROWS, PROPERTY_ID_MAXROWS, cppu::UnoType<sal_Int32>::get(), 0 },
+ { PROPERTY_QUERYTIMEOUT, PROPERTY_ID_QUERYTIMEOUT, cppu::UnoType<sal_Int32>::get(), 0 },
+ { PROPERTY_RESULTSETCONCURRENCY, PROPERTY_ID_RESULTSETCONCURRENCY, cppu::UnoType<sal_Int32>::get(), 0 },
+ { PROPERTY_RESULTSETTYPE, PROPERTY_ID_RESULTSETTYPE, cppu::UnoType<sal_Int32>::get(), 0 },
+ { PROPERTY_USEBOOKMARKS, PROPERTY_ID_USEBOOKMARKS, cppu::UnoType<bool>::get(), 0 }
+ }
+ };
}
// cppu::OPropertySetHelper
@@ -288,7 +293,7 @@ void OStatementBase::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) cons
Any OStatementBase::getWarnings()
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
return Reference< XWarningsSupplier >(m_xAggregateAsSet, UNO_QUERY_THROW)->getWarnings();
}
@@ -296,7 +301,7 @@ Any OStatementBase::getWarnings()
void OStatementBase::clearWarnings()
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
Reference< XWarningsSupplier >(m_xAggregateAsSet, UNO_QUERY_THROW)->clearWarnings();
}
@@ -315,7 +320,7 @@ void OStatementBase::cancel()
Reference< XResultSet > SAL_CALL OStatementBase::getResultSet( )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
// first check the meta data
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
@@ -328,7 +333,7 @@ Reference< XResultSet > SAL_CALL OStatementBase::getResultSet( )
sal_Int32 SAL_CALL OStatementBase::getUpdateCount( )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
// first check the meta data
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
@@ -341,7 +346,7 @@ sal_Int32 SAL_CALL OStatementBase::getUpdateCount( )
sal_Bool SAL_CALL OStatementBase::getMoreResults( )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
// first check the meta data
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
@@ -358,7 +363,7 @@ sal_Bool SAL_CALL OStatementBase::getMoreResults( )
void SAL_CALL OStatementBase::addBatch( )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
// first check the meta data
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
@@ -371,7 +376,7 @@ void SAL_CALL OStatementBase::addBatch( )
void SAL_CALL OStatementBase::clearBatch( )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
// first check the meta data
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
@@ -384,7 +389,7 @@ void SAL_CALL OStatementBase::clearBatch( )
Sequence< sal_Int32 > SAL_CALL OStatementBase::executeBatch( )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
// first check the meta data
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
@@ -400,7 +405,7 @@ Sequence< sal_Int32 > SAL_CALL OStatementBase::executeBatch( )
Reference< XResultSet > SAL_CALL OStatementBase::getGeneratedValues( )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
Reference< XGeneratedResultSet > xGRes(m_xAggregateAsSet, UNO_QUERY);
if ( xGRes.is() )
@@ -441,7 +446,7 @@ Sequence< OUString > OStatement::getSupportedServiceNames( )
Reference< XResultSet > OStatement::executeQuery( const OUString& _rSQL )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
disposeResultSet();
Reference< XResultSet > xResultSet;
@@ -467,7 +472,7 @@ Reference< XResultSet > OStatement::executeQuery( const OUString& _rSQL )
sal_Int32 OStatement::executeUpdate( const OUString& _rSQL )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
disposeResultSet();
@@ -478,7 +483,7 @@ sal_Int32 OStatement::executeUpdate( const OUString& _rSQL )
sal_Bool OStatement::execute( const OUString& _rSQL )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
disposeResultSet();
@@ -489,7 +494,7 @@ sal_Bool OStatement::execute( const OUString& _rSQL )
void OStatement::addBatch( const OUString& _rSQL )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
// first check the meta data
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
@@ -503,7 +508,7 @@ void OStatement::addBatch( const OUString& _rSQL )
void OStatement::clearBatch( )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
// first check the meta data
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
if (!xMeta.is() || !xMeta->supportsBatchUpdates())
@@ -515,7 +520,7 @@ void OStatement::clearBatch( )
Sequence< sal_Int32 > OStatement::executeBatch( )
{
MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
// first check the meta data
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
if (!xMeta.is() || !xMeta->supportsBatchUpdates())
diff --git a/dbaccess/source/core/api/table.cxx b/dbaccess/source/core/api/table.cxx
index 054c1de241cb..bb2a6f832dea 100644
--- a/dbaccess/source/core/api/table.cxx
+++ b/dbaccess/source/core/api/table.cxx
@@ -17,20 +17,18 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <apitools.hxx>
#include <table.hxx>
#include <definitioncolumn.hxx>
#include <stringconstants.hxx>
+#include <strings.hxx>
#include <core_resource.hxx>
#include <strings.hrc>
#include "CIndexes.hxx"
#include <osl/diagnose.h>
-#include <cppuhelper/typeprovider.hxx>
#include <comphelper/servicehelper.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/sdbc/SQLException.hpp>
-#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/sdb/tools/XTableRename.hpp>
#include <com/sun/star/sdb/tools/XTableAlteration.hpp>
@@ -42,7 +40,6 @@
using namespace dbaccess;
using namespace connectivity;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::util;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbc;
@@ -212,7 +209,7 @@ void ODBTable::construct()
describeProperties(aProps);
if(!_nId)
{
- for(Property & prop : aProps)
+ for(Property & prop : asNonConstRange(aProps))
{
if (prop.Name == PROPERTY_CATALOGNAME)
prop.Attributes = PropertyAttribute::READONLY;
@@ -234,7 +231,24 @@ void ODBTable::construct()
}
// XServiceInfo
-IMPLEMENT_SERVICE_INFO1(ODBTable, "com.sun.star.sdb.dbaccess.ODBTable", SERVICE_SDBCX_TABLE)
+OUString SAL_CALL ODBTable::getImplementationName()
+ {
+ return "com.sun.star.sdb.dbaccess.ODBTable";
+ }
+sal_Bool SAL_CALL ODBTable::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ }
+css::uno::Sequence< OUString > SAL_CALL ODBTable::getSupportedServiceNames()
+{
+ return { SERVICE_SDBCX_TABLE };
+}
+
Any SAL_CALL ODBTable::queryInterface( const Type & rType )
{
@@ -294,24 +308,6 @@ void SAL_CALL ODBTable::alterColumnByName( const OUString& _rName, const Referen
m_xColumns->refresh();
}
-sal_Int64 SAL_CALL ODBTable::getSomething( const Sequence< sal_Int8 >& rId )
-{
- sal_Int64 nRet(0);
- if (isUnoTunnelId<ODBTable>(rId))
- nRet = reinterpret_cast<sal_Int64>(this);
- else
- nRet = OTable_Base::getSomething(rId);
-
- return nRet;
-}
-
-Sequence< sal_Int8 > ODBTable::getUnoTunnelId()
-{
- static ::cppu::OImplementationId s_Id;
-
- return s_Id.getImplementationId();
-}
-
Reference< XPropertySet > ODBTable::createColumnDescriptor()
{
return new OTableColumnDescriptor( true );
diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx
index 51ef6df327d7..1a7e2a261609 100644
--- a/dbaccess/source/core/api/tablecontainer.cxx
+++ b/dbaccess/source/core/api/tablecontainer.cxx
@@ -17,13 +17,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <apitools.hxx>
#include <tablecontainer.hxx>
#include <table.hxx>
#include <comphelper/property.hxx>
#include <comphelper/processfactory.hxx>
#include <core_resource.hxx>
#include <strings.hrc>
+#include <strings.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyState.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
@@ -40,7 +40,7 @@
#include <sdbcoretools.hxx>
#include <ContainerMediator.hxx>
#include <objectnameapproval.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace dbaccess;
using namespace dbtools;
@@ -51,7 +51,6 @@ using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::util;
using namespace ::osl;
using namespace ::comphelper;
using namespace ::cppu;
@@ -62,26 +61,24 @@ namespace
bool lcl_isPropertySetDefaulted(const Sequence< OUString>& _aNames,const Reference<XPropertySet>& _xProp)
{
Reference<XPropertyState> xState(_xProp,UNO_QUERY);
- if ( xState.is() )
+ if ( !xState )
+ return false;
+ const OUString* pIter = _aNames.getConstArray();
+ const OUString* pEnd = pIter + _aNames.getLength();
+ for(;pIter != pEnd;++pIter)
{
- const OUString* pIter = _aNames.getConstArray();
- const OUString* pEnd = pIter + _aNames.getLength();
- for(;pIter != pEnd;++pIter)
+ try
{
- try
- {
- PropertyState aState = xState->getPropertyState(*pIter);
- if ( aState != PropertyState_DEFAULT_VALUE )
- break;
- }
- catch(const Exception&)
- {
- TOOLS_WARN_EXCEPTION("dbaccess", "" );
- }
+ PropertyState aState = xState->getPropertyState(*pIter);
+ if ( aState != PropertyState_DEFAULT_VALUE )
+ break;
+ }
+ catch(const Exception&)
+ {
+ TOOLS_WARN_EXCEPTION("dbaccess", "" );
}
- return ( pIter == pEnd );
}
- return false;
+ return ( pIter == pEnd );
}
}
@@ -123,7 +120,24 @@ OUString OTableContainer::getTableTypeRestriction() const
}
// XServiceInfo
-IMPLEMENT_SERVICE_INFO2(OTableContainer, "com.sun.star.sdb.dbaccess.OTableContainer", SERVICE_SDBCX_CONTAINER, SERVICE_SDBCX_TABLES)
+OUString SAL_CALL OTableContainer::getImplementationName()
+ {
+ return "com.sun.star.sdb.dbaccess.OTableContainer";
+ }
+sal_Bool SAL_CALL OTableContainer::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ }
+css::uno::Sequence< OUString > SAL_CALL OTableContainer::getSupportedServiceNames()
+{
+ return { SERVICE_SDBCX_CONTAINER, SERVICE_SDBCX_TABLES };
+}
+
namespace
{
@@ -141,7 +155,7 @@ void lcl_createDefinitionObject(const OUString& _rName
{
// set as folder
_xTableDefinition = TableDefinition::createWithName( ::comphelper::getProcessComponentContext(), _rName );
- _xTableDefinitions->insertByName(_rName,makeAny(_xTableDefinition));
+ _xTableDefinitions->insertByName(_rName,Any(_xTableDefinition));
}
Reference<XColumnsSupplier> xColumnsSupplier(_xTableDefinition,UNO_QUERY);
if ( xColumnsSupplier.is() )
@@ -393,7 +407,7 @@ void SAL_CALL OTableContainer::elementInserted( const ContainerEvent& Event )
ObjectType xName = createObject(sName);
insertElement(sName,xName);
// and notify our listeners
- ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(sName), makeAny(xName), Any());
+ ContainerEvent aEvent(static_cast<XContainer*>(this), Any(sName), Any(xName), Any());
m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, aEvent );
}
}
diff --git a/dbaccess/source/core/api/viewcontainer.cxx b/dbaccess/source/core/api/viewcontainer.cxx
index 796e23c9f49d..7e170b86d43a 100644
--- a/dbaccess/source/core/api/viewcontainer.cxx
+++ b/dbaccess/source/core/api/viewcontainer.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <apitools.hxx>
+#include <strings.hxx>
#include <viewcontainer.hxx>
#include <View.hxx>
@@ -34,9 +34,7 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::util;
using namespace ::com::sun::star::container;
using namespace ::osl;
using namespace ::comphelper;
@@ -61,7 +59,24 @@ OViewContainer::~OViewContainer()
}
// XServiceInfo
-IMPLEMENT_SERVICE_INFO2(OViewContainer, "com.sun.star.sdb.dbaccess.OViewContainer", SERVICE_SDBCX_CONTAINER, SERVICE_SDBCX_TABLES)
+OUString SAL_CALL OViewContainer::getImplementationName()
+ {
+ return "com.sun.star.sdb.dbaccess.OViewContainer";
+ }
+sal_Bool SAL_CALL OViewContainer::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ }
+css::uno::Sequence< OUString > SAL_CALL OViewContainer::getSupportedServiceNames()
+{
+ return { SERVICE_SDBCX_CONTAINER, SERVICE_SDBCX_TABLES };
+}
+
ObjectType OViewContainer::createObject(const OUString& _rName)
{
diff --git a/dbaccess/source/core/dataaccess/ComponentDefinition.cxx b/dbaccess/source/core/dataaccess/ComponentDefinition.cxx
index 629727930859..19076507e0b3 100644
--- a/dbaccess/source/core/dataaccess/ComponentDefinition.cxx
+++ b/dbaccess/source/core/dataaccess/ComponentDefinition.cxx
@@ -18,18 +18,17 @@
*/
#include "ComponentDefinition.hxx"
-#include <apitools.hxx>
#include <stringconstants.hxx>
+#include <strings.hxx>
#include <osl/diagnose.h>
#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <cppuhelper/interfacecontainer.hxx>
+//#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/property.hxx>
#include <comphelper/propertysequence.hxx>
#include <definitioncolumn.hxx>
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
@@ -142,7 +141,14 @@ css::uno::Sequence<sal_Int8> OComponentDefinition::getImplementationId()
return css::uno::Sequence<sal_Int8>();
}
-IMPLEMENT_GETTYPES3(OComponentDefinition,ODataSettings,OContentHelper,OComponentDefinition_BASE);
+css::uno::Sequence< css::uno::Type > OComponentDefinition::getTypes()
+{
+ return ::comphelper::concatSequences(
+ ODataSettings::getTypes( ),
+ OContentHelper::getTypes( ),
+ OComponentDefinition_BASE::getTypes( )
+ );
+}
IMPLEMENT_FORWARD_XINTERFACE3( OComponentDefinition,OContentHelper,ODataSettings,OComponentDefinition_BASE)
OUString SAL_CALL OComponentDefinition::getImplementationName()
diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx
index 94cb7168d037..7dd40092fe52 100644
--- a/dbaccess/source/core/dataaccess/ContentHelper.cxx
+++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx
@@ -31,15 +31,14 @@
#include <com/sun/star/container/ElementExistException.hpp>
#include <ucbhelper/propertyvalueset.hxx>
#include <ucbhelper/contentidentifier.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/servicehelper.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <tools/diagnose_ex.h>
-#include <apitools.hxx>
+#include <comphelper/diagnose_ex.hxx>
#include <sdbcoretools.hxx>
#include <stringconstants.hxx>
+#include <strings.hxx>
#include <map>
+#include <utility>
namespace dbaccess
{
@@ -49,8 +48,6 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::io;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::embed;
using namespace ::com::sun::star::container;
using namespace ::cppu;
@@ -65,13 +62,13 @@ OContentHelper_Impl::~OContentHelper_Impl()
OContentHelper::OContentHelper(const Reference< XComponentContext >& _xORB
,const Reference< XInterface >& _xParentContainer
- ,const TContentPtr& _pImpl)
+ ,TContentPtr _pImpl)
: OContentHelper_COMPBASE(m_aMutex)
,m_aContentListeners(m_aMutex)
,m_aPropertyChangeListeners(m_aMutex)
,m_xParentContainer( _xParentContainer )
,m_aContext( _xORB )
- ,m_pImpl(_pImpl)
+ ,m_pImpl(std::move(_pImpl))
,m_nCommandId(0)
{
}
@@ -87,14 +84,25 @@ void SAL_CALL OContentHelper::disposing()
m_xParentContainer = nullptr;
}
-IMPLEMENT_SERVICE_INFO1(OContentHelper,"com.sun.star.comp.sdb.Content","com.sun.star.ucb.Content");
+OUString SAL_CALL OContentHelper::getImplementationName()
+ {
+ return "com.sun.star.comp.sdb.Content";
+ }
+sal_Bool SAL_CALL OContentHelper::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
-css::uno::Sequence<sal_Int8> OContentHelper::getUnoTunnelId()
+ return false;
+ }
+css::uno::Sequence< OUString > SAL_CALL OContentHelper::getSupportedServiceNames()
{
- static cppu::OImplementationId aId;
- return aId.getImplementationId();
+ return { "com.sun.star.ucb.Content" };
}
+
css::uno::Sequence<sal_Int8> OContentHelper::getImplementationId()
{
return css::uno::Sequence<sal_Int8>();
@@ -178,7 +186,7 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma
{
OSL_FAIL( "Wrong argument type!" );
ucbhelper::cancelCommandExecution(
- makeAny( IllegalArgumentException(
+ Any( IllegalArgumentException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
-1 ) ),
@@ -196,7 +204,7 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma
{
OSL_FAIL( "Wrong argument type!" );
ucbhelper::cancelCommandExecution(
- makeAny( IllegalArgumentException(
+ Any( IllegalArgumentException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
-1 ) ),
@@ -208,7 +216,7 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma
{
OSL_FAIL( "No properties!" );
ucbhelper::cancelCommandExecution(
- makeAny( IllegalArgumentException(
+ Any( IllegalArgumentException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
-1 ) ),
@@ -234,7 +242,7 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma
OSL_FAIL( "Content::execute - unsupported command!" );
ucbhelper::cancelCommandExecution(
- makeAny( UnsupportedCommandException(
+ Any( UnsupportedCommandException(
OUString(),
static_cast< cppu::OWeakObject * >( this ) ) ),
Environment );
@@ -333,6 +341,7 @@ Sequence< Any > OContentHelper::setPropertyValues(const Sequence< PropertyValue
osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex );
Sequence< Any > aRet( rValues.getLength() );
+ auto aRetRange = asNonConstRange(aRet);
Sequence< PropertyChangeEvent > aChanges( rValues.getLength() );
sal_Int32 nChanged = 0;
@@ -351,7 +360,7 @@ Sequence< Any > OContentHelper::setPropertyValues(const Sequence< PropertyValue
if ( rValue.Name == "ContentType" || rValue.Name == "IsDocument" || rValue.Name == "IsFolder" )
{
// Read-only property!
- aRet[ n ] <<= IllegalAccessException("Property is read-only!",
+ aRetRange[ n ] <<= IllegalAccessException("Property is read-only!",
static_cast< cppu::OWeakObject * >( this ) );
}
else if ( rValue.Name == "Title" )
@@ -385,14 +394,14 @@ Sequence< Any > OContentHelper::setPropertyValues(const Sequence< PropertyValue
}
else
{
- aRet[ n ] <<= IllegalTypeException("Property value has wrong type!",
+ aRetRange[ n ] <<= IllegalTypeException("Property value has wrong type!",
static_cast< cppu::OWeakObject * >( this ) );
}
}
else
{
- aRet[ n ] <<= Exception("No property set for storing the value!",
+ aRetRange[ n ] <<= Exception("No property set for storing the value!",
static_cast< cppu::OWeakObject * >( this ) );
}
}
@@ -486,18 +495,9 @@ void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent
return;
// First, notify listeners interested in changes of every property.
- OInterfaceContainerHelper* pAllPropsContainer = m_aPropertyChangeListeners.getContainer( OUString() );
+ comphelper::OInterfaceContainerHelper3<XPropertiesChangeListener>* pAllPropsContainer = m_aPropertyChangeListeners.getContainer( OUString() );
if ( pAllPropsContainer )
- {
- OInterfaceIteratorHelper aIter( *pAllPropsContainer );
- while ( aIter.hasMoreElements() )
- {
- // Propagate event.
- Reference< XPropertiesChangeListener > xListener( aIter.next(), UNO_QUERY );
- if ( xListener.is() )
- xListener->propertiesChange( evt );
- }
- }
+ pAllPropsContainer->notifyEach( &XPropertiesChangeListener::propertiesChange, evt );
typedef std::map< XPropertiesChangeListener*, Sequence< PropertyChangeEvent > > PropertiesEventListenerMap;
PropertiesEventListenerMap aListeners;
@@ -509,15 +509,15 @@ void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent
const PropertyChangeEvent& rEvent = *propertyChangeEvent;
const OUString& rName = rEvent.PropertyName;
- OInterfaceContainerHelper* pPropsContainer = m_aPropertyChangeListeners.getContainer( rName );
+ comphelper::OInterfaceContainerHelper3<XPropertiesChangeListener>* pPropsContainer = m_aPropertyChangeListeners.getContainer( rName );
if ( pPropsContainer )
{
- OInterfaceIteratorHelper aIter( *pPropsContainer );
+ comphelper::OInterfaceIteratorHelper3 aIter( *pPropsContainer );
while ( aIter.hasMoreElements() )
{
Sequence< PropertyChangeEvent >* propertyEvents;
- XPropertiesChangeListener* pListener = static_cast< XPropertiesChangeListener * >( aIter.next() );
+ XPropertiesChangeListener* pListener = aIter.next().get();
PropertiesEventListenerMap::iterator it = aListeners.find( pListener );
if ( it == aListeners.end() )
{
@@ -528,7 +528,7 @@ void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent
else
propertyEvents = &(*it).second;
- (*propertyEvents)[n] = rEvent;
+ propertyEvents->getArray()[n] = rEvent;
}
}
}
@@ -544,15 +544,6 @@ void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent
}
}
-// css::lang::XUnoTunnel
-sal_Int64 OContentHelper::getSomething( const Sequence< sal_Int8 > & rId )
-{
- if (isUnoTunnelId<OContentHelper>(rId))
- return reinterpret_cast<sal_Int64>(this);
-
- return 0;
-}
-
Reference< XInterface > SAL_CALL OContentHelper::getParent( )
{
::osl::MutexGuard aGuard(m_aMutex);
@@ -572,14 +563,14 @@ void OContentHelper::impl_rename_throw(const OUString& _sNewName,bool _bNotify )
return;
try
{
- Sequence< PropertyChangeEvent > aChanges( 1 );
-
- aChanges[0].Source = static_cast< cppu::OWeakObject * >( this );
- aChanges[0].Further = false;
- aChanges[0].PropertyName = PROPERTY_NAME;
- aChanges[0].PropertyHandle = PROPERTY_ID_NAME;
- aChanges[0].OldValue <<= m_pImpl->m_aProps.aTitle;
- aChanges[0].NewValue <<= _sNewName;
+ Sequence<PropertyChangeEvent> aChanges{
+ { /* Source */ static_cast<cppu::OWeakObject*>(this),
+ /* PropertyName */ PROPERTY_NAME,
+ /* Further */ false,
+ /* PropertyHandle */ PROPERTY_ID_NAME,
+ /* OldValue */ Any(m_pImpl->m_aProps.aTitle),
+ /* NewValue */ Any(_sNewName) }
+ };
aGuard.clear();
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index e41e847cc903..818e70b5433b 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -48,7 +48,7 @@
#include <comphelper/processfactory.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/signaturestate.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/file.hxx>
#include <osl/diagnose.h>
#include <sal/log.hxx>
@@ -58,11 +58,11 @@
#include <i18nlangtag/languagetag.hxx>
#include <algorithm>
+#include <utility>
using namespace css;
using namespace ::com::sun::star::document;
using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
@@ -71,9 +71,7 @@ using namespace ::com::sun::star::embed;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::io;
-using namespace ::com::sun::star::ucb;
using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::view;
using namespace ::com::sun::star::task;
using namespace ::com::sun::star::script;
using namespace ::cppu;
@@ -353,14 +351,11 @@ void SAL_CALL DocumentStorageAccess::disposing( const css::lang::EventObject& So
// ODatabaseModelImpl
ODatabaseModelImpl::ODatabaseModelImpl( const Reference< XComponentContext >& _rxContext, ODatabaseContext& _rDBContext )
- :m_xModel()
- ,m_xDataSource()
- ,m_aContainer(4)
+ :m_aContainer()
,m_aMacroMode( *this )
,m_nImposedMacroExecMode( MacroExecMode::NEVER_EXECUTE )
,m_rDBContext( _rDBContext )
,m_refCount(0)
- ,m_aEmbeddedMacros()
,m_bModificationLock( false )
,m_bDocumentInitialized( false )
,m_nScriptingSignatureState(SignatureState::UNKNOWN)
@@ -372,34 +367,29 @@ ODatabaseModelImpl::ODatabaseModelImpl( const Reference< XComponentContext >& _r
,m_bModified(false)
,m_bDocumentReadOnly(false)
,m_bMacroCallsSeenWhileLoading(false)
- ,m_pSharedConnectionManager(nullptr)
,m_nControllerLockCount(0)
{
// some kind of default
m_sConnectURL = "jdbc:";
- m_aTableFilter.realloc(1);
- m_aTableFilter[0] = "%";
+ m_aTableFilter = { "%" };
impl_construct_nothrow();
}
ODatabaseModelImpl::ODatabaseModelImpl(
- const OUString& _rRegistrationName,
+ OUString _sRegistrationName,
const Reference< XComponentContext >& _rxContext,
ODatabaseContext& _rDBContext
)
- :m_xModel()
- ,m_xDataSource()
- ,m_aContainer(4)
+ :m_aContainer()
,m_aMacroMode( *this )
,m_nImposedMacroExecMode( MacroExecMode::NEVER_EXECUTE )
,m_rDBContext( _rDBContext )
,m_refCount(0)
- ,m_aEmbeddedMacros()
,m_bModificationLock( false )
,m_bDocumentInitialized( false )
,m_nScriptingSignatureState(SignatureState::UNKNOWN)
,m_aContext( _rxContext )
- ,m_sName(_rRegistrationName)
+ ,m_sName(std::move(_sRegistrationName))
,m_nLoginTimeout(0)
,m_bReadOnly(false)
,m_bPasswordRequired(false)
@@ -407,7 +397,6 @@ ODatabaseModelImpl::ODatabaseModelImpl(
,m_bModified(false)
,m_bDocumentReadOnly(false)
,m_bMacroCallsSeenWhileLoading(false)
- ,m_pSharedConnectionManager(nullptr)
,m_nControllerLockCount(0)
{
impl_construct_nothrow();
@@ -448,7 +437,7 @@ void ODatabaseModelImpl::impl_construct_nothrow()
pSettings->ValueType,
PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT | PropertyAttribute::MAYBEVOID
);
- xSettingsSet->insert( makeAny( aProperty ) );
+ xSettingsSet->insert( Any( aProperty ) );
}
else
{
@@ -474,10 +463,10 @@ namespace
const char* pAsciiName( nullptr );
switch ( _eType )
{
- case ODatabaseModelImpl::E_FORM: pAsciiName = "forms"; break;
- case ODatabaseModelImpl::E_REPORT: pAsciiName = "reports"; break;
- case ODatabaseModelImpl::E_QUERY: pAsciiName = "queries"; break;
- case ODatabaseModelImpl::E_TABLE: pAsciiName = "tables"; break;
+ case ODatabaseModelImpl::ObjectType::Form: pAsciiName = "forms"; break;
+ case ODatabaseModelImpl::ObjectType::Report: pAsciiName = "reports"; break;
+ case ODatabaseModelImpl::ObjectType::Query: pAsciiName = "queries"; break;
+ case ODatabaseModelImpl::ObjectType::Table: pAsciiName = "tables"; break;
default:
throw RuntimeException();
}
@@ -567,7 +556,8 @@ bool ODatabaseModelImpl::objectHasMacros( const Reference< XStorage >& _rxContai
void ODatabaseModelImpl::reset()
{
m_bReadOnly = false;
- std::vector<TContentPtr>(4).swap(m_aContainer);
+ for (auto & i : m_aContainer)
+ i.reset();
if ( m_pStorageAccess.is() )
{
@@ -629,7 +619,6 @@ void ODatabaseModelImpl::clearConnections()
}
}
- m_pSharedConnectionManager = nullptr;
m_xSharedConnectionManager = nullptr;
}
@@ -656,7 +645,8 @@ void ODatabaseModelImpl::dispose()
if ( elem )
elem->m_pDataSource = nullptr;
}
- m_aContainer.clear();
+ for (auto & i : m_aContainer)
+ i.reset();
clearConnections();
@@ -772,9 +762,7 @@ Reference< XStorage > const & ODatabaseModelImpl::getOrCreateRootStorage()
if ( aSource.hasValue() )
{
- Sequence< Any > aStorageCreationArgs(2);
- aStorageCreationArgs[0] = aSource;
- aStorageCreationArgs[1] <<= ElementModes::READWRITE;
+ Sequence< Any > aStorageCreationArgs{ aSource, Any(ElementModes::READWRITE) };
Reference< XStorage > xDocumentStorage;
OUString sURL;
@@ -789,7 +777,7 @@ Reference< XStorage > const & ODatabaseModelImpl::getOrCreateRootStorage()
catch( const Exception& )
{
m_bDocumentReadOnly = true;
- aStorageCreationArgs[1] <<= ElementModes::READ;
+ aStorageCreationArgs.getArray()[1] <<= ElementModes::READ;
try
{
xDocumentStorage.set( xStorageFactory->createInstanceWithArguments( aStorageCreationArgs ), UNO_QUERY_THROW );
@@ -842,7 +830,7 @@ bool ODatabaseModelImpl::commitEmbeddedStorage( bool _bPreventRootCommits )
bool ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors( const Reference< XStorage >& _rxStorage )
{
bool bTryToPreserveScriptSignature = false;
- utl::TempFile aTempFile;
+ utl::TempFileNamed aTempFile;
aTempFile.EnableKillingFile();
OUString sTmpFileUrl = aTempFile.GetURL();
SignatureState aSignatureState = getScriptingSignatureState();
@@ -896,7 +884,7 @@ bool ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors( const Reference<
uno::Reference<embed::XStorage> xTargetMetaInf
= _rxStorage->openStorageElement("META-INF", embed::ElementModes::READWRITE);
- if (xMetaInf.is() && xTargetMetaInf.is())
+ if (xMetaInf.is() && xTargetMetaInf.is() && xMetaInf->hasByName(aScriptSignName))
{
xMetaInf->copyElementTo(aScriptSignName, xTargetMetaInf, aScriptSignName);
@@ -985,7 +973,7 @@ Reference< XModel > ODatabaseModelImpl::createNewModel_deliverOwnership()
try
{
Reference< XGlobalEventBroadcaster > xModelCollection = theGlobalEventBroadcaster::get( m_aContext );
- xModelCollection->insert( makeAny( xModel ) );
+ xModelCollection->insert( Any( xModel ) );
}
catch( const Exception& )
{
@@ -1041,68 +1029,68 @@ const AsciiPropertyValue* ODatabaseModelImpl::getDefaultDataSourceSettings()
static const AsciiPropertyValue aKnownSettings[] =
{
// known JDBC settings
- AsciiPropertyValue( "JavaDriverClass", makeAny( OUString() ) ),
- AsciiPropertyValue( "JavaDriverClassPath", makeAny( OUString() ) ),
- AsciiPropertyValue( "IgnoreCurrency", makeAny( false ) ),
+ AsciiPropertyValue( "JavaDriverClass", Any( OUString() ) ),
+ AsciiPropertyValue( "JavaDriverClassPath", Any( OUString() ) ),
+ AsciiPropertyValue( "IgnoreCurrency", Any( false ) ),
// known settings for file-based drivers
- AsciiPropertyValue( "Extension", makeAny( OUString() ) ),
- AsciiPropertyValue( "CharSet", makeAny( OUString() ) ),
- AsciiPropertyValue( "HeaderLine", makeAny( true ) ),
- AsciiPropertyValue( "FieldDelimiter", makeAny( OUString( "," ) ) ),
- AsciiPropertyValue( "StringDelimiter", makeAny( OUString( "\"" ) ) ),
- AsciiPropertyValue( "DecimalDelimiter", makeAny( OUString( "." ) ) ),
- AsciiPropertyValue( "ThousandDelimiter", makeAny( OUString() ) ),
- AsciiPropertyValue( "ShowDeleted", makeAny( false ) ),
+ AsciiPropertyValue( "Extension", Any( OUString() ) ),
+ AsciiPropertyValue( "CharSet", Any( OUString() ) ),
+ AsciiPropertyValue( "HeaderLine", Any( true ) ),
+ AsciiPropertyValue( "FieldDelimiter", Any( OUString( "," ) ) ),
+ AsciiPropertyValue( "StringDelimiter", Any( OUString( "\"" ) ) ),
+ AsciiPropertyValue( "DecimalDelimiter", Any( OUString( "." ) ) ),
+ AsciiPropertyValue( "ThousandDelimiter", Any( OUString() ) ),
+ AsciiPropertyValue( "ShowDeleted", Any( false ) ),
// known ODBC settings
- AsciiPropertyValue( "SystemDriverSettings", makeAny( OUString() ) ),
- AsciiPropertyValue( "UseCatalog", makeAny( false ) ),
- AsciiPropertyValue( "TypeInfoSettings", makeAny( Sequence< Any >()) ),
+ AsciiPropertyValue( "SystemDriverSettings", Any( OUString() ) ),
+ AsciiPropertyValue( "UseCatalog", Any( false ) ),
+ AsciiPropertyValue( "TypeInfoSettings", Any( Sequence< Any >()) ),
// settings related to auto increment handling
- AsciiPropertyValue( "AutoIncrementCreation", makeAny( OUString() ) ),
- AsciiPropertyValue( "AutoRetrievingStatement", makeAny( OUString() ) ),
- AsciiPropertyValue( "IsAutoRetrievingEnabled", makeAny( false ) ),
+ AsciiPropertyValue( "AutoIncrementCreation", Any( OUString() ) ),
+ AsciiPropertyValue( "AutoRetrievingStatement", Any( OUString() ) ),
+ AsciiPropertyValue( "IsAutoRetrievingEnabled", Any( false ) ),
// known LDAP driver settings
- AsciiPropertyValue( "HostName", makeAny( OUString() ) ),
- AsciiPropertyValue( "PortNumber", makeAny( sal_Int32(389) ) ),
- AsciiPropertyValue( "BaseDN", makeAny( OUString() ) ),
- AsciiPropertyValue( "MaxRowCount", makeAny( sal_Int32(100) ) ),
+ AsciiPropertyValue( "HostName", Any( OUString() ) ),
+ AsciiPropertyValue( "PortNumber", Any( sal_Int32(389) ) ),
+ AsciiPropertyValue( "BaseDN", Any( OUString() ) ),
+ AsciiPropertyValue( "MaxRowCount", Any( sal_Int32(100) ) ),
// known MySQLNative driver settings
- AsciiPropertyValue( "LocalSocket", makeAny( OUString() ) ),
- AsciiPropertyValue( "NamedPipe", makeAny( OUString() ) ),
+ AsciiPropertyValue( "LocalSocket", Any( OUString() ) ),
+ AsciiPropertyValue( "NamedPipe", Any( OUString() ) ),
// misc known driver settings
- AsciiPropertyValue( "ParameterNameSubstitution", makeAny( false ) ),
- AsciiPropertyValue( "AddIndexAppendix", makeAny( true ) ),
- AsciiPropertyValue( "IgnoreDriverPrivileges", makeAny( true ) ),
+ AsciiPropertyValue( "ParameterNameSubstitution", Any( false ) ),
+ AsciiPropertyValue( "AddIndexAppendix", Any( true ) ),
+ AsciiPropertyValue( "IgnoreDriverPrivileges", Any( true ) ),
AsciiPropertyValue( "ImplicitCatalogRestriction", ::cppu::UnoType< OUString >::get() ),
AsciiPropertyValue( "ImplicitSchemaRestriction", ::cppu::UnoType< OUString >::get() ),
AsciiPropertyValue( "PrimaryKeySupport", ::cppu::UnoType< sal_Bool >::get() ),
- AsciiPropertyValue( "ShowColumnDescription", makeAny( false ) ),
+ AsciiPropertyValue( "ShowColumnDescription", Any( false ) ),
// known SDB level settings
- AsciiPropertyValue( "NoNameLengthLimit", makeAny( false ) ),
- AsciiPropertyValue( "AppendTableAliasName", makeAny( false ) ),
- AsciiPropertyValue( "GenerateASBeforeCorrelationName", makeAny( false ) ),
- AsciiPropertyValue( "ColumnAliasInOrderBy", makeAny( true ) ),
- AsciiPropertyValue( "EnableSQL92Check", makeAny( false ) ),
- AsciiPropertyValue( "BooleanComparisonMode", makeAny( BooleanComparisonMode::EQUAL_INTEGER ) ),
- AsciiPropertyValue( "TableTypeFilterMode", makeAny( sal_Int32(3) ) ),
- AsciiPropertyValue( "RespectDriverResultSetType", makeAny( false ) ),
- AsciiPropertyValue( "UseSchemaInSelect", makeAny( true ) ),
- AsciiPropertyValue( "UseCatalogInSelect", makeAny( true ) ),
- AsciiPropertyValue( "EnableOuterJoinEscape", makeAny( true ) ),
- AsciiPropertyValue( "PreferDosLikeLineEnds", makeAny( false ) ),
- AsciiPropertyValue( "FormsCheckRequiredFields", makeAny( true ) ),
- AsciiPropertyValue( "EscapeDateTime", makeAny( true ) ),
+ AsciiPropertyValue( "NoNameLengthLimit", Any( false ) ),
+ AsciiPropertyValue( "AppendTableAliasName", Any( false ) ),
+ AsciiPropertyValue( "GenerateASBeforeCorrelationName", Any( false ) ),
+ AsciiPropertyValue( "ColumnAliasInOrderBy", Any( true ) ),
+ AsciiPropertyValue( "EnableSQL92Check", Any( false ) ),
+ AsciiPropertyValue( "BooleanComparisonMode", Any( BooleanComparisonMode::EQUAL_INTEGER ) ),
+ AsciiPropertyValue( "TableTypeFilterMode", Any( sal_Int32(3) ) ),
+ AsciiPropertyValue( "RespectDriverResultSetType", Any( false ) ),
+ AsciiPropertyValue( "UseSchemaInSelect", Any( true ) ),
+ AsciiPropertyValue( "UseCatalogInSelect", Any( true ) ),
+ AsciiPropertyValue( "EnableOuterJoinEscape", Any( true ) ),
+ AsciiPropertyValue( "PreferDosLikeLineEnds", Any( false ) ),
+ AsciiPropertyValue( "FormsCheckRequiredFields", Any( true ) ),
+ AsciiPropertyValue( "EscapeDateTime", Any( true ) ),
// known services to handle database tasks
- AsciiPropertyValue( "TableAlterationServiceName", makeAny( OUString() ) ),
- AsciiPropertyValue( "TableRenameServiceName", makeAny( OUString() ) ),
- AsciiPropertyValue( "ViewAlterationServiceName", makeAny( OUString() ) ),
- AsciiPropertyValue( "ViewAccessServiceName", makeAny( OUString() ) ),
- AsciiPropertyValue( "CommandDefinitions", makeAny( OUString() ) ),
- AsciiPropertyValue( "Forms", makeAny( OUString() ) ),
- AsciiPropertyValue( "Reports", makeAny( OUString() ) ),
- AsciiPropertyValue( "KeyAlterationServiceName", makeAny( OUString() ) ),
- AsciiPropertyValue( "IndexAlterationServiceName", makeAny( OUString() ) ),
+ AsciiPropertyValue( "TableAlterationServiceName", Any( OUString() ) ),
+ AsciiPropertyValue( "TableRenameServiceName", Any( OUString() ) ),
+ AsciiPropertyValue( "ViewAlterationServiceName", Any( OUString() ) ),
+ AsciiPropertyValue( "ViewAccessServiceName", Any( OUString() ) ),
+ AsciiPropertyValue( "CommandDefinitions", Any( OUString() ) ),
+ AsciiPropertyValue( "Forms", Any( OUString() ) ),
+ AsciiPropertyValue( "Reports", Any( OUString() ) ),
+ AsciiPropertyValue( "KeyAlterationServiceName", Any( OUString() ) ),
+ AsciiPropertyValue( "IndexAlterationServiceName", Any( OUString() ) ),
AsciiPropertyValue()
};
@@ -1111,7 +1099,6 @@ const AsciiPropertyValue* ODatabaseModelImpl::getDefaultDataSourceSettings()
TContentPtr& ODatabaseModelImpl::getObjectContainer( ObjectType _eType )
{
- OSL_PRECOND( _eType >= E_FORM && _eType <= E_TABLE, "ODatabaseModelImpl::getObjectContainer: illegal index!" );
TContentPtr& rContentPtr = m_aContainer[ _eType ];
if ( !rContentPtr )
@@ -1132,7 +1119,8 @@ bool ODatabaseModelImpl::checkMacrosOnLoading()
{
Reference< XInteractionHandler > xInteraction;
xInteraction = m_aMediaDescriptor.getOrDefault( "InteractionHandler", xInteraction );
- return m_aMacroMode.checkMacrosOnLoading( xInteraction );
+ const bool bHasMacros = m_aMacroMode.hasMacros();
+ return m_aMacroMode.checkMacrosOnLoading(xInteraction, false /*HasValidContentSignature*/, bHasMacros);
}
void ODatabaseModelImpl::resetMacroExecutionMode()
@@ -1330,17 +1318,17 @@ ODatabaseModelImpl::EmbeddedMacros ODatabaseModelImpl::determineEmbeddedMacros()
{
if ( ::sfx2::DocumentMacroMode::storageHasMacros( getOrCreateRootStorage() ) )
{
- m_aEmbeddedMacros = eDocumentWideMacros;
+ m_aEmbeddedMacros = EmbeddedMacros::DocumentWide;
}
- else if ( lcl_hasObjectsWithMacros_nothrow( *this, E_FORM )
- || lcl_hasObjectsWithMacros_nothrow( *this, E_REPORT )
+ else if ( lcl_hasObjectsWithMacros_nothrow( *this, ObjectType::Form )
+ || lcl_hasObjectsWithMacros_nothrow( *this, ObjectType::Report )
)
{
- m_aEmbeddedMacros = eSubDocumentMacros;
+ m_aEmbeddedMacros = EmbeddedMacros::SubDocument;
}
else
{
- m_aEmbeddedMacros = eNoMacros;
+ m_aEmbeddedMacros = EmbeddedMacros::NONE;
}
}
return *m_aEmbeddedMacros;
@@ -1349,7 +1337,7 @@ ODatabaseModelImpl::EmbeddedMacros ODatabaseModelImpl::determineEmbeddedMacros()
bool ODatabaseModelImpl::documentStorageHasMacros() const
{
const_cast< ODatabaseModelImpl* >( this )->determineEmbeddedMacros();
- return ( *m_aEmbeddedMacros != eNoMacros );
+ return ( *m_aEmbeddedMacros != EmbeddedMacros::NONE );
}
bool ODatabaseModelImpl::macroCallsSeenWhileLoading() const
@@ -1367,7 +1355,8 @@ SignatureState ODatabaseModelImpl::getScriptingSignatureState()
return m_nScriptingSignatureState;
}
-bool ODatabaseModelImpl::hasTrustedScriptingSignature(bool bAllowUIToAddAuthor)
+bool ODatabaseModelImpl::hasTrustedScriptingSignature(
+ const css::uno::Reference<css::task::XInteractionHandler>& _rxInteraction)
{
bool bResult = false;
@@ -1382,7 +1371,7 @@ bool ODatabaseModelImpl::hasTrustedScriptingSignature(bool bAllowUIToAddAuthor)
uno::Reference<security::XDocumentDigitalSignatures> xSigner(
security::DocumentDigitalSignatures::createWithVersion(
comphelper::getProcessComponentContext(), aODFVersion));
- uno::Sequence<security::DocumentSignatureInformation> aInfo
+ const uno::Sequence<security::DocumentSignatureInformation> aInfo
= xSigner->verifyScriptingContentSignatures(xStorage,
uno::Reference<io::XInputStream>());
@@ -1399,20 +1388,15 @@ bool ODatabaseModelImpl::hasTrustedScriptingSignature(bool bAllowUIToAddAuthor)
});
}
- if (!bResult && bAllowUIToAddAuthor)
+ if (!bResult && _rxInteraction)
{
- Reference<XInteractionHandler> xInteraction;
- xInteraction = m_aMediaDescriptor.getOrDefault("InteractionHandler", xInteraction);
- if (xInteraction.is())
- {
- task::DocumentMacroConfirmationRequest aRequest;
- aRequest.DocumentURL = m_sDocFileLocation;
- aRequest.DocumentStorage = xStorage;
- aRequest.DocumentSignatureInformation = aInfo;
- aRequest.DocumentVersion = aODFVersion;
- aRequest.Classification = task::InteractionClassification_QUERY;
- bResult = SfxMedium::CallApproveHandler(xInteraction, uno::makeAny(aRequest), true);
- }
+ task::DocumentMacroConfirmationRequest aRequest;
+ aRequest.DocumentURL = m_sDocFileLocation;
+ aRequest.DocumentStorage = xStorage;
+ aRequest.DocumentSignatureInformation = aInfo;
+ aRequest.DocumentVersion = aODFVersion;
+ aRequest.Classification = task::InteractionClassification_QUERY;
+ bResult = SfxMedium::CallApproveHandler(_rxInteraction, uno::Any(aRequest), true);
}
}
catch (uno::Exception&)
@@ -1427,8 +1411,8 @@ void ODatabaseModelImpl::storageIsModified()
setModified( true );
}
-ModelDependentComponent::ModelDependentComponent( const ::rtl::Reference< ODatabaseModelImpl >& _model )
- :m_pImpl( _model )
+ModelDependentComponent::ModelDependentComponent( ::rtl::Reference< ODatabaseModelImpl > _model )
+ :m_pImpl(std::move( _model ))
{
}
diff --git a/dbaccess/source/core/dataaccess/SharedConnection.cxx b/dbaccess/source/core/dataaccess/SharedConnection.cxx
index 31a8e68ba7b1..d893a8e298b3 100644
--- a/dbaccess/source/core/dataaccess/SharedConnection.cxx
+++ b/dbaccess/source/core/dataaccess/SharedConnection.cxx
@@ -38,8 +38,8 @@ OSharedConnection::~OSharedConnection() {}
void SAL_CALL OSharedConnection::disposing()
{
- OSharedConnection_BASE::disposing();
OConnectionWrapper::disposing();
+ OSharedConnection_BASE::disposing();
}
Reference<XStatement> SAL_CALL OSharedConnection::createStatement()
diff --git a/dbaccess/source/core/dataaccess/SharedConnection.hxx b/dbaccess/source/core/dataaccess/SharedConnection.hxx
index ea6e961cf19d..2c88e58fd55d 100644
--- a/dbaccess/source/core/dataaccess/SharedConnection.hxx
+++ b/dbaccess/source/core/dataaccess/SharedConnection.hxx
@@ -34,11 +34,10 @@ namespace dbaccess
// datasource is asked for not isolated connection.
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XConnection
> OSharedConnection_BASE;
- typedef ::connectivity::OConnectionWrapper OSharedConnection_BASE2;
class OSharedConnection : public ::cppu::BaseMutex
, public OSharedConnection_BASE
- , public OSharedConnection_BASE2
+ , public ::connectivity::OConnectionWrapper
{
protected:
virtual void SAL_CALL disposing() override;
@@ -54,7 +53,7 @@ namespace dbaccess
{
return ::comphelper::concatSequences(
OSharedConnection_BASE::getTypes(),
- OSharedConnection_BASE2::getTypes()
+ ::connectivity::OConnectionWrapper::getTypes()
);
}
@@ -62,7 +61,7 @@ namespace dbaccess
{
css::uno::Any aReturn = OSharedConnection_BASE::queryInterface(_rType);
if ( !aReturn.hasValue() )
- aReturn = OSharedConnection_BASE2::queryInterface(_rType);
+ aReturn = ::connectivity::OConnectionWrapper::queryInterface(_rType);
return aReturn;
}
diff --git a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
index deb618ff9858..a03caea57e93 100644
--- a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
@@ -19,6 +19,7 @@
#include <bookmarkcontainer.hxx>
+#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
#include <comphelper/enumhelper.hxx>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
@@ -96,10 +97,8 @@ void SAL_CALL OBookmarkContainer::insertByName( const OUString& _rName, const An
// notify the listeners
if (m_aContainerListeners.getLength())
{
- ContainerEvent aEvent(*this, makeAny(_rName), makeAny(sNewLink), Any());
- OInterfaceIteratorHelper2 aListenerIterator(m_aContainerListeners);
- while (aListenerIterator.hasMoreElements())
- static_cast< XContainerListener* >(aListenerIterator.next())->elementInserted(aEvent);
+ ContainerEvent aEvent(*this, Any(_rName), Any(sNewLink), Any());
+ m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, aEvent );
}
}
@@ -126,10 +125,8 @@ void SAL_CALL OBookmarkContainer::removeByName( const OUString& _rName )
// notify the listeners
if (m_aContainerListeners.getLength())
{
- ContainerEvent aEvent(*this, makeAny(_rName), makeAny(sOldBookmark), Any());
- OInterfaceIteratorHelper2 aListenerIterator(m_aContainerListeners);
- while (aListenerIterator.hasMoreElements())
- static_cast< XContainerListener* >(aListenerIterator.next())->elementRemoved(aEvent);
+ ContainerEvent aEvent(*this, Any(_rName), Any(sOldBookmark), Any());
+ m_aContainerListeners.notifyEach( &XContainerListener::elementRemoved, aEvent );
}
}
@@ -161,10 +158,8 @@ void SAL_CALL OBookmarkContainer::replaceByName( const OUString& _rName, const A
aGuard.clear();
if (m_aContainerListeners.getLength())
{
- ContainerEvent aEvent(*this, makeAny(_rName), makeAny(sNewLink), makeAny(sOldLink));
- OInterfaceIteratorHelper2 aListenerIterator(m_aContainerListeners);
- while (aListenerIterator.hasMoreElements())
- static_cast< XContainerListener* >(aListenerIterator.next())->elementReplaced(aEvent);
+ ContainerEvent aEvent(*this, Any(_rName), Any(sNewLink), Any(sOldLink));
+ m_aContainerListeners.notifyEach( &XContainerListener::elementReplaced, aEvent );
}
}
@@ -185,7 +180,6 @@ void SAL_CALL OBookmarkContainer::removeContainerListener( const Reference< XCon
// XElementAccess
Type SAL_CALL OBookmarkContainer::getElementType( )
{
- MutexGuard aGuard(m_rMutex);
return ::cppu::UnoType<OUString>::get();
}
@@ -213,10 +207,10 @@ Any SAL_CALL OBookmarkContainer::getByIndex( sal_Int32 _nIndex )
{
MutexGuard aGuard(m_rMutex);
- if ((_nIndex < 0) || (_nIndex >= static_cast<sal_Int32>(m_aBookmarksIndexed.size())))
+ if ((_nIndex < 0) || (o3tl::make_unsigned(_nIndex) >= m_aBookmarksIndexed.size()))
throw IndexOutOfBoundsException();
- return makeAny(m_aBookmarksIndexed[_nIndex]->second);
+ return Any(m_aBookmarksIndexed[_nIndex]->second);
}
Any SAL_CALL OBookmarkContainer::getByName( const OUString& _rName )
@@ -226,7 +220,7 @@ Any SAL_CALL OBookmarkContainer::getByName( const OUString& _rName )
if (!checkExistence(_rName))
throw NoSuchElementException();
- return makeAny(m_aBookmarks[_rName]);
+ return Any(m_aBookmarks[_rName]);
}
Sequence< OUString > SAL_CALL OBookmarkContainer::getElementNames( )
diff --git a/dbaccess/source/core/dataaccess/commandcontainer.cxx b/dbaccess/source/core/dataaccess/commandcontainer.cxx
index 55087272b992..7f646c61722e 100644
--- a/dbaccess/source/core/dataaccess/commandcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/commandcontainer.cxx
@@ -24,11 +24,7 @@
#include <com/sun/star/sdb/CommandDefinition.hpp>
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
using namespace ::com::sun::star::ucb;
-using namespace ::osl;
using namespace ::comphelper;
using namespace ::cppu;
@@ -52,7 +48,13 @@ OCommandContainer::~OCommandContainer()
}
IMPLEMENT_FORWARD_XINTERFACE2( OCommandContainer,ODefinitionContainer,OCommandContainer_BASE)
-IMPLEMENT_GETTYPES2(OCommandContainer,ODefinitionContainer,OCommandContainer_BASE);
+css::uno::Sequence< css::uno::Type > OCommandContainer::getTypes()
+{
+ return ::comphelper::concatSequences(
+ ODefinitionContainer::getTypes( ),
+ OCommandContainer_BASE::getTypes( )
+ );
+}
css::uno::Sequence<sal_Int8> OCommandContainer::getImplementationId()
{
diff --git a/dbaccess/source/core/dataaccess/commanddefinition.cxx b/dbaccess/source/core/dataaccess/commanddefinition.cxx
index 41ce139a8dc1..b3f4fa8b0ead 100644
--- a/dbaccess/source/core/dataaccess/commanddefinition.cxx
+++ b/dbaccess/source/core/dataaccess/commanddefinition.cxx
@@ -18,16 +18,14 @@
*/
#include "commanddefinition.hxx"
-#include <apitools.hxx>
#include <stringconstants.hxx>
+#include <strings.hxx>
#include <com/sun/star/container/ElementExistException.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
@@ -81,9 +79,30 @@ css::uno::Sequence<sal_Int8> OCommandDefinition::getImplementationId()
return css::uno::Sequence<sal_Int8>();
}
-IMPLEMENT_GETTYPES2(OCommandDefinition,OCommandDefinition_Base,OComponentDefinition);
+css::uno::Sequence< css::uno::Type > OCommandDefinition::getTypes()
+{
+ return ::comphelper::concatSequences(
+ OCommandDefinition_Base::getTypes( ),
+ OComponentDefinition::getTypes( )
+ );
+}
IMPLEMENT_FORWARD_XINTERFACE2( OCommandDefinition,OComponentDefinition,OCommandDefinition_Base)
-IMPLEMENT_PROPERTYCONTAINER_DEFAULTS2(OCommandDefinition,OCommandDefinition_PROP)
+css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL OCommandDefinition::getPropertySetInfo()
+{
+ Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+}
+::cppu::IPropertyArrayHelper& OCommandDefinition::getInfoHelper()
+{
+ return *OCommandDefinition_PROP::getArrayHelper();
+}
+::cppu::IPropertyArrayHelper* OCommandDefinition::createArrayHelper( ) const
+{
+ css::uno::Sequence< css::beans::Property > aProps;
+ describeProperties(aProps);
+ return new ::cppu::OPropertyArrayHelper(aProps);
+}
+
OUString SAL_CALL OCommandDefinition::getImplementationName()
{
@@ -105,9 +124,9 @@ void SAL_CALL OCommandDefinition::rename( const OUString& newName )
{
sal_Int32 nHandle = PROPERTY_ID_NAME;
osl::ClearableGuard< osl::Mutex > aGuard(m_aMutex);
- Any aOld = makeAny(m_pImpl->m_aProps.aTitle);
+ Any aOld(m_pImpl->m_aProps.aTitle);
aGuard.clear();
- Any aNew = makeAny(newName);
+ Any aNew(newName);
fire(&nHandle, &aNew, &aOld, 1, true );
m_pImpl->m_aProps.aTitle = newName;
diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx
index d5889255523e..fa4c934a056e 100644
--- a/dbaccess/source/core/dataaccess/connection.cxx
+++ b/dbaccess/source/core/dataaccess/connection.cxx
@@ -24,6 +24,7 @@
#include "connection.hxx"
#include "datasource.hxx"
#include <strings.hrc>
+#include <strings.hxx>
#include <core_resource.hxx>
#include <statement.hxx>
#include <preparedstatement.hxx>
@@ -38,7 +39,7 @@
#include <com/sun/star/beans/NamedValue.hpp>
#include <connectivity/dbtools.hxx>
#include <connectivity/dbmetadata.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <comphelper/sequence.hxx>
#include <comphelper/types.hxx>
@@ -46,7 +47,6 @@
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::util;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdb::application;
using namespace ::com::sun::star::sdbc;
@@ -86,7 +86,7 @@ Sequence< OUString > OConnection::getSupportedServiceNames( )
{
sal_Int32 nLen = aSupported.getLength();
aSupported.realloc( nLen + 1 );
- aSupported[ nLen ] = SERVICE_SDB_CONNECTION;
+ aSupported.getArray()[ nLen ] = SERVICE_SDB_CONNECTION;
}
return aSupported;
@@ -628,9 +628,8 @@ Reference< XInterface > SAL_CALL OConnection::createInstance( const OUString& _s
TSupportServices::const_iterator aFind = m_aSupportServices.find(_sServiceSpecifier);
if ( aFind == m_aSupportServices.end() )
{
- Sequence<Any> aArgs(1);
Reference<XConnection> xMy(this);
- aArgs[0] <<= NamedValue("ActiveConnection",makeAny(xMy));
+ Sequence<Any> aArgs{ Any(NamedValue("ActiveConnection",Any(xMy))) };
aFind = m_aSupportServices.emplace(
_sServiceSpecifier,
m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext(_sServiceSpecifier, aArgs, m_aContext)
@@ -750,7 +749,7 @@ void OConnection::impl_checkTableQueryNames_nothrow()
try
{
Reference< XNameAccess > xTables( getTables() );
- Sequence< OUString > aTableNames( xTables->getElementNames() );
+ const Sequence< OUString > aTableNames( xTables->getElementNames() );
std::set< OUString > aSortedTableNames( aTableNames.begin(), aTableNames.end() );
Reference< XNameAccess > xQueries( getQueries() );
diff --git a/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx b/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx
index e66af7fb4036..ef5239a6793f 100644
--- a/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx
+++ b/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx
@@ -35,7 +35,6 @@
#include <comphelper/uno3.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <rtl/ref.hxx>
namespace
{
@@ -112,48 +111,29 @@ namespace
// </properties>
};
-#define REGISTER_PROPERTY( propname, member ) \
- registerProperty( PROPERTY_##propname, PROPERTY_ID_##propname, PropertyAttribute::BOUND, &member, cppu::UnoType<decltype(member)>::get() )
-
DataAccessDescriptor::DataAccessDescriptor()
- :DataAccessDescriptor_MutexBase()
- ,DataAccessDescriptor_TypeBase()
- ,DataAccessDescriptor_PropertyBase( m_aBHelper )
- ,m_sDataSourceName()
- ,m_sDatabaseLocation()
- ,m_sConnectionResource()
- ,m_aConnectionInfo()
- ,m_xActiveConnection()
- ,m_sCommand()
+ :DataAccessDescriptor_PropertyBase( m_aBHelper )
,m_nCommandType( CommandType::COMMAND )
- ,m_sFilter()
- ,m_sOrder()
- ,m_sHavingClause()
- ,m_sGroupBy()
,m_bEscapeProcessing( true )
- ,m_xResultSet()
- ,m_aSelection()
,m_bBookmarkSelection( true )
- ,m_sColumnName()
- ,m_xColumn()
{
- REGISTER_PROPERTY( DATASOURCENAME, m_sDataSourceName );
- REGISTER_PROPERTY( DATABASE_LOCATION, m_sDatabaseLocation );
- REGISTER_PROPERTY( CONNECTION_RESOURCE, m_sConnectionResource );
- REGISTER_PROPERTY( CONNECTION_INFO, m_aConnectionInfo );
- REGISTER_PROPERTY( ACTIVE_CONNECTION, m_xActiveConnection );
- REGISTER_PROPERTY( COMMAND, m_sCommand );
- REGISTER_PROPERTY( COMMAND_TYPE, m_nCommandType );
- REGISTER_PROPERTY( FILTER, m_sFilter );
- REGISTER_PROPERTY( ORDER, m_sOrder );
- REGISTER_PROPERTY( HAVING_CLAUSE, m_sHavingClause );
- REGISTER_PROPERTY( GROUP_BY, m_sGroupBy );
- REGISTER_PROPERTY( ESCAPE_PROCESSING, m_bEscapeProcessing );
- REGISTER_PROPERTY( RESULT_SET, m_xResultSet );
- REGISTER_PROPERTY( SELECTION, m_aSelection );
- REGISTER_PROPERTY( BOOKMARK_SELECTION, m_bBookmarkSelection );
- REGISTER_PROPERTY( COLUMN_NAME, m_sColumnName );
- REGISTER_PROPERTY( COLUMN, m_xColumn );
+ registerProperty(PROPERTY_DATASOURCENAME, PROPERTY_ID_DATASOURCENAME, PropertyAttribute::BOUND, &m_sDataSourceName , cppu::UnoType<decltype(m_sDataSourceName )>::get());
+ registerProperty(PROPERTY_DATABASE_LOCATION, PROPERTY_ID_DATABASE_LOCATION, PropertyAttribute::BOUND, &m_sDatabaseLocation , cppu::UnoType<decltype(m_sDatabaseLocation )>::get());
+ registerProperty(PROPERTY_CONNECTION_RESOURCE, PROPERTY_ID_CONNECTION_RESOURCE, PropertyAttribute::BOUND, &m_sConnectionResource , cppu::UnoType<decltype(m_sConnectionResource )>::get());
+ registerProperty(PROPERTY_CONNECTION_INFO, PROPERTY_ID_CONNECTION_INFO, PropertyAttribute::BOUND, &m_aConnectionInfo , cppu::UnoType<decltype(m_aConnectionInfo )>::get());
+ registerProperty(PROPERTY_ACTIVE_CONNECTION, PROPERTY_ID_ACTIVE_CONNECTION, PropertyAttribute::BOUND, &m_xActiveConnection , cppu::UnoType<decltype(m_xActiveConnection )>::get());
+ registerProperty(PROPERTY_COMMAND, PROPERTY_ID_COMMAND, PropertyAttribute::BOUND, &m_sCommand , cppu::UnoType<decltype(m_sCommand )>::get());
+ registerProperty(PROPERTY_COMMAND_TYPE, PROPERTY_ID_COMMAND_TYPE, PropertyAttribute::BOUND, &m_nCommandType , cppu::UnoType<decltype(m_nCommandType )>::get());
+ registerProperty(PROPERTY_FILTER, PROPERTY_ID_FILTER, PropertyAttribute::BOUND, &m_sFilter , cppu::UnoType<decltype(m_sFilter )>::get());
+ registerProperty(PROPERTY_ORDER, PROPERTY_ID_ORDER, PropertyAttribute::BOUND, &m_sOrder , cppu::UnoType<decltype(m_sOrder )>::get());
+ registerProperty(PROPERTY_HAVING_CLAUSE, PROPERTY_ID_HAVING_CLAUSE, PropertyAttribute::BOUND, &m_sHavingClause , cppu::UnoType<decltype(m_sHavingClause )>::get());
+ registerProperty(PROPERTY_GROUP_BY, PROPERTY_ID_GROUP_BY, PropertyAttribute::BOUND, &m_sGroupBy , cppu::UnoType<decltype(m_sGroupBy )>::get());
+ registerProperty(PROPERTY_ESCAPE_PROCESSING, PROPERTY_ID_ESCAPE_PROCESSING, PropertyAttribute::BOUND, &m_bEscapeProcessing , cppu::UnoType<decltype(m_bEscapeProcessing )>::get());
+ registerProperty(PROPERTY_RESULT_SET, PROPERTY_ID_RESULT_SET, PropertyAttribute::BOUND, &m_xResultSet , cppu::UnoType<decltype(m_xResultSet )>::get());
+ registerProperty(PROPERTY_SELECTION, PROPERTY_ID_SELECTION, PropertyAttribute::BOUND, &m_aSelection , cppu::UnoType<decltype(m_aSelection )>::get());
+ registerProperty(PROPERTY_BOOKMARK_SELECTION, PROPERTY_ID_BOOKMARK_SELECTION, PropertyAttribute::BOUND, &m_bBookmarkSelection , cppu::UnoType<decltype(m_bBookmarkSelection )>::get());
+ registerProperty(PROPERTY_COLUMN_NAME, PROPERTY_ID_COLUMN_NAME, PropertyAttribute::BOUND, &m_sColumnName , cppu::UnoType<decltype(m_sColumnName )>::get());
+ registerProperty(PROPERTY_COLUMN, PROPERTY_ID_COLUMN, PropertyAttribute::BOUND, &m_xColumn , cppu::UnoType<decltype(m_xColumn )>::get());
}
DataAccessDescriptor::~DataAccessDescriptor()
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index 8e17e0440abc..54c2ae37f356 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -20,6 +20,7 @@
#include <config_features.h>
#include <strings.hrc>
+#include <strings.hxx>
#include <core_resource.hxx>
#include <databasecontext.hxx>
#include "databaseregistrations.hxx"
@@ -52,13 +53,12 @@
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/weak.hxx>
#include <rtl/uri.hxx>
#include <sal/log.hxx>
#include <svl/filenotation.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/urlobj.hxx>
#include <ucbhelper/content.hxx>
#include <rtl/ref.hxx>
@@ -74,7 +74,6 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::registry;
using namespace ::com::sun::star;
using namespace ::cppu;
using namespace ::osl;
@@ -177,12 +176,7 @@ ODatabaseContext::ODatabaseContext( const Reference< XComponentContext >& _rxCon
#endif
osl_atomic_increment( &m_refCount );
- {
- m_xDBRegistrationAggregate.set( createDataSourceRegistrations( m_aContext ), UNO_SET_THROW );
- m_xDatabaseRegistrations.set( m_xDBRegistrationAggregate, UNO_QUERY_THROW );
-
- m_xDBRegistrationAggregate->setDelegator( *this );
- }
+ m_xDatabaseRegistrations = createDataSourceRegistrations( m_aContext );
osl_atomic_decrement( &m_refCount );
}
@@ -193,8 +187,6 @@ ODatabaseContext::~ODatabaseContext()
#endif
m_xDatabaseDocumentLoader.clear();
- m_xDBRegistrationAggregate->setDelegator( nullptr );
- m_xDBRegistrationAggregate.clear();
m_xDatabaseRegistrations.clear();
}
@@ -314,10 +306,11 @@ Reference< XInterface > ODatabaseContext::loadObjectFromURL(const OUString& _rNa
OUString sErrorMessage( DBA_RES( RID_STR_FILE_DOES_NOT_EXIST ) );
::svt::OFileNotation aTransformer( _sURL );
- SQLException aError;
- aError.Message = sErrorMessage.replaceAll( "$file$", aTransformer.get( ::svt::OFileNotation::N_SYSTEM ) );
+ SQLException aError(sErrorMessage.replaceAll(
+ "$file$", aTransformer.get(::svt::OFileNotation::N_SYSTEM)),
+ {}, {}, 0, {});
- throw WrappedTargetException( _sURL, *this, makeAny( aError ) );
+ throw WrappedTargetException( _sURL, *this, Any( aError ) );
}
throw WrappedTargetException( _sURL, *this, ::cppu::getCaughtException() );
}
@@ -440,7 +433,7 @@ void ODatabaseContext::registerObject(const OUString& _rName, const Reference< X
}
// notify our container listeners
- ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_rName), makeAny(_rxObject), Any());
+ ContainerEvent aEvent(static_cast<XContainer*>(this), Any(_rName), Any(_rxObject), Any());
m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, aEvent );
}
@@ -459,7 +452,7 @@ void ODatabaseContext::storeTransientProperties( ODatabaseModelImpl& _rModelImpl
if (xSetInfo.is())
aProperties = xSetInfo->getProperties();
- for ( const Property& rProperty : std::as_const(aProperties) )
+ for (const Property& rProperty : aProperties)
{
if ( ( ( rProperty.Attributes & PropertyAttribute::TRANSIENT) != 0 )
&& ( ( rProperty.Attributes & PropertyAttribute::READONLY) == 0 )
@@ -528,7 +521,7 @@ void ODatabaseContext::revokeObject(const OUString& _rName)
m_aDatabaseObjects.erase( aExistent );
// notify our container listeners
- ContainerEvent aEvent( *this, makeAny( _rName ), Any(), Any() );
+ ContainerEvent aEvent( *this, Any( _rName ), Any(), Any() );
aGuard.clear();
m_aContainerListeners.notifyEach( &XContainerListener::elementRemoved, aEvent );
}
@@ -611,7 +604,7 @@ Any ODatabaseContext::getByName(const OUString& _rName)
{
Reference< XInterface > xExistent = getObject( _rName );
if ( xExistent.is() )
- return makeAny( xExistent );
+ return Any( xExistent );
// see whether this is a registered name
OUString sURL;
@@ -628,7 +621,7 @@ Any ODatabaseContext::getByName(const OUString& _rName)
if ( !xExistent.is() )
// try to load this as URL
xExistent = loadObjectFromURL( _rName, sURL );
- return makeAny( xExistent );
+ return Any( xExistent );
}
catch (const NoSuchElementException&)
{ // let these exceptions through
@@ -707,21 +700,6 @@ void ODatabaseContext::databaseDocumentURLChange( const OUString& _rOldURL, cons
m_aDatabaseObjects.erase( oldPos );
}
-sal_Int64 SAL_CALL ODatabaseContext::getSomething( const Sequence< sal_Int8 >& rId )
-{
- if (isUnoTunnelId<ODatabaseContext>(rId))
- return reinterpret_cast<sal_Int64>(this);
-
- return 0;
-}
-
-Sequence< sal_Int8 > ODatabaseContext::getUnoTunnelId()
-{
- static ::cppu::OImplementationId implId;
-
- return implId.getImplementationId();
-}
-
void ODatabaseContext::onBasicManagerCreated( const Reference< XModel >& _rxForDocument, BasicManager& _rBasicManager )
{
#if !HAVE_FEATURE_SCRIPTING
@@ -740,7 +718,7 @@ void ODatabaseContext::onBasicManagerCreated( const Reference< XModel >& _rxForD
// ... whose BasicManager has just been created, then add the global DatabaseDocument variable to its scope.
if ( xDatabaseDocument.is() )
- _rBasicManager.SetGlobalUNOConstant( "ThisDatabaseDocument", makeAny( xDatabaseDocument ) );
+ _rBasicManager.SetGlobalUNOConstant( "ThisDatabaseDocument", Any( xDatabaseDocument ) );
#endif
}
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 603a0622b2ba..204bad556e5d 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -24,8 +24,11 @@
#include <databasecontext.hxx>
#include "documentcontainer.hxx"
#include <sdbcoretools.hxx>
+#include <strings.hxx>
#include <recovery/dbdocrecovery.hxx>
+#include <officecfg/Office/Common.hxx>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/document/XImporter.hpp>
@@ -59,6 +62,7 @@
#include <comphelper/genericpropertyset.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/numberedcollection.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/propertysetinfo.hxx>
#include <comphelper/types.hxx>
@@ -69,7 +73,7 @@
#include <cppuhelper/supportsservice.hxx>
#include <framework/titlehelper.hxx>
#include <unotools/saveopt.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <vcl/GraphicObject.hxx>
@@ -193,39 +197,24 @@ Any SAL_CALL ODatabaseDocument::queryInterface( const Type& _rType )
)
return Any();
- Any aReturn = ODatabaseDocument_OfficeDocument::queryInterface(_rType);
- if (!aReturn.hasValue())
- aReturn = ODatabaseDocument_Title::queryInterface(_rType);
- return aReturn;
-}
-
-void SAL_CALL ODatabaseDocument::acquire( ) noexcept
-{
- ODatabaseDocument_OfficeDocument::acquire();
-}
-
-void SAL_CALL ODatabaseDocument::release( ) noexcept
-{
- ODatabaseDocument_OfficeDocument::release();
+ return ODatabaseDocument_OfficeDocument::queryInterface(_rType);
}
Sequence< Type > SAL_CALL ODatabaseDocument::getTypes( )
{
- Sequence< Type > aTypes = ::comphelper::concatSequences(
- ODatabaseDocument_OfficeDocument::getTypes(),
- ODatabaseDocument_Title::getTypes()
- );
+ Sequence< Type > aTypes = ODatabaseDocument_OfficeDocument::getTypes();
// strip XEmbeddedScripts and XScriptInvocationContext if we have any form/report
// which already contains macros. In this case, the database document itself is not
// allowed to contain macros, too.
if ( !m_bAllowDocumentScripting )
{
- auto newEnd = std::remove_if( aTypes.begin(), aTypes.end(),
+ auto [begin, end] = asNonConstRange(aTypes);
+ auto newEnd = std::remove_if( begin, end,
[](const Type& t)
{ return t == cppu::UnoType<XEmbeddedScripts>::get() ||
t == cppu::UnoType<XScriptInvocationContext>::get();} );
- aTypes.realloc( std::distance(aTypes.begin(), newEnd) );
+ aTypes.realloc( std::distance(begin, newEnd) );
}
return aTypes;
@@ -275,7 +264,7 @@ namespace
sal_Int32 nLength = _rCallArgs.getLength();
_rCallArgs.realloc( nLength + 1 );
- _rCallArgs[ nLength ] <<= xStatusIndicator;
+ _rCallArgs.getArray()[ nLength ] <<= xStatusIndicator;
}
void lcl_extractAndStartStatusIndicator( const ::comphelper::NamedValueCollection& _rArguments, Reference< XStatusIndicator >& _rxStatusIndicator,
@@ -291,7 +280,7 @@ namespace
sal_Int32 nLength = _rCallArgs.getLength();
_rCallArgs.realloc( nLength + 1 );
- _rCallArgs[ nLength ] <<= _rxStatusIndicator;
+ _rCallArgs.getArray()[ nLength ] <<= _rxStatusIndicator;
}
catch( const Exception& )
{
@@ -301,17 +290,17 @@ namespace
Sequence< PropertyValue > lcl_appendFileNameToDescriptor( const ::comphelper::NamedValueCollection& _rDescriptor, const OUString& _rURL )
{
+ if ( _rURL.isEmpty() )
+ return _rDescriptor.getPropertyValues();
+
::comphelper::NamedValueCollection aMutableDescriptor( _rDescriptor );
- if ( !_rURL.isEmpty() )
- {
- aMutableDescriptor.put( "FileName", _rURL );
- aMutableDescriptor.put( "URL", _rURL );
- }
+ aMutableDescriptor.put( "FileName", _rURL );
+ aMutableDescriptor.put( "URL", _rURL );
return aMutableDescriptor.getPropertyValues();
}
}
-constexpr OUStringLiteral sPictures = u"Pictures";
+constexpr OUString sPictures = u"Pictures"_ustr;
// base documents seem to have a different behaviour to other documents, the
// root storage contents at least seem to be re-used over different saves, thus if there is a
@@ -429,9 +418,8 @@ namespace
{ OUString("BaseURI"), 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 },
{ OUString("StreamName"), 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 },
{ OUString("UsePrettyPrinting"), 0, ::cppu::UnoType<sal_Bool>::get(), beans::PropertyAttribute::MAYBEVOID, 0},
- {OUString("TargetStorage"), 0, cppu::UnoType<embed::XStorage>::get(), beans::PropertyAttribute::MAYBEVOID, 0},
- {OUString("StreamRelPath"), 0, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0},
- { OUString(), 0, css::uno::Type(), 0, 0 }
+ { OUString("TargetStorage"), 0, cppu::UnoType<embed::XStorage>::get(), beans::PropertyAttribute::MAYBEVOID, 0},
+ { OUString("StreamRelPath"), 0, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0},
};
}
@@ -447,12 +435,12 @@ void ODatabaseDocument::impl_import_nolck_throw( const Reference< XComponentCont
if (sBaseURI.isEmpty())
sBaseURI = _rResource.getOrDefault("URL",OUString());
assert(!sBaseURI.isEmpty()); // needed for relative URLs
- xInfoSet->setPropertyValue("BaseURI", uno::makeAny(sBaseURI));
- xInfoSet->setPropertyValue("StreamName", uno::makeAny(OUString("content.xml")));
+ xInfoSet->setPropertyValue("BaseURI", uno::Any(sBaseURI));
+ xInfoSet->setPropertyValue("StreamName", uno::Any(OUString("content.xml")));
const sal_Int32 nCount = aFilterCreationArgs.getLength();
aFilterCreationArgs.realloc(nCount + 1);
- aFilterCreationArgs[nCount] <<= xInfoSet;
+ aFilterCreationArgs.getArray()[nCount] <<= xInfoSet;
Reference< XImporter > xImporter(
_rContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.comp.sdb.DBFilter", aFilterCreationArgs, _rContext),
@@ -771,7 +759,7 @@ bool ODatabaseDocument::impl_attachResource( const OUString& i_rLogicalDocumentU
// determine whether the document as a whole, or sub documents, have macros. Especially the latter
// controls the availability of our XEmbeddedScripts and XScriptInvocationContext interfaces, and we
// should know this before anybody actually uses the object.
- m_bAllowDocumentScripting = ( m_pImpl->determineEmbeddedMacros() != ODatabaseModelImpl::eSubDocumentMacros );
+ m_bAllowDocumentScripting = ( m_pImpl->determineEmbeddedMacros() != ODatabaseModelImpl::EmbeddedMacros::SubDocument );
_rDocGuard.clear();
// <- SYNCHRONIZED
@@ -793,6 +781,15 @@ Sequence< PropertyValue > SAL_CALL ODatabaseDocument::getArgs( )
return m_pImpl->getMediaDescriptor().getPropertyValues();
}
+Sequence< PropertyValue > SAL_CALL ODatabaseDocument::getArgs2( const ::css::uno::Sequence< ::rtl::OUString >& requestedArgs )
+{
+ DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit );
+ std::vector<PropertyValue> aRet;
+ for (const auto & rArgName : requestedArgs)
+ aRet.push_back(PropertyValue(rArgName, 0, m_pImpl->getMediaDescriptor().get(rArgName), PropertyState_DIRECT_VALUE));
+ return comphelper::containerToSequence(aRet);
+}
+
void SAL_CALL ODatabaseDocument::setArgs(const Sequence<beans::PropertyValue>& /* aArgs */)
{
throw NoSupportException();
@@ -1016,7 +1013,7 @@ void ODatabaseDocument::impl_storeAs_throw( const OUString& _rURL, const ::comph
if ( !bIsInitializationProcess )
{
_rGuard.clear();
- m_aEventNotifier.notifyDocumentEvent( _eType == SAVE ? "OnSave" : "OnSaveAs", nullptr, makeAny( _rURL ) );
+ m_aEventNotifier.notifyDocumentEvent( _eType == SAVE ? "OnSave" : "OnSaveAs", nullptr, Any( _rURL ) );
_rGuard.reset();
}
@@ -1076,13 +1073,13 @@ void ODatabaseDocument::impl_storeAs_throw( const OUString& _rURL, const ::comph
catch( const IOException& )
{
if ( !bIsInitializationProcess )
- m_aEventNotifier.notifyDocumentEventAsync( _eType == SAVE ? "OnSaveFailed" : "OnSaveAsFailed", nullptr, makeAny( _rURL ) );
+ m_aEventNotifier.notifyDocumentEventAsync( _eType == SAVE ? "OnSaveFailed" : "OnSaveAsFailed", nullptr, Any( _rURL ) );
throw;
}
catch( const RuntimeException& )
{
if ( !bIsInitializationProcess )
- m_aEventNotifier.notifyDocumentEventAsync( _eType == SAVE ? "OnSaveFailed" : "OnSaveAsFailed", nullptr, makeAny( _rURL ) );
+ m_aEventNotifier.notifyDocumentEventAsync( _eType == SAVE ? "OnSaveFailed" : "OnSaveAsFailed", nullptr, Any( _rURL ) );
throw;
}
catch( const Exception& )
@@ -1091,14 +1088,14 @@ void ODatabaseDocument::impl_storeAs_throw( const OUString& _rURL, const ::comph
// notify the failure
if ( !bIsInitializationProcess )
- m_aEventNotifier.notifyDocumentEventAsync( _eType == SAVE ? "OnSaveFailed" : "OnSaveAsFailed", nullptr, makeAny( _rURL ) );
+ m_aEventNotifier.notifyDocumentEventAsync( _eType == SAVE ? "OnSaveFailed" : "OnSaveAsFailed", nullptr, Any( _rURL ) );
impl_throwIOExceptionCausedBySave_throw( aError, _rURL );
}
// notify the document event
if ( !bIsInitializationProcess )
- m_aEventNotifier.notifyDocumentEventAsync( _eType == SAVE ? "OnSaveDone" : "OnSaveAsDone", nullptr, makeAny( _rURL ) );
+ m_aEventNotifier.notifyDocumentEventAsync( _eType == SAVE ? "OnSaveDone" : "OnSaveAsDone", nullptr, Any( _rURL ) );
// reset our "modified" flag, and clear the guard
impl_setModified_nothrow( false, _rGuard );
@@ -1118,9 +1115,7 @@ Reference< XStorage > ODatabaseDocument::impl_createStorageFor_throw( const OUSt
{
xTruncate->truncate();
}
- Sequence<Any> aParam(2);
- aParam[0] <<= xStream;
- aParam[1] <<= ElementModes::READWRITE | ElementModes::TRUNCATE;
+ Sequence<Any> aParam{ Any(xStream), Any(ElementModes::READWRITE | ElementModes::TRUNCATE) };
Reference< XSingleServiceFactory > xStorageFactory( m_pImpl->createStorageFactory(), UNO_SET_THROW );
return Reference< XStorage >( xStorageFactory->createInstanceWithArguments( aParam ), UNO_QUERY_THROW );
@@ -1240,7 +1235,7 @@ void SAL_CALL ODatabaseDocument::storeToURL( const OUString& _rURL, const Sequen
{
aGuard.clear();
- m_aEventNotifier.notifyDocumentEvent( "OnSaveTo", nullptr, makeAny( _rURL ) );
+ m_aEventNotifier.notifyDocumentEvent( "OnSaveTo", nullptr, Any( _rURL ) );
aGuard.reset();
}
@@ -1272,7 +1267,7 @@ void SAL_CALL ODatabaseDocument::storeToURL( const OUString& _rURL, const Sequen
impl_throwIOExceptionCausedBySave_throw( aError, _rURL );
}
- m_aEventNotifier.notifyDocumentEventAsync( "OnSaveToDone", nullptr, makeAny( _rURL ) );
+ m_aEventNotifier.notifyDocumentEventAsync( "OnSaveToDone", nullptr, Any( _rURL ) );
}
// XModifyBroadcaster
@@ -1402,10 +1397,10 @@ void ODatabaseDocument::clearObjectContainer( WeakReference< XNameAccess >& _rxC
Reference< XNameAccess > ODatabaseDocument::impl_getDocumentContainer_throw( ODatabaseModelImpl::ObjectType _eType )
{
- if ( ( _eType != ODatabaseModelImpl::E_FORM ) && ( _eType != ODatabaseModelImpl::E_REPORT ) )
+ if ( ( _eType != ODatabaseModelImpl::ObjectType::Form ) && ( _eType != ODatabaseModelImpl::ObjectType::Report ) )
throw IllegalArgumentException();
- bool bFormsContainer = _eType == ODatabaseModelImpl::E_FORM;
+ bool bFormsContainer = _eType == ODatabaseModelImpl::ObjectType::Form;
WeakReference< XNameAccess >& rContainerRef( bFormsContainer ? m_xForms : m_xReports );
Reference< XNameAccess > xContainer = rContainerRef;
@@ -1419,8 +1414,7 @@ Reference< XNameAccess > ODatabaseDocument::impl_getDocumentContainer_throw( ODa
aValue >>= sSupportService;
if ( !sSupportService.isEmpty() )
{
- Sequence<Any> aArgs(1);
- aArgs[0] <<= NamedValue("DatabaseDocument",makeAny(xMy));
+ Sequence<Any> aArgs{ Any(NamedValue("DatabaseDocument",Any(xMy))) };
xContainer.set(
m_pImpl->m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext(sSupportService, aArgs, m_pImpl->m_aContext),
UNO_QUERY);
@@ -1497,7 +1491,7 @@ void SAL_CALL ODatabaseDocument::close(sal_Bool bDeliverOwnership)
{
// allow listeners to veto
lang::EventObject aEvent( *this );
- m_aCloseListener.forEach< XCloseListener >(
+ m_aCloseListener.forEach(
[&aEvent, &bDeliverOwnership] (uno::Reference<XCloseListener> const& xListener) {
return xListener->queryClosing(aEvent, bDeliverOwnership);
});
@@ -1539,13 +1533,13 @@ void SAL_CALL ODatabaseDocument::removeCloseListener( const Reference< css::util
Reference< XNameAccess > SAL_CALL ODatabaseDocument::getFormDocuments( )
{
DocumentGuard aGuard( *this, DocumentGuard::MethodUsedDuringInit );
- return impl_getDocumentContainer_throw( ODatabaseModelImpl::E_FORM );
+ return impl_getDocumentContainer_throw( ODatabaseModelImpl::ObjectType::Form );
}
Reference< XNameAccess > SAL_CALL ODatabaseDocument::getReportDocuments( )
{
DocumentGuard aGuard( *this, DocumentGuard::MethodUsedDuringInit );
- return impl_getDocumentContainer_throw( ODatabaseModelImpl::E_REPORT );
+ return impl_getDocumentContainer_throw( ODatabaseModelImpl::ObjectType::Report );
}
void ODatabaseDocument::WriteThroughComponent( const Reference< XComponent >& xComponent, const char* pStreamName,
@@ -1571,8 +1565,8 @@ void ODatabaseDocument::WriteThroughComponent( const Reference< XComponent >& xC
xSeek->seek(0);
Reference< XPropertySet > xStreamProp( xOutputStream, UNO_QUERY_THROW );
- xStreamProp->setPropertyValue( INFO_MEDIATYPE, makeAny( OUString( "text/xml" ) ) );
- xStreamProp->setPropertyValue( "Compressed", makeAny( true ) );
+ xStreamProp->setPropertyValue( INFO_MEDIATYPE, Any( OUString( "text/xml" ) ) );
+ xStreamProp->setPropertyValue( "Compressed", Any( true ) );
// write the stuff
WriteThroughComponent( xOutputStream, xComponent, pServiceName, _rArguments, rMediaDesc );
@@ -1594,9 +1588,10 @@ void ODatabaseDocument::WriteThroughComponent( const Reference< XOutputStream >&
// prepare arguments (prepend doc handler to given arguments)
Sequence<Any> aArgs( 1 + _rArguments.getLength() );
- aArgs[0] <<= xSaxWriter;
+ auto pArgs = aArgs.getArray();
+ pArgs[0] <<= xSaxWriter;
for ( sal_Int32 i = 0; i < _rArguments.getLength(); ++i )
- aArgs[ i+1 ] = _rArguments[i];
+ pArgs[ i+1 ] = _rArguments[i];
// get filter component
Reference< XExporter > xExporter( m_pImpl->m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext(OUString::createFromAscii(pServiceName), aArgs, m_pImpl->m_aContext), UNO_QUERY_THROW );
@@ -1617,18 +1612,17 @@ void ODatabaseDocument::impl_writeStorage_throw( const Reference< XStorage >& _r
uno::Reference< beans::XPropertySet > xInfoSet( comphelper::GenericPropertySet_CreateInstance( new comphelper::PropertySetInfo( aExportInfoMap ) ) );
- SvtSaveOptions aSaveOpt;
- xInfoSet->setPropertyValue("UsePrettyPrinting", uno::makeAny(aSaveOpt.IsPrettyPrinting()));
- if ( aSaveOpt.IsSaveRelFSys() )
+ xInfoSet->setPropertyValue("UsePrettyPrinting", uno::Any(officecfg::Office::Common::Save::Document::PrettyPrinting::get()));
+ if ( officecfg::Office::Common::Save::URL::FileSystem::get() )
{
OUString sBaseURI = _rMediaDescriptor.getOrDefault("BaseURI", OUString());
if (sBaseURI.isEmpty())
sBaseURI = _rMediaDescriptor.getOrDefault("URL",OUString());
- xInfoSet->setPropertyValue("BaseURI", uno::makeAny(sBaseURI));
+ xInfoSet->setPropertyValue("BaseURI", uno::Any(sBaseURI));
}
// Set TargetStorage, so it doesn't have to be re-constructed based on possibly empty URL.
- xInfoSet->setPropertyValue("TargetStorage", uno::makeAny(m_pImpl->getRootStorage()));
+ xInfoSet->setPropertyValue("TargetStorage", uno::Any(m_pImpl->getRootStorage()));
// Set StreamRelPath, in case this document is an embedded one.
OUString sStreamRelPath;
@@ -1642,18 +1636,18 @@ void ODatabaseDocument::impl_writeStorage_throw( const Reference< XStorage >& _r
sStreamRelPath = sStreamRelPath.copy(1);
}
if (!sStreamRelPath.isEmpty())
- xInfoSet->setPropertyValue("StreamRelPath", uno::makeAny(sStreamRelPath));
+ xInfoSet->setPropertyValue("StreamRelPath", uno::Any(sStreamRelPath));
sal_Int32 nArgsLen = aDelegatorArguments.getLength();
aDelegatorArguments.realloc(nArgsLen+1);
- aDelegatorArguments[nArgsLen++] <<= xInfoSet;
+ aDelegatorArguments.getArray()[nArgsLen++] <<= xInfoSet;
Reference< XPropertySet > xProp( _rxTargetStorage, UNO_QUERY_THROW );
- xProp->setPropertyValue( INFO_MEDIATYPE, makeAny( OUString(MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII) ) );
+ xProp->setPropertyValue( INFO_MEDIATYPE, Any( MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII ) );
OUString aVersion;
SvtSaveOptions::ODFSaneDefaultVersion const nDefVersion =
- aSaveOpt.GetODFSaneDefaultVersion();
+ GetODFSaneDefaultVersion();
// older versions can not have this property set,
// it exists only starting from ODF1.2
if (nDefVersion >= SvtSaveOptions::ODFSVER_013)
@@ -1669,7 +1663,7 @@ void ODatabaseDocument::impl_writeStorage_throw( const Reference< XStorage >& _r
{
try
{
- xProp->setPropertyValue("Version" , uno::makeAny(aVersion));
+ xProp->setPropertyValue("Version" , uno::Any(aVersion));
}
catch (const uno::Exception&)
{
@@ -1682,11 +1676,11 @@ void ODatabaseDocument::impl_writeStorage_throw( const Reference< XStorage >& _r
Sequence< PropertyValue > aMediaDescriptor;
_rMediaDescriptor >>= aMediaDescriptor;
- xInfoSet->setPropertyValue("StreamName", uno::makeAny(OUString("settings.xml")));
+ xInfoSet->setPropertyValue("StreamName", uno::Any(OUString("settings.xml")));
WriteThroughComponent( xComponent, "settings.xml", "com.sun.star.comp.sdb.XMLSettingsExporter",
aDelegatorArguments, aMediaDescriptor, _rxTargetStorage );
- xInfoSet->setPropertyValue("StreamName", uno::makeAny(OUString("content.xml")));
+ xInfoSet->setPropertyValue("StreamName", uno::Any(OUString("content.xml")));
WriteThroughComponent( xComponent, "content.xml", "com.sun.star.comp.sdb.DBExportFilter",
aDelegatorArguments, aMediaDescriptor, _rxTargetStorage );
@@ -1767,7 +1761,7 @@ void ODatabaseDocument::impl_notifyStorageChange_nolck_nothrow( const Reference<
{
Reference< XInterface > xMe( *this );
- m_aStorageListeners.forEach< XStorageChangeListener >(
+ m_aStorageListeners.forEach(
[&xMe, &xNewRootStorage] (uno::Reference<XStorageChangeListener> const& xListener) {
return xListener->notifyStorageChange(xMe, xNewRootStorage);
});
@@ -1859,6 +1853,11 @@ void ODatabaseDocument::disposing()
void SAL_CALL ODatabaseDocument::dispose( )
{
::cppu::WeakComponentImplHelperBase::dispose();
+ m_xTitleHelper.clear();
+ m_xModuleManager.clear();
+ m_pEventExecutor.clear();
+ m_xCurrentController.clear();
+ m_xUIConfigurationManager.clear();
}
void SAL_CALL ODatabaseDocument::addEventListener( const Reference< lang::XEventListener >& _xListener )
@@ -1901,7 +1900,6 @@ comphelper::PropertyMapEntry const aEmbeddedImportInfoMap[] =
{OUString("StreamRelPath"), 0, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0},
{OUString("StreamName"), 0, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0},
{OUString("SourceStorage"), 0, cppu::UnoType<embed::XStorage>::get(), beans::PropertyAttribute::MAYBEVOID, 0},
- {OUString(), 0, css::uno::Type(), 0, 0}
};
}
@@ -1910,13 +1908,11 @@ void SAL_CALL ODatabaseDocument::loadFromStorage(const Reference<XStorage>& xSto
DocumentGuard aGuard(*this, DocumentGuard::InitMethod);
uno::Reference<beans::XPropertySet> xInfoSet(comphelper::GenericPropertySet_CreateInstance(new comphelper::PropertySetInfo(aEmbeddedImportInfoMap)));
- comphelper::NamedValueCollection aDescriptor(rMediaDescriptor);
- xInfoSet->setPropertyValue("StreamRelPath", uno::makeAny(aDescriptor.getOrDefault("HierarchicalDocumentName", OUString())));
- xInfoSet->setPropertyValue("StreamName", uno::makeAny(OUString("content.xml")));
- xInfoSet->setPropertyValue("SourceStorage", uno::makeAny(xStorage));
+ xInfoSet->setPropertyValue("StreamRelPath", uno::Any(comphelper::NamedValueCollection::getOrDefault(rMediaDescriptor, u"HierarchicalDocumentName", OUString())));
+ xInfoSet->setPropertyValue("StreamName", uno::Any(OUString("content.xml")));
+ xInfoSet->setPropertyValue("SourceStorage", uno::Any(xStorage));
- uno::Sequence<uno::Any> aFilterCreationArgs(1);
- aFilterCreationArgs[0] <<= xInfoSet;
+ uno::Sequence<uno::Any> aFilterCreationArgs{ Any(xInfoSet) };
uno::Reference<document::XImporter> xImporter(m_pImpl->m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.comp.sdb.DBFilter", aFilterCreationArgs, m_pImpl->m_aContext), uno::UNO_QUERY_THROW);
@@ -2029,7 +2025,7 @@ struct CreateAny
{
Any operator() (const Reference<XController>& lhs) const
{
- return makeAny(lhs);
+ return Any(lhs);
}
};
@@ -2086,10 +2082,7 @@ Reference< XTitle > const & ODatabaseDocument::impl_getTitleHelper_throw()
Reference< XUntitledNumbers > xDesktop(Desktop::create(m_pImpl->m_aContext), uno::UNO_QUERY_THROW);
Reference< frame::XModel > xThis (getThis(), uno::UNO_QUERY_THROW);
- rtl::Reference<::framework::TitleHelper> pHelper = new ::framework::TitleHelper(m_pImpl->m_aContext);
- m_xTitleHelper = pHelper;
- pHelper->setOwner (xThis );
- pHelper->connectWithUntitledNumbers (xDesktop);
+ m_xTitleHelper = new ::framework::TitleHelper(m_pImpl->m_aContext, xThis, xDesktop);
}
return m_xTitleHelper;
@@ -2101,23 +2094,17 @@ uno::Reference< frame::XUntitledNumbers > ODatabaseDocument::impl_getUntitledHel
m_xModuleManager.set( ModuleManager::create(m_pImpl->m_aContext) );
OUString sModuleId;
- try
- {
- sModuleId = m_xModuleManager->identify( _xComponent );
- }
- catch(const uno::Exception&)
- {
- }
+ if (_xComponent.is())
+ sModuleId = m_xModuleManager->identify(_xComponent);
+
uno::Reference< frame::XUntitledNumbers > xNumberedControllers;
TNumberedController::const_iterator aFind = m_aNumberedControllers.find(sModuleId);
if ( aFind == m_aNumberedControllers.end() )
{
- uno::Reference< frame::XModel > xThis(static_cast< frame::XModel* >(this), uno::UNO_QUERY_THROW);
rtl::Reference<::comphelper::NumberedCollection> pHelper = new ::comphelper::NumberedCollection();
xNumberedControllers = pHelper;
-
- pHelper->setOwner (xThis);
+ pHelper->setOwner(uno::Reference< frame::XModel >(this));
m_aNumberedControllers.emplace( sModuleId,xNumberedControllers );
}
@@ -2198,11 +2185,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
com_sun_star_comp_dba_ODatabaseDocument(css::uno::XComponentContext* context,
css::uno::Sequence<css::uno::Any> const &)
{
- Reference<XUnoTunnel> xDBContextTunnel(DatabaseContext::create(context), UNO_QUERY_THROW);
- dbaccess::ODatabaseContext* pContext = reinterpret_cast<dbaccess::ODatabaseContext*>(
- xDBContextTunnel->getSomething(
- dbaccess::ODatabaseContext::getUnoTunnelId()));
-
+ Reference<XInterface> xDBContextTunnel(DatabaseContext::create(context), UNO_QUERY_THROW);
+ rtl::Reference<dbaccess::ODatabaseContext> pContext
+ = dynamic_cast<dbaccess::ODatabaseContext*>(xDBContextTunnel.get());
+ assert(pContext);
+
rtl::Reference pImpl(
new dbaccess::ODatabaseModelImpl(context, *pContext));
css::uno::Reference<XInterface> inst(pImpl->createNewModel_deliverOwnership());
diff --git a/dbaccess/source/core/dataaccess/databasedocument.hxx b/dbaccess/source/core/dataaccess/databasedocument.hxx
index b1bfbedc61b2..6278aa039a63 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.hxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.hxx
@@ -28,7 +28,7 @@
#include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
#include <com/sun/star/frame/DoubleInitializationException.hpp>
-#include <com/sun/star/frame/XModel2.hpp>
+#include <com/sun/star/frame/XModel3.hpp>
#include <com/sun/star/frame/XTitle.hpp>
#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
#include <com/sun/star/frame/XUntitledNumbers.hpp>
@@ -57,6 +57,7 @@
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/util/XModifiable.hpp>
+#include <comphelper/interfacecontainer3.hxx>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/implbase3.hxx>
#include <rtl/ref.hxx>
@@ -130,7 +131,7 @@ private:
};
// ODatabaseDocument
-typedef cppu::PartialWeakComponentImplHelper< css::frame::XModel2
+typedef cppu::PartialWeakComponentImplHelper< css::frame::XModel3
, css::util::XModifiable
, css::frame::XStorable
, css::document::XEventBroadcaster
@@ -147,16 +148,13 @@ typedef cppu::PartialWeakComponentImplHelper< css::frame::XModel2
, css::document::XEventsSupplier
, css::frame::XLoadable
, css::document::XDocumentRecovery
+ , css::frame::XTitle
+ , css::frame::XTitleChangeBroadcaster
+ , css::frame::XUntitledNumbers
> ODatabaseDocument_OfficeDocument;
-typedef ::cppu::ImplHelper3< css::frame::XTitle
- , css::frame::XTitleChangeBroadcaster
- , css::frame::XUntitledNumbers
- > ODatabaseDocument_Title;
-
class ODatabaseDocument :public ModelDependentComponent // ModelDependentComponent must be first!
,public ODatabaseDocument_OfficeDocument
- ,public ODatabaseDocument_Title
{
enum InitState
{
@@ -168,9 +166,9 @@ class ODatabaseDocument :public ModelDependentComponent // ModelDepe
typedef std::map< OUString, css::uno::Reference< css::frame::XUntitledNumbers > > TNumberedController;
css::uno::Reference< css::ui::XUIConfigurationManager2> m_xUIConfigurationManager;
- ::comphelper::OInterfaceContainerHelper2 m_aModifyListeners;
- ::comphelper::OInterfaceContainerHelper2 m_aCloseListener;
- ::comphelper::OInterfaceContainerHelper2 m_aStorageListeners;
+ ::comphelper::OInterfaceContainerHelper3<css::util::XModifyListener> m_aModifyListeners;
+ ::comphelper::OInterfaceContainerHelper3<css::util::XCloseListener> m_aCloseListener;
+ ::comphelper::OInterfaceContainerHelper3<css::document::XStorageChangeListener> m_aStorageListeners;
std::unique_ptr<DocumentEvents> m_pEventContainer;
::rtl::Reference< DocumentEventExecutor > m_pEventExecutor;
@@ -298,8 +296,6 @@ public:
// XInterface
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override;
- virtual void SAL_CALL acquire( ) noexcept override;
- virtual void SAL_CALL release( ) noexcept override;
// XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
@@ -330,6 +326,9 @@ public:
virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createViewController( const OUString& ViewName, const css::uno::Sequence< css::beans::PropertyValue >& Arguments, const css::uno::Reference< css::frame::XFrame >& Frame ) override ;
virtual void SAL_CALL setArgs(const css::uno::Sequence<css::beans::PropertyValue>& aArgs) override;
+ // XModel3
+ virtual ::css::uno::Sequence< ::css::beans::PropertyValue > SAL_CALL getArgs2( const ::css::uno::Sequence< ::rtl::OUString >& requestedArgs ) override;
+
// XStorable
virtual sal_Bool SAL_CALL hasLocation( ) override ;
virtual OUString SAL_CALL getLocation( ) override ;
diff --git a/dbaccess/source/core/dataaccess/databaseregistrations.cxx b/dbaccess/source/core/dataaccess/databaseregistrations.cxx
index 6009653ce1a7..3b19de41c366 100644
--- a/dbaccess/source/core/dataaccess/databaseregistrations.cxx
+++ b/dbaccess/source/core/dataaccess/databaseregistrations.cxx
@@ -26,8 +26,8 @@
#include <com/sun/star/sdb/XDatabaseRegistrations.hpp>
#include <cppuhelper/basemutex.hxx>
-#include <comphelper/interfacecontainer2.hxx>
-#include <cppuhelper/implbase1.hxx>
+#include <comphelper/interfacecontainer3.hxx>
+#include <cppuhelper/implbase.hxx>
#include <osl/diagnose.h>
#include <unotools/pathoptions.hxx>
#include <tools/urlobj.hxx>
@@ -39,7 +39,7 @@ namespace dbaccess
{
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::RuntimeException;
- using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::XComponentContext;
using ::com::sun::star::container::NoSuchElementException;
@@ -51,24 +51,13 @@ namespace dbaccess
using ::com::sun::star::sdb::DatabaseRegistrationEvent;
using ::com::sun::star::uno::XAggregation;
- static OUString getConfigurationRootPath()
- {
- return "org.openoffice.Office.DataAccess/RegisteredNames";
- }
-
- static OUString getLocationNodeName()
- {
- return "Location";
- }
-
- static OUString getNameNodeName()
- {
- return "Name";
- }
+ constexpr OUString CONF_ROOT_PATH = u"org.openoffice.Office.DataAccess/RegisteredNames"_ustr;
+ constexpr OUString LOCATION = u"Location"_ustr;
+ constexpr OUString NAME = u"Name"_ustr;
// DatabaseRegistrations - declaration
- typedef ::cppu::WeakAggImplHelper1 < XDatabaseRegistrations
- > DatabaseRegistrations_Base;
+ typedef ::cppu::WeakImplHelper< XDatabaseRegistrations
+ > DatabaseRegistrations_Base;
namespace {
@@ -100,7 +89,7 @@ namespace dbaccess
::utl::OConfigurationNode
impl_checkValidName_throw_must_not_exist(const OUString& _rName);
- void impl_checkValidLocation_throw( const OUString& _rLocation );
+ void impl_checkValidLocation_throw( std::u16string_view _rLocation );
/** retrieves the configuration node whose "Name" sub node has the given value
@@ -136,7 +125,7 @@ namespace dbaccess
private:
Reference<XComponentContext> m_aContext;
::utl::OConfigurationTreeRoot m_aConfigurationRoot;
- ::comphelper::OInterfaceContainerHelper2 m_aRegistrationListeners;
+ ::comphelper::OInterfaceContainerHelper3<XDatabaseRegistrationsListener> m_aRegistrationListeners;
};
}
@@ -144,11 +133,10 @@ namespace dbaccess
// DatabaseRegistrations - implementation
DatabaseRegistrations::DatabaseRegistrations( const Reference<XComponentContext> & _rxContext )
:m_aContext( _rxContext )
- ,m_aConfigurationRoot()
,m_aRegistrationListeners( m_aMutex )
{
m_aConfigurationRoot = ::utl::OConfigurationTreeRoot::createWithComponentContext(
- m_aContext, getConfigurationRootPath() );
+ m_aContext, CONF_ROOT_PATH );
}
DatabaseRegistrations::~DatabaseRegistrations()
@@ -163,7 +151,7 @@ namespace dbaccess
::utl::OConfigurationNode aNodeForName = m_aConfigurationRoot.openNode( nodeName );
OUString sTestName;
- OSL_VERIFY( aNodeForName.getNodeValue( getNameNodeName() ) >>= sTestName );
+ OSL_VERIFY( aNodeForName.getNodeValue( NAME ) >>= sTestName );
if ( sTestName == _rName )
return aNodeForName;
}
@@ -197,7 +185,7 @@ namespace dbaccess
}
::utl::OConfigurationNode aNewNode( m_aConfigurationRoot.createNode( sNewNodeName ) );
- aNewNode.setNodeValue( getNameNodeName(), makeAny( _rName ) );
+ aNewNode.setNodeValue( NAME, Any( _rName ) );
return aNewNode;
}
@@ -222,9 +210,9 @@ namespace dbaccess
return impl_getNodeForName_throw_must_not_exist(_rName);
}
- void DatabaseRegistrations::impl_checkValidLocation_throw( const OUString& _rLocation )
+ void DatabaseRegistrations::impl_checkValidLocation_throw( std::u16string_view _rLocation )
{
- if ( _rLocation.isEmpty() )
+ if ( _rLocation.empty() )
throw IllegalArgumentException( OUString(), *this, 2 );
INetURLObject aURL( _rLocation );
@@ -252,7 +240,7 @@ namespace dbaccess
for ( auto const & name : aProgrammaticNames )
{
::utl::OConfigurationNode aRegistrationNode = m_aConfigurationRoot.openNode( name );
- OSL_VERIFY( aRegistrationNode.getNodeValue( getNameNodeName() ) >>= *pDisplayName );
+ OSL_VERIFY( aRegistrationNode.getNodeValue( NAME ) >>= *pDisplayName );
++pDisplayName;
}
@@ -266,7 +254,7 @@ namespace dbaccess
::utl::OConfigurationNode aNodeForName = impl_checkValidName_throw_must_exist(Name);
OUString sLocation;
- OSL_VERIFY( aNodeForName.getNodeValue( getLocationNodeName() ) >>= sLocation );
+ OSL_VERIFY( aNodeForName.getNodeValue( LOCATION ) >>= sLocation );
sLocation = SvtPathOptions().SubstituteVariable( sLocation );
return sLocation;
@@ -281,7 +269,7 @@ namespace dbaccess
::utl::OConfigurationNode aDataSourceRegistration = impl_checkValidName_throw_must_not_exist(Name);
// register
- aDataSourceRegistration.setNodeValue( getLocationNodeName(), makeAny( Location ) );
+ aDataSourceRegistration.setNodeValue( LOCATION, Any( Location ) );
m_aConfigurationRoot.commit();
// notify
@@ -299,7 +287,7 @@ namespace dbaccess
// obtain properties for notification
OUString sLocation;
- OSL_VERIFY( aNodeForName.getNodeValue( getLocationNodeName() ) >>= sLocation );
+ OSL_VERIFY( aNodeForName.getNodeValue( LOCATION ) >>= sLocation );
// revoke
if ( aNodeForName.isReadonly()
@@ -328,10 +316,10 @@ namespace dbaccess
// obtain properties for notification
OUString sOldLocation;
- OSL_VERIFY( aDataSourceRegistration.getNodeValue( getLocationNodeName() ) >>= sOldLocation );
+ OSL_VERIFY( aDataSourceRegistration.getNodeValue( LOCATION ) >>= sOldLocation );
// change
- aDataSourceRegistration.setNodeValue( getLocationNodeName(), makeAny( NewLocation ) );
+ aDataSourceRegistration.setNodeValue( LOCATION, Any( NewLocation ) );
m_aConfigurationRoot.commit();
// notify
@@ -360,7 +348,7 @@ namespace dbaccess
}
// DatabaseRegistrations - factory
- Reference< XAggregation > createDataSourceRegistrations( const Reference<XComponentContext> & _rxContext )
+ Reference< XDatabaseRegistrations > createDataSourceRegistrations( const Reference<XComponentContext> & _rxContext )
{
return new DatabaseRegistrations( _rxContext );
}
diff --git a/dbaccess/source/core/dataaccess/databaseregistrations.hxx b/dbaccess/source/core/dataaccess/databaseregistrations.hxx
index 709bc9f98490..52def1de5aa2 100644
--- a/dbaccess/source/core/dataaccess/databaseregistrations.hxx
+++ b/dbaccess/source/core/dataaccess/databaseregistrations.hxx
@@ -20,11 +20,11 @@
#pragma once
#include <com/sun/star/uno/XAggregation.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/sdb/XDatabaseRegistrations.hpp>
namespace dbaccess
{
-css::uno::Reference<css::uno::XAggregation>
+css::uno::Reference<css::sdb::XDatabaseRegistrations>
createDataSourceRegistrations(const css::uno::Reference<css::uno::XComponentContext>& _rxContext);
} // namespace dbaccess
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx
index 83a45afa3e2d..fbb0ac1bd86b 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -22,6 +22,7 @@
#include <stringconstants.hxx>
#include <core_resource.hxx>
#include <strings.hrc>
+#include <strings.hxx>
#include "connection.hxx"
#include "SharedConnection.hxx"
#include "databasedocument.hxx"
@@ -55,13 +56,12 @@
#include <connectivity/dbtools.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <officecfg/Office/Common.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <osl/process.h>
#include <sal/log.hxx>
#include <tools/urlobj.hxx>
#include <unotools/sharedunocomponent.hxx>
-#include <rtl/digest.h>
#include <algorithm>
#include <iterator>
@@ -249,69 +249,6 @@ void SAL_CALL OAuthenticationContinuation::setRememberAccount( RememberAuthentic
SAL_WARN("dbaccess","OAuthenticationContinuation::setRememberAccount: not supported!");
}
-namespace {
-
-/** The class OSharedConnectionManager implements a structure to share connections.
- It owns the master connections which will be disposed when the last connection proxy is gone.
-*/
-// need to hold the digest
-struct TDigestHolder
-{
- sal_uInt8 m_pBuffer[RTL_DIGEST_LENGTH_SHA1];
- TDigestHolder()
- {
- m_pBuffer[0] = 0;
- }
-
-};
-
-}
-
-class OSharedConnectionManager : public ::cppu::WeakImplHelper< XEventListener >
-{
-
- // contains the currently used master connections
- struct TConnectionHolder
- {
- Reference< XConnection > xMasterConnection;
- oslInterlockedCount nALiveCount;
- };
-
- // the less-compare functor, used for the stl::map
- struct TDigestLess
- {
- bool operator() (const TDigestHolder& x, const TDigestHolder& y) const
- {
- sal_uInt32 i;
- for(i=0;i < RTL_DIGEST_LENGTH_SHA1 && (x.m_pBuffer[i] >= y.m_pBuffer[i]); ++i)
- ;
- return i < RTL_DIGEST_LENGTH_SHA1;
- }
- };
-
- typedef std::map< TDigestHolder,TConnectionHolder,TDigestLess> TConnectionMap; // holds the master connections
- typedef std::map< Reference< XConnection >,TConnectionMap::iterator> TSharedConnectionMap;// holds the shared connections
-
- ::osl::Mutex m_aMutex;
- TConnectionMap m_aConnections; // remember the master connection in conjunction with the digest
- TSharedConnectionMap m_aSharedConnection; // the shared connections with conjunction with an iterator into the connections map
- Reference< XProxyFactory > m_xProxyFactory;
-
-protected:
- virtual ~OSharedConnectionManager() override;
-
-public:
- explicit OSharedConnectionManager(const Reference< XComponentContext >& _rxContext);
-
- void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
- Reference<XConnection> getConnection( const OUString& url,
- const OUString& user,
- const OUString& password,
- const Sequence< PropertyValue >& _aInfo,
- ODatabaseSource* _pDataSource);
- void addEventListener(const Reference<XConnection>& _rxConnection, TConnectionMap::iterator const & _rIter);
-};
-
OSharedConnectionManager::OSharedConnectionManager(const Reference< XComponentContext >& _rxContext)
{
m_xProxyFactory.set( ProxyFactory::create( _rxContext ) );
@@ -349,10 +286,11 @@ Reference<XConnection> OSharedConnectionManager::getConnection( const OUString&
Sequence< PropertyValue > aInfoCopy(_aInfo);
sal_Int32 nPos = aInfoCopy.getLength();
aInfoCopy.realloc( nPos + 2 );
- aInfoCopy[nPos].Name = "TableFilter";
- aInfoCopy[nPos++].Value <<= _pDataSource->m_pImpl->m_aTableFilter;
- aInfoCopy[nPos].Name = "TableTypeFilter";
- aInfoCopy[nPos++].Value <<= _pDataSource->m_pImpl->m_aTableTypeFilter;
+ auto pInfoCopy = aInfoCopy.getArray();
+ pInfoCopy[nPos].Name = "TableFilter";
+ pInfoCopy[nPos++].Value <<= _pDataSource->m_pImpl->m_aTableFilter;
+ pInfoCopy[nPos].Name = "TableTypeFilter";
+ pInfoCopy[nPos++].Value <<= _pDataSource->m_pImpl->m_aTableTypeFilter;
OUString sUser = user;
OUString sPassword = password;
@@ -606,8 +544,7 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
if ( xModel)
{
//See ODbTypeWizDialogSetup::SaveDatabaseDocument
- ::comphelper::NamedValueCollection aArgs( xModel->getArgs() );
- aArgs.get("IgnoreFirebirdMigration") >>= bIgnoreMigration;
+ ::comphelper::NamedValueCollection::get(xModel->getArgs(), u"IgnoreFirebirdMigration") >>= bIgnoreMigration;
}
else
{
@@ -641,7 +578,7 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
if (bNeedMigration)
{
// back up content xml file if migration was successful
- static constexpr OUStringLiteral BACKUP_XML_NAME = u"content_before_migration.xml";
+ static constexpr OUString BACKUP_XML_NAME = u"content_before_migration.xml"_ustr;
try
{
if(xRootStorage->isStreamElement(BACKUP_XML_NAME))
@@ -676,7 +613,7 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
sPwd = m_pImpl->m_aPassword;
}
- const char* pExceptionMessageId = RID_STR_COULDNOTCONNECT_UNSPECIFIED;
+ TranslateId pExceptionMessageId = RID_STR_COULDNOTCONNECT_UNSPECIFIED;
if (xManager.is())
{
sal_Int32 nAdditionalArgs(0);
@@ -684,17 +621,18 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
if (!sPwd.isEmpty()) ++nAdditionalArgs;
Sequence< PropertyValue > aUserPwd(nAdditionalArgs);
+ auto aUserPwdRange = asNonConstRange(aUserPwd);
sal_Int32 nArgPos = 0;
if (!sUser.isEmpty())
{
- aUserPwd[ nArgPos ].Name = "user";
- aUserPwd[ nArgPos ].Value <<= sUser;
+ aUserPwdRange[ nArgPos ].Name = "user";
+ aUserPwdRange[ nArgPos ].Value <<= sUser;
++nArgPos;
}
if (!sPwd.isEmpty())
{
- aUserPwd[ nArgPos ].Name = "password";
- aUserPwd[ nArgPos ].Value <<= sPwd;
+ aUserPwdRange[ nArgPos ].Name = "password";
+ aUserPwdRange[ nArgPos ].Value <<= sPwd;
}
Reference< XDriver > xDriver;
try
@@ -729,16 +667,17 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
{
sal_Int32 nCount = aDriverInfo.getLength();
aDriverInfo.realloc(nCount + 3 );
+ auto pDriverInfo = aDriverInfo.getArray();
- aDriverInfo[nCount].Name = "URL";
- aDriverInfo[nCount++].Value <<= m_pImpl->getURL();
+ pDriverInfo[nCount].Name = "URL";
+ pDriverInfo[nCount++].Value <<= m_pImpl->getURL();
- aDriverInfo[nCount].Name = "Storage";
+ pDriverInfo[nCount].Name = "Storage";
Reference< css::document::XDocumentSubStorageSupplier> xDocSup( m_pImpl->getDocumentSubStorageSupplier() );
- aDriverInfo[nCount++].Value <<= xDocSup->getDocumentSubStorage("database",ElementModes::READWRITE);
+ pDriverInfo[nCount++].Value <<= xDocSup->getDocumentSubStorage("database",ElementModes::READWRITE);
- aDriverInfo[nCount].Name = "Document";
- aDriverInfo[nCount++].Value <<= getDatabaseDocument();
+ pDriverInfo[nCount].Name = "Document";
+ pDriverInfo[nCount++].Value <<= getDatabaseDocument();
}
if (nAdditionalArgs)
xReturn = xManager->getConnectionWithInfo(m_pImpl->m_sConnectURL, ::comphelper::concatSequences(aUserPwd,aDriverInfo));
@@ -763,11 +702,11 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
OUString sMessage = DBA_RES(pExceptionMessageId)
.replaceAll("$name$", m_pImpl->m_sConnectURL);
- SQLContext aContext;
- aContext.Message = DBA_RES(RID_STR_CONNECTION_REQUEST).
- replaceFirst("$name$", m_pImpl->m_sConnectURL);
+ SQLContext aContext(
+ DBA_RES(RID_STR_CONNECTION_REQUEST).replaceFirst("$name$", m_pImpl->m_sConnectURL),
+ {}, {}, 0, {}, {});
- throwGenericSQLException( sMessage, static_cast< XDataSource* >( this ), makeAny( aContext ) );
+ throwGenericSQLException( sMessage, static_cast< XDataSource* >( this ), Any( aContext ) );
}
#if ENABLE_FIREBIRD_SDBC
@@ -793,21 +732,26 @@ Reference< XPropertySetInfo > ODatabaseSource::getPropertySetInfo()
// comphelper::OPropertyArrayUsageHelper
::cppu::IPropertyArrayHelper* ODatabaseSource::createArrayHelper( ) const
{
- BEGIN_PROPERTY_HELPER(13)
- DECL_PROP1(INFO, Sequence< PropertyValue >, BOUND);
- DECL_PROP1_BOOL(ISPASSWORDREQUIRED, BOUND);
- DECL_PROP1_BOOL(ISREADONLY, READONLY);
- DECL_PROP1(LAYOUTINFORMATION, Sequence< PropertyValue >, BOUND);
- DECL_PROP1(NAME, OUString, READONLY);
- DECL_PROP2_IFACE(NUMBERFORMATSSUPPLIER, XNumberFormatsSupplier, READONLY, TRANSIENT);
- DECL_PROP1(PASSWORD, OUString, TRANSIENT);
- DECL_PROP2_IFACE(SETTINGS, XPropertySet, BOUND, READONLY);
- DECL_PROP1_BOOL(SUPPRESSVERSIONCL, BOUND);
- DECL_PROP1(TABLEFILTER, Sequence< OUString >,BOUND);
- DECL_PROP1(TABLETYPEFILTER, Sequence< OUString >,BOUND);
- DECL_PROP1(URL, OUString, BOUND);
- DECL_PROP1(USER, OUString, BOUND);
- END_PROPERTY_HELPER();
+ return new ::cppu::OPropertyArrayHelper
+ {
+ {
+ // a change here means a change should also been done in OApplicationController::disposing()
+ { PROPERTY_INFO, PROPERTY_ID_INFO, cppu::UnoType<Sequence< PropertyValue >>::get(), css::beans::PropertyAttribute::BOUND },
+ { PROPERTY_ISPASSWORDREQUIRED, PROPERTY_ID_ISPASSWORDREQUIRED, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND },
+ { PROPERTY_ISREADONLY, PROPERTY_ID_ISREADONLY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_LAYOUTINFORMATION, PROPERTY_ID_LAYOUTINFORMATION, cppu::UnoType<Sequence< PropertyValue >>::get(), css::beans::PropertyAttribute::BOUND },
+ { PROPERTY_NAME, PROPERTY_ID_NAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_NUMBERFORMATSSUPPLIER, PROPERTY_ID_NUMBERFORMATSSUPPLIER, cppu::UnoType<XNumberFormatsSupplier>::get(),
+ css::beans::PropertyAttribute::READONLY | css::beans::PropertyAttribute::TRANSIENT },
+ { PROPERTY_PASSWORD, PROPERTY_ID_PASSWORD, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::TRANSIENT },
+ { PROPERTY_SETTINGS, PROPERTY_ID_SETTINGS, cppu::UnoType<XPropertySet>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY },
+ { PROPERTY_SUPPRESSVERSIONCL, PROPERTY_ID_SUPPRESSVERSIONCL, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND },
+ { PROPERTY_TABLEFILTER, PROPERTY_ID_TABLEFILTER, cppu::UnoType<Sequence< OUString >>::get(), css::beans::PropertyAttribute::BOUND },
+ { PROPERTY_TABLETYPEFILTER, PROPERTY_ID_TABLETYPEFILTER, cppu::UnoType<Sequence< OUString >>::get(), css::beans::PropertyAttribute::BOUND },
+ { PROPERTY_URL, PROPERTY_ID_URL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND },
+ { PROPERTY_USER, PROPERTY_ID_USER, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND }
+ }
+ };
}
// cppu::OPropertySetHelper
@@ -854,7 +798,7 @@ sal_Bool ODatabaseSource::convertFastPropertyValue(Any & rConvertedValue, Any &
if (!(rValue >>= aValues))
throw IllegalArgumentException();
- for ( auto const & checkName : std::as_const(aValues) )
+ for (auto const& checkName : aValues)
{
if ( checkName.Name.isEmpty() )
throw IllegalArgumentException();
@@ -866,7 +810,7 @@ sal_Bool ODatabaseSource::convertFastPropertyValue(Any & rConvertedValue, Any &
{
const PropertyValue* pInfoIter = aSettings.getConstArray();
const PropertyValue* checkValue = aValues.getConstArray();
- for ( ;!bModified && checkValue != aValues.end() ; ++checkValue,++pInfoIter)
+ for ( ;!bModified && checkValue != std::cend(aValues) ; ++checkValue,++pInfoIter)
{
bModified = checkValue->Name != pInfoIter->Name;
if ( !bModified )
@@ -1046,13 +990,15 @@ void ODatabaseSource::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) con
// transform them so that only property values which fulfill certain
// criteria survive
Sequence< PropertyValue > aNonDefaultOrUserDefined( aValues.getLength() );
+ auto [begin, end] = asNonConstRange(aValues);
+ auto pCopyStart = aNonDefaultOrUserDefined.getArray();
const PropertyValue* pCopyEnd = std::remove_copy_if(
- aValues.begin(),
- aValues.end(),
- aNonDefaultOrUserDefined.getArray(),
+ begin,
+ end,
+ pCopyStart,
IsDefaultAndNotRemoveable( aPropertyAttributes )
);
- aNonDefaultOrUserDefined.realloc( pCopyEnd - aNonDefaultOrUserDefined.getArray() );
+ aNonDefaultOrUserDefined.realloc( pCopyEnd - pCopyStart );
rValue <<= aNonDefaultOrUserDefined;
}
catch( const Exception& )
@@ -1150,7 +1096,7 @@ Reference< XConnection > ODatabaseSource::connectWithCompletion( const Reference
aRequest.HasUserName = aRequest.HasPassword = true;
aRequest.UserName = m_pImpl->m_sUser;
aRequest.Password = m_pImpl->m_sFailedPassword.isEmpty() ? m_pImpl->m_aPassword : m_pImpl->m_sFailedPassword;
- rtl::Reference<OInteractionRequest> pRequest = new OInteractionRequest(makeAny(aRequest));
+ rtl::Reference<OInteractionRequest> pRequest = new OInteractionRequest(Any(aRequest));
// some knittings
pRequest->addContinuation(pAbort);
pRequest->addContinuation(pAuthenticate);
@@ -1225,14 +1171,9 @@ Reference< XConnection > ODatabaseSource::getConnection(const OUString& user, co
{ // create a new proxy for the connection
if ( !m_pImpl->m_xSharedConnectionManager.is() )
{
- // TODO ideally we could just have one field, but to make that work
- // we'd need to move OSharedConnectionManager into its own file and header
- rtl::Reference<OSharedConnectionManager> manager =
- new OSharedConnectionManager( m_pImpl->m_aContext );
- m_pImpl->m_pSharedConnectionManager = manager.get();
- m_pImpl->m_xSharedConnectionManager = m_pImpl->m_pSharedConnectionManager;
+ m_pImpl->m_xSharedConnectionManager = new OSharedConnectionManager( m_pImpl->m_aContext );
}
- xConn = m_pImpl->m_pSharedConnectionManager->getConnection(
+ xConn = m_pImpl->m_xSharedConnectionManager->getConnection(
m_pImpl->m_sConnectURL, user, password, m_pImpl->m_xSettings->getPropertyValues(), this );
}
@@ -1269,14 +1210,13 @@ Reference< XNameAccess > SAL_CALL ODatabaseSource::getQueryDefinitions( )
aValue >>= sSupportService;
if ( !sSupportService.isEmpty() )
{
- Sequence<Any> aArgs(1);
- aArgs[0] <<= NamedValue("DataSource",makeAny(xMy));
+ Sequence<Any> aArgs{ Any(NamedValue("DataSource",Any(xMy))) };
xContainer.set( m_pImpl->m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext(sSupportService, aArgs, m_pImpl->m_aContext), UNO_QUERY);
}
}
if ( !xContainer.is() )
{
- TContentPtr& rContainerData( m_pImpl->getObjectContainer( ODatabaseModelImpl::E_QUERY ) );
+ TContentPtr& rContainerData( m_pImpl->getObjectContainer( ODatabaseModelImpl::ObjectType::Query ) );
xContainer = new OCommandContainer( m_pImpl->m_aContext, *this, rContainerData, false );
}
m_pImpl->m_xCommandDefinitions = xContainer;
@@ -1292,7 +1232,7 @@ Reference< XNameAccess > ODatabaseSource::getTables()
Reference< XNameAccess > xContainer = m_pImpl->m_xTableDefinitions;
if ( !xContainer.is() )
{
- TContentPtr& rContainerData( m_pImpl->getObjectContainer( ODatabaseModelImpl::E_TABLE ) );
+ TContentPtr& rContainerData( m_pImpl->getObjectContainer( ODatabaseModelImpl::ObjectType::Table ) );
xContainer = new OCommandContainer( m_pImpl->m_aContext, *this, rContainerData, true );
m_pImpl->m_xTableDefinitions = xContainer;
}
diff --git a/dbaccess/source/core/dataaccess/datasource.hxx b/dbaccess/source/core/dataaccess/datasource.hxx
index c608505381b0..5b5985eacd72 100644
--- a/dbaccess/source/core/dataaccess/datasource.hxx
+++ b/dbaccess/source/core/dataaccess/datasource.hxx
@@ -30,6 +30,7 @@
#include <com/sun/star/document/XEventListener.hpp>
#include <com/sun/star/util/XFlushable.hpp>
#include <cppuhelper/propshlp.hxx>
+#include <comphelper/interfacecontainer3.hxx>
#include <comphelper/proparrhlp.hxx>
#include <cppuhelper/weakref.hxx>
#include <cppuhelper/compbase.hxx>
@@ -83,7 +84,7 @@ private:
using ODatabaseSource_Base::rBHelper;
// note: this thing uses the ref-count of "this", see OBookmarkContainer::acquire!
OBookmarkContainer m_Bookmarks;
- ::comphelper::OInterfaceContainerHelper2 m_aFlushListeners;
+ ::comphelper::OInterfaceContainerHelper3<css::util::XFlushListener> m_aFlushListeners;
private:
virtual ~ODatabaseSource() override;
diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
index c9ca13c41ebb..807dc5ec98c3 100644
--- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx
+++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
@@ -18,11 +18,12 @@
*/
#include <definitioncontainer.hxx>
-#include <apitools.hxx>
#include <core_resource.hxx>
#include <strings.hrc>
+#include <strings.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
#include <comphelper/enumhelper.hxx>
#include <cppuhelper/exc_hlp.hxx>
@@ -32,7 +33,6 @@
#include <com/sun/star/sdb/ErrorCondition.hpp>
#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
#include <rtl/ref.hxx>
using namespace ::com::sun::star::uno;
@@ -135,7 +135,14 @@ ODefinitionContainer::~ODefinitionContainer()
}
IMPLEMENT_FORWARD_XINTERFACE2( ODefinitionContainer,OContentHelper,ODefinitionContainer_Base)
-IMPLEMENT_GETTYPES2(ODefinitionContainer,OContentHelper,ODefinitionContainer_Base);
+css::uno::Sequence< css::uno::Type > ODefinitionContainer::getTypes()
+{
+ return ::comphelper::concatSequences(
+ OContentHelper::getTypes( ),
+ ODefinitionContainer_Base::getTypes( )
+ );
+}
+
css::uno::Sequence<sal_Int8> ODefinitionContainer::getImplementationId()
{
@@ -280,7 +287,7 @@ void ODefinitionContainer::notifyByName( ResettableMutexGuard& _rGuard, const OU
if ( !rContainer.getLength() )
return;
- ContainerEvent aEvent( *this, makeAny( _rName ), makeAny( _xNewElement ), makeAny( _xOldElement ) );
+ ContainerEvent aEvent( *this, Any( _rName ), Any( _xNewElement ), Any( _xOldElement ) );
_rGuard.clear();
switch ( _eOperation )
@@ -366,7 +373,7 @@ Any SAL_CALL ODefinitionContainer::getByIndex( sal_Int32 _nIndex )
{
MutexGuard aGuard(m_aMutex);
- if ((_nIndex < 0) || (_nIndex >= static_cast<sal_Int32>(m_aDocuments.size())))
+ if ((_nIndex < 0) || (o3tl::make_unsigned(_nIndex) >= m_aDocuments.size()))
throw IndexOutOfBoundsException();
Documents::iterator aPos = m_aDocuments[_nIndex];
@@ -379,14 +386,14 @@ Any SAL_CALL ODefinitionContainer::getByIndex( sal_Int32 _nIndex )
// and update the name-access map
}
- return makeAny(xProp);
+ return Any(xProp);
}
Any SAL_CALL ODefinitionContainer::getByName( const OUString& _rName )
{
MutexGuard aGuard(m_aMutex);
- return makeAny( implGetByName( _rName, true ) );
+ return Any( implGetByName( _rName, true ) );
}
Reference< XContent > ODefinitionContainer::implGetByName(const OUString& _rName, bool _bReadIfNecessary)
@@ -526,7 +533,7 @@ void ODefinitionContainer::implAppend(const OUString& _rName, const Reference< X
// #i44786#
lcl_ensureName( _rxNewObject, _rName );
- ::rtl::Reference< OContentHelper > pContent = comphelper::getUnoTunnelImplementation<OContentHelper>( _rxNewObject );
+ ::rtl::Reference< OContentHelper > pContent = dynamic_cast<OContentHelper*>( _rxNewObject.get() );
if ( pContent.is() )
{
TContentPtr pImpl = pContent->getImpl();
@@ -585,7 +592,7 @@ void ODefinitionContainer::approveNewObject(const OUString& _sName,const Referen
DBA_RES( RID_STR_NAME_ALREADY_USED ),
*this );
- ::rtl::Reference< OContentHelper > pContent( comphelper::getUnoTunnelImplementation<OContentHelper>( _rxObject ) );
+ ::rtl::Reference< OContentHelper > pContent( dynamic_cast<OContentHelper*>( _rxObject.get() ) );
if ( !pContent.is() )
throw IllegalArgumentException(
DBA_RES( RID_STR_OBJECT_CONTAINER_MISMATCH ),
diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx
index 472f60ad566f..48971a3c74f5 100644
--- a/dbaccess/source/core/dataaccess/documentcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx
@@ -34,6 +34,7 @@
#include <connectivity/sqlerror.hxx>
#include <core_resource.hxx>
#include <strings.hrc>
+#include <strings.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/propertysequence.hxx>
#include <comphelper/servicehelper.hxx>
@@ -41,6 +42,7 @@
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
+#include <o3tl/string_view.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
@@ -50,7 +52,6 @@ using namespace ::com::sun::star::container;
using namespace ::com::sun::star::ucb;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
-using namespace ::com::sun::star::io;
using namespace ::osl;
using namespace ::comphelper;
using namespace ::cppu;
@@ -115,14 +116,47 @@ css::uno::Sequence<sal_Int8> ODocumentContainer::getImplementationId()
return css::uno::Sequence<sal_Int8>();
}
-IMPLEMENT_GETTYPES3(ODocumentContainer,ODefinitionContainer,OPropertyStateContainer,ODocumentContainer_Base);
-IMPLEMENT_SERVICE_INFO_IMPLNAME(ODocumentContainer, "com.sun.star.comp.dba.ODocumentContainer");
-IMPLEMENT_SERVICE_INFO_SUPPORTS(ODocumentContainer);
-IMPLEMENT_PROPERTYCONTAINER_DEFAULTS(ODocumentContainer)
+css::uno::Sequence< css::uno::Type > ODocumentContainer::getTypes()
+{
+ return ::comphelper::concatSequences(
+ ODefinitionContainer::getTypes( ),
+ OPropertyStateContainer::getTypes( ),
+ ODocumentContainer_Base::getTypes( )
+ );
+}
+OUString SAL_CALL ODocumentContainer::getImplementationName()
+ {
+ return "com.sun.star.comp.dba.ODocumentContainer";
+ };
+sal_Bool SAL_CALL ODocumentContainer::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ };
+css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL ODocumentContainer::getPropertySetInfo()
+{
+ Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+}
+::cppu::IPropertyArrayHelper& ODocumentContainer::getInfoHelper()
+{
+ return *ODocumentContainer::getArrayHelper();
+}
+::cppu::IPropertyArrayHelper* ODocumentContainer::createArrayHelper( ) const
+{
+ css::uno::Sequence< css::beans::Property > aProps;
+ describeProperties(aProps);
+ return new ::cppu::OPropertyArrayHelper(aProps);
+}
+
Sequence< OUString > SAL_CALL ODocumentContainer::getSupportedServiceNames( )
{
- return { m_bFormsContainer ? OUString(SERVICE_NAME_FORM_COLLECTION) : OUString(SERVICE_NAME_REPORT_COLLECTION) };
+ return { m_bFormsContainer ? SERVICE_NAME_FORM_COLLECTION : SERVICE_NAME_REPORT_COLLECTION };
}
OUString ODocumentContainer::determineContentType() const
@@ -218,9 +252,7 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments
const bool bNeedClassID = !aClassID.hasElements() && sURL.isEmpty() ;
if ( xCopyFrom.is() )
{
- Sequence<Any> aIni(2);
- aIni[0] <<= getContainerStorage();
- aIni[1] <<= sPersistentName;
+ Sequence<Any> aIni{ Any(getContainerStorage()), Any(sPersistentName) };
Command aCommand;
aCommand.Name = "copyTo";
aCommand.Argument <<= aIni;
@@ -279,8 +311,7 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments
if ( !sURL.isEmpty() )
{
- Sequence<Any> aIni(2);
- aIni[0] <<= sURL;
+ Sequence<Any> aIni{ Any(sURL) };
Command aCommand;
aCommand.Name = "insert";
aCommand.Argument <<= aIni;
@@ -361,7 +392,7 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments
Reference<XContent > xNew(xORB->createInstanceWithArguments(sServiceName,aArguments),UNO_QUERY);
Reference<XNameContainer> xNameContainer(xContent,UNO_QUERY);
if ( xNameContainer.is() )
- xNameContainer->insertByName(*elements,makeAny(xNew));
+ xNameContainer->insertByName(*elements,Any(xNew));
}
}
}
@@ -391,7 +422,7 @@ Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 Com
{
OSL_FAIL( "Wrong argument type!" );
ucbhelper::cancelCommandExecution(
- makeAny( IllegalArgumentException(
+ Any( IllegalArgumentException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
-1 ) ),
@@ -413,12 +444,12 @@ Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 Com
aOpenCommand,
Environment );
aRet <<= xSet;
- }
+ }
else
{
// Unsupported.
ucbhelper::cancelCommandExecution(
- makeAny( UnsupportedOpenModeException(
+ Any( UnsupportedOpenModeException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
sal_Int16( aOpenCommand.Mode ) ) ),
@@ -435,7 +466,7 @@ Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 Com
{
OSL_FAIL( "Wrong argument type!" );
ucbhelper::cancelCommandExecution(
- makeAny( IllegalArgumentException(
+ Any( IllegalArgumentException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
-1 ) ),
@@ -461,10 +492,10 @@ Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 Com
namespace
{
- bool lcl_queryContent(const OUString& _sName,Reference< XNameContainer >& _xNameContainer,Any& _rRet,OUString& _sSimpleName)
+ bool lcl_queryContent(std::u16string_view _sName,Reference< XNameContainer >& _xNameContainer,Any& _rRet,OUString& _sSimpleName)
{
sal_Int32 nIndex = 0;
- OUString sName = _sName.getToken(0,'/',nIndex);
+ OUString sName( o3tl::getToken(_sName,0,'/',nIndex) );
bool bRet = _xNameContainer->hasByName(sName);
if ( bRet )
{
@@ -472,7 +503,7 @@ namespace
_rRet = _xNameContainer->getByName(_sSimpleName);
while ( nIndex != -1 && bRet )
{
- sName = _sName.getToken(0,'/',nIndex);
+ sName = o3tl::getToken(_sName,0,'/',nIndex);
_xNameContainer.set(_rRet,UNO_QUERY);
bRet = _xNameContainer.is();
if ( bRet )
@@ -580,7 +611,7 @@ void SAL_CALL ODocumentContainer::insertByHierarchicalName( const OUString& _sNa
sal_Int32 index = sName.getLength();
OUString sMessage(
DBA_RES(RID_STR_NO_SUB_FOLDER).replaceFirst("$folder$",
- _sName.getToken(0,'/',index)));
+ o3tl::getToken(_sName, 0,'/',index)));
throw IllegalArgumentException( sMessage, *this, 1 );
}
@@ -636,7 +667,7 @@ OUString SAL_CALL ODocumentContainer::composeHierarchicalName( const OUString& i
::rtl::Reference<OContentHelper> pContent;
try
{
- pContent = comphelper::getUnoTunnelImplementation<OContentHelper>(const_cast<ODocumentContainer*>(this)->implGetByName( _sName, true ));
+ pContent = dynamic_cast<OContentHelper*>(const_cast<ODocumentContainer*>(this)->implGetByName( _sName, true ).get());
}
catch(const Exception&)
{
@@ -680,7 +711,7 @@ void SAL_CALL ODocumentContainer::revert( )
Reference< XStorage> ODocumentContainer::getContainerStorage() const
{
return m_pImpl->m_pDataSource
- ? m_pImpl->m_pDataSource->getStorage( m_bFormsContainer ? ODatabaseModelImpl::E_FORM : ODatabaseModelImpl::E_REPORT )
+ ? m_pImpl->m_pDataSource->getStorage( m_bFormsContainer ? ODatabaseModelImpl::ObjectType::Form : ODatabaseModelImpl::ObjectType::Report )
: Reference< XStorage>();
}
@@ -719,8 +750,8 @@ void SAL_CALL ODocumentContainer::rename( const OUString& newName )
return;
sal_Int32 nHandle = PROPERTY_ID_NAME;
- Any aOld = makeAny(m_pImpl->m_aProps.aTitle);
- Any aNew = makeAny(newName);
+ Any aOld(m_pImpl->m_aProps.aTitle);
+ Any aNew(newName);
aGuard.clear();
fire(&nHandle, &aNew, &aOld, 1, true );
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index 8291597870c5..227bde4cde1b 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -21,16 +21,19 @@
#include <ModelImpl.hxx>
#include <stringconstants.hxx>
#include <sdbcoretools.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
+#include <comphelper/compbase.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/classids.hxx>
#include <comphelper/propertysequence.hxx>
+#include <comphelper/propertyvalue.hxx>
#include <comphelper/types.hxx>
#include <com/sun/star/frame/XUntitledNumbers.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/XModel.hpp>
@@ -75,6 +78,7 @@
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
#include <core_resource.hxx>
#include <strings.hrc>
+#include <strings.hxx>
#include <com/sun/star/task/XInteractionApprove.hpp>
#include <com/sun/star/task/XInteractionDisapprove.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
@@ -144,22 +148,20 @@ namespace dbaccess
}
// OEmbedObjectHolder
- typedef ::cppu::WeakComponentImplHelper< embed::XStateChangeListener > TEmbedObjectHolder;
+ typedef ::comphelper::WeakComponentImplHelper< embed::XStateChangeListener > TEmbedObjectHolder;
namespace {
- class OEmbedObjectHolder : public ::cppu::BaseMutex
- ,public TEmbedObjectHolder
+ class OEmbedObjectHolder : public TEmbedObjectHolder
{
Reference< XEmbeddedObject > m_xBroadCaster;
ODocumentDefinition* m_pDefinition;
bool m_bInStateChange;
protected:
- virtual void SAL_CALL disposing() override;
+ virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
public:
OEmbedObjectHolder(const Reference< XEmbeddedObject >& _xBroadCaster,ODocumentDefinition* _pDefinition)
- : TEmbedObjectHolder(m_aMutex)
- ,m_xBroadCaster(_xBroadCaster)
+ : m_xBroadCaster(_xBroadCaster)
,m_pDefinition(_pDefinition)
,m_bInStateChange(false)
{
@@ -178,7 +180,7 @@ namespace dbaccess
}
- void SAL_CALL OEmbedObjectHolder::disposing()
+ void OEmbedObjectHolder::disposing(std::unique_lock<std::mutex>& /*rGuard*/)
{
if ( m_xBroadCaster.is() )
m_xBroadCaster->removeStateChangeListener(this);
@@ -474,21 +476,28 @@ css::uno::Sequence<sal_Int8> ODocumentDefinition::getImplementationId()
return css::uno::Sequence<sal_Int8>();
}
-IMPLEMENT_GETTYPES3(ODocumentDefinition,OContentHelper,OPropertyStateContainer,ODocumentDefinition_Base);
+css::uno::Sequence< css::uno::Type > ODocumentDefinition::getTypes()
+{
+ return ::comphelper::concatSequences(
+ OContentHelper::getTypes( ),
+ OPropertyStateContainer::getTypes( ),
+ ODocumentDefinition_Base::getTypes( )
+ );
+}
IMPLEMENT_FORWARD_XINTERFACE3( ODocumentDefinition,OContentHelper,OPropertyStateContainer,ODocumentDefinition_Base)
void ODocumentDefinition::registerProperties()
{
-#define REGISTER_PROPERTY( name, location ) \
- registerProperty( PROPERTY_##name, PROPERTY_ID_##name, PropertyAttribute::READONLY, &location, cppu::UnoType<decltype(location)>::get() );
+ registerProperty(PROPERTY_NAME, PROPERTY_ID_NAME, PropertyAttribute::CONSTRAINED | PropertyAttribute::BOUND | PropertyAttribute::READONLY,
+ &m_pImpl->m_aProps.aTitle, cppu::UnoType<decltype(m_pImpl->m_aProps.aTitle)>::get());
+
+ registerProperty(PROPERTY_AS_TEMPLATE, PROPERTY_ID_AS_TEMPLATE, PropertyAttribute::READONLY, &m_pImpl->m_aProps.bAsTemplate,
+ cppu::UnoType<decltype(m_pImpl->m_aProps.bAsTemplate)>::get());
-#define REGISTER_PROPERTY_BV( name, location ) \
- registerProperty( PROPERTY_##name, PROPERTY_ID_##name, PropertyAttribute::CONSTRAINED | PropertyAttribute::BOUND | PropertyAttribute::READONLY, &location, cppu::UnoType<decltype(location)>::get() );
+ registerProperty(PROPERTY_PERSISTENT_NAME, PROPERTY_ID_PERSISTENT_NAME, PropertyAttribute::READONLY, &m_pImpl->m_aProps.sPersistentName,
+ cppu::UnoType<decltype(m_pImpl->m_aProps.sPersistentName)>::get());
- REGISTER_PROPERTY_BV( NAME, m_pImpl->m_aProps.aTitle );
- REGISTER_PROPERTY ( AS_TEMPLATE, m_pImpl->m_aProps.bAsTemplate );
- REGISTER_PROPERTY ( PERSISTENT_NAME, m_pImpl->m_aProps.sPersistentName );
- REGISTER_PROPERTY ( IS_FORM, m_bForm );
+ registerProperty(PROPERTY_IS_FORM, PROPERTY_ID_IS_FORM, PropertyAttribute::READONLY, &m_bForm, cppu::UnoType<decltype(m_bForm)>::get());
}
void SAL_CALL ODocumentDefinition::getFastPropertyValue( Any& o_rValue, sal_Int32 i_nHandle ) const
@@ -498,11 +507,8 @@ void SAL_CALL ODocumentDefinition::getFastPropertyValue( Any& o_rValue, sal_Int3
OUString sPersistentPath;
if ( !m_pImpl->m_aProps.sPersistentName.isEmpty() )
{
- OUStringBuffer aBuffer;
- aBuffer.append( ODatabaseModelImpl::getObjectContainerStorageName( m_bForm ? ODatabaseModelImpl::E_FORM : ODatabaseModelImpl::E_REPORT ) );
- aBuffer.append( '/' );
- aBuffer.append( m_pImpl->m_aProps.sPersistentName );
- sPersistentPath = aBuffer.makeStringAndClear();
+ sPersistentPath = ODatabaseModelImpl::getObjectContainerStorageName( m_bForm ? ODatabaseModelImpl::ObjectType::Form : ODatabaseModelImpl::ObjectType::Report )
+ + "/" + m_pImpl->m_aProps.sPersistentName;
}
o_rValue <<= sPersistentPath;
return;
@@ -529,11 +535,10 @@ IPropertyArrayHelper* ODocumentDefinition::createArrayHelper( ) const
describeProperties( aProps );
// properties not maintained by our base class
- Sequence< Property > aManualProps( 1 );
- aManualProps[0].Name = PROPERTY_PERSISTENT_PATH;
- aManualProps[0].Handle = PROPERTY_ID_PERSISTENT_PATH;
- aManualProps[0].Type = ::cppu::UnoType<OUString>::get();
- aManualProps[0].Attributes = PropertyAttribute::READONLY;
+ Sequence< Property > aManualProps{ { /* Name */ PROPERTY_PERSISTENT_PATH,
+ /* Handle */ PROPERTY_ID_PERSISTENT_PATH,
+ /* Type */ ::cppu::UnoType<OUString>::get(),
+ /* Attributes */ PropertyAttribute::READONLY } };
return new OPropertyArrayHelper( ::comphelper::concatSequences( aProps, aManualProps ) );
}
@@ -715,14 +720,14 @@ void ODocumentDefinition::impl_initFormEditView( const Reference< XController >&
LayoutManagerLock aLockLayout( _rxController );
// setting of the visual properties
- xViewSettings->setPropertyValue("ShowRulers",makeAny(true));
- xViewSettings->setPropertyValue("ShowVertRuler",makeAny(true));
- xViewSettings->setPropertyValue("ShowHoriRuler",makeAny(true));
- xViewSettings->setPropertyValue("IsRasterVisible",makeAny(true));
- xViewSettings->setPropertyValue("IsSnapToRaster",makeAny(true));
- xViewSettings->setPropertyValue("ShowOnlineLayout",makeAny(true));
- xViewSettings->setPropertyValue("RasterSubdivisionX",makeAny(sal_Int32(5)));
- xViewSettings->setPropertyValue("RasterSubdivisionY",makeAny(sal_Int32(5)));
+ xViewSettings->setPropertyValue("ShowRulers",Any(true));
+ xViewSettings->setPropertyValue("ShowVertRuler",Any(true));
+ xViewSettings->setPropertyValue("ShowHoriRuler",Any(true));
+ xViewSettings->setPropertyValue("IsRasterVisible",Any(true));
+ xViewSettings->setPropertyValue("IsSnapToRaster",Any(true));
+ xViewSettings->setPropertyValue("ShowOnlineLayout",Any(true));
+ xViewSettings->setPropertyValue("RasterSubdivisionX",Any(sal_Int32(5)));
+ xViewSettings->setPropertyValue("RasterSubdivisionY",Any(sal_Int32(5)));
}
catch( const Exception& )
{
@@ -846,7 +851,7 @@ Any ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, cons
// So, in such a case, and with 2. above, we would silently execute those macros,
// regardless of the global security settings - which would be a security issue, of
// course.
- if ( m_pImpl->m_pDataSource->determineEmbeddedMacros() == ODatabaseModelImpl::eNoMacros )
+ if ( m_pImpl->m_pDataSource->determineEmbeddedMacros() == ODatabaseModelImpl::EmbeddedMacros::NONE )
{
// this is case 2. from above
// So, pass a USE_CONFIG to the to-be-loaded document. This means that
@@ -876,14 +881,14 @@ Any ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, cons
{
// not supported
ucbhelper::cancelCommandExecution(
- makeAny( UnsupportedOpenModeException(
+ Any( UnsupportedOpenModeException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
sal_Int16( nOpenMode ) ) ),
_rxEnvironment );
// Unreachable
OSL_FAIL( "unreachable" );
- }
+ }
OSL_ENSURE( !m_pImpl->m_aProps.sPersistentName.isEmpty(),
"ODocumentDefinition::onCommandOpenSomething: no persistent name - cannot load!" );
@@ -924,8 +929,8 @@ Any ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, cons
xReportEngine->setReportDefinition(xReportDefinition);
xReportEngine->setActiveConnection(m_xLastKnownConnection);
if ( bOpenHidden )
- return makeAny( xReportEngine->createDocumentModel() );
- return makeAny( xReportEngine->createDocumentAlive( nullptr ) );
+ return Any( xReportEngine->createDocumentModel() );
+ return Any( xReportEngine->createDocumentAlive( nullptr ) );
}
if ( _bActivate && !bOpenHidden )
@@ -943,7 +948,7 @@ Any ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, cons
if ( !m_bForm && m_pImpl->m_aProps.bAsTemplate && !m_bOpenInDesign )
ODocumentDefinition::fillReportData( m_aContext, getComponent(), xConnection );
- return makeAny( xModel );
+ return Any( xModel );
}
Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 CommandId, const Reference< XCommandEnvironment >& Environment )
@@ -990,7 +995,7 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co
if ( !bIsAliveNewStyleReport )
{
impl_onActivateEmbeddedObject_nothrow( true );
- return makeAny( getComponent() );
+ return Any( getComponent() );
}
}
}
@@ -1011,7 +1016,7 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co
{
OSL_FAIL( "Wrong argument type!" );
ucbhelper::cancelCommandExecution(
- makeAny( IllegalArgumentException(
+ Any( IllegalArgumentException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
-1 ) ),
@@ -1037,7 +1042,7 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co
{
OSL_FAIL( "Wrong argument count!" );
ucbhelper::cancelCommandExecution(
- makeAny( IllegalArgumentException(
+ Any( IllegalArgumentException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
-1 ) ),
@@ -1108,7 +1113,7 @@ namespace
try
{
Reference< XPropertySet > xFormProps( xForm, UNO_QUERY_THROW );
- xFormProps->setPropertyValue( PROPERTY_DATASOURCENAME, makeAny( OUString() ) );
+ xFormProps->setPropertyValue( PROPERTY_DATASOURCENAME, Any( OUString() ) );
}
catch( const Exception& )
{
@@ -1154,7 +1159,7 @@ void ODocumentDefinition::onCommandInsert( const OUString& _sURL, const Referenc
Sequence<OUString> aProps { PROPERTY_URL };
ucbhelper::cancelCommandExecution(
- makeAny( MissingPropertiesException(
+ Any( MissingPropertiesException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
aProps ) ),
@@ -1168,9 +1173,9 @@ void ODocumentDefinition::onCommandInsert( const OUString& _sURL, const Referenc
if ( xStorage.is() )
{
Reference< XEmbeddedObjectCreator> xEmbedFactory = EmbeddedObjectCreator::create(m_aContext);
- Sequence<PropertyValue> aEmpty,aMediaDesc(1);
- aMediaDesc[0].Name = PROPERTY_URL;
- aMediaDesc[0].Value <<= _sURL;
+ Sequence<PropertyValue> aEmpty;
+ Sequence<PropertyValue> aMediaDesc{ comphelper::makePropertyValue(PROPERTY_URL,
+ _sURL) };
m_xEmbeddedObject.set(xEmbedFactory->createInstanceInitFromMediaDescriptor( xStorage
,m_pImpl->m_aProps.sPersistentName
,aMediaDesc
@@ -1224,7 +1229,7 @@ bool ODocumentDefinition::save(bool _bApprove, const css::uno::Reference<css::aw
}
aRequest.Content.set(m_xParentContainer,UNO_QUERY);
- rtl::Reference<OInteractionRequest> pRequest = new OInteractionRequest(makeAny(aRequest));
+ rtl::Reference<OInteractionRequest> pRequest = new OInteractionRequest(Any(aRequest));
// some knittings
// two continuations allowed: OK and Cancel
rtl::Reference<ODocumentSaveContinuation> pDocuSave;
@@ -1265,7 +1270,7 @@ bool ODocumentDefinition::save(bool _bApprove, const css::uno::Reference<css::aw
m_pImpl->m_aProps.aTitle = pDocuSave->getName();
Reference< XContent> xContent = this;
- xNC->insertByName(pDocuSave->getName(),makeAny(xContent));
+ xNC->insertByName(pDocuSave->getName(),Any(xContent));
updateDocumentTitle();
}
@@ -1310,7 +1315,7 @@ void ODocumentDefinition::saveAs()
aRequest.Name = m_pImpl->m_aProps.aTitle;
aRequest.Content.set(m_xParentContainer,UNO_QUERY);
- rtl::Reference<OInteractionRequest> pRequest = new OInteractionRequest(makeAny(aRequest));
+ rtl::Reference<OInteractionRequest> pRequest = new OInteractionRequest(Any(aRequest));
// some knittings
// two continuations allowed: OK and Cancel
rtl::Reference<ODocumentSaveContinuation> pDocuSave = new ODocumentSaveContinuation;
@@ -1356,7 +1361,7 @@ void ODocumentDefinition::saveAs()
Reference< XMultiServiceFactory > xORB( m_xParentContainer, UNO_QUERY_THROW );
Reference< XInterface > xComponent( xORB->createInstanceWithArguments( SERVICE_SDB_DOCUMENTDEFINITION, aArguments ) );
Reference< XNameContainer > xNameContainer( m_xParentContainer, UNO_QUERY_THROW );
- xNameContainer->insertByName( sOldName, makeAny( xComponent ) );
+ xNameContainer->insertByName( sOldName, Any( xComponent ) );
}
catch(const Exception&)
{
@@ -1382,7 +1387,7 @@ namespace
{
void lcl_putLoadArgs( ::comphelper::NamedValueCollection& _io_rArgs, const optional_bool& _bSuppressMacros, const optional_bool& _bReadOnly )
{
- if ( !!_bSuppressMacros )
+ if ( _bSuppressMacros.has_value() )
{
if ( *_bSuppressMacros )
{
@@ -1399,7 +1404,7 @@ namespace
}
}
- if ( !!_bReadOnly )
+ if ( _bReadOnly.has_value() )
_io_rArgs.put( "ReadOnly", *_bReadOnly );
}
}
@@ -1425,7 +1430,7 @@ namespace
bool ODocumentDefinition::objectSupportsEmbeddedScripts() const
{
bool bAllowDocumentMacros = !m_pImpl->m_pDataSource
- || ( m_pImpl->m_pDataSource->determineEmbeddedMacros() == ODatabaseModelImpl::eSubDocumentMacros );
+ || ( m_pImpl->m_pDataSource->determineEmbeddedMacros() == ODatabaseModelImpl::EmbeddedMacros::SubDocument );
// if *any* of the objects of the database document already has macros, we
// continue to allow it to have them, until the user does a migration.
@@ -1444,16 +1449,14 @@ void ODocumentDefinition::separateOpenCommandArguments( const Sequence< Property
{
::comphelper::NamedValueCollection aOpenCommandArguments( i_rOpenCommandArguments );
- const char* const pObjectDescriptorArgs[] =
- {
- "RecoveryStorage"
- };
- for (const char* pObjectDescriptorArg : pObjectDescriptorArgs)
+ static const std::u16string_view sObjectDescriptorArgs[] = { u"RecoveryStorage" };
+ for (const auto& rObjectDescriptorArg : sObjectDescriptorArgs)
{
- if ( aOpenCommandArguments.has( pObjectDescriptorArg ) )
+ const OUString sObjectDescriptorArg(rObjectDescriptorArg);
+ if ( aOpenCommandArguments.has( sObjectDescriptorArg ) )
{
- o_rEmbeddedObjectDescriptor.put( pObjectDescriptorArg, aOpenCommandArguments.get( pObjectDescriptorArg ) );
- aOpenCommandArguments.remove( pObjectDescriptorArg );
+ o_rEmbeddedObjectDescriptor.put( sObjectDescriptorArg, aOpenCommandArguments.get( sObjectDescriptorArg ) );
+ aOpenCommandArguments.remove( sObjectDescriptorArg );
}
}
@@ -1563,9 +1566,7 @@ void ODocumentDefinition::loadEmbeddedObject( const Reference< XConnection >& i_
Reference< XEnumeration > xEnumDrivers = xEnumAccess->createContentEnumeration(sReportEngineServiceName);
if ( !xEnumDrivers.is() || !xEnumDrivers->hasMoreElements() )
{
- css::io::WrongFormatException aWFE;
- aWFE.Message = DBA_RES( RID_STR_MISSING_EXTENSION );
- throw aWFE;
+ throw css::io::WrongFormatException(DBA_RES(RID_STR_MISSING_EXTENSION));
}
}
if ( !aClassID.hasElements() )
@@ -1923,7 +1924,7 @@ void SAL_CALL ODocumentDefinition::rename( const OUString& _rNewName )
Reference< XStorage> ODocumentDefinition::getContainerStorage() const
{
return m_pImpl->m_pDataSource
- ? m_pImpl->m_pDataSource->getStorage( m_bForm ? ODatabaseModelImpl::E_FORM : ODatabaseModelImpl::E_REPORT )
+ ? m_pImpl->m_pDataSource->getStorage( m_bForm ? ODatabaseModelImpl::ObjectType::Form : ODatabaseModelImpl::ObjectType::Report )
: Reference< XStorage>();
}
@@ -2073,8 +2074,8 @@ void ODocumentDefinition::firePropertyChange( sal_Int32 i_nHandle, const Any& i_
NameChangeNotifier::NameChangeNotifier( ODocumentDefinition& i_rDocumentDefinition, const OUString& i_rNewName,
::osl::ResettableMutexGuard& i_rClearForNotify )
:m_rDocumentDefinition( i_rDocumentDefinition )
- ,m_aOldValue( makeAny( i_rDocumentDefinition.getCurrentName() ) )
- ,m_aNewValue( makeAny( i_rNewName ) )
+ ,m_aOldValue( Any( i_rDocumentDefinition.getCurrentName() ) )
+ ,m_aNewValue( Any( i_rNewName ) )
,m_rClearForNotify( i_rClearForNotify )
{
impl_fireEvent_throw( true );
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.hxx b/dbaccess/source/core/dataaccess/documentdefinition.hxx
index 389ab601f2ab..5569276d4a7d 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.hxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.hxx
@@ -207,7 +207,7 @@ private:
@throws css::uno::RuntimeException
*/
static void impl_removeFrameFromDesktop_throw(
- const css::uno::Reference< css::uno::XComponentContext >& _rContxt,
+ const css::uno::Reference< css::uno::XComponentContext >& _rContext,
const css::uno::Reference< css::frame::XFrame >& _rxFrame
);
diff --git a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx
index 3d16ee6ebb79..e1cb9f3f4e57 100644
--- a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx
+++ b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx
@@ -27,7 +27,7 @@
#include <comphelper/namedvaluecollection.hxx>
#include <cppuhelper/weakref.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <vcl/svapp.hxx>
namespace dbaccess
@@ -57,24 +57,14 @@ namespace dbaccess
using namespace ::com::sun::star;
- // DocumentEventExecutor_Data
- struct DocumentEventExecutor_Data
- {
- WeakReference< XEventsSupplier > xDocument;
- Reference< XURLTransformer > xURLTransformer;
-
- explicit DocumentEventExecutor_Data( const Reference< XEventsSupplier >& _rxDocument )
- :xDocument( _rxDocument )
- {
- }
- };
-
namespace
{
- void lcl_dispatchScriptURL_throw( DocumentEventExecutor_Data const & _rDocExecData,
+ void lcl_dispatchScriptURL_throw(
+ css::uno::WeakReference< css::document::XEventsSupplier > const & xWeakDocument,
+ css::uno::Reference< css::util::XURLTransformer > const & xURLTransformer,
const OUString& _rScriptURL, const DocumentEvent& _rTrigger )
{
- Reference< XModel > xDocument( _rDocExecData.xDocument.get(), UNO_QUERY_THROW );
+ Reference< XModel > xDocument( xWeakDocument.get(), UNO_QUERY_THROW );
Reference< XController > xController( xDocument->getCurrentController() );
Reference< XDispatchProvider > xDispProv;
@@ -88,8 +78,8 @@ namespace dbaccess
URL aScriptURL;
aScriptURL.Complete = _rScriptURL;
- if ( _rDocExecData.xURLTransformer.is() )
- _rDocExecData.xURLTransformer->parseStrict( aScriptURL );
+ if ( xURLTransformer.is() )
+ xURLTransformer->parseStrict( aScriptURL );
// unfortunately, executing a script can trigger all kind of complex stuff, and unfortunately, not
// every component involved into this properly cares for thread safety. To be on the safe side,
@@ -113,7 +103,7 @@ namespace dbaccess
// DocumentEventExecutor
DocumentEventExecutor::DocumentEventExecutor( const Reference<XComponentContext> & _rContext,
const Reference< XEventsSupplier >& _rxDocument )
- :m_pData( new DocumentEventExecutor_Data( _rxDocument ) )
+ :mxDocument( _rxDocument )
{
Reference< XDocumentEventBroadcaster > xBroadcaster( _rxDocument, UNO_QUERY_THROW );
@@ -125,7 +115,7 @@ namespace dbaccess
try
{
- m_pData->xURLTransformer = URLTransformer::create(_rContext);
+ mxURLTransformer = URLTransformer::create(_rContext);
}
catch( const Exception& )
{
@@ -139,8 +129,8 @@ namespace dbaccess
void SAL_CALL DocumentEventExecutor::documentEventOccured( const DocumentEvent& Event )
{
- Reference< XEventsSupplier > xEventsSupplier( m_pData->xDocument.get(), UNO_QUERY );
- if ( !xEventsSupplier.is() )
+ Reference< XEventsSupplier > xEventsSupplier( mxDocument.get(), UNO_QUERY );
+ if ( !xEventsSupplier )
{
OSL_FAIL( "DocumentEventExecutor::documentEventOccurred: no document anymore, but still being notified?" );
return;
@@ -179,7 +169,7 @@ namespace dbaccess
if ( bDispatchScriptURL && bNonEmptyScript )
{
- lcl_dispatchScriptURL_throw( *m_pData, sScript, Event );
+ lcl_dispatchScriptURL_throw( mxDocument, mxURLTransformer, sScript, Event );
}
}
catch( const RuntimeException& ) { throw; }
diff --git a/dbaccess/source/core/dataaccess/documenteventexecutor.hxx b/dbaccess/source/core/dataaccess/documenteventexecutor.hxx
index 90dc9083c4a3..58aee4bcd590 100644
--- a/dbaccess/source/core/dataaccess/documenteventexecutor.hxx
+++ b/dbaccess/source/core/dataaccess/documenteventexecutor.hxx
@@ -23,15 +23,13 @@
#include <com/sun/star/document/XEventsSupplier.hpp>
#include <cppuhelper/implbase.hxx>
-
-#include <memory>
+#include <cppuhelper/weakref.hxx>
namespace com::sun::star::uno { class XComponentContext; }
+namespace com::sun::star::util { class XURLTransformer; }
namespace dbaccess
{
-
- struct DocumentEventExecutor_Data;
// DocumentEventExecutor
typedef ::cppu::WeakImplHelper < css::document::XDocumentEventListener
> DocumentEventExecutor_Base;
@@ -51,7 +49,8 @@ namespace dbaccess
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
private:
- std::unique_ptr< DocumentEventExecutor_Data > m_pData;
+ css::uno::WeakReference< css::document::XEventsSupplier > mxDocument;
+ css::uno::Reference< css::util::XURLTransformer > mxURLTransformer;
};
} // namespace dbaccess
diff --git a/dbaccess/source/core/dataaccess/documenteventnotifier.cxx b/dbaccess/source/core/dataaccess/documenteventnotifier.cxx
index 38cf0b2f11ba..475b16c0b551 100644
--- a/dbaccess/source/core/dataaccess/documenteventnotifier.cxx
+++ b/dbaccess/source/core/dataaccess/documenteventnotifier.cxx
@@ -22,9 +22,9 @@
#include <com/sun/star/frame/DoubleInitializationException.hpp>
#include <comphelper/asyncnotification.hxx>
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/interfacecontainer3.hxx>
#include <cppuhelper/weak.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <vcl/svapp.hxx>
namespace dbaccess
@@ -52,8 +52,8 @@ namespace dbaccess
bool m_bInitialized;
bool m_bDisposed;
std::shared_ptr<::comphelper::AsyncEventNotifierAutoJoin> m_pEventBroadcaster;
- ::comphelper::OInterfaceContainerHelper2 m_aLegacyEventListeners;
- ::comphelper::OInterfaceContainerHelper2 m_aDocumentEventListeners;
+ ::comphelper::OInterfaceContainerHelper3<css::document::XEventListener> m_aLegacyEventListeners;
+ ::comphelper::OInterfaceContainerHelper3<XDocumentEventListener> m_aDocumentEventListeners;
public:
DocumentEventNotifier_Impl( ::cppu::OWeakObject& _rBroadcasterDocument, ::osl::Mutex& _rMutex )
diff --git a/dbaccess/source/core/dataaccess/documentevents.cxx b/dbaccess/source/core/dataaccess/documentevents.cxx
index cd4428775e03..6dbe9ad5965d 100644
--- a/dbaccess/source/core/dataaccess/documentevents.cxx
+++ b/dbaccess/source/core/dataaccess/documentevents.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <o3tl/string_view.hxx>
#include <osl/diagnose.h>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/sequence.hxx>
@@ -35,23 +36,6 @@ namespace dbaccess
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Type;
- // DocumentEvents_Data
- struct DocumentEvents_Data
- {
- ::cppu::OWeakObject& rParent;
- ::osl::Mutex& rMutex;
- DocumentEventsData& rEventsData;
-
- DocumentEvents_Data( ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, DocumentEventsData& _rEventsData )
- :rParent( _rParent )
- ,rMutex( _rMutex )
- ,rEventsData( _rEventsData )
- {
- }
- DocumentEvents_Data(const DocumentEvents_Data&) = delete;
- const DocumentEvents_Data& operator=(const DocumentEvents_Data&) = delete;
- };
-
namespace {
// helper
@@ -96,15 +80,15 @@ namespace dbaccess
// DocumentEvents
DocumentEvents::DocumentEvents( ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, DocumentEventsData& _rEventsData )
- :m_pData( new DocumentEvents_Data( _rParent, _rMutex, _rEventsData ) )
+ :mrParent(_rParent), mrMutex(_rMutex), mrEventsData(_rEventsData)
{
const DocumentEventData* pEventData = lcl_getDocumentEventData();
while ( pEventData->pAsciiEventName )
{
OUString sEventName = OUString::createFromAscii( pEventData->pAsciiEventName );
- DocumentEventsData::const_iterator existingPos = m_pData->rEventsData.find( sEventName );
- if ( existingPos == m_pData->rEventsData.end() )
- m_pData->rEventsData[ sEventName ] = Sequence< PropertyValue >();
+ DocumentEventsData::const_iterator existingPos = mrEventsData.find( sEventName );
+ if ( existingPos == mrEventsData.end() )
+ mrEventsData[ sEventName ] = Sequence< PropertyValue >();
++pEventData;
}
}
@@ -115,20 +99,20 @@ namespace dbaccess
void SAL_CALL DocumentEvents::acquire() noexcept
{
- m_pData->rParent.acquire();
+ mrParent.acquire();
}
void SAL_CALL DocumentEvents::release() noexcept
{
- m_pData->rParent.release();
+ mrParent.release();
}
- bool DocumentEvents::needsSynchronousNotification( const OUString& _rEventName )
+ bool DocumentEvents::needsSynchronousNotification( std::u16string_view _rEventName )
{
const DocumentEventData* pEventData = lcl_getDocumentEventData();
while ( pEventData->pAsciiEventName )
{
- if ( _rEventName.equalsAscii( pEventData->pAsciiEventName ) )
+ if ( o3tl::equalsAscii( _rEventName, pEventData->pAsciiEventName ) )
return pEventData->bNeedsSyncNotify;
++pEventData;
}
@@ -139,10 +123,10 @@ namespace dbaccess
void SAL_CALL DocumentEvents::replaceByName( const OUString& Name, const Any& Element )
{
- ::osl::MutexGuard aGuard( m_pData->rMutex );
+ ::osl::MutexGuard aGuard( mrMutex );
- DocumentEventsData::iterator elementPos = m_pData->rEventsData.find( Name );
- if ( elementPos == m_pData->rEventsData.end() )
+ DocumentEventsData::iterator elementPos = mrEventsData.find( Name );
+ if ( elementPos == mrEventsData.end() )
throw NoSuchElementException( Name, *this );
Sequence< PropertyValue > aEventDescriptor;
@@ -172,10 +156,10 @@ namespace dbaccess
Any SAL_CALL DocumentEvents::getByName( const OUString& Name )
{
- ::osl::MutexGuard aGuard( m_pData->rMutex );
+ ::osl::MutexGuard aGuard( mrMutex );
- DocumentEventsData::const_iterator elementPos = m_pData->rEventsData.find( Name );
- if ( elementPos == m_pData->rEventsData.end() )
+ DocumentEventsData::const_iterator elementPos = mrEventsData.find( Name );
+ if ( elementPos == mrEventsData.end() )
throw NoSuchElementException( Name, *this );
Any aReturn;
@@ -187,16 +171,16 @@ namespace dbaccess
Sequence< OUString > SAL_CALL DocumentEvents::getElementNames( )
{
- ::osl::MutexGuard aGuard( m_pData->rMutex );
+ ::osl::MutexGuard aGuard( mrMutex );
- return comphelper::mapKeysToSequence( m_pData->rEventsData );
+ return comphelper::mapKeysToSequence( mrEventsData );
}
sal_Bool SAL_CALL DocumentEvents::hasByName( const OUString& Name )
{
- ::osl::MutexGuard aGuard( m_pData->rMutex );
+ ::osl::MutexGuard aGuard( mrMutex );
- return m_pData->rEventsData.find( Name ) != m_pData->rEventsData.end();
+ return mrEventsData.find( Name ) != mrEventsData.end();
}
Type SAL_CALL DocumentEvents::getElementType( )
@@ -206,8 +190,8 @@ namespace dbaccess
sal_Bool SAL_CALL DocumentEvents::hasElements( )
{
- ::osl::MutexGuard aGuard( m_pData->rMutex );
- return !m_pData->rEventsData.empty();
+ ::osl::MutexGuard aGuard( mrMutex );
+ return !mrEventsData.empty();
}
} // namespace dbaccess
diff --git a/dbaccess/source/core/dataaccess/intercept.cxx b/dbaccess/source/core/dataaccess/intercept.cxx
index 3b42df4ed6a1..26b85cbb8f3b 100644
--- a/dbaccess/source/core/dataaccess/intercept.cxx
+++ b/dbaccess/source/core/dataaccess/intercept.cxx
@@ -20,7 +20,7 @@
#include "intercept.hxx"
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <memory>
@@ -28,13 +28,11 @@ namespace dbaccess
{
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::ucb;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::io;
-using namespace ::com::sun::star::embed;
using namespace ::com::sun::star::container;
using namespace ::comphelper;
using namespace ::cppu;
@@ -65,17 +63,14 @@ void OInterceptor::dispose()
OInterceptor::OInterceptor( ODocumentDefinition* _pContentHolder )
:m_pContentHolder( _pContentHolder )
- ,m_aInterceptedURL(7)
+ ,m_aInterceptedURL{ /* DISPATCH_SAVEAS */ ".uno:SaveAs",
+ /* DISPATCH_SAVE */ ".uno:Save",
+ /* DISPATCH_CLOSEDOC */ ".uno:CloseDoc",
+ /* DISPATCH_CLOSEWIN */ ".uno:CloseWin",
+ /* DISPATCH_CLOSEFRAME */ ".uno:CloseFrame",
+ /* DISPATCH_RELOAD */ ".uno:Reload" }
{
-
OSL_ENSURE(DISPATCH_RELOAD < m_aInterceptedURL.getLength(),"Illegal size.");
-
- m_aInterceptedURL[DISPATCH_SAVEAS] = ".uno:SaveAs";
- m_aInterceptedURL[DISPATCH_SAVE] = ".uno:Save";
- m_aInterceptedURL[DISPATCH_CLOSEDOC] = ".uno:CloseDoc";
- m_aInterceptedURL[DISPATCH_CLOSEWIN] = ".uno:CloseWin";
- m_aInterceptedURL[DISPATCH_CLOSEFRAME] = ".uno:CloseFrame";
- m_aInterceptedURL[DISPATCH_RELOAD] = ".uno:Reload";
}
@@ -131,7 +126,7 @@ void SAL_CALL OInterceptor::dispatch( const URL& URL,const Sequence<PropertyValu
{
if ( aNewArgs[nInd].Name == "SaveTo" )
{
- aNewArgs[nInd].Value <<= true;
+ aNewArgs.getArray()[nInd].Value <<= true;
break;
}
nInd++;
@@ -140,8 +135,9 @@ void SAL_CALL OInterceptor::dispatch( const URL& URL,const Sequence<PropertyValu
if ( nInd == aNewArgs.getLength() )
{
aNewArgs.realloc( nInd + 1 );
- aNewArgs[nInd].Name = "SaveTo";
- aNewArgs[nInd].Value <<= true;
+ auto pNewArgs = aNewArgs.getArray();
+ pNewArgs[nInd].Name = "SaveTo";
+ pNewArgs[nInd].Value <<= true;
}
Reference< XDispatch > xDispatch = m_xSlaveDispatchProvider->queryDispatch(URL, "_self", 0 );
@@ -210,7 +206,7 @@ void SAL_CALL OInterceptor::addStatusListener(
{
osl::MutexGuard aGuard(m_aMutex);
if(!m_pStatCL)
- m_pStatCL.reset( new PropertyChangeListenerContainer(m_aMutex) );
+ m_pStatCL.reset( new StatusListenerContainer(m_aMutex) );
}
m_pStatCL->addInterface(URL.Complete,Control);
@@ -227,7 +223,7 @@ void SAL_CALL OInterceptor::addStatusListener(
{
osl::MutexGuard aGuard(m_aMutex);
if(!m_pStatCL)
- m_pStatCL.reset( new PropertyChangeListenerContainer(m_aMutex) );
+ m_pStatCL.reset( new StatusListenerContainer(m_aMutex) );
}
m_pStatCL->addInterface(URL.Complete,Control);
@@ -251,7 +247,7 @@ void SAL_CALL OInterceptor::addStatusListener(
{
osl::MutexGuard aGuard(m_aMutex);
if(!m_pStatCL)
- m_pStatCL.reset( new PropertyChangeListenerContainer(m_aMutex) );
+ m_pStatCL.reset( new StatusListenerContainer(m_aMutex) );
}
m_pStatCL->addInterface(URL.Complete,Control);
@@ -305,13 +301,13 @@ Reference< XDispatch > SAL_CALL OInterceptor::queryDispatch( const URL& URL,cons
Sequence< Reference< XDispatch > > SAL_CALL OInterceptor::queryDispatches( const Sequence<DispatchDescriptor >& Requests )
{
- Sequence< Reference< XDispatch > > aRet;
osl::MutexGuard aGuard(m_aMutex);
- if(m_xSlaveDispatchProvider.is())
- aRet = m_xSlaveDispatchProvider->queryDispatches(Requests);
- else
- aRet.realloc(Requests.getLength());
+ typedef Sequence<Reference<XDispatch>> DispatchSeq;
+ DispatchSeq aRet = m_xSlaveDispatchProvider.is() ?
+ m_xSlaveDispatchProvider->queryDispatches(Requests) :
+ DispatchSeq(Requests.getLength());
+ auto aRetRange = asNonConstRange(aRet);
for(sal_Int32 i = 0; i < Requests.getLength(); ++i)
{
const OUString* pIter = m_aInterceptedURL.getConstArray();
@@ -320,7 +316,7 @@ Sequence< Reference< XDispatch > > SAL_CALL OInterceptor::queryDispatches( cons
{
if ( Requests[i].FeatureURL.Complete == *pIter )
{
- aRet[i] = static_cast<XDispatch*>(this);
+ aRetRange[i] = static_cast<XDispatch*>(this);
break;
}
}
diff --git a/dbaccess/source/core/dataaccess/intercept.hxx b/dbaccess/source/core/dataaccess/intercept.hxx
index 16077c3c9e52..7ce53752f19d 100644
--- a/dbaccess/source/core/dataaccess/intercept.hxx
+++ b/dbaccess/source/core/dataaccess/intercept.hxx
@@ -103,7 +103,9 @@ private:
css::uno::Sequence< OUString > m_aInterceptedURL;
- std::unique_ptr<PropertyChangeListenerContainer> m_pStatCL;
+ typedef comphelper::OMultiTypeInterfaceContainerHelperVar3<css::frame::XStatusListener, OUString>
+ StatusListenerContainer;
+ std::unique_ptr<StatusListenerContainer> m_pStatCL;
};
} // namespace dbaccess
diff --git a/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx b/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx
index e0d32d56971b..495f4868851e 100644
--- a/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx
+++ b/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx
@@ -17,82 +17,38 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <utility>
#include <vector>
-#include <ucbhelper/contentidentifier.hxx>
-
#include "myucp_datasupplier.hxx"
#include <ContentHelper.hxx>
#include <com/sun/star/ucb/IllegalIdentifierException.hpp>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ucb;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::container;
-// @@@ Adjust namespace name.
using namespace dbaccess;
-// @@@ Adjust namespace name.
-namespace dbaccess
-{
-
-namespace {
-
-// struct ResultListEntry.
-struct ResultListEntry
-{
- OUString aId;
- Reference< XContentIdentifier > xId;
- ::rtl::Reference< OContentHelper > xContent;
- Reference< XRow > xRow;
- const ContentProperties& rData;
-
- explicit ResultListEntry(const ContentProperties& rEntry) : rData( rEntry ) {}
-};
-
-}
-
-// struct DataSupplier_Impl.
-struct DataSupplier_Impl
-{
- osl::Mutex m_aMutex;
- std::vector< std::unique_ptr<ResultListEntry> > m_aResults;
- rtl::Reference< ODocumentContainer > m_xContent;
- bool m_bCountFinal;
-
- explicit DataSupplier_Impl(const rtl::Reference< ODocumentContainer >& rContent)
- : m_xContent(rContent)
- , m_bCountFinal(false)
- {
- }
-};
-
-}
-
-// DataSupplier Implementation.
DataSupplier::DataSupplier( const rtl::Reference< ODocumentContainer >& rContent )
-: m_pImpl( new DataSupplier_Impl( rContent ) )
+: m_xContent( rContent )
{
-
}
DataSupplier::~DataSupplier()
{
-
}
OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex )
{
- osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
+ osl::Guard< osl::Mutex > aGuard( m_aMutex );
- if ( static_cast<size_t>(nIndex) < m_pImpl->m_aResults.size() )
+ if ( static_cast<size_t>(nIndex) < m_aResults.size() )
{
- OUString aId = m_pImpl->m_aResults[ nIndex ]->aId;
+ OUString aId = m_aResults[ nIndex ]->aId;
if ( !aId.isEmpty() )
{
// Already cached.
@@ -102,14 +58,14 @@ OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex )
if ( getResult( nIndex ) )
{
- OUString aId = m_pImpl->m_xContent->getIdentifier()->getContentIdentifier();
+ OUString aId = m_xContent->getIdentifier()->getContentIdentifier();
if ( !aId.isEmpty() )
aId += "/";
- aId += m_pImpl->m_aResults[ nIndex ]->rData.aTitle;
+ aId += m_aResults[ nIndex ]->rData.aTitle;
- m_pImpl->m_aResults[ nIndex ]->aId = aId;
+ m_aResults[ nIndex ]->aId = aId;
return aId;
}
return OUString();
@@ -118,11 +74,11 @@ OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex )
Reference< XContentIdentifier >
DataSupplier::queryContentIdentifier( sal_uInt32 nIndex )
{
- osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
+ osl::Guard< osl::Mutex > aGuard( m_aMutex );
- if ( static_cast<size_t>(nIndex) < m_pImpl->m_aResults.size() )
+ if ( static_cast<size_t>(nIndex) < m_aResults.size() )
{
- Reference< XContentIdentifier > xId = m_pImpl->m_aResults[ nIndex ]->xId;
+ Reference< XContentIdentifier > xId = m_aResults[ nIndex ]->xId;
if ( xId.is() )
{
// Already cached.
@@ -134,7 +90,7 @@ DataSupplier::queryContentIdentifier( sal_uInt32 nIndex )
if ( !aId.isEmpty() )
{
Reference< XContentIdentifier > xId = new ::ucbhelper::ContentIdentifier( aId );
- m_pImpl->m_aResults[ nIndex ]->xId = xId;
+ m_aResults[ nIndex ]->xId = xId;
return xId;
}
return Reference< XContentIdentifier >();
@@ -143,11 +99,11 @@ DataSupplier::queryContentIdentifier( sal_uInt32 nIndex )
Reference< XContent >
DataSupplier::queryContent( sal_uInt32 _nIndex )
{
- osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
+ osl::Guard< osl::Mutex > aGuard( m_aMutex );
- if ( static_cast<size_t>(_nIndex) < m_pImpl->m_aResults.size() )
+ if ( static_cast<size_t>(_nIndex) < m_aResults.size() )
{
- Reference< XContent > xContent = m_pImpl->m_aResults[ _nIndex ]->xContent;
+ Reference< XContent > xContent = m_aResults[ _nIndex ]->xContent;
if ( xContent.is() )
{
// Already cached.
@@ -164,9 +120,9 @@ DataSupplier::queryContent( sal_uInt32 _nIndex )
OUString sName = xId->getContentIdentifier();
sName = sName.copy(sName.lastIndexOf('/')+1);
- m_pImpl->m_aResults[ _nIndex ]->xContent = m_pImpl->m_xContent->getContent(sName);
+ m_aResults[ _nIndex ]->xContent = m_xContent->getContent(sName);
- xContent = m_pImpl->m_aResults[ _nIndex ]->xContent.get();
+ xContent = m_aResults[ _nIndex ]->xContent.get();
return xContent;
}
@@ -179,9 +135,9 @@ DataSupplier::queryContent( sal_uInt32 _nIndex )
bool DataSupplier::getResult( sal_uInt32 nIndex )
{
- osl::ClearableGuard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
+ osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex );
- if ( static_cast<size_t>(nIndex) < m_pImpl->m_aResults.size() )
+ if ( static_cast<size_t>(nIndex) < m_aResults.size() )
{
// Result already present.
return true;
@@ -189,25 +145,25 @@ bool DataSupplier::getResult( sal_uInt32 nIndex )
// Result not (yet) present.
- if ( m_pImpl->m_bCountFinal )
+ if ( m_bCountFinal )
return false;
// Try to obtain result...
- sal_uInt32 nOldCount = m_pImpl->m_aResults.size();
+ sal_uInt32 nOldCount = m_aResults.size();
bool bFound = false;
sal_uInt32 nPos = nOldCount;
// @@@ Obtain data and put it into result list...
- Sequence< OUString> aSeq = m_pImpl->m_xContent->getElementNames();
+ Sequence< OUString> aSeq = m_xContent->getElementNames();
if ( nIndex < sal::static_int_cast< sal_uInt32 >( aSeq.getLength() ) )
{
const OUString* pIter = aSeq.getConstArray();
const OUString* pEnd = pIter + aSeq.getLength();
for(pIter = pIter + nPos;pIter != pEnd;++pIter,++nPos)
{
- m_pImpl->m_aResults.emplace_back(
- new ResultListEntry( m_pImpl->m_xContent->getContent(*pIter)->getContentProperties() ) );
+ m_aResults.emplace_back(
+ new ResultListEntry( m_xContent->getContent(*pIter)->getContentProperties() ) );
if ( nPos == nIndex )
{
@@ -219,7 +175,7 @@ bool DataSupplier::getResult( sal_uInt32 nIndex )
}
if ( !bFound )
- m_pImpl->m_bCountFinal = true;
+ m_bCountFinal = true;
rtl::Reference< ::ucbhelper::ResultSet > xResultSet = getResultSet();
if ( xResultSet.is() )
@@ -227,11 +183,10 @@ bool DataSupplier::getResult( sal_uInt32 nIndex )
// Callbacks follow!
aGuard.clear();
- if ( static_cast<size_t>(nOldCount) < m_pImpl->m_aResults.size() )
- xResultSet->rowCountChanged(
- nOldCount, m_pImpl->m_aResults.size() );
+ if ( static_cast<size_t>(nOldCount) < m_aResults.size() )
+ xResultSet->rowCountChanged( nOldCount, m_aResults.size() );
- if ( m_pImpl->m_bCountFinal )
+ if ( m_bCountFinal )
xResultSet->rowCountFinal();
}
@@ -240,22 +195,22 @@ bool DataSupplier::getResult( sal_uInt32 nIndex )
sal_uInt32 DataSupplier::totalCount()
{
- osl::ClearableGuard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
+ osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex );
- if ( m_pImpl->m_bCountFinal )
- return m_pImpl->m_aResults.size();
+ if ( m_bCountFinal )
+ return m_aResults.size();
- sal_uInt32 nOldCount = m_pImpl->m_aResults.size();
+ sal_uInt32 nOldCount = m_aResults.size();
// @@@ Obtain data and put it into result list...
- Sequence< OUString> aSeq = m_pImpl->m_xContent->getElementNames();
+ Sequence< OUString> aSeq = m_xContent->getElementNames();
const OUString* pIter = aSeq.getConstArray();
const OUString* pEnd = pIter + aSeq.getLength();
for(;pIter != pEnd;++pIter)
- m_pImpl->m_aResults.emplace_back(
- new ResultListEntry( m_pImpl->m_xContent->getContent(*pIter)->getContentProperties() ) );
+ m_aResults.emplace_back(
+ new ResultListEntry( m_xContent->getContent(*pIter)->getContentProperties() ) );
- m_pImpl->m_bCountFinal = true;
+ m_bCountFinal = true;
rtl::Reference< ::ucbhelper::ResultSet > xResultSet = getResultSet();
if ( xResultSet.is() )
@@ -263,34 +218,33 @@ sal_uInt32 DataSupplier::totalCount()
// Callbacks follow!
aGuard.clear();
- if ( static_cast<size_t>(nOldCount) < m_pImpl->m_aResults.size() )
- xResultSet->rowCountChanged(
- nOldCount, m_pImpl->m_aResults.size() );
+ if ( static_cast<size_t>(nOldCount) < m_aResults.size() )
+ xResultSet->rowCountChanged( nOldCount, m_aResults.size() );
xResultSet->rowCountFinal();
}
- return m_pImpl->m_aResults.size();
+ return m_aResults.size();
}
sal_uInt32 DataSupplier::currentCount()
{
- return m_pImpl->m_aResults.size();
+ return m_aResults.size();
}
bool DataSupplier::isCountFinal()
{
- return m_pImpl->m_bCountFinal;
+ return m_bCountFinal;
}
Reference< XRow >
DataSupplier::queryPropertyValues( sal_uInt32 nIndex )
{
- osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
+ osl::Guard< osl::Mutex > aGuard( m_aMutex );
- if ( static_cast<size_t>(nIndex) < m_pImpl->m_aResults.size() )
+ if ( static_cast<size_t>(nIndex) < m_aResults.size() )
{
- Reference< XRow > xRow = m_pImpl->m_aResults[ nIndex ]->xRow;
+ Reference< XRow > xRow = m_aResults[ nIndex ]->xRow;
if ( xRow.is() )
{
// Already cached.
@@ -300,11 +254,11 @@ DataSupplier::queryPropertyValues( sal_uInt32 nIndex )
if ( getResult( nIndex ) )
{
- if ( !m_pImpl->m_aResults[ nIndex ]->xContent.is() )
+ if ( !m_aResults[ nIndex ]->xContent.is() )
queryContent(nIndex);
- Reference< XRow > xRow = m_pImpl->m_aResults[ nIndex ]->xContent->getPropertyValues(getResultSet()->getProperties());
- m_pImpl->m_aResults[ nIndex ]->xRow = xRow;
+ Reference< XRow > xRow = m_aResults[ nIndex ]->xContent->getPropertyValues(getResultSet()->getProperties());
+ m_aResults[ nIndex ]->xRow = xRow;
return xRow;
}
@@ -313,10 +267,10 @@ DataSupplier::queryPropertyValues( sal_uInt32 nIndex )
void DataSupplier::releasePropertyValues( sal_uInt32 nIndex )
{
- osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
+ osl::Guard< osl::Mutex > aGuard( m_aMutex );
- if ( static_cast<size_t>(nIndex) < m_pImpl->m_aResults.size() )
- m_pImpl->m_aResults[ nIndex ]->xRow.clear();
+ if ( static_cast<size_t>(nIndex) < m_aResults.size() )
+ m_aResults[ nIndex ]->xRow.clear();
}
void DataSupplier::close()
diff --git a/dbaccess/source/core/dataaccess/myucp_datasupplier.hxx b/dbaccess/source/core/dataaccess/myucp_datasupplier.hxx
index 8083f5ef59fa..65a45ad7fef6 100644
--- a/dbaccess/source/core/dataaccess/myucp_datasupplier.hxx
+++ b/dbaccess/source/core/dataaccess/myucp_datasupplier.hxx
@@ -20,17 +20,33 @@
#pragma once
#include <rtl/ref.hxx>
+#include <ucbhelper/contentidentifier.hxx>
#include <ucbhelper/resultset.hxx>
#include "documentcontainer.hxx"
#include <memory>
namespace dbaccess
{
-struct DataSupplier_Impl;
+struct ResultListEntry
+{
+ OUString aId;
+ css::uno::Reference<css::ucb::XContentIdentifier> xId;
+ ::rtl::Reference<OContentHelper> xContent;
+ css::uno::Reference<css::sdbc::XRow> xRow;
+ const ContentProperties& rData;
+
+ explicit ResultListEntry(const ContentProperties& rEntry)
+ : rData(rEntry)
+ {
+ }
+};
class DataSupplier : public ucbhelper::ResultSetDataSupplier
{
- std::unique_ptr<DataSupplier_Impl> m_pImpl;
+ osl::Mutex m_aMutex;
+ std::vector<std::unique_ptr<ResultListEntry>> m_aResults;
+ rtl::Reference<ODocumentContainer> m_xContent;
+ bool m_bCountFinal = false;
public:
explicit DataSupplier(const rtl::Reference<ODocumentContainer>& rxContent);
diff --git a/dbaccess/source/core/dataaccess/myucp_resultset.cxx b/dbaccess/source/core/dataaccess/myucp_resultset.cxx
index 67c1ad7c8b4b..9ba383e0aa18 100644
--- a/dbaccess/source/core/dataaccess/myucp_resultset.cxx
+++ b/dbaccess/source/core/dataaccess/myucp_resultset.cxx
@@ -26,14 +26,13 @@
*************************************************************************/
+#include <utility>
+
#include "myucp_datasupplier.hxx"
#include "myucp_resultset.hxx"
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ucb;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::container;
@@ -42,11 +41,11 @@ using namespace dbaccess;
// DynamicResultSet Implementation.
DynamicResultSet::DynamicResultSet(
const Reference< XComponentContext >& rxContext,
- const rtl::Reference< ODocumentContainer >& rxContent,
+ rtl::Reference< ODocumentContainer > xContent,
const OpenCommandArgument2& rCommand,
const Reference< XCommandEnvironment >& rxEnv )
:ResultSetImplHelper( rxContext, rCommand )
- ,m_xContent(rxContent)
+ ,m_xContent(std::move(xContent))
,m_xEnv( rxEnv )
{
}
diff --git a/dbaccess/source/core/dataaccess/myucp_resultset.hxx b/dbaccess/source/core/dataaccess/myucp_resultset.hxx
index ae269ffb8ac9..220bdf0a70b7 100644
--- a/dbaccess/source/core/dataaccess/myucp_resultset.hxx
+++ b/dbaccess/source/core/dataaccess/myucp_resultset.hxx
@@ -39,7 +39,7 @@ private:
public:
DynamicResultSet(
const css::uno::Reference< css::uno::XComponentContext >& rxContext,
- const rtl::Reference< ODocumentContainer >& rxContent,
+ rtl::Reference< ODocumentContainer > xContent,
const css::ucb::OpenCommandArgument2& rCommand,
const css::uno::Reference< css::ucb::XCommandEnvironment >& rxEnv );
};
diff --git a/dbaccess/source/core/inc/ContentHelper.hxx b/dbaccess/source/core/inc/ContentHelper.hxx
index b7d275481ec1..d60521a4328d 100644
--- a/dbaccess/source/core/inc/ContentHelper.hxx
+++ b/dbaccess/source/core/inc/ContentHelper.hxx
@@ -25,11 +25,11 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/basemutex.hxx>
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/interfacecontainer3.hxx>
+#include <comphelper/multiinterfacecontainer3.hxx>
#include <com/sun/star/beans/Property.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/sdbcx/XRename.hpp>
@@ -71,7 +71,7 @@ namespace dbaccess
typedef std::shared_ptr<OContentHelper_Impl> TContentPtr;
- typedef cppu::OMultiTypeInterfaceContainerHelperVar<OUString>
+ typedef comphelper::OMultiTypeInterfaceContainerHelperVar3<css::beans::XPropertiesChangeListener, OUString>
PropertyChangeListenerContainer;
typedef ::cppu::WeakComponentImplHelper< css::ucb::XContent
, css::ucb::XCommandProcessor
@@ -79,7 +79,6 @@ namespace dbaccess
, css::beans::XPropertiesChangeNotifier
, css::beans::XPropertyContainer
, css::lang::XInitialization
- , css::lang::XUnoTunnel
, css::container::XChild
, css::sdbcx::XRename
> OContentHelper_COMPBASE;
@@ -93,7 +92,7 @@ namespace dbaccess
void impl_rename_throw(const OUString& _sNewName,bool _bNotify = true);
protected:
- ::comphelper::OInterfaceContainerHelper2 m_aContentListeners;
+ ::comphelper::OInterfaceContainerHelper3<css::ucb::XContentEventListener> m_aContentListeners;
PropertyChangeListenerContainer m_aPropertyChangeListeners;
css::uno::Reference< css::uno::XInterface >
m_xParentContainer;
@@ -121,7 +120,7 @@ namespace dbaccess
OContentHelper( const css::uno::Reference< css::uno::XComponentContext >& _xORB
,const css::uno::Reference< css::uno::XInterface >& _xParentContainer
- ,const TContentPtr& _pImpl
+ ,TContentPtr _pImpl
);
// css::lang::XTypeProvider
@@ -154,10 +153,6 @@ namespace dbaccess
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
- // css::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
-
// css::container::XChild
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
diff --git a/dbaccess/source/core/inc/DatabaseDataProvider.hxx b/dbaccess/source/core/inc/DatabaseDataProvider.hxx
index 9131cfaf1c2b..8c2029634b8a 100644
--- a/dbaccess/source/core/inc/DatabaseDataProvider.hxx
+++ b/dbaccess/source/core/inc/DatabaseDataProvider.hxx
@@ -73,7 +73,7 @@ private:
virtual css::uno::Reference<css::chart2::data::XDataSequence> SAL_CALL
createDataSequenceByValueArray(
- const OUString& aRole, const OUString & aRangeRepresentation) override;
+ const OUString& aRole, const OUString & aRangeRepresentation, const OUString& aRoleQualifier) override;
virtual css::uno::Reference< css::sheet::XRangeSelection > SAL_CALL getRangeSelection() override;
@@ -220,7 +220,7 @@ private:
::osl::MutexGuard aGuard(m_aMutex);
if ( _member != Value )
{
- prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l);
+ prepareSet(_sProperty, css::uno::Any(_member), css::uno::Any(Value), &l);
_member = Value;
}
}
diff --git a/dbaccess/source/core/inc/ModelImpl.hxx b/dbaccess/source/core/inc/ModelImpl.hxx
index b6e2fe729ffb..2fc19830ca42 100644
--- a/dbaccess/source/core/inc/ModelImpl.hxx
+++ b/dbaccess/source/core/inc/ModelImpl.hxx
@@ -27,18 +27,23 @@
#include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <com/sun/star/reflection/ProxyFactory.hpp>
#include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
#include <com/sun/star/sdbc/XDataSource.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+
#include <comphelper/namedvaluecollection.hxx>
#include <cppuhelper/weakref.hxx>
#include <vcl/svapp.hxx>
#include <sfx2/docmacromode.hxx>
#include <sfx2/docstoragemodifylistener.hxx>
#include <unotools/sharedunocomponent.hxx>
+#include <rtl/digest.h>
#include <rtl/ref.hxx>
+#include <o3tl/enumarray.hxx>
namespace comphelper
{
@@ -84,35 +89,95 @@ struct AsciiPropertyValue
}
};
-class ODatabaseContext;
-class OSharedConnectionManager;
-
// ODatabaseModelImpl
typedef ::utl::SharedUNOComponent< css::embed::XStorage > SharedStorage;
class ODatabaseContext;
class DocumentStorageAccess;
-class OSharedConnectionManager;
+class ODatabaseSource;
+
+
+/** The class OSharedConnectionManager implements a structure to share connections.
+ It owns the master connections which will be disposed when the last connection proxy is gone.
+*/
+// need to hold the digest
+struct TDigestHolder
+{
+ sal_uInt8 m_pBuffer[RTL_DIGEST_LENGTH_SHA1];
+ TDigestHolder()
+ {
+ m_pBuffer[0] = 0;
+ }
+
+};
+
+class OSharedConnectionManager : public ::cppu::WeakImplHelper< css::lang::XEventListener >
+{
+ // contains the currently used master connections
+ struct TConnectionHolder
+ {
+ css::uno::Reference< css::sdbc::XConnection > xMasterConnection;
+ oslInterlockedCount nALiveCount;
+ };
+
+ // the less-compare functor, used for the stl::map
+ struct TDigestLess
+ {
+ bool operator() (const TDigestHolder& x, const TDigestHolder& y) const
+ {
+ sal_uInt32 i;
+ for(i=0;i < RTL_DIGEST_LENGTH_SHA1 && (x.m_pBuffer[i] >= y.m_pBuffer[i]); ++i)
+ ;
+ return i < RTL_DIGEST_LENGTH_SHA1;
+ }
+ };
+
+ typedef std::map< TDigestHolder,TConnectionHolder,TDigestLess> TConnectionMap; // holds the master connections
+ typedef std::map< css::uno::Reference< css::sdbc::XConnection >,TConnectionMap::iterator> TSharedConnectionMap;// holds the shared connections
+
+ ::osl::Mutex m_aMutex;
+ TConnectionMap m_aConnections; // remember the master connection in conjunction with the digest
+ TSharedConnectionMap m_aSharedConnection; // the shared connections with conjunction with an iterator into the connections map
+ css::uno::Reference< css::reflection::XProxyFactory > m_xProxyFactory;
+
+protected:
+ virtual ~OSharedConnectionManager() override;
+
+public:
+ explicit OSharedConnectionManager(const css::uno::Reference< css::uno::XComponentContext >& _rxContext);
+
+ void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
+ css::uno::Reference< css::sdbc::XConnection > getConnection( const OUString& url,
+ const OUString& user,
+ const OUString& password,
+ const css::uno::Sequence< css::beans::PropertyValue >& _aInfo,
+ ODatabaseSource* _pDataSource);
+ void addEventListener(const css::uno::Reference< css::sdbc::XConnection >& _rxConnection, TConnectionMap::iterator const & _rIter);
+};
+
+
class ODatabaseModelImpl :public ::sfx2::IMacroDocumentAccess
,public ::sfx2::IModifiableDocument
{
public:
- enum ObjectType
+
+ enum class ObjectType
{
- E_FORM = 0,
- E_REPORT = 1,
- E_QUERY = 2,
- E_TABLE = 3
+ Form = 0,
+ Report = 1,
+ Query = 2,
+ Table = 3,
+ LAST = Table
};
- enum EmbeddedMacros
+ enum class EmbeddedMacros
{
// the database document (storage) itself contains macros
- eDocumentWideMacros,
+ DocumentWide,
// there are sub document( storage)s containing macros
- eSubDocumentMacros,
+ SubDocument,
// there are no known macro( storage)s
- eNoMacros
+ NONE
};
private:
@@ -120,7 +185,7 @@ private:
css::uno::WeakReference< css::sdbc::XDataSource > m_xDataSource;
rtl::Reference<DocumentStorageAccess> m_pStorageAccess;
- std::vector< TContentPtr > m_aContainer; // one for each ObjectType
+ o3tl::enumarray< ObjectType, TContentPtr > m_aContainer; // one for each ObjectType
::sfx2::DocumentMacroMode m_aMacroMode;
sal_Int16 m_nImposedMacroExecMode;
@@ -187,9 +252,7 @@ public:
m_xSettings;
css::uno::Sequence< OUString > m_aTableFilter;
css::uno::Sequence< OUString > m_aTableTypeFilter;
- OSharedConnectionManager* m_pSharedConnectionManager;
- css::uno::Reference< css::lang::XEventListener >
- m_xSharedConnectionManager;
+ rtl::Reference< OSharedConnectionManager > m_xSharedConnectionManager;
css::uno::Reference<css::awt::XWindow>
m_xDialogParent;
sal_uInt16 m_nControllerLockCount;
@@ -221,7 +284,7 @@ public:
virtual ~ODatabaseModelImpl();
ODatabaseModelImpl(
- const OUString& _rRegistrationName,
+ OUString _sRegistrationName,
const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
ODatabaseContext& _rDBContext
);
@@ -416,7 +479,8 @@ public:
virtual bool macroCallsSeenWhileLoading() const override;
virtual css::uno::Reference< css::document::XEmbeddedScripts > getEmbeddedDocumentScripts() const override;
virtual SignatureState getScriptingSignatureState() override;
- virtual bool hasTrustedScriptingSignature( bool bAllowUIToAddAuthor ) override;
+ virtual bool hasTrustedScriptingSignature(
+ const css::uno::Reference<css::task::XInteractionHandler>& _rxInteraction) override;
// IModifiableDocument
virtual void storageIsModified() override;
@@ -451,7 +515,7 @@ protected:
::osl::Mutex m_aMutex; // only use this to init WeakComponentImplHelper
protected:
- explicit ModelDependentComponent( const ::rtl::Reference< ODatabaseModelImpl >& _model );
+ explicit ModelDependentComponent( ::rtl::Reference< ODatabaseModelImpl > _model );
virtual ~ModelDependentComponent();
/** returns the component itself
diff --git a/dbaccess/source/core/inc/PropertyForward.hxx b/dbaccess/source/core/inc/PropertyForward.hxx
index b8e602fc05cf..daf31758d000 100644
--- a/dbaccess/source/core/inc/PropertyForward.hxx
+++ b/dbaccess/source/core/inc/PropertyForward.hxx
@@ -49,7 +49,7 @@ namespace dbaccess
public:
OPropertyForward( const css::uno::Reference< css::beans::XPropertySet>& _xSource,
const css::uno::Reference< css::container::XNameAccess>& _xDestContainer,
- const OUString& _sName,
+ OUString _sName,
const std::vector< OUString >& _aPropertyList
);
diff --git a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx
index 356d00aafdb0..fdde2d451d17 100644
--- a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx
+++ b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx
@@ -76,6 +76,7 @@ namespace dbaccess
typedef std::function<const ::connectivity::OSQLParseNode*(::connectivity::OSQLParseTreeIterator *)>
TGetParseNode;
::svxform::OSystemParseContext m_aParseContext;
+ ::svxform::ONeutralParseContext m_aNeutralContext;
::connectivity::OSQLParser m_aSqlParser;
::connectivity::OSQLParseTreeIterator m_aSqlIterator; // the iterator for the complete statement
::connectivity::OSQLParseTreeIterator m_aAdditiveIterator; // the iterator for the "additive statement" (means without the clauses of the elementary statement)
@@ -218,7 +219,10 @@ namespace dbaccess
// XServiceInfo
DECLARE_SERVICE_INFO();
- DECLARE_PROPERTYCONTAINER_DEFAULTS();
+ virtual css::uno::Reference< css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override;
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
+
// css::sdb::XSingleSelectQueryComposer
virtual OUString SAL_CALL getElementaryQuery() override;
diff --git a/dbaccess/source/core/inc/TableDeco.hxx b/dbaccess/source/core/inc/TableDeco.hxx
index 5e2cb214fb8a..93a974dac4a4 100644
--- a/dbaccess/source/core/inc/TableDeco.hxx
+++ b/dbaccess/source/core/inc/TableDeco.hxx
@@ -61,7 +61,6 @@ namespace dbaccess
,public ODBTableDecorator_PROP
{
void fillPrivileges() const;
- protected:
css::uno::Reference< css::container::XContainerListener > m_xColumnMediator;
css::uno::Reference< css::sdbcx::XColumnsSupplier > m_xTable;
css::uno::Reference< css::container::XNameAccess > m_xColumnDefinitions;
@@ -75,6 +74,7 @@ namespace dbaccess
// note: this thing uses the ref-count of "this", see OCollection::acquire()!
std::unique_ptr<::connectivity::sdbcx::OCollection> m_pColumns;
+ protected:
// IColumnFactory
virtual rtl::Reference<OColumn> createColumn(const OUString& _rName) const override;
virtual css::uno::Reference< css::beans::XPropertySet > createColumnDescriptor() override;
@@ -145,7 +145,7 @@ namespace dbaccess
virtual void SAL_CALL setName( const OUString& aName ) override;
// css::lang::XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
+ static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
// XColumnsSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getColumns( ) override;
diff --git a/dbaccess/source/core/inc/bookmarkcontainer.hxx b/dbaccess/source/core/inc/bookmarkcontainer.hxx
index ebe66ed918eb..464192542499 100644
--- a/dbaccess/source/core/inc/bookmarkcontainer.hxx
+++ b/dbaccess/source/core/inc/bookmarkcontainer.hxx
@@ -24,7 +24,7 @@
#include <map>
#include <vector>
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/interfacecontainer3.hxx>
#include <cppuhelper/implbase.hxx>
#include <osl/mutex.hxx>
#include <com/sun/star/container/XChild.hpp>
@@ -58,7 +58,7 @@ class OBookmarkContainer final
MapIteratorVector m_aBookmarksIndexed; // for index access to the
::cppu::OWeakObject& m_rParent; // for the ref counting
- ::comphelper::OInterfaceContainerHelper2
+ ::comphelper::OInterfaceContainerHelper3<css::container::XContainerListener>
m_aContainerListeners;
::osl::Mutex& m_rMutex;
diff --git a/dbaccess/source/core/inc/column.hxx b/dbaccess/source/core/inc/column.hxx
index aebc376b138d..eae96fba3fd6 100644
--- a/dbaccess/source/core/inc/column.hxx
+++ b/dbaccess/source/core/inc/column.hxx
@@ -128,7 +128,6 @@ namespace dbaccess
{
OContainerMediator* m_pMediator;
- protected:
// comes from the driver can be null
css::uno::Reference< css::container::XNameAccess > m_xDrvColumns;
css::uno::WeakReference< css::uno::XInterface > m_xParent;
@@ -139,6 +138,7 @@ namespace dbaccess
bool m_bAddColumn : 1;
bool m_bDropColumn : 1;
+ protected:
virtual void impl_refresh() override;
virtual connectivity::sdbcx::ObjectType createObject(const OUString& _rName) override;
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
@@ -178,7 +178,7 @@ namespace dbaccess
OColumns(
::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
- const css::uno::Reference< css::container::XNameAccess >& _rxDrvColumns,
+ css::uno::Reference< css::container::XNameAccess > _xDrvColumns,
bool _bCaseSensitive,
const std::vector< OUString> &_rVector,
IColumnFactory* _pColFactory,
diff --git a/dbaccess/source/core/inc/databasecontext.hxx b/dbaccess/source/core/inc/databasecontext.hxx
index 4f561ebd2401..d94df018d1c0 100644
--- a/dbaccess/source/core/inc/databasecontext.hxx
+++ b/dbaccess/source/core/inc/databasecontext.hxx
@@ -28,7 +28,6 @@
#include "ModelImpl.hxx"
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/sdb/XDatabaseContext.hpp>
#include <com/sun/star/sdb/XDatabaseRegistrations.hpp>
#include <com/sun/star/uno/XAggregation.hpp>
@@ -55,7 +54,6 @@ class DatabaseDocumentLoader;
typedef ::cppu::WeakComponentImplHelper< css::lang::XServiceInfo
, css::sdb::XDatabaseContext
- , css::lang::XUnoTunnel
> DatabaseAccessContext_Base;
class ODatabaseContext :public DatabaseAccessContext_Base
@@ -84,13 +82,10 @@ private:
BasicDLL m_aBasicDLL;
#endif
-protected:
::osl::Mutex m_aMutex;
css::uno::Reference< css::uno::XComponentContext >
m_aContext;
- css::uno::Reference< css::uno::XAggregation >
- m_xDBRegistrationAggregate;
css::uno::Reference< css::sdb::XDatabaseRegistrations >
m_xDatabaseRegistrations;
@@ -105,7 +100,7 @@ protected:
// recreated afterwards. So it's our (the context's) responsibility to store the session-persistent
// properties.
- ::comphelper::OInterfaceContainerHelper2 m_aContainerListeners;
+ ::comphelper::OInterfaceContainerHelper3<css::container::XContainerListener> m_aContainerListeners;
rtl::Reference<DatabaseDocumentLoader> m_xDatabaseDocumentLoader;
public:
@@ -156,10 +151,6 @@ public:
virtual void SAL_CALL addContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
virtual void SAL_CALL removeContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
- // css::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
-
void registerDatabaseDocument( ODatabaseModelImpl& _rModelImpl);
void revokeDatabaseDocument( const ODatabaseModelImpl& _rModelImpl);
void databaseDocumentURLChange(const OUString& _sOldName, const OUString& _sNewName);
diff --git a/dbaccess/source/core/inc/definitioncolumn.hxx b/dbaccess/source/core/inc/definitioncolumn.hxx
index 4d7ff3e170e0..b4c0a5c081a6 100644
--- a/dbaccess/source/core/inc/definitioncolumn.hxx
+++ b/dbaccess/source/core/inc/definitioncolumn.hxx
@@ -151,7 +151,7 @@ namespace dbaccess
OQueryColumn(
const css::uno::Reference< css::beans::XPropertySet>& _rxParserColumn,
const css::uno::Reference< css::sdbc::XConnection >& _rxConnection,
- const OUString &i_sLabel
+ OUString i_sLabel
);
// XTypeProvider
diff --git a/dbaccess/source/core/inc/definitioncontainer.hxx b/dbaccess/source/core/inc/definitioncontainer.hxx
index bcb6bd364470..02f145776c8f 100644
--- a/dbaccess/source/core/inc/definitioncontainer.hxx
+++ b/dbaccess/source/core/inc/definitioncontainer.hxx
@@ -36,6 +36,7 @@
#include "ContentHelper.hxx"
#include "containerapprove.hxx"
#include <comphelper/uno3.hxx>
+#include <comphelper/interfacecontainer2.hxx>
namespace dbaccess
{
@@ -129,7 +130,7 @@ protected:
with a new one), this new element must pass our own internal approval, plus the approval
given here.
*/
- void setElementApproval( PContainerApprove _pElementApproval ) { m_pElementApproval = _pElementApproval; }
+ void setElementApproval(const PContainerApprove& _pElementApproval ) { m_pElementApproval = _pElementApproval; }
const PContainerApprove& getElementApproval() const { return m_pElementApproval; }
protected:
diff --git a/dbaccess/source/core/inc/documentevents.hxx b/dbaccess/source/core/inc/documentevents.hxx
index 24a7dd24ca17..224fc407d2fe 100644
--- a/dbaccess/source/core/inc/documentevents.hxx
+++ b/dbaccess/source/core/inc/documentevents.hxx
@@ -24,7 +24,6 @@
#include <cppuhelper/implbase.hxx>
-#include <memory>
#include <map>
namespace dbaccess
@@ -33,9 +32,6 @@ namespace dbaccess
typedef std::map< OUString, css::uno::Sequence< css::beans::PropertyValue > >
DocumentEventsData;
- // DocumentEvents
- struct DocumentEvents_Data;
-
typedef ::cppu::WeakImplHelper< css::container::XNameReplace
> DocumentEvents_Base;
@@ -48,7 +44,7 @@ namespace dbaccess
DocumentEvents(const DocumentEvents&) = delete;
const DocumentEvents& operator=(const DocumentEvents&) = delete;
- static bool needsSynchronousNotification( const OUString& _rEventName );
+ static bool needsSynchronousNotification( std::u16string_view _rEventName );
// XInterface
virtual void SAL_CALL acquire() noexcept override;
@@ -67,7 +63,9 @@ namespace dbaccess
virtual sal_Bool SAL_CALL hasElements( ) override;
private:
- std::unique_ptr< DocumentEvents_Data > m_pData;
+ ::cppu::OWeakObject& mrParent;
+ ::osl::Mutex& mrMutex;
+ DocumentEventsData& mrEventsData;
};
} // namespace dbaccess
diff --git a/dbaccess/source/core/inc/object.hxx b/dbaccess/source/core/inc/object.hxx
deleted file mode 100644
index a947f9c57c3e..000000000000
--- a/dbaccess/source/core/inc/object.hxx
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#pragma once
-
-enum ObjectType
-{
- dbaTable,
- dbaQuery,
- dbaForm,
- dbaReport
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/core/inc/objectnameapproval.hxx b/dbaccess/source/core/inc/objectnameapproval.hxx
index ddd538c79edb..e503c347ea4e 100644
--- a/dbaccess/source/core/inc/objectnameapproval.hxx
+++ b/dbaccess/source/core/inc/objectnameapproval.hxx
@@ -21,14 +21,13 @@
#include <memory>
#include "containerapprove.hxx"
-
+#include <cppuhelper/weakref.hxx>
#include <com/sun/star/sdbc/XConnection.hpp>
namespace dbaccess
{
// ObjectNameApproval
- struct ObjectNameApproval_Impl;
/** implementation of the IContainerApprove interface which approves
elements for insertion into a query or tables container.
@@ -40,7 +39,8 @@ namespace dbaccess
*/
class ObjectNameApproval : public IContainerApprove
{
- std::unique_ptr< ObjectNameApproval_Impl > m_pImpl;
+ css::uno::WeakReference< css::sdbc::XConnection > mxConnection;
+ sal_Int32 mnCommandType;
public:
enum ObjectType
diff --git a/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx b/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx
index e5f924650b52..4f0f68d306c9 100644
--- a/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx
+++ b/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx
@@ -24,13 +24,11 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <vector>
-#include <memory>
namespace dbaccess
{
// DatabaseDocumentRecovery
- struct DatabaseDocumentRecovery_Data;
class DatabaseDocumentRecovery
{
public:
@@ -63,7 +61,7 @@ namespace dbaccess
);
private:
- const std::unique_ptr< DatabaseDocumentRecovery_Data > m_pData;
+ css::uno::Reference<css::uno::XComponentContext> mxContext;
};
} // namespace dbaccess
diff --git a/dbaccess/source/core/inc/table.hxx b/dbaccess/source/core/inc/table.hxx
index 069579c632e3..6c71e7447653 100644
--- a/dbaccess/source/core/inc/table.hxx
+++ b/dbaccess/source/core/inc/table.hxx
@@ -44,7 +44,6 @@ namespace dbaccess
private:
::rtl::Reference< OContainerMediator > m_pColumnMediator;
- protected:
css::uno::Reference< css::container::XNameAccess > m_xColumnDefinitions;
css::uno::Reference< css::container::XNameAccess > m_xDriverColumns;
@@ -52,6 +51,7 @@ namespace dbaccess
sal_Int32 m_nPrivileges;
// </properties>
+ protected:
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override;
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
@@ -114,7 +114,6 @@ namespace dbaccess
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
// css::lang::XServiceInfo
DECLARE_SERVICE_INFO();
@@ -128,9 +127,6 @@ namespace dbaccess
// css::sdbcx::XAlterTable,
virtual void SAL_CALL alterColumnByName( const OUString& _rName, const css::uno::Reference< css::beans::XPropertySet >& _rxDescriptor ) override;
- // css::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
-
private:
using OTable_Base::createArrayHelper;
using OTable_Base::getFastPropertyValue;
diff --git a/dbaccess/source/core/inc/veto.hxx b/dbaccess/source/core/inc/veto.hxx
index 5608e87d11ee..ec44172f70d4 100644
--- a/dbaccess/source/core/inc/veto.hxx
+++ b/dbaccess/source/core/inc/veto.hxx
@@ -37,7 +37,7 @@ namespace dbaccess
const css::uno::Any m_aDetails;
public:
- Veto( const css::uno::Any& _rDetails );
+ Veto( css::uno::Any _aDetails );
virtual OUString SAL_CALL getReason() override;
virtual css::uno::Any SAL_CALL getDetails() override;
diff --git a/dbaccess/source/core/misc/ContainerMediator.cxx b/dbaccess/source/core/misc/ContainerMediator.cxx
index 338858c87e76..0ee0d2e1f93c 100644
--- a/dbaccess/source/core/misc/ContainerMediator.cxx
+++ b/dbaccess/source/core/misc/ContainerMediator.cxx
@@ -25,7 +25,7 @@
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/sdbcx/XRename.hpp>
#include <comphelper/property.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaccess
{
@@ -222,8 +222,7 @@ void OContainerMediator::notifyElementCreated( const OUString& _sName, const Ref
DBG_UNHANDLED_EXCEPTION("dbaccess");
}
- ::rtl::Reference pForward( new OPropertyForward( _xDest, m_xSettings, _sName, aPropertyList ) );
- m_aForwardList[ _sName ] = pForward;
+ m_aForwardList[_sName].set(new OPropertyForward(_xDest, m_xSettings, _sName, aPropertyList));
}
} // namespace dbaccess
diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
index 2098f513f343..d2aa735fa8ba 100644
--- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx
+++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
@@ -23,9 +23,8 @@
#include <comphelper/types.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <connectivity/FValue.hxx>
-#include <rtl/math.hxx>
#include <sal/macros.h>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
@@ -38,6 +37,7 @@
#include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <com/sun/star/chart/XChartDataArray.hpp>
+#include <utility>
#include <vector>
// TODO: update for new HavingClause-aware FilterManager
@@ -52,7 +52,6 @@ DatabaseDataProvider::DatabaseDataProvider(uno::Reference< uno::XComponentContex
::cppu::PropertySetMixin< chart2::data::XDatabaseDataProvider >(
context, IMPLEMENTS_PROPERTY_SET, uno::Sequence< OUString >()),
m_aParameterManager( m_aMutex, context ),
- m_aFilterManager(),
m_xContext(context),
m_CommandType(sdb::CommandType::COMMAND), // #i94114
m_RowLimit(0),
@@ -71,8 +70,8 @@ DatabaseDataProvider::DatabaseDataProvider(uno::Reference< uno::XComponentContex
uno::Reference<beans::XPropertySet> xProp(static_cast< ::cppu::OWeakObject* >( this ),uno::UNO_QUERY);
m_aFilterManager.initialize( m_xAggregateSet );
m_aParameterManager.initialize( xProp, m_xAggregate );
- m_xAggregateSet->setPropertyValue(PROPERTY_COMMAND_TYPE,uno::makeAny(m_CommandType));
- m_xAggregateSet->setPropertyValue(PROPERTY_ESCAPE_PROCESSING,uno::makeAny(m_EscapeProcessing));
+ m_xAggregateSet->setPropertyValue(PROPERTY_COMMAND_TYPE,uno::Any(m_CommandType));
+ m_xAggregateSet->setPropertyValue(PROPERTY_ESCAPE_PROCESSING,uno::Any(m_EscapeProcessing));
}
osl_atomic_decrement( &m_refCount );
}
@@ -125,7 +124,7 @@ void SAL_CALL DatabaseDataProvider::initialize(const uno::Sequence< uno::Any > &
else if ( !m_xHandler.is() )
(*pIter) >>= m_xHandler;
}
- m_xAggregateSet->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, uno::makeAny( m_xActiveConnection ) );
+ m_xAggregateSet->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, uno::Any( m_xActiveConnection ) );
}
// chart2::data::XDataProvider:
@@ -203,9 +202,8 @@ uno::Reference< chart2::data::XDataSource > SAL_CALL DatabaseDataProvider::creat
uno::Reference< lang::XInitialization> xIni(m_xInternal,uno::UNO_QUERY);
if ( xIni.is() )
{
- uno::Sequence< uno::Any > aInitArgs(1);
- beans::NamedValue aParam("CreateDefaultData",uno::makeAny(true));
- aInitArgs[0] <<= aParam;
+ beans::NamedValue aParam("CreateDefaultData",uno::Any(true));
+ uno::Sequence< uno::Any > aInitArgs{ uno::Any(aParam) };
xIni->initialize(aInitArgs);
}
}
@@ -218,9 +216,9 @@ uno::Sequence< beans::PropertyValue > SAL_CALL DatabaseDataProvider::detectArgum
{
::comphelper::NamedValueCollection aArguments;
aArguments.put( "CellRangeRepresentation", uno::Any( OUString( "all" ) ) );
- aArguments.put( "DataRowSource", uno::makeAny( chart::ChartDataRowSource_COLUMNS ) );
+ aArguments.put( "DataRowSource", uno::Any( chart::ChartDataRowSource_COLUMNS ) );
// internal data always contains labels
- aArguments.put( "FirstCellAsLabel", uno::makeAny( true ) );
+ aArguments.put( "FirstCellAsLabel", uno::Any( true ) );
bool bHasCategories = false;
if( _xDataSource.is())
@@ -244,7 +242,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL DatabaseDataProvider::detectArgum
}
}
}
- aArguments.put( "HasCategories", uno::makeAny( bHasCategories ) );
+ aArguments.put( "HasCategories", uno::Any( bHasCategories ) );
return aArguments.getPropertyValues();
}
@@ -258,7 +256,7 @@ uno::Any DatabaseDataProvider::impl_getNumberFormatKey_nothrow(const OUString &
std::map< OUString,css::uno::Any>::const_iterator aFind = m_aNumberFormats.find(_sRangeRepresentation);
if ( aFind != m_aNumberFormats.end() )
return aFind->second;
- return uno::makeAny(sal_Int32(0));
+ return uno::Any(sal_Int32(0));
}
uno::Reference< chart2::data::XDataSequence > SAL_CALL DatabaseDataProvider::createDataSequenceByRangeRepresentation(const OUString & _sRangeRepresentation)
@@ -266,7 +264,7 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL DatabaseDataProvider::cre
osl::MutexGuard g(m_aMutex);
uno::Reference< chart2::data::XDataSequence > xData = m_xInternal->createDataSequenceByRangeRepresentation(_sRangeRepresentation);
uno::Reference<beans::XPropertySet> xProp(xData,uno::UNO_QUERY);
- static constexpr OUStringLiteral s_sNumberFormatKey = u"NumberFormatKey";
+ static constexpr OUString s_sNumberFormatKey = u"NumberFormatKey"_ustr;
if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName(s_sNumberFormatKey) )
{
xProp->setPropertyValue(s_sNumberFormatKey,impl_getNumberFormatKey_nothrow(_sRangeRepresentation));
@@ -276,7 +274,7 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL DatabaseDataProvider::cre
uno::Reference<chart2::data::XDataSequence>
SAL_CALL DatabaseDataProvider::createDataSequenceByValueArray(
- const OUString& /*aRole*/, const OUString& /*aRangeRepresentation*/ )
+ const OUString& /*aRole*/, const OUString& /*aRangeRepresentation*/, const OUString& /*aRoleQualifier*/ )
{
return uno::Reference<chart2::data::XDataSequence>();
}
@@ -447,7 +445,7 @@ void SAL_CALL DatabaseDataProvider::setCommand(const OUString & the_value)
{
osl::MutexGuard g(m_aMutex);
impl_invalidateParameter_nothrow();
- m_xAggregateSet->setPropertyValue( PROPERTY_COMMAND, uno::makeAny( the_value ) );
+ m_xAggregateSet->setPropertyValue( PROPERTY_COMMAND, uno::Any( the_value ) );
}
set(PROPERTY_COMMAND,the_value,m_Command);
}
@@ -462,7 +460,7 @@ void SAL_CALL DatabaseDataProvider::setCommandType(::sal_Int32 the_value)
{
{
osl::MutexGuard g(m_aMutex);
- m_xAggregateSet->setPropertyValue( PROPERTY_COMMAND_TYPE, uno::makeAny( the_value ) );
+ m_xAggregateSet->setPropertyValue( PROPERTY_COMMAND_TYPE, uno::Any( the_value ) );
}
set(PROPERTY_COMMAND_TYPE,the_value,m_CommandType);
}
@@ -492,7 +490,7 @@ void SAL_CALL DatabaseDataProvider::setApplyFilter( sal_Bool the_value )
{
{
osl::MutexGuard g(m_aMutex);
- m_xAggregateSet->setPropertyValue( PROPERTY_APPLYFILTER, uno::makeAny( the_value ) );
+ m_xAggregateSet->setPropertyValue( PROPERTY_APPLYFILTER, uno::Any( the_value ) );
}
set(PROPERTY_APPLYFILTER,static_cast<bool>(the_value),m_ApplyFilter);
}
@@ -507,7 +505,7 @@ void SAL_CALL DatabaseDataProvider::setHavingClause( const OUString& the_value )
{
{
osl::MutexGuard g(m_aMutex);
- m_xAggregateSet->setPropertyValue( PROPERTY_HAVING_CLAUSE, uno::makeAny( the_value ) );
+ m_xAggregateSet->setPropertyValue( PROPERTY_HAVING_CLAUSE, uno::Any( the_value ) );
}
set(PROPERTY_HAVING_CLAUSE,the_value,m_HavingClause);
}
@@ -522,7 +520,7 @@ void SAL_CALL DatabaseDataProvider::setGroupBy( const OUString& the_value )
{
{
osl::MutexGuard g(m_aMutex);
- m_xAggregateSet->setPropertyValue( PROPERTY_GROUP_BY, uno::makeAny( the_value ) );
+ m_xAggregateSet->setPropertyValue( PROPERTY_GROUP_BY, uno::Any( the_value ) );
}
set(PROPERTY_GROUP_BY,the_value,m_GroupBy);
}
@@ -537,7 +535,7 @@ void SAL_CALL DatabaseDataProvider::setOrder( const OUString& the_value )
{
{
osl::MutexGuard g(m_aMutex);
- m_xAggregateSet->setPropertyValue( PROPERTY_ORDER, uno::makeAny( the_value ) );
+ m_xAggregateSet->setPropertyValue( PROPERTY_ORDER, uno::Any( the_value ) );
}
set(PROPERTY_ORDER,the_value,m_Order);
}
@@ -597,13 +595,12 @@ namespace
sal_Int32 nDataType;
ColumnDescription()
- :sName()
- ,nResultSetPosition( 0 )
+ :nResultSetPosition( 0 )
,nDataType( sdbc::DataType::VARCHAR )
{
}
- explicit ColumnDescription( const OUString& i_rName )
- :sName( i_rName )
+ explicit ColumnDescription( OUString i_sName )
+ :sName(std::move( i_sName ))
,nResultSetPosition( 0 )
,nDataType( sdbc::DataType::VARCHAR )
{
@@ -662,7 +659,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor
{
const sal_Int32 nAssumedRowSetColumnIndex = _bHasCategories ? 1 : 0;
if ( nAssumedRowSetColumnIndex < aRowSetColumnNames.getLength() )
- aImposedColumnNames[0] = aRowSetColumnNames[ nAssumedRowSetColumnIndex ];
+ aImposedColumnNames.getArray()[0] = aRowSetColumnNames[ nAssumedRowSetColumnIndex ];
}
const sal_Int32 nCount = aImposedColumnNames.getLength();
@@ -738,11 +735,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor
aValue.fill( column.nResultSetPosition, column.nDataType, xRow );
if ( aValue.isNull() )
- {
- double nValue;
- ::rtl::math::setNan( &nValue );
- aRow.push_back( nValue );
- }
+ aRow.push_back( std::numeric_limits<double>::quiet_NaN() );
else
aRow.push_back( aValue.getDouble() );
}
@@ -763,7 +756,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor
{
aRowLabels.push_back(OUString::number(h+1));
std::vector< double > aRow;
- const sal_Int32 nSize = SAL_N_ELEMENTS(fDefaultData);
+ const sal_Int32 nSize = std::size(fDefaultData);
for (size_t j = 0; j < (aColumns.size()-1); ++j,++k)
{
if ( k >= nSize )
@@ -800,7 +793,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor
void DatabaseDataProvider::impl_fillRowSet_throw()
{
- m_xAggregateSet->setPropertyValue( PROPERTY_FILTER, uno::makeAny( getFilter() ) );
+ m_xAggregateSet->setPropertyValue( PROPERTY_FILTER, uno::Any( getFilter() ) );
uno::Reference< sdbc::XParameters> xParam(m_xRowSet,uno::UNO_QUERY_THROW);
xParam->clearParameters( );
}
diff --git a/dbaccess/source/core/misc/PropertyForward.cxx b/dbaccess/source/core/misc/PropertyForward.cxx
index 239bd422fd41..07e1068f695f 100644
--- a/dbaccess/source/core/misc/PropertyForward.cxx
+++ b/dbaccess/source/core/misc/PropertyForward.cxx
@@ -24,7 +24,8 @@
#include <com/sun/star/sdbcx/XAppend.hpp>
#include <comphelper/property.hxx>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaccess
{
@@ -37,10 +38,10 @@ namespace dbaccess
OPropertyForward::OPropertyForward( const Reference< XPropertySet>& _xSource, const Reference< XNameAccess>& _xDestContainer,
- const OUString& _sName, const std::vector< OUString>& _aPropertyList )
+ OUString _sName, const std::vector< OUString>& _aPropertyList )
:m_xSource( _xSource, UNO_SET_THROW )
,m_xDestContainer( _xDestContainer, UNO_SET_THROW )
- ,m_sName( _sName )
+ ,m_sName(std::move( _sName ))
,m_bInInsert( false )
{
diff --git a/dbaccess/source/core/misc/apitools.cxx b/dbaccess/source/core/misc/apitools.cxx
index efec92cf5a63..384d5962bd2d 100644
--- a/dbaccess/source/core/misc/apitools.cxx
+++ b/dbaccess/source/core/misc/apitools.cxx
@@ -29,7 +29,7 @@ using namespace osl;
// various helper functions
// OSubComponent
OSubComponent::OSubComponent(Mutex& _rMutex, const Reference< XInterface > & xParent)
- :OComponentHelper(_rMutex)
+ :WeakComponentImplHelper(_rMutex)
,m_xParent(xParent)
{
@@ -41,74 +41,51 @@ OSubComponent::~OSubComponent()
}
-// css::lang::XTypeProvider
-Sequence< Type > OSubComponent::getTypes()
-{
- OTypeCollection aTypes(cppu::UnoType<XComponent>::get(),
- cppu::UnoType<XTypeProvider>::get(),
- cppu::UnoType<XWeak>::get());
-
- return aTypes.getTypes();
-}
-
// XInterface
void OSubComponent::release() noexcept
{
- Reference< XInterface > x( xDelegator );
- if (! x.is())
+ if (osl_atomic_decrement( &m_refCount ) == 0 )
{
- if (osl_atomic_decrement( &m_refCount ) == 0 )
+ if (! rBHelper.bDisposed)
{
- if (! rBHelper.bDisposed)
+ // *before* again incrementing our ref count, ensure that our weak connection point
+ // will not create references to us anymore (via XAdapter::queryAdapted)
+ disposeWeakConnectionPoint();
+
+ Reference< XInterface > xHoldAlive( *this );
+ // remember the parent
+ Reference< XInterface > xParent;
{
- // *before* again incrementing our ref count, ensure that our weak connection point
- // will not create references to us anymore (via XAdapter::queryAdapted)
- disposeWeakConnectionPoint();
-
- Reference< XInterface > xHoldAlive( *this );
- // remember the parent
- Reference< XInterface > xParent;
- {
- MutexGuard aGuard( rBHelper.rMutex );
- xParent = m_xParent;
- m_xParent = nullptr;
- }
-
- SAL_WARN_IF( m_refCount != 1, "dbaccess.core", "OSubComponent::release: invalid ref count (before dispose)!" );
-
- // First dispose
- dispose();
-
- // only the alive ref holds the object
- SAL_WARN_IF( m_refCount != 1, "dbaccess.core", "OSubComponent::release: invalid ref count (after dispose)!" );
-
- // release the parent in the ~
- if (xParent.is())
- {
- MutexGuard aGuard( rBHelper.rMutex );
- m_xParent = xParent;
- }
-
- // destroy the object if xHoldAlive decrement the refcount to 0
- return;
+ MutexGuard aGuard( rBHelper.rMutex );
+ xParent = m_xParent;
+ m_xParent = nullptr;
}
- }
- // restore the reference count
- osl_atomic_increment( &m_refCount );
- }
- // as we cover the job of the componenthelper we use the ...
- OWeakAggObject::release();
-}
+ SAL_WARN_IF( m_refCount != 1, "dbaccess.core", "OSubComponent::release: invalid ref count (before dispose)!" );
-Any OSubComponent::queryInterface( const Type & rType )
-{
- Any aReturn;
- if (!rType.equals(cppu::UnoType<XAggregation>::get()))
- aReturn = OComponentHelper::queryInterface(rType);
+ // First dispose
+ dispose();
+
+ // only the alive ref holds the object
+ SAL_WARN_IF( m_refCount != 1, "dbaccess.core", "OSubComponent::release: invalid ref count (after dispose)!" );
+
+ // release the parent in the ~
+ if (xParent.is())
+ {
+ MutexGuard aGuard( rBHelper.rMutex );
+ m_xParent = xParent;
+ }
+
+ // destroy the object if xHoldAlive decrement the refcount to 0
+ return;
+ }
+ }
+ // restore the reference count
+ osl_atomic_increment( &m_refCount );
- return aReturn;
+ // as we cover the job of the WeakComponentImplHelper we use the ...
+ OWeakObject::release();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx
index aca8aacb560b..6a081c47a1f7 100644
--- a/dbaccess/source/core/misc/dsntypes.cxx
+++ b/dbaccess/source/core/misc/dsntypes.cxx
@@ -17,13 +17,17 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_java.h>
#include <dsntypes.hxx>
#include <unotools/confignode.hxx>
+#include <o3tl/safeint.hxx>
+#include <o3tl/string_view.hxx>
#include <osl/diagnose.h>
#include <tools/wldcrd.hxx>
#include <osl/file.hxx>
#include <officecfg/Office/Common.hxx>
#include <comphelper/string.hxx>
+#include <utility>
namespace dbaccess
{
@@ -31,17 +35,16 @@ namespace dbaccess
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::lang;
namespace
{
- void lcl_extractHostAndPort(const OUString& _sUrl,OUString& _sHostname,sal_Int32& _nPortNumber)
+ void lcl_extractHostAndPort(std::u16string_view _sUrl, OUString& _sHostname, sal_Int32& _nPortNumber)
{
if ( comphelper::string::getTokenCount(_sUrl, ':') >= 2 )
{
sal_Int32 nPos {0};
- _sHostname = _sUrl.getToken(0, ':', nPos);
- _nPortNumber = _sUrl.getToken(0, ':', nPos).toInt32();
+ _sHostname = o3tl::getToken(_sUrl, 0, ':', nPos);
+ _nPortNumber = o3tl::toInt32(o3tl::getToken(_sUrl, 0, ':', nPos));
}
}
}
@@ -83,7 +86,7 @@ OUString ODsnTypeCollection::cutPrefix(std::u16string_view _sURL) const
OUString sOldPattern;
// on Windows or with gen rendering, the urls may begin with an ~
- const OUString& sCleanURL = comphelper::string::stripStart(_sURL, '~');
+ std::u16string_view sCleanURL = comphelper::string::stripStart(_sURL, '~');
for (auto const& dsnPrefix : m_aDsnPrefixes)
{
@@ -94,8 +97,8 @@ OUString ODsnTypeCollection::cutPrefix(std::u16string_view _sURL) const
// foo*
// that is, the very concept of "prefix" applies.
OUString prefix(comphelper::string::stripEnd(dsnPrefix, '*'));
- OSL_ENSURE(prefix.getLength() <= sCleanURL.getLength(), "How can A match B when A shorter than B?");
- sRet = sCleanURL.copy(prefix.getLength());
+ OSL_ENSURE(o3tl::make_unsigned(prefix.getLength()) <= sCleanURL.size(), "How can A match B when A shorter than B?");
+ sRet = sCleanURL.substr(prefix.getLength());
sOldPattern = dsnPrefix;
}
}
@@ -103,7 +106,7 @@ OUString ODsnTypeCollection::cutPrefix(std::u16string_view _sURL) const
return sRet;
}
-OUString ODsnTypeCollection::getPrefix(const OUString& _sURL) const
+OUString ODsnTypeCollection::getPrefix(std::u16string_view _sURL) const
{
OUString sRet;
OUString sOldPattern;
@@ -116,7 +119,7 @@ OUString ODsnTypeCollection::getPrefix(const OUString& _sURL) const
// foo*
// that is, the very concept of "prefix" applies.
sRet = comphelper::string::stripEnd(dsnPrefix, '*');
- OSL_ENSURE(sRet.getLength() <= _sURL.getLength(), "How can A match B when A shorter than B?");
+ OSL_ENSURE(sRet.getLength() <= static_cast<sal_Int32>(_sURL.size()), "How can A match B when A shorter than B?");
sOldPattern = dsnPrefix;
}
}
@@ -225,8 +228,7 @@ void ODsnTypeCollection::extractHostNamePort(const OUString& _rDsn,OUString& _sD
_rsHostname = sUrl.getToken(0,'/');
_sDatabaseName = sUrl.copy(sUrl.lastIndexOf('/')+1);
}
- else if ( _rDsn.startsWithIgnoreAsciiCase("sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=")
- || _rDsn.startsWithIgnoreAsciiCase("sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=") )
+ else if ( _rDsn.startsWithIgnoreAsciiCase("sdbc:ado:access:"))
{
OUString sNewFileName;
if ( ::osl::FileBase::getFileURLFromSystemPath( sUrl, sNewFileName ) == ::osl::FileBase::E_None )
@@ -278,14 +280,14 @@ Sequence<PropertyValue> ODsnTypeCollection::getDefaultDBSettings( std::u16string
return aProperties.getPropertyValues();
}
-bool ODsnTypeCollection::isEmbeddedDatabase( const OUString& _sURL )
+bool ODsnTypeCollection::isEmbeddedDatabase( std::u16string_view _sURL )
{
- return _sURL.startsWith( "sdbc:embedded:" );
+ return o3tl::starts_with( _sURL, u"sdbc:embedded:" );
}
OUString ODsnTypeCollection::getEmbeddedDatabase()
{
- if (officecfg::Office::Common::Misc::ExperimentalMode::get())
+ if (!HAVE_FEATURE_JAVA || officecfg::Office::Common::Misc::ExperimentalMode::get())
return "sdbc:embedded:firebird";
else
return "sdbc:embedded:hsqldb";
@@ -320,6 +322,9 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(std::u16string_view _rDsn) con
if (sDsn.equalsIgnoreAsciiCase("sdbc:embedded:firebird"))
return DST_EMBEDDED_FIREBIRD;
+ if (sDsn.startsWithIgnoreAsciiCase("sdbc:embedded:"))
+ return DST_EMBEDDED_UNKNOWN;
+
// find second :
nSeparator = sDsn.indexOf(u':', nSeparator + 1);
if (-1 == nSeparator)
@@ -333,10 +338,7 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(std::u16string_view _rDsn) con
{
if (sDsn.startsWithIgnoreAsciiCase("sdbc:ado:access:"))
{
- if (sDsn.startsWithIgnoreAsciiCase("sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0;"))
- return DST_MSACCESS_2007;
- else
- return DST_MSACCESS;
+ return DST_MSACCESS;
}
return DST_ADO;
}
@@ -347,8 +349,8 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(std::u16string_view _rDsn) con
const DATASOURCE_TYPE eType;
const bool bMatchComplete;
- KnownPrefix( const OUString &_s, const DATASOURCE_TYPE _t, const bool _m )
- :sPrefix( _s )
+ KnownPrefix( OUString _s, const DATASOURCE_TYPE _t, const bool _m )
+ :sPrefix(std::move( _s ))
,eType ( _t )
,bMatchComplete( _m )
{
@@ -442,11 +444,13 @@ void ODsnTypeCollection::fillPageIds(std::u16string_view _sURL,std::vector<sal_I
case DST_ORACLE_JDBC:
_rOutPathIds.push_back(PAGE_DBSETUPWIZARD_ORACLE);
break;
+ case DST_POSTGRES:
+ _rOutPathIds.push_back(PAGE_DBSETUPWIZARD_POSTGRES);
+ break;
case DST_LDAP:
_rOutPathIds.push_back(PAGE_DBSETUPWIZARD_LDAP);
break;
case DST_MSACCESS:
- case DST_MSACCESS_2007:
_rOutPathIds.push_back(PAGE_DBSETUPWIZARD_MSACCESS);
break;
case DST_OUTLOOKEXP:
@@ -460,6 +464,7 @@ void ODsnTypeCollection::fillPageIds(std::u16string_view _sURL,std::vector<sal_I
case DST_MACAB:
case DST_EMBEDDED_HSQLDB:
case DST_EMBEDDED_FIREBIRD:
+ case DST_EMBEDDED_UNKNOWN:
break;
default:
_rOutPathIds.push_back(PAGE_DBSETUPWIZARD_USERDEFINED);
diff --git a/dbaccess/source/core/misc/objectnameapproval.cxx b/dbaccess/source/core/misc/objectnameapproval.cxx
index 3ec15caaa4fd..fa03e81e3d09 100644
--- a/dbaccess/source/core/misc/objectnameapproval.cxx
+++ b/dbaccess/source/core/misc/objectnameapproval.cxx
@@ -23,35 +23,23 @@
#include <com/sun/star/sdb/tools/XConnectionTools.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
-#include <cppuhelper/weakref.hxx>
-
namespace dbaccess
{
using ::com::sun::star::sdbc::XConnection;
- using ::com::sun::star::uno::WeakReference;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::lang::DisposedException;
using ::com::sun::star::sdb::tools::XConnectionTools;
using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::sdb::tools::XObjectNames;
- using ::com::sun::star::uno::XInterface;
namespace CommandType = com::sun::star::sdb::CommandType;
- // ObjectNameApproval_Impl
- struct ObjectNameApproval_Impl
- {
- WeakReference< XConnection > aConnection;
- sal_Int32 nCommandType;
- };
-
// ObjectNameApproval
ObjectNameApproval::ObjectNameApproval( const Reference< XConnection >& _rxConnection, ObjectType _eType )
- :m_pImpl( new ObjectNameApproval_Impl )
{
- m_pImpl->aConnection = _rxConnection;
- m_pImpl->nCommandType = _eType == TypeQuery ? CommandType::QUERY : CommandType::TABLE;
+ mxConnection = _rxConnection;
+ mnCommandType = _eType == TypeQuery ? CommandType::QUERY : CommandType::TABLE;
}
ObjectNameApproval::~ObjectNameApproval()
@@ -60,13 +48,13 @@ namespace dbaccess
void ObjectNameApproval::approveElement( const OUString& _rName )
{
- Reference< XConnection > xConnection( m_pImpl->aConnection );
+ Reference< XConnection > xConnection( mxConnection );
if ( !xConnection.is() )
throw DisposedException();
Reference< XConnectionTools > xConnectionTools( xConnection, UNO_QUERY_THROW );
Reference< XObjectNames > xObjectNames( xConnectionTools->getObjectNames(), css::uno::UNO_SET_THROW );
- xObjectNames->checkNameForCreate( m_pImpl->nCommandType, _rName );
+ xObjectNames->checkNameForCreate( mnCommandType, _rName );
}
} // namespace dbaccess
diff --git a/dbaccess/source/core/misc/sdbcoretools.cxx b/dbaccess/source/core/misc/sdbcoretools.cxx
index 5cd5367ba117..7856a1484591 100644
--- a/dbaccess/source/core/misc/sdbcoretools.cxx
+++ b/dbaccess/source/core/misc/sdbcoretools.cxx
@@ -27,19 +27,16 @@
#include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <comphelper/interaction.hxx>
#include <rtl/ref.hxx>
-#include <rtl/ustrbuf.hxx>
namespace dbaccess
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::io;
- using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::task;
diff --git a/dbaccess/source/core/misc/veto.cxx b/dbaccess/source/core/misc/veto.cxx
index d2596d4e1e11..07aa9567ec46 100644
--- a/dbaccess/source/core/misc/veto.cxx
+++ b/dbaccess/source/core/misc/veto.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <utility>
#include <veto.hxx>
namespace dbaccess
@@ -25,8 +26,8 @@ namespace dbaccess
using ::com::sun::star::uno::Any;
// Veto
- Veto::Veto( const Any& _rDetails )
- :m_aDetails( _rDetails )
+ Veto::Veto( Any _aDetails )
+ :m_aDetails(std::move( _aDetails ))
{
}
diff --git a/dbaccess/source/core/recovery/dbdocrecovery.cxx b/dbaccess/source/core/recovery/dbdocrecovery.cxx
index db7bb53bd53c..eead0c2c7910 100644
--- a/dbaccess/source/core/recovery/dbdocrecovery.cxx
+++ b/dbaccess/source/core/recovery/dbdocrecovery.cxx
@@ -28,9 +28,10 @@
#include <com/sun/star/io/TextInputStream.hpp>
#include <com/sun/star/util/XModifiable.hpp>
+#include <o3tl/string_view.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaccess
{
@@ -65,30 +66,30 @@ namespace dbaccess
o_rBuffer.append( sal_Unicode( i_rComponentDesc.second.bForEditing ? '1' : '0' ) );
}
- bool lcl_extractCompDesc( const OUString& i_rIniLine, OUString& o_rStorName, SubComponentDescriptor& o_rCompDesc )
+ bool lcl_extractCompDesc( std::u16string_view i_rIniLine, OUString& o_rStorName, SubComponentDescriptor& o_rCompDesc )
{
- const sal_Int32 nEqualSignPos = i_rIniLine.indexOf( '=' );
- if ( nEqualSignPos < 1 )
+ const size_t nEqualSignPos = i_rIniLine.find( '=' );
+ if ( nEqualSignPos == 0 || nEqualSignPos == std::u16string_view::npos )
{
OSL_FAIL( "lcl_extractCompDesc: invalid map file entry - unexpected pos of '='" );
return false;
}
- o_rStorName = i_rIniLine.copy( 0, nEqualSignPos );
+ o_rStorName = i_rIniLine.substr( 0, nEqualSignPos );
- const sal_Int32 nCommaPos = i_rIniLine.lastIndexOf( ',' );
- if ( nCommaPos != i_rIniLine.getLength() - 2 )
+ const size_t nCommaPos = i_rIniLine.rfind( ',' );
+ if ( nCommaPos != i_rIniLine.size() - 2 )
{
OSL_FAIL( "lcl_extractCompDesc: invalid map file entry - unexpected pos of ','" );
return false;
}
- o_rCompDesc.sName = i_rIniLine.copy( nEqualSignPos + 1, nCommaPos - nEqualSignPos - 1 );
+ o_rCompDesc.sName = i_rIniLine.substr( nEqualSignPos + 1, nCommaPos - nEqualSignPos - 1 );
o_rCompDesc.bForEditing = ( i_rIniLine[ nCommaPos + 1 ] == '1' );
return true;
}
- constexpr OUStringLiteral sRecoveryDataSubStorageName = u"recovery";
+ constexpr OUString sRecoveryDataSubStorageName = u"recovery"_ustr;
- constexpr OUStringLiteral sObjectMapStreamName = u"storage-component-map.ini";
+ constexpr OUString sObjectMapStreamName = u"storage-component-map.ini"_ustr;
void lcl_writeObjectMap_throw( const Reference<XComponentContext> & i_rContext, const Reference< XStorage >& i_rStorage,
const MapStringToCompDesc& i_mapStorageToCompDesc )
@@ -112,12 +113,12 @@ namespace dbaccess
aTextOutput.writeLine();
}
- bool lcl_isSectionStart( const OUString& i_rIniLine, OUString& o_rSectionName )
+ bool lcl_isSectionStart( std::u16string_view i_rIniLine, OUString& o_rSectionName )
{
- const sal_Int32 nLen = i_rIniLine.getLength();
- if ( i_rIniLine.startsWith("[") && i_rIniLine.endsWith("]") )
+ const size_t nLen = i_rIniLine.size();
+ if ( o3tl::starts_with(i_rIniLine, u"[") && o3tl::ends_with(i_rIniLine, u"]") )
{
- o_rSectionName = i_rIniLine.copy( 1, nLen -2 );
+ o_rSectionName = i_rIniLine.substr( 1, nLen -2 );
return true;
}
return false;
@@ -194,20 +195,9 @@ namespace dbaccess
}
}
- // DatabaseDocumentRecovery_Data
- struct DatabaseDocumentRecovery_Data
- {
- const Reference<XComponentContext> aContext;
-
- explicit DatabaseDocumentRecovery_Data( const Reference<XComponentContext> & i_rContext )
- :aContext( i_rContext )
- {
- }
- };
-
// DatabaseDocumentRecovery
DatabaseDocumentRecovery::DatabaseDocumentRecovery( const Reference<XComponentContext> & i_rContext )
- :m_pData( new DatabaseDocumentRecovery_Data( i_rContext ) )
+ : mxContext( i_rContext )
{
}
@@ -243,7 +233,7 @@ namespace dbaccess
for ( auto const & component : aComponents )
{
- SubComponentRecovery aComponentRecovery( m_pData->aContext, xDatabaseUI, component );
+ SubComponentRecovery aComponentRecovery( mxContext, xDatabaseUI, component );
aComponentRecovery.saveToRecoveryStorage( xRecoveryStorage, aMapCompDescs );
}
}
@@ -252,7 +242,7 @@ namespace dbaccess
{
Reference< XStorage > xComponentsStor( xRecoveryStorage->openStorageElement(
SubComponentRecovery::getComponentsStorageName( elem.first ), ElementModes::WRITE | ElementModes::NOCREATE ) );
- lcl_writeObjectMap_throw( m_pData->aContext, xComponentsStor, elem.second );
+ lcl_writeObjectMap_throw( mxContext, xComponentsStor, elem.second );
tools::stor::commitStorageIfWriteable( xComponentsStor );
}
}
@@ -284,7 +274,7 @@ namespace dbaccess
Reference< XStorage > xComponentsStor( xRecoveryStorage->openStorageElement(
SubComponentRecovery::getComponentsStorageName( aKnownType ), ElementModes::READ ) );
- lcl_readObjectMap_throw( m_pData->aContext, xComponentsStor, aMapCompDescs[ aKnownType ] );
+ lcl_readObjectMap_throw( mxContext, xComponentsStor, aMapCompDescs[ aKnownType ] );
xComponentsStor->dispose();
}
@@ -318,7 +308,7 @@ namespace dbaccess
// recover the single component
Reference< XStorage > xCompStor( xComponentsStor->openStorageElement( elem.first, ElementModes::READ ) );
- SubComponentRecovery aComponentRecovery( m_pData->aContext, xDocumentUI, eComponentType );
+ SubComponentRecovery aComponentRecovery( mxContext, xDocumentUI, eComponentType );
Reference< XComponent > xSubComponent( aComponentRecovery.recoverFromStorage( xCompStor, sComponentName, elem.second.bForEditing ) );
// at the moment, we only store, during session save, sub components which are modified. So, set this
diff --git a/dbaccess/source/core/recovery/settingsimport.cxx b/dbaccess/source/core/recovery/settingsimport.cxx
index 2353202681c4..00db4ddf3bab 100644
--- a/dbaccess/source/core/recovery/settingsimport.cxx
+++ b/dbaccess/source/core/recovery/settingsimport.cxx
@@ -19,7 +19,7 @@
#include "settingsimport.hxx"
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <sal/log.hxx>
#include <sax/tools/converter.hxx>
#include <xmloff/xmltoken.hxx>
@@ -139,7 +139,7 @@ namespace dbaccess
o_rValue.clear();
// the characters building up th evalue
- const OUString sValue = getAccumulatedCharacters().toString();
+ std::u16string_view sValue = getAccumulatedCharacters();
const OUString& rItemType( getItemType() );
ENSURE_OR_RETURN_VOID( !rItemType.isEmpty(), "no item type -> no item value" );
@@ -170,7 +170,7 @@ namespace dbaccess
}
else if ( ::xmloff::token::IsXMLToken( rItemType, ::xmloff::token::XML_STRING ) )
{
- o_rValue <<= sValue;
+ o_rValue <<= OUString(sValue);
}
else
{
diff --git a/dbaccess/source/core/recovery/storagestream.cxx b/dbaccess/source/core/recovery/storagestream.cxx
index 2831f406bbf7..613bfb729903 100644
--- a/dbaccess/source/core/recovery/storagestream.cxx
+++ b/dbaccess/source/core/recovery/storagestream.cxx
@@ -21,13 +21,12 @@
#include <com/sun/star/embed/ElementModes.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaccess
{
using ::com::sun::star::uno::Reference;
- using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::uno::UNO_SET_THROW;
using ::com::sun::star::embed::XStorage;
using ::com::sun::star::io::XStream;
diff --git a/dbaccess/source/core/recovery/storagetextstream.cxx b/dbaccess/source/core/recovery/storagetextstream.cxx
index 32f68da9a087..a60890fa8555 100644
--- a/dbaccess/source/core/recovery/storagetextstream.cxx
+++ b/dbaccess/source/core/recovery/storagetextstream.cxx
@@ -28,15 +28,8 @@ namespace dbaccess
using ::com::sun::star::uno::XComponentContext;
using ::com::sun::star::embed::XStorage;
using ::com::sun::star::io::TextOutputStream;
- using ::com::sun::star::io::XTextOutputStream2;
- // StorageTextOutputStream_Data
- struct StorageTextOutputStream_Data
- {
- Reference< XTextOutputStream2 > xTextOutput;
- };
-
- constexpr OUStringLiteral sLineFeed = u"\n";
+ constexpr OUString sLineFeed = u"\n"_ustr;
// StorageTextOutputStream
StorageTextOutputStream::StorageTextOutputStream( const Reference<XComponentContext>& i_rContext,
@@ -44,11 +37,10 @@ namespace dbaccess
const OUString& i_rStreamName
)
:StorageOutputStream( i_rParentStorage, i_rStreamName )
- ,m_pData( new StorageTextOutputStream_Data )
{
- m_pData->xTextOutput = TextOutputStream::create( i_rContext );
- m_pData->xTextOutput->setEncoding( "UTF-8" );
- m_pData->xTextOutput->setOutputStream( getOutputStream() );
+ mxTextOutput = TextOutputStream::create( i_rContext );
+ mxTextOutput->setEncoding( "UTF-8" );
+ mxTextOutput->setOutputStream( getOutputStream() );
}
StorageTextOutputStream::~StorageTextOutputStream()
@@ -57,13 +49,13 @@ namespace dbaccess
void StorageTextOutputStream::writeLine( const OUString& i_rLine )
{
- m_pData->xTextOutput->writeString( i_rLine );
- m_pData->xTextOutput->writeString( sLineFeed );
+ mxTextOutput->writeString( i_rLine );
+ mxTextOutput->writeString( sLineFeed );
}
void StorageTextOutputStream::writeLine()
{
- m_pData->xTextOutput->writeString( sLineFeed );
+ mxTextOutput->writeString( sLineFeed );
}
} // namespace dbaccess
diff --git a/dbaccess/source/core/recovery/storagetextstream.hxx b/dbaccess/source/core/recovery/storagetextstream.hxx
index 46c3e5b2ee26..31bef3d83bd8 100644
--- a/dbaccess/source/core/recovery/storagetextstream.hxx
+++ b/dbaccess/source/core/recovery/storagetextstream.hxx
@@ -23,13 +23,12 @@
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <memory>
+namespace com::sun::star::io { class XTextOutputStream2; }
namespace dbaccess
{
// StorageTextStream
- struct StorageTextOutputStream_Data;
class StorageTextOutputStream : public StorageOutputStream
{
public:
@@ -44,8 +43,8 @@ namespace dbaccess
void writeLine();
private:
- std::unique_ptr< StorageTextOutputStream_Data > m_pData;
- };
+ css::uno::Reference< css::io::XTextOutputStream2 > mxTextOutput;
+ };
} // namespace dbaccess
diff --git a/dbaccess/source/core/recovery/storagexmlstream.cxx b/dbaccess/source/core/recovery/storagexmlstream.cxx
index e76dabefec0e..e828ac73d38d 100644
--- a/dbaccess/source/core/recovery/storagexmlstream.cxx
+++ b/dbaccess/source/core/recovery/storagexmlstream.cxx
@@ -25,10 +25,7 @@
#include <com/sun/star/xml/sax/Writer.hpp>
#include <rtl/ref.hxx>
-#include <tools/diagnose_ex.h>
-#include <xmloff/attrlist.hxx>
-
-#include <stack>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaccess
{
@@ -43,28 +40,19 @@ namespace dbaccess
using ::com::sun::star::xml::sax::Parser;
using ::com::sun::star::xml::sax::InputSource;
- // StorageXMLOutputStream_Data
- struct StorageXMLOutputStream_Data
- {
- Reference< XDocumentHandler > xHandler;
- std::stack< OUString > aElements;
- ::rtl::Reference< SvXMLAttributeList > xAttributes;
- };
-
// StorageXMLOutputStream
StorageXMLOutputStream::StorageXMLOutputStream( const Reference<XComponentContext>& i_rContext,
const Reference< XStorage >& i_rParentStorage,
const OUString& i_rStreamName )
:StorageOutputStream( i_rParentStorage, i_rStreamName )
- ,m_pData( new StorageXMLOutputStream_Data )
{
const Reference< XWriter > xSaxWriter = Writer::create( i_rContext );
xSaxWriter->setOutputStream( getOutputStream() );
- m_pData->xHandler.set( xSaxWriter, UNO_QUERY_THROW );
- m_pData->xHandler->startDocument();
+ mxHandler.set( xSaxWriter, UNO_QUERY_THROW );
+ mxHandler->startDocument();
- m_pData->xAttributes = new SvXMLAttributeList;
+ mxAttributes = new comphelper::AttributeList;
}
StorageXMLOutputStream::~StorageXMLOutputStream()
@@ -73,48 +61,48 @@ namespace dbaccess
void StorageXMLOutputStream::close()
{
- ENSURE_OR_RETURN_VOID( m_pData->xHandler.is(), "illegal document handler" );
- m_pData->xHandler->endDocument();
+ ENSURE_OR_RETURN_VOID( mxHandler.is(), "illegal document handler" );
+ mxHandler->endDocument();
// do not call the base class, it would call closeOutput on the output stream, which is already done by
// endDocument
}
void StorageXMLOutputStream::addAttribute( const OUString& i_rName, const OUString& i_rValue ) const
{
- m_pData->xAttributes->AddAttribute( i_rName, i_rValue );
+ mxAttributes->AddAttribute( i_rName, i_rValue );
}
- void StorageXMLOutputStream::startElement( const OUString& i_rElementName ) const
+ void StorageXMLOutputStream::startElement( const OUString& i_rElementName )
{
- ENSURE_OR_RETURN_VOID( m_pData->xHandler.is(), "no document handler" );
+ ENSURE_OR_RETURN_VOID( mxHandler.is(), "no document handler" );
- m_pData->xHandler->startElement( i_rElementName, m_pData->xAttributes );
- m_pData->xAttributes = new SvXMLAttributeList;
- m_pData->aElements.push( i_rElementName );
+ mxHandler->startElement( i_rElementName, mxAttributes );
+ mxAttributes = new comphelper::AttributeList;
+ maElements.push( i_rElementName );
}
- void StorageXMLOutputStream::endElement() const
+ void StorageXMLOutputStream::endElement()
{
- ENSURE_OR_RETURN_VOID( m_pData->xHandler.is(), "no document handler" );
- ENSURE_OR_RETURN_VOID( !m_pData->aElements.empty(), "no element on the stack" );
+ ENSURE_OR_RETURN_VOID( mxHandler.is(), "no document handler" );
+ ENSURE_OR_RETURN_VOID( !maElements.empty(), "no element on the stack" );
- const OUString sElementName( m_pData->aElements.top() );
- m_pData->xHandler->endElement( sElementName );
- m_pData->aElements.pop();
+ const OUString sElementName( maElements.top() );
+ mxHandler->endElement( sElementName );
+ maElements.pop();
}
void StorageXMLOutputStream::ignorableWhitespace( const OUString& i_rWhitespace ) const
{
- ENSURE_OR_RETURN_VOID( m_pData->xHandler.is(), "no document handler" );
+ ENSURE_OR_RETURN_VOID( mxHandler.is(), "no document handler" );
- m_pData->xHandler->ignorableWhitespace( i_rWhitespace );
+ mxHandler->ignorableWhitespace( i_rWhitespace );
}
void StorageXMLOutputStream::characters( const OUString& i_rCharacters ) const
{
- ENSURE_OR_RETURN_VOID( m_pData->xHandler.is(), "no document handler" );
+ ENSURE_OR_RETURN_VOID( mxHandler.is(), "no document handler" );
- m_pData->xHandler->characters( i_rCharacters );
+ mxHandler->characters( i_rCharacters );
}
// StorageXMLInputStream
diff --git a/dbaccess/source/core/recovery/storagexmlstream.hxx b/dbaccess/source/core/recovery/storagexmlstream.hxx
index fd762ae05dc8..8a340b6fea0c 100644
--- a/dbaccess/source/core/recovery/storagexmlstream.hxx
+++ b/dbaccess/source/core/recovery/storagexmlstream.hxx
@@ -25,14 +25,13 @@
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-
-#include <memory>
+#include <comphelper/attributelist.hxx>
+#include <rtl/ref.hxx>
+#include <stack>
namespace dbaccess
{
- // StorageXMLOutputStream
- struct StorageXMLOutputStream_Data;
class StorageXMLOutputStream : public StorageOutputStream
{
public:
@@ -47,8 +46,8 @@ namespace dbaccess
void addAttribute( const OUString& i_rName, const OUString& i_rValue ) const;
- void startElement( const OUString& i_rElementName ) const;
- void endElement() const;
+ void startElement( const OUString& i_rElementName );
+ void endElement();
void ignorableWhitespace( const OUString& i_rWhitespace ) const;
void characters( const OUString& i_rCharacters ) const;
@@ -58,7 +57,9 @@ namespace dbaccess
StorageXMLOutputStream& operator=( const StorageXMLOutputStream& ) = delete;
private:
- std::unique_ptr< StorageXMLOutputStream_Data > m_pData;
+ css::uno::Reference< css::xml::sax::XDocumentHandler > mxHandler;
+ std::stack< OUString > maElements;
+ ::rtl::Reference<comphelper::AttributeList> mxAttributes;
};
class StorageXMLInputStream
diff --git a/dbaccess/source/core/recovery/subcomponentloader.cxx b/dbaccess/source/core/recovery/subcomponentloader.cxx
index 3393c3d13d08..a416b997fa38 100644
--- a/dbaccess/source/core/recovery/subcomponentloader.cxx
+++ b/dbaccess/source/core/recovery/subcomponentloader.cxx
@@ -22,7 +22,7 @@
#include <com/sun/star/ucb/Command.hpp>
#include <com/sun/star/frame/XController2.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaccess
{
diff --git a/dbaccess/source/core/recovery/subcomponentrecovery.cxx b/dbaccess/source/core/recovery/subcomponentrecovery.cxx
index e7ffffd61452..3a7a30d016f0 100644
--- a/dbaccess/source/core/recovery/subcomponentrecovery.cxx
+++ b/dbaccess/source/core/recovery/subcomponentrecovery.cxx
@@ -36,7 +36,7 @@
#include <comphelper/namedvaluecollection.hxx>
#include <cppuhelper/implbase.hxx>
#include <connectivity/dbtools.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <sal/log.hxx>
#include <xmloff/XMLSettingsExportContext.hxx>
#include <xmloff/SettingsExportHelper.hxx>
@@ -47,12 +47,10 @@ namespace dbaccess
{
using css::uno::Reference;
- using css::uno::XInterface;
using css::uno::UNO_QUERY;
using css::uno::UNO_QUERY_THROW;
using css::uno::UNO_SET_THROW;
using css::uno::Exception;
- using css::uno::RuntimeException;
using css::uno::Any;
using css::uno::Sequence;
using css::uno::XComponentContext;
@@ -160,8 +158,8 @@ namespace dbaccess
return xCommandProcessor;
}
- constexpr OUStringLiteral sSettingsStreamName = u"settings.xml";
- constexpr OUStringLiteral sCurrentQueryDesignName = u"ooo:current-query-design";
+ constexpr OUString sSettingsStreamName = u"settings.xml"_ustr;
+ constexpr OUString sCurrentQueryDesignName = u"ooo:current-query-design"_ustr;
}
namespace {
@@ -170,7 +168,7 @@ namespace dbaccess
class SettingsExportContext : public ::xmloff::XMLSettingsExportContext
{
public:
- SettingsExportContext( const Reference<XComponentContext>& i_rContext, const StorageXMLOutputStream& i_rDelegator )
+ SettingsExportContext( const Reference<XComponentContext>& i_rContext, StorageXMLOutputStream& i_rDelegator )
:m_rContext( i_rContext )
,m_rDelegator( i_rDelegator )
,m_aNamespace( ::xmloff::token::GetXMLToken( ::xmloff::token::XML_NP_CONFIG ) )
@@ -199,7 +197,7 @@ namespace dbaccess
private:
const Reference<XComponentContext>& m_rContext;
- const StorageXMLOutputStream& m_rDelegator;
+ StorageXMLOutputStream& m_rDelegator;
const OUString m_aNamespace;
};
@@ -480,7 +478,7 @@ namespace dbaccess
StorageXMLOutputStream aDesignOutput( m_rContext, i_rObjectStorage, sSettingsStreamName );
SettingsExportContext aSettingsExportContext( m_rContext, aDesignOutput );
- static const OUStringLiteral sWhitespace( u" " );
+ static constexpr OUString sWhitespace( u" "_ustr );
aDesignOutput.startElement( "office:settings" );
aDesignOutput.ignorableWhitespace( sWhitespace );
diff --git a/dbaccess/source/core/recovery/subcomponentrecovery.hxx b/dbaccess/source/core/recovery/subcomponentrecovery.hxx
index 26b81c63f374..ee41a32dfc89 100644
--- a/dbaccess/source/core/recovery/subcomponentrecovery.hxx
+++ b/dbaccess/source/core/recovery/subcomponentrecovery.hxx
@@ -24,6 +24,7 @@
#include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <utility>
namespace dbaccess
{
@@ -35,10 +36,10 @@ namespace dbaccess
SubComponentRecovery(
const css::uno::Reference< css::uno::XComponentContext >& i_rContext,
const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI >& i_rController,
- const css::uno::Reference< css::lang::XComponent >& i_rComponent )
+ css::uno::Reference< css::lang::XComponent > i_xComponent )
:m_rContext( i_rContext )
,m_xDocumentUI( i_rController, css::uno::UNO_SET_THROW )
- ,m_xComponent( i_rComponent )
+ ,m_xComponent(std::move( i_xComponent ))
,m_eType( UNKNOWN )
,m_aCompDesc()
{
diff --git a/dbaccess/source/core/resource/core_resource.cxx b/dbaccess/source/core/resource/core_resource.cxx
index cecf7d3b4773..fdef07e1f8f8 100644
--- a/dbaccess/source/core/resource/core_resource.cxx
+++ b/dbaccess/source/core/resource/core_resource.cxx
@@ -21,30 +21,14 @@
#include <unotools/resmgr.hxx>
-// ---- needed as long as we have no contexts for components ---
-#include <rtl/instance.hxx>
-
namespace dbaccess
{
- // ResourceManager
- namespace
- {
- // access safety
- struct theResourceManagerMutex : public rtl::Static< osl::Mutex, theResourceManagerMutex > {};
- }
-
- OUString ResourceManager::loadString(const char* pResId)
+ OUString ResourceManager::loadString(TranslateId pResId)
{
return Translate::get(pResId, Translate::Create("dba"));
}
- OUString ResourceManager::loadString(const char* pResId, const char* _pPlaceholderAscii, std::u16string_view _rReplace)
- {
- OUString sString(loadString(pResId));
- return sString.replaceFirst( OUString::createFromAscii(_pPlaceholderAscii), _rReplace );
- }
-
- OUString ResourceManager::loadString(const char* pResId, const char* _pPlaceholderAscii1, std::u16string_view _rReplace1,
+ OUString ResourceManager::loadString(TranslateId pResId, const char* _pPlaceholderAscii1, std::u16string_view _rReplace1,
const char* _pPlaceholderAscii2, std::u16string_view _rReplace2)
{
OUString sString(loadString(pResId));
diff --git a/dbaccess/source/filter/hsqldb/columndef.cxx b/dbaccess/source/filter/hsqldb/columndef.cxx
index 62bd7b541bf1..643e8187627d 100644
--- a/dbaccess/source/filter/hsqldb/columndef.cxx
+++ b/dbaccess/source/filter/hsqldb/columndef.cxx
@@ -20,23 +20,22 @@
#include "columndef.hxx"
#include <com/sun/star/sdbc/DataType.hpp>
+#include <utility>
namespace dbahsql
{
-using namespace css::sdbc;
-
-ColumnDefinition::ColumnDefinition(const OUString& sName, sal_Int32 eType,
- const std::vector<sal_Int32>& aParams, bool bPrimary,
+ColumnDefinition::ColumnDefinition(OUString sName, sal_Int32 eType,
+ std::vector<sal_Int32>&& aParams, bool bPrimary,
sal_Int32 nAutoIncr, bool bNullable, bool bCaseInsensitive,
- const OUString& sDefault)
- : m_sName(sName)
+ OUString sDefault)
+ : m_sName(std::move(sName))
, m_eType(eType)
- , m_aParams(aParams)
+ , m_aParams(std::move(aParams))
, m_bPrimaryKey(bPrimary)
, m_nAutoIncrement(nAutoIncr)
, m_bNullable(bNullable)
, m_bCaseInsensitive(bCaseInsensitive)
- , m_sDefaultValue(sDefault)
+ , m_sDefaultValue(std::move(sDefault))
{
}
}
diff --git a/dbaccess/source/filter/hsqldb/columndef.hxx b/dbaccess/source/filter/hsqldb/columndef.hxx
index faad744c554e..4ac3532a3454 100644
--- a/dbaccess/source/filter/hsqldb/columndef.hxx
+++ b/dbaccess/source/filter/hsqldb/columndef.hxx
@@ -28,9 +28,9 @@ private:
OUString m_sDefaultValue;
public:
- ColumnDefinition(const OUString& sName, sal_Int32 eType, const std::vector<sal_Int32>& aParams,
+ ColumnDefinition(OUString sName, sal_Int32 eType, std::vector<sal_Int32>&& aParams,
bool bPrimary = false, sal_Int32 nAutoIncr = -1, bool bNullable = true,
- bool bCaseInsensitive = false, const OUString& sDefault = OUString{});
+ bool bCaseInsensitive = false, OUString sDefault = OUString{});
OUString const& getName() const { return m_sName; }
sal_Int32 getDataType() const { return m_eType; }
diff --git a/dbaccess/source/filter/hsqldb/createparser.cxx b/dbaccess/source/filter/hsqldb/createparser.cxx
index 9aad116535fb..360741ce0b28 100644
--- a/dbaccess/source/filter/hsqldb/createparser.cxx
+++ b/dbaccess/source/filter/hsqldb/createparser.cxx
@@ -19,6 +19,7 @@
#include <comphelper/string.hxx>
#include <sal/log.hxx>
+#include <o3tl/string_view.hxx>
#include "createparser.hxx"
#include "utils.hxx"
#include <com/sun/star/sdbc/DataType.hpp>
@@ -30,16 +31,17 @@ namespace
{
/// Returns substring of sSql from the first occurrence of '(' until the
/// last occurrence of ')' (excluding the parenthesis)
-OUString lcl_getColumnPart(const OUString& sSql)
+std::u16string_view lcl_getColumnPart(std::u16string_view sSql)
{
- sal_Int32 nBeginIndex = sSql.indexOf("(") + 1;
- if (nBeginIndex < 0)
+ size_t nBeginIndex = sSql.find('(');
+ if (nBeginIndex == std::u16string_view::npos)
{
SAL_WARN("dbaccess", "No column definitions found");
- return OUString();
+ return std::u16string_view();
}
- sal_Int32 nCount = sSql.lastIndexOf(")") - nBeginIndex;
- return sSql.copy(nBeginIndex, nCount);
+ sal_Int32 nCount = sSql.rfind(')') - nBeginIndex - 1;
+ auto sPart = sSql.substr(nBeginIndex + 1, nCount);
+ return sPart;
}
/// Constructs a vector of strings that represents the definitions of each
@@ -47,7 +49,7 @@ OUString lcl_getColumnPart(const OUString& sSql)
///
/// @param sColumnPart part of the create statement inside the parenthesis
/// containing the column definitions
-std::vector<OUString> lcl_splitColumnPart(const OUString& sColumnPart)
+std::vector<OUString> lcl_splitColumnPart(std::u16string_view sColumnPart)
{
std::vector<OUString> sParts = string::split(sColumnPart, sal_Unicode(u','));
std::vector<OUString> sReturn;
@@ -67,10 +69,11 @@ std::vector<OUString> lcl_splitColumnPart(const OUString& sColumnPart)
return sReturn;
}
-sal_Int32 lcl_getAutoIncrementDefault(const OUString& sColumnDef)
+sal_Int32 lcl_getAutoIncrementDefault(std::u16string_view sColumnDef)
{
// TODO what if there are more spaces?
- if (sColumnDef.indexOf("GENERATED BY DEFAULT AS IDENTITY") > 0)
+ size_t nPos = sColumnDef.find(u"GENERATED BY DEFAULT AS IDENTITY");
+ if (nPos != std::u16string_view::npos && nPos > 0)
{
// TODO parse starting sequence stated by "START WITH"
return 0;
@@ -78,24 +81,34 @@ sal_Int32 lcl_getAutoIncrementDefault(const OUString& sColumnDef)
return -1;
}
-OUString lcl_getDefaultValue(const OUString& sColumnDef)
+std::u16string_view lcl_getDefaultValue(std::u16string_view sColumnDef)
{
- constexpr char DEFAULT_KW[] = "DEFAULT";
- auto nDefPos = sColumnDef.indexOf(DEFAULT_KW);
- if (nDefPos > 0 && lcl_getAutoIncrementDefault(sColumnDef) < 0)
+ constexpr std::u16string_view DEFAULT_KW = u"DEFAULT";
+ size_t nDefPos = sColumnDef.find(DEFAULT_KW);
+ if (nDefPos > 0 && nDefPos != std::u16string_view::npos
+ && lcl_getAutoIncrementDefault(sColumnDef) < 0)
{
- const OUString& fromDefault = sColumnDef.copy(nDefPos + sizeof(DEFAULT_KW)).trim();
+ std::u16string_view fromDefault
+ = o3tl::trim(sColumnDef.substr(nDefPos + DEFAULT_KW.size()));
// next word is the value
- auto nNextSpace = fromDefault.indexOf(" ");
- return nNextSpace > 0 ? fromDefault.copy(0, fromDefault.indexOf(" ")) : fromDefault;
+ size_t nNextSpace = fromDefault.find(' ');
+ return (nNextSpace > 0 && nNextSpace != std::u16string_view::npos)
+ ? fromDefault.substr(0, nNextSpace)
+ : fromDefault;
}
- return OUString{};
+ return std::u16string_view();
}
-bool lcl_isNullable(const OUString& sColumnDef) { return sColumnDef.indexOf("NOT NULL") < 0; }
+bool lcl_isNullable(std::u16string_view sColumnDef)
+{
+ return sColumnDef.find(u"NOT NULL") == std::u16string_view::npos;
+}
-bool lcl_isPrimaryKey(const OUString& sColumnDef) { return sColumnDef.indexOf("PRIMARY KEY") >= 0; }
+bool lcl_isPrimaryKey(std::u16string_view sColumnDef)
+{
+ return sColumnDef.find(u"PRIMARY KEY") != std::u16string_view::npos;
+}
sal_Int32 lcl_getDataTypeFromHsql(std::u16string_view sTypeName)
{
@@ -163,15 +176,15 @@ struct ColumnTypeParts
* Separates full type descriptions (e.g. NUMERIC(5,4)) to type name (NUMERIC) and
* parameters (5,4)
*/
-ColumnTypeParts lcl_getColumnTypeParts(const OUString& sFullTypeName)
+ColumnTypeParts lcl_getColumnTypeParts(std::u16string_view sFullTypeName)
{
ColumnTypeParts parts;
- auto nParenPos = sFullTypeName.indexOf("(");
- if (nParenPos > 0)
+ auto nParenPos = sFullTypeName.find('(');
+ if (nParenPos > 0 && nParenPos != std::u16string_view::npos)
{
- parts.typeName = sFullTypeName.copy(0, nParenPos).trim();
- OUString sParamStr
- = sFullTypeName.copy(nParenPos + 1, sFullTypeName.indexOf(")") - nParenPos - 1);
+ parts.typeName = o3tl::trim(sFullTypeName.substr(0, nParenPos));
+ std::u16string_view sParamStr
+ = sFullTypeName.substr(nParenPos + 1, sFullTypeName.find(')') - nParenPos - 1);
auto sParams = string::split(sParamStr, sal_Unicode(u','));
for (const auto& sParam : sParams)
{
@@ -180,7 +193,7 @@ ColumnTypeParts lcl_getColumnTypeParts(const OUString& sFullTypeName)
}
else
{
- parts.typeName = sFullTypeName.trim();
+ parts.typeName = o3tl::trim(sFullTypeName);
lcl_addDefaultParameters(parts.params, lcl_getDataTypeFromHsql(parts.typeName));
}
return parts;
@@ -192,13 +205,13 @@ namespace dbahsql
{
CreateStmtParser::CreateStmtParser() {}
-void CreateStmtParser::parsePrimaryKeys(const OUString& sPrimaryPart)
+void CreateStmtParser::parsePrimaryKeys(std::u16string_view sPrimaryPart)
{
- sal_Int32 nParenPos = sPrimaryPart.indexOf("(");
- if (nParenPos > 0)
+ size_t nParenPos = sPrimaryPart.find('(');
+ if (nParenPos > 0 && nParenPos != std::u16string_view::npos)
{
- OUString sParamStr
- = sPrimaryPart.copy(nParenPos + 1, sPrimaryPart.lastIndexOf(")") - nParenPos - 1);
+ std::u16string_view sParamStr
+ = sPrimaryPart.substr(nParenPos + 1, sPrimaryPart.rfind(')') - nParenPos - 1);
auto sParams = string::split(sParamStr, sal_Unicode(u','));
for (const auto& sParam : sParams)
{
@@ -207,7 +220,7 @@ void CreateStmtParser::parsePrimaryKeys(const OUString& sPrimaryPart)
}
}
-void CreateStmtParser::parseColumnPart(const OUString& sColumnPart)
+void CreateStmtParser::parseColumnPart(std::u16string_view sColumnPart)
{
auto sColumns = lcl_splitColumnPart(sColumnPart);
for (const OUString& sColumn : sColumns)
@@ -232,15 +245,15 @@ void CreateStmtParser::parseColumnPart(const OUString& sColumnPart)
= bIsQuoteUsedForColumnName ? sColumn.indexOf("\"", 1) + 1 : sColumn.indexOf(" ");
OUString rColumnName = sColumn.copy(0, nEndColumnName);
- const OUString& sFromTypeName = sColumn.copy(nEndColumnName).trim();
+ const OUString sFromTypeName(o3tl::trim(sColumn.subView(nEndColumnName)));
// Now let's manage the column type
// search next space to get the whole type name
// eg: INTEGER, VARCHAR(10), DECIMAL(6,3)
auto nNextSpace = sFromTypeName.indexOf(" ");
- OUString sFullTypeName;
+ std::u16string_view sFullTypeName;
if (nNextSpace > 0)
- sFullTypeName = sFromTypeName.copy(0, nNextSpace);
+ sFullTypeName = sFromTypeName.subView(0, nNextSpace);
// perhaps column type corresponds to the last info here
else
sFullTypeName = sFromTypeName;
@@ -253,29 +266,30 @@ void CreateStmtParser::parseColumnPart(const OUString& sColumnPart)
if (isPrimaryKey)
m_PrimaryKeys.push_back(rColumnName);
- const OUString sColumnWithoutName = sColumn.copy(sColumn.indexOf(typeParts.typeName));
+ const std::u16string_view sColumnWithoutName
+ = sColumn.subView(sColumn.indexOf(typeParts.typeName));
ColumnDefinition aColDef(rColumnName, lcl_getDataTypeFromHsql(typeParts.typeName),
- typeParts.params, isPrimaryKey,
+ std::move(typeParts.params), isPrimaryKey,
lcl_getAutoIncrementDefault(sColumnWithoutName),
lcl_isNullable(sColumnWithoutName), bCaseInsensitive,
- lcl_getDefaultValue(sColumnWithoutName));
+ OUString(lcl_getDefaultValue(sColumnWithoutName)));
m_aColumns.push_back(aColDef);
}
}
-void CreateStmtParser::parse(const OUString& sSql)
+void CreateStmtParser::parse(std::u16string_view sSql)
{
// TODO Foreign keys
- if (!sSql.startsWith("CREATE"))
+ if (!o3tl::starts_with(sSql, u"CREATE"))
{
SAL_WARN("dbaccess", "Not a create statement");
return;
}
m_sTableName = utils::getTableNameFromStmt(sSql);
- OUString sColumnPart = lcl_getColumnPart(sSql);
+ std::u16string_view sColumnPart = lcl_getColumnPart(sSql);
parseColumnPart(sColumnPart);
}
diff --git a/dbaccess/source/filter/hsqldb/createparser.hxx b/dbaccess/source/filter/hsqldb/createparser.hxx
index 909b4063ac58..a92f745860d5 100644
--- a/dbaccess/source/filter/hsqldb/createparser.hxx
+++ b/dbaccess/source/filter/hsqldb/createparser.hxx
@@ -23,8 +23,8 @@ private:
OUString m_sTableName;
protected:
- void parseColumnPart(const OUString& sColumnPart);
- void parsePrimaryKeys(const OUString& sPrimaryPart);
+ void parseColumnPart(std::u16string_view sColumnPart);
+ void parsePrimaryKeys(std::u16string_view sPrimaryPart);
public:
CreateStmtParser();
@@ -56,7 +56,7 @@ public:
*
* @param SQL "CREATE" statement
*/
- void parse(const OUString& sSql);
+ void parse(std::u16string_view sSql);
/**
* Recreate the sql statement.
diff --git a/dbaccess/source/filter/hsqldb/fbalterparser.cxx b/dbaccess/source/filter/hsqldb/fbalterparser.cxx
index 024598c0b319..a8948069e4e6 100644
--- a/dbaccess/source/filter/hsqldb/fbalterparser.cxx
+++ b/dbaccess/source/filter/hsqldb/fbalterparser.cxx
@@ -32,15 +32,13 @@ OUString FbAlterStmtParser::compose() const
}
else if (getActionType() == AlterAction::ADD_FOREIGN)
return getStatement(); // do nothing with that
- OUStringBuffer sSql("ALTER TABLE ");
- sSql.append(getTableName());
+ OUStringBuffer sSql("ALTER TABLE " + getTableName());
if (getActionType() == AlterAction::IDENTITY_RESTART)
{
sSql.append(" ALTER COLUMN ");
}
- sSql.append(getColumnName());
- sSql.append(" RESTART WITH ");
+ sSql.append(getColumnName() + " RESTART WITH ");
// Firebird: restart with 0 means the first number is 1, not 0.
sSql.append(getIdentityParam() - 1);
diff --git a/dbaccess/source/filter/hsqldb/fbcreateparser.cxx b/dbaccess/source/filter/hsqldb/fbcreateparser.cxx
index f3399474c272..5d4244f8085b 100644
--- a/dbaccess/source/filter/hsqldb/fbcreateparser.cxx
+++ b/dbaccess/source/filter/hsqldb/fbcreateparser.cxx
@@ -29,12 +29,6 @@ using namespace css::sdbc;
namespace
{
-void lcl_appendWithSpace(OUStringBuffer& sBuff, std::u16string_view sStr)
-{
- sBuff.append(" ");
- sBuff.append(sStr);
-}
-
OUString lcl_DataTypetoFbTypeName(sal_Int32 eType)
{
switch (eType)
@@ -110,8 +104,7 @@ void FbCreateStmtParser::appendPrimaryKeyPart(OUStringBuffer& rSql) const
if (sPrimaryKeys.empty())
return; // no primary key specified
- rSql.append(",");
- rSql.append("PRIMARY KEY(");
+ rSql.append(",PRIMARY KEY(");
auto it = sPrimaryKeys.cbegin();
while (it != sPrimaryKeys.end())
{
@@ -135,16 +128,14 @@ OUString FbCreateStmtParser::compose() const
{
ensureProperTableLengths();
OUStringBuffer sSql(128);
- sSql.append("CREATE TABLE ");
- sSql.append(getTableName());
+ sSql.append("CREATE TABLE " + getTableName() + " ("); // column declaration
- lcl_appendWithSpace(sSql, u"("); // column declaration
auto& rColumns = getColumnDef();
auto columnIter = rColumns.cbegin();
while (columnIter != rColumns.end())
{
- lcl_appendWithSpace(sSql, columnIter->getName());
- lcl_appendWithSpace(sSql, lcl_DataTypetoFbTypeName(columnIter->getDataType()));
+ sSql.append(" " + columnIter->getName() + " "
+ + lcl_DataTypetoFbTypeName(columnIter->getDataType()));
std::vector<sal_Int32> params{ columnIter->getParams() };
@@ -174,32 +165,30 @@ OUString FbCreateStmtParser::compose() const
// special modifiers here, based on type (e.g. charset, subtype)
OUString sModifier = lcl_getTypeModifier(columnIter->getDataType());
if (!sModifier.isEmpty())
- lcl_appendWithSpace(sSql, sModifier);
+ sSql.append(" " + sModifier);
if (columnIter->isAutoIncremental())
{
- lcl_appendWithSpace(sSql, u"GENERATED BY DEFAULT AS IDENTITY (START WITH ");
-
// start with 0:
// HSQLDB: first value will be 0.
// Firebird: first value will be 1.
- sSql.append(columnIter->getStartValue() - 1);
- sSql.append(")");
+ sSql.append(" GENERATED BY DEFAULT AS IDENTITY (START WITH "
+ + OUString::number(columnIter->getStartValue() - 1) + ")");
}
else if (!columnIter->isNullable())
- lcl_appendWithSpace(sSql, u"NOT NULL");
+ sSql.append(" NOT NULL");
if (columnIter->isCaseInsensitive())
- lcl_appendWithSpace(sSql, u"COLLATE UNICODE_CI");
+ sSql.append(" COLLATE UNICODE_CI");
const OUString& sDefaultVal = columnIter->getDefault();
if (!sDefaultVal.isEmpty())
{
- lcl_appendWithSpace(sSql, u"DEFAULT");
+ sSql.append(" DEFAULT ");
if (sDefaultVal.equalsIgnoreAsciiCase("NOW"))
- lcl_appendWithSpace(sSql, u"\'NOW\'"); // Fb likes it single quoted
+ sSql.append("'NOW'"); // Fb likes it single quoted
else
- lcl_appendWithSpace(sSql, sDefaultVal);
+ sSql.append(sDefaultVal);
}
++columnIter;
diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.cxx b/dbaccess/source/filter/hsqldb/hsqlimport.cxx
index 045a32f93ce3..918397da620f 100644
--- a/dbaccess/source/filter/hsqldb/hsqlimport.cxx
+++ b/dbaccess/source/filter/hsqldb/hsqlimport.cxx
@@ -180,9 +180,7 @@ OUString lcl_createInsertStatement(std::u16string_view sTableName,
const std::vector<dbahsql::ColumnDefinition>& rColTypes)
{
assert(rColTypes.size() > 0);
- OUStringBuffer sql("INSERT INTO ");
- sql.append(sTableName);
- sql.append(" (");
+ OUStringBuffer sql(OUString::Concat("INSERT INTO ") + sTableName + " (");
// column names
for (size_t i = 0; i < rColTypes.size(); ++i)
@@ -191,9 +189,7 @@ OUString lcl_createInsertStatement(std::u16string_view sTableName,
if (i < rColTypes.size() - 1)
sql.append(", ");
}
- sql.append(")");
-
- sql.append(" VALUES (");
+ sql.append(") VALUES (");
for (size_t i = 0; i < rColTypes.size(); ++i)
{
sql.append("?");
@@ -267,7 +263,7 @@ void HsqlImporter::parseTableRows(const std::vector<sal_Int32>& rIndexes,
const std::vector<ColumnDefinition>& rColTypes,
const OUString& sTableName)
{
- static constexpr OUStringLiteral BINARY_FILENAME = u"data";
+ static constexpr OUString BINARY_FILENAME = u"data"_ustr;
if (!m_xStorage->hasByName(BINARY_FILENAME))
{
diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.hxx b/dbaccess/source/filter/hsqldb/hsqlimport.hxx
index 7bab53c24b88..13bbcd510442 100644
--- a/dbaccess/source/filter/hsqldb/hsqlimport.hxx
+++ b/dbaccess/source/filter/hsqldb/hsqlimport.hxx
@@ -23,7 +23,7 @@ class Window;
namespace dbahsql
{
-class SAL_DLLPUBLIC_EXPORT HsqlImporter
+class UNLESS_MERGELIBS_MORE(SAL_DLLPUBLIC_EXPORT) HsqlImporter
{
private:
css::uno::Reference<css::sdbc::XConnection>& m_rConnection;
diff --git a/dbaccess/source/filter/hsqldb/parseschema.cxx b/dbaccess/source/filter/hsqldb/parseschema.cxx
index c3b7951a8219..5e512f067920 100644
--- a/dbaccess/source/filter/hsqldb/parseschema.cxx
+++ b/dbaccess/source/filter/hsqldb/parseschema.cxx
@@ -33,6 +33,7 @@
#include <comphelper/string.hxx>
#include <sal/log.hxx>
#include <connectivity/dbexception.hxx>
+#include <utility>
namespace
{
@@ -46,8 +47,8 @@ private:
OUString m_sql;
public:
- IndexStmtParser(const OUString& sSql)
- : m_sql(sSql)
+ IndexStmtParser(OUString sSql)
+ : m_sql(std::move(sSql))
{
}
@@ -60,9 +61,14 @@ public:
{
assert(isIndexStatement());
- OUString sIndexPart = m_sql.copy(m_sql.indexOf("INDEX") + 5);
- sal_Int32 nQuotePos = sIndexPart.indexOf("'") + 1;
- OUString sIndexNums = sIndexPart.copy(nQuotePos, sIndexPart.lastIndexOf("'") - nQuotePos);
+ std::u16string_view sIndexPart = m_sql.subView(m_sql.indexOf("INDEX") + 5);
+ size_t nQuotePos = sIndexPart.find('\'');
+ if (nQuotePos == std::u16string_view::npos)
+ nQuotePos = 0;
+ else
+ ++nQuotePos;
+ std::u16string_view sIndexNums
+ = sIndexPart.substr(nQuotePos, sIndexPart.rfind('\'') - nQuotePos);
std::vector<OUString> sIndexes = string::split(sIndexNums, u' ');
IndexVector indexes;
@@ -112,7 +118,7 @@ void SchemaParser::parseSchema()
{
assert(m_rStorage);
- static constexpr OUStringLiteral SCHEMA_FILENAME = u"script";
+ static constexpr OUString SCHEMA_FILENAME = u"script"_ustr;
if (!m_rStorage->hasByName(SCHEMA_FILENAME))
{
SAL_WARN("dbaccess", "script file does not exist in storage during hsqldb import");
@@ -176,8 +182,8 @@ std::vector<ColumnDefinition> SchemaParser::getTableColumnTypes(const OUString&
{
if (m_ColumnTypes.count(sTableName) < 1)
{
- static constexpr OUStringLiteral NOT_EXIST
- = u"Internal error while getting column information of table";
+ static constexpr OUString NOT_EXIST
+ = u"Internal error while getting column information of table"_ustr;
SAL_WARN("dbaccess", NOT_EXIST << ". Table name is: " << sTableName);
dbtools::throwGenericSQLException(NOT_EXIST, ::comphelper::getProcessComponentContext());
}
diff --git a/dbaccess/source/filter/hsqldb/rowinputbinary.cxx b/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
index 5ded17936c38..7aa11ed5f49c 100644
--- a/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
+++ b/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
@@ -90,9 +90,8 @@ OUString lcl_double_dabble(const std::vector<sal_uInt8>& bytes)
RTL_TEXTENCODING_UTF8);
}
-OUString lcl_makeStringFromBigint(const std::vector<sal_uInt8>& bytes)
+OUString lcl_makeStringFromBigint(std::vector<sal_uInt8>&& aBytes)
{
- std::vector<sal_uInt8> aBytes{ bytes };
OUStringBuffer sRet;
// two's complement
@@ -116,11 +115,11 @@ OUString lcl_makeStringFromBigint(const std::vector<sal_uInt8>& bytes)
return sRet.makeStringAndClear();
}
-OUString lcl_putDot(const OUString& sNum, sal_Int32 nScale)
+OUString lcl_putDot(std::u16string_view sNum, sal_Int32 nScale)
{
// e.g. sNum = "0", nScale = 2 -> "0.00"
OUStringBuffer sBuf{ sNum };
- sal_Int32 nNullsToAppend = nScale - sNum.getLength() + 1;
+ sal_Int32 nNullsToAppend = nScale - sNum.size() + 1;
for (sal_Int32 i = 0; i < nNullsToAppend; ++i)
sBuf.insert(0, "0");
@@ -166,9 +165,8 @@ OUString HsqlRowInputStream::readUTF(sal_Int32 nUTFLen)
sal_Int32 nStrLen = 0;
while (nCount < nUTFLen)
{
- unsigned char cIn = 0;
- m_pStream->ReadUChar(cIn);
- sal_uInt8 c = reinterpret_cast<sal_uInt8&>(cIn);
+ sal_uInt8 c = 0;
+ m_pStream->ReadUChar(c);
sal_uInt8 char2, char3;
switch (c >> 4)
{
@@ -194,8 +192,7 @@ OUString HsqlRowInputStream::readUTF(sal_Int32 nUTFLen)
throw WrongFormatException();
}
- m_pStream->ReadUChar(cIn);
- char2 = reinterpret_cast<sal_uInt8&>(cIn);
+ m_pStream->ReadUChar(char2);
if ((char2 & 0xC0) != 0x80)
{
throw WrongFormatException();
@@ -212,10 +209,8 @@ OUString HsqlRowInputStream::readUTF(sal_Int32 nUTFLen)
throw WrongFormatException();
}
- m_pStream->ReadUChar(cIn);
- char2 = reinterpret_cast<sal_uInt8&>(cIn);
- m_pStream->ReadUChar(cIn);
- char3 = reinterpret_cast<sal_uInt8&>(cIn);
+ m_pStream->ReadUChar(char2);
+ m_pStream->ReadUChar(char3);
if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80))
{
@@ -235,9 +230,8 @@ OUString HsqlRowInputStream::readUTF(sal_Int32 nUTFLen)
bool HsqlRowInputStream::checkNull()
{
- unsigned char cIn = 0;
- m_pStream->ReadUChar(cIn);
- sal_uInt8 nNull = reinterpret_cast<sal_uInt8&>(cIn);
+ sal_uInt8 nNull = 0;
+ m_pStream->ReadUChar(nNull);
return nNull == 0;
}
@@ -250,7 +244,7 @@ std::vector<Any> HsqlRowInputStream::readOneRow(const std::vector<ColumnDefiniti
{
if (checkNull())
{
- aData.push_back(Any());
+ aData.emplace_back();
continue;
}
@@ -263,28 +257,28 @@ std::vector<Any> HsqlRowInputStream::readOneRow(const std::vector<ColumnDefiniti
case DataType::CHAR:
case DataType::VARCHAR:
case DataType::LONGVARCHAR:
- aData.push_back(makeAny(readString()));
+ aData.emplace_back(readString());
break;
case DataType::TINYINT:
case DataType::SMALLINT:
{
sal_Int16 value = 0;
m_pStream->ReadInt16(value);
- aData.push_back(makeAny(value));
+ aData.emplace_back(value);
}
break;
case DataType::INTEGER:
{
sal_Int32 value = 0;
m_pStream->ReadInt32(value);
- aData.push_back(makeAny(value));
+ aData.emplace_back(value);
}
break;
case DataType::BIGINT:
{
sal_Int64 value = 0;
m_pStream->ReadInt64(value);
- aData.push_back(makeAny(value));
+ aData.emplace_back(value);
}
break;
case DataType::REAL:
@@ -294,7 +288,7 @@ std::vector<Any> HsqlRowInputStream::readOneRow(const std::vector<ColumnDefiniti
double value = 0;
m_pStream->ReadDouble(value);
// FIXME double is not necessarily 4 bytes
- aData.push_back(makeAny(value));
+ aData.emplace_back(value);
}
break;
case DataType::NUMERIC:
@@ -310,11 +304,9 @@ std::vector<Any> HsqlRowInputStream::readOneRow(const std::vector<ColumnDefiniti
sal_Int32 nScale = 0;
m_pStream->ReadInt32(nScale);
- Sequence<Any> result(2);
- OUString sNum = lcl_makeStringFromBigint(aBytes);
- result[0] <<= lcl_putDot(sNum, nScale);
- result[1] <<= nScale;
- aData.push_back(makeAny(result));
+ OUString sNum = lcl_makeStringFromBigint(std::move(aBytes));
+ Sequence<Any> result{ Any(lcl_putDot(sNum, nScale)), Any(nScale) };
+ aData.emplace_back(result);
}
break;
case DataType::DATE:
@@ -327,7 +319,7 @@ std::vector<Any> HsqlRowInputStream::readOneRow(const std::vector<ColumnDefiniti
css::util::Date loDate(asDate.day(), asDate.month(),
asDate.year()); // day, month, year
- aData.push_back(makeAny(loDate));
+ aData.emplace_back(loDate);
}
break;
case DataType::TIME:
@@ -346,7 +338,7 @@ std::vector<Any> HsqlRowInputStream::readOneRow(const std::vector<ColumnDefiniti
const sal_uInt16 nMins = valueInSecs / 60;
const sal_uInt16 nSecs = valueInSecs % 60;
css::util::Time time((value % 1000) * 1000000, nSecs, nMins, nHours, true);
- aData.push_back(makeAny(time));
+ aData.emplace_back(time);
}
break;
case DataType::TIMESTAMP:
@@ -369,18 +361,18 @@ std::vector<Any> HsqlRowInputStream::readOneRow(const std::vector<ColumnDefiniti
dateTime.Day = asDate.day();
dateTime.Month = asDate.month();
dateTime.Year = asDate.year();
- aData.push_back(makeAny(dateTime));
+ aData.emplace_back(dateTime);
}
break;
case DataType::BOOLEAN:
{
sal_uInt8 nBool = 0;
m_pStream->ReadUChar(nBool);
- aData.push_back(makeAny(static_cast<bool>(nBool)));
+ aData.emplace_back(static_cast<bool>(nBool));
}
break;
case DataType::OTHER:
- aData.push_back(Any{}); // TODO
+ aData.emplace_back(); // TODO
break;
case DataType::BINARY:
case DataType::VARBINARY:
@@ -391,7 +383,7 @@ std::vector<Any> HsqlRowInputStream::readOneRow(const std::vector<ColumnDefiniti
Sequence<sal_Int8> aBytes(nSize);
m_pStream->ReadBytes(aBytes.getArray(), nSize);
- aData.push_back(makeAny(aBytes));
+ aData.emplace_back(aBytes);
}
break;
diff --git a/dbaccess/source/filter/hsqldb/utils.cxx b/dbaccess/source/filter/hsqldb/utils.cxx
index 041df17a700a..d8addd33623e 100644
--- a/dbaccess/source/filter/hsqldb/utils.cxx
+++ b/dbaccess/source/filter/hsqldb/utils.cxx
@@ -21,6 +21,7 @@
#include <comphelper/string.hxx>
#include <comphelper/processfactory.hxx>
#include <connectivity/dbexception.hxx>
+#include <sal/log.hxx>
#include "utils.hxx"
@@ -79,7 +80,7 @@ OUString utils::convertToUTF8(std::string_view original)
if (escape)
{
i -= 2;
- res = res.replaceAt(i, 6, OUString(c));
+ res = res.replaceAt(i, 6, rtl::OUStringChar(c));
++i;
}
}
@@ -87,7 +88,7 @@ OUString utils::convertToUTF8(std::string_view original)
return res;
}
-OUString utils::getTableNameFromStmt(const OUString& sSql)
+OUString utils::getTableNameFromStmt(std::u16string_view sSql)
{
auto stmtComponents = comphelper::string::split(sSql, sal_Unicode(u' '));
assert(stmtComponents.size() > 2);
@@ -103,17 +104,22 @@ OUString utils::getTableNameFromStmt(const OUString& sSql)
// it may contain spaces if it's put into apostrophes.
if (wordIter->indexOf("\"") >= 0)
{
- sal_Int32 nAposBegin = sSql.indexOf("\"");
- sal_Int32 nAposEnd = nAposBegin;
+ size_t nAposBegin = sSql.find('"');
+ size_t nAposEnd = nAposBegin;
bool bProperEndAposFound = false;
while (!bProperEndAposFound)
{
- nAposEnd = sSql.indexOf("\"", nAposEnd + 1);
+ nAposEnd = sSql.find('"', nAposEnd + 1);
+ if (nAposEnd == std::u16string_view::npos)
+ {
+ SAL_WARN("dbaccess", "no matching \"");
+ return OUString();
+ }
if (sSql[nAposEnd - 1] != u'\\')
bProperEndAposFound = true;
}
- OUString result = sSql.copy(nAposBegin, nAposEnd - nAposBegin + 1);
- return result;
+ std::u16string_view result = sSql.substr(nAposBegin, nAposEnd - nAposBegin + 1);
+ return OUString(result);
}
// next word is the table's name
@@ -125,9 +131,9 @@ OUString utils::getTableNameFromStmt(const OUString& sSql)
return *wordIter;
}
-void utils::ensureFirebirdTableLength(const OUString& sName)
+void utils::ensureFirebirdTableLength(std::u16string_view sName)
{
- if (sName.getLength() > 30) // Firebird limitation
+ if (sName.size() > 30) // Firebird limitation
{
static constexpr OUStringLiteral NAME_TOO_LONG
= u"Firebird 3 doesn't support object (table, field) names "
diff --git a/dbaccess/source/filter/hsqldb/utils.hxx b/dbaccess/source/filter/hsqldb/utils.hxx
index b8ed1a222c4c..ed5fb8a1e380 100644
--- a/dbaccess/source/filter/hsqldb/utils.hxx
+++ b/dbaccess/source/filter/hsqldb/utils.hxx
@@ -19,9 +19,9 @@ namespace dbahsql::utils
{
OUString convertToUTF8(std::string_view original);
-OUString getTableNameFromStmt(const OUString& sSql);
+OUString getTableNameFromStmt(std::u16string_view sSql);
-void ensureFirebirdTableLength(const OUString& sName);
+void ensureFirebirdTableLength(std::u16string_view sName);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx
index 0f0674d2c038..3942dab26801 100644
--- a/dbaccess/source/filter/xml/dbloader2.cxx
+++ b/dbaccess/source/filter/xml/dbloader2.cxx
@@ -52,8 +52,9 @@
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <sfx2/docfile.hxx>
+#include <unotools/fcm.hxx>
#include <unotools/moduleoptions.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <vcl/svapp.hxx>
using namespace ::ucbhelper;
@@ -64,7 +65,6 @@ using namespace ::com::sun::star::io;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::document;
using namespace ::com::sun::star::sdb;
@@ -138,8 +138,8 @@ OUString SAL_CALL DBTypeDetection::detect( css::uno::Sequence< css::beans::Prope
{
// After fixing of the i88522 issue ( use the new file locking for database files ) the stream from the type detection can be used further
// for now the file should be reopened to have read/write access
- aMedia.remove( OUString( "InputStream" ) );
- aMedia.remove( OUString( "Stream" ) );
+ aMedia.remove( "InputStream" );
+ aMedia.remove( "Stream" );
aMedia >>= Descriptor;
try
{
@@ -374,7 +374,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU
else
{
::comphelper::NamedValueCollection aCreationArgs;
- aCreationArgs.put( OUString(INFO_POOLURL), sSalvagedURL );
+ aCreationArgs.put( INFO_POOLURL, sSalvagedURL );
xDocumentDataSource.set( xDatabaseContext->createInstanceWithArguments( aCreationArgs.getWrappedNamedValues() ), UNO_QUERY_THROW );
}
@@ -447,11 +447,8 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU
Reference< XModel2 > xModel2( xModel, UNO_QUERY_THROW );
Reference< XController2 > xController( xModel2->createViewController( sViewName, Sequence< PropertyValue >(), rFrame ), UNO_SET_THROW );
- xController->attachModel( xModel );
- xModel->connectController( xController );
- rFrame->setComponent( xController->getComponentWindow(), xController );
- xController->attachFrame( rFrame );
- xModel->setCurrentController( xController );
+ // introduce model/view/controller to each other
+ utl::ConnectFrameControllerModel(rFrame, xController, xModel);
bSuccess = true;
}
@@ -474,7 +471,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU
{
NamedDatabaseObject aSelection;
aSelection.Type = nInitialSelection;
- xDocView->select( makeAny( aSelection ) );
+ xDocView->select( Any( aSelection ) );
}
}
diff --git a/dbaccess/source/filter/xml/xmlAutoStyle.cxx b/dbaccess/source/filter/xml/xmlAutoStyle.cxx
index 99101567111a..82bcab3620ea 100644
--- a/dbaccess/source/filter/xml/xmlAutoStyle.cxx
+++ b/dbaccess/source/filter/xml/xmlAutoStyle.cxx
@@ -24,10 +24,9 @@
namespace dbaxml
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::xml::sax;
void OXMLAutoStylePoolP::exportStyleAttributes(
- SvXMLAttributeList& rAttrList,
+ comphelper::AttributeList& rAttrList,
XmlStyleFamily nFamily,
const std::vector< XMLPropertyState >& rProperties,
const SvXMLExportPropertyMapper& rPropExp
diff --git a/dbaccess/source/filter/xml/xmlAutoStyle.hxx b/dbaccess/source/filter/xml/xmlAutoStyle.hxx
index 54748a22c307..d358b50f7230 100644
--- a/dbaccess/source/filter/xml/xmlAutoStyle.hxx
+++ b/dbaccess/source/filter/xml/xmlAutoStyle.hxx
@@ -28,7 +28,7 @@ namespace dbaxml
ODBExport& rODBExport;
virtual void exportStyleAttributes(
- SvXMLAttributeList& rAttrList,
+ comphelper::AttributeList& rAttrList,
XmlStyleFamily nFamily,
const std::vector< XMLPropertyState >& rProperties,
const SvXMLExportPropertyMapper& rPropExp,
diff --git a/dbaccess/source/filter/xml/xmlColumn.cxx b/dbaccess/source/filter/xml/xmlColumn.cxx
index 198a92f76fa4..1afbf9f0f419 100644
--- a/dbaccess/source/filter/xml/xmlColumn.cxx
+++ b/dbaccess/source/filter/xml/xmlColumn.cxx
@@ -25,7 +25,6 @@
#include <com/sun/star/sdbcx/XAppend.hpp>
#include "xmlStyleImport.hxx"
#include <osl/diagnose.h>
-#include <sal/log.hxx>
namespace dbaxml
{
@@ -95,10 +94,10 @@ void OXMLColumn::endFastElement(sal_Int32 )
Reference<XPropertySet> xProp(xFac->createDataDescriptor());
if ( xProp.is() )
{
- xProp->setPropertyValue(PROPERTY_NAME,makeAny(m_sName));
- xProp->setPropertyValue(PROPERTY_HIDDEN,makeAny(m_bHidden));
+ xProp->setPropertyValue(PROPERTY_NAME,Any(m_sName));
+ xProp->setPropertyValue(PROPERTY_HIDDEN,Any(m_bHidden));
if ( !m_sHelpMessage.isEmpty() )
- xProp->setPropertyValue(PROPERTY_HELPTEXT,makeAny(m_sHelpMessage));
+ xProp->setPropertyValue(PROPERTY_HELPTEXT,Any(m_sHelpMessage));
if ( m_aDefaultValue.hasValue() )
xProp->setPropertyValue(PROPERTY_CONTROLDEFAULT,m_aDefaultValue);
diff --git a/dbaccess/source/filter/xml/xmlComponent.cxx b/dbaccess/source/filter/xml/xmlComponent.cxx
index a9ba7a708842..8f219e4d9eae 100644
--- a/dbaccess/source/filter/xml/xmlComponent.cxx
+++ b/dbaccess/source/filter/xml/xmlComponent.cxx
@@ -24,13 +24,12 @@
#include <strings.hxx>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <comphelper/propertysequence.hxx>
namespace dbaxml
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::xml::sax;
@@ -81,7 +80,7 @@ OXMLComponent::OXMLComponent( ODBFilter& rImport
Reference< XMultiServiceFactory > xORB( _xParentContainer, UNO_QUERY_THROW );
Reference< XInterface > xComponent( xORB->createInstanceWithArguments( _sComponentServiceName, aArguments ) );
Reference< XNameContainer > xNameContainer( _xParentContainer, UNO_QUERY_THROW );
- xNameContainer->insertByName( sName, makeAny( xComponent ) );
+ xNameContainer->insertByName( sName, Any( xComponent ) );
}
catch(Exception&)
{
diff --git a/dbaccess/source/filter/xml/xmlConnectionResource.cxx b/dbaccess/source/filter/xml/xmlConnectionResource.cxx
index e5d92a8d0a8e..6e4a006be25b 100644
--- a/dbaccess/source/filter/xml/xmlConnectionResource.cxx
+++ b/dbaccess/source/filter/xml/xmlConnectionResource.cxx
@@ -22,7 +22,7 @@
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlnamespace.hxx>
#include <strings.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaxml
{
@@ -50,7 +50,7 @@ OXMLConnectionResource::OXMLConnectionResource( ODBFilter& rImport,
case XML_ELEMENT(XLINK, XML_HREF):
try
{
- xDataSource->setPropertyValue(PROPERTY_URL,makeAny(aIter.toString()));
+ xDataSource->setPropertyValue(PROPERTY_URL,Any(aIter.toString()));
}
catch(const Exception&)
{
diff --git a/dbaccess/source/filter/xml/xmlDataSource.cxx b/dbaccess/source/filter/xml/xmlDataSource.cxx
index e133d09cbc29..9939a197b1aa 100644
--- a/dbaccess/source/filter/xml/xmlDataSource.cxx
+++ b/dbaccess/source/filter/xml/xmlDataSource.cxx
@@ -27,7 +27,7 @@
#include <xmloff/ProgressBarHelper.hxx>
#include "xmlEnums.hxx"
#include <strings.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include "xmlConnectionData.hxx"
namespace dbaxml
@@ -61,7 +61,7 @@ OXMLDataSource::OXMLDataSource( ODBFilter& rImport,
case XML_CONNECTION_RESOURCE:
try
{
- xDataSource->setPropertyValue(PROPERTY_URL,makeAny(aIter.toString()));
+ xDataSource->setPropertyValue(PROPERTY_URL,Any(aIter.toString()));
}
catch(const Exception&)
{
@@ -71,7 +71,7 @@ OXMLDataSource::OXMLDataSource( ODBFilter& rImport,
case XML_SUPPRESS_VERSION_COLUMNS:
try
{
- xDataSource->setPropertyValue(PROPERTY_SUPPRESSVERSIONCL,makeAny(IsXMLToken(aIter, XML_TRUE)));
+ xDataSource->setPropertyValue(PROPERTY_SUPPRESSVERSIONCL,Any(IsXMLToken(aIter, XML_TRUE)));
bFoundSuppressVersionColumns = true;
}
catch(const Exception&)
@@ -180,7 +180,7 @@ OXMLDataSource::OXMLDataSource( ODBFilter& rImport,
{
try
{
- xDataSource->setPropertyValue(PROPERTY_SUPPRESSVERSIONCL,makeAny(true));
+ xDataSource->setPropertyValue(PROPERTY_SUPPRESSVERSIONCL,Any(true));
}
catch(const Exception&)
{
diff --git a/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx b/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx
index e7362ca5ba77..eefc08e4191a 100644
--- a/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx
+++ b/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx
@@ -22,7 +22,6 @@
#include <xmloff/xmltoken.hxx>
#include <strings.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <sal/log.hxx>
namespace dbaxml
{
diff --git a/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx b/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx
index 525162664865..9402bb399dca 100644
--- a/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx
+++ b/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx
@@ -55,7 +55,7 @@ OXMLDataSourceSetting::OXMLDataSourceSetting( ODBFilter& rImport
case XML_DATA_SOURCE_SETTING_TYPE:
{
// needs to be translated into a css::uno::Type
- static std::map< OUString, css::uno::Type > s_aTypeNameMap = [&]()
+ static std::map< OUString, css::uno::Type > s_aTypeNameMap = []()
{
std::map< OUString, css::uno::Type > tmp;
tmp[GetXMLToken( XML_BOOLEAN)] = cppu::UnoType<bool>::get();
@@ -143,7 +143,7 @@ void OXMLDataSourceSetting::addValue(const OUString& _sValue)
{
sal_Int32 nPos = m_aInfoSequence.getLength();
m_aInfoSequence.realloc(nPos+1);
- m_aInfoSequence[nPos] = aValue;
+ m_aInfoSequence.getArray()[nPos] = aValue;
}
}
diff --git a/dbaccess/source/filter/xml/xmlDocuments.cxx b/dbaccess/source/filter/xml/xmlDocuments.cxx
index 71d5b4589e3a..fa763614c31e 100644
--- a/dbaccess/source/filter/xml/xmlDocuments.cxx
+++ b/dbaccess/source/filter/xml/xmlDocuments.cxx
@@ -19,6 +19,7 @@
#include "xmlDocuments.hxx"
#include "xmlfilter.hxx"
+#include <utility>
#include <xmloff/xmltoken.hxx>
#include <xmloff/ProgressBarHelper.hxx>
#include "xmlQuery.hxx"
@@ -35,23 +36,23 @@ namespace dbaxml
OXMLDocuments::OXMLDocuments( ODBFilter& rImport
,const Reference< XNameAccess >& _xContainer
- ,const OUString& _sCollectionServiceName
- ,const OUString& _sComponentServiceName) :
+ ,OUString _sCollectionServiceName
+ ,OUString _sComponentServiceName) :
SvXMLImportContext( rImport )
,m_xContainer(_xContainer)
- ,m_sCollectionServiceName(_sCollectionServiceName)
- ,m_sComponentServiceName(_sComponentServiceName)
+ ,m_sCollectionServiceName(std::move(_sCollectionServiceName))
+ ,m_sComponentServiceName(std::move(_sComponentServiceName))
{
}
OXMLDocuments::OXMLDocuments( ODBFilter& rImport
,const Reference< XNameAccess >& _xContainer
- ,const OUString& _sCollectionServiceName
+ ,OUString _sCollectionServiceName
) :
SvXMLImportContext( rImport )
,m_xContainer(_xContainer)
- ,m_sCollectionServiceName(_sCollectionServiceName)
+ ,m_sCollectionServiceName(std::move(_sCollectionServiceName))
{
}
diff --git a/dbaccess/source/filter/xml/xmlDocuments.hxx b/dbaccess/source/filter/xml/xmlDocuments.hxx
index c0542dcfb1a3..49c6346aa83e 100644
--- a/dbaccess/source/filter/xml/xmlDocuments.hxx
+++ b/dbaccess/source/filter/xml/xmlDocuments.hxx
@@ -37,13 +37,13 @@ namespace dbaxml
// for forms and reports
OXMLDocuments( ODBFilter& rImport
,const css::uno::Reference< css::container::XNameAccess >& _xContainer
- ,const OUString& _sCollectionServiceName
- ,const OUString& _sComponentServiceName);
+ ,OUString _sCollectionServiceName
+ ,OUString _sComponentServiceName);
// for queries
OXMLDocuments( ODBFilter& rImport
,const css::uno::Reference< css::container::XNameAccess >& _xContainer
- ,const OUString& _sCollectionServiceName = OUString()
+ ,OUString _sCollectionServiceName = OUString()
);
virtual ~OXMLDocuments() override;
diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx
index 1e4f79d4ce44..13d0887b0caa 100644
--- a/dbaccess/source/filter/xml/xmlExport.cxx
+++ b/dbaccess/source/filter/xml/xmlExport.cxx
@@ -20,6 +20,7 @@
#include "xmlExport.hxx"
#include "xmlAutoStyle.hxx"
#include <sax/tools/converter.hxx>
+#include <utility>
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlnamespace.hxx>
#include <xmloff/namespacemap.hxx>
@@ -44,7 +45,7 @@
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <svl/filenotation.hxx>
#include <unotools/pathoptions.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <connectivity/DriversConfig.hxx>
#include <connectivity/dbtools.hxx>
@@ -126,7 +127,7 @@ namespace dbaxml
/** this method is called for every item that has the
MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
virtual void handleSpecialItem(
- SvXMLAttributeList& /*rAttrList*/,
+ comphelper::AttributeList& /*rAttrList*/,
const XMLPropertyState& /*rProperty*/,
const SvXMLUnitConverter& /*rUnitConverter*/,
const SvXMLNamespaceMap& /*rNamespaceMap*/,
@@ -182,27 +183,27 @@ ODBExport::ODBExport(const Reference< XComponentContext >& _rxContext, OUString
GetAutoStylePool()->AddFamily(
XmlStyleFamily::TABLE_TABLE,
- OUString(XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME ),
+ XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME,
m_xExportHelper.get(),
- OUString(XML_STYLE_FAMILY_TABLE_TABLE_STYLES_PREFIX ));
+ XML_STYLE_FAMILY_TABLE_TABLE_STYLES_PREFIX);
GetAutoStylePool()->AddFamily(
XmlStyleFamily::TABLE_COLUMN,
- OUString(XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME ),
+ XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME,
m_xColumnExportHelper.get(),
- OUString(XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_PREFIX ));
+ XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_PREFIX);
GetAutoStylePool()->AddFamily(
XmlStyleFamily::TABLE_CELL,
- OUString(XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME ),
+ XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME,
m_xCellExportHelper.get(),
- OUString(XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX ));
+ XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX);
GetAutoStylePool()->AddFamily(
XmlStyleFamily::TABLE_ROW,
- OUString(XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME ),
+ XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME,
m_xRowExportHelper.get(),
- OUString(XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX ));
+ XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX);
}
void ODBExport::exportDataSource()
@@ -281,15 +282,15 @@ void ODBExport::exportDataSource()
const XMLTokenEnum eAttributeToken;
const ::std::optional< OUString > aXMLDefault;
- PropertyMap( const OUString& _rPropertyName, const XMLTokenEnum _eToken )
- :sPropertyName( _rPropertyName )
+ PropertyMap( OUString _sPropertyName, const XMLTokenEnum _eToken )
+ :sPropertyName(std::move( _sPropertyName ))
,eAttributeToken( _eToken )
,aXMLDefault()
{
}
- PropertyMap( const OUString& _rPropertyName, const XMLTokenEnum _eToken, const OUString& _rDefault )
- :sPropertyName( _rPropertyName )
+ PropertyMap( OUString _sPropertyName, const XMLTokenEnum _eToken, const OUString& _rDefault )
+ :sPropertyName(std::move( _sPropertyName ))
,eAttributeToken( _eToken )
,aXMLDefault( _rDefault )
{
@@ -416,7 +417,7 @@ void ODBExport::exportDataSource()
aSettingsMap.emplace(eToken,sValue);
}
if ( bAutoIncrementEnabled && !(aAutoIncrement.first.isEmpty() && aAutoIncrement.second.isEmpty()) )
- m_aAutoIncrement.reset( new TStringPair(aAutoIncrement));
+ m_oAutoIncrement = aAutoIncrement;
if ( aDelimiter.bUsed )
m_aDelimiter.reset( new TDelimiter( aDelimiter ) );
@@ -560,7 +561,7 @@ void ODBExport::exportConnectionData()
Reference< XPropertySetInfo > xSettingsInfo( xDataSourceSettings->getPropertySetInfo(), UNO_SET_THROW );
- static const OUStringLiteral sPropertyName = u"LocalSocket";
+ static constexpr OUString sPropertyName = u"LocalSocket"_ustr;
if ( xSettingsInfo->hasPropertyByName( sPropertyName ) )
{
OUString sPropertyValue;
@@ -595,7 +596,7 @@ template< typename T > void ODBExport::exportDataSourceSettingsSequence(
css::uno::Sequence<T> anySeq;
bool bSuccess = in->Value >>= anySeq;
assert(bSuccess); (void)bSuccess;
- for (T const & i : anySeq )
+ for (T const& i : anySeq)
{
SvXMLElementExport aDataValue(*this,XML_NAMESPACE_DB, XML_DATA_SOURCE_SETTING_VALUE, true, false);
// (no whitespace inside the tag)
@@ -698,10 +699,10 @@ void ODBExport::exportDelimiter()
void ODBExport::exportAutoIncrement()
{
- if (m_aAutoIncrement)
+ if (m_oAutoIncrement)
{
- AddAttribute(XML_NAMESPACE_DB, XML_ADDITIONAL_COLUMN_STATEMENT,m_aAutoIncrement->second);
- AddAttribute(XML_NAMESPACE_DB, XML_ROW_RETRIEVING_STATEMENT,m_aAutoIncrement->first);
+ AddAttribute(XML_NAMESPACE_DB, XML_ADDITIONAL_COLUMN_STATEMENT,m_oAutoIncrement->second);
+ AddAttribute(XML_NAMESPACE_DB, XML_ROW_RETRIEVING_STATEMENT,m_oAutoIncrement->first);
SvXMLElementExport aElem(*this,XML_NAMESPACE_DB, XML_AUTO_INCREMENT, true, true);
}
}
@@ -839,7 +840,7 @@ void ODBExport::exportTable(XPropertySet* _xProp)
exportFilter(_xProp,PROPERTY_ORDER,XML_ORDER_STATEMENT);
}
-void ODBExport::exportStyleName(XPropertySet* _xProp,SvXMLAttributeList& _rAtt)
+void ODBExport::exportStyleName(XPropertySet* _xProp,comphelper::AttributeList& _rAtt)
{
Reference<XPropertySet> xFind(_xProp);
exportStyleName(XML_STYLE_NAME,xFind,_rAtt,m_aAutoStyleNames);
@@ -847,7 +848,7 @@ void ODBExport::exportStyleName(XPropertySet* _xProp,SvXMLAttributeList& _rAtt)
exportStyleName(XML_DEFAULT_ROW_STYLE_NAME,xFind,_rAtt,m_aRowAutoStyleNames);
}
-void ODBExport::exportStyleName(const ::xmloff::token::XMLTokenEnum _eToken,const uno::Reference<beans::XPropertySet>& _xProp,SvXMLAttributeList& _rAtt,TPropertyStyleMap& _rMap)
+void ODBExport::exportStyleName(const ::xmloff::token::XMLTokenEnum _eToken,const uno::Reference<beans::XPropertySet>& _xProp,comphelper::AttributeList& _rAtt,TPropertyStyleMap& _rMap)
{
TPropertyStyleMap::const_iterator aFind = _rMap.find(_xProp);
if ( aFind != _rMap.end() )
@@ -861,15 +862,15 @@ void ODBExport::exportStyleName(const ::xmloff::token::XMLTokenEnum _eToken,cons
void ODBExport::exportTableName(XPropertySet* _xProp,bool _bUpdate)
{
OUString sValue;
- _xProp->getPropertyValue(_bUpdate ? OUString(PROPERTY_UPDATE_TABLENAME) : OUString(PROPERTY_NAME)) >>= sValue;
+ _xProp->getPropertyValue(_bUpdate ? PROPERTY_UPDATE_TABLENAME : PROPERTY_NAME) >>= sValue;
if ( sValue.isEmpty() )
return;
AddAttribute(XML_NAMESPACE_DB, XML_NAME,sValue);
- _xProp->getPropertyValue(_bUpdate ? OUString(PROPERTY_UPDATE_SCHEMANAME) : OUString(PROPERTY_SCHEMANAME)) >>= sValue;
+ _xProp->getPropertyValue(_bUpdate ? PROPERTY_UPDATE_SCHEMANAME : PROPERTY_SCHEMANAME) >>= sValue;
if ( !sValue.isEmpty() )
AddAttribute(XML_NAMESPACE_DB, XML_SCHEMA_NAME,sValue);
- _xProp->getPropertyValue(_bUpdate ? OUString(PROPERTY_UPDATE_CATALOGNAME) : OUString(PROPERTY_CATALOGNAME)) >>= sValue;
+ _xProp->getPropertyValue(_bUpdate ? PROPERTY_UPDATE_CATALOGNAME : PROPERTY_CATALOGNAME) >>= sValue;
if ( !sValue.isEmpty() )
AddAttribute(XML_NAMESPACE_DB, XML_CATALOG_NAME,sValue);
@@ -910,7 +911,7 @@ void ODBExport::exportColumns(const Reference<XColumnsSupplier>& _xColSup)
if ( aFind != m_aTableDummyColumns.end() )
{
SvXMLElementExport aColumns(*this,XML_NAMESPACE_DB, XML_COLUMNS, true, true);
- rtl::Reference<SvXMLAttributeList> pAtt = new SvXMLAttributeList;
+ rtl::Reference<comphelper::AttributeList> pAtt = new comphelper::AttributeList;
exportStyleName(aFind->second.get(),*pAtt);
AddAttributeList(pAtt);
SvXMLElementExport aColumn(*this,XML_NAMESPACE_DB, XML_COLUMN, true, true);
@@ -928,7 +929,7 @@ void ODBExport::exportColumns(const Reference<XColumnsSupplier>& _xColSup)
Reference<XPropertySet> xProp(xNameAccess->getByName(*pIter),UNO_QUERY);
if ( xProp.is() )
{
- rtl::Reference<SvXMLAttributeList> pAtt = new SvXMLAttributeList;
+ rtl::Reference<comphelper::AttributeList> pAtt = new comphelper::AttributeList;
exportStyleName(xProp.get(),*pAtt);
bool bHidden = getBOOL(xProp->getPropertyValue(PROPERTY_HIDDEN));
@@ -1071,12 +1072,11 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp)
,TExportPropMapperPair(m_xRowExportHelper,TEnumMapperPair(&m_aRowAutoStyleNames,XmlStyleFamily::TABLE_ROW))
};
- std::vector< XMLPropertyState > aPropertyStates;
for (const auto & i : pExportHelper)
{
- aPropertyStates = i.first->Filter(*this, _xProp);
+ std::vector< XMLPropertyState > aPropertyStates = i.first->Filter(*this, _xProp);
if ( !aPropertyStates.empty() )
- i.second.first->emplace( _xProp,GetAutoStylePool()->Add( i.second.second, aPropertyStates ) );
+ i.second.first->emplace( _xProp,GetAutoStylePool()->Add( i.second.second, std::move(aPropertyStates) ) );
}
Reference< XNameAccess > xCollection;
@@ -1148,7 +1148,7 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp)
if ( XmlStyleFamily::TABLE_CELL == i.second.second )
aPropStates.insert( aPropStates.end(), m_aCurrentPropertyStates.begin(), m_aCurrentPropertyStates.end() );
if ( !aPropStates.empty() )
- i.second.first->emplace( _xProp,GetAutoStylePool()->Add( i.second.second, aPropStates ) );
+ i.second.first->emplace( _xProp,GetAutoStylePool()->Add( i.second.second, std::move(aPropStates) ) );
}
}
}
@@ -1195,22 +1195,24 @@ void ODBExport::GetViewSettings(Sequence<PropertyValue>& aProps)
{
sal_Int32 nLength = aProps.getLength();
aProps.realloc(nLength + 1);
- aProps[nLength].Name = "Queries";
+ auto pProps = aProps.getArray();
+ pProps[nLength].Name = "Queries";
Sequence< OUString> aSeq = xCollection->getElementNames();
const OUString* pIter = aSeq.getConstArray();
const OUString* pEnd = pIter + aSeq.getLength();
Sequence<PropertyValue> aQueries(aSeq.getLength());
+ auto aQueriesRange = asNonConstRange(aQueries);
for(sal_Int32 i = 0;pIter != pEnd;++pIter,++i)
{
Reference<XPropertySet> xProp(xCollection->getByName(*pIter),UNO_QUERY);
if ( xProp.is() )
{
- aQueries[i].Name = *pIter;
- aQueries[i].Value = xProp->getPropertyValue(PROPERTY_LAYOUTINFORMATION);
+ aQueriesRange[i].Name = *pIter;
+ aQueriesRange[i].Value = xProp->getPropertyValue(PROPERTY_LAYOUTINFORMATION);
}
}
- aProps[nLength].Value <<= aQueries;
+ pProps[nLength].Value <<= aQueries;
}
catch(const Exception&)
{
@@ -1234,8 +1236,9 @@ void ODBExport::GetConfigurationSettings(Sequence<PropertyValue>& aProps)
if ( aPropValues.hasElements() )
{
aProps.realloc(nLength + 1);
- aProps[nLength].Name = "layout-settings";
- aProps[nLength].Value = aValue;
+ auto pProps = aProps.getArray();
+ pProps[nLength].Name = "layout-settings";
+ pProps[nLength].Value = aValue;
}
}
catch(const Exception&)
diff --git a/dbaccess/source/filter/xml/xmlExport.hxx b/dbaccess/source/filter/xml/xmlExport.hxx
index 7e1d148e197c..fa808eaf6378 100644
--- a/dbaccess/source/filter/xml/xmlExport.hxx
+++ b/dbaccess/source/filter/xml/xmlExport.hxx
@@ -25,6 +25,9 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/io/XActiveDataSource.hpp>
+
+#include <optional>
+#include <utility>
#include <xmloff/maptype.hxx>
#include <xmloff/txtprmap.hxx>
#include <xmloff/xmlexp.hxx>
@@ -43,11 +46,7 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::document;
using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::io;
-using namespace ::com::sun::star::xml::sax;
class ODBExport : public SvXMLExport
@@ -74,15 +73,15 @@ class ODBExport : public SvXMLExport
css::uno::Type Type;
css::uno::Any Value;
- TypedPropertyValue( const OUString& _name, const css::uno::Type& _type, const css::uno::Any& _value )
- :Name( _name )
+ TypedPropertyValue( OUString _name, const css::uno::Type& _type, css::uno::Any _value )
+ :Name(std::move( _name ))
,Type( _type )
- ,Value( _value )
+ ,Value(std::move( _value ))
{
}
};
- std::unique_ptr< TStringPair > m_aAutoIncrement;
+ std::optional< TStringPair > m_oAutoIncrement;
std::unique_ptr< TDelimiter > m_aDelimiter;
std::vector< TypedPropertyValue > m_aDataSourceSettings;
std::vector< XMLPropertyState > m_aCurrentPropertyStates;
@@ -122,8 +121,8 @@ class ODBExport : public SvXMLExport
void exportReports();
void exportQueries(bool _bExportContext);
void exportTables(bool _bExportContext);
- void exportStyleName(XPropertySet* _xProp,SvXMLAttributeList& _rAtt);
- void exportStyleName(const ::xmloff::token::XMLTokenEnum _eToken,const Reference<XPropertySet>& _xProp,SvXMLAttributeList& _rAtt,TPropertyStyleMap& _rMap);
+ void exportStyleName(XPropertySet* _xProp,comphelper::AttributeList& _rAtt);
+ void exportStyleName(const ::xmloff::token::XMLTokenEnum _eToken,const Reference<XPropertySet>& _xProp,comphelper::AttributeList& _rAtt,TPropertyStyleMap& _rMap);
void exportCollection(const Reference< XNameAccess >& _xCollection
,enum ::xmloff::token::XMLTokenEnum _eComponents
,enum ::xmloff::token::XMLTokenEnum _eSubComponents
diff --git a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
index 0ee1445a8699..c54acdd6527f 100644
--- a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
+++ b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
@@ -22,7 +22,7 @@
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlnamespace.hxx>
#include <strings.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <svl/filenotation.hxx>
#include <unotools/pathoptions.hxx>
#include <dsntypes.hxx>
@@ -95,7 +95,7 @@ OXMLFileBasedDatabase::OXMLFileBasedDatabase( ODBFilter& rImport,
OUString sURL = aTypeCollection.getDatasourcePrefixFromMediaType(sMediaType,sFileTypeExtension) + sLocation;
try
{
- xDataSource->setPropertyValue(PROPERTY_URL,makeAny(sURL));
+ xDataSource->setPropertyValue(PROPERTY_URL,Any(sURL));
}
catch(const Exception&)
{
diff --git a/dbaccess/source/filter/xml/xmlHelper.cxx b/dbaccess/source/filter/xml/xmlHelper.cxx
index 38e90e4e9d3a..5386a4036843 100644
--- a/dbaccess/source/filter/xml/xmlHelper.cxx
+++ b/dbaccess/source/filter/xml/xmlHelper.cxx
@@ -32,7 +32,6 @@
namespace dbaxml
{
using namespace ::xmloff::token;
- using namespace ::com::sun::star::awt;
OPropertyHandlerFactory::OPropertyHandlerFactory()
{
@@ -68,12 +67,11 @@ const XMLPropertyHandler* OPropertyHandlerFactory::GetPropertyHandler(sal_Int32
return pHandler;
}
-#define MAP_END() { nullptr, 0, 0, XML_TOKEN_INVALID, 0 , 0, SvtSaveOptions::ODFSVER_010, false}
rtl::Reference < XMLPropertySetMapper > OXMLHelper::GetTableStylesPropertySetMapper( bool bForExport )
{
static const XMLPropertyMapEntry s_aTableStylesProperties[] =
{
- MAP_END()
+ { nullptr }
};
rtl::Reference < XMLPropertyHandlerFactory> xFac = new ::xmloff::OControlPropertyHandlerFactory();
return new XMLPropertySetMapper(s_aTableStylesProperties, xFac, bForExport);
@@ -81,13 +79,14 @@ rtl::Reference < XMLPropertySetMapper > OXMLHelper::GetTableStylesPropertySetMap
rtl::Reference < XMLPropertySetMapper > OXMLHelper::GetColumnStylesPropertySetMapper( bool bForExport )
{
-#define MAP_CONST_COLUMN( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TABLE_COLUMN, context, SvtSaveOptions::ODFSVER_010, false }
static const XMLPropertyMapEntry s_aColumnStylesProperties[] =
{
- MAP_CONST_COLUMN( PROPERTY_WIDTH, XML_NAMESPACE_STYLE, XML_COLUMN_WIDTH, XML_TYPE_MEASURE, 0),
- MAP_CONST_COLUMN( PROPERTY_HIDDEN, XML_NAMESPACE_TABLE, XML_DISPLAY, XML_DB_TYPE_EQUAL|MID_FLAG_SPECIAL_ITEM, CTF_DB_ISVISIBLE ),
- MAP_CONST_COLUMN( PROPERTY_NUMBERFORMAT, XML_NAMESPACE_STYLE, XML_DATA_STYLE_NAME, XML_TYPE_NUMBER|MID_FLAG_SPECIAL_ITEM, CTF_DB_NUMBERFORMAT),
- MAP_END()
+ { PROPERTY_WIDTH, XML_NAMESPACE_STYLE, XML_COLUMN_WIDTH, XML_TYPE_MEASURE|XML_TYPE_PROP_TABLE_COLUMN, 0, SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_HIDDEN, XML_NAMESPACE_TABLE, XML_DISPLAY, XML_DB_TYPE_EQUAL|MID_FLAG_SPECIAL_ITEM|XML_TYPE_PROP_TABLE_COLUMN,
+ CTF_DB_ISVISIBLE, SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_NUMBERFORMAT, XML_NAMESPACE_STYLE, XML_DATA_STYLE_NAME, XML_TYPE_NUMBER|MID_FLAG_SPECIAL_ITEM|XML_TYPE_PROP_TABLE_COLUMN,
+ CTF_DB_NUMBERFORMAT, SvtSaveOptions::ODFSVER_010, false },
+ { nullptr }
};
rtl::Reference < XMLPropertyHandlerFactory> xFac = new OPropertyHandlerFactory();
return new XMLPropertySetMapper(s_aColumnStylesProperties, xFac, bForExport);
@@ -95,40 +94,47 @@ rtl::Reference < XMLPropertySetMapper > OXMLHelper::GetColumnStylesPropertySetMa
rtl::Reference < XMLPropertySetMapper > OXMLHelper::GetCellStylesPropertySetMapper( bool bForExport )
{
-#define MAP_CONST_CELL( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_PARAGRAPH, context, SvtSaveOptions::ODFSVER_010, false }
-#define MAP_CONST_TEXT( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFSVER_010, false }
static const XMLPropertyMapEntry s_aCellStylesProperties[] =
{
- MAP_CONST_CELL( PROPERTY_ALIGN, XML_NAMESPACE_FO, XML_TEXT_ALIGN, XML_TYPE_TEXT_ALIGN, CTF_DB_COLUMN_TEXT_ALIGN),
- MAP_CONST_TEXT( PROPERTY_FONTNAME, XML_NAMESPACE_STYLE, XML_FONT_NAME, XML_TYPE_STRING, 0 ),
- MAP_CONST_TEXT( PROPERTY_TEXTCOLOR, XML_NAMESPACE_FO, XML_COLOR, XML_TYPE_COLOR, 0 ),
- MAP_CONST_TEXT( PROPERTY_TEXTLINECOLOR, XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_COLOR|MID_FLAG_MULTI_PROPERTY, 0 ),
-
- MAP_CONST_TEXT( PROPERTY_TEXTRELIEF, XML_NAMESPACE_STYLE, XML_FONT_RELIEF, XML_TYPE_TEXT_FONT_RELIEF|MID_FLAG_MULTI_PROPERTY, 0 ),
- MAP_CONST_TEXT( PROPERTY_TEXTEMPHASIS, XML_NAMESPACE_STYLE, XML_TEXT_EMPHASIZE, XML_TYPE_CONTROL_TEXT_EMPHASIZE, 0 ),
- MAP_CONST_TEXT( PROPERTY_FONTCHARWIDTH, XML_NAMESPACE_STYLE, XML_FONT_CHAR_WIDTH, XML_TYPE_NUMBER16, 0 ),
- MAP_CONST_TEXT( PROPERTY_FONTCHARSET, XML_NAMESPACE_STYLE, XML_FONT_CHARSET, XML_TYPE_TEXT_FONTENCODING, 0 ),
- MAP_CONST_TEXT( PROPERTY_FONTFAMILY, XML_NAMESPACE_STYLE, XML_FONT_FAMILY_GENERIC, XML_TYPE_TEXT_FONTFAMILY, 0 ),
- MAP_CONST_TEXT( PROPERTY_FONTHEIGHT, XML_NAMESPACE_FO, XML_FONT_SIZE, XML_TYPE_MEASURE16, 0 ),
- MAP_CONST_TEXT( PROPERTY_FONTKERNING, XML_NAMESPACE_STYLE, XML_LETTER_KERNING, XML_TYPE_BOOL, 0 ),
-
- MAP_CONST_TEXT( PROPERTY_FONTORIENTATION, XML_NAMESPACE_STYLE, XML_ROTATION_ANGLE, XML_TYPE_ROTATION_ANGLE, 0 ),
- MAP_CONST_TEXT( PROPERTY_FONTPITCH, XML_NAMESPACE_STYLE, XML_FONT_PITCH, XML_TYPE_TEXT_FONTPITCH, 0 ),
- MAP_CONST_TEXT( PROPERTY_FONTSLANT, XML_NAMESPACE_FO, XML_FONT_STYLE, XML_TYPE_TEXT_POSTURE, 0 ),
- MAP_CONST_TEXT( "CharStrikeout", XML_NAMESPACE_STYLE, XML_TEXT_LINE_THROUGH_STYLE, XML_TYPE_TEXT_CROSSEDOUT_STYLE|MID_FLAG_MERGE_PROPERTY, 0),
- MAP_CONST_TEXT( "CharStrikeout", XML_NAMESPACE_STYLE, XML_TEXT_LINE_THROUGH_TYPE, XML_TYPE_TEXT_CROSSEDOUT_TYPE|MID_FLAG_MERGE_PROPERTY, 0),
- MAP_CONST_TEXT( "CharStrikeout", XML_NAMESPACE_STYLE, XML_TEXT_LINE_THROUGH_WIDTH, XML_TYPE_TEXT_CROSSEDOUT_WIDTH|MID_FLAG_MERGE_PROPERTY, 0),
- MAP_CONST_TEXT( "CharStrikeout", XML_NAMESPACE_STYLE, XML_TEXT_LINE_THROUGH_TEXT, XML_TYPE_TEXT_CROSSEDOUT_TEXT|MID_FLAG_MERGE_PROPERTY, 0),
- MAP_CONST_TEXT( PROPERTY_FONTSTYLENAME, XML_NAMESPACE_STYLE, XML_FONT_STYLE_NAME, XML_TYPE_STRING, 0 ),
- MAP_CONST_TEXT( "CharUnderline", XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_STYLE, XML_TYPE_TEXT_UNDERLINE_STYLE|MID_FLAG_MERGE_PROPERTY, 0 ),
- MAP_CONST_TEXT( "CharUnderline", XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_TYPE, XML_TYPE_TEXT_UNDERLINE_TYPE|MID_FLAG_MERGE_PROPERTY, 0 ),
- MAP_CONST_TEXT( "CharUnderline", XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_WIDTH, XML_TYPE_TEXT_UNDERLINE_WIDTH|MID_FLAG_MERGE_PROPERTY, 0 ),
- MAP_CONST_TEXT( "CharUnderlineColor", XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_COLOR|MID_FLAG_MULTI_PROPERTY, 0 ),
- MAP_CONST_TEXT( "CharUnderlineHasColor", XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_HASCOLOR|MID_FLAG_MERGE_ATTRIBUTE, 0 ),
- MAP_CONST_TEXT( PROPERTY_FONTWEIGHT, XML_NAMESPACE_FO, XML_FONT_WEIGHT, XML_TYPE_TEXT_WEIGHT, 0 ),
- MAP_CONST_TEXT( PROPERTY_FONTWIDTH, XML_NAMESPACE_STYLE, XML_FONT_WIDTH, XML_TYPE_FONT_WIDTH, 0 ),
- MAP_CONST_TEXT( PROPERTY_FONTWORDLINEMODE, XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_MODE, XML_TYPE_TEXT_LINE_MODE|MID_FLAG_MERGE_PROPERTY, 0 ),
- MAP_END()
+ { PROPERTY_ALIGN, XML_NAMESPACE_FO, XML_TEXT_ALIGN, XML_TYPE_TEXT_ALIGN|XML_TYPE_PROP_PARAGRAPH, CTF_DB_COLUMN_TEXT_ALIGN, SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_FONTNAME, XML_NAMESPACE_STYLE, XML_FONT_NAME, XML_TYPE_STRING|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_TEXTCOLOR, XML_NAMESPACE_FO, XML_COLOR, XML_TYPE_COLOR|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_TEXTLINECOLOR, XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_COLOR,
+ XML_TYPE_TEXT_UNDERLINE_COLOR|MID_FLAG_MULTI_PROPERTY|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_TEXTRELIEF, XML_NAMESPACE_STYLE, XML_FONT_RELIEF,
+ XML_TYPE_TEXT_FONT_RELIEF|MID_FLAG_MULTI_PROPERTY|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_TEXTEMPHASIS, XML_NAMESPACE_STYLE, XML_TEXT_EMPHASIZE, XML_TYPE_CONTROL_TEXT_EMPHASIZE|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_FONTCHARWIDTH, XML_NAMESPACE_STYLE, XML_FONT_CHAR_WIDTH, XML_TYPE_NUMBER16|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_FONTCHARSET, XML_NAMESPACE_STYLE, XML_FONT_CHARSET, XML_TYPE_TEXT_FONTENCODING|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_FONTFAMILY, XML_NAMESPACE_STYLE, XML_FONT_FAMILY_GENERIC, XML_TYPE_TEXT_FONTFAMILY|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_FONTHEIGHT, XML_NAMESPACE_FO, XML_FONT_SIZE, XML_TYPE_MEASURE16|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_FONTKERNING, XML_NAMESPACE_STYLE, XML_LETTER_KERNING, XML_TYPE_BOOL|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_FONTORIENTATION, XML_NAMESPACE_STYLE, XML_ROTATION_ANGLE, XML_TYPE_ROTATION_ANGLE|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_FONTPITCH, XML_NAMESPACE_STYLE, XML_FONT_PITCH, XML_TYPE_TEXT_FONTPITCH|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_FONTSLANT, XML_NAMESPACE_FO, XML_FONT_STYLE, XML_TYPE_TEXT_POSTURE|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_CHAR_STRIKEOUT, XML_NAMESPACE_STYLE, XML_TEXT_LINE_THROUGH_STYLE,
+ XML_TYPE_TEXT_CROSSEDOUT_STYLE|MID_FLAG_MERGE_PROPERTY|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_CHAR_STRIKEOUT, XML_NAMESPACE_STYLE, XML_TEXT_LINE_THROUGH_TYPE,
+ XML_TYPE_TEXT_CROSSEDOUT_TYPE|MID_FLAG_MERGE_PROPERTY|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_CHAR_STRIKEOUT, XML_NAMESPACE_STYLE, XML_TEXT_LINE_THROUGH_WIDTH,
+ XML_TYPE_TEXT_CROSSEDOUT_WIDTH|MID_FLAG_MERGE_PROPERTY|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_CHAR_STRIKEOUT, XML_NAMESPACE_STYLE, XML_TEXT_LINE_THROUGH_TEXT,
+ XML_TYPE_TEXT_CROSSEDOUT_TEXT|MID_FLAG_MERGE_PROPERTY|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_FONTSTYLENAME, XML_NAMESPACE_STYLE, XML_FONT_STYLE_NAME, XML_TYPE_STRING|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_CHAR_UNDERLINE, XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_STYLE,
+ XML_TYPE_TEXT_UNDERLINE_STYLE|MID_FLAG_MERGE_PROPERTY|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_CHAR_UNDERLINE, XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_TYPE,
+ XML_TYPE_TEXT_UNDERLINE_TYPE|MID_FLAG_MERGE_PROPERTY|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_CHAR_UNDERLINE, XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_WIDTH,
+ XML_TYPE_TEXT_UNDERLINE_WIDTH|MID_FLAG_MERGE_PROPERTY|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_CHAR_UNDERLINE_COLOR, XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_COLOR,
+ XML_TYPE_TEXT_UNDERLINE_COLOR|MID_FLAG_MULTI_PROPERTY|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_CHAR_UNDERLINE_HAS_COLOR, XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_HASCOLOR|MID_FLAG_MERGE_ATTRIBUTE|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_FONTWEIGHT, XML_NAMESPACE_FO, XML_FONT_WEIGHT, XML_TYPE_TEXT_WEIGHT|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_FONTWIDTH, XML_NAMESPACE_STYLE, XML_FONT_WIDTH, XML_TYPE_FONT_WIDTH|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { PROPERTY_FONTWORDLINEMODE, XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_MODE,
+ XML_TYPE_TEXT_LINE_MODE|MID_FLAG_MERGE_PROPERTY|XML_TYPE_PROP_TEXT, 0 , SvtSaveOptions::ODFSVER_010, false },
+ { nullptr }
};
rtl::Reference < XMLPropertyHandlerFactory> xFac = new /*OPropertyHandlerFactory*/::xmloff::OControlPropertyHandlerFactory();
return new XMLPropertySetMapper(s_aCellStylesProperties, xFac, bForExport);
@@ -136,11 +142,10 @@ rtl::Reference < XMLPropertySetMapper > OXMLHelper::GetCellStylesPropertySetMapp
rtl::Reference < XMLPropertySetMapper > OXMLHelper::GetRowStylesPropertySetMapper()
{
-#define MAP_CONST_ROW( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TABLE_ROW, context, SvtSaveOptions::ODFSVER_010, false }
static const XMLPropertyMapEntry s_aStylesProperties[] =
{
- MAP_CONST_ROW( PROPERTY_ROW_HEIGHT, XML_NAMESPACE_STYLE, XML_ROW_HEIGHT, XML_TYPE_MEASURE, 0),
- MAP_END()
+ { PROPERTY_ROW_HEIGHT, XML_NAMESPACE_STYLE, XML_ROW_HEIGHT, XML_TYPE_MEASURE|XML_TYPE_PROP_TABLE_ROW, 0, SvtSaveOptions::ODFSVER_010, false },
+ { nullptr }
};
rtl::Reference < XMLPropertyHandlerFactory> xFac = new OPropertyHandlerFactory();
return new XMLPropertySetMapper(s_aStylesProperties, xFac, true/*bForExport*/);
diff --git a/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx b/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx
index 879575482b54..74a5b5e3f150 100644
--- a/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx
+++ b/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx
@@ -21,15 +21,14 @@
#include "xmlComponent.hxx"
#include "xmlColumn.hxx"
#include "xmlfilter.hxx"
+#include <utility>
#include <xmloff/xmltoken.hxx>
#include <xmloff/ProgressBarHelper.hxx>
#include "xmlEnums.hxx"
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/propertysequence.hxx>
-#include <osl/diagnose.h>
-#include <sal/log.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaxml
{
@@ -42,10 +41,10 @@ OXMLHierarchyCollection::OXMLHierarchyCollection( ODBFilter& rImport
,const Reference< XFastAttributeList > & _xAttrList
,const Reference< XNameAccess >& _xParentContainer
,const OUString& _sCollectionServiceName
- ,const OUString& _sComponentServiceName) :
+ ,OUString _sComponentServiceName) :
SvXMLImportContext( rImport )
,m_sCollectionServiceName(_sCollectionServiceName)
- ,m_sComponentServiceName(_sComponentServiceName)
+ ,m_sComponentServiceName(std::move(_sComponentServiceName))
{
OUString sName;
for (auto &aIter : sax_fastparser::castToFastAttributeList( _xAttrList ))
@@ -75,7 +74,7 @@ OXMLHierarchyCollection::OXMLHierarchyCollection( ODBFilter& rImport
m_xContainer.set(xORB->createInstanceWithArguments(_sCollectionServiceName,aArguments),UNO_QUERY);
Reference<XNameContainer> xNameContainer(_xParentContainer,UNO_QUERY);
if ( xNameContainer.is() && !xNameContainer->hasByName(sName) )
- xNameContainer->insertByName(sName,makeAny(m_xContainer));
+ xNameContainer->insertByName(sName,Any(m_xContainer));
}
}
catch(Exception&)
diff --git a/dbaccess/source/filter/xml/xmlHierarchyCollection.hxx b/dbaccess/source/filter/xml/xmlHierarchyCollection.hxx
index 689434822922..91f0aae869db 100644
--- a/dbaccess/source/filter/xml/xmlHierarchyCollection.hxx
+++ b/dbaccess/source/filter/xml/xmlHierarchyCollection.hxx
@@ -39,7 +39,7 @@ namespace dbaxml
,const css::uno::Reference< css::xml::sax::XFastAttributeList > & _xAttrList
,const css::uno::Reference< css::container::XNameAccess >& _xParentContainer
,const OUString& _sCollectionServiceName
- ,const OUString& _sComponentServiceName
+ ,OUString _sComponentServiceName
);
OXMLHierarchyCollection( ODBFilter& rImport
,const css::uno::Reference< css::container::XNameAccess >& _xContainer
diff --git a/dbaccess/source/filter/xml/xmlLogin.cxx b/dbaccess/source/filter/xml/xmlLogin.cxx
index cc7502301233..a4519b26e7a9 100644
--- a/dbaccess/source/filter/xml/xmlLogin.cxx
+++ b/dbaccess/source/filter/xml/xmlLogin.cxx
@@ -21,7 +21,7 @@
#include "xmlfilter.hxx"
#include <xmloff/xmltoken.hxx>
#include <strings.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <com/sun/star/sdbc/XDataSource.hpp>
namespace dbaxml
@@ -52,7 +52,7 @@ OXMLLogin::OXMLLogin( ODBFilter& rImport,
bUserFound = true;
try
{
- xDataSource->setPropertyValue(PROPERTY_USER,makeAny(aIter.toString()));
+ xDataSource->setPropertyValue(PROPERTY_USER,Any(aIter.toString()));
}
catch(const Exception&)
{
@@ -63,7 +63,7 @@ OXMLLogin::OXMLLogin( ODBFilter& rImport,
case XML_IS_PASSWORD_REQUIRED:
try
{
- xDataSource->setPropertyValue(PROPERTY_ISPASSWORDREQUIRED,makeAny(IsXMLToken(aIter, XML_TRUE)));
+ xDataSource->setPropertyValue(PROPERTY_ISPASSWORDREQUIRED,Any(IsXMLToken(aIter, XML_TRUE)));
}
catch(const Exception&)
{
diff --git a/dbaccess/source/filter/xml/xmlQuery.cxx b/dbaccess/source/filter/xml/xmlQuery.cxx
index 8f91145d72e9..a707e8734533 100644
--- a/dbaccess/source/filter/xml/xmlQuery.cxx
+++ b/dbaccess/source/filter/xml/xmlQuery.cxx
@@ -23,9 +23,7 @@
#include <xmloff/ProgressBarHelper.hxx>
#include "xmlEnums.hxx"
#include <strings.hxx>
-#include <osl/diagnose.h>
-#include <sal/log.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaxml
{
@@ -92,20 +90,20 @@ void OXMLQuery::setProperties(Reference< XPropertySet > & _xProp )
{
OXMLTable::setProperties(_xProp);
- _xProp->setPropertyValue(PROPERTY_COMMAND,makeAny(m_sCommand));
- _xProp->setPropertyValue(PROPERTY_ESCAPE_PROCESSING,makeAny(m_bEscapeProcessing));
+ _xProp->setPropertyValue(PROPERTY_COMMAND,Any(m_sCommand));
+ _xProp->setPropertyValue(PROPERTY_ESCAPE_PROCESSING,Any(m_bEscapeProcessing));
if ( !m_sTable.isEmpty() )
- _xProp->setPropertyValue(PROPERTY_UPDATE_TABLENAME,makeAny(m_sTable));
+ _xProp->setPropertyValue(PROPERTY_UPDATE_TABLENAME,Any(m_sTable));
if ( !m_sCatalog.isEmpty() )
- _xProp->setPropertyValue(PROPERTY_UPDATE_CATALOGNAME,makeAny(m_sCatalog));
+ _xProp->setPropertyValue(PROPERTY_UPDATE_CATALOGNAME,Any(m_sCatalog));
if ( !m_sSchema.isEmpty() )
- _xProp->setPropertyValue(PROPERTY_UPDATE_SCHEMANAME,makeAny(m_sSchema));
+ _xProp->setPropertyValue(PROPERTY_UPDATE_SCHEMANAME,Any(m_sSchema));
const ODBFilter::TPropertyNameMap& rSettings = GetOwnImport().getQuerySettings();
ODBFilter::TPropertyNameMap::const_iterator aFind = rSettings.find(m_sName);
if ( aFind != rSettings.end() )
- _xProp->setPropertyValue(PROPERTY_LAYOUTINFORMATION,makeAny(aFind->second));
+ _xProp->setPropertyValue(PROPERTY_LAYOUTINFORMATION,Any(aFind->second));
}
}
catch(Exception&)
diff --git a/dbaccess/source/filter/xml/xmlServerDatabase.cxx b/dbaccess/source/filter/xml/xmlServerDatabase.cxx
index 654a9f403402..a1db053092a1 100644
--- a/dbaccess/source/filter/xml/xmlServerDatabase.cxx
+++ b/dbaccess/source/filter/xml/xmlServerDatabase.cxx
@@ -22,7 +22,7 @@
#include <xmloff/xmltoken.hxx>
#include <strings.hxx>
#include <rtl/ustrbuf.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaxml
{
@@ -118,7 +118,7 @@ OXMLServerDatabase::OXMLServerDatabase( ODBFilter& rImport,
}
try
{
- xDataSource->setPropertyValue(PROPERTY_URL,makeAny(sURL.makeStringAndClear()));
+ xDataSource->setPropertyValue(PROPERTY_URL,Any(sURL.makeStringAndClear()));
}
catch(const Exception&)
{
diff --git a/dbaccess/source/filter/xml/xmlStyleImport.cxx b/dbaccess/source/filter/xml/xmlStyleImport.cxx
index ddadc5e3b91f..4196860031a0 100644
--- a/dbaccess/source/filter/xml/xmlStyleImport.cxx
+++ b/dbaccess/source/filter/xml/xmlStyleImport.cxx
@@ -41,7 +41,7 @@ using namespace xmloff::token;
OTableStyleContext::OTableStyleContext( ODBFilter& rImport,
- SvXMLStylesContext& rStyles, XmlStyleFamily nFamily )
+ OTableStylesContext& rStyles, XmlStyleFamily nFamily )
:XMLPropStyleContext( rImport, rStyles, nFamily, false )
,pStyles(&rStyles)
,m_nNumberFormat(-1)
@@ -101,7 +101,7 @@ void OTableStyleContext::SetDefaults()
void OTableStyleContext::AddProperty(const sal_Int16 nContextID, const uno::Any& rValue)
{
- sal_Int32 nIndex(static_cast<OTableStylesContext *>(pStyles)->GetIndex(nContextID));
+ sal_Int32 nIndex(pStyles->GetIndex(nContextID));
OSL_ENSURE(nIndex != -1, "Property not found in Map");
XMLPropertyState aPropState(nIndex, rValue);
GetProperties().push_back(aPropState); // has to be inserted in a sort order later
diff --git a/dbaccess/source/filter/xml/xmlStyleImport.hxx b/dbaccess/source/filter/xml/xmlStyleImport.hxx
index d3fc001b03d5..7f6c9932dac7 100644
--- a/dbaccess/source/filter/xml/xmlStyleImport.hxx
+++ b/dbaccess/source/filter/xml/xmlStyleImport.hxx
@@ -27,12 +27,13 @@
namespace dbaxml
{
class ODBFilter;
+ class OTableStylesContext;
class OTableStyleContext : public XMLPropStyleContext
{
OUString m_sDataStyleName;
OUString sPageStyle;
- SvXMLStylesContext* pStyles;
+ OTableStylesContext* pStyles;
sal_Int32 m_nNumberFormat;
ODBFilter& GetOwnImport();
@@ -46,7 +47,7 @@ namespace dbaxml
OTableStyleContext( ODBFilter& rImport,
- SvXMLStylesContext& rStyles, XmlStyleFamily nFamily );
+ OTableStylesContext& rStyles, XmlStyleFamily nFamily );
virtual ~OTableStyleContext() override;
diff --git a/dbaccess/source/filter/xml/xmlTable.cxx b/dbaccess/source/filter/xml/xmlTable.cxx
index 1af5f8e1955a..dd7df81c8072 100644
--- a/dbaccess/source/filter/xml/xmlTable.cxx
+++ b/dbaccess/source/filter/xml/xmlTable.cxx
@@ -19,6 +19,7 @@
#include "xmlTable.hxx"
#include "xmlfilter.hxx"
+#include <utility>
#include <xmloff/xmltoken.hxx>
#include <xmloff/ProgressBarHelper.hxx>
#include "xmlEnums.hxx"
@@ -29,9 +30,7 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <comphelper/propertysequence.hxx>
-#include <osl/diagnose.h>
-#include <tools/diagnose_ex.h>
-#include <sal/log.hxx>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaxml
{
@@ -42,11 +41,11 @@ namespace dbaxml
OXMLTable::OXMLTable( ODBFilter& _rImport
,const uno::Reference< XFastAttributeList > & _xAttrList
- ,const uno::Reference< css::container::XNameAccess >& _xParentContainer
+ ,uno::Reference< css::container::XNameAccess > _xParentContainer
,const OUString& _sServiceName
)
:SvXMLImportContext( _rImport )
- ,m_xParentContainer(_xParentContainer)
+ ,m_xParentContainer(std::move(_xParentContainer))
,m_bApplyFilter(false)
,m_bApplyOrder(false)
{
@@ -143,12 +142,12 @@ void OXMLTable::setProperties(uno::Reference< XPropertySet > & _xProp )
{
if ( _xProp.is() )
{
- _xProp->setPropertyValue(PROPERTY_APPLYFILTER,makeAny(m_bApplyFilter));
- _xProp->setPropertyValue(PROPERTY_FILTER,makeAny(m_sFilterStatement));
+ _xProp->setPropertyValue(PROPERTY_APPLYFILTER,Any(m_bApplyFilter));
+ _xProp->setPropertyValue(PROPERTY_FILTER,Any(m_sFilterStatement));
if ( _xProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_APPLYORDER) )
- _xProp->setPropertyValue(PROPERTY_APPLYORDER,makeAny(m_bApplyOrder));
- _xProp->setPropertyValue(PROPERTY_ORDER,makeAny(m_sOrderStatement));
+ _xProp->setPropertyValue(PROPERTY_APPLYORDER,Any(m_bApplyOrder));
+ _xProp->setPropertyValue(PROPERTY_ORDER,Any(m_sOrderStatement));
}
}
catch(Exception&)
@@ -182,7 +181,7 @@ void OXMLTable::endFastElement(sal_Int32 )
}
}
- xNameContainer->insertByName(m_sName,makeAny(m_xTable));
+ xNameContainer->insertByName(m_sName,Any(m_xTable));
}
}
catch(Exception&)
diff --git a/dbaccess/source/filter/xml/xmlTable.hxx b/dbaccess/source/filter/xml/xmlTable.hxx
index cee19ef19e40..9be9feaa023a 100644
--- a/dbaccess/source/filter/xml/xmlTable.hxx
+++ b/dbaccess/source/filter/xml/xmlTable.hxx
@@ -53,7 +53,7 @@ namespace dbaxml
OXMLTable( ODBFilter& rImport
,const css::uno::Reference< css::xml::sax::XFastAttributeList > & _xAttrList
- ,const css::uno::Reference< css::container::XNameAccess >& _xParentContainer
+ ,css::uno::Reference< css::container::XNameAccess > _xParentContainer
,const OUString& _sServiceName
);
virtual ~OXMLTable() override;
diff --git a/dbaccess/source/filter/xml/xmlTableFilterList.cxx b/dbaccess/source/filter/xml/xmlTableFilterList.cxx
index 88ec4fa2bcde..a6541684acba 100644
--- a/dbaccess/source/filter/xml/xmlTableFilterList.cxx
+++ b/dbaccess/source/filter/xml/xmlTableFilterList.cxx
@@ -84,9 +84,9 @@ void OXMLTableFilterList::endFastElement(sal_Int32 )
if ( xDataSource.is() )
{
if ( !m_aPatterns.empty() )
- xDataSource->setPropertyValue(PROPERTY_TABLEFILTER,makeAny(comphelper::containerToSequence(m_aPatterns)));
+ xDataSource->setPropertyValue(PROPERTY_TABLEFILTER,Any(comphelper::containerToSequence(m_aPatterns)));
if ( !m_aTypes.empty() )
- xDataSource->setPropertyValue(PROPERTY_TABLETYPEFILTER,makeAny(comphelper::containerToSequence(m_aTypes)));
+ xDataSource->setPropertyValue(PROPERTY_TABLETYPEFILTER,Any(comphelper::containerToSequence(m_aTypes)));
}
}
diff --git a/dbaccess/source/filter/xml/xmlTableFilterPattern.cxx b/dbaccess/source/filter/xml/xmlTableFilterPattern.cxx
index 0c4b2892d2b7..1df9c037ac38 100644
--- a/dbaccess/source/filter/xml/xmlTableFilterPattern.cxx
+++ b/dbaccess/source/filter/xml/xmlTableFilterPattern.cxx
@@ -22,9 +22,6 @@
namespace dbaxml
{
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::xml::sax;
-
OXMLTableFilterPattern::OXMLTableFilterPattern( SvXMLImport& rImport
,bool _bNameFilter
,OXMLTableFilterList& _rParent)
diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx
index 88765c186961..975044623258 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -51,7 +51,7 @@
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <svtools/sfxecode.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <comphelper/sequence.hxx>
#include <comphelper/types.hxx>
@@ -132,42 +132,40 @@ static ErrCode ReadThroughComponent(
OSL_ENSURE( xStorage.is(), "Need storage!");
OSL_ENSURE(nullptr != pStreamName, "Please, please, give me a name!");
- if ( xStorage.is() )
- {
- uno::Reference< io::XStream > xDocStream;
+ if ( !xStorage )
+ // TODO/LATER: better error handling
+ return ErrCode(1);
- try
- {
- // open stream (and set parser input)
- OUString sStreamName = OUString::createFromAscii(pStreamName);
- if ( !xStorage->hasByName( sStreamName ) || !xStorage->isStreamElement( sStreamName ) )
- {
- // stream name not found! return immediately with OK signal
- return ERRCODE_NONE;
- }
+ uno::Reference< io::XStream > xDocStream;
- // get input stream
- xDocStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ );
- }
- catch (const packages::WrongPasswordException&)
- {
- return ERRCODE_SFX_WRONGPASSWORD;
- }
- catch (const uno::Exception&)
+ try
+ {
+ // open stream (and set parser input)
+ OUString sStreamName = OUString::createFromAscii(pStreamName);
+ if ( !xStorage->hasByName( sStreamName ) || !xStorage->isStreamElement( sStreamName ) )
{
- return ErrCode(1); // TODO/LATER: error handling
+ // stream name not found! return immediately with OK signal
+ return ERRCODE_NONE;
}
- uno::Reference< XInputStream > xInputStream = xDocStream->getInputStream();
- // read from the stream
- return ReadThroughComponent( xInputStream
- ,xModelComponent
- ,rxContext
- ,_rFilter );
+ // get input stream
+ xDocStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ );
+ }
+ catch (const packages::WrongPasswordException&)
+ {
+ return ERRCODE_SFX_WRONGPASSWORD;
+ }
+ catch (const uno::Exception&)
+ {
+ return ErrCode(1); // TODO/LATER: error handling
}
- // TODO/LATER: better error handling
- return ErrCode(1);
+ uno::Reference< XInputStream > xInputStream = xDocStream->getInputStream();
+ // read from the stream
+ return ReadThroughComponent( xInputStream
+ ,xModelComponent
+ ,rxContext
+ ,_rFilter );
}
@@ -522,7 +520,7 @@ void ODBFilter::SetConfigurationSettings(const Sequence<PropertyValue>& aConfigP
pIter->Value >>= aWindows;
uno::Reference<XPropertySet> xProp(getDataSource());
if ( xProp.is() )
- xProp->setPropertyValue(PROPERTY_LAYOUTINFORMATION,makeAny(aWindows));
+ xProp->setPropertyValue(PROPERTY_LAYOUTINFORMATION,Any(aWindows));
}
}
}
@@ -605,7 +603,7 @@ void ODBFilter::setPropertyInfo()
{
try
{
- xDataSource->setPropertyValue(PROPERTY_INFO,makeAny(aInfo));
+ xDataSource->setPropertyValue(PROPERTY_INFO,Any(aInfo));
}
catch (const Exception&)
{
diff --git a/dbaccess/source/inc/OAuthenticationContinuation.hxx b/dbaccess/source/inc/OAuthenticationContinuation.hxx
index 0812c46f8baa..a87203e7a64c 100644
--- a/dbaccess/source/inc/OAuthenticationContinuation.hxx
+++ b/dbaccess/source/inc/OAuthenticationContinuation.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_DBACCESS_SOURCE_INC_OAUTHENTICATIONCONTINUATION_HXX
-#define INCLUDED_DBACCESS_SOURCE_INC_OAUTHENTICATIONCONTINUATION_HXX
+#pragma once
#include <dbadllapi.hxx>
@@ -32,7 +31,7 @@
namespace dbaccess
{
-class OOO_DLLPUBLIC_DBA OAuthenticationContinuation :
+class UNLESS_MERGELIBS_MORE(OOO_DLLPUBLIC_DBA) OAuthenticationContinuation :
public comphelper::OInteraction< css::ucb::XInteractionSupplyAuthentication >
{
bool m_bRememberPassword : 1; // remember the password for this session ?
@@ -65,6 +64,4 @@ public:
} // namespace dbaccess
-#endif // INCLUDED_DBACCESS_SOURCE_INC_OAUTHENTICATIONCONTINUATION_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/inc/apitools.hxx b/dbaccess/source/inc/apitools.hxx
index 654ed00573c2..0f4f2c9bec1c 100644
--- a/dbaccess/source/inc/apitools.hxx
+++ b/dbaccess/source/inc/apitools.hxx
@@ -17,22 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_DBACCESS_SOURCE_INC_APITOOLS_HXX
-#define INCLUDED_DBACCESS_SOURCE_INC_APITOOLS_HXX
+#pragma once
#include <sal/config.h>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <cppuhelper/component.hxx>
+#include <cppuhelper/compbase.hxx>
#include <osl/mutex.hxx>
-#include <osl/diagnose.h>
-#include <comphelper/sequence.hxx>
-#include <strings.hxx>
// OSubComponent - a component which holds a hard ref to its parent
// and is been hold itself (by the parent) with a weak ref
-class OSubComponent : public ::cppu::OComponentHelper
+class OSubComponent : public ::cppu::WeakComponentImplHelper<>
{
protected:
// the parent must support the tunnel implementation
@@ -43,11 +37,7 @@ public:
OSubComponent(::osl::Mutex& _rMutex,
const css::uno::Reference< css::uno::XInterface >& _xParent);
-// css::lang::XTypeProvider
- virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
-
// css::uno::XInterface
- virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL release() noexcept override;
operator css::uno::Reference< css::uno::XInterface > () const
@@ -55,143 +45,4 @@ public:
};
-// helper for implementing the XServiceInfo interface
-
-// (internal - not to be used outside - usually)
-#define IMPLEMENT_SERVICE_INFO_IMPLNAME(classname, implasciiname) \
- OUString SAL_CALL classname::getImplementationName( ) \
- { \
- return implasciiname; \
- } \
-
-
-#define IMPLEMENT_SERVICE_INFO_SUPPORTS(classname) \
- sal_Bool SAL_CALL classname::supportsService( const OUString& _rServiceName ) \
- { \
- const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames()); \
- for (const OUString& s : aSupported) \
- if (s == _rServiceName) \
- return true; \
- \
- return false; \
- } \
-
-
-
-#define IMPLEMENT_SERVICE_INFO1(classname, implasciiname, serviceasciiname) \
- IMPLEMENT_SERVICE_INFO_IMPLNAME(classname, implasciiname) \
- IMPLEMENT_SERVICE_INFO_SUPPORTS(classname) \
- css::uno::Sequence< OUString > SAL_CALL classname::getSupportedServiceNames( ) \
- { \
- return { serviceasciiname }; \
- } \
-
-
-#define IMPLEMENT_SERVICE_INFO2(classname, implasciiname, serviceasciiname1, serviceasciiname2) \
- IMPLEMENT_SERVICE_INFO_IMPLNAME(classname, implasciiname) \
- IMPLEMENT_SERVICE_INFO_SUPPORTS(classname) \
- css::uno::Sequence< OUString > SAL_CALL classname::getSupportedServiceNames( ) \
- { \
- return { serviceasciiname1, serviceasciiname2 }; \
- }
-
-
-
-#define IMPLEMENT_SERVICE_INFO3(classname, implasciiname, serviceasciiname1, serviceasciiname2, serviceasciiname3) \
- IMPLEMENT_SERVICE_INFO_IMPLNAME(classname, implasciiname) \
- IMPLEMENT_SERVICE_INFO_SUPPORTS(classname) \
- css::uno::Sequence< OUString > SAL_CALL classname::getSupportedServiceNames( ) \
- { \
- return { serviceasciiname1, serviceasciiname2, serviceasciiname3 }; \
- } \
-
-
-// XTypeProvider helpers
-
-#define IMPLEMENT_GETTYPES2( classname, baseclass1, baseclass2 ) \
- css::uno::Sequence< css::uno::Type > classname::getTypes() \
- { \
- return ::comphelper::concatSequences( \
- baseclass1::getTypes( ), \
- baseclass2::getTypes( ) \
- ); \
- }
-
-#define IMPLEMENT_GETTYPES3( classname, baseclass1, baseclass2, baseclass3 ) \
- css::uno::Sequence< css::uno::Type > classname::getTypes() \
- { \
- return ::comphelper::concatSequences( \
- baseclass1::getTypes( ), \
- baseclass2::getTypes( ), \
- baseclass3::getTypes( ) \
- ); \
- }
-
-// helper for declaring/implementing classes based on the OPropertyContainer and an OPropertyArrayUsageHelper
-#define DECLARE_PROPERTYCONTAINER_DEFAULTS( ) \
- virtual css::uno::Reference< css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override; \
- virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; \
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override
-
-#define IMPLEMENT_PROPERTYCONTAINER_DEFAULTS2( classname , baseclass1) \
- css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL classname::getPropertySetInfo() \
- { \
- Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); \
- return xInfo; \
- } \
- ::cppu::IPropertyArrayHelper& classname::getInfoHelper() \
- { \
- return *baseclass1::getArrayHelper(); \
- } \
- ::cppu::IPropertyArrayHelper* classname::createArrayHelper( ) const \
- { \
- css::uno::Sequence< css::beans::Property > aProps; \
- describeProperties(aProps); \
- return new ::cppu::OPropertyArrayHelper(aProps); \
- }
-#define IMPLEMENT_PROPERTYCONTAINER_DEFAULTS( classname ) \
- IMPLEMENT_PROPERTYCONTAINER_DEFAULTS2( classname, classname )
-
-// helper for implementing the createArrayHelper
-#define BEGIN_PROPERTY_SEQUENCE(count) \
- css::uno::Sequence< css::beans::Property> aDescriptor(count); \
- css::beans::Property* pDesc = aDescriptor.getArray(); \
- sal_Int32 nPos = 0; \
-
-#define BEGIN_PROPERTY_HELPER(count) \
- BEGIN_PROPERTY_SEQUENCE(count)
-
-#define DECL_PROP_IMPL(varname, cpputype) \
- pDesc[nPos++] = css::beans::Property(PROPERTY_##varname, PROPERTY_ID_##varname, cpputype,
-
-#define DECL_PROP0(varname, type) \
- DECL_PROP_IMPL(varname, cppu::UnoType<type>::get()) 0)
-
-#define DECL_PROP0_BOOL(varname) \
- DECL_PROP_IMPL(varname, cppu::UnoType<bool>::get()) 0)
-
-#define DECL_PROP1(varname, type, attrib1) \
- DECL_PROP_IMPL(varname, cppu::UnoType<type>::get()) css::beans::PropertyAttribute::attrib1)
-
-#define DECL_PROP1_BOOL(varname, attrib1) \
- DECL_PROP_IMPL(varname, cppu::UnoType<bool>::get()) css::beans::PropertyAttribute::attrib1)
-
-#define DECL_PROP2_IFACE(varname, iface, attrib1, attrib2) \
- DECL_PROP_IMPL(varname, cppu::UnoType<iface>::get()) css::beans::PropertyAttribute::attrib1 | css::beans::PropertyAttribute::attrib2)
-
-#define DECL_PROP2(varname, type, attrib1, attrib2) \
- DECL_PROP_IMPL(varname, cppu::UnoType<type>::get()) css::beans::PropertyAttribute::attrib1 | css::beans::PropertyAttribute::attrib2)
-
-#define DECL_PROP3(varname, type, attrib1, attrib2, attrib3) \
- DECL_PROP_IMPL(varname, cppu::UnoType<type>::get()) css::beans::PropertyAttribute::attrib1 | css::beans::PropertyAttribute::attrib2 | css::beans::PropertyAttribute::attrib3)
-
-#define END_PROPERTY_SEQUENCE() \
- OSL_ENSURE(nPos == aDescriptor.getLength(), "forgot to adjust the count ?"); \
-
-#define END_PROPERTY_HELPER() \
- END_PROPERTY_SEQUENCE() \
- return new ::cppu::OPropertyArrayHelper(aDescriptor);
-
-#endif // INCLUDED_DBACCESS_SOURCE_INC_APITOOLS_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/inc/dsntypes.hxx b/dbaccess/source/inc/dsntypes.hxx
index b7642c66f20c..ebd287099fa1 100644
--- a/dbaccess/source/inc/dsntypes.hxx
+++ b/dbaccess/source/inc/dsntypes.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_DBACCESS_SOURCE_INC_DSNTYPES_HXX
-#define INCLUDED_DBACCESS_SOURCE_INC_DSNTYPES_HXX
+#pragma once
#include <sal/config.h>
@@ -56,7 +55,6 @@ enum DATASOURCE_TYPE
DST_EVOLUTION_LDAP = 19,
DST_KAB = 20,
DST_MACAB = 21,
- DST_MSACCESS_2007 = 22,
DST_EMBEDDED_HSQLDB = 23,
DST_MYSQL_NATIVE = 24,
DST_MYSQL_NATIVE_DIRECT = 25,
@@ -64,6 +62,8 @@ enum DATASOURCE_TYPE
DST_EMBEDDED_FIREBIRD = 27,
DST_POSTGRES = 28,
DST_WRITER = 29,
+ DST_EMBEDDED_UNKNOWN = 30, /// for all embedded addons driver
+
DST_USERDEFINE1, /// first user defined driver
DST_USERDEFINE2,
@@ -97,9 +97,10 @@ enum DATASOURCE_TYPE
#define PAGE_DBSETUPWIZARD_FINAL 16
#define PAGE_DBSETUPWIZARD_USERDEFINED 17
#define PAGE_DBSETUPWIZARD_MYSQL_NATIVE 18
+#define PAGE_DBSETUPWIZARD_POSTGRES 19
// ODsnTypeCollection
-class OOO_DLLPUBLIC_DBA ODsnTypeCollection final
+class UNLESS_MERGELIBS_MORE(OOO_DLLPUBLIC_DBA) ODsnTypeCollection final
{
std::vector<OUString> m_aDsnTypesDisplayNames; /// user readable names for the datasource types
@@ -124,7 +125,7 @@ public:
OUString cutPrefix(std::u16string_view _sURL) const;
/// on a given string, return the type prefix
- OUString getPrefix(const OUString& _sURL) const;
+ OUString getPrefix(std::u16string_view _sURL) const;
/// determines whether there is a driver for the given URL prefix/pattern
bool hasDriver( const char* _pAsciiPattern ) const;
@@ -158,7 +159,7 @@ public:
bool isConnectionUrlRequired(std::u16string_view _sURL) const;
/// checks if the given data source type embeds its data into the database document
- static bool isEmbeddedDatabase( const OUString& _sURL );
+ static bool isEmbeddedDatabase( std::u16string_view _sURL );
static OUString getEmbeddedDatabase();
@@ -185,7 +186,7 @@ public:
};
//- ODsnTypeCollection::TypeIterator
-class OOO_DLLPUBLIC_DBA ODsnTypeCollection::TypeIterator
+class UNLESS_MERGELIBS_MORE(OOO_DLLPUBLIC_DBA) ODsnTypeCollection::TypeIterator
{
friend class ODsnTypeCollection;
@@ -216,6 +217,4 @@ inline ODsnTypeCollection::TypeIterator ODsnTypeCollection::end() const { return
} // namespace dbaccess
-#endif // INCLUDED_DBACCESS_SOURCE_INC_DSNTYPES_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/inc/stringconstants.hxx b/dbaccess/source/inc/stringconstants.hxx
index 9b7e732fee8f..1f20962a78a3 100644
--- a/dbaccess/source/inc/stringconstants.hxx
+++ b/dbaccess/source/inc/stringconstants.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_DBACCESS_SOURCE_INC_STRINGCONSTANTS_HRC
-#define INCLUDED_DBACCESS_SOURCE_INC_STRINGCONSTANTS_HRC
+#pragma once
// property ids
@@ -169,6 +168,4 @@
#define PROPERTY_ID_PROPCHANGE_NOTIFY 146
#define PROPERTY_ID_AUTOGROW 147
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/sdbtools/connection/objectnames.cxx b/dbaccess/source/sdbtools/connection/objectnames.cxx
index 5ec2c22e8ea4..e36092e30be4 100644
--- a/dbaccess/source/sdbtools/connection/objectnames.cxx
+++ b/dbaccess/source/sdbtools/connection/objectnames.cxx
@@ -33,6 +33,7 @@
#include <osl/diagnose.h>
#include <memory>
+#include <utility>
namespace sdbtools
{
@@ -159,18 +160,18 @@ namespace sdbtools
{
}
- static ::connectivity::ErrorCondition validateName_getErrorCondition( const OUString& _rName )
+ static ::connectivity::ErrorCondition validateName_getErrorCondition( std::u16string_view _rName )
{
- if ( ( _rName.indexOf( u'"' ) >= 0 )
- || ( _rName.indexOf( u'\'' ) >= 0 )
- || ( _rName.indexOf( u'`' ) >= 0 )
- || ( _rName.indexOf( u'\x0091' ) >= 0 )
- || ( _rName.indexOf( u'\x0092' ) >= 0 )
- || ( _rName.indexOf( u'\x00B4' ) >= 0 ) // removed unparsable chars
+ if ( ( _rName.find( u'"' ) != std::u16string_view::npos )
+ || ( _rName.find( u'\'' ) != std::u16string_view::npos )
+ || ( _rName.find( u'`' ) != std::u16string_view::npos )
+ || ( _rName.find( u'\x0091' ) != std::u16string_view::npos )
+ || ( _rName.find( u'\x0092' ) != std::u16string_view::npos )
+ || ( _rName.find( u'\x00B4' ) != std::u16string_view::npos ) // removed unparsable chars
)
return ErrorCondition::DB_QUERY_NAME_WITH_QUOTES;
- if ( _rName.indexOf( '/') >= 0 )
+ if ( _rName.find( '/') != std::u16string_view::npos )
return ErrorCondition::DB_OBJECT_NAME_WITH_SLASHES;
return 0;
@@ -200,9 +201,9 @@ namespace sdbtools
PNameValidation m_pSecondary;
public:
- CombinedNameCheck(const PNameValidation& _pPrimary, const PNameValidation& _pSecondary)
- :m_pPrimary( _pPrimary )
- ,m_pSecondary( _pSecondary )
+ CombinedNameCheck(PNameValidation _pPrimary, PNameValidation _pSecondary)
+ :m_pPrimary(std::move( _pPrimary ))
+ ,m_pSecondary(std::move( _pSecondary ))
{
OSL_ENSURE( m_pPrimary && m_pSecondary, "CombinedNameCheck::CombinedNameCheck: this will crash!" );
}
diff --git a/dbaccess/source/sdbtools/connection/tablename.cxx b/dbaccess/source/sdbtools/connection/tablename.cxx
index 132484a2469f..f6a77dd3e91b 100644
--- a/dbaccess/source/sdbtools/connection/tablename.cxx
+++ b/dbaccess/source/sdbtools/connection/tablename.cxx
@@ -26,7 +26,7 @@
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <connectivity/dbtools.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace sdbtools
{
@@ -51,17 +51,8 @@ namespace sdbtools
using namespace ::dbtools;
// TableName
- struct TableName_Impl
- {
- OUString sCatalog;
- OUString sSchema;
- OUString sName;
- };
-
- // TableName
TableName::TableName( const Reference<XComponentContext>& _rContext, const Reference< XConnection >& _rxConnection )
:ConnectionDependentComponent( _rContext )
- ,m_pImpl( new TableName_Impl )
{
setWeakConnection( _rxConnection );
}
@@ -73,43 +64,43 @@ namespace sdbtools
OUString SAL_CALL TableName::getCatalogName()
{
EntryGuard aGuard( *this );
- return m_pImpl->sCatalog;
+ return msCatalog;
}
void SAL_CALL TableName::setCatalogName( const OUString& _catalogName )
{
EntryGuard aGuard( *this );
- m_pImpl->sCatalog = _catalogName;
+ msCatalog = _catalogName;
}
OUString SAL_CALL TableName::getSchemaName()
{
EntryGuard aGuard( *this );
- return m_pImpl->sSchema;
+ return msSchema;
}
void SAL_CALL TableName::setSchemaName( const OUString& _schemaName )
{
EntryGuard aGuard( *this );
- m_pImpl->sSchema = _schemaName;
+ msSchema = _schemaName;
}
OUString SAL_CALL TableName::getTableName()
{
EntryGuard aGuard( *this );
- return m_pImpl->sName;
+ return msName;
}
void SAL_CALL TableName::setTableName( const OUString& _tableName )
{
EntryGuard aGuard( *this );
- m_pImpl->sName = _tableName;
+ msName = _tableName;
}
OUString SAL_CALL TableName::getNameForSelect()
{
EntryGuard aGuard( *this );
- return composeTableNameForSelect( getConnection(), m_pImpl->sCatalog, m_pImpl->sSchema, m_pImpl->sName );
+ return composeTableNameForSelect( getConnection(), msCatalog, msSchema, msName );
}
Reference< XPropertySet > SAL_CALL TableName::getTable()
@@ -157,9 +148,9 @@ namespace sdbtools
try
{
- OSL_VERIFY( _table->getPropertyValue( PROPERTY_CATALOGNAME ) >>= m_pImpl->sCatalog );
- OSL_VERIFY( _table->getPropertyValue( PROPERTY_SCHEMANAME ) >>= m_pImpl->sSchema );
- OSL_VERIFY( _table->getPropertyValue( PROPERTY_NAME ) >>= m_pImpl->sName );
+ OSL_VERIFY( _table->getPropertyValue( PROPERTY_CATALOGNAME ) >>= msCatalog );
+ OSL_VERIFY( _table->getPropertyValue( PROPERTY_SCHEMANAME ) >>= msSchema );
+ OSL_VERIFY( _table->getPropertyValue( PROPERTY_NAME ) >>= msName );
}
catch( const RuntimeException& ) { throw; }
catch( const Exception& e )
@@ -190,19 +181,16 @@ namespace sdbtools
{ CompositionType::Complete, EComposeRule::Complete }
};
- bool found = false;
- size_t i = 0;
- for ( ; i < SAL_N_ELEMENTS( TypeTable ) && !found; ++i )
- if ( TypeTable[i].nCompositionType == _nType )
- found = true;
- if ( !found )
+ auto const found = std::find_if(std::begin(TypeTable), std::end(TypeTable)
+ , [_nType](auto const & type){ return type.nCompositionType == _nType; });
+ if (found == std::end(TypeTable))
throw IllegalArgumentException(
DBA_RES( STR_INVALID_COMPOSITION_TYPE ),
nullptr,
0
);
- return TypeTable[i].eComposeRule;
+ return found->eComposeRule;
}
}
@@ -212,7 +200,7 @@ namespace sdbtools
return composeTableName(
getConnection()->getMetaData(),
- m_pImpl->sCatalog, m_pImpl->sSchema, m_pImpl->sName, Quote,
+ msCatalog, msSchema, msName, Quote,
lcl_translateCompositionType_throw( Type ) );
}
@@ -223,7 +211,7 @@ namespace sdbtools
qualifiedNameComponents(
getConnection()->getMetaData(),
ComposedName,
- m_pImpl->sCatalog, m_pImpl->sSchema, m_pImpl->sName,
+ msCatalog, msSchema, msName,
lcl_translateCompositionType_throw( Type ) );
}
diff --git a/dbaccess/source/sdbtools/connection/tablename.hxx b/dbaccess/source/sdbtools/connection/tablename.hxx
index 3a7ece21a182..74abc3025f49 100644
--- a/dbaccess/source/sdbtools/connection/tablename.hxx
+++ b/dbaccess/source/sdbtools/connection/tablename.hxx
@@ -33,15 +33,11 @@ namespace sdbtools
// TableName
typedef ::cppu::WeakImplHelper< css::sdb::tools::XTableName
> TableName_Base;
- struct TableName_Impl;
/** default implementation for XTableName
*/
class TableName :public TableName_Base
,public ConnectionDependentComponent
{
- private:
- std::unique_ptr< TableName_Impl > m_pImpl;
-
public:
/** constructs the instance
@@ -77,6 +73,10 @@ namespace sdbtools
private:
TableName( const TableName& ) = delete;
TableName& operator=( const TableName& ) = delete;
+
+ OUString msCatalog;
+ OUString msSchema;
+ OUString msName;
};
} // namespace sdbtools
diff --git a/dbaccess/source/sdbtools/inc/connectiondependent.hxx b/dbaccess/source/sdbtools/inc/connectiondependent.hxx
index d315d70187fb..9f424256c61c 100644
--- a/dbaccess/source/sdbtools/inc/connectiondependent.hxx
+++ b/dbaccess/source/sdbtools/inc/connectiondependent.hxx
@@ -25,6 +25,7 @@
#include <cppuhelper/weakref.hxx>
#include <osl/mutex.hxx>
+#include <utility>
namespace sdbtools
{
@@ -58,8 +59,8 @@ namespace sdbtools
class EntryGuard;
protected:
- explicit ConnectionDependentComponent( const css::uno::Reference< css::uno::XComponentContext > & _rContext )
- :m_aContext( _rContext )
+ explicit ConnectionDependentComponent( css::uno::Reference< css::uno::XComponentContext > _xContext )
+ :m_aContext(std::move( _xContext ))
{
}
diff --git a/dbaccess/source/shared/registrationhelper.cxx b/dbaccess/source/shared/registrationhelper.cxx
deleted file mode 100644
index 2c9fbc1f1042..000000000000
--- a/dbaccess/source/shared/registrationhelper.cxx
+++ /dev/null
@@ -1,152 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-// be included in other cxx files
-
-#ifndef REGISTRATIONHELPER_CXX_INCLUDED_INDIRECTLY_
-#error "don't build this file directly! use dbu_reghelper.cxx instead!"
-#endif
-
-using namespace ::com::sun::star;
-using namespace ::comphelper;
-using namespace ::cppu;
-
-uno::Sequence< OUString >* OModuleRegistration::s_pImplementationNames = nullptr;
-uno::Sequence< uno::Sequence< OUString > >* OModuleRegistration::s_pSupportedServices = nullptr;
-uno::Sequence< sal_Int64 >* OModuleRegistration::s_pCreationFunctionPointers = nullptr;
-uno::Sequence< sal_Int64 >* OModuleRegistration::s_pFactoryFunctionPointers = nullptr;
-
-void OModuleRegistration::registerComponent(
- const OUString& _rImplementationName,
- const uno::Sequence< OUString >& _rServiceNames,
- ComponentInstantiation _pCreateFunction,
- FactoryInstantiation _pFactoryFunction)
-{
- if (!s_pImplementationNames)
- {
- OSL_ENSURE(!s_pSupportedServices && !s_pCreationFunctionPointers && !s_pFactoryFunctionPointers,
- "OModuleRegistration::registerComponent : inconsistent state (the pointers (1)) !");
- s_pImplementationNames = new uno::Sequence< OUString >;
- s_pSupportedServices = new uno::Sequence< uno::Sequence< OUString > >;
- s_pCreationFunctionPointers = new uno::Sequence< sal_Int64 >;
- s_pFactoryFunctionPointers = new uno::Sequence< sal_Int64 >;
- }
- OSL_ENSURE(s_pImplementationNames && s_pSupportedServices && s_pCreationFunctionPointers && s_pFactoryFunctionPointers,
- "OModuleRegistration::registerComponent : inconsistent state (the pointers (2)) !");
-
- OSL_ENSURE( (s_pImplementationNames->getLength() == s_pSupportedServices->getLength())
- && (s_pImplementationNames->getLength() == s_pCreationFunctionPointers->getLength())
- && (s_pImplementationNames->getLength() == s_pFactoryFunctionPointers->getLength()),
- "OModuleRegistration::registerComponent : inconsistent state !");
-
- sal_Int32 nOldLen = s_pImplementationNames->getLength();
- s_pImplementationNames->realloc(nOldLen + 1);
- s_pSupportedServices->realloc(nOldLen + 1);
- s_pCreationFunctionPointers->realloc(nOldLen + 1);
- s_pFactoryFunctionPointers->realloc(nOldLen + 1);
-
- s_pImplementationNames->getArray()[nOldLen] = _rImplementationName;
- s_pSupportedServices->getArray()[nOldLen] = _rServiceNames;
- s_pCreationFunctionPointers->getArray()[nOldLen] = reinterpret_cast<sal_Int64>(_pCreateFunction);
- s_pFactoryFunctionPointers->getArray()[nOldLen] = reinterpret_cast<sal_Int64>(_pFactoryFunction);
-}
-
-void OModuleRegistration::revokeComponent(const OUString& _rImplementationName)
-{
- if (!s_pImplementationNames)
- {
- OSL_FAIL("OModuleRegistration::revokeComponent : have no class infos ! Are you sure called this method at the right time ?");
- return;
- }
- OSL_ENSURE(s_pImplementationNames && s_pSupportedServices && s_pCreationFunctionPointers && s_pFactoryFunctionPointers,
- "OModuleRegistration::revokeComponent : inconsistent state (the pointers) !");
- OSL_ENSURE( (s_pImplementationNames->getLength() == s_pSupportedServices->getLength())
- && (s_pImplementationNames->getLength() == s_pCreationFunctionPointers->getLength())
- && (s_pImplementationNames->getLength() == s_pFactoryFunctionPointers->getLength()),
- "OModuleRegistration::revokeComponent : inconsistent state !");
-
- sal_Int32 nLen = s_pImplementationNames->getLength();
- const OUString* pImplNames = s_pImplementationNames->getConstArray();
- for (sal_Int32 i=0; i<nLen; ++i, ++pImplNames)
- {
- if (*pImplNames == _rImplementationName)
- {
- removeElementAt(*s_pImplementationNames, i);
- removeElementAt(*s_pSupportedServices, i);
- removeElementAt(*s_pCreationFunctionPointers, i);
- removeElementAt(*s_pFactoryFunctionPointers, i);
- break;
- }
- }
-
- if (s_pImplementationNames->getLength() == 0)
- {
- delete s_pImplementationNames; s_pImplementationNames = nullptr;
- delete s_pSupportedServices; s_pSupportedServices = nullptr;
- delete s_pCreationFunctionPointers; s_pCreationFunctionPointers = nullptr;
- delete s_pFactoryFunctionPointers; s_pFactoryFunctionPointers = nullptr;
- }
-}
-
-uno::Reference< uno::XInterface > OModuleRegistration::getComponentFactory(
- const OUString& _rImplementationName,
- const uno::Reference< lang::XMultiServiceFactory >& _rxServiceManager)
-{
- OSL_ENSURE(_rxServiceManager.is(), "OModuleRegistration::getComponentFactory : invalid argument (service manager) !");
- OSL_ENSURE(!_rImplementationName.isEmpty(), "OModuleRegistration::getComponentFactory : invalid argument (implementation name) !");
-
- if (!s_pImplementationNames)
- {
- OSL_FAIL("OModuleRegistration::getComponentFactory : have no class infos ! Are you sure called this method at the right time ?");
- return nullptr;
- }
- OSL_ENSURE(s_pImplementationNames && s_pSupportedServices && s_pCreationFunctionPointers && s_pFactoryFunctionPointers,
- "OModuleRegistration::getComponentFactory : inconsistent state (the pointers) !");
- OSL_ENSURE( (s_pImplementationNames->getLength() == s_pSupportedServices->getLength())
- && (s_pImplementationNames->getLength() == s_pCreationFunctionPointers->getLength())
- && (s_pImplementationNames->getLength() == s_pFactoryFunctionPointers->getLength()),
- "OModuleRegistration::getComponentFactory : inconsistent state !");
-
- uno::Reference< uno::XInterface > xReturn;
-
- sal_Int32 nLen = s_pImplementationNames->getLength();
- const OUString* pImplName = s_pImplementationNames->getConstArray();
- const uno::Sequence< OUString >* pServices = s_pSupportedServices->getConstArray();
- const sal_Int64* pComponentFunction = s_pCreationFunctionPointers->getConstArray();
- const sal_Int64* pFactoryFunction = s_pFactoryFunctionPointers->getConstArray();
-
- for (sal_Int32 i=0; i<nLen; ++i, ++pImplName, ++pServices, ++pComponentFunction, ++pFactoryFunction)
- {
- if (*pImplName == _rImplementationName)
- {
- const FactoryInstantiation FactoryInstantiationFunction = reinterpret_cast<FactoryInstantiation>(*pFactoryFunction);
- const ComponentInstantiation ComponentInstantiationFunction = reinterpret_cast<ComponentInstantiation>(*pComponentFunction);
-
- xReturn = FactoryInstantiationFunction( _rxServiceManager, *pImplName, ComponentInstantiationFunction, *pServices, nullptr);
- if (xReturn.is())
- {
- return xReturn.get();
- }
- }
- }
-
- return nullptr;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index d2fd90d9ad7d..fbe2c395633f 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -55,7 +55,7 @@
#include <com/sun/star/sdb/application/DatabaseObject.hpp>
#include <com/sun/star/sdb/application/DatabaseObjectContainer.hpp>
#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/urlobj.hxx>
#include <osl/diagnose.h>
@@ -63,6 +63,7 @@
#include <vcl/transfer.hxx>
#include <svtools/cliplistener.hxx>
+#include <comphelper/interfacecontainer3.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/uno3.hxx>
#include <comphelper/types.hxx>
@@ -157,7 +158,7 @@ class SelectionGuard;
class SelectionNotifier
{
private:
- ::comphelper::OInterfaceContainerHelper2 m_aSelectionListeners;
+ ::comphelper::OInterfaceContainerHelper3<XSelectionChangeListener> m_aSelectionListeners;
::cppu::OWeakObject& m_rContext;
sal_Int32 m_nSelectionNestingLevel;
@@ -251,7 +252,7 @@ OApplicationController::OApplicationController(const Reference< XComponentContex
,m_aTableCopyHelper(this)
,m_nAsyncDrop(nullptr)
,m_aSelectContainerEvent( LINK( this, OApplicationController, OnSelectContainer ) )
- ,m_ePreviewMode(E_PREVIEWNONE)
+ ,m_ePreviewMode(PreviewMode::NONE)
,m_eCurrentType(E_NONE)
,m_bNeedToReconnect(false)
,m_bSuspended( false )
@@ -326,14 +327,20 @@ void SAL_CALL OApplicationController::disposing()
if ( m_xDataSource.is() )
{
+ // Should correspond to ODatabaseSource::createArrayHelper in dbaccess/source/core/dataaccess/datasource.cxx
m_xDataSource->removePropertyChangeListener(OUString(), this);
m_xDataSource->removePropertyChangeListener(PROPERTY_INFO, this);
- m_xDataSource->removePropertyChangeListener(PROPERTY_URL, this);
m_xDataSource->removePropertyChangeListener(PROPERTY_ISPASSWORDREQUIRED, this);
+ m_xDataSource->removePropertyChangeListener(PROPERTY_ISREADONLY, this);
m_xDataSource->removePropertyChangeListener(PROPERTY_LAYOUTINFORMATION, this);
+ m_xDataSource->removePropertyChangeListener(PROPERTY_NAME, this);
+ m_xDataSource->removePropertyChangeListener(PROPERTY_NUMBERFORMATSSUPPLIER, this);
+ m_xDataSource->removePropertyChangeListener(PROPERTY_PASSWORD, this);
+ m_xDataSource->removePropertyChangeListener(PROPERTY_SETTINGS, this);
m_xDataSource->removePropertyChangeListener(PROPERTY_SUPPRESSVERSIONCL, this);
m_xDataSource->removePropertyChangeListener(PROPERTY_TABLEFILTER, this);
m_xDataSource->removePropertyChangeListener(PROPERTY_TABLETYPEFILTER, this);
+ m_xDataSource->removePropertyChangeListener(PROPERTY_URL, this);
m_xDataSource->removePropertyChangeListener(PROPERTY_USER, this);
m_xDataSource = nullptr;
}
@@ -347,8 +354,7 @@ void SAL_CALL OApplicationController::disposing()
OUString sUrl = m_xModel->getURL();
if ( !sUrl.isEmpty() )
{
- ::comphelper::NamedValueCollection aArgs( m_xModel->getArgs() );
- if ( aArgs.getOrDefault( "PickListEntry", true ) )
+ if ( ::comphelper::NamedValueCollection::getOrDefault( m_xModel->getArgs(), u"PickListEntry", true ) )
{
OUString aFilter;
INetURLObject aURL( m_xModel->getURL() );
@@ -356,12 +362,13 @@ void SAL_CALL OApplicationController::disposing()
if ( pFilter )
aFilter = pFilter->GetFilterName();
+ OUString sDatabaseName;
// add to svtool history options
- SvtHistoryOptions().AppendItem( EHistoryType::PickList,
+ SvtHistoryOptions::AppendItem( EHistoryType::PickList,
aURL.GetURLNoPass( INetURLObject::DecodeMechanism::NONE ),
aFilter,
- getStrippedDatabaseName(),
- std::nullopt);
+ ::dbaui::getStrippedDatabaseName(m_xDataSource, sDatabaseName),
+ std::nullopt, std::nullopt);
// add to recent document list
if ( aURL.GetProtocol() == INetProtocol::File )
@@ -498,7 +505,8 @@ sal_Bool SAL_CALL OApplicationController::suspend(sal_Bool bSuspend)
)
)
{
- switch (ExecuteQuerySaveDocument(getFrameWeld(), getStrippedDatabaseName()))
+ OUString sDatabaseName;
+ switch (ExecuteQuerySaveDocument(getFrameWeld(), ::dbaui::getStrippedDatabaseName(m_xDataSource, sDatabaseName)))
{
case RET_YES:
Execute(ID_BROWSER_SAVEDOC,Sequence<PropertyValue>());
@@ -792,18 +800,18 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const
break;
case SID_DB_APP_DISABLE_PREVIEW:
aReturn.bEnabled = true;
- aReturn.bChecked = getContainer()->getPreviewMode() == E_PREVIEWNONE;
+ aReturn.bChecked = getContainer()->getPreviewMode() == PreviewMode::NONE;
break;
case SID_DB_APP_VIEW_DOCINFO_PREVIEW:
{
ElementType eType = getContainer()->getElementType();
aReturn.bEnabled = (E_REPORT == eType || E_FORM == eType);
- aReturn.bChecked = getContainer()->getPreviewMode() == E_DOCUMENTINFO;
+ aReturn.bChecked = getContainer()->getPreviewMode() == PreviewMode::DocumentInfo;
}
break;
case SID_DB_APP_VIEW_DOC_PREVIEW:
aReturn.bEnabled = true;
- aReturn.bChecked = getContainer()->getPreviewMode() == E_DOCUMENT;
+ aReturn.bChecked = getContainer()->getPreviewMode() == PreviewMode::Document;
break;
case ID_BROWSER_UNDO:
aReturn.bEnabled = false;
@@ -906,8 +914,7 @@ namespace
bool bHandled = false;
// try handling the error with an interaction handler
- ::comphelper::NamedValueCollection aArgs( _rxDocument->getArgs() );
- Reference< XInteractionHandler > xHandler( aArgs.getOrDefault( "InteractionHandler", Reference< XInteractionHandler >() ) );
+ Reference< XInteractionHandler > xHandler = ::comphelper::NamedValueCollection::getOrDefault( _rxDocument->getArgs(), u"InteractionHandler", Reference< XInteractionHandler >() );
if ( xHandler.is() )
{
rtl::Reference pRequest( new ::comphelper::OInteractionRequest( _rException ) );
@@ -1026,7 +1033,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
{
if ( pIter->Name == "FormatStringId" )
{
- sal_uLong nTmp;
+ sal_uInt32 nTmp;
if ( pIter->Value >>= nTmp )
pasteFormat(static_cast<SotClipboardFormatId>(nTmp));
break;
@@ -1078,13 +1085,13 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
OUString sUrl;
if ( m_xModel.is() )
sUrl = m_xModel->getURL();
- if ( sUrl.isEmpty() )
- sUrl = SvtPathOptions().GetWorkPath();
::sfx2::FileDialogHelper aFileDlg(
ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION,
FileDialogFlags::NONE, getFrameWeld());
- aFileDlg.SetDisplayDirectory( sUrl );
+ aFileDlg.SetContext(sfx2::FileDialogHelper::BaseSaveAs);
+ if (!sUrl.isEmpty())
+ aFileDlg.SetDisplayDirectory( sUrl );
std::shared_ptr<const SfxFilter> pFilter = getStandardDatabaseFilter();
if ( pFilter )
@@ -1170,7 +1177,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
eType = E_QUERY;
break;
case ID_NEW_QUERY_DESIGN:
- aCreationArgs.put( OUString(PROPERTY_GRAPHICAL_DESIGN), true );
+ aCreationArgs.put( PROPERTY_GRAPHICAL_DESIGN, true );
[[fallthrough]];
case ID_NEW_QUERY_SQL:
eType = E_QUERY;
@@ -1196,7 +1203,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
{
ElementType eType = getContainer()->getElementType();
OUString sName = getContainer()->getQualifiedName( nullptr );
- insertHierachyElement(eType,sName);
+ insertHierarchyElement(eType,sName);
}
break;
case ID_NEW_VIEW_DESIGN:
@@ -1208,11 +1215,11 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
QueryDesigner aDesigner( getORB(), this, getFrame(), true );
::comphelper::NamedValueCollection aCreationArgs;
- aCreationArgs.put( OUString(PROPERTY_GRAPHICAL_DESIGN), ID_NEW_VIEW_DESIGN == _nId );
+ aCreationArgs.put( PROPERTY_GRAPHICAL_DESIGN, ID_NEW_VIEW_DESIGN == _nId );
const Reference< XDataSource > xDataSource( m_xDataSource, UNO_QUERY );
const Reference< XComponent > xComponent = aDesigner.createNew( xDataSource, aCreationArgs );
- onDocumentOpened( OUString(), E_QUERY, E_OPEN_DESIGN, xComponent, nullptr );
+ onDocumentOpened( OUString(), E_QUERY, ElementOpenMode::Design, xComponent, nullptr );
}
}
break;
@@ -1236,17 +1243,17 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
case SID_DB_APP_QUERY_EDIT:
case SID_DB_APP_FORM_EDIT:
case SID_DB_APP_REPORT_EDIT:
- doAction( _nId, E_OPEN_DESIGN );
+ doAction( _nId, ElementOpenMode::Design );
break;
case SID_DB_APP_OPEN:
case SID_DB_APP_TABLE_OPEN:
case SID_DB_APP_QUERY_OPEN:
case SID_DB_APP_FORM_OPEN:
case SID_DB_APP_REPORT_OPEN:
- doAction( _nId, E_OPEN_NORMAL );
+ doAction( _nId, ElementOpenMode::Normal );
break;
case SID_DB_APP_CONVERTTOVIEW:
- doAction( _nId, E_OPEN_NORMAL );
+ doAction( _nId, ElementOpenMode::Normal );
break;
case SID_SELECTALL:
getContainer()->selectAll();
@@ -1255,7 +1262,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
case SID_DB_APP_DSRELDESIGN:
{
Reference< XComponent > xRelationDesigner;
- if ( !m_pSubComponentManager->activateSubFrame( OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN, xRelationDesigner ) )
+ if ( !m_pSubComponentManager->activateSubFrame( OUString(), SID_DB_APP_DSRELDESIGN, ElementOpenMode::Design, xRelationDesigner ) )
{
SharedConnection xConnection( ensureConnection() );
if ( xConnection.is() )
@@ -1264,7 +1271,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
const Reference< XDataSource > xDataSource( m_xDataSource, UNO_QUERY );
const Reference< XComponent > xComponent = aDesigner.createNew( xDataSource );
- onDocumentOpened( OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN, xComponent, nullptr );
+ onDocumentOpened( OUString(), SID_DB_APP_DSRELDESIGN, ElementOpenMode::Design, xComponent, nullptr );
}
}
}
@@ -1318,15 +1325,15 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
m_aSelectContainerEvent.Call( reinterpret_cast< void* >( E_REPORT ) );
break;
case SID_DB_APP_DISABLE_PREVIEW:
- m_ePreviewMode = E_PREVIEWNONE;
+ m_ePreviewMode = PreviewMode::NONE;
getContainer()->switchPreview(m_ePreviewMode);
break;
case SID_DB_APP_VIEW_DOCINFO_PREVIEW:
- m_ePreviewMode = E_DOCUMENTINFO;
+ m_ePreviewMode = PreviewMode::DocumentInfo;
getContainer()->switchPreview(m_ePreviewMode);
break;
case SID_DB_APP_VIEW_DOC_PREVIEW:
- m_ePreviewMode = E_DOCUMENT;
+ m_ePreviewMode = PreviewMode::Document;
getContainer()->switchPreview(m_ePreviewMode);
break;
case SID_MAIL_SENDDOC:
@@ -1337,7 +1344,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
}
break;
case SID_DB_APP_SENDREPORTASMAIL:
- doAction( _nId, E_OPEN_FOR_MAIL );
+ doAction( _nId, ElementOpenMode::Mail );
break;
}
}
@@ -1693,23 +1700,23 @@ bool OApplicationController::onEntryDoubleClick(const weld::TreeView& rTreeView)
if (!rTreeView.get_cursor(xHdlEntry.get()))
return false;
- if (pContainer->isLeaf(rTreeView, *xHdlEntry))
+ if (!pContainer->isLeaf(rTreeView, *xHdlEntry))
+ return false; // not handled
+
+ try
{
- try
- {
- // opens a new frame with either the table or the query or report or form or view
- openElementWithArguments(
- getContainer()->getQualifiedName(xHdlEntry.get()),
- getContainer()->getElementType(),
- E_OPEN_NORMAL,
- 0,
- ::comphelper::NamedValueCollection() );
- return true; // handled
- }
- catch(const Exception&)
- {
- DBG_UNHANDLED_EXCEPTION("dbaccess");
- }
+ // opens a new frame with either the table or the query or report or form or view
+ openElementWithArguments(
+ getContainer()->getQualifiedName(xHdlEntry.get()),
+ getContainer()->getElementType(),
+ ElementOpenMode::Normal,
+ 0,
+ ::comphelper::NamedValueCollection() );
+ return true; // handled
+ }
+ catch(const Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION("dbaccess");
}
return false; // not handled
@@ -1748,7 +1755,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const
return nullptr;
Reference< XComponent > xRet;
- if ( _eOpenMode == E_OPEN_DESIGN )
+ if ( _eOpenMode == ElementOpenMode::Design )
{
// https://bz.apache.org/ooo/show_bug.cgi?id=30382
getContainer()->showPreview(nullptr);
@@ -1758,7 +1765,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const
switch ( _eType )
{
case E_REPORT:
- if ( _eOpenMode != E_OPEN_DESIGN )
+ if ( _eOpenMode != ElementOpenMode::Design )
{
// reports which are opened in a mode other than design are no sub components of our application
// component, but standalone documents.
@@ -1795,7 +1802,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const
::comphelper::NamedValueCollection aArguments( _rAdditionalArguments );
Any aDataSource;
- if ( _eOpenMode == E_OPEN_DESIGN )
+ if ( _eOpenMode == ElementOpenMode::Design )
{
bool bAddViewTypeArg = false;
@@ -1821,7 +1828,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const
if ( bAddViewTypeArg )
{
const bool bQueryGraphicalMode =( _nInstigatorCommand != SID_DB_APP_EDIT_SQL_VIEW );
- aArguments.put( OUString(PROPERTY_GRAPHICAL_DESIGN), bQueryGraphicalMode );
+ aArguments.put( PROPERTY_GRAPHICAL_DESIGN, bQueryGraphicalMode );
}
}
@@ -1829,8 +1836,8 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const
{
pDesigner.reset( new ResultSetBrowser( getORB(), this, m_aCurrentFrame.getFrame(), _eType == E_TABLE ) );
- if ( !aArguments.has( OUString(PROPERTY_SHOWMENU) ) )
- aArguments.put( OUString(PROPERTY_SHOWMENU), makeAny( true ) );
+ if ( !aArguments.has( PROPERTY_SHOWMENU ) )
+ aArguments.put( PROPERTY_SHOWMENU, Any( true ) );
aDataSource <<= getDatabaseName();
}
@@ -1955,7 +1962,7 @@ Reference< XComponent > OApplicationController::newElement( ElementType _eType,
}
if ( xComponent.is() )
- onDocumentOpened( OUString(), _eType, E_OPEN_DESIGN, xComponent, o_rDocumentDefinition );
+ onDocumentOpened( OUString(), _eType, ElementOpenMode::Design, xComponent, o_rDocumentDefinition );
return xComponent;
}
@@ -2154,7 +2161,7 @@ void OApplicationController::onSelectionChanged()
void OApplicationController::showPreviewFor(const ElementType _eType,const OUString& _sName)
{
- if ( m_ePreviewMode == E_PREVIEWNONE )
+ if ( m_ePreviewMode == PreviewMode::NONE )
return;
OApplicationView* pView = getContainer();
@@ -2265,7 +2272,7 @@ Any OApplicationController::getCurrentSelection(weld::TreeView& rControl) const
{
Sequence< NamedDatabaseObject > aSelection;
getContainer()->describeCurrentSelectionForControl(rControl, aSelection);
- return makeAny( aSelection );
+ return Any( aSelection );
}
vcl::Window* OApplicationController::getMenuParent() const
@@ -2286,7 +2293,6 @@ bool OApplicationController::requestQuickHelp(const void* /*pUserData*/, OUStrin
bool OApplicationController::requestDrag(const weld::TreeIter& /*rEntry*/)
{
bool bSuccess = false;
- rtl::Reference<TransferableHelper> pTransfer;
OApplicationView* pContainer = getContainer();
if (pContainer && pContainer->getSelectionCount())
@@ -2324,43 +2330,42 @@ sal_Int8 OApplicationController::queryDrop( const AcceptDropEvent& _rEvt, const
sal_Int8 nActionAskedFor = _rEvt.mnAction;
// check if we're a table or query container
OApplicationView* pView = getContainer();
- if ( pView && !isDataSourceReadOnly() )
+ if ( !pView || isDataSourceReadOnly() )
+ return DND_ACTION_NONE;
+
+ ElementType eType = pView->getElementType();
+ if ( eType == E_NONE || (eType == E_TABLE && isConnectionReadOnly()) )
+ return DND_ACTION_NONE;
+
+ // check for the concrete type
+ if(std::any_of(_rFlavors.begin(),_rFlavors.end(),TAppSupportedSotFunctor(eType)))
+ return DND_ACTION_COPY;
+
+ if ( eType != E_FORM && eType != E_REPORT )
+ return DND_ACTION_NONE;
+
+ sal_Int8 nAction = OComponentTransferable::canExtractComponentDescriptor(_rFlavors,eType == E_FORM) ? DND_ACTION_COPY : DND_ACTION_NONE;
+ if ( nAction == DND_ACTION_NONE )
+ return DND_ACTION_NONE;
+
+ auto xHitEntry = pView->getEntry(_rEvt.maPosPixel);
+ if (xHitEntry)
{
- ElementType eType = pView->getElementType();
- if ( eType != E_NONE && (eType != E_TABLE || !isConnectionReadOnly()) )
+ OUString sName = pView->getQualifiedName(xHitEntry.get());
+ if ( !sName.isEmpty() )
{
- // check for the concrete type
- if(std::any_of(_rFlavors.begin(),_rFlavors.end(),TAppSupportedSotFunctor(eType)))
- return DND_ACTION_COPY;
- if ( eType == E_FORM || eType == E_REPORT )
+ Reference< XHierarchicalNameAccess > xContainer(getElements(pView->getElementType()),UNO_QUERY);
+ if ( xContainer.is() && xContainer->hasByHierarchicalName(sName) )
{
- sal_Int8 nAction = OComponentTransferable::canExtractComponentDescriptor(_rFlavors,eType == E_FORM) ? DND_ACTION_COPY : DND_ACTION_NONE;
- if ( nAction != DND_ACTION_NONE )
- {
- auto xHitEntry = pView->getEntry(_rEvt.maPosPixel);
- if (xHitEntry)
- {
- OUString sName = pView->getQualifiedName(xHitEntry.get());
- if ( !sName.isEmpty() )
- {
- Reference< XHierarchicalNameAccess > xContainer(getElements(pView->getElementType()),UNO_QUERY);
- if ( xContainer.is() && xContainer->hasByHierarchicalName(sName) )
- {
- Reference< XHierarchicalNameAccess > xHitObject(xContainer->getByHierarchicalName(sName),UNO_QUERY);
- if ( xHitObject.is() )
- nAction = nActionAskedFor & DND_ACTION_COPYMOVE;
- }
- else
- nAction = DND_ACTION_NONE;
- }
- }
- }
- return nAction;
+ Reference< XHierarchicalNameAccess > xHitObject(xContainer->getByHierarchicalName(sName),UNO_QUERY);
+ if ( xHitObject.is() )
+ nAction = nActionAskedFor & DND_ACTION_COPYMOVE;
}
+ else
+ nAction = DND_ACTION_NONE;
}
}
-
- return DND_ACTION_NONE;
+ return nAction;
}
sal_Int8 OApplicationController::executeDrop( const ExecuteDropEvent& _rEvt )
@@ -2515,8 +2520,7 @@ void OApplicationController::OnFirstControllerConnected()
{
// If the migration just happened, but was not successful, the document is reloaded.
// In this case, we should not show the warning, again.
- ::comphelper::NamedValueCollection aModelArgs( m_xModel->getArgs() );
- if ( aModelArgs.getOrDefault( "SuppressMigrationWarning", false ) )
+ if ( ::comphelper::NamedValueCollection::getOrDefault( m_xModel->getArgs(), u"SuppressMigrationWarning", false ) )
return;
// also, if the document is read-only, then no migration is possible, and the
@@ -2524,13 +2528,10 @@ void OApplicationController::OnFirstControllerConnected()
if ( Reference< XStorable >( m_xModel, UNO_QUERY_THROW )->isReadonly() )
return;
- SQLWarning aWarning;
- aWarning.Message = DBA_RES(STR_SUB_DOCS_WITH_SCRIPTS);
- SQLException aDetail;
- aDetail.Message = DBA_RES(STR_SUB_DOCS_WITH_SCRIPTS_DETAIL);
- aWarning.NextException <<= aDetail;
+ SQLException aDetail(DBA_RES(STR_SUB_DOCS_WITH_SCRIPTS_DETAIL), {}, {}, 0, {});
+ SQLWarning aWarning(DBA_RES(STR_SUB_DOCS_WITH_SCRIPTS), {}, {}, 0, css::uno::Any(aDetail));
- Reference< XExecutableDialog > xDialog = ErrorMessageDialog::create( getORB(), "", nullptr, makeAny( aWarning ) );
+ Reference< XExecutableDialog > xDialog = ErrorMessageDialog::create( getORB(), "", nullptr, Any( aWarning ) );
xDialog->execute();
}
catch( const Exception& )
@@ -2569,7 +2570,7 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel >
const OUString aPropertyNames[] =
{
- OUString(PROPERTY_URL), OUString(PROPERTY_USER)
+ PROPERTY_URL, PROPERTY_USER
};
// disconnect from old model
@@ -2616,25 +2617,25 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel >
}
// initial preview mode
- if ( m_xDataSource.is() )
+ if ( !m_xDataSource )
+ return true;
+
+ try
{
- try
+ // to get the 'modified' for the data source
+ ::comphelper::NamedValueCollection aLayoutInfo( m_xDataSource->getPropertyValue( PROPERTY_LAYOUTINFORMATION ) );
+ if ( aLayoutInfo.has( INFO_PREVIEW ) )
{
- // to get the 'modified' for the data source
- ::comphelper::NamedValueCollection aLayoutInfo( m_xDataSource->getPropertyValue( PROPERTY_LAYOUTINFORMATION ) );
- if ( aLayoutInfo.has( OUString(INFO_PREVIEW) ) )
- {
- const sal_Int32 nPreviewMode( aLayoutInfo.getOrDefault( INFO_PREVIEW, sal_Int32(0) ) );
- m_ePreviewMode = static_cast< PreviewMode >( nPreviewMode );
- if ( getView() )
- getContainer()->switchPreview( m_ePreviewMode );
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION("dbaccess");
+ const sal_Int32 nPreviewMode( aLayoutInfo.getOrDefault( INFO_PREVIEW, sal_Int32(0) ) );
+ m_ePreviewMode = static_cast< PreviewMode >( nPreviewMode );
+ if ( getView() )
+ getContainer()->switchPreview( m_ePreviewMode );
}
}
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION("dbaccess");
+ }
return true;
}
@@ -2729,7 +2730,7 @@ sal_Bool SAL_CALL OApplicationController::select( const Any& _aSelection )
if ( !( _aSelection >>= aSelectedObjects ) )
{
aSelectedObjects.realloc( 1 );
- if ( !( _aSelection >>= aSelectedObjects[0] ) )
+ if ( !( _aSelection >>= aSelectedObjects.getArray()[0] ) )
throw IllegalArgumentException();
}
@@ -2816,20 +2817,21 @@ Any SAL_CALL OApplicationController::getSelection( )
{ // if no objects are selected, add an entry to the sequence which describes the overall category
// which is selected currently
aCurrentSelection.realloc(1);
- aCurrentSelection[0].Name = getDatabaseName();
+ auto pCurrentSelection = aCurrentSelection.getArray();
+ pCurrentSelection[0].Name = getDatabaseName();
switch ( eType )
{
- case E_TABLE: aCurrentSelection[0].Type = DatabaseObjectContainer::TABLES; break;
- case E_QUERY: aCurrentSelection[0].Type = DatabaseObjectContainer::QUERIES; break;
- case E_FORM: aCurrentSelection[0].Type = DatabaseObjectContainer::FORMS; break;
- case E_REPORT: aCurrentSelection[0].Type = DatabaseObjectContainer::REPORTS; break;
+ case E_TABLE: pCurrentSelection[0].Type = DatabaseObjectContainer::TABLES; break;
+ case E_QUERY: pCurrentSelection[0].Type = DatabaseObjectContainer::QUERIES; break;
+ case E_FORM: pCurrentSelection[0].Type = DatabaseObjectContainer::FORMS; break;
+ case E_REPORT: pCurrentSelection[0].Type = DatabaseObjectContainer::REPORTS; break;
default:
OSL_FAIL( "OApplicationController::getSelection: unexpected current element type!" );
break;
}
}
}
- return makeAny( aCurrentSelection );
+ return Any( aCurrentSelection );
}
} // namespace dbaui
diff --git a/dbaccess/source/ui/app/AppController.hxx b/dbaccess/source/ui/app/AppController.hxx
index cf9306cdb3a2..f50cdfb4daf7 100644
--- a/dbaccess/source/ui/app/AppController.hxx
+++ b/dbaccess/source/ui/app/AppController.hxx
@@ -137,12 +137,6 @@ namespace dbaui
*/
OUString getDatabaseName() const;
- /** returns the stripped database name.
- @return
- The stripped database name either the registered name or if it is a file url the last segment.
- */
- OUString getStrippedDatabaseName() const;
-
/** return the element type for given container
@param _xContainer The container where the element type has to be found
@return the element type corresponding to the given container
@@ -316,7 +310,7 @@ namespace dbaui
@return
<TRUE/> if the insert operations was successful, otherwise <FALSE/>.
*/
- bool insertHierachyElement( ElementType _eType
+ bool insertHierarchyElement( ElementType _eType
,const OUString& _sParentFolder
,bool _bCollection = true
,const css::uno::Reference< css::ucb::XContent>& _xContent = css::uno::Reference< css::ucb::XContent>()
diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx
index 09919dda7e61..a46bfad409fd 100644
--- a/dbaccess/source/ui/app/AppControllerDnD.cxx
+++ b/dbaccess/source/ui/app/AppControllerDnD.cxx
@@ -52,7 +52,7 @@
#include <com/sun/star/sdb/XReportDocumentsSupplier.hpp>
#include <com/sun/star/sdb/XFormDocumentsSupplier.hpp>
#include <svtools/querydelete.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <defaultobjectnamecheck.hxx>
#include <osl/mutex.hxx>
@@ -74,7 +74,6 @@ using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::ucb;
-using namespace ::com::sun::star::util;
void OApplicationController::deleteTables(const std::vector< OUString>& _rList)
{
@@ -314,7 +313,8 @@ const SharedConnection& OApplicationController::ensureConnection( ::dbtools::SQL
SolarMutexGuard aSolarGuard;
OUString sConnectingContext(DBA_RES(STR_COULDNOTCONNECT_DATASOURCE));
- sConnectingContext = sConnectingContext.replaceFirst("$name$", getStrippedDatabaseName());
+ OUString sDatabaseName;
+ sConnectingContext = sConnectingContext.replaceFirst("$name$", ::dbaui::getStrippedDatabaseName(m_xDataSource, sDatabaseName));
// do the connection *without* holding getMutex() to avoid deadlock
// when we are not in the main thread and we need username/password
@@ -744,11 +744,11 @@ bool OApplicationController::paste( ElementType _eType, const svx::ODataAccessDe
::comphelper::copyProperties(xQuery,xNewQuery);
else
{
- xNewQuery->setPropertyValue(PROPERTY_COMMAND,makeAny(sCommand));
- xNewQuery->setPropertyValue(PROPERTY_ESCAPE_PROCESSING,makeAny(bEscapeProcessing));
+ xNewQuery->setPropertyValue(PROPERTY_COMMAND,Any(sCommand));
+ xNewQuery->setPropertyValue(PROPERTY_ESCAPE_PROCESSING,Any(bEscapeProcessing));
}
// insert
- xDestQueries->insertByName( sTargetName, makeAny(xNewQuery) );
+ xDestQueries->insertByName( sTargetName, Any(xNewQuery) );
xNewQuery.set(xDestQueries->getByName( sTargetName),UNO_QUERY);
if ( xQuery.is() && xNewQuery.is() )
{
@@ -786,7 +786,7 @@ bool OApplicationController::paste( ElementType _eType, const svx::ODataAccessDe
{
Reference<XContent> xContent;
_rPasteData[DataAccessDescriptorProperty::Component] >>= xContent;
- return insertHierachyElement(_eType,_sParentFolder,Reference<XNameAccess>(xContent,UNO_QUERY).is(),xContent,_bMove);
+ return insertHierarchyElement(_eType,_sParentFolder,Reference<XNameAccess>(xContent,UNO_QUERY).is(),xContent,_bMove);
}
}
catch(const SQLException&) { showError( SQLExceptionInfo( ::cppu::getCaughtException() ) ); }
@@ -852,10 +852,10 @@ IMPL_LINK_NOARG( OApplicationController, OnAsyncDrop, void*, void )
std::vector< OUString> aList;
sal_Int32 nIndex = 0;
OUString sName = xContent->getIdentifier()->getContentIdentifier();
- OUString sErase = sName.getToken(0,'/',nIndex); // we don't want to have the "private:forms" part
+ std::u16string_view sErase = o3tl::getToken(sName,0,'/',nIndex); // we don't want to have the "private:forms" part
if ( nIndex != -1 )
{
- aList.push_back(sName.copy(sErase.getLength() + 1));
+ aList.push_back(sName.copy(sErase.size() + 1));
deleteObjects( m_aAsyncDrop.nType, aList, false );
}
}
diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx
index 632523e76977..0f6eda11de7b 100644
--- a/dbaccess/source/ui/app/AppControllerGen.cxx
+++ b/dbaccess/source/ui/app/AppControllerGen.cxx
@@ -50,7 +50,7 @@
#include <sfx2/mailmodelapi.hxx>
#include <svx/dbaexchange.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <vcl/mnemonic.hxx>
#include <vcl/svapp.hxx>
@@ -110,7 +110,7 @@ void OApplicationController::convertToView(const OUString& _sName)
Reference<XPropertySet> xView = ::dbaui::createView(sNewName,xConnection,xSourceObject);
if ( !xView.is() )
throw SQLException(DBA_RES(STR_NO_TABLE_FORMAT_INSIDE),*this, "S1000",0,Any());
- getContainer()->elementAdded(E_TABLE,sNewName,makeAny(xView));
+ getContainer()->elementAdded(E_TABLE,sNewName,Any(xView));
}
}
catch(const SQLException& )
@@ -155,6 +155,7 @@ void OApplicationController::openDialog( const OUString& _sServiceName )
weld::WaitObject aWO(getFrameWeld());
Sequence< Any > aArgs(3);
+ auto pArgs = aArgs.getArray();
sal_Int32 nArgPos = 0;
Reference< css::awt::XWindow> xWindow = getTopMostContainerWindow();
@@ -165,9 +166,9 @@ void OApplicationController::openDialog( const OUString& _sServiceName )
xWindow = VCLUnoHelper::GetInterface(getView()->Window::GetParent());
}
// the parent window
- aArgs[nArgPos++] <<= PropertyValue( "ParentWindow",
+ pArgs[nArgPos++] <<= PropertyValue( "ParentWindow",
0,
- makeAny(xWindow),
+ Any(xWindow),
PropertyState_DIRECT_VALUE);
// the initial selection
@@ -176,15 +177,15 @@ void OApplicationController::openDialog( const OUString& _sServiceName )
sInitialSelection = getDatabaseName();
if ( !sInitialSelection.isEmpty() )
{
- aArgs[ nArgPos++ ] <<= PropertyValue(
+ pArgs[ nArgPos++ ] <<= PropertyValue(
"InitialSelection", 0,
- makeAny( sInitialSelection ), PropertyState_DIRECT_VALUE );
+ Any( sInitialSelection ), PropertyState_DIRECT_VALUE );
}
SharedConnection xConnection( getConnection() );
if ( xConnection.is() )
{
- aArgs[ nArgPos++ ] <<= PropertyValue(
+ pArgs[ nArgPos++ ] <<= PropertyValue(
PROPERTY_ACTIVE_CONNECTION, 0,
makeAny( xConnection ), PropertyState_DIRECT_VALUE );
}
@@ -320,7 +321,8 @@ void SAL_CALL OApplicationController::connect( )
// no particular error, but nonetheless could not connect -> throw a generic exception
OUString sConnectingContext( DBA_RES( STR_COULDNOTCONNECT_DATASOURCE ) );
- ::dbtools::throwGenericSQLException( sConnectingContext.replaceFirst( "$name$", getStrippedDatabaseName() ), *this );
+ OUString sDatabaseName;
+ ::dbtools::throwGenericSQLException( sConnectingContext.replaceFirst( "$name$", ::dbaui::getStrippedDatabaseName(m_xDataSource, sDatabaseName) ), *this );
}
}
@@ -432,7 +434,7 @@ Reference< XComponent > SAL_CALL OApplicationController::loadComponentWithArgume
Reference< XComponent > xComponent( openElementWithArguments(
ObjectName,
lcl_objectType2ElementType( ObjectType ),
- ForEditing ? E_OPEN_DESIGN : E_OPEN_NORMAL,
+ ForEditing ? ElementOpenMode::Design : ElementOpenMode::Normal,
ForEditing ? SID_DB_APP_EDIT : SID_DB_APP_OPEN,
::comphelper::NamedValueCollection( Arguments )
) );
@@ -486,7 +488,7 @@ void OApplicationController::previewChanged( sal_Int32 _nMode )
if ( nOldMode != _nMode )
{
aLayoutInfo.put( "Preview", _nMode );
- m_xDataSource->setPropertyValue( PROPERTY_LAYOUTINFORMATION, makeAny( aLayoutInfo.getPropertyValues() ) );
+ m_xDataSource->setPropertyValue( PROPERTY_LAYOUTINFORMATION, Any( aLayoutInfo.getPropertyValues() ) );
}
}
catch ( const Exception& )
@@ -549,12 +551,6 @@ OUString OApplicationController::getDatabaseName() const
return sDatabaseName;
}
-OUString OApplicationController::getStrippedDatabaseName() const
-{
- OUString sDatabaseName;
- return ::dbaui::getStrippedDatabaseName( m_xDataSource, sDatabaseName );
-}
-
void OApplicationController::onDocumentOpened( const OUString& _rName, const sal_Int32 _nType,
const ElementOpenMode _eMode, const Reference< XComponent >& _xDocument, const Reference< XComponent >& _rxDefinition )
{
@@ -579,10 +575,10 @@ void OApplicationController::onDocumentOpened( const OUString& _rName, const sal
}
}
-bool OApplicationController::insertHierachyElement(ElementType _eType, const OUString& _sParentFolder, bool _bCollection, const Reference<XContent>& _xContent, bool _bMove)
+bool OApplicationController::insertHierarchyElement(ElementType _eType, const OUString& _sParentFolder, bool _bCollection, const Reference<XContent>& _xContent, bool _bMove)
{
Reference<XHierarchicalNameContainer> xNames(getElements(_eType), UNO_QUERY);
- return dbaui::insertHierachyElement(getFrameWeld()
+ return dbaui::insertHierarchyElement(getFrameWeld()
,getORB()
,xNames
,_sParentFolder
@@ -638,7 +634,7 @@ void OApplicationController::onLoadedMenu(const Reference< css::frame::XLayoutMa
if ( !_xLayoutManager.is() )
return;
- static constexpr OUStringLiteral s_sStatusbar = u"private:resource/statusbar/statusbar";
+ static constexpr OUString s_sStatusbar = u"private:resource/statusbar/statusbar"_ustr;
_xLayoutManager->createElement( s_sStatusbar );
_xLayoutManager->requestElement( s_sStatusbar );
@@ -666,10 +662,10 @@ void OApplicationController::doAction(sal_uInt16 _nId, const ElementOpenMode _eO
ElementType eType = getContainer()->getElementType();
::comphelper::NamedValueCollection aArguments;
ElementOpenMode eOpenMode = _eOpenMode;
- if ( eType == E_REPORT && E_OPEN_FOR_MAIL == _eOpenMode )
+ if ( eType == E_REPORT && ElementOpenMode::Mail == _eOpenMode )
{
aArguments.put("Hidden",true);
- eOpenMode = E_OPEN_NORMAL;
+ eOpenMode = ElementOpenMode::Normal;
}
std::vector< std::pair< OUString ,Reference< XModel > > > aComponents;
@@ -685,7 +681,7 @@ void OApplicationController::doAction(sal_uInt16 _nId, const ElementOpenMode _eO
}
// special handling for mail, if more than one document is selected attach them all
- if ( _eOpenMode != E_OPEN_FOR_MAIL )
+ if ( _eOpenMode != ElementOpenMode::Mail )
return;
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 18767cc46a51..c4adb2f45935 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -18,7 +18,7 @@
*/
#include "AppDetailPageHelper.hxx"
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tabletree.hxx>
#include <dbtreelistbox.hxx>
#include <com/sun/star/awt/PopupMenu.hpp>
@@ -43,6 +43,7 @@
#include <com/sun/star/util/XCloseable.hpp>
#include <comphelper/propertyvalue.hxx>
#include <comphelper/string.hxx>
+#include <o3tl/string_view.hxx>
#include "AppView.hxx"
#include <helpids.h>
#include <strings.hxx>
@@ -52,7 +53,6 @@
#include <vcl/commandinfoprovider.hxx>
#include <vcl/cvtgrf.hxx>
#include <tools/stream.hxx>
-#include <rtl/ustrbuf.hxx>
#include "AppController.hxx"
#include <com/sun/star/document/XDocumentProperties.hpp>
@@ -80,11 +80,11 @@ namespace dbaui
namespace
{
- bool lcl_findEntry_impl(const TreeListBox& rTree, const OUString& rName, weld::TreeIter& rIter)
+ bool lcl_findEntry_impl(const TreeListBox& rTree, std::u16string_view rName, weld::TreeIter& rIter)
{
bool bReturn = false;
sal_Int32 nIndex = 0;
- OUString sName( rName.getToken(0,'/',nIndex) );
+ std::u16string_view sName( o3tl::getToken(rName,0,'/',nIndex) );
const weld::TreeView& rTreeView = rTree.GetWidget();
bool bEntry = true;
@@ -94,7 +94,7 @@ namespace
{
if ( nIndex != -1 )
{
- sName = rName.getToken(0,'/',nIndex);
+ sName = o3tl::getToken(rName,0,'/',nIndex);
bEntry = rTreeView.iter_children(rIter);
}
else
@@ -111,11 +111,11 @@ namespace
return bReturn;
}
- bool lcl_findEntry(const TreeListBox& rTree, const OUString& rName, weld::TreeIter& rIter)
+ bool lcl_findEntry(const TreeListBox& rTree, std::u16string_view rName, weld::TreeIter& rIter)
{
sal_Int32 nIndex = 0;
- OUString sErase = rName.getToken(0,'/',nIndex); // we don't want to have the "private:forms" part
- return nIndex != -1 && lcl_findEntry_impl(rTree, rName.copy(sErase.getLength() + 1), rIter);
+ std::u16string_view sErase = o3tl::getToken(rName,0,'/',nIndex); // we don't want to have the "private:forms" part
+ return nIndex != -1 && lcl_findEntry_impl(rTree, rName.substr(sErase.size() + 1), rIter);
}
}
@@ -553,7 +553,7 @@ void OAppDetailPageHelper::createPage(ElementType _eType,const Reference< XNameA
{
OSL_ENSURE(E_TABLE != _eType,"E_TABLE isn't allowed.");
- OString sHelpId;
+ OUString sHelpId;
switch( _eType )
{
case E_FORM:
@@ -670,7 +670,7 @@ void OAppDetailPageHelper::fillNames( const Reference< XNameAccess >& _xContaine
}
}
-std::unique_ptr<DBTreeViewBase> OAppDetailPageHelper::createSimpleTree(const OString& rHelpId, ElementType eType)
+std::unique_ptr<DBTreeViewBase> OAppDetailPageHelper::createSimpleTree(const OUString& rHelpId, ElementType eType)
{
const bool bSQLType = eType == E_TABLE || eType == E_QUERY;
std::unique_ptr<DBTreeViewBase> xTreeView(new DBTreeView(m_xBox.get(), bSQLType));
@@ -761,7 +761,7 @@ void OAppDetailPageHelper::elementReplaced(ElementType eType,
std::unique_ptr<weld::TreeIter> OAppDetailPageHelper::elementAdded(ElementType _eType,const OUString& _rName, const Any& _rObject )
{
std::unique_ptr<weld::TreeIter> xRet;
- DBTreeViewBase* pTreeView = m_aLists[_eType].get();
+ DBTreeViewBase* pTreeView = _eType != E_NONE ? m_aLists[_eType].get() : nullptr;
if (!pTreeView)
return xRet;
weld::TreeView& rTreeView = pTreeView->GetWidget();
@@ -875,14 +875,14 @@ IMPL_LINK_NOARG( OAppDetailPageHelper, OnDeleteEntry, LinkParamNone*, void )
bool OAppDetailPageHelper::isPreviewEnabled() const
{
- return m_ePreviewMode != E_PREVIEWNONE;
+ return m_ePreviewMode != PreviewMode::NONE;
}
namespace
{
OUString stripTrailingDots(std::u16string_view rStr)
{
- return comphelper::string::stripEnd(rStr, '.');
+ return OUString(comphelper::string::stripEnd(rStr, '.'));
}
}
@@ -898,18 +898,18 @@ void OAppDetailPageHelper::switchPreview(PreviewMode _eMode,bool _bForce)
OUString aCommand;
switch ( m_ePreviewMode )
{
- case E_PREVIEWNONE:
+ case PreviewMode::NONE:
aCommand = ".uno:DBDisablePreview";
break;
- case E_DOCUMENT:
+ case PreviewMode::Document:
aCommand = ".uno:DBShowDocPreview";
break;
- case E_DOCUMENTINFO:
+ case PreviewMode::DocumentInfo:
if ( getBorderWin().getView()->getAppController().isCommandEnabled(SID_DB_APP_VIEW_DOCINFO_PREVIEW) )
aCommand = ".uno:DBShowDocInfoPreview";
else
{
- m_ePreviewMode = E_PREVIEWNONE;
+ m_ePreviewMode = PreviewMode::NONE;
aCommand = ".uno:DBDisablePreview";
}
break;
@@ -950,13 +950,13 @@ void OAppDetailPageHelper::showPreview(const Reference< XContent >& _xContent)
if ( xContent.is() )
{
css::ucb::Command aCommand;
- if ( m_ePreviewMode == E_DOCUMENT )
+ if ( m_ePreviewMode == PreviewMode::Document )
aCommand.Name = "preview";
else
aCommand.Name = "getDocumentInfo";
Any aPreview = xContent->execute(aCommand,xContent->createCommandIdentifier(),Reference< XCommandEnvironment >());
- if ( m_ePreviewMode == E_DOCUMENT )
+ if ( m_ePreviewMode == PreviewMode::Document )
{
m_xDocumentInfo->Hide();
m_xPreview->Show();
@@ -1043,9 +1043,9 @@ void OAppDetailPageHelper::showPreview( const OUString& _sDataSourceName,
aArgs.put( "Preview", true );
aArgs.put( "ReadOnly", true );
aArgs.put( "AsTemplate", false );
- aArgs.put( OUString(PROPERTY_SHOWMENU), false );
+ aArgs.put( PROPERTY_SHOWMENU, false );
- Reference< XController > xPreview( pDispatcher->openExisting( makeAny( _sDataSourceName ), _sName, aArgs ), UNO_QUERY );
+ Reference< XController > xPreview( pDispatcher->openExisting( Any( _sDataSourceName ), _sName, aArgs ), UNO_QUERY );
bool bClearPreview = !xPreview.is();
// clear the preview when the query or table could not be loaded
@@ -1079,7 +1079,7 @@ namespace
if (!rEvent.IsEnabled)
{
const OUString &rURL = rEvent.FeatureURL.Complete;
- m_rMBPreview.remove_item(rURL.toUtf8());
+ m_rMBPreview.remove_item(rURL);
}
}
@@ -1105,9 +1105,9 @@ IMPL_LINK_NOARG(OAppDetailPageHelper, OnDropdownClickHdl, weld::Toggleable&, voi
auto xFrame = getBorderWin().getView()->getAppController().getFrame();
css::uno::Sequence<css::uno::Any> aArgs {
- css::uno::makeAny(comphelper::makePropertyValue("InToolbar", true)),
- css::uno::makeAny(comphelper::makePropertyValue("ModuleIdentifier", OUString("com.sun.star.sdb.OfficeDatabaseDocument"))),
- css::uno::makeAny(comphelper::makePropertyValue("Frame", xFrame)) };
+ css::uno::Any(comphelper::makePropertyValue("InToolbar", true)),
+ css::uno::Any(comphelper::makePropertyValue("ModuleIdentifier", OUString("com.sun.star.sdb.OfficeDatabaseDocument"))),
+ css::uno::Any(comphelper::makePropertyValue("Frame", xFrame)) };
css::uno::Reference<css::frame::XPopupMenuController> xPopupController
(xPopupMenuFactory->createInstanceWithArgumentsAndContext(".uno:DBPreview", aArgs, xContext), css::uno::UNO_QUERY);
@@ -1152,13 +1152,13 @@ IMPL_LINK_NOARG(OAppDetailPageHelper, OnDropdownClickHdl, weld::Toggleable&, voi
xComponent->dispose();
}
-IMPL_LINK(OAppDetailPageHelper, MenuSelectHdl, const OString&, rIdent, void)
+IMPL_LINK(OAppDetailPageHelper, MenuSelectHdl, const OUString&, rIdent, void)
{
if (rIdent.isEmpty())
return;
css::util::URL aURL;
- aURL.Complete = OUString::fromUtf8(rIdent);
+ aURL.Complete = rIdent;
Reference<XDispatchProvider> xProvider(getBorderWin().getView()->getAppController().getFrame(), UNO_QUERY);
Reference<XDispatch> xDisp = xProvider->queryDispatch(aURL, "_self", 0);
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
index 4428bcfc9f2a..fb47cb70c558 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
@@ -37,8 +37,6 @@ namespace com::sun::star::awt { class XWindow; }
namespace com::sun::star::frame { class XFrame2; }
namespace com::sun::star::io { class XPersist; }
-#define ELEMENT_COUNT size_t(E_ELEMENT_TYPE_COUNT)
-
namespace dbaui
{
class OAppBorderWindow;
@@ -76,7 +74,7 @@ namespace dbaui
// Combines general functionality.
class OAppDetailPageHelper final : public OChildWindow
{
- std::unique_ptr<DBTreeViewBase> m_aLists[ELEMENT_COUNT];
+ std::unique_ptr<DBTreeViewBase> m_aLists[size_t(E_ELEMENT_TYPE_COUNT)];
OAppBorderWindow& m_rBorderWin;
std::unique_ptr<weld::Container> m_xBox;
std::unique_ptr<weld::Widget> m_xFL;
@@ -146,7 +144,7 @@ namespace dbaui
@return
The new tree.
*/
- std::unique_ptr<DBTreeViewBase> createSimpleTree(const OString& rHelpId, ElementType eType);
+ std::unique_ptr<DBTreeViewBase> createSimpleTree(const OUString& rHelpId, ElementType eType);
DECL_LINK( OnEntryDoubleClick, weld::TreeView&, bool );
DECL_LINK( OnEntrySelChange, LinkParamNone*, void );
@@ -156,7 +154,7 @@ namespace dbaui
DECL_LINK( OnDeleteEntry, LinkParamNone*, void );
DECL_LINK(OnDropdownClickHdl, weld::Toggleable&, void);
- DECL_LINK(MenuSelectHdl, const OString&, void);
+ DECL_LINK(MenuSelectHdl, const OUString&, void);
OAppBorderWindow& getBorderWin() const { return m_rBorderWin; }
diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx
index 6c56c6052282..9ea7dcd4e6da 100644
--- a/dbaccess/source/ui/app/AppDetailView.cxx
+++ b/dbaccess/source/ui/app/AppDetailView.cxx
@@ -40,8 +40,6 @@
using namespace ::dbaui;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::ucb;
using namespace ::com::sun::star::graphic;
using namespace ::com::sun::star::ui;
@@ -50,7 +48,7 @@ using namespace ::com::sun::star::beans;
using ::com::sun::star::util::URL;
using ::com::sun::star::sdb::application::NamedDatabaseObject;
-TaskEntry::TaskEntry( const char* _pAsciiUNOCommand, const char* _pHelpID, const char* pTitleResourceID, bool _bHideWhenDisabled )
+TaskEntry::TaskEntry( const char* _pAsciiUNOCommand, TranslateId _pHelpID, TranslateId pTitleResourceID, bool _bHideWhenDisabled )
:sUNOCommand( OUString::createFromAscii( _pAsciiUNOCommand ) )
,pHelpID( _pHelpID )
,sTitle( DBA_RES(pTitleResourceID) )
@@ -60,10 +58,10 @@ TaskEntry::TaskEntry( const char* _pAsciiUNOCommand, const char* _pHelpID, const
void OTasksWindow::updateHelpText()
{
- const char* pHelpTextId = nullptr;
+ TranslateId pHelpTextId;
int nCurEntry = m_xTreeView->get_selected_index();
if (nCurEntry != -1)
- pHelpTextId = reinterpret_cast<TaskEntry*>(m_xTreeView->get_id(nCurEntry).toUInt64())->pHelpID;
+ pHelpTextId = weld::fromId<TaskEntry*>(m_xTreeView->get_id(nCurEntry))->pHelpID;
setHelpText(pHelpTextId);
}
@@ -73,7 +71,7 @@ IMPL_LINK(OTasksWindow, onSelected, weld::TreeView&, rTreeView, bool)
if (m_nCursorIndex != -1)
{
URL aCommand;
- aCommand.Complete = reinterpret_cast<TaskEntry*>(rTreeView.get_id(m_nCursorIndex).toUInt64())->sUNOCommand;
+ aCommand.Complete = weld::fromId<TaskEntry*>(rTreeView.get_id(m_nCursorIndex))->sUNOCommand;
getDetailView()->getBorderWin().getView()->getAppController().executeChecked( aCommand, Sequence< PropertyValue >() );
}
return true;
@@ -135,7 +133,7 @@ OTasksWindow::~OTasksWindow()
Clear();
}
-void OTasksWindow::setHelpText(const char* pId)
+void OTasksWindow::setHelpText(TranslateId pId)
{
if (pId)
m_xHelpText->set_text(DBA_RES(pId));
@@ -175,7 +173,7 @@ void OTasksWindow::fillTaskEntryList( const TaskEntryList& _rList )
size_t nIndex = 0;
for (auto const& task : _rList)
{
- OUString sId = OUString::number(reinterpret_cast<sal_uInt64>(new TaskEntry(task)));
+ OUString sId = weld::toId(new TaskEntry(task));
m_xTreeView->append(sId, task.sTitle);
m_xTreeView->set_image(nIndex++, *pImages++);
}
@@ -192,7 +190,7 @@ void OTasksWindow::fillTaskEntryList( const TaskEntryList& _rList )
void OTasksWindow::Clear()
{
m_xTreeView->all_foreach([this](weld::TreeIter& rEntry){
- TaskEntry* pUserData = reinterpret_cast<TaskEntry*>(m_xTreeView->get_id(rEntry).toUInt64());
+ TaskEntry* pUserData = weld::fromId<TaskEntry*>(m_xTreeView->get_id(rEntry));
delete pUserData;
return false;
});
@@ -208,7 +206,7 @@ OApplicationDetailView::OApplicationDetailView(weld::Container* pParent, OAppBor
, m_xTasksParent(m_xBuilder->weld_container("tasks"))
, m_xContainerParent(m_xBuilder->weld_container("container"))
, m_xTasks(new dbaui::OTitleWindow(m_xTasksParent.get(), STR_TASKS))
- , m_xTitleContainer(new dbaui::OTitleWindow(m_xContainerParent.get(), nullptr))
+ , m_xTitleContainer(new dbaui::OTitleWindow(m_xContainerParent.get(), TranslateId()))
, m_rBorderWin(rBorder)
{
m_xControlHelper = std::make_shared<OAppDetailPageHelper>(m_xTitleContainer->getChildContainer(), m_rBorderWin, ePreviewMode);
@@ -313,7 +311,7 @@ void OApplicationDetailView::impl_fillTaskPaneData(ElementType _eType, TaskPaneD
const TaskPaneData& OApplicationDetailView::impl_getTaskPaneData( ElementType _eType )
{
if ( m_aTaskPaneData.empty() )
- m_aTaskPaneData.resize( ELEMENT_COUNT );
+ m_aTaskPaneData.resize( size_t(E_ELEMENT_TYPE_COUNT) );
OSL_ENSURE( ( _eType >= 0 ) && ( _eType < E_ELEMENT_TYPE_COUNT ), "OApplicationDetailView::impl_getTaskPaneData: illegal element type!" );
TaskPaneData& rData = m_aTaskPaneData[ _eType ];
diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx
index 58b382800865..f074df4401f7 100644
--- a/dbaccess/source/ui/app/AppDetailView.hxx
+++ b/dbaccess/source/ui/app/AppDetailView.hxx
@@ -40,14 +40,14 @@ namespace dbaui
struct TaskEntry
{
OUString sUNOCommand;
- const char* pHelpID;
+ TranslateId pHelpID;
OUString sTitle;
bool bHideWhenDisabled;
// TODO: we should be consistent in the task pane and the menus/toolbars:
// If an entry is disabled in the latter, it should also be disabled in the former.
// If an entry is *hidden* in the former, it should also be hidden in the latter.
- TaskEntry( const char* _pAsciiUNOCommand, const char* pHelpID, const char* pTitleResourceID, bool _bHideWhenDisabled = false );
+ TaskEntry( const char* _pAsciiUNOCommand, TranslateId pHelpID, TranslateId pTitleResourceID, bool _bHideWhenDisabled = false );
};
typedef std::vector< TaskEntry > TaskEntryList;
@@ -56,7 +56,7 @@ namespace dbaui
/// the tasks available in the pane
TaskEntryList aTasks;
/// the resource ID for the title of the pane
- const char* pTitleId;
+ TranslateId pTitleId;
};
class OTasksWindow final : public OChildWindow
@@ -89,7 +89,7 @@ namespace dbaui
void fillTaskEntryList( const TaskEntryList& _rList );
void Clear();
- void setHelpText(const char* pId);
+ void setHelpText(TranslateId pId);
};
class OApplicationDetailView final : public IClipboardTest
diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx
index 0ae6f1eff01b..bd94d52c564b 100644
--- a/dbaccess/source/ui/app/AppIconControl.cxx
+++ b/dbaccess/source/ui/app/AppIconControl.cxx
@@ -69,11 +69,11 @@ OApplicationIconControl::OApplicationIconControl(std::unique_ptr<weld::ScrolledW
void OApplicationIconControl::Fill()
{
- static const struct CategoryDescriptor
+ static constexpr struct CategoryDescriptor
{
- const char* pLabelResId;
+ TranslateId pLabelResId;
ElementType eType;
- const char* aImageResId;
+ OUString aImageResId;
} aCategories[] = { { RID_STR_TABLES_CONTAINER, E_TABLE, BMP_TABLEFOLDER_TREE_L },
{ RID_STR_QUERIES_CONTAINER, E_QUERY, BMP_QUERYFOLDER_TREE_L },
{ RID_STR_FORMS_CONTAINER, E_FORM, BMP_FORMFOLDER_TREE_L },
@@ -85,7 +85,7 @@ void OApplicationIconControl::Fill()
std::unique_ptr<ThumbnailViewItem> xItem(
new ThumbnailViewItem(*this, aCategorie.eType + 1));
xItem->mbBorder = false;
- xItem->maPreview1 = BitmapEx(OUString::createFromAscii(aCategorie.aImageResId));
+ xItem->maPreview1 = BitmapEx(aCategorie.aImageResId);
const Size& rSize = xItem->maPreview1.GetSizePixel();
m_nMaxWidth = std::max(m_nMaxWidth, rSize.Width());
m_nMaxHeight = std::max(m_nMaxHeight, rSize.Height());
diff --git a/dbaccess/source/ui/app/AppSwapWindow.cxx b/dbaccess/source/ui/app/AppSwapWindow.cxx
index ea2066c729c1..ddef5a3a8ac0 100644
--- a/dbaccess/source/ui/app/AppSwapWindow.cxx
+++ b/dbaccess/source/ui/app/AppSwapWindow.cxx
@@ -28,9 +28,6 @@
using namespace ::dbaui;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
OApplicationSwapWindow::OApplicationSwapWindow(weld::Container* pParent,
OAppBorderWindow& rBorderWindow)
diff --git a/dbaccess/source/ui/app/AppTitleWindow.cxx b/dbaccess/source/ui/app/AppTitleWindow.cxx
index 9927b49b2956..d5e604394b2f 100644
--- a/dbaccess/source/ui/app/AppTitleWindow.cxx
+++ b/dbaccess/source/ui/app/AppTitleWindow.cxx
@@ -23,7 +23,7 @@
namespace dbaui
{
-OTitleWindow::OTitleWindow(weld::Container* pParent, const char* pTitleId)
+OTitleWindow::OTitleWindow(weld::Container* pParent, TranslateId pTitleId)
: m_xBuilder(Application::CreateBuilder(pParent, "dbaccess/ui/titlewindow.ui"))
, m_xContainer(m_xBuilder->weld_container("TitleWindow"))
, m_xTitleFrame(m_xBuilder->weld_container("titleparent"))
@@ -46,7 +46,7 @@ void OTitleWindow::setChildWindow(const std::shared_ptr<OChildWindow>& rChild)
m_xChild = rChild;
}
-void OTitleWindow::setTitle(const char* pTitleId)
+void OTitleWindow::setTitle(TranslateId pTitleId)
{
if (!pTitleId)
return;
diff --git a/dbaccess/source/ui/app/AppTitleWindow.hxx b/dbaccess/source/ui/app/AppTitleWindow.hxx
index 161e21e5c3fe..d57f5241650f 100644
--- a/dbaccess/source/ui/app/AppTitleWindow.hxx
+++ b/dbaccess/source/ui/app/AppTitleWindow.hxx
@@ -19,6 +19,7 @@
#pragma once
#include <ChildWindow.hxx>
+#include <unotools/resmgr.hxx>
namespace dbaui
{
@@ -32,7 +33,7 @@ namespace dbaui
std::shared_ptr<OChildWindow> m_xChild;
public:
- OTitleWindow(weld::Container* pParent, const char* pTitleId);
+ OTitleWindow(weld::Container* pParent, TranslateId pTitleId);
~OTitleWindow();
void GrabFocus();
@@ -59,7 +60,7 @@ namespace dbaui
@param pTitleId
The resource id of the title text.
*/
- void setTitle(const char* pTitleId);
+ void setTitle(TranslateId pTitleId);
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/app/AppView.cxx b/dbaccess/source/ui/app/AppView.cxx
index b300df8dfe6c..e6536beecfb8 100644
--- a/dbaccess/source/ui/app/AppView.cxx
+++ b/dbaccess/source/ui/app/AppView.cxx
@@ -19,7 +19,7 @@
#include "AppView.hxx"
#include <strings.hrc>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <vcl/event.hxx>
#include <vcl/weld.hxx>
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
@@ -174,7 +174,7 @@ bool OApplicationView::PreNotify( NotifyEvent& rNEvt )
{
switch(rNEvt.GetType())
{
- case MouseNotifyEvent::KEYINPUT:
+ case NotifyEventType::KEYINPUT:
{
const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
// give the pane the chance to intercept mnemonic accelerators
diff --git a/dbaccess/source/ui/app/AppView.hxx b/dbaccess/source/ui/app/AppView.hxx
index b3a5706c54b5..59a6d477a367 100644
--- a/dbaccess/source/ui/app/AppView.hxx
+++ b/dbaccess/source/ui/app/AppView.hxx
@@ -30,7 +30,6 @@
namespace com::sun::star::beans { class XPropertySet; }
-class Control;
class MnemonicGenerator;
namespace dbaui
diff --git a/dbaccess/source/ui/app/ChildWindow.cxx b/dbaccess/source/ui/app/ChildWindow.cxx
index a8091c8637a5..2f27ccb30b46 100644
--- a/dbaccess/source/ui/app/ChildWindow.cxx
+++ b/dbaccess/source/ui/app/ChildWindow.cxx
@@ -13,7 +13,7 @@
namespace dbaui
{
OChildWindow::OChildWindow(weld::Container* pParent, const OUString& rUIXMLDescription,
- const OString& rID)
+ const OUString& rID)
: m_xBuilder(Application::CreateBuilder(pParent, rUIXMLDescription))
, m_xContainer(m_xBuilder->weld_container(rID))
{
diff --git a/dbaccess/source/ui/app/DocumentInfoPreview.cxx b/dbaccess/source/ui/app/DocumentInfoPreview.cxx
index 7220eb2bdb30..cfa79be20c1f 100644
--- a/dbaccess/source/ui/app/DocumentInfoPreview.cxx
+++ b/dbaccess/source/ui/app/DocumentInfoPreview.cxx
@@ -34,7 +34,7 @@
#include <vcl/svapp.hxx>
#include <svl/itemset.hxx>
#include <tools/datetime.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <unotools/localedatawrapper.hxx>
#include <templwin.hrc>
diff --git a/dbaccess/source/ui/app/subcomponentmanager.cxx b/dbaccess/source/ui/app/subcomponentmanager.cxx
index 0fa0d3b45a0c..712996e093be 100644
--- a/dbaccess/source/ui/app/subcomponentmanager.cxx
+++ b/dbaccess/source/ui/app/subcomponentmanager.cxx
@@ -31,8 +31,9 @@
#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <dbaccess/dataview.hxx>
+#include <utility>
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
@@ -47,7 +48,7 @@ namespace dbaui
using ::com::sun::star::uno::UNO_SET_THROW;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::RuntimeException;
- using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::frame::XFrame;
using ::com::sun::star::frame::XController;
@@ -88,18 +89,14 @@ namespace dbaui
Reference< XPropertySet > xDocumentDefinitionProperties;
SubComponentDescriptor()
- :sName()
- ,nComponentType( -1 )
- ,eOpenMode( E_OPEN_NORMAL )
- ,xFrame()
- ,xController()
- ,xModel()
+ :nComponentType( -1 )
+ ,eOpenMode( ElementOpenMode::Normal )
{
}
- SubComponentDescriptor( const OUString& i_rName, const sal_Int32 i_nComponentType,
+ SubComponentDescriptor( OUString i_sName, const sal_Int32 i_nComponentType,
const ElementOpenMode i_eOpenMode, const Reference< XComponent >& i_rComponent )
- :sName( i_rName )
+ :sName(std::move( i_sName ))
,nComponentType( i_nComponentType )
,eOpenMode( i_eOpenMode )
{
@@ -172,9 +169,9 @@ namespace dbaui
struct SubComponentMatch
{
public:
- SubComponentMatch( const OUString& i_rName, const sal_Int32 i_nComponentType,
+ SubComponentMatch( OUString i_sName, const sal_Int32 i_nComponentType,
const ElementOpenMode i_eOpenMode )
- :m_sName( i_rName )
+ :m_sName(std::move( i_sName ))
,m_nComponentType( i_nComponentType )
,m_eOpenMode( i_eOpenMode )
{
@@ -196,9 +193,9 @@ namespace dbaui
// SubComponentManager_Data
struct SubComponentManager_Data
{
- SubComponentManager_Data( OApplicationController& _rController, const ::comphelper::SharedMutex& _rMutex )
+ SubComponentManager_Data( OApplicationController& _rController, ::comphelper::SharedMutex _aMutex )
:m_rController( _rController )
- ,m_aMutex( _rMutex )
+ ,m_aMutex(std::move( _aMutex ))
{
}
@@ -319,7 +316,7 @@ namespace dbaui
xBroadcaster->notifyDocumentEvent(
OUString::createFromAscii( _pAsciiEventName ),
&_rData.m_rController,
- makeAny( _rComponent.xFrame )
+ Any( _rComponent.xFrame )
);
}
catch( const Exception& )
diff --git a/dbaccess/source/ui/app/templwin.cxx b/dbaccess/source/ui/app/templwin.cxx
index e9940782d630..224d8be0aed9 100644
--- a/dbaccess/source/ui/app/templwin.cxx
+++ b/dbaccess/source/ui/app/templwin.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <algorithm>
#include <core_resource.hxx>
#include <templwin.hrc>
#include "templwin.hxx"
@@ -25,13 +26,9 @@ namespace SvtDocInfoTable_Impl
{
OUString GetString(int nId)
{
- for (size_t i = 0; i < SAL_N_ELEMENTS(STRARY_SVT_DOCINFO); ++i)
- {
- if (STRARY_SVT_DOCINFO[i].second == nId)
- return DBA_RES(STRARY_SVT_DOCINFO[i].first);
- }
-
- return OUString();
+ auto const found = std::find_if(std::begin(STRARY_SVT_DOCINFO), std::end(STRARY_SVT_DOCINFO)
+ , [nId](auto const & docinfo){ return docinfo.second == nId; });
+ return (found != std::end(STRARY_SVT_DOCINFO)) ? DBA_RES(found->first) : OUString();
}
}
diff --git a/dbaccess/source/ui/browser/AsynchronousLink.cxx b/dbaccess/source/ui/browser/AsynchronousLink.cxx
index f42c00d9a944..538ea702c4ac 100644
--- a/dbaccess/source/ui/browser/AsynchronousLink.cxx
+++ b/dbaccess/source/ui/browser/AsynchronousLink.cxx
@@ -24,8 +24,6 @@
using namespace dbaui;
OAsynchronousLink::OAsynchronousLink(const Link<void*, void>& _rHandler)
: m_aHandler(_rHandler)
- , m_aEventSafety()
- , m_aDestructionSafety()
, m_nEventId(nullptr)
{
}
@@ -33,14 +31,14 @@ OAsynchronousLink::OAsynchronousLink(const Link<void*, void>& _rHandler)
OAsynchronousLink::~OAsynchronousLink()
{
{
- ::osl::MutexGuard aEventGuard(m_aEventSafety);
+ std::unique_lock aEventGuard(m_aEventSafety);
if (m_nEventId)
Application::RemoveUserEvent(m_nEventId);
m_nEventId = nullptr;
}
{
- ::osl::MutexGuard aDestructionGuard(m_aDestructionSafety);
+ std::unique_lock aDestructionGuard(m_aDestructionSafety);
// this is just for the case we're deleted while another thread just handled the event :
// if this other thread called our link while we were deleting the event here, the
// link handler blocked. With leaving the above block it continued, but now we are prevented
@@ -50,7 +48,7 @@ OAsynchronousLink::~OAsynchronousLink()
void OAsynchronousLink::Call(void* _pArgument)
{
- ::osl::MutexGuard aEventGuard(m_aEventSafety);
+ std::unique_lock aEventGuard(m_aEventSafety);
if (m_nEventId)
Application::RemoveUserEvent(m_nEventId);
m_nEventId = Application::PostUserEvent(LINK(this, OAsynchronousLink, OnAsyncCall), _pArgument);
@@ -58,7 +56,7 @@ void OAsynchronousLink::Call(void* _pArgument)
void OAsynchronousLink::CancelCall()
{
- ::osl::MutexGuard aEventGuard(m_aEventSafety);
+ std::unique_lock aEventGuard(m_aEventSafety);
if (m_nEventId)
Application::RemoveUserEvent(m_nEventId);
m_nEventId = nullptr;
@@ -67,9 +65,9 @@ void OAsynchronousLink::CancelCall()
IMPL_LINK(OAsynchronousLink, OnAsyncCall, void*, _pArg, void)
{
{
- ::osl::MutexGuard aDestructionGuard(m_aDestructionSafety);
+ std::unique_lock aDestructionGuard(m_aDestructionSafety);
{
- ::osl::MutexGuard aEventGuard(m_aEventSafety);
+ std::unique_lock aEventGuard(m_aEventSafety);
if (!m_nEventId)
// our destructor deleted the event just while we are waiting for m_aEventSafety
// -> get outta here
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index e799ab9c30e6..8a316b331d1e 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -68,7 +68,7 @@
#include <sal/log.hxx>
#include <svx/fmsearch.hxx>
#include <svx/svxdlg.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
@@ -91,27 +91,6 @@ using namespace ::dbtools;
using namespace ::comphelper;
using namespace ::svt;
-#define HANDLE_SQL_ERRORS( action, successflag, context, message ) \
- try \
- { \
- successflag = false; \
- action; \
- successflag = true; \
- } \
- catch(SQLException& e) \
- { \
- SQLException aError = ::dbtools::prependErrorInfo(e, *this, context); \
- css::sdb::SQLErrorEvent aEvent; \
- aEvent.Reason <<= aError; \
- errorOccured(aEvent); \
- } \
- catch(Exception&) \
- { \
- DBG_UNHANDLED_EXCEPTION("dbaccess"); \
- } \
-
-#define DO_SAFE( action, message ) try { action; } catch(Exception&) { SAL_WARN("dbaccess.ui",message); } ;
-
namespace dbaui
{
@@ -146,7 +125,7 @@ class SbaXDataBrowserController::FormControllerImpl
css::frame::XFrameActionListener >
{
friend class SbaXDataBrowserController;
- ::comphelper::OInterfaceContainerHelper2 m_aActivateListeners;
+ ::comphelper::OInterfaceContainerHelper3<css::form::XFormControllerListener> m_aActivateListeners;
SbaXDataBrowserController* m_pOwner;
public:
@@ -525,6 +504,7 @@ Any SAL_CALL SbaXDataBrowserController::queryInterface(const Type& _rType)
SbaXDataBrowserController::SbaXDataBrowserController(const Reference< css::uno::XComponentContext >& _rM)
:SbaXDataBrowserController_Base(_rM)
,m_nRowSetPrivileges(0)
+ ,m_aInvalidateClipboard("dbaui::SbaXDataBrowserController m_aInvalidateClipboard")
,m_aAsyncGetCellFocus(LINK(this, SbaXDataBrowserController, OnAsyncGetCellFocus))
,m_aAsyncDisplayError( LINK( this, SbaXDataBrowserController, OnAsyncDisplayError ) )
,m_sStateSaveRecord(DBA_RES(RID_STR_SAVE_CURRENT_RECORD))
@@ -542,7 +522,6 @@ SbaXDataBrowserController::SbaXDataBrowserController(const Reference< css::uno::
}
osl_atomic_decrement(&m_refCount);
- m_aInvalidateClipboard.SetDebugName("dbaui::SbaXDataBrowserController m_aInvalidateClipboard");
m_aInvalidateClipboard.SetInvokeHandler(LINK(this, SbaXDataBrowserController, OnInvalidateClipboard));
m_aInvalidateClipboard.SetTimeout(300);
}
@@ -733,14 +712,14 @@ bool SbaXDataBrowserController::Construct(vcl::Window* pParent)
// we want to have a grid with a "flat" border
Reference< XPropertySet > xGridSet(m_xGridModel, UNO_QUERY);
if ( xGridSet.is() )
- xGridSet->setPropertyValue(PROPERTY_BORDER, makeAny(sal_Int16(2)));
+ xGridSet->setPropertyValue(PROPERTY_BORDER, Any(sal_Int16(2)));
// marry them
Reference< css::container::XNameContainer > xNameCont(m_xRowSet, UNO_QUERY);
{
OUString sText(DBA_RES(STR_DATASOURCE_GRIDCONTROL_NAME));
- xNameCont->insertByName(sText, makeAny(m_xGridModel));
+ xNameCont->insertByName(sText, Any(m_xGridModel));
}
// create the view
@@ -923,9 +902,7 @@ void SAL_CALL SbaXDataBrowserController::focusGained(const FocusEvent& /*e*/)
{
// notify our activate listeners (registered on the form controller aggregate)
EventObject aEvt(*this);
- ::comphelper::OInterfaceIteratorHelper2 aIter(m_xFormControllerImpl->m_aActivateListeners);
- while (aIter.hasMoreElements())
- static_cast<XFormControllerListener*>(aIter.next())->formActivated(aEvt);
+ m_xFormControllerImpl->m_aActivateListeners.notifyEach( &css::form::XFormControllerListener::formActivated, aEvt );
}
void SAL_CALL SbaXDataBrowserController::focusLost(const FocusEvent& e)
@@ -949,9 +926,7 @@ void SAL_CALL SbaXDataBrowserController::focusLost(const FocusEvent& e)
// notify the listeners that the "form" we represent has been deactivated
EventObject aEvt(*this);
- ::comphelper::OInterfaceIteratorHelper2 aIter(m_xFormControllerImpl->m_aActivateListeners);
- while (aIter.hasMoreElements())
- static_cast<XFormControllerListener*>(aIter.next())->formDeactivated(aEvt);
+ m_xFormControllerImpl->m_aActivateListeners.notifyEach( &css::form::XFormControllerListener::formDeactivated, aEvt );
// commit the changes of the grid control (as we're deactivated)
Reference< XBoundComponent > xCommitable(getBrowserView()->getGridControl(), UNO_QUERY);
@@ -1282,7 +1257,6 @@ sal_Bool SbaXDataBrowserController::approveParameter(const css::form::DatabasePa
return true;
}
- Reference< css::container::XIndexAccess > xParameters = aEvent.Parameters;
SolarMutexGuard aSolarGuard;
// default handling: instantiate an interaction handler and let it handle the parameter request
@@ -1293,9 +1267,9 @@ sal_Bool SbaXDataBrowserController::approveParameter(const css::form::DatabasePa
rtl::Reference<OInteractionAbort> pAbort = new OInteractionAbort;
// the request
ParametersRequest aRequest;
- aRequest.Parameters = xParameters;
+ aRequest.Parameters = aEvent.Parameters;
aRequest.Connection = getConnection(Reference< XRowSet >(aEvent.Source, UNO_QUERY));
- rtl::Reference<OInteractionRequest> pParamRequest = new OInteractionRequest(makeAny(aRequest));
+ rtl::Reference<OInteractionRequest> pParamRequest = new OInteractionRequest(Any(aRequest));
// some knittings
pParamRequest->addContinuation(pParamValues);
pParamRequest->addContinuation(pAbort);
@@ -1606,7 +1580,7 @@ void SbaXDataBrowserController::applyParserOrder(const OUString& _rOldOrder,cons
bool bSuccess = false;
try
{
- xFormSet->setPropertyValue(PROPERTY_ORDER, makeAny(_xParser->getOrder()));
+ xFormSet->setPropertyValue(PROPERTY_ORDER, Any(_xParser->getOrder()));
bSuccess = reloadForm(m_xLoadable);
}
catch(Exception&)
@@ -1615,7 +1589,7 @@ void SbaXDataBrowserController::applyParserOrder(const OUString& _rOldOrder,cons
if (!bSuccess)
{
- xFormSet->setPropertyValue(PROPERTY_ORDER, makeAny(_rOldOrder));
+ xFormSet->setPropertyValue(PROPERTY_ORDER, Any(_rOldOrder));
try
{
@@ -1648,8 +1622,8 @@ void SbaXDataBrowserController::applyParserFilter(const OUString& _rOldFilter, b
try
{
FormErrorHelper aError(this);
- xFormSet->setPropertyValue(PROPERTY_FILTER, makeAny(_xParser->getFilter()));
- xFormSet->setPropertyValue(PROPERTY_HAVING_CLAUSE, makeAny(_xParser->getHavingClause()));
+ xFormSet->setPropertyValue(PROPERTY_FILTER, Any(_xParser->getFilter()));
+ xFormSet->setPropertyValue(PROPERTY_HAVING_CLAUSE, Any(_xParser->getHavingClause()));
xFormSet->setPropertyValue(PROPERTY_APPLYFILTER, css::uno::Any(true));
bSuccess = reloadForm(m_xLoadable);
@@ -1660,8 +1634,8 @@ void SbaXDataBrowserController::applyParserFilter(const OUString& _rOldFilter, b
if (!bSuccess)
{
- xFormSet->setPropertyValue(PROPERTY_FILTER, makeAny(_rOldFilter));
- xFormSet->setPropertyValue(PROPERTY_HAVING_CLAUSE, makeAny(_sOldHaving));
+ xFormSet->setPropertyValue(PROPERTY_FILTER, Any(_rOldFilter));
+ xFormSet->setPropertyValue(PROPERTY_HAVING_CLAUSE, Any(_sOldHaving));
xFormSet->setPropertyValue(PROPERTY_APPLYFILTER, css::uno::Any(_bOldFilterApplied));
try
@@ -1814,7 +1788,7 @@ void SbaXDataBrowserController::ExecuteSearch()
OSL_ENSURE(xModelSet.is(), "SbaXDataBrowserController::ExecuteSearch : no model set ?!");
xModelSet->setPropertyValue("DisplayIsSynchron", css::uno::Any(false));
xModelSet->setPropertyValue("AlwaysShowCursor", css::uno::Any(true));
- xModelSet->setPropertyValue("CursorColor", makeAny(COL_LIGHTRED));
+ xModelSet->setPropertyValue("CursorColor", Any(COL_LIGHTRED));
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
VclPtr<AbstractFmSearchDialog> pDialog;
@@ -1964,12 +1938,24 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property
Reference< XSingleSelectQueryComposer > xParser = createParser_nothrow();
const OUString sOldSort = xParser->getOrder();
bool bParserSuccess = false;
- HANDLE_SQL_ERRORS(
- xParser->setOrder(OUString()); xParser->appendOrderByColumn(xField, bSortUp),
- bParserSuccess,
- DBA_RES(SBA_BROWSER_SETTING_ORDER),
- "SbaXDataBrowserController::Execute : caught an exception while composing the new filter !"
- )
+ try
+ {
+ bParserSuccess = false;
+ xParser->setOrder(OUString());
+ xParser->appendOrderByColumn(xField, bSortUp);
+ bParserSuccess = true;
+ }
+ catch(SQLException& e)
+ {
+ SQLException aError = ::dbtools::prependErrorInfo(e, *this, DBA_RES(SBA_BROWSER_SETTING_ORDER));
+ css::sdb::SQLErrorEvent aEvent;
+ aEvent.Reason <<= aError;
+ errorOccured(aEvent);
+ }
+ catch(Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION("dbaccess", "SbaXDataBrowserController::Execute : caught an exception while composing the new filter !");
+ }
if (bParserSuccess)
applyParserOrder(sOldSort,xParser);
@@ -2001,8 +1987,22 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property
// -> completely overwrite it, else append one
if (!bApplied)
{
- DO_SAFE( xParser->setFilter( OUString()), "SbaXDataBrowserController::Execute : caught an exception while resetting unapplied filter !" );
- DO_SAFE( xParser->setHavingClause(OUString()), "SbaXDataBrowserController::Execute : caught an exception while resetting unapplied HAVING clause !" );
+ try
+ {
+ xParser->setFilter(OUString());
+ }
+ catch(Exception&)
+ {
+ SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::Execute : caught an exception while resetting unapplied filter !");
+ }
+ try
+ {
+ xParser->setHavingClause(OUString());
+ }
+ catch(Exception&)
+ {
+ SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::Execute : caught an exception while resetting unapplied HAVING clause !");
+ }
}
bool bParserSuccess = false;
@@ -2011,21 +2011,43 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property
if ( bHaving )
{
- HANDLE_SQL_ERRORS(
- xParser->appendHavingClauseByColumn(xField,true,nOp),
- bParserSuccess,
- DBA_RES(SBA_BROWSER_SETTING_FILTER),
- "SbaXDataBrowserController::Execute : caught an exception while composing the new filter !"
- )
+ try
+ {
+ bParserSuccess = false;
+ xParser->appendHavingClauseByColumn(xField,true,nOp);
+ bParserSuccess = true;
+ }
+ catch(SQLException& e)
+ {
+ SQLException aError = ::dbtools::prependErrorInfo(e, *this, DBA_RES(SBA_BROWSER_SETTING_FILTER));
+ css::sdb::SQLErrorEvent aEvent;
+ aEvent.Reason <<= aError;
+ errorOccured(aEvent);
+ }
+ catch(Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION("dbaccess", "SbaXDataBrowserController::Execute : caught an exception while composing the new filter !");
+ }
}
else
{
- HANDLE_SQL_ERRORS(
- xParser->appendFilterByColumn(xField,true,nOp),
- bParserSuccess,
- DBA_RES(SBA_BROWSER_SETTING_FILTER),
- "SbaXDataBrowserController::Execute : caught an exception while composing the new filter !"
- )
+ try
+ {
+ bParserSuccess = false;
+ xParser->appendFilterByColumn(xField,true,nOp);
+ bParserSuccess = true;
+ }
+ catch(SQLException& e)
+ {
+ SQLException aError = ::dbtools::prependErrorInfo(e, *this, DBA_RES(SBA_BROWSER_SETTING_FILTER));
+ css::sdb::SQLErrorEvent aEvent;
+ aEvent.Reason <<= aError;
+ errorOccured(aEvent);
+ }
+ catch(Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION("dbaccess", "SbaXDataBrowserController::Execute : caught an exception while composing the new filter !");
+ }
}
if (bParserSuccess)
@@ -2056,9 +2078,9 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property
Reference< XPropertySet > xSet(getRowSet(), UNO_QUERY);
if ( xSet.is() )
{
- xSet->setPropertyValue(PROPERTY_FILTER,makeAny(OUString()));
- xSet->setPropertyValue(PROPERTY_HAVING_CLAUSE,makeAny(OUString()));
- xSet->setPropertyValue(PROPERTY_ORDER,makeAny(OUString()));
+ xSet->setPropertyValue(PROPERTY_FILTER,Any(OUString()));
+ xSet->setPropertyValue(PROPERTY_HAVING_CLAUSE,Any(OUString()));
+ xSet->setPropertyValue(PROPERTY_ORDER,Any(OUString()));
}
try
{
diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx
index 4aa7c4c5abb9..19ec1ef44a5a 100644
--- a/dbaccess/source/ui/browser/brwview.cxx
+++ b/dbaccess/source/ui/browser/brwview.cxx
@@ -32,7 +32,6 @@
using namespace dbaui;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::form;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
@@ -251,7 +250,7 @@ SbaGridControl* UnoDataBrowserView::getVclControl() const
Reference< css::awt::XWindowPeer > xPeer = m_xGrid->getPeer();
if ( xPeer.is() )
{
- SbaXGridPeer* pPeer = comphelper::getUnoTunnelImplementation<SbaXGridPeer>(xPeer);
+ SbaXGridPeer* pPeer = dynamic_cast<SbaXGridPeer*>(xPeer.get());
UnoDataBrowserView* pTHIS = const_cast<UnoDataBrowserView*>(this);
if ( pPeer )
{
@@ -292,7 +291,7 @@ void UnoDataBrowserView::_disposing( const css::lang::EventObject& /*_rSource*/
bool UnoDataBrowserView::PreNotify( NotifyEvent& rNEvt )
{
bool bDone = false;
- if(rNEvt.GetType() == MouseNotifyEvent::KEYINPUT)
+ if(rNEvt.GetType() == NotifyEventType::KEYINPUT)
{
bool bGrabAllowed = isGrabVclControlFocusAllowed(this);
if ( bGrabAllowed )
diff --git a/dbaccess/source/ui/browser/dataview.cxx b/dbaccess/source/ui/browser/dataview.cxx
index b48a3f0adb17..84716351d45a 100644
--- a/dbaccess/source/ui/browser/dataview.cxx
+++ b/dbaccess/source/ui/browser/dataview.cxx
@@ -23,16 +23,14 @@
#include <comphelper/namedvaluecollection.hxx>
#include <dbaccess/IController.hxx>
#include <svtools/acceleratorexecute.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <vcl/event.hxx>
#include <vcl/settings.hxx>
namespace dbaui
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::util;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::frame;
ODataView::ODataView( vcl::Window* pParent,
@@ -70,7 +68,7 @@ namespace dbaui
{
// draw the background
{
- rRenderContext.Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
+ rRenderContext.Push(vcl::PushFlags::LINECOLOR | vcl::PushFlags::FILLCOLOR);
rRenderContext.SetLineColor(COL_TRANSPARENT);
rRenderContext.SetFillColor(GetSettings().GetStyleSettings().GetFaceColor());
rRenderContext.DrawRect(_rRect);
@@ -98,7 +96,7 @@ namespace dbaui
bool bHandled = false;
switch ( _rNEvt.GetType() )
{
- case MouseNotifyEvent::KEYINPUT:
+ case NotifyEventType::KEYINPUT:
{
const KeyEvent* pKeyEvent = _rNEvt.GetKeyEvent();
const vcl::KeyCode& aKeyCode = pKeyEvent->GetKeyCode();
@@ -107,9 +105,9 @@ namespace dbaui
return true;
[[fallthrough]];
}
- case MouseNotifyEvent::KEYUP:
- case MouseNotifyEvent::MOUSEBUTTONDOWN:
- case MouseNotifyEvent::MOUSEBUTTONUP:
+ case NotifyEventType::KEYUP:
+ case NotifyEventType::MOUSEBUTTONDOWN:
+ case NotifyEventType::MOUSEBUTTONUP:
bHandled = m_xController->interceptUserInput( _rNEvt );
break;
default:
diff --git a/dbaccess/source/ui/browser/dbexchange.cxx b/dbaccess/source/ui/browser/dbexchange.cxx
index dc6398f48aea..dc318dc0f61c 100644
--- a/dbaccess/source/ui/browser/dbexchange.cxx
+++ b/dbaccess/source/ui/browser/dbexchange.cxx
@@ -140,14 +140,14 @@ namespace dbaui
osl_atomic_decrement( &m_refCount );
}
- bool ODataClipboard::WriteObject( ::tools::SvRef<SotTempStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& /*rFlavor*/ )
+ bool ODataClipboard::WriteObject( SvStream& rOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& /*rFlavor*/ )
{
if (nUserObjectId == FORMAT_OBJECT_ID_RTF || nUserObjectId == FORMAT_OBJECT_ID_HTML )
{
ODatabaseImportExport* pExport = static_cast<ODatabaseImportExport*>(pUserObject);
- if ( pExport && rxOStm.is() )
+ if ( pExport )
{
- pExport->setStream(rxOStm.get());
+ pExport->setStream(&rOStm);
return pExport->Write();
}
}
diff --git a/dbaccess/source/ui/browser/dbloader.cxx b/dbaccess/source/ui/browser/dbloader.cxx
index 3530bf7a6acd..0eeba92634a5 100644
--- a/dbaccess/source/ui/browser/dbloader.cxx
+++ b/dbaccess/source/ui/browser/dbloader.cxx
@@ -36,8 +36,9 @@
#include <comphelper/types.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/urlobj.hxx>
+#include <unotools/fcm.hxx>
#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
@@ -113,22 +114,17 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU
m_xListener = rListener;
m_aArgs = rArgs;
- static const struct ServiceNameToImplName
+ static constexpr struct ServiceNameToImplName
{
- const char* pAsciiServiceName;
+ OUString sServiceName;
const char* pAsciiImplementationName;
- ServiceNameToImplName( const char* _pService, const char* _pImpl )
- :pAsciiServiceName( _pService )
- ,pAsciiImplementationName( _pImpl )
- {
- }
} aImplementations[] = {
- ServiceNameToImplName( URL_COMPONENT_FORMGRIDVIEW, "org.openoffice.comp.dbu.OFormGridView" ),
- ServiceNameToImplName( URL_COMPONENT_DATASOURCEBROWSER, "org.openoffice.comp.dbu.ODatasourceBrowser" ),
- ServiceNameToImplName( URL_COMPONENT_QUERYDESIGN, "org.openoffice.comp.dbu.OQueryDesign" ),
- ServiceNameToImplName( URL_COMPONENT_TABLEDESIGN, "org.openoffice.comp.dbu.OTableDesign" ),
- ServiceNameToImplName( URL_COMPONENT_RELATIONDESIGN, "org.openoffice.comp.dbu.ORelationDesign" ),
- ServiceNameToImplName( URL_COMPONENT_VIEWDESIGN, "org.openoffice.comp.dbu.OViewDesign" )
+ { URL_COMPONENT_FORMGRIDVIEW, "org.openoffice.comp.dbu.OFormGridView" },
+ { URL_COMPONENT_DATASOURCEBROWSER, "org.openoffice.comp.dbu.ODatasourceBrowser" },
+ { URL_COMPONENT_QUERYDESIGN, "org.openoffice.comp.dbu.OQueryDesign" },
+ { URL_COMPONENT_TABLEDESIGN, "org.openoffice.comp.dbu.OTableDesign" },
+ { URL_COMPONENT_RELATIONDESIGN, "org.openoffice.comp.dbu.ORelationDesign" },
+ { URL_COMPONENT_VIEWDESIGN, "org.openoffice.comp.dbu.OViewDesign" }
};
INetURLObject aParser( rURL );
@@ -137,7 +133,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU
const OUString sComponentURL( aParser.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ) );
for (const ServiceNameToImplName& aImplementation : aImplementations)
{
- if ( sComponentURL.equalsAscii( aImplementation.pAsciiServiceName ) )
+ if ( sComponentURL == aImplementation.sServiceName )
{
xController.set( m_xContext->getServiceManager()->
createInstanceWithContext( OUString::createFromAscii( aImplementation.pAsciiImplementationName ), m_xContext), UNO_QUERY_THROW );
@@ -182,9 +178,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU
if ( xReportModel.is() )
{
xController.set( ReportDesign::create( m_xContext ) );
- xController->attachModel( xReportModel );
- xReportModel->connectController( xController );
- xReportModel->setCurrentController( xController );
+ utl::ConnectModelController(xReportModel, xController);
}
}
@@ -221,7 +215,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU
try
{
Reference<XInitialization > xIni(xController,UNO_QUERY);
- PropertyValue aFrame("Frame",0,makeAny(rFrame),PropertyState_DIRECT_VALUE);
+ PropertyValue aFrame("Frame",0,Any(rFrame),PropertyState_DIRECT_VALUE);
Sequence< Any > aInitArgs(m_aArgs.getLength()+1);
Any* pBegin = aInitArgs.getArray();
diff --git a/dbaccess/source/ui/browser/dbtreemodel.hxx b/dbaccess/source/ui/browser/dbtreemodel.hxx
index 2ea11b900975..53a34a8e4247 100644
--- a/dbaccess/source/ui/browser/dbtreemodel.hxx
+++ b/dbaccess/source/ui/browser/dbtreemodel.hxx
@@ -29,9 +29,6 @@
// tables holds the nameaccess for the tables
// table holds the table
-#define CONTAINER_QUERIES sal_uLong( 0 )
-#define CONTAINER_TABLES sal_uLong( 1 )
-
namespace com::sun::star::lang { class XMultiServiceFactory; }
namespace dbaui
diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
index 0db9f29f5236..475768d0f8b8 100644
--- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
+++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
@@ -28,8 +28,6 @@
#include "dbtreemodel.hxx"
using namespace ::com::sun::star::frame;
-using namespace ::dbtools;
-using namespace ::svx;
namespace dbaui
{
@@ -55,59 +53,9 @@ OUString SbaTableQueryBrowser::GetEntryText(const weld::TreeIter& rEntry) const
SbaTableQueryBrowser::EntryType SbaTableQueryBrowser::getEntryType(const weld::TreeIter& rEntry) const
{
- std::unique_ptr<weld::TreeIter> xRootEntry = m_pTreeView->GetRootLevelParent(&rEntry);
- weld::TreeView& rTreeView = m_pTreeView->GetWidget();
-
- if (rTreeView.iter_compare(*xRootEntry, rEntry) == 0)
- return etDatasource;
-
- std::unique_ptr<weld::TreeIter> xEntryParent(rTreeView.make_iterator(&rEntry));
- if (!rTreeView.iter_parent(*xEntryParent))
- xEntryParent.reset();
-
- std::unique_ptr<weld::TreeIter> xTables;
- std::unique_ptr<weld::TreeIter> xQueries;
-
- std::unique_ptr<weld::TreeIter> xContainer = rTreeView.make_iterator(xRootEntry.get());
- if (rTreeView.iter_children(*xContainer))
- {
- // 1st child is queries
- xQueries = rTreeView.make_iterator(xContainer.get());
-
- if (rTreeView.iter_next_sibling(*xContainer))
- {
- // 2nd child is tables
- xTables = rTreeView.make_iterator(xContainer.get());
- }
- }
-
- if (xTables && rTreeView.iter_compare(*xTables, rEntry) == 0)
- return etTableContainer;
-
- if (xQueries && rTreeView.iter_compare(*xQueries, rEntry) == 0)
- return etQueryContainer;
-
- if (xTables && xEntryParent && rTreeView.iter_compare(*xTables, *xEntryParent) == 0)
- return etTableOrView;
-
- if (xQueries && xEntryParent)
- {
- if (rTreeView.iter_compare(*xQueries, *xEntryParent) == 0)
- {
- DBTreeListUserData* pEntryData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(rEntry).toUInt64());
- if (pEntryData)
- return pEntryData->eType;
- return etQuery;
- }
-
- while (rTreeView.iter_compare(*xEntryParent, *xQueries) != 0)
- {
- if (!rTreeView.iter_parent(*xEntryParent))
- return etUnknown;
- }
- }
-
- return etQueryContainer;
+ const weld::TreeView& rTreeView = m_pTreeView->GetWidget();
+ DBTreeListUserData* pEntryData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(rEntry));
+ return pEntryData ? pEntryData->eType : etUnknown;
}
void SbaTableQueryBrowser::select(const weld::TreeIter* pEntry, bool bSelect)
diff --git a/dbaccess/source/ui/browser/dsbrowserDnD.cxx b/dbaccess/source/ui/browser/dsbrowserDnD.cxx
index 7d51a5abf8fb..774f43b4c7a4 100644
--- a/dbaccess/source/ui/browser/dsbrowserDnD.cxx
+++ b/dbaccess/source/ui/browser/dsbrowserDnD.cxx
@@ -31,7 +31,7 @@
#include <connectivity/dbtools.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <svx/dataaccessdescriptor.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <vcl/svapp.hxx>
@@ -43,16 +43,8 @@ namespace dbaui
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::sdbcx;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::util;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::container;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::form;
- using namespace ::com::sun::star::io;
- using namespace ::com::sun::star::i18n;
- using namespace ::com::sun::star::task;
using namespace ::com::sun::star::datatransfer;
using namespace ::dbtools;
using namespace ::svx;
@@ -232,7 +224,7 @@ namespace dbaui
weld::TreeView& rTreeView = m_pTreeView->GetWidget();
rTreeView.all_foreach([this, &rTreeView](weld::TreeIter& rEntryLoop){
// clear the user data of the tree model
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(rEntryLoop).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(rEntryLoop));
if (pData)
{
rTreeView.set_id(rEntryLoop, OUString());
diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx
index e837f6b05439..1beb1b5f2dd7 100644
--- a/dbaccess/source/ui/browser/exsrcbrw.cxx
+++ b/dbaccess/source/ui/browser/exsrcbrw.cxx
@@ -25,11 +25,10 @@
#include <formadapter.hxx>
#include <strings.hxx>
#include <o3tl/any.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <sal/log.hxx>
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::beans;
@@ -104,9 +103,7 @@ void SbaExternalSourceBrowser::modified(const css::lang::EventObject& aEvent)
// multiplex this event to all my listeners
css::lang::EventObject aEvt(*this);
- ::comphelper::OInterfaceIteratorHelper2 aIt(m_aModifyListeners);
- while (aIt.hasMoreElements())
- static_cast< css::util::XModifyListener*>(aIt.next())->modified(aEvt);
+ m_aModifyListeners.notifyEach( &css::util::XModifyListener::modified, aEvt );
}
void SAL_CALL SbaExternalSourceBrowser::dispatch(const css::util::URL& aURL, const Sequence< css::beans::PropertyValue>& aArgs)
@@ -160,7 +157,7 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const css::util::URL& aURL, con
// set its properties
if (xNewColProperties.is())
{
- for (const css::beans::PropertyValue& rControlProp : std::as_const(aControlProps))
+ for (const css::beans::PropertyValue& rControlProp : aControlProps)
{
try
{
@@ -183,7 +180,7 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const css::util::URL& aURL, con
nControlPos = 0;
// append the column
- xColContainer->insertByIndex(nControlPos, makeAny(xNewCol));
+ xColContainer->insertByIndex(nControlPos, Any(xNewCol));
}
else if ( aURL.Complete == ".uno:FormSlots/ClearView" )
{
diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx
index 9620d5840a34..24791b44fff5 100644
--- a/dbaccess/source/ui/browser/formadapter.cxx
+++ b/dbaccess/source/ui/browser/formadapter.cxx
@@ -89,13 +89,42 @@ Any SAL_CALL SbaXFormAdapter::queryInterface(const Type& _rType)
void SbaXFormAdapter::StopListening()
{
// log off all our multiplexers
- STOP_MULTIPLEXER_LISTENING(LoadListener, m_aLoadListeners, css::form::XLoadable, m_xMainForm);
- STOP_MULTIPLEXER_LISTENING(RowSetListener, m_aRowSetListeners, css::sdbc::XRowSet, m_xMainForm);
- STOP_MULTIPLEXER_LISTENING(RowSetApproveListener, m_aRowSetApproveListeners, css::sdb::XRowSetApproveBroadcaster, m_xMainForm);
- STOP_MULTIPLEXER_LISTENING(SQLErrorListener, m_aErrorListeners, css::sdb::XSQLErrorBroadcaster, m_xMainForm);
- STOP_MULTIPLEXER_LISTENING(SubmitListener, m_aSubmitListeners, css::form::XSubmit, m_xMainForm);
- STOP_MULTIPLEXER_LISTENING(ResetListener, m_aResetListeners, css::form::XReset, m_xMainForm);
-
+ if (m_aLoadListeners.getLength())
+ {
+ css::uno::Reference< css::form::XLoadable > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->removeLoadListener(&m_aLoadListeners);
+ }
+ if (m_aRowSetListeners.getLength())
+ {
+ css::uno::Reference< css::sdbc::XRowSet > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->removeRowSetListener(&m_aRowSetListeners);
+ }
+ if (m_aRowSetApproveListeners.getLength())
+ {
+ css::uno::Reference< css::sdb::XRowSetApproveBroadcaster > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->removeRowSetApproveListener(&m_aRowSetApproveListeners);
+ }
+ if (m_aErrorListeners.getLength())
+ {
+ css::uno::Reference< css::sdb::XSQLErrorBroadcaster > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->removeSQLErrorListener(&m_aErrorListeners);
+ }
+ if (m_aSubmitListeners.getLength())
+ {
+ css::uno::Reference< css::form::XSubmit > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->removeSubmitListener(&m_aSubmitListeners);
+ }
+ if (m_aResetListeners.getLength())
+ {
+ css::uno::Reference< css::form::XReset > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->removeResetListener(&m_aResetListeners);
+ }
if (m_aParameterListeners.getLength())
{
Reference< css::form::XDatabaseParameterBroadcaster > xBroadcaster(m_xMainForm, UNO_QUERY);
@@ -103,8 +132,20 @@ void SbaXFormAdapter::StopListening()
xBroadcaster->removeParameterListener(&m_aParameterListeners);
}
- STOP_PROPERTY_MULTIPLEXER_LISTENING(PropertyChangeListener, m_aPropertyChangeListeners, css::beans::XPropertySet, m_xMainForm);
- STOP_PROPERTY_MULTIPLEXER_LISTENING(VetoableChangeListener, m_aVetoablePropertyChangeListeners, css::beans::XPropertySet, m_xMainForm);
+ if (m_aPropertyChangeListeners.getOverallLen())
+ {
+ css::uno::Reference< css::beans::XPropertySet > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->removePropertyChangeListener(OUString(), &m_aPropertyChangeListeners);
+ }
+
+ if (m_aVetoablePropertyChangeListeners.getOverallLen())
+ {
+ css::uno::Reference< css::beans::XPropertySet > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->removeVetoableChangeListener(OUString(), &m_aVetoablePropertyChangeListeners);
+ }
+
if (m_aPropertiesChangeListeners.getLength())
{
Reference< css::beans::XMultiPropertySet > xBroadcaster(m_xMainForm, UNO_QUERY);
@@ -121,12 +162,42 @@ void SbaXFormAdapter::StopListening()
void SbaXFormAdapter::StartListening()
{
// log off all our multiplexers
- START_MULTIPLEXER_LISTENING(LoadListener, m_aLoadListeners, css::form::XLoadable, m_xMainForm);
- START_MULTIPLEXER_LISTENING(RowSetListener, m_aRowSetListeners, css::sdbc::XRowSet, m_xMainForm);
- START_MULTIPLEXER_LISTENING(RowSetApproveListener, m_aRowSetApproveListeners, css::sdb::XRowSetApproveBroadcaster, m_xMainForm);
- START_MULTIPLEXER_LISTENING(SQLErrorListener, m_aErrorListeners, css::sdb::XSQLErrorBroadcaster, m_xMainForm);
- START_MULTIPLEXER_LISTENING(SubmitListener, m_aSubmitListeners, css::form::XSubmit, m_xMainForm);
- START_MULTIPLEXER_LISTENING(ResetListener, m_aResetListeners, css::form::XReset, m_xMainForm);
+ if (m_aLoadListeners.getLength())
+ {
+ css::uno::Reference< css::form::XLoadable > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->addLoadListener(&m_aLoadListeners);
+ }
+ if (m_aRowSetListeners.getLength())
+ {
+ css::uno::Reference< css::sdbc::XRowSet > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->addRowSetListener(&m_aRowSetListeners);
+ }
+ if (m_aRowSetApproveListeners.getLength())
+ {
+ css::uno::Reference< css::sdb::XRowSetApproveBroadcaster > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->addRowSetApproveListener(&m_aRowSetApproveListeners);
+ }
+ if (m_aErrorListeners.getLength())
+ {
+ css::uno::Reference< css::sdb::XSQLErrorBroadcaster > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->addSQLErrorListener(&m_aErrorListeners);
+ }
+ if (m_aSubmitListeners.getLength())
+ {
+ css::uno::Reference< css::form::XSubmit > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->addSubmitListener(&m_aSubmitListeners);
+ }
+ if (m_aResetListeners.getLength())
+ {
+ css::uno::Reference< css::form::XReset > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->addResetListener(&m_aResetListeners);
+ }
if (m_aParameterListeners.getLength())
{
@@ -135,8 +206,20 @@ void SbaXFormAdapter::StartListening()
xBroadcaster->addParameterListener(&m_aParameterListeners);
}
- START_PROPERTY_MULTIPLEXER_LISTENING(PropertyChangeListener, m_aPropertyChangeListeners, css::beans::XPropertySet, m_xMainForm);
- START_PROPERTY_MULTIPLEXER_LISTENING(VetoableChangeListener, m_aVetoablePropertyChangeListeners, css::beans::XPropertySet, m_xMainForm);
+ if (m_aPropertyChangeListeners.getOverallLen())
+ {
+ css::uno::Reference< css::beans::XPropertySet > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->addPropertyChangeListener(OUString(), &m_aPropertyChangeListeners);
+ }
+
+ if (m_aVetoablePropertyChangeListeners.getOverallLen())
+ {
+ css::uno::Reference< css::beans::XPropertySet > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->addVetoableChangeListener(OUString(), &m_aVetoablePropertyChangeListeners);
+ }
+
if (m_aPropertiesChangeListeners.getLength())
{
Reference< css::beans::XMultiPropertySet > xBroadcaster(m_xMainForm, UNO_QUERY);
@@ -166,9 +249,7 @@ void SbaXFormAdapter::AttachForm(const Reference< css::sdbc::XRowSet >& xNewMast
if (xLoadable->isLoaded())
{
css::lang::EventObject aEvt(*this);
- ::comphelper::OInterfaceIteratorHelper2 aIt(m_aLoadListeners);
- while (aIt.hasMoreElements())
- static_cast< css::form::XLoadListener*>(aIt.next())->unloaded(aEvt);
+ m_aLoadListeners.notifyEach( &css::form::XLoadListener::unloaded, aEvt );
}
}
@@ -184,9 +265,7 @@ void SbaXFormAdapter::AttachForm(const Reference< css::sdbc::XRowSet >& xNewMast
if (xLoadable->isLoaded())
{
css::lang::EventObject aEvt(*this);
- ::comphelper::OInterfaceIteratorHelper2 aIt(m_aLoadListeners);
- while (aIt.hasMoreElements())
- static_cast< css::form::XLoadListener*>(aIt.next())->loaded(aEvt);
+ m_aLoadListeners.notifyEach( &css::form::XLoadListener::loaded, aEvt );
}
// TODO : perhaps _all_ of our listeners should be notified about our new state
@@ -736,7 +815,26 @@ void SAL_CALL SbaXFormAdapter::execute()
m_xMainForm->execute();
}
-IMPLEMENT_LISTENER_ADMINISTRATION(SbaXFormAdapter, sdbc, RowSetListener, m_aRowSetListeners, css::sdbc::XRowSet, m_xMainForm)
+void SAL_CALL SbaXFormAdapter::addRowSetListener(const css::uno::Reference< css::sdbc::XRowSetListener >& l)
+{
+ m_aRowSetListeners.addInterface(l);
+ if (m_aRowSetListeners.getLength() == 1)
+ {
+ css::uno::Reference< css::sdbc::XRowSet > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->addRowSetListener(&m_aRowSetListeners);
+ }
+}
+void SAL_CALL SbaXFormAdapter::removeRowSetListener(const css::uno::Reference< css::sdbc::XRowSetListener >& l)
+{
+ if (m_aRowSetListeners.getLength() == 1)
+ {
+ css::uno::Reference< css::sdbc::XRowSet > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->removeRowSetListener(&m_aRowSetListeners);
+ }
+ m_aRowSetListeners.removeInterface(l);
+}
// css::sdbcx::XDeleteRows
Sequence<sal_Int32> SAL_CALL SbaXFormAdapter::deleteRows(const Sequence< Any >& rows)
@@ -764,10 +862,48 @@ void SAL_CALL SbaXFormAdapter::clearWarnings()
}
// css::sdb::XRowSetApproveBroadcaster
-IMPLEMENT_LISTENER_ADMINISTRATION(SbaXFormAdapter, sdb, RowSetApproveListener, m_aRowSetApproveListeners, css::sdb::XRowSetApproveBroadcaster, m_xMainForm)
+void SAL_CALL SbaXFormAdapter::addRowSetApproveListener(const css::uno::Reference< css::sdb::XRowSetApproveListener >& l)
+{
+ m_aRowSetApproveListeners.addInterface(l);
+ if (m_aRowSetApproveListeners.getLength() == 1)
+ {
+ css::uno::Reference< css::sdb::XRowSetApproveBroadcaster > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->addRowSetApproveListener(&m_aRowSetApproveListeners);
+ }
+}
+void SAL_CALL SbaXFormAdapter::removeRowSetApproveListener(const css::uno::Reference< css::sdb::XRowSetApproveListener >& l)
+{
+ if (m_aRowSetApproveListeners.getLength() == 1)
+ {
+ css::uno::Reference< css::sdb::XRowSetApproveBroadcaster > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->removeRowSetApproveListener(&m_aRowSetApproveListeners);
+ }
+ m_aRowSetApproveListeners.removeInterface(l);
+}
// css::sdbc::XSQLErrorBroadcaster
-IMPLEMENT_LISTENER_ADMINISTRATION(SbaXFormAdapter, sdb, SQLErrorListener, m_aErrorListeners, css::sdb::XSQLErrorBroadcaster, m_xMainForm)
+void SAL_CALL SbaXFormAdapter::addSQLErrorListener(const css::uno::Reference< css::sdb::XSQLErrorListener >& l)
+{
+ m_aErrorListeners.addInterface(l);
+ if (m_aErrorListeners.getLength() == 1)
+ {
+ css::uno::Reference< css::sdb::XSQLErrorBroadcaster > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->addSQLErrorListener(&m_aErrorListeners);
+ }
+}
+void SAL_CALL SbaXFormAdapter::removeSQLErrorListener(const css::uno::Reference< css::sdb::XSQLErrorListener >& l)
+{
+ if (m_aErrorListeners.getLength() == 1)
+ {
+ css::uno::Reference< css::sdb::XSQLErrorBroadcaster > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->removeSQLErrorListener(&m_aErrorListeners);
+ }
+ m_aErrorListeners.removeInterface(l);
+}
// css::sdb::XResultSetAccess
Reference< css::sdbc::XResultSet > SAL_CALL SbaXFormAdapter::createResultSet()
@@ -808,7 +944,26 @@ sal_Bool SAL_CALL SbaXFormAdapter::isLoaded()
return false;
}
-IMPLEMENT_LISTENER_ADMINISTRATION(SbaXFormAdapter, form, LoadListener, m_aLoadListeners, css::form::XLoadable, m_xMainForm)
+void SAL_CALL SbaXFormAdapter::addLoadListener(const css::uno::Reference< css::form::XLoadListener>& l)
+{
+ m_aLoadListeners.addInterface(l);
+ if (m_aLoadListeners.getLength() == 1)
+ {
+ css::uno::Reference< css::form::XLoadable > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->addLoadListener(&m_aLoadListeners);
+ }
+}
+void SAL_CALL SbaXFormAdapter::removeLoadListener(const css::uno::Reference< css::form::XLoadListener >& l)
+{
+ if (m_aLoadListeners.getLength() == 1)
+ {
+ css::uno::Reference< css::form::XLoadable > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->removeLoadListener(&m_aLoadListeners);
+ }
+ m_aLoadListeners.removeInterface(l);
+}
// css::sdbc::XParameters
void SAL_CALL SbaXFormAdapter::setNull(sal_Int32 parameterIndex, sal_Int32 sqlType)
@@ -1014,7 +1169,26 @@ void SAL_CALL SbaXFormAdapter::submit(const Reference< css::awt::XControl >& aCo
xSubmit->submit(aControl, aMouseEvt);
}
-IMPLEMENT_LISTENER_ADMINISTRATION(SbaXFormAdapter, form, SubmitListener, m_aSubmitListeners, css::form::XSubmit, m_xMainForm)
+void SAL_CALL SbaXFormAdapter::addSubmitListener(const css::uno::Reference< css::form::XSubmitListener >& l)
+{
+ m_aSubmitListeners.addInterface(l);
+ if (m_aSubmitListeners.getLength() == 1)
+ {
+ css::uno::Reference< css::form::XSubmit > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->addSubmitListener(&m_aSubmitListeners);
+ }
+}
+void SAL_CALL SbaXFormAdapter::removeSubmitListener(const css::uno::Reference< css::form::XSubmitListener >& l)
+{
+ if (m_aSubmitListeners.getLength() == 1)
+ {
+ css::uno::Reference< css::form::XSubmit > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->removeSubmitListener(&m_aSubmitListeners);
+ }
+ m_aSubmitListeners.removeInterface(l);
+}
// css::awt::XTabControllerModel
sal_Bool SAL_CALL SbaXFormAdapter::getGroupControl()
@@ -1099,6 +1273,8 @@ void SAL_CALL SbaXFormAdapter::dispose()
xComp->dispose();
}
m_aChildren.clear();
+ m_xMainForm.clear();
+ m_xParent.clear();
}
void SAL_CALL SbaXFormAdapter::addEventListener(const Reference< css::lang::XEventListener >& xListener)
@@ -1134,9 +1310,8 @@ void SAL_CALL SbaXFormAdapter::setFastPropertyValue(sal_Int32 nHandle, const Any
aValue >>= m_sName;
- ::cppu::OInterfaceIteratorHelper aIt(*m_aPropertyChangeListeners.getContainer(PROPERTY_NAME));
- while (aIt.hasMoreElements())
- static_cast< css::beans::XPropertyChangeListener*>(aIt.next())->propertyChange(aEvt);
+ m_aPropertyChangeListeners.getContainer(PROPERTY_NAME)->notifyEach(
+ &XPropertyChangeListener::propertyChange, aEvt );
return;
}
@@ -1150,7 +1325,7 @@ Any SAL_CALL SbaXFormAdapter::getFastPropertyValue(sal_Int32 nHandle)
OSL_ENSURE(xSet.is(), "SAL_CALL SbaXFormAdapter::getFastPropertyValue : have no master form !");
if (m_nNamePropHandle == nHandle)
- return makeAny(m_sName);
+ return Any(m_sName);
return xSet->getFastPropertyValue(nHandle);
}
@@ -1163,7 +1338,7 @@ OUString SAL_CALL SbaXFormAdapter::getName()
void SAL_CALL SbaXFormAdapter::setName(const OUString& aName)
{
- setPropertyValue(PROPERTY_NAME, makeAny(aName));
+ setPropertyValue(PROPERTY_NAME, Any(aName));
}
// css::io::XPersistObject
@@ -1227,13 +1402,14 @@ Sequence< Any > SAL_CALL SbaXFormAdapter::getPropertyValues(const Sequence< OUSt
return Sequence< Any>(aPropertyNames.getLength());
Sequence< Any> aReturn = xSet->getPropertyValues(aPropertyNames);
+ auto aReturnRange = asNonConstRange(aReturn);
// search for (and fake) the NAME property
OSL_ENSURE(aReturn.getLength() == aPropertyNames.getLength(), "SAL_CALL SbaXFormAdapter::getPropertyValues : the main form returned an invalid-length sequence !");
for (sal_Int32 i=0; i<aPropertyNames.getLength(); ++i)
if (aPropertyNames[i] == PROPERTY_NAME)
{
- aReturn[i] <<= m_sName;
+ aReturnRange[i] <<= m_sName;
break;
}
@@ -1297,14 +1473,54 @@ Any SAL_CALL SbaXFormAdapter::getPropertyValue(const OUString& PropertyName)
return xSet->getPropertyValue(PropertyName);
}
-IMPLEMENT_PROPERTY_LISTENER_ADMINISTRATION(SbaXFormAdapter, PropertyChangeListener, m_aPropertyChangeListeners, css::beans::XPropertySet, m_xMainForm);
-IMPLEMENT_PROPERTY_LISTENER_ADMINISTRATION(SbaXFormAdapter, VetoableChangeListener, m_aVetoablePropertyChangeListeners, css::beans::XPropertySet, m_xMainForm);
+void SAL_CALL SbaXFormAdapter::addPropertyChangeListener(const OUString& rName, const css::uno::Reference< css::beans::XPropertyChangeListener>& l )
+{
+ m_aPropertyChangeListeners.addInterface(rName, l);
+ if (m_aPropertyChangeListeners.getOverallLen() == 1)
+ {
+ css::uno::Reference< css::beans::XPropertySet > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->addPropertyChangeListener(OUString(), &m_aPropertyChangeListeners);
+ }
+}
+void SAL_CALL SbaXFormAdapter::removePropertyChangeListener(const OUString& rName, const css::uno::Reference< css::beans::XPropertyChangeListener>& l )
+{
+ if (m_aPropertyChangeListeners.getOverallLen() == 1)
+ {
+ css::uno::Reference< css::beans::XPropertySet > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->removePropertyChangeListener(OUString(), &m_aPropertyChangeListeners);
+ }
+ m_aPropertyChangeListeners.removeInterface(rName, l);
+}
+
+void SAL_CALL SbaXFormAdapter::addVetoableChangeListener(const OUString& rName, const css::uno::Reference< css::beans::XVetoableChangeListener>& l )
+{
+ m_aVetoablePropertyChangeListeners.addInterface(rName, l);
+ if (m_aVetoablePropertyChangeListeners.getOverallLen() == 1)
+ {
+ css::uno::Reference< css::beans::XPropertySet > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->addVetoableChangeListener(OUString(), &m_aVetoablePropertyChangeListeners);
+ }
+}
+void SAL_CALL SbaXFormAdapter::removeVetoableChangeListener(const OUString& rName, const css::uno::Reference< css::beans::XVetoableChangeListener>& l )
+{
+ if (m_aVetoablePropertyChangeListeners.getOverallLen() == 1)
+ {
+ css::uno::Reference< css::beans::XPropertySet > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->removeVetoableChangeListener(OUString(), &m_aVetoablePropertyChangeListeners);
+ }
+ m_aVetoablePropertyChangeListeners.removeInterface(rName, l);
+}
+
// css::util::XCancellable
void SAL_CALL SbaXFormAdapter::cancel()
{
Reference< css::util::XCancellable > xCancel(m_xMainForm, UNO_QUERY);
- if (xCancel.is())
+ if (!xCancel.is())
return;
xCancel->cancel();
}
@@ -1326,7 +1542,7 @@ Sequence< css::beans::PropertyState> SAL_CALL SbaXFormAdapter::getPropertyStates
// set them all to DEFAULT
Sequence< css::beans::PropertyState> aReturn(aPropertyName.getLength());
- for (css::beans::PropertyState& rState : aReturn)
+ for (css::beans::PropertyState& rState : asNonConstRange(aReturn))
rState = css::beans::PropertyState_DEFAULT_VALUE;
return aReturn;
}
@@ -1354,7 +1570,26 @@ void SAL_CALL SbaXFormAdapter::reset()
xReset->reset();
}
-IMPLEMENT_LISTENER_ADMINISTRATION(SbaXFormAdapter, form, ResetListener, m_aResetListeners, css::form::XReset, m_xMainForm)
+void SAL_CALL SbaXFormAdapter::addResetListener(const css::uno::Reference< css::form::XResetListener >& l)
+{
+ m_aResetListeners.addInterface(l);
+ if (m_aResetListeners.getLength() == 1)
+ {
+ css::uno::Reference< css::form::XReset > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->addResetListener(&m_aResetListeners);
+ }
+}
+void SAL_CALL SbaXFormAdapter::removeResetListener(const css::uno::Reference< css::form::XResetListener >& l)
+{
+ if (m_aResetListeners.getLength() == 1)
+ {
+ css::uno::Reference< css::form::XReset > xBroadcaster(m_xMainForm, css::uno::UNO_QUERY);
+ if (xBroadcaster.is())
+ xBroadcaster->removeResetListener(&m_aResetListeners);
+ }
+ m_aResetListeners.removeInterface(l);
+}
// css::container::XNameContainer
void SbaXFormAdapter::implInsert(const Any& aElement, sal_Int32 nIndex, const OUString* pNewElName)
@@ -1376,12 +1611,12 @@ void SbaXFormAdapter::implInsert(const Any& aElement, sal_Int32 nIndex, const OU
if (!xElementSet.is())
{
throw css::lang::IllegalArgumentException();
- }
+ }
OUString sName;
try
{
if (pNewElName)
- xElementSet->setPropertyValue(PROPERTY_NAME, makeAny(*pNewElName));
+ xElementSet->setPropertyValue(PROPERTY_NAME, Any(*pNewElName));
xElementSet->getPropertyValue(PROPERTY_NAME) >>= sName;
}
@@ -1411,9 +1646,7 @@ void SbaXFormAdapter::implInsert(const Any& aElement, sal_Int32 nIndex, const OU
aEvt.Source = *this;
aEvt.Accessor <<= nIndex;
aEvt.Element <<= xElement;
- ::comphelper::OInterfaceIteratorHelper2 aIt(m_aContainerListeners);
- while (aIt.hasMoreElements())
- static_cast< css::container::XContainerListener*>(aIt.next())->elementInserted(aEvt);
+ m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, aEvt );
}
sal_Int32 SbaXFormAdapter::implGetPos(const OUString& rName)
@@ -1462,7 +1695,7 @@ Any SAL_CALL SbaXFormAdapter::getByName(const OUString& aName)
{
throw css::container::NoSuchElementException();
}
- return makeAny(m_aChildren[nPos]);
+ return Any(m_aChildren[nPos]);
}
Sequence< OUString > SAL_CALL SbaXFormAdapter::getElementNames()
@@ -1516,10 +1749,7 @@ void SAL_CALL SbaXFormAdapter::removeByIndex(sal_Int32 _rIndex)
css::container::ContainerEvent aEvt;
aEvt.Source = *this;
aEvt.Element <<= xAffected;
- ::comphelper::OInterfaceIteratorHelper2 aIt(m_aContainerListeners);
- while (aIt.hasMoreElements())
- static_cast< css::container::XContainerListener*>(aIt.next())->elementRemoved(aEvt);
-
+ m_aContainerListeners.notifyEach( &XContainerListener::elementRemoved, aEvt );
}
// css::container::XIndexReplace
@@ -1545,7 +1775,7 @@ void SAL_CALL SbaXFormAdapter::replaceByIndex(sal_Int32 _rIndex, const Any& Elem
if (!xElementSet.is())
{
throw css::lang::IllegalArgumentException();
- }
+ }
OUString sName;
try
{
@@ -1579,9 +1809,7 @@ void SAL_CALL SbaXFormAdapter::replaceByIndex(sal_Int32 _rIndex, const Any& Elem
aEvt.Element <<= xElement;
aEvt.ReplacedElement <<= xOld;
- ::comphelper::OInterfaceIteratorHelper2 aIt(m_aContainerListeners);
- while (aIt.hasMoreElements())
- static_cast< css::container::XContainerListener*>(aIt.next())->elementReplaced(aEvt);
+ m_aContainerListeners.notifyEach( &XContainerListener::elementReplaced, aEvt );
}
// css::container::XIndexAccess
@@ -1596,7 +1824,7 @@ Any SAL_CALL SbaXFormAdapter::getByIndex(sal_Int32 _rIndex)
throw css::lang::IndexOutOfBoundsException();
Reference< css::form::XFormComponent > xElement = *(m_aChildren.begin() + _rIndex);
- return makeAny(xElement);
+ return Any(xElement);
}
// css::container::XContainer
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index 7d0d326605b0..8bde54b54549 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -23,7 +23,7 @@
#include <vcl/weld.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <dbaccess/dataview.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <vcl/stdtext.hxx>
#include <framework/titlehelper.hxx>
@@ -37,7 +37,6 @@
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/ui/XSidebarProvider.hpp>
-#include <sfx2/userinputinterception.hxx>
#include <datasourceconnector.hxx>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
@@ -57,7 +56,6 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::frame::status;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::task;
@@ -67,40 +65,17 @@ using namespace ::dbtools;
using namespace ::comphelper;
#define ALL_FEATURES -1
-#define FIRST_USER_DEFINED_FEATURE ( std::numeric_limits< sal_uInt16 >::max() - 1000 )
-#define LAST_USER_DEFINED_FEATURE ( std::numeric_limits< sal_uInt16 >::max() )
typedef std::unordered_map< sal_Int16, sal_Int16 > CommandHashMap;
namespace dbaui
{
-namespace {
-
-// UserDefinedFeatures
-class UserDefinedFeatures
-{
-public:
- explicit UserDefinedFeatures( const Reference< XController >& _rxController );
-
- void execute( const URL& _rFeatureURL, const Sequence< PropertyValue>& _rArgs );
-
-private:
- css::uno::WeakReference< XController > m_aController;
-};
-
-}
-
-UserDefinedFeatures::UserDefinedFeatures( const Reference< XController >& _rxController )
- :m_aController( _rxController )
-{
-}
-
-void UserDefinedFeatures::execute( const URL& _rFeatureURL, const Sequence< PropertyValue>& _rArgs )
+void OGenericUnoController::executeUserDefinedFeatures( const URL& _rFeatureURL, const Sequence< PropertyValue>& _rArgs )
{
try
{
- Reference< XController > xController( Reference< XController >(m_aController), UNO_SET_THROW );
+ Reference< XController > xController( getXController(), UNO_SET_THROW );
Reference< XDispatchProvider > xDispatchProvider( xController->getFrame(), UNO_QUERY_THROW );
Reference< XDispatch > xDispatch( xDispatchProvider->queryDispatch(
_rFeatureURL,
@@ -123,22 +98,10 @@ void UserDefinedFeatures::execute( const URL& _rFeatureURL, const Sequence< Prop
}
}
-// OGenericUnoController_Data
-struct OGenericUnoController_Data
-{
- ::sfx2::UserInputInterception m_aUserInputInterception;
- UserDefinedFeatures m_aUserDefinedFeatures;
-
- OGenericUnoController_Data( OGenericUnoController& _rController, ::osl::Mutex& _rMutex )
- :m_aUserInputInterception( _rController, _rMutex )
- ,m_aUserDefinedFeatures( _rController.getXController() )
- {
- }
-};
-
// OGenericUnoController
OGenericUnoController::OGenericUnoController(const Reference< XComponentContext >& _rM)
:OGenericUnoController_Base( getMutex() )
+ ,m_aUserInputInterception(*this, getMutex())
,m_pView(nullptr)
#ifdef DBG_UTIL
,m_bDescribingSupportedFeatures( false )
@@ -152,12 +115,6 @@ OGenericUnoController::OGenericUnoController(const Reference< XComponentContext
,m_bCurrentlyModified(false)
,m_bExternalTitle(false)
{
- osl_atomic_increment( &m_refCount );
- {
- m_pData.reset( new OGenericUnoController_Data( *this, getMutex() ) );
- }
- osl_atomic_decrement( &m_refCount );
-
try
{
@@ -209,7 +166,7 @@ IMPL_LINK_NOARG(OGenericUnoController, OnAsyncInvalidateAll, void*, void)
InvalidateFeature_Impl();
}
-void OGenericUnoController::impl_initialize()
+void OGenericUnoController::impl_initialize(const ::comphelper::NamedValueCollection& /*rArguments*/)
{
}
@@ -248,7 +205,6 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen
throw IllegalArgumentException("Parent window is null", *this, 1 );
}
- m_aInitParameters.assign( aArguments );
Construct( pParentWin );
ODataView* pView = getView();
@@ -258,7 +214,7 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen
if ( m_bReadOnly || m_bPreview )
pView->EnableInput( false );
- impl_initialize();
+ impl_initialize(::comphelper::NamedValueCollection(aArguments));
}
catch(Exception&)
{
@@ -372,11 +328,11 @@ namespace
// #i68216# is the bug which requests to fix the code in Draw which relies on
// framework's implementation details
if ( !!_rFeatureState.sTitle )
- _out_rStates.push_back( makeAny( *_rFeatureState.sTitle ) );
- if ( !!_rFeatureState.bChecked )
- _out_rStates.push_back( makeAny( *_rFeatureState.bChecked ) );
- if ( !!_rFeatureState.bInvisible )
- _out_rStates.push_back( makeAny( Visibility( !*_rFeatureState.bInvisible ) ) );
+ _out_rStates.push_back( Any( *_rFeatureState.sTitle ) );
+ if ( _rFeatureState.bChecked.has_value() )
+ _out_rStates.push_back( Any( *_rFeatureState.bChecked ) );
+ if ( _rFeatureState.bInvisible.has_value() )
+ _out_rStates.push_back( Any( Visibility( !*_rFeatureState.bInvisible ) ) );
if ( _rFeatureState.aValue.hasValue() )
_out_rStates.push_back( _rFeatureState.aValue );
if ( _out_rStates.empty() )
@@ -431,7 +387,7 @@ void OGenericUnoController::ImplBroadcastFeatureState(const OUString& _rFeature,
// it is possible that listeners are registered or revoked while
// we are notifying them, so we must use a copy of m_arrStatusListener, not
// m_arrStatusListener itself
- Dispatch aNotifyLoop( m_arrStatusListener );
+ std::vector<DispatchTarget> aNotifyLoop( m_arrStatusListener );
for (auto const& elem : aNotifyLoop)
{
@@ -461,7 +417,7 @@ void OGenericUnoController::InvalidateFeature_Impl()
bool bEmpty = true;
FeatureListener aNextFeature;
{
- ::osl::MutexGuard aGuard( m_aFeatureMutex);
+ std::unique_lock aGuard( m_aFeatureMutex);
bEmpty = m_aFeaturesToInvalidate.empty();
if (!bEmpty)
aNextFeature = m_aFeaturesToInvalidate.front();
@@ -494,7 +450,7 @@ void OGenericUnoController::InvalidateFeature_Impl()
ImplBroadcastFeatureState( aFeaturePos->first, aNextFeature.xListener, aNextFeature.bForceBroadcast );
}
- ::osl::MutexGuard aGuard( m_aFeatureMutex);
+ std::unique_lock aGuard( m_aFeatureMutex);
m_aFeaturesToInvalidate.pop_front();
bEmpty = m_aFeaturesToInvalidate.empty();
if (!bEmpty)
@@ -523,7 +479,7 @@ void OGenericUnoController::ImplInvalidateFeature( sal_Int32 _nId, const Referen
bool bWasEmpty;
{
- ::osl::MutexGuard aGuard( m_aFeatureMutex );
+ std::unique_lock aGuard( m_aFeatureMutex );
bWasEmpty = m_aFeaturesToInvalidate.empty();
m_aFeaturesToInvalidate.push_back( aListener );
}
@@ -549,7 +505,7 @@ void OGenericUnoController::InvalidateAll_Impl()
ImplBroadcastFeatureState( supportedFeature.first, nullptr, true );
{
- ::osl::MutexGuard aGuard( m_aFeatureMutex);
+ std::unique_lock aGuard( m_aFeatureMutex);
OSL_ENSURE(m_aFeaturesToInvalidate.size(), "OGenericUnoController::InvalidateAll_Impl: to be called from within InvalidateFeature_Impl only!");
m_aFeaturesToInvalidate.pop_front();
if(!m_aFeaturesToInvalidate.empty())
@@ -655,14 +611,12 @@ void OGenericUnoController::removeStatusListener(const Reference< XStatusListene
{
if (_rURL.Complete.isEmpty())
{
- m_arrStatusListener.erase(std::remove_if(m_arrStatusListener.begin(), m_arrStatusListener.end(),
- [&aListener](const DispatchTarget& rCurrent) { return rCurrent.xListener == aListener; }),
- m_arrStatusListener.end());
+ std::erase_if(m_arrStatusListener, [&aListener](const DispatchTarget& rCurrent) { return rCurrent.xListener == aListener; });
}
else
{
// remove the listener only for the given URL
- Dispatch::iterator iterSearch = std::find_if(m_arrStatusListener.begin(), m_arrStatusListener.end(),
+ auto iterSearch = std::find_if(m_arrStatusListener.begin(), m_arrStatusListener.end(),
[&aListener, &_rURL](const DispatchTarget& rCurrent) {
return (rCurrent.xListener == aListener) && (rCurrent.aURL.Complete == _rURL.Complete); });
if (iterSearch != m_arrStatusListener.end())
@@ -676,18 +630,14 @@ void OGenericUnoController::removeStatusListener(const Reference< XStatusListene
SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find(_rURL.Complete);
if (aIter != m_aSupportedFeatures.end())
{ // clear the cache for that feature
- StateCache::const_iterator aCachePos = m_aStateCache.find( aIter->second.nFeatureId );
+ auto aCachePos = m_aStateCache.find( aIter->second.nFeatureId );
if ( aCachePos != m_aStateCache.end() )
m_aStateCache.erase( aCachePos );
}
// now remove the listener from the deque
- ::osl::MutexGuard aGuard( m_aFeatureMutex );
- m_aFeaturesToInvalidate.erase(
- std::remove_if( m_aFeaturesToInvalidate.begin(),
- m_aFeaturesToInvalidate.end(),
- FindFeatureListener(aListener))
- ,m_aFeaturesToInvalidate.end());
+ std::unique_lock aGuard( m_aFeatureMutex );
+ std::erase_if( m_aFeaturesToInvalidate, FindFeatureListener(aListener));
}
void OGenericUnoController::releaseNumberForComponent()
@@ -709,7 +659,7 @@ void OGenericUnoController::disposing()
{
EventObject aDisposeEvent;
aDisposeEvent.Source = static_cast<XWeak*>(this);
- Dispatch aStatusListener = m_arrStatusListener;
+ std::vector<DispatchTarget> aStatusListener = m_arrStatusListener;
for (auto const& statusListener : aStatusListener)
{
statusListener.xListener->disposing(aDisposeEvent);
@@ -719,7 +669,7 @@ void OGenericUnoController::disposing()
m_xDatabaseContext = nullptr;
{
- ::osl::MutexGuard aGuard( m_aFeatureMutex);
+ std::unique_lock aGuard( m_aFeatureMutex);
m_aAsyncInvalidateAll.CancelCall();
m_aFeaturesToInvalidate.clear();
}
@@ -735,7 +685,6 @@ void OGenericUnoController::disposing()
m_xSlaveDispatcher = nullptr;
m_xTitleHelper.clear();
m_xUrlTransformer.clear();
- m_aInitParameters.clear();
}
void SAL_CALL OGenericUnoController::addEventListener( const Reference< XEventListener >& xListener )
@@ -757,16 +706,17 @@ void OGenericUnoController::frameAction(const FrameActionEvent& aEvent)
m_aCurrentFrame.frameAction( aEvent.Action );
}
-void OGenericUnoController::implDescribeSupportedFeature( const char* _pAsciiCommandURL,
+void OGenericUnoController::implDescribeSupportedFeature( const OUString& _rCommandURL,
sal_uInt16 _nFeatureId, sal_Int16 _nCommandGroup )
{
#ifdef DBG_UTIL
OSL_ENSURE( m_bDescribingSupportedFeatures, "OGenericUnoController::implDescribeSupportedFeature: bad timing for this call!" );
#endif
- OSL_PRECOND( _nFeatureId < FIRST_USER_DEFINED_FEATURE, "OGenericUnoController::implDescribeSupportedFeature: invalid feature id!" );
+ OSL_PRECOND( _nFeatureId < ( std::numeric_limits< sal_uInt16 >::max() - 1000 ), // FIRST_USER_DEFINED_FEATURE
+ "OGenericUnoController::implDescribeSupportedFeature: invalid feature id!" );
ControllerFeature aFeature;
- aFeature.Command = OUString::createFromAscii( _pAsciiCommandURL );
+ aFeature.Command = _rCommandURL;
aFeature.nFeatureId = _nFeatureId;
aFeature.GroupId = _nCommandGroup;
@@ -816,7 +766,7 @@ void OGenericUnoController::Execute( sal_uInt16 _nId, const Sequence< PropertyVa
// user defined features can be handled by dispatch interceptors resp. protocol handlers only.
// So, we need to do a queryDispatch, and dispatch the URL
- m_pData->m_aUserDefinedFeatures.execute( getURLForId( _nId ), _rArgs );
+ executeUserDefinedFeatures( getURLForId( _nId ), _rArgs );
}
URL OGenericUnoController::getURLForId(sal_Int32 _nId) const
@@ -841,7 +791,11 @@ URL OGenericUnoController::getURLForId(sal_Int32 _nId) const
bool OGenericUnoController::isUserDefinedFeature( const sal_uInt16 _nFeatureId )
{
- return ( _nFeatureId >= FIRST_USER_DEFINED_FEATURE ) && ( _nFeatureId < LAST_USER_DEFINED_FEATURE );
+ return
+ (_nFeatureId >= ( std::numeric_limits< sal_uInt16 >::max() - 1000 )) // test if >= FIRST_USER_DEFINED_FEATURE
+ &&
+ ( _nFeatureId < (std::numeric_limits< sal_uInt16 >::max())) // test if < LAST_USER_DEFINED_FEATURE
+ ;
}
bool OGenericUnoController::isUserDefinedFeature( const OUString& _rFeatureURL ) const
@@ -1047,21 +1001,16 @@ Reference< awt::XWindow> OGenericUnoController::getTopMostContainerWindow() cons
return xWindow;
}
-Reference< XTitle > OGenericUnoController::impl_getTitleHelper_throw()
+Reference< XTitle > OGenericUnoController::impl_getTitleHelper_throw(bool bCreateIfNecessary)
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( getMutex() );
- if ( ! m_xTitleHelper.is ())
+ if (!m_xTitleHelper.is() && bCreateIfNecessary)
{
Reference< XUntitledNumbers > xUntitledProvider(getPrivateModel(), UNO_QUERY );
- Reference< XController > xThis(static_cast< XController* >(this), UNO_QUERY_THROW);
-
- rtl::Reference<::framework::TitleHelper> pHelper = new ::framework::TitleHelper( m_xContext );
- m_xTitleHelper = pHelper;
- pHelper->setOwner (xThis );
- pHelper->connectWithUntitledNumbers (xUntitledProvider);
+ m_xTitleHelper = new ::framework::TitleHelper( m_xContext, Reference< XController >(this), xUntitledProvider );
}
return m_xTitleHelper;
@@ -1095,7 +1044,7 @@ void SAL_CALL OGenericUnoController::addTitleChangeListener(const Reference< XTi
void SAL_CALL OGenericUnoController::removeTitleChangeListener(const Reference< XTitleChangeListener >& xListener)
{
- Reference< XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper_throw(), UNO_QUERY);
+ Reference< XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper_throw(false), UNO_QUERY);
if (xBroadcaster.is ())
xBroadcaster->removeTitleChangeListener (xListener);
}
@@ -1104,23 +1053,23 @@ void SAL_CALL OGenericUnoController::removeTitleChangeListener(const Reference<
void SAL_CALL OGenericUnoController::addKeyHandler( const Reference< XKeyHandler >& _rxHandler )
{
if ( _rxHandler.is() )
- m_pData->m_aUserInputInterception.addKeyHandler( _rxHandler );
+ m_aUserInputInterception.addKeyHandler( _rxHandler );
}
void SAL_CALL OGenericUnoController::removeKeyHandler( const Reference< XKeyHandler >& _rxHandler )
{
- m_pData->m_aUserInputInterception.removeKeyHandler( _rxHandler );
+ m_aUserInputInterception.removeKeyHandler( _rxHandler );
}
void SAL_CALL OGenericUnoController::addMouseClickHandler( const Reference< XMouseClickHandler >& _rxHandler )
{
if ( _rxHandler.is() )
- m_pData->m_aUserInputInterception.addMouseClickHandler( _rxHandler );
+ m_aUserInputInterception.addMouseClickHandler( _rxHandler );
}
void SAL_CALL OGenericUnoController::removeMouseClickHandler( const Reference< XMouseClickHandler >& _rxHandler )
{
- m_pData->m_aUserInputInterception.removeMouseClickHandler( _rxHandler );
+ m_aUserInputInterception.removeMouseClickHandler( _rxHandler );
}
void OGenericUnoController::executeChecked(sal_uInt16 _nCommandId, const Sequence< PropertyValue >& aArgs)
@@ -1146,14 +1095,14 @@ Reference< XController > OGenericUnoController::getXController()
bool OGenericUnoController::interceptUserInput( const NotifyEvent& _rEvent )
{
- return m_pData->m_aUserInputInterception.handleNotifyEvent( _rEvent );
+ return m_aUserInputInterception.handleNotifyEvent( _rEvent );
}
bool OGenericUnoController::isCommandChecked(sal_uInt16 _nCommandId) const
{
FeatureState aState = GetState( _nCommandId );
- return aState.bChecked && *aState.bChecked;
+ return aState.bChecked.has_value() && *aState.bChecked;
}
bool OGenericUnoController::isCommandEnabled( const OUString& _rCompleteCommandURL ) const
@@ -1207,6 +1156,11 @@ void SAL_CALL OGenericUnoController::dispose()
{
SolarMutexGuard aSolarGuard;
OGenericUnoController_Base::dispose();
+ m_xUrlTransformer.clear();
+ m_xSlaveDispatcher.clear();
+ m_xMasterDispatcher.clear();
+ m_xDatabaseContext.clear();
+ m_xTitleHelper.clear();
}
weld::Window* OGenericUnoController::getFrameWeld() const
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index 7c6278d60fe2..f433eaa3b47b 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -18,7 +18,6 @@
*/
#include <core_resource.hxx>
-#include <helpids.h>
#include <sot/exchange.hxx>
@@ -34,25 +33,22 @@
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/awt/XTextComponent.hpp>
#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <svl/numuno.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/svapp.hxx>
-#include <svl/zforlist.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <connectivity/dbtools.hxx>
+#include <comphelper/propertyvalue.hxx>
#include <comphelper/types.hxx>
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/SQLException.hpp>
-#include <browserids.hxx>
#include <strings.hrc>
#include <strings.hxx>
#include <dbexchange.hxx>
-#include <TableRowExchange.hxx>
-#include <TableRow.hxx>
#include <svtools/stringtransfer.hxx>
#include <UITools.hxx>
#include <TokenWriter.hxx>
@@ -63,12 +59,10 @@ using namespace ::com::sun::star::ui::dialogs;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::datatransfer;
using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::view;
using namespace ::com::sun::star::form;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::util;
@@ -131,9 +125,9 @@ rtl::Reference<FmXGridPeer> SbaXGridControl::imp_CreatePeer(vcl::Window* pParent
return pReturn;
}
-Any SAL_CALL SbaXGridControl::queryInterface(const Type& _rType)
+Any SAL_CALL SbaXGridControl::queryAggregation(const Type& _rType)
{
- Any aRet = FmXGridControl::queryInterface(_rType);
+ Any aRet = FmXGridControl::queryAggregation(_rType);
return aRet.hasValue() ? aRet : ::cppu::queryInterface(_rType,static_cast<css::frame::XDispatch*>(this));
}
@@ -241,7 +235,6 @@ void SAL_CALL SbaXGridControl::dispose()
// SbaXGridPeer
SbaXGridPeer::SbaXGridPeer(const Reference< XComponentContext >& _rM)
: FmXGridPeer(_rM)
-,m_aStatusListeners(m_aMutex)
{
}
@@ -251,10 +244,11 @@ SbaXGridPeer::~SbaXGridPeer()
void SAL_CALL SbaXGridPeer::dispose()
{
- EventObject aEvt(*this);
-
- m_aStatusListeners.disposeAndClear(aEvt);
-
+ {
+ std::unique_lock g(m_aMutex);
+ EventObject aEvt(*this);
+ m_aStatusListeners.disposeAndClear(g, aEvt);
+ }
FmXGridPeer::dispose();
}
@@ -279,13 +273,13 @@ void SbaXGridPeer::NotifyStatusChanged(const css::util::URL& _rUrl, const Refere
xControl->statusChanged(aEvt);
else
{
- ::cppu::OInterfaceContainerHelper * pIter = m_aStatusListeners.getContainer(_rUrl);
+ std::unique_lock g(m_aMutex);
+ ::comphelper::OInterfaceContainerHelper4<css::frame::XStatusListener> * pIter
+ = m_aStatusListeners.getContainer(g, _rUrl);
if (pIter)
{
- ::cppu::OInterfaceIteratorHelper aListIter(*pIter);
- while (aListIter.hasMoreElements())
- static_cast< css::frame::XStatusListener*>(aListIter.next())->statusChanged(aEvt);
+ pIter->notifyEach( g, &XStatusListener::statusChanged, aEvt );
}
}
}
@@ -444,19 +438,24 @@ void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const Sequence< PropertyVa
void SAL_CALL SbaXGridPeer::addStatusListener(const Reference< css::frame::XStatusListener > & xControl, const css::util::URL& aURL)
{
- ::cppu::OInterfaceContainerHelper* pCont = m_aStatusListeners.getContainer(aURL);
- if (!pCont)
- m_aStatusListeners.addInterface(aURL,xControl);
- else
- pCont->addInterface(xControl);
+ {
+ std::unique_lock g(m_aMutex);
+ ::comphelper::OInterfaceContainerHelper4< css::frame::XStatusListener >* pCont
+ = m_aStatusListeners.getContainer(g, aURL);
+ if (!pCont)
+ m_aStatusListeners.addInterface(g, aURL,xControl);
+ else
+ pCont->addInterface(g, xControl);
+ }
NotifyStatusChanged(aURL, xControl);
}
void SAL_CALL SbaXGridPeer::removeStatusListener(const Reference< css::frame::XStatusListener > & xControl, const css::util::URL& aURL)
{
- ::cppu::OInterfaceContainerHelper* pCont = m_aStatusListeners.getContainer(aURL);
+ std::unique_lock g(m_aMutex);
+ ::comphelper::OInterfaceContainerHelper4< css::frame::XStatusListener >* pCont = m_aStatusListeners.getContainer(g, aURL);
if ( pCont )
- pCont->removeInterface(xControl);
+ pCont->removeInterface(g, xControl);
}
Sequence< Type > SAL_CALL SbaXGridPeer::getTypes()
@@ -466,8 +465,6 @@ Sequence< Type > SAL_CALL SbaXGridPeer::getTypes()
Sequence { cppu::UnoType<css::frame::XDispatch>::get() });
}
-UNO3_GETIMPLEMENTATION2_IMPL(SbaXGridPeer, FmXGridPeer);
-
VclPtr<FmGridControl> SbaXGridPeer::imp_CreateControl(vcl::Window* pParent, WinBits nStyle)
{
return VclPtr<SbaGridControl>::Create( m_xContext, pParent, this, nStyle);
@@ -522,7 +519,7 @@ void SbaGridHeader::ImplStartColumnDrag(sal_Int8 _nAction, const Point& _rMouseP
tools::Rectangle aColRect = GetItemRect(nId);
aColRect.AdjustLeft(nId ? 3 : 0 ); // the handle col (nId == 0) does not have a left margin for resizing
aColRect.AdjustRight( -3 );
- bResizingCol = !aColRect.IsInside(_rMousePos);
+ bResizingCol = !aColRect.Contains(_rMousePos);
}
if (bResizingCol)
return;
@@ -594,7 +591,7 @@ void SbaGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, weld::Menu& r
rMenu.insert_separator(nPos++, "separator2");
}
-void SbaGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const weld::Menu& rMenu, const OString& rExecutionResult)
+void SbaGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const weld::Menu& rMenu, const OUString& rExecutionResult)
{
if (rExecutionResult == "colwidth")
static_cast<SbaGridControl*>(GetParent())->SetColWidth(nColId);
@@ -667,7 +664,7 @@ SvNumberFormatter* SbaGridControl::GetDatasourceFormatter()
{
Reference< css::util::XNumberFormatsSupplier > xSupplier = ::dbtools::getNumberFormats(::dbtools::getConnection(Reference< XRowSet > (getDataSource(),UNO_QUERY)), true, getContext());
- SvNumberFormatsSupplierObj* pSupplierImpl = comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>( xSupplier );
+ SvNumberFormatsSupplierObj* pSupplierImpl = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>( xSupplier );
if ( !pSupplierImpl )
return nullptr;
@@ -777,14 +774,10 @@ void SbaGridControl::SetBrowserAttrs()
try
{
Reference< XComponentContext > xContext = getContext();
- css::beans::PropertyValue aArg;
- css::uno::Sequence<css::uno::Any> aArguments(2);
- aArg.Name = "IntrospectedObject";
- aArg.Value <<= xGridModel;
- aArguments[0] <<= aArg;
- aArg.Name = "ParentWindow";
- aArg.Value <<= VCLUnoHelper::GetInterface(this);
- aArguments[1] <<= aArg;
+ css::uno::Sequence<css::uno::Any> aArguments{
+ Any(comphelper::makePropertyValue("IntrospectedObject", xGridModel)),
+ Any(comphelper::makePropertyValue("ParentWindow", VCLUnoHelper::GetInterface(this)))
+ };
Reference<XExecutableDialog> xExecute(xContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.form.ControlFontDialog",
aArguments, xContext), css::uno::UNO_QUERY_THROW);
xExecute->execute();
@@ -795,7 +788,7 @@ void SbaGridControl::SetBrowserAttrs()
}
}
-void SbaGridControl::PostExecuteRowContextMenu(const OString& rExecutionResult)
+void SbaGridControl::PostExecuteRowContextMenu(const OUString& rExecutionResult)
{
if (rExecutionResult == "tableattr")
SetBrowserAttrs();
@@ -1063,8 +1056,7 @@ void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfC
// collect the affected rows
if ((GetSelectRowCount() == 0) && (nRowPos >= 0))
{
- aSelectedRows.realloc( 1 );
- aSelectedRows[0] <<= static_cast<sal_Int32>(nRowPos + 1);
+ aSelectedRows = { Any(static_cast<sal_Int32>(nRowPos + 1)) };
bSelectionBookmarks = false;
}
else if ( !IsAllSelected() && GetSelectRowCount() )
@@ -1096,7 +1088,7 @@ void SbaGridControl::DoFieldDrag(sal_uInt16 nColumnPos, sal_Int16 nRowPos)
try
{
OUString sCellText;
- Reference< XGridFieldDataSupplier > xFieldData(static_cast< XGridPeer* >(GetPeer()), UNO_QUERY);
+ Reference< XGridFieldDataSupplier > xFieldData(GetPeer());
Sequence<sal_Bool> aSupportingText = xFieldData->queryFieldDataType(cppu::UnoType<decltype(sCellText)>::get());
if (aSupportingText.getConstArray()[nColumnPos])
{
@@ -1142,82 +1134,83 @@ sal_Int8 SbaGridControl::AcceptDrop( const BrowserAcceptDropEvent& rEvt )
if (!::dbtools::getConnection(Reference< XRowSet > (getDataSource(),UNO_QUERY)).is())
return nAction;
- if ( IsDropFormatSupported( SotClipboardFormatId::STRING ) ) do
- { // odd construction, but spares us a lot of (explicit ;) goto's
+ if ( IsDropFormatSupported( SotClipboardFormatId::STRING ) )
+ do
+ { // odd construction, but spares us a lot of (explicit ;) goto's
- if (!GetEmptyRow().is())
- // without an empty row we're not in update mode
- break;
+ if (!GetEmptyRow().is())
+ // without an empty row we're not in update mode
+ break;
- const sal_Int32 nRow = GetRowAtYPosPixel(rEvt.maPosPixel.Y(), false);
- const sal_uInt16 nCol = GetColumnId(GetColumnAtXPosPixel(rEvt.maPosPixel.X()));
+ const sal_Int32 nRow = GetRowAtYPosPixel(rEvt.maPosPixel.Y(), false);
+ const sal_uInt16 nCol = GetColumnId(GetColumnAtXPosPixel(rEvt.maPosPixel.X()));
- sal_Int32 nCorrectRowCount = GetRowCount();
- if (GetOptions() & DbGridControlOptions::Insert)
- --nCorrectRowCount; // there is an empty row for inserting records
- if (IsCurrentAppending())
- --nCorrectRowCount; // the current data record doesn't really exist, we are appending a new one
+ sal_Int32 nCorrectRowCount = GetRowCount();
+ if (GetOptions() & DbGridControlOptions::Insert)
+ --nCorrectRowCount; // there is an empty row for inserting records
+ if (IsCurrentAppending())
+ --nCorrectRowCount; // the current data record doesn't really exist, we are appending a new one
- if ( (nCol == BROWSER_INVALIDID) || (nRow >= nCorrectRowCount) || (nCol == 0) )
- // no valid cell under the mouse cursor
- break;
+ if ( (nCol == BROWSER_INVALIDID) || (nRow >= nCorrectRowCount) || (nCol == 0) )
+ // no valid cell under the mouse cursor
+ break;
- tools::Rectangle aRect = GetCellRect(nRow, nCol, false);
- if (!aRect.IsInside(rEvt.maPosPixel))
- // not dropped within a cell (a cell isn't as wide as the column - the are small spaces)
- break;
+ tools::Rectangle aRect = GetCellRect(nRow, nCol, false);
+ if (!aRect.Contains(rEvt.maPosPixel))
+ // not dropped within a cell (a cell isn't as wide as the column - the are small spaces)
+ break;
- if ((IsModified() || (GetCurrentRow().is() && GetCurrentRow()->IsModified())) && (GetCurrentPos() != nRow))
- // there is a current and modified row or cell and he text is to be dropped into another one
- break;
+ if ((IsModified() || (GetCurrentRow().is() && GetCurrentRow()->IsModified())) && (GetCurrentPos() != nRow))
+ // there is a current and modified row or cell and he text is to be dropped into another one
+ break;
- CellControllerRef xCurrentController = Controller();
- if (xCurrentController.is() && xCurrentController->IsValueChangedFromSaved() && ((nRow != GetCurRow()) || (nCol != GetCurColumnId())))
- // the current controller is modified and the user wants to drop in another cell -> no chance
- // (when leaving the modified cell an error may occur - this is deadly while dragging)
- break;
+ CellControllerRef xCurrentController = Controller();
+ if (xCurrentController.is() && xCurrentController->IsValueChangedFromSaved() && ((nRow != GetCurRow()) || (nCol != GetCurColumnId())))
+ // the current controller is modified and the user wants to drop in another cell -> no chance
+ // (when leaving the modified cell an error may occur - this is deadly while dragging)
+ break;
- Reference< XPropertySet > xField = getField(GetModelColumnPos(nCol));
- if (!xField.is())
- // the column is not valid bound (for instance a binary field)
- break;
+ Reference< XPropertySet > xField = getField(GetModelColumnPos(nCol));
+ if (!xField.is())
+ // the column is not valid bound (for instance a binary field)
+ break;
- try
- {
- if (::comphelper::getBOOL(xField->getPropertyValue(PROPERTY_ISREADONLY)))
+ try
+ {
+ if (::comphelper::getBOOL(xField->getPropertyValue(PROPERTY_ISREADONLY)))
+ break;
+ }
+ catch (const Exception& )
+ {
+ // assume RO
break;
- }
- catch (const Exception& )
- {
- // assume RO
- break;
- }
+ }
- try
- {
- // assume that text can be dropped into a field if the column has a css::awt::XTextComponent interface
- Reference< XIndexAccess > xColumnControls(static_cast<css::form::XGridPeer*>(GetPeer()), UNO_QUERY);
- if (xColumnControls.is())
+ try
{
- Reference< css::awt::XTextComponent > xColControl(
- xColumnControls->getByIndex(GetViewColumnPos(nCol)),
- css::uno::UNO_QUERY);
- if (xColControl.is())
+ // assume that text can be dropped into a field if the column has a css::awt::XTextComponent interface
+ Reference< XIndexAccess > xColumnControls(GetPeer());
+ if (xColumnControls.is())
{
- m_bActivatingForDrop = true;
- GoToRowColumnId(nRow, nCol);
- m_bActivatingForDrop = false;
-
- nAction = DND_ACTION_COPY;
+ Reference< css::awt::XTextComponent > xColControl(
+ xColumnControls->getByIndex(GetViewColumnPos(nCol)),
+ css::uno::UNO_QUERY);
+ if (xColControl.is())
+ {
+ m_bActivatingForDrop = true;
+ GoToRowColumnId(nRow, nCol);
+ m_bActivatingForDrop = false;
+
+ nAction = DND_ACTION_COPY;
+ }
}
}
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION("dbaccess");
- }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION("dbaccess");
+ }
- } while (false);
+ } while (false);
if(nAction != DND_ACTION_COPY && GetEmptyRow().is())
{
@@ -1356,10 +1349,10 @@ IMPL_LINK_NOARG(SbaGridControl, AsynchDropEvent, void*, void)
m_aDataDescriptor.clear();
}
-OUString SbaGridControl::GetAccessibleObjectDescription( ::vcl::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition) const
+OUString SbaGridControl::GetAccessibleObjectDescription( AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition) const
{
OUString sRet;
- if ( ::vcl::BBTYPE_BROWSEBOX == eObjType )
+ if ( AccessibleBrowseBoxObjType::BrowseBox == eObjType )
{
SolarMutexGuard aGuard;
sRet = DBA_RES(STR_DATASOURCE_GRIDCONTROL_DESC);
diff --git a/dbaccess/source/ui/browser/sbamultiplex.cxx b/dbaccess/source/ui/browser/sbamultiplex.cxx
index 68673fd06ff2..8bf7ed747c03 100644
--- a/dbaccess/source/ui/browser/sbamultiplex.cxx
+++ b/dbaccess/source/ui/browser/sbamultiplex.cxx
@@ -18,79 +18,511 @@
*/
#include <sbamultiplex.hxx>
+#include <cppuhelper/queryinterface.hxx>
+
using namespace dbaui;
// the listener multiplexers
// XStatusListener
-IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXStatusMultiplexer, css::frame::XStatusListener)
+SbaXStatusMultiplexer::SbaXStatusMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex)
+ :OSbaWeakSubObject(rSource)
+ ,OInterfaceContainerHelper3(_rMutex)
+{
+}
+
+css::uno::Any SAL_CALL SbaXStatusMultiplexer::queryInterface(const css::uno::Type& _rType)
+{
+ css::uno::Any aReturn = OSbaWeakSubObject::queryInterface(_rType);
+ if (!aReturn.hasValue())
+ aReturn = ::cppu::queryInterface(_rType,
+ static_cast< css::frame::XStatusListener* >(this),
+ static_cast< css::lang::XEventListener* >(static_cast< css::frame::XStatusListener* >(this))
+ );
+
+ return aReturn;
+}
+void SAL_CALL SbaXStatusMultiplexer::disposing(const css::lang::EventObject& )
+{
+}
+
void SAL_CALL SbaXStatusMultiplexer::statusChanged(const css::frame::FeatureStateEvent& e)
{
m_aLastKnownStatus = e;
m_aLastKnownStatus.Source = &m_rParent;
- ::comphelper::OInterfaceIteratorHelper2 aIt( *this );
- while ( aIt.hasMoreElements() )
- static_cast< css::frame::XStatusListener* >( aIt.next() )->statusChanged( m_aLastKnownStatus );
+ notifyEach( &XStatusListener::statusChanged, m_aLastKnownStatus );
}
// LoadListener
-IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXLoadMultiplexer, css::form::XLoadListener)
-IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXLoadMultiplexer, css::form::XLoadListener, loaded, css::lang::EventObject)
-IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXLoadMultiplexer, css::form::XLoadListener, unloaded, css::lang::EventObject)
-IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXLoadMultiplexer, css::form::XLoadListener, unloading, css::lang::EventObject)
-IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXLoadMultiplexer, css::form::XLoadListener, reloading, css::lang::EventObject)
-IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXLoadMultiplexer, css::form::XLoadListener, reloaded, css::lang::EventObject)
+SbaXLoadMultiplexer::SbaXLoadMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex)
+ :OSbaWeakSubObject(rSource)
+ ,OInterfaceContainerHelper3(_rMutex)
+{
+}
+
+css::uno::Any SAL_CALL SbaXLoadMultiplexer::queryInterface(const css::uno::Type& _rType)
+{
+ css::uno::Any aReturn = OSbaWeakSubObject::queryInterface(_rType);
+ if (!aReturn.hasValue())
+ aReturn = ::cppu::queryInterface(_rType,
+ static_cast< css::form::XLoadListener* >(this),
+ static_cast< css::lang::XEventListener* >(static_cast< css::form::XLoadListener* >(this))
+ );
+
+ return aReturn;
+}
+void SAL_CALL SbaXLoadMultiplexer::disposing(const css::lang::EventObject& )
+{
+}
+
+void SAL_CALL SbaXLoadMultiplexer::loaded(const css::lang::EventObject& e)
+{
+ css::lang::EventObject aMulti(e);
+ aMulti.Source = &m_rParent;
+ notifyEach( &XLoadListener::loaded, aMulti );
+}
+void SAL_CALL SbaXLoadMultiplexer::unloaded(const css::lang::EventObject& e)
+{
+ css::lang::EventObject aMulti(e);
+ aMulti.Source = &m_rParent;
+ notifyEach( &XLoadListener::unloaded, aMulti );
+}
+
+void SAL_CALL SbaXLoadMultiplexer::unloading(const css::lang::EventObject& e)
+{
+ css::lang::EventObject aMulti(e);
+ aMulti.Source = &m_rParent;
+ notifyEach( &XLoadListener::unloading, aMulti );
+}
+
+void SAL_CALL SbaXLoadMultiplexer::reloading(const css::lang::EventObject& e)
+{
+ css::lang::EventObject aMulti(e);
+ aMulti.Source = &m_rParent;
+ notifyEach( &XLoadListener::reloading, aMulti );
+}
+
+void SAL_CALL SbaXLoadMultiplexer::reloaded(const css::lang::EventObject& e)
+{
+ css::lang::EventObject aMulti(e);
+ aMulti.Source = &m_rParent;
+ notifyEach( &XLoadListener::reloaded, aMulti );
+}
+
// css::sdbc::XRowSetListener
-IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXRowSetMultiplexer, css::sdbc::XRowSetListener)
-IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXRowSetMultiplexer, css::sdbc::XRowSetListener, cursorMoved, css::lang::EventObject)
-IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXRowSetMultiplexer, css::sdbc::XRowSetListener, rowChanged, css::lang::EventObject)
-IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXRowSetMultiplexer, css::sdbc::XRowSetListener, rowSetChanged, css::lang::EventObject)
+SbaXRowSetMultiplexer::SbaXRowSetMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex)
+ :OSbaWeakSubObject(rSource)
+ ,OInterfaceContainerHelper3(_rMutex)
+{
+}
+
+css::uno::Any SAL_CALL SbaXRowSetMultiplexer::queryInterface(const css::uno::Type& _rType)
+{
+ css::uno::Any aReturn = OSbaWeakSubObject::queryInterface(_rType);
+ if (!aReturn.hasValue())
+ aReturn = ::cppu::queryInterface(_rType,
+ static_cast< css::sdbc::XRowSetListener* >(this),
+ static_cast< css::lang::XEventListener* >(static_cast< css::sdbc::XRowSetListener* >(this))
+ );
+
+ return aReturn;
+}
+void SAL_CALL SbaXRowSetMultiplexer::disposing(const css::lang::EventObject& )
+{
+}
+
+void SAL_CALL SbaXRowSetMultiplexer::cursorMoved(const css::lang::EventObject& e)
+{
+ css::lang::EventObject aMulti(e);
+ aMulti.Source = &m_rParent;
+ notifyEach( &XRowSetListener::cursorMoved, aMulti );
+}
+
+void SAL_CALL SbaXRowSetMultiplexer::rowChanged(const css::lang::EventObject& e)
+{
+ css::lang::EventObject aMulti(e);
+ aMulti.Source = &m_rParent;
+ notifyEach( &XRowSetListener::rowChanged, aMulti );
+}
+
+void SAL_CALL SbaXRowSetMultiplexer::rowSetChanged(const css::lang::EventObject& e)
+{
+ css::lang::EventObject aMulti(e);
+ aMulti.Source = &m_rParent;
+ notifyEach( &XRowSetListener::rowSetChanged, aMulti );
+}
// css::sdb::XRowSetApproveListener
-IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXRowSetApproveMultiplexer, css::sdb::XRowSetApproveListener)
-IMPLEMENT_LISTENER_MULTIPLEXER_BOOL_METHOD(SbaXRowSetApproveMultiplexer, css::sdb::XRowSetApproveListener, approveCursorMove, css::lang::EventObject)
-IMPLEMENT_LISTENER_MULTIPLEXER_BOOL_METHOD(SbaXRowSetApproveMultiplexer, css::sdb::XRowSetApproveListener, approveRowChange, css::sdb::RowChangeEvent)
-IMPLEMENT_LISTENER_MULTIPLEXER_BOOL_METHOD(SbaXRowSetApproveMultiplexer, css::sdb::XRowSetApproveListener, approveRowSetChange, css::lang::EventObject)
+SbaXRowSetApproveMultiplexer::SbaXRowSetApproveMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex)
+ :OSbaWeakSubObject(rSource)
+ ,OInterfaceContainerHelper3(_rMutex)
+{
+}
+
+css::uno::Any SAL_CALL SbaXRowSetApproveMultiplexer::queryInterface(const css::uno::Type& _rType)
+{
+ css::uno::Any aReturn = OSbaWeakSubObject::queryInterface(_rType);
+ if (!aReturn.hasValue())
+ aReturn = ::cppu::queryInterface(_rType,
+ static_cast< css::sdb::XRowSetApproveListener* >(this),
+ static_cast< css::lang::XEventListener* >(static_cast< css::sdb::XRowSetApproveListener* >(this))
+ );
+
+ return aReturn;
+}
+void SAL_CALL SbaXRowSetApproveMultiplexer::disposing(const css::lang::EventObject& )
+{
+}
+
+sal_Bool SAL_CALL SbaXRowSetApproveMultiplexer::approveCursorMove(const css::lang::EventObject& e)
+{
+ css::lang::EventObject aMulti(e);
+ aMulti.Source = &m_rParent;
+ ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
+ bool bResult = true;
+ while (bResult && aIt.hasMoreElements())
+ bResult = aIt.next()->approveCursorMove(aMulti);
+ return bResult;
+}
+
+sal_Bool SAL_CALL SbaXRowSetApproveMultiplexer::approveRowChange(const css::sdb::RowChangeEvent& e)
+{
+ css::sdb::RowChangeEvent aMulti(e);
+ aMulti.Source = &m_rParent;
+ ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
+ bool bResult = true;
+ while (bResult && aIt.hasMoreElements())
+ bResult = aIt.next()->approveRowChange(aMulti);
+ return bResult;
+}
+
+sal_Bool SAL_CALL SbaXRowSetApproveMultiplexer::approveRowSetChange(const css::lang::EventObject& e)
+{
+ css::lang::EventObject aMulti(e);
+ aMulti.Source = &m_rParent;
+ ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
+ bool bResult = true;
+ while (bResult && aIt.hasMoreElements())
+ bResult = aIt.next()->approveRowSetChange(aMulti);
+ return bResult;
+}
// css::sdb::XSQLErrorListener
-IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXSQLErrorMultiplexer, css::sdb::XSQLErrorListener)
-IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXSQLErrorMultiplexer, css::sdb::XSQLErrorListener, errorOccured, css::sdb::SQLErrorEvent)
+SbaXSQLErrorMultiplexer::SbaXSQLErrorMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex)
+ :OSbaWeakSubObject(rSource)
+ ,OInterfaceContainerHelper3(_rMutex)
+{
+}
+
+css::uno::Any SAL_CALL SbaXSQLErrorMultiplexer::queryInterface(const css::uno::Type& _rType)
+{
+ css::uno::Any aReturn = OSbaWeakSubObject::queryInterface(_rType);
+ if (!aReturn.hasValue())
+ aReturn = ::cppu::queryInterface(_rType,
+ static_cast< css::sdb::XSQLErrorListener* >(this),
+ static_cast< css::lang::XEventListener* >(static_cast< css::sdb::XSQLErrorListener* >(this))
+ );
+
+ return aReturn;
+}
+void SAL_CALL SbaXSQLErrorMultiplexer::disposing(const css::lang::EventObject& )
+{
+}
+
+void SAL_CALL SbaXSQLErrorMultiplexer::errorOccured(const css::sdb::SQLErrorEvent& e)
+{
+ css::sdb::SQLErrorEvent aMulti(e);
+ aMulti.Source = &m_rParent;
+ notifyEach( &XSQLErrorListener::errorOccured, aMulti );
+}
// css::form::XDatabaseParameterListener
-IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXParameterMultiplexer, css::form::XDatabaseParameterListener)
-IMPLEMENT_LISTENER_MULTIPLEXER_BOOL_METHOD(SbaXParameterMultiplexer, css::form::XDatabaseParameterListener, approveParameter, css::form::DatabaseParameterEvent)
+SbaXParameterMultiplexer::SbaXParameterMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex)
+ :OSbaWeakSubObject(rSource)
+ ,OInterfaceContainerHelper3(_rMutex)
+{
+}
+
+css::uno::Any SAL_CALL SbaXParameterMultiplexer::queryInterface(const css::uno::Type& _rType)
+{
+ css::uno::Any aReturn = OSbaWeakSubObject::queryInterface(_rType);
+ if (!aReturn.hasValue())
+ aReturn = ::cppu::queryInterface(_rType,
+ static_cast< css::form::XDatabaseParameterListener* >(this),
+ static_cast< css::lang::XEventListener* >(static_cast< css::form::XDatabaseParameterListener* >(this))
+ );
+
+ return aReturn;
+}
+void SAL_CALL SbaXParameterMultiplexer::disposing(const css::lang::EventObject& )
+{
+}
+
+sal_Bool SAL_CALL SbaXParameterMultiplexer::approveParameter(const css::form::DatabaseParameterEvent& e)
+{
+ css::form::DatabaseParameterEvent aMulti(e);
+ aMulti.Source = &m_rParent;
+ ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
+ bool bResult = true;
+ while (bResult && aIt.hasMoreElements())
+ bResult = aIt.next()->approveParameter(aMulti);
+ return bResult;
+}
// css::form::XSubmitListener
-IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXSubmitMultiplexer, css::form::XSubmitListener)
-IMPLEMENT_LISTENER_MULTIPLEXER_BOOL_METHOD(SbaXSubmitMultiplexer, css::form::XSubmitListener, approveSubmit, css::lang::EventObject)
+SbaXSubmitMultiplexer::SbaXSubmitMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex)
+ :OSbaWeakSubObject(rSource)
+ ,OInterfaceContainerHelper3(_rMutex)
+{
+}
+
+css::uno::Any SAL_CALL SbaXSubmitMultiplexer::queryInterface(const css::uno::Type& _rType)
+{
+ css::uno::Any aReturn = OSbaWeakSubObject::queryInterface(_rType);
+ if (!aReturn.hasValue())
+ aReturn = ::cppu::queryInterface(_rType,
+ static_cast< css::form::XSubmitListener* >(this),
+ static_cast< css::lang::XEventListener* >(static_cast< css::form::XSubmitListener* >(this))
+ );
+
+ return aReturn;
+}
+void SAL_CALL SbaXSubmitMultiplexer::disposing(const css::lang::EventObject& )
+{
+}
+
+
+
+sal_Bool SAL_CALL SbaXSubmitMultiplexer::approveSubmit(const css::lang::EventObject& e)
+{
+ css::lang::EventObject aMulti(e);
+ aMulti.Source = &m_rParent;
+ ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
+ bool bResult = true;
+ while (bResult && aIt.hasMoreElements())
+ bResult = aIt.next()->approveSubmit(aMulti);
+ return bResult;
+}
// css::form::XResetListener
-IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXResetMultiplexer, css::form::XResetListener)
-IMPLEMENT_LISTENER_MULTIPLEXER_BOOL_METHOD(SbaXResetMultiplexer, css::form::XResetListener, approveReset, css::lang::EventObject)
-IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXResetMultiplexer, css::form::XResetListener, resetted, css::lang::EventObject)
+SbaXResetMultiplexer::SbaXResetMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex)
+ :OSbaWeakSubObject(rSource)
+ ,OInterfaceContainerHelper3(_rMutex)
+{
+}
+
+css::uno::Any SAL_CALL SbaXResetMultiplexer::queryInterface(const css::uno::Type& _rType)
+{
+ css::uno::Any aReturn = OSbaWeakSubObject::queryInterface(_rType);
+ if (!aReturn.hasValue())
+ aReturn = ::cppu::queryInterface(_rType,
+ static_cast< css::form::XResetListener* >(this),
+ static_cast< css::lang::XEventListener* >(static_cast< css::form::XResetListener* >(this))
+ );
+
+ return aReturn;
+}
+void SAL_CALL SbaXResetMultiplexer::disposing(const css::lang::EventObject& )
+{
+}
+
+
+sal_Bool SAL_CALL SbaXResetMultiplexer::approveReset(const css::lang::EventObject& e)
+{
+ css::lang::EventObject aMulti(e);
+ aMulti.Source = &m_rParent;
+ ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
+ bool bResult = true;
+ while (bResult && aIt.hasMoreElements())
+ bResult = aIt.next()->approveReset(aMulti);
+ return bResult;
+}
+
+void SAL_CALL SbaXResetMultiplexer::resetted(const css::lang::EventObject& e)
+{
+ css::lang::EventObject aMulti(e);
+ aMulti.Source = &m_rParent;
+ notifyEach( &XResetListener::resetted, aMulti );
+}
// css::beans::XPropertyChangeListener
-IMPLEMENT_PROPERTY_MULTIPLEXER(SbaXPropertyChangeMultiplexer, css::beans::XPropertyChangeListener, propertyChange, css::beans::PropertyChangeEvent)
+SbaXPropertyChangeMultiplexer::SbaXPropertyChangeMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex)
+ :OSbaWeakSubObject(rSource)
+ ,m_aListeners(rMutex)
+{
+}
+
+css::uno::Any SAL_CALL SbaXPropertyChangeMultiplexer::queryInterface(const css::uno::Type& _rType)
+{
+ css::uno::Any aReturn = OSbaWeakSubObject::queryInterface(_rType);
+ if (!aReturn.hasValue())
+ aReturn = ::cppu::queryInterface(_rType,
+ static_cast< css::beans::XPropertyChangeListener* >(this),
+ static_cast< css::lang::XEventListener* >(static_cast< css::beans::XPropertyChangeListener* >(this))
+ );
+
+ return aReturn;
+}
+void SAL_CALL SbaXPropertyChangeMultiplexer::disposing(const css::lang::EventObject& )
+{
+}
+void SAL_CALL SbaXPropertyChangeMultiplexer::propertyChange(const css::beans::PropertyChangeEvent& e)
+{
+ ::comphelper::OInterfaceContainerHelper3<XPropertyChangeListener>* pListeners = m_aListeners.getContainer(e.PropertyName);
+ if (pListeners)
+ Notify(*pListeners, e);
+
+ /* do the notification for the unspecialized listeners, too */
+ pListeners = m_aListeners.getContainer(OUString());
+ if (pListeners)
+ Notify(*pListeners, e);
+}
+
+void SbaXPropertyChangeMultiplexer::addInterface(const OUString& rName,
+ const css::uno::Reference< css::beans::XPropertyChangeListener > & rListener)
+{
+ m_aListeners.addInterface(rName, rListener);
+}
+
+void SbaXPropertyChangeMultiplexer::removeInterface(const OUString& rName,
+ const css::uno::Reference< css::beans::XPropertyChangeListener > & rListener)
+{
+ m_aListeners.removeInterface(rName, rListener);
+}
+
+void SbaXPropertyChangeMultiplexer::disposeAndClear()
+{
+ css::lang::EventObject aEvt(m_rParent);
+ m_aListeners.disposeAndClear(aEvt);
+}
+
+sal_Int32 SbaXPropertyChangeMultiplexer::getOverallLen() const
+{
+ sal_Int32 nLen = 0;
+ const std::vector< OUString > aContained = m_aListeners.getContainedTypes();
+ for ( OUString const & s : aContained)
+ {
+ ::comphelper::OInterfaceContainerHelper3<XPropertyChangeListener>* pListeners = m_aListeners.getContainer(s);
+ if (!pListeners)
+ continue;
+ nLen += pListeners->getLength();
+ }
+ return nLen;
+}
+
+void SbaXPropertyChangeMultiplexer::Notify(::comphelper::OInterfaceContainerHelper3<XPropertyChangeListener>& rListeners, const css::beans::PropertyChangeEvent& e)
+{
+ css::beans::PropertyChangeEvent aMulti(e);
+ aMulti.Source = &m_rParent;
+ rListeners.notifyEach( &XPropertyChangeListener::propertyChange, aMulti );
+}
// css::beans::XVetoableChangeListener
-IMPLEMENT_PROPERTY_MULTIPLEXER(SbaXVetoableChangeMultiplexer, css::beans::XVetoableChangeListener, vetoableChange, css::beans::PropertyChangeEvent)
+SbaXVetoableChangeMultiplexer::SbaXVetoableChangeMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex)
+ :OSbaWeakSubObject(rSource)
+ ,m_aListeners(rMutex)
+{
+}
+
+css::uno::Any SAL_CALL SbaXVetoableChangeMultiplexer::queryInterface(const css::uno::Type& _rType)
+{
+ css::uno::Any aReturn = OSbaWeakSubObject::queryInterface(_rType);
+ if (!aReturn.hasValue())
+ aReturn = ::cppu::queryInterface(_rType,
+ static_cast< css::beans::XVetoableChangeListener* >(this),
+ static_cast< css::lang::XEventListener* >(static_cast< css::beans::XVetoableChangeListener* >(this))
+ );
+
+ return aReturn;
+}
+void SAL_CALL SbaXVetoableChangeMultiplexer::disposing(const css::lang::EventObject& )
+{
+}
+void SAL_CALL SbaXVetoableChangeMultiplexer::vetoableChange(const css::beans::PropertyChangeEvent& e)
+{
+ ::comphelper::OInterfaceContainerHelper3<css::beans::XVetoableChangeListener>* pListeners = m_aListeners.getContainer(e.PropertyName);
+ if (pListeners)
+ Notify(*pListeners, e);
+
+ /* do the notification for the unspecialized listeners, too */
+ pListeners = m_aListeners.getContainer(OUString());
+ if (pListeners)
+ Notify(*pListeners, e);
+}
+
+void SbaXVetoableChangeMultiplexer::addInterface(const OUString& rName,
+ const css::uno::Reference< css::beans::XVetoableChangeListener > & rListener)
+{
+ m_aListeners.addInterface(rName, rListener);
+}
+
+void SbaXVetoableChangeMultiplexer::removeInterface(const OUString& rName,
+ const css::uno::Reference< css::beans::XVetoableChangeListener > & rListener)
+{
+ m_aListeners.removeInterface(rName, rListener);
+}
+
+void SbaXVetoableChangeMultiplexer::disposeAndClear()
+{
+ css::lang::EventObject aEvt(m_rParent);
+ m_aListeners.disposeAndClear(aEvt);
+}
+
+sal_Int32 SbaXVetoableChangeMultiplexer::getOverallLen() const
+{
+ sal_Int32 nLen = 0;
+ const std::vector< OUString > aContained = m_aListeners.getContainedTypes();
+ for ( OUString const & s : aContained)
+ {
+ ::comphelper::OInterfaceContainerHelper3<XVetoableChangeListener>* pListeners = m_aListeners.getContainer(s);
+ if (!pListeners)
+ continue;
+ nLen += pListeners->getLength();
+ }
+ return nLen;
+}
+
+void SbaXVetoableChangeMultiplexer::Notify(::comphelper::OInterfaceContainerHelper3<XVetoableChangeListener>& rListeners, const css::beans::PropertyChangeEvent& e)
+{
+ css::beans::PropertyChangeEvent aMulti(e);
+ aMulti.Source = &m_rParent;
+ rListeners.notifyEach( &XVetoableChangeListener::vetoableChange, aMulti );
+}
// css::beans::XPropertiesChangeListener
-IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXPropertiesChangeMultiplexer, css::beans::XPropertiesChangeListener);
+SbaXPropertiesChangeMultiplexer::SbaXPropertiesChangeMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex)
+ :OSbaWeakSubObject(rSource)
+ ,OInterfaceContainerHelper3(_rMutex)
+{
+}
+
+css::uno::Any SAL_CALL SbaXPropertiesChangeMultiplexer::queryInterface(const css::uno::Type& _rType)
+{
+ css::uno::Any aReturn = OSbaWeakSubObject::queryInterface(_rType);
+ if (!aReturn.hasValue())
+ aReturn = ::cppu::queryInterface(_rType,
+ static_cast< css::beans::XPropertiesChangeListener* >(this),
+ static_cast< css::lang::XEventListener* >(static_cast< css::beans::XPropertiesChangeListener* >(this))
+ );
+
+ return aReturn;
+}
+void SAL_CALL SbaXPropertiesChangeMultiplexer::disposing(const css::lang::EventObject& )
+{
+}
+
void SbaXPropertiesChangeMultiplexer::propertiesChange(const css::uno::Sequence< css::beans::PropertyChangeEvent>& aEvts)
{
// the SbaXPropertiesChangeMultiplexer doesn't care about the property names a listener logs on for, it simply
// forwards _all_ changes to _all_ listeners
css::uno::Sequence< css::beans::PropertyChangeEvent> aMulti(aEvts);
- for (css::beans::PropertyChangeEvent & rEvent : aMulti)
+ for (css::beans::PropertyChangeEvent & rEvent : asNonConstRange(aMulti))
rEvent.Source = &m_rParent;
- ::comphelper::OInterfaceIteratorHelper2 aIt(*this);
- while (aIt.hasMoreElements())
- static_cast< css::beans::XPropertiesChangeListener*>(aIt.next())->propertiesChange(aMulti);
+ notifyEach( &css::beans::XPropertiesChangeListener::propertiesChange, aMulti );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 685db87d432e..889c168247f0 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -82,12 +82,13 @@
#include <svx/dataaccessdescriptor.hxx>
#include <svx/databaseregistrationui.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <sal/log.hxx>
#include <tools/multisel.hxx>
#include <tools/urlobj.hxx>
#include <unotools/confignode.hxx>
+#include <utility>
#include <vcl/split.hxx>
#include <vcl/svapp.hxx>
#include <vcl/toolbox.hxx>
@@ -110,7 +111,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::ui::dialogs;
using namespace ::com::sun::star::task;
using namespace ::com::sun::star::form;
-using namespace ::com::sun::star::io;
using namespace ::com::sun::star::i18n;
using namespace ::com::sun::star::view;
using namespace ::com::sun::star::datatransfer;
@@ -192,9 +192,9 @@ Any SAL_CALL SbaTableQueryBrowser::queryInterface(const Type& _rType)
{
if ( _rType.equals( cppu::UnoType<XScriptInvocationContext>::get() ) )
{
- OSL_PRECOND( !!m_aDocScriptSupport, "SbaTableQueryBrowser::queryInterface: did not initialize this, yet!" );
- if ( !!m_aDocScriptSupport && *m_aDocScriptSupport )
- return makeAny( Reference< XScriptInvocationContext >( this ) );
+ OSL_PRECOND( m_aDocScriptSupport.has_value(), "SbaTableQueryBrowser::queryInterface: did not initialize this, yet!" );
+ if ( m_aDocScriptSupport.has_value() && *m_aDocScriptSupport )
+ return Any( Reference< XScriptInvocationContext >( this ) );
return Any();
}
@@ -211,13 +211,14 @@ Sequence< Type > SAL_CALL SbaTableQueryBrowser::getTypes( )
SbaTableQueryBrowser_Base::getTypes()
) );
- OSL_PRECOND( !!m_aDocScriptSupport, "SbaTableQueryBrowser::getTypes: did not initialize this, yet!" );
- if ( !m_aDocScriptSupport || !*m_aDocScriptSupport )
+ OSL_PRECOND( m_aDocScriptSupport.has_value(), "SbaTableQueryBrowser::getTypes: did not initialize this, yet!" );
+ if ( !m_aDocScriptSupport.has_value() || !*m_aDocScriptSupport )
{
- auto newEnd = std::remove_if( aTypes.begin(), aTypes.end(),
+ auto [begin, end] = asNonConstRange(aTypes);
+ auto newEnd = std::remove_if( begin, end,
[](const Type& type)
{ return type == cppu::UnoType<XScriptInvocationContext>::get(); } );
- aTypes.realloc( std::distance(aTypes.begin(), newEnd) );
+ aTypes.realloc( std::distance(begin, newEnd) );
}
return aTypes;
}
@@ -285,49 +286,49 @@ bool SbaTableQueryBrowser::Construct(vcl::Window* pParent)
{
SAL_WARN("dbaccess.ui", "SbaTableQueryBrowser::Construct: could not create (or start listening at) the database context!");
}
+
// some help ids
- if (getBrowserView() && getBrowserView()->getVclControl())
- {
+ if (!getBrowserView() || !getBrowserView()->getVclControl())
+ return true;
- // create controls and set sizes
- const tools::Long nFrameWidth = getBrowserView()->LogicToPixel(::Size(3, 0), MapMode(MapUnit::MapAppFont)).Width();
+ // create controls and set sizes
+ const tools::Long nFrameWidth = getBrowserView()->LogicToPixel(::Size(3, 0), MapMode(MapUnit::MapAppFont)).Width();
- m_pSplitter = VclPtr<Splitter>::Create(getBrowserView(),WB_HSCROLL);
- m_pSplitter->SetPosSizePixel( ::Point(0,0), ::Size(nFrameWidth,0) );
- m_pSplitter->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetDialogColor() ) );
+ m_pSplitter = VclPtr<Splitter>::Create(getBrowserView(),WB_HSCROLL);
+ m_pSplitter->SetPosSizePixel( ::Point(0,0), ::Size(nFrameWidth,0) );
+ m_pSplitter->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetDialogColor() ) );
- m_pTreeView = VclPtr<InterimDBTreeListBox>::Create(getBrowserView());
+ m_pTreeView = VclPtr<InterimDBTreeListBox>::Create(getBrowserView());
- weld::TreeView& rTreeView = m_pTreeView->GetWidget();
- rTreeView.connect_expanding(LINK(this, SbaTableQueryBrowser, OnExpandEntry));
+ weld::TreeView& rTreeView = m_pTreeView->GetWidget();
+ rTreeView.connect_expanding(LINK(this, SbaTableQueryBrowser, OnExpandEntry));
- m_pTreeView->setCopyHandler(LINK(this, SbaTableQueryBrowser, OnCopyEntry));
+ m_pTreeView->setCopyHandler(LINK(this, SbaTableQueryBrowser, OnCopyEntry));
- m_pTreeView->setContextMenuProvider( this );
- m_pTreeView->setControlActionListener( this );
- m_pTreeView->SetHelpId(HID_CTL_TREEVIEW);
+ m_pTreeView->setContextMenuProvider( this );
+ m_pTreeView->setControlActionListener( this );
+ m_pTreeView->SetHelpId(HID_CTL_TREEVIEW);
- // a default pos for the splitter, so that the listbox is about 80 (logical) pixels wide
- m_pSplitter->SetSplitPosPixel(getBrowserView()->LogicToPixel(::Size(80, 0), MapMode(MapUnit::MapAppFont)).Width());
+ // a default pos for the splitter, so that the listbox is about 80 (logical) pixels wide
+ m_pSplitter->SetSplitPosPixel(getBrowserView()->LogicToPixel(::Size(80, 0), MapMode(MapUnit::MapAppFont)).Width());
- getBrowserView()->setSplitter(m_pSplitter);
- getBrowserView()->setTreeView(m_pTreeView);
+ getBrowserView()->setSplitter(m_pSplitter);
+ getBrowserView()->setTreeView(m_pTreeView);
- // fill view with data
- rTreeView.set_sort_order(true);
- rTreeView.set_sort_func([this](const weld::TreeIter& rLeft, const weld::TreeIter& rRight){
- return OnTreeEntryCompare(rLeft, rRight);
- });
- rTreeView.make_sorted();
- m_pTreeView->SetSelChangeHdl(LINK(this, SbaTableQueryBrowser, OnSelectionChange));
- m_pTreeView->show_container();
+ // fill view with data
+ rTreeView.set_sort_order(true);
+ rTreeView.set_sort_func([this](const weld::TreeIter& rLeft, const weld::TreeIter& rRight){
+ return OnTreeEntryCompare(rLeft, rRight);
+ });
+ rTreeView.make_sorted();
+ m_pTreeView->SetSelChangeHdl(LINK(this, SbaTableQueryBrowser, OnSelectionChange));
+ m_pTreeView->show_container();
- // TODO
- getBrowserView()->getVclControl()->SetHelpId(HID_CTL_TABBROWSER);
- if (getBrowserView()->getVclControl()->GetHeaderBar())
- getBrowserView()->getVclControl()->GetHeaderBar()->SetHelpId(HID_DATABROWSE_HEADER);
- InvalidateFeature(ID_BROWSER_EXPLORER);
- }
+ // TODO
+ getBrowserView()->getVclControl()->SetHelpId(HID_CTL_TABBROWSER);
+ if (getBrowserView()->getVclControl()->GetHeaderBar())
+ getBrowserView()->getVclControl()->GetHeaderBar()->SetHelpId(HID_DATABROWSE_HEADER);
+ InvalidateFeature(ID_BROWSER_EXPLORER);
return true;
}
@@ -415,7 +416,7 @@ void SbaTableQueryBrowser::impl_sanitizeRowSetClauses_nothrow()
if ( invalidColumn )
{
// reset the complete order statement at both the row set and the parser
- xRowSetProps->setPropertyValue( PROPERTY_ORDER, makeAny( OUString() ) );
+ xRowSetProps->setPropertyValue( PROPERTY_ORDER, Any( OUString() ) );
xComposer->setOrder( "" );
}
@@ -468,7 +469,7 @@ bool SbaTableQueryBrowser::InitializeForm( const Reference< XPropertySet > & i_f
try
{
weld::TreeView& rTreeView = m_pTreeView->GetWidget();
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*m_xCurrentlyDisplayed).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*m_xCurrentlyDisplayed));
ENSURE_OR_RETURN_FALSE( pData, "SbaTableQueryBrowser::InitializeForm: No user data set at the currently displayed entry!" );
ENSURE_OR_RETURN_FALSE( pData->xObjectProperties.is(), "SbaTableQueryBrowser::InitializeForm: No table available!" );
@@ -478,16 +479,16 @@ bool SbaTableQueryBrowser::InitializeForm( const Reference< XPropertySet > & i_f
const OUString aTransferProperties[] =
{
- OUString(PROPERTY_APPLYFILTER),
- OUString(PROPERTY_FILTER),
- OUString(PROPERTY_HAVING_CLAUSE),
- OUString(PROPERTY_ORDER)
+ PROPERTY_APPLYFILTER,
+ PROPERTY_FILTER,
+ PROPERTY_HAVING_CLAUSE,
+ PROPERTY_ORDER
};
- for (const auto & aTransferPropertie : aTransferProperties)
+ for (const auto & aTransferProperty : aTransferProperties)
{
- if ( !xPSI->hasPropertyByName( aTransferPropertie ) )
+ if ( !xPSI->hasPropertyByName( aTransferProperty ) )
continue;
- aPropertyValues.put( aTransferPropertie, pData->xObjectProperties->getPropertyValue( aTransferPropertie ) );
+ aPropertyValues.put( aTransferProperty, pData->xObjectProperties->getPropertyValue( aTransferProperty ) );
}
std::vector< OUString > aNames( aPropertyValues.getNames() );
@@ -522,9 +523,9 @@ void SbaTableQueryBrowser::initializePreviewMode()
Reference< XPropertySet > xDataSourceSet(getRowSet(), UNO_QUERY);
if ( xDataSourceSet.is() )
{
- xDataSourceSet->setPropertyValue("AllowInserts",makeAny(false));
- xDataSourceSet->setPropertyValue("AllowUpdates",makeAny(false));
- xDataSourceSet->setPropertyValue("AllowDeletes",makeAny(false));
+ xDataSourceSet->setPropertyValue("AllowInserts",Any(false));
+ xDataSourceSet->setPropertyValue("AllowUpdates",Any(false));
+ xDataSourceSet->setPropertyValue("AllowDeletes",Any(false));
}
}
@@ -545,10 +546,10 @@ void SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm
if (m_xCurrentlyDisplayed)
{
Sequence< OUString> aProperties(6 + ( m_bPreview ? 5 : 0 ));
- Sequence< Any> aValues(7 + ( m_bPreview ? 5 : 0 ));
+ Sequence< Any> aValues(6 + ( m_bPreview ? 5 : 0 ));
weld::TreeView& rTreeView = m_pTreeView->GetWidget();
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*m_xCurrentlyDisplayed).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*m_xCurrentlyDisplayed));
OSL_ENSURE( pData->xObjectProperties.is(), "SbaTableQueryBrowser::InitializeGridModel: No table available!" );
if ( !pData->xObjectProperties.is() )
return;
@@ -640,14 +641,14 @@ void SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm
case DataType::BOOLEAN:
{
aCurrentModelType = "CheckBox";
- aInitialValues.emplace_back( "VisualEffect", makeAny( VisualEffect::FLAT ) );
+ aInitialValues.emplace_back( "VisualEffect", Any( VisualEffect::FLAT ) );
sDefaultProperty = PROPERTY_DEFAULTSTATE;
sal_Int32 nNullable = ColumnValue::NULLABLE_UNKNOWN;
OSL_VERIFY( xColumn->getPropertyValue( PROPERTY_ISNULLABLE ) >>= nNullable );
aInitialValues.emplace_back(
"TriState",
- makeAny( ColumnValue::NO_NULLS != nNullable )
+ Any( ColumnValue::NO_NULLS != nNullable )
);
if ( ColumnValue::NO_NULLS == nNullable )
aDefault <<= sal_Int16(TRISTATE_FALSE);
@@ -656,7 +657,7 @@ void SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm
case DataType::LONGVARCHAR:
case DataType::CLOB:
- aInitialValues.emplace_back( "MultiLine", makeAny( true ) );
+ aInitialValues.emplace_back( "MultiLine", Any( true ) );
[[fallthrough]];
case DataType::BINARY:
case DataType::VARBINARY:
@@ -674,19 +675,19 @@ void SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm
sDefaultProperty = PROPERTY_EFFECTIVEDEFAULT;
if ( xSupplier.is() )
- aInitialValues.emplace_back( "FormatsSupplier", makeAny( xSupplier ) );
- aInitialValues.emplace_back( "TreatAsNumber", makeAny( bFormattedIsNumeric ) );
+ aInitialValues.emplace_back( "FormatsSupplier", Any( xSupplier ) );
+ aInitialValues.emplace_back( "TreatAsNumber", Any( bFormattedIsNumeric ) );
aCopyProperties.emplace_back(PROPERTY_FORMATKEY );
break;
}
- aInitialValues.emplace_back( PROPERTY_CONTROLSOURCE, makeAny( rName ) );
+ aInitialValues.emplace_back( PROPERTY_CONTROLSOURCE, Any( rName ) );
OUString sLabel;
xColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel;
if ( !sLabel.isEmpty() )
- aInitialValues.emplace_back( PROPERTY_LABEL, makeAny( sLabel ) );
+ aInitialValues.emplace_back( PROPERTY_LABEL, Any( sLabel ) );
else
- aInitialValues.emplace_back( PROPERTY_LABEL, makeAny( rName ) );
+ aInitialValues.emplace_back( PROPERTY_LABEL, Any( rName ) );
Reference< XPropertySet > xGridCol( xColFactory->createColumn( aCurrentModelType ), UNO_SET_THROW );
Reference< XPropertySetInfo > xGridColPSI( xGridCol->getPropertySetInfo(), UNO_SET_THROW );
@@ -733,7 +734,7 @@ void SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm
// don't allow the mouse to scroll in the cells
if ( xGridColPSI->hasPropertyByName( PROPERTY_MOUSE_WHEEL_BEHAVIOR ) )
- aInitialValues.emplace_back( PROPERTY_MOUSE_WHEEL_BEHAVIOR, makeAny( MouseWheelBehavior::SCROLL_DISABLED ) );
+ aInitialValues.emplace_back( PROPERTY_MOUSE_WHEEL_BEHAVIOR, Any( MouseWheelBehavior::SCROLL_DISABLED ) );
// now set all those values
for (auto const& property : aInitialValues)
@@ -743,7 +744,7 @@ void SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm
for (auto const& copyPropertyName : aCopyProperties)
xGridCol->setPropertyValue( copyPropertyName, xColumn->getPropertyValue(copyPropertyName) );
- xColContainer->insertByName(rName, makeAny(xGridCol));
+ xColContainer->insertByName(rName, Any(xGridCol));
}
}
}
@@ -760,7 +761,7 @@ static Reference<XPropertySet> getColumnHelper(const weld::TreeView& rTreeView,
Reference<XPropertySet> xRet;
if (pCurrentlyDisplayed)
{
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*pCurrentlyDisplayed).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*pCurrentlyDisplayed));
Reference<XColumnsSupplier> xColumnsSup(pData->xObjectProperties,UNO_QUERY);
Reference<XNameAccess> xNames = xColumnsSup->getColumns();
OUString aName;
@@ -776,7 +777,7 @@ void SbaTableQueryBrowser::transferChangedControlProperty(const OUString& _rProp
if (m_xCurrentlyDisplayed)
{
weld::TreeView& rTreeView = m_pTreeView->GetWidget();
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*m_xCurrentlyDisplayed).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*m_xCurrentlyDisplayed));
Reference< XPropertySet > xObjectProps = pData->xObjectProperties;
OSL_ENSURE(xObjectProps.is(),"SbaTableQueryBrowser::transferChangedControlProperty: no table/query object!");
if (xObjectProps.is())
@@ -804,7 +805,7 @@ void SbaTableQueryBrowser::propertyChange(const PropertyChangeEvent& evt)
if(xProp.is())
{
if(!evt.NewValue.hasValue())
- xProp->setPropertyValue(PROPERTY_WIDTH,makeAny(sal_Int32(227)));
+ xProp->setPropertyValue(PROPERTY_WIDTH,Any(sal_Int32(227)));
else
xProp->setPropertyValue(PROPERTY_WIDTH,evt.NewValue);
}
@@ -830,12 +831,12 @@ void SbaTableQueryBrowser::propertyChange(const PropertyChangeEvent& evt)
{
sal_Int16 nAlign = 0;
if(evt.NewValue >>= nAlign)
- xProp->setPropertyValue(PROPERTY_ALIGN,makeAny(sal_Int32(nAlign)));
+ xProp->setPropertyValue(PROPERTY_ALIGN,Any(sal_Int32(nAlign)));
else
xProp->setPropertyValue(PROPERTY_ALIGN,evt.NewValue);
}
else
- xProp->setPropertyValue(PROPERTY_ALIGN,makeAny(css::awt::TextAlign::LEFT));
+ xProp->setPropertyValue(PROPERTY_ALIGN,Any(css::awt::TextAlign::LEFT));
}
}
catch( const Exception& )
@@ -861,12 +862,12 @@ void SbaTableQueryBrowser::propertyChange(const PropertyChangeEvent& evt)
{
if (m_xCurrentlyDisplayed)
{
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*m_xCurrentlyDisplayed).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*m_xCurrentlyDisplayed));
OSL_ENSURE( pData->xObjectProperties.is(), "No table available!" );
bool bDefault = !evt.NewValue.hasValue();
if (bDefault)
- pData->xObjectProperties->setPropertyValue(PROPERTY_ROW_HEIGHT,makeAny(sal_Int32(45)));
+ pData->xObjectProperties->setPropertyValue(PROPERTY_ROW_HEIGHT,Any(sal_Int32(45)));
else
pData->xObjectProperties->setPropertyValue(PROPERTY_ROW_HEIGHT,evt.NewValue);
}
@@ -1036,7 +1037,7 @@ namespace
struct FilterByEntryDataId : public IEntryFilter
{
OUString sId;
- explicit FilterByEntryDataId( const OUString& _rId ) : sId( _rId ) { }
+ explicit FilterByEntryDataId( OUString _aId ) : sId(std::move( _aId )) { }
virtual ~FilterByEntryDataId() {}
@@ -1053,7 +1054,7 @@ namespace
OUString SbaTableQueryBrowser::getDataSourceAccessor(const weld::TreeIter& rDataSourceEntry) const
{
weld::TreeView& rTreeView = m_pTreeView->GetWidget();
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(rDataSourceEntry).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(rDataSourceEntry));
OSL_ENSURE( pData, "SbaTableQueryBrowser::getDataSourceAccessor: invalid entry data!" );
OSL_ENSURE( pData->eType == etDatasource, "SbaTableQueryBrowser::getDataSourceAccessor: entry does not denote a data source!" );
return !pData->sAccessor.isEmpty() ? pData->sAccessor : GetEntryText(rDataSourceEntry);
@@ -1166,7 +1167,7 @@ std::unique_ptr<weld::TreeIter> SbaTableQueryBrowser::getObjectEntry(const OUStr
{
if (ensureEntryObject(*xObject))
{
- DBTreeListUserData* pParentData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xObject).toUInt64());
+ DBTreeListUserData* pParentData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xObject));
Reference< XNameAccess > xCollection( pParentData->xContainer, UNO_QUERY );
sal_Int32 nIndex2 = nIndex;
sPath = _rCommand.getToken( 0, '/', nIndex2 );
@@ -1183,7 +1184,7 @@ std::unique_ptr<weld::TreeIter> SbaTableQueryBrowser::getObjectEntry(const OUStr
{
pEntryData->eType = etQueryContainer;
}
- implAppendEntry(xObject.get(), sPath, pEntryData, pEntryData->eType);
+ implAppendEntry(xObject.get(), sPath, pEntryData);
}
}
}
@@ -1238,13 +1239,13 @@ void SbaTableQueryBrowser::connectExternalDispatches()
ID_BROWSER_INSERTCONTENT
};
- for ( size_t i=0; i < SAL_N_ELEMENTS( pURLs ); ++i )
+ for ( size_t i=0; i < std::size( pURLs ); ++i )
{
URL aURL;
aURL.Complete = OUString::createFromAscii( pURLs[i] );
if ( m_xUrlTransformer.is() )
m_xUrlTransformer->parseStrict( aURL );
- m_aExternalFeatures[ nIds[ i ] ] = ExternalFeature( aURL );
+ m_aExternalFeatures[ nIds[ i ] ] = ExternalFeature( std::move(aURL) );
}
}
@@ -1344,7 +1345,7 @@ void SAL_CALL SbaTableQueryBrowser::disposing( const css::lang::EventObject& _rS
{
do
{
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xDSLoop).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xDSLoop));
if ( pData && pData->xConnection == xCon )
{
// we set the connection to null to avoid a second disposing of the connection
@@ -1644,7 +1645,7 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const
std::unique_ptr<weld::TreeIter> xDataSourceEntry = m_pTreeView->GetRootLevelParent(xCurrentEntry.get());
DBTreeListUserData* pDSData
= xDataSourceEntry
- ? reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xDataSourceEntry).toUInt64())
+ ? weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xDataSourceEntry))
: nullptr;
if ( nId == ID_TREE_CLOSE_CONN )
@@ -2033,7 +2034,7 @@ void SbaTableQueryBrowser::implAddDatasource(const OUString& _rDbName, OUString&
pDSData->eType = etDatasource;
pDSData->sAccessor = sDataSourceId;
pDSData->xConnection = _rxConnection;
- OUString sId(OUString::number(reinterpret_cast<sal_uInt64>(pDSData)));
+ OUString sId(weld::toId(pDSData));
std::unique_ptr<weld::TreeIter> xDatasourceEntry(rTreeView.make_iterator());
rTreeView.insert(nullptr, -1, &sDSDisplayName, &sId, nullptr, nullptr, false, xDatasourceEntry.get());
@@ -2044,7 +2045,7 @@ void SbaTableQueryBrowser::implAddDatasource(const OUString& _rDbName, OUString&
{
DBTreeListUserData* pQueriesData = new DBTreeListUserData;
pQueriesData->eType = etQueryContainer;
- sId = OUString::number(reinterpret_cast<sal_uInt64>(pQueriesData));
+ sId = weld::toId(pQueriesData);
std::unique_ptr<weld::TreeIter> xRet(rTreeView.make_iterator());
rTreeView.insert(xDatasourceEntry.get(), -1, &_rQueryName, &sId,
@@ -2057,7 +2058,7 @@ void SbaTableQueryBrowser::implAddDatasource(const OUString& _rDbName, OUString&
{
DBTreeListUserData* pTablesData = new DBTreeListUserData;
pTablesData->eType = etTableContainer;
- sId = OUString::number(reinterpret_cast<sal_uInt64>(pTablesData));
+ sId = weld::toId(pTablesData);
std::unique_ptr<weld::TreeIter> xRet(rTreeView.make_iterator());
rTreeView.insert(xDatasourceEntry.get(), -1, &_rTableName, &sId,
@@ -2088,7 +2089,7 @@ void SbaTableQueryBrowser::populateTree(const Reference<XNameAccess>& _xNameAcce
weld::TreeView& rTreeView = m_pTreeView->GetWidget();
rTreeView.make_unsorted();
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(rParent).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(rParent));
if (pData) // don't ask if the nameaccess is already set see OnExpandEntry views and tables
pData->xContainer = _xNameAccess;
@@ -2107,7 +2108,7 @@ void SbaTableQueryBrowser::populateTree(const Reference<XNameAccess>& _xNameAcce
if ( xChild.is() )
pEntryData->eType = etQueryContainer;
}
- implAppendEntry(&rParent, rName, pEntryData, pEntryData->eType);
+ implAppendEntry(&rParent, rName, pEntryData);
}
}
}
@@ -2119,13 +2120,15 @@ void SbaTableQueryBrowser::populateTree(const Reference<XNameAccess>& _xNameAcce
rTreeView.make_sorted();
}
-std::unique_ptr<weld::TreeIter> SbaTableQueryBrowser::implAppendEntry(const weld::TreeIter* pParent, const OUString& rName, void* pUserData, EntryType eEntryType)
+std::unique_ptr<weld::TreeIter> SbaTableQueryBrowser::implAppendEntry(const weld::TreeIter* pParent, const OUString& rName, const DBTreeListUserData* pUserData)
{
+ EntryType eEntryType = pUserData->eType;
+
std::unique_ptr<ImageProvider> xImageProvider(getImageProviderFor(pParent));
OUString aImage = xImageProvider->getImageId(rName, getDatabaseObjectType(eEntryType));
- OUString sId(OUString::number(reinterpret_cast<sal_uInt64>(pUserData)));
+ OUString sId(weld::toId(pUserData));
weld::TreeView& rTreeView = m_pTreeView->GetWidget();
std::unique_ptr<weld::TreeIter> xNewEntry(rTreeView.make_iterator());
rTreeView.insert(pParent, -1, &rName, &sId, nullptr, nullptr, eEntryType == etQueryContainer, xNewEntry.get());
@@ -2147,7 +2150,7 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, const weld::TreeIter&, rParent, b
std::unique_ptr<weld::TreeIter> xFirstParent = m_pTreeView->GetRootLevelParent(&rParent);
OSL_ENSURE(xFirstParent,"SbaTableQueryBrowser::OnExpandEntry: No rootlevelparent!");
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(rParent).toInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(rParent));
assert(pData && "SbaTableQueryBrowser::OnExpandEntry: No user data!");
if (etTableContainer == pData->eType)
@@ -2235,7 +2238,7 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, const weld::TreeIter&, rParent, b
// we have to expand the queries or bookmarks
if (ensureEntryObject(rParent))
{
- DBTreeListUserData* pParentData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(rParent).toUInt64());
+ DBTreeListUserData* pParentData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(rParent));
Reference< XNameAccess > xCollection( pParentData->xContainer, UNO_QUERY );
populateTree(xCollection, rParent, etQuery);
}
@@ -2249,7 +2252,7 @@ bool SbaTableQueryBrowser::ensureEntryObject(const weld::TreeIter& rEntry)
// the user data of the entry
weld::TreeView& rTreeView = m_pTreeView->GetWidget();
- DBTreeListUserData* pEntryData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(rEntry).toUInt64());
+ DBTreeListUserData* pEntryData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(rEntry));
OSL_ENSURE(pEntryData,"ensureEntryObject: user data should already be set!");
std::unique_ptr<weld::TreeIter> xDataSourceEntry = m_pTreeView->GetRootLevelParent(&rEntry);
@@ -2272,7 +2275,7 @@ bool SbaTableQueryBrowser::ensureEntryObject(const weld::TreeIter& rEntry)
if (rTreeView.iter_compare(*xParent, *xDataSourceEntry) != 0)
{
OUString aName(rTreeView.get_text(rEntry));
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xParent).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xParent));
try
{
Reference< XNameAccess > xNameAccess(pData->xContainer,UNO_QUERY);
@@ -2344,17 +2347,17 @@ bool SbaTableQueryBrowser::implLoadAnything(const OUString& _rDataSourceName, co
Reference<XPropertySet> xProp( getRowSet(), UNO_QUERY_THROW );
Reference< XLoadable > xLoadable( xProp, UNO_QUERY_THROW );
// the values allowing the RowSet to re-execute
- xProp->setPropertyValue(PROPERTY_DATASOURCENAME, makeAny(_rDataSourceName));
+ xProp->setPropertyValue(PROPERTY_DATASOURCENAME, Any(_rDataSourceName));
if(_rxConnection.is())
- xProp->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( _rxConnection.getTyped() ) );
+ xProp->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, Any( _rxConnection.getTyped() ) );
// set this _before_ setting the connection, else the rowset would rebuild it ...
- xProp->setPropertyValue(PROPERTY_COMMAND_TYPE, makeAny(nCommandType));
- xProp->setPropertyValue(PROPERTY_COMMAND, makeAny(_rCommand));
- xProp->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, css::uno::makeAny(_bEscapeProcessing));
+ xProp->setPropertyValue(PROPERTY_COMMAND_TYPE, Any(nCommandType));
+ xProp->setPropertyValue(PROPERTY_COMMAND, Any(_rCommand));
+ xProp->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, css::uno::Any(_bEscapeProcessing));
if ( m_bPreview )
{
- xProp->setPropertyValue(PROPERTY_FETCHDIRECTION, makeAny(FetchDirection::FORWARD));
+ xProp->setPropertyValue(PROPERTY_FETCHDIRECTION, Any(FetchDirection::FORWARD));
}
// the formatter depends on the data source we're working on, so rebuild it here ...
@@ -2424,44 +2427,44 @@ bool SbaTableQueryBrowser::implSelect(const OUString& _rDataSourceName, const OU
const SharedConnection& _rxConnection,
bool _bSelectDirect)
{
- if (_rDataSourceName.getLength() && _rCommand.getLength() && (-1 != nCommandType))
- {
- std::unique_ptr<weld::TreeIter> xDataSource;
- std::unique_ptr<weld::TreeIter> xCommandType;
- std::unique_ptr<weld::TreeIter> xCommand = getObjectEntry( _rDataSourceName, _rCommand, nCommandType, &xDataSource, &xCommandType, true, _rxConnection );
+ if (!_rDataSourceName.getLength() || !_rCommand.getLength() || (-1 == nCommandType))
+ return false;
- if (xCommand)
- {
- weld::TreeView& rTreeView = m_pTreeView->GetWidget();
+ std::unique_ptr<weld::TreeIter> xDataSource;
+ std::unique_ptr<weld::TreeIter> xCommandType;
+ std::unique_ptr<weld::TreeIter> xCommand = getObjectEntry( _rDataSourceName, _rCommand, nCommandType, &xDataSource, &xCommandType, true, _rxConnection );
- bool bSuccess = true;
- if ( _bSelectDirect )
- {
- bSuccess = implSelect(xCommand.get());
- }
- else
- {
- rTreeView.select(*xCommand);
- }
+ if (xCommand)
+ {
+ weld::TreeView& rTreeView = m_pTreeView->GetWidget();
- if ( bSuccess )
- {
- rTreeView.scroll_to_row(*xCommand);
- rTreeView.set_cursor(*xCommand);
- }
+ bool bSuccess = true;
+ if ( _bSelectDirect )
+ {
+ bSuccess = implSelect(xCommand.get());
}
- else if (!xCommandType)
+ else
{
- if (m_xCurrentlyDisplayed)
- {
- // tell the old entry (if any) it has been deselected
- selectPath(m_xCurrentlyDisplayed.get(), false);
- m_xCurrentlyDisplayed.reset();
- }
+ rTreeView.select(*xCommand);
+ }
- // we have a command and need to display this in the rowset
- return implLoadAnything(_rDataSourceName, _rCommand, nCommandType, _bEscapeProcessing, _rxConnection);
+ if ( bSuccess )
+ {
+ rTreeView.scroll_to_row(*xCommand);
+ rTreeView.set_cursor(*xCommand);
+ }
+ }
+ else if (!xCommandType)
+ {
+ if (m_xCurrentlyDisplayed)
+ {
+ // tell the old entry (if any) it has been deselected
+ selectPath(m_xCurrentlyDisplayed.get(), false);
+ m_xCurrentlyDisplayed.reset();
}
+
+ // we have a command and need to display this in the rowset
+ return implLoadAnything(_rDataSourceName, _rCommand, nCommandType, _bEscapeProcessing, _rxConnection);
}
return false;
}
@@ -2475,15 +2478,15 @@ IMPL_LINK_NOARG(SbaTableQueryBrowser, OnSelectionChange, LinkParamNone*, void)
implSelect(xSelection.get());
}
-std::unique_ptr<weld::TreeIter> SbaTableQueryBrowser::implGetConnectionEntry(weld::TreeIter& rEntry) const
+std::unique_ptr<weld::TreeIter> SbaTableQueryBrowser::implGetConnectionEntry(const weld::TreeIter& rEntry) const
{
weld::TreeView& rTreeView = m_pTreeView->GetWidget();
std::unique_ptr<weld::TreeIter> xCurrentEntry(rTreeView.make_iterator(&rEntry));
- DBTreeListUserData* pEntryData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xCurrentEntry).toInt64());
+ DBTreeListUserData* pEntryData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xCurrentEntry));
while (pEntryData->eType != etDatasource)
{
rTreeView.iter_parent(*xCurrentEntry);
- pEntryData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xCurrentEntry).toInt64());
+ pEntryData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xCurrentEntry));
}
return xCurrentEntry;
}
@@ -2494,7 +2497,7 @@ bool SbaTableQueryBrowser::implSelect(const weld::TreeIter* pEntry)
return false;
weld::TreeView& rTreeView = m_pTreeView->GetWidget();
- DBTreeListUserData* pEntryData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*pEntry).toUInt64());
+ DBTreeListUserData* pEntryData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*pEntry));
switch (pEntryData->eType)
{
case etTableOrView:
@@ -2510,11 +2513,11 @@ bool SbaTableQueryBrowser::implSelect(const weld::TreeIter* pEntry)
// get the entry for the tables or queries
std::unique_ptr<weld::TreeIter> xContainer = rTreeView.make_iterator(pEntry);
rTreeView.iter_parent(*xContainer);
- DBTreeListUserData* pContainerData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xContainer).toUInt64());
+ DBTreeListUserData* pContainerData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xContainer));
// get the entry for the datasource
std::unique_ptr<weld::TreeIter> xConnection = implGetConnectionEntry(*xContainer);
- DBTreeListUserData* pConData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xConnection).toUInt64());
+ DBTreeListUserData* pConData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xConnection));
// reinitialize the rowset
// but first check if it is necessary
@@ -2537,8 +2540,7 @@ bool SbaTableQueryBrowser::implSelect(const weld::TreeIter* pEntry)
{
while (rTreeView.iter_compare(*xNextTemp, *xConnection) != 0)
{
- sNameBuffer.insert(0,'/');
- sNameBuffer.insert(0, rTreeView.get_text(*xTemp));
+ sNameBuffer.insert(0, rTreeView.get_text(*xTemp) + "/");
rTreeView.copy_iterator(*xNextTemp, *xTemp);
if (!rTreeView.iter_parent(*xNextTemp))
break;
@@ -2621,7 +2623,7 @@ bool SbaTableQueryBrowser::implSelect(const weld::TreeIter* pEntry)
bool bEscapeProcessing = true;
if(xNameAccess.is() && xNameAccess->hasByName(sSimpleName))
{
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*pEntry).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*pEntry));
if ( !pData->xObjectProperties.is() )
{
Reference<XInterface> xObject;
@@ -2722,14 +2724,14 @@ std::unique_ptr<weld::TreeIter> SbaTableQueryBrowser::getEntryFromContainer(cons
if (rTreeView.iter_children(*xContainer))
{
// 1st child is queries
- DBTreeListUserData* pQueriesData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xContainer).toUInt64());
+ DBTreeListUserData* pQueriesData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xContainer));
if (pQueriesData && pQueriesData->xContainer == rxNameAccess)
break;
if (rTreeView.iter_next_sibling(*xContainer))
{
// 2nd child is tables
- DBTreeListUserData* pTablesData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xContainer).toUInt64());
+ DBTreeListUserData* pTablesData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xContainer));
if (pTablesData && pTablesData->xContainer == rxNameAccess)
break;
}
@@ -2756,7 +2758,7 @@ void SAL_CALL SbaTableQueryBrowser::elementInserted(const ContainerEvent& rEvent
rTreeView.make_unsorted();
// insert the new entry into the tree
- DBTreeListUserData* pContainerData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xEntry).toUInt64());
+ DBTreeListUserData* pContainerData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xEntry));
OSL_ENSURE(pContainerData, "elementInserted: There must be user data for this type!");
DBTreeListUserData* pNewData = new DBTreeListUserData;
@@ -2776,7 +2778,7 @@ void SAL_CALL SbaTableQueryBrowser::elementInserted(const ContainerEvent& rEvent
}
pNewData->eType = etQuery;
}
- implAppendEntry(xEntry.get(), ::comphelper::getString(rEvent.Accessor), pNewData, pNewData->eType);
+ implAppendEntry(xEntry.get(), ::comphelper::getString(rEvent.Accessor), pNewData);
rTreeView.make_sorted();
}
@@ -2821,7 +2823,7 @@ void SAL_CALL SbaTableQueryBrowser::elementRemoved( const ContainerEvent& _rEven
// unload
unloadAndCleanup( false ); // don't dispose the connection
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xTemp).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xTemp));
rTreeView.set_id(*xTemp, OUString());
delete pData; // the data could be null because we have a table which isn't correct
rTreeView.remove(*xTemp);
@@ -2836,7 +2838,7 @@ void SAL_CALL SbaTableQueryBrowser::elementRemoved( const ContainerEvent& _rEven
{
if (rTreeView.get_text(*xChild) == aName)
{
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xChild).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xChild));
rTreeView.set_id(*xChild, OUString());
delete pData;
rTreeView.remove(*xChild);
@@ -2872,13 +2874,13 @@ void SAL_CALL SbaTableQueryBrowser::elementReplaced( const ContainerEvent& _rEve
std::unique_ptr<weld::TreeIter> xTemp = rTreeView.make_iterator(m_xCurrentlyDisplayed.get());
unloadAndCleanup( false ); // don't dispose the connection
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xTemp).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xTemp));
if (pData)
{
if ( etTableOrView == pData->eType )
{
// only insert userdata when we have a table because the query is only a commanddefinition object and not a query
- _rEvent.Element >>= pData->xObjectProperties; // remember the new element
+ _rEvent.Element >>= pData->xObjectProperties; // remember the new element
}
else
{
@@ -2897,7 +2899,7 @@ void SAL_CALL SbaTableQueryBrowser::elementReplaced( const ContainerEvent& _rEve
{
if (rTreeView.get_text(*xChild) == aName)
{
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xChild).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xChild));
if (pData)
{
if ( etTableOrView == pData->eType )
@@ -2965,13 +2967,13 @@ void SbaTableQueryBrowser::disposeConnection(const weld::TreeIter* pDSEntry)
if (pDSEntry)
{
weld::TreeView& rTreeView = m_pTreeView->GetWidget();
- DBTreeListUserData* pTreeListData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*pDSEntry).toUInt64());
+ DBTreeListUserData* pTreeListData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*pDSEntry));
if (pTreeListData)
impl_releaseConnection(pTreeListData->xConnection);
}
}
-void SbaTableQueryBrowser::closeConnection(weld::TreeIter& rDSEntry, bool _bDisposeConnection)
+void SbaTableQueryBrowser::closeConnection(const weld::TreeIter& rDSEntry, bool _bDisposeConnection)
{
OSL_ENSURE(impl_isDataSourceEntry(&rDSEntry), "SbaTableQueryBrowser::closeConnection: invalid entry (not top-level)!");
@@ -3001,7 +3003,7 @@ void SbaTableQueryBrowser::closeConnection(weld::TreeIter& rDSEntry, bool _bDisp
{
std::unique_ptr<weld::TreeIter> xRemove(rTreeView.make_iterator(xElements.get()));
bElements = rTreeView.iter_next_sibling(*xElements);
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xRemove).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xRemove));
rTreeView.set_id(*xRemove, OUString());
delete pData;
rTreeView.remove(*xRemove);
@@ -3092,13 +3094,13 @@ namespace
}
}
-void SbaTableQueryBrowser::impl_initialize()
+void SbaTableQueryBrowser::impl_initialize(const ::comphelper::NamedValueCollection& rArguments)
{
SolarMutexGuard aGuard;
// doin' a lot of VCL stuff here -> lock the SolarMutex
// first initialize the parent
- SbaXDataBrowserController::impl_initialize();
+ SbaXDataBrowserController::impl_initialize(rArguments);
Reference<XConnection> xForeignConnection;
Reference< XFrame > xFrame;
@@ -3110,8 +3112,6 @@ void SbaTableQueryBrowser::impl_initialize()
OUString sInitialDataSourceName;
OUString sInitialCommand;
- const NamedValueCollection& rArguments( getInitParams() );
-
rArguments.get_ensureType( PROPERTY_DATASOURCENAME, sInitialDataSourceName );
rArguments.get_ensureType( PROPERTY_COMMAND_TYPE, nInitialDisplayCommandType );
rArguments.get_ensureType( PROPERTY_COMMAND, sInitialCommand );
@@ -3249,9 +3249,9 @@ void SbaTableQueryBrowser::impl_initialize()
try
{
Reference< XPropertySet > xRowSetProps(getRowSet(), UNO_QUERY);
- xRowSetProps->setPropertyValue(PROPERTY_UPDATE_CATALOGNAME,makeAny(aCatalogName));
- xRowSetProps->setPropertyValue(PROPERTY_UPDATE_SCHEMANAME,makeAny(aSchemaName));
- xRowSetProps->setPropertyValue(PROPERTY_UPDATE_TABLENAME,makeAny(aTableName));
+ xRowSetProps->setPropertyValue(PROPERTY_UPDATE_CATALOGNAME,Any(aCatalogName));
+ xRowSetProps->setPropertyValue(PROPERTY_UPDATE_SCHEMANAME,Any(aSchemaName));
+ xRowSetProps->setPropertyValue(PROPERTY_UPDATE_TABLENAME,Any(aTableName));
}
catch(const Exception&)
@@ -3303,7 +3303,7 @@ bool SbaTableQueryBrowser::ensureConnection(const weld::TreeIter* pAnyEntry, Sha
weld::TreeView& rTreeView = m_pTreeView->GetWidget();
DBTreeListUserData* pDSData =
xDSEntry
- ? reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xDSEntry).toUInt64())
+ ? weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xDSEntry))
: nullptr;
return ensureConnection(xDSEntry.get(), pDSData, rConnection);
@@ -3324,7 +3324,7 @@ bool SbaTableQueryBrowser::getExistentConnectionFor(const weld::TreeIter* pAnyEn
weld::TreeView& rTreeView = m_pTreeView->GetWidget();
DBTreeListUserData* pDSData =
xDSEntry
- ? reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xDSEntry).toUInt64())
+ ? weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xDSEntry))
: nullptr;
if (pDSData)
rConnection = pDSData->xConnection;
@@ -3433,7 +3433,7 @@ int SbaTableQueryBrowser::OnTreeEntryCompare(const weld::TreeIter& rLHS, const w
return nCompareResult;
}
-void SbaTableQueryBrowser::implAdministrate(weld::TreeIter& rApplyTo)
+void SbaTableQueryBrowser::implAdministrate(const weld::TreeIter& rApplyTo)
{
try
{
@@ -3520,7 +3520,7 @@ Any SbaTableQueryBrowser::getCurrentSelection(weld::TreeView& rControl) const
return Any();
NamedDatabaseObject aSelectedObject;
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xSelected).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xSelected));
aSelectedObject.Type = static_cast< sal_Int32 >( pData->eType );
switch ( aSelectedObject.Type )
@@ -3541,7 +3541,7 @@ Any SbaTableQueryBrowser::getCurrentSelection(weld::TreeView& rControl) const
break;
}
- return makeAny( aSelectedObject );
+ return Any( aSelectedObject );
}
vcl::Window* SbaTableQueryBrowser::getMenuParent() const
@@ -3778,14 +3778,14 @@ void SbaTableQueryBrowser::impl_cleanupDataSourceEntry(std::u16string_view rData
do
{
// delete any user data of the child entries of the to-be-removed entry
- const DBTreeListUserData* pData = reinterpret_cast<const DBTreeListUserData*>(rTreeView.get_id(*xChild).toUInt64());
+ const DBTreeListUserData* pData = weld::fromId<const DBTreeListUserData*>(rTreeView.get_id(*xChild));
rTreeView.set_id(*xChild, OUString());
delete pData;
} while (rTreeView.iter_next_sibling(*xChild));
}
// remove the entry
- DBTreeListUserData* pData = reinterpret_cast<DBTreeListUserData*>(rTreeView.get_id(*xDataSourceEntry).toUInt64());
+ DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xDataSourceEntry));
rTreeView.set_id(*xDataSourceEntry, OUString());
delete pData;
rTreeView.remove(*xDataSourceEntry);
diff --git a/dbaccess/source/ui/control/ColumnControlWindow.cxx b/dbaccess/source/ui/control/ColumnControlWindow.cxx
index 7a419a6cfb8c..f9f786f22ec3 100644
--- a/dbaccess/source/ui/control/ColumnControlWindow.cxx
+++ b/dbaccess/source/ui/control/ColumnControlWindow.cxx
@@ -21,6 +21,7 @@
#include <unotools/syslocale.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <connectivity/dbtools.hxx>
+#include <o3tl/safeint.hxx>
#include <UITools.hxx>
#include <core_resource.hxx>
#include <strings.hrc>
@@ -121,7 +122,7 @@ Reference< XNumberFormatter > OColumnControlWindow::GetFormatter() const
TOTypeInfoSP OColumnControlWindow::getTypeInfo(sal_Int32 _nPos)
{
- return ( _nPos >= 0 && _nPos < static_cast<sal_Int32>(m_aDestTypeInfoIndex.size())) ? m_aDestTypeInfoIndex[_nPos]->second : TOTypeInfoSP();
+ return ( _nPos >= 0 && o3tl::make_unsigned(_nPos) < m_aDestTypeInfoIndex.size()) ? m_aDestTypeInfoIndex[_nPos]->second : TOTypeInfoSP();
}
const OTypeInfoMap* OColumnControlWindow::getTypeInfo() const
diff --git a/dbaccess/source/ui/control/FieldControls.cxx b/dbaccess/source/ui/control/FieldControls.cxx
index 866014a99f2d..3f3553d56ee9 100644
--- a/dbaccess/source/ui/control/FieldControls.cxx
+++ b/dbaccess/source/ui/control/FieldControls.cxx
@@ -25,7 +25,7 @@ namespace dbaui {
OPropColumnEditCtrl::OPropColumnEditCtrl(std::unique_ptr<weld::Entry> xEntry,
OUString const & _rAllowedChars,
- const char* pHelpId,
+ TranslateId pHelpId,
short nPosition)
: OSQLNameEntry(std::move(xEntry), _rAllowedChars)
, m_nPos(nPosition)
@@ -33,7 +33,7 @@ OPropColumnEditCtrl::OPropColumnEditCtrl(std::unique_ptr<weld::Entry> xEntry,
m_strHelpText = DBA_RES(pHelpId);
}
-OPropEditCtrl::OPropEditCtrl(std::unique_ptr<weld::Entry> xEntry, const char* pHelpId, short nPosition)
+OPropEditCtrl::OPropEditCtrl(std::unique_ptr<weld::Entry> xEntry, TranslateId pHelpId, short nPosition)
: OWidgetBase(xEntry.get())
, m_xEntry(std::move(xEntry))
, m_nPos(nPosition)
@@ -41,7 +41,7 @@ OPropEditCtrl::OPropEditCtrl(std::unique_ptr<weld::Entry> xEntry, const char* pH
m_strHelpText = DBA_RES(pHelpId);
}
-OPropNumericEditCtrl::OPropNumericEditCtrl(std::unique_ptr<weld::SpinButton> xSpinButton, const char* pHelpId, short nPosition)
+OPropNumericEditCtrl::OPropNumericEditCtrl(std::unique_ptr<weld::SpinButton> xSpinButton, TranslateId pHelpId, short nPosition)
: OWidgetBase(xSpinButton.get())
, m_xSpinButton(std::move(xSpinButton))
, m_nPos(nPosition)
@@ -49,7 +49,7 @@ OPropNumericEditCtrl::OPropNumericEditCtrl(std::unique_ptr<weld::SpinButton> xSp
m_strHelpText = DBA_RES(pHelpId);
}
-OPropListBoxCtrl::OPropListBoxCtrl(std::unique_ptr<weld::ComboBox> xComboBox, const char* pHelpId, short nPosition)
+OPropListBoxCtrl::OPropListBoxCtrl(std::unique_ptr<weld::ComboBox> xComboBox, TranslateId pHelpId, short nPosition)
: OWidgetBase(xComboBox.get())
, m_xComboBox(std::move(xComboBox))
, m_nPos(nPosition)
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index 9009d0b467c3..f341482ea92f 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -20,11 +20,10 @@
#include <core_resource.hxx>
#include <FieldDescControl.hxx>
#include <FieldControls.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <TableDesignHelpBar.hxx>
#include <vcl/svapp.hxx>
#include <FieldDescriptions.hxx>
-#include <svl/zforlist.hxx>
#include <svl/numuno.hxx>
#include <vcl/transfer.hxx>
#include <com/sun/star/sdbc/ColumnValue.hpp>
@@ -71,7 +70,6 @@ OFieldDescControl::OFieldDescControl(weld::Container* pPage, OTableDesignHelpBar
, m_pHelp( pHelpBar )
, m_pLastFocusWindow(nullptr)
, m_pActFocusWindow(nullptr)
- , m_pPreviousType()
, m_nPos(-1)
, aYes(DBA_RES(STR_VALUE_YES))
, aNo(DBA_RES(STR_VALUE_NO))
@@ -166,27 +164,28 @@ void OFieldDescControl::Init()
void OFieldDescControl::SetReadOnly( bool bReadOnly )
{
// Enable/disable Controls
- OWidgetBase* ppAggregates[] = { m_xRequired.get(), m_xNumType.get()
- , m_xAutoIncrement.get(), m_xDefault.get()
- , m_xTextLen.get(), m_xLength.get()
- , m_xScale.get(), m_xColumnName.get()
- , m_xType.get(), m_xAutoIncrementValue.get()
- };
- weld::Widget* ppAggregatesText[] = { m_xRequiredText.get(), m_xNumTypeText.get()
- , m_xAutoIncrementText.get(), m_xDefaultText.get()
- , m_xTextLenText.get(), m_xLengthText.get()
- , m_xScaleText.get(), m_xColumnNameText.get()
- , m_xTypeText.get(), m_xAutoIncrementValueText.get()
- };
-
- OSL_ENSURE(SAL_N_ELEMENTS(ppAggregates) == SAL_N_ELEMENTS(ppAggregatesText),"Lists are not identical!");
-
- for (size_t i=0; i<SAL_N_ELEMENTS(ppAggregates); ++i)
+ struct final
{
- if ( ppAggregatesText[i] )
- ppAggregatesText[i]->set_sensitive( !bReadOnly );
- if ( ppAggregates[i] )
- ppAggregates[i]->set_sensitive( !bReadOnly );
+ OWidgetBase * aggregate;
+ weld::Widget * text;
+ } const aggregates[] = {
+ {m_xRequired.get(), m_xRequiredText.get()}
+ , {m_xNumType.get(), m_xNumTypeText.get()}
+ , {m_xAutoIncrement.get(), m_xAutoIncrementText.get()}
+ , {m_xDefault.get(), m_xDefaultText.get()}
+ , {m_xTextLen.get(), m_xTextLenText.get()}
+ , {m_xLength.get(), m_xLengthText.get()}
+ , {m_xScale.get(), m_xScaleText.get()}
+ , {m_xColumnName.get(), m_xColumnNameText.get()}
+ , {m_xType.get(), m_xTypeText.get()}
+ , {m_xAutoIncrementValue.get(), m_xAutoIncrementValueText.get()}};
+
+ for (auto const & aggregate: aggregates)
+ {
+ if (aggregate.text)
+ aggregate.text->set_sensitive(!bReadOnly);
+ if (aggregate.aggregate)
+ aggregate.aggregate->set_sensitive(!bReadOnly);
}
if (m_xFormat)
@@ -282,7 +281,7 @@ IMPL_LINK_NOARG(OFieldDescControl, FormatClickHdl, weld::Button&, void)
sal_Int32 nOldFormatKey(pActFieldDescr->GetFormatKey());
SvxCellHorJustify rOldJustify = pActFieldDescr->GetHorJustify();
Reference< XNumberFormatsSupplier > xSupplier = GetFormatter()->getNumberFormatsSupplier();
- SvNumberFormatsSupplierObj* pSupplierImpl = comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>( xSupplier );
+ SvNumberFormatsSupplierObj* pSupplierImpl = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>( xSupplier );
if (!pSupplierImpl)
return;
@@ -586,7 +585,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
}
}
-void OFieldDescControl::InitializeControl(OPropListBoxCtrl* _pControl,const OString& _sHelpId,bool _bAddChangeHandler)
+void OFieldDescControl::InitializeControl(OPropListBoxCtrl* _pControl,const OUString& _sHelpId,bool _bAddChangeHandler)
{
if ( _bAddChangeHandler )
_pControl->GetComboBox().connect_changed(LINK(this,OFieldDescControl,ChangeHdl));
@@ -594,7 +593,7 @@ void OFieldDescControl::InitializeControl(OPropListBoxCtrl* _pControl,const OStr
InitializeControl(_pControl->GetWidget(), _sHelpId);
}
-void OFieldDescControl::InitializeControl(weld::Widget* pControl,const OString& _sHelpId)
+void OFieldDescControl::InitializeControl(weld::Widget* pControl,const OUString& _sHelpId)
{
pControl->set_help_id(_sHelpId);
pControl->connect_focus_in(LINK(this, OFieldDescControl, OnControlFocusGot));
@@ -607,7 +606,7 @@ void OFieldDescControl::InitializeControl(weld::Widget* pControl,const OString&
}
}
-std::unique_ptr<OPropNumericEditCtrl> OFieldDescControl::CreateNumericControl(const OString& rId, const char* pHelpId, short _nProperty, const OString& _sHelpId)
+std::unique_ptr<OPropNumericEditCtrl> OFieldDescControl::CreateNumericControl(const OUString& rId, TranslateId pHelpId, short _nProperty, const OUString& _sHelpId)
{
auto xControl = std::make_unique<OPropNumericEditCtrl>(
m_xBuilder->weld_spin_button(rId), pHelpId, _nProperty);
@@ -916,7 +915,7 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr )
else
m_xBoolDefault->set_active_text(sDef);
- pFieldDescr->SetControlDefault(makeAny(BoolStringPersistent(m_xBoolDefault->get_active_text())));
+ pFieldDescr->SetControlDefault(Any(BoolStringPersistent(m_xBoolDefault->get_active_text())));
}
else if (m_xBoolDefault->get_count() < 3)
{
@@ -1117,7 +1116,7 @@ void OFieldDescControl::SaveData( OFieldDescription* pFieldDescr )
}
if ( !sDefault.isEmpty() )
- pFieldDescr->SetControlDefault(makeAny(sDefault));
+ pFieldDescr->SetControlDefault(Any(sDefault));
else
pFieldDescr->SetControlDefault(Any());
diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx
index fc8bca178725..cedd116575b2 100644
--- a/dbaccess/source/ui/control/RelationControl.cxx
+++ b/dbaccess/source/ui/control/RelationControl.cxx
@@ -21,7 +21,7 @@
#include <svtools/editbrowsebox.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <TableConnectionData.hxx>
#include <TableConnection.hxx>
@@ -46,7 +46,6 @@ namespace dbaui
{
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::container;
using namespace svt;
@@ -184,9 +183,9 @@ namespace dbaui
bool ORelationControl::PreNotify(NotifyEvent& rNEvt)
{
- if (rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS && !HasChildPathFocus() && !ControlHasFocus())
+ if (rNEvt.GetType() == NotifyEventType::LOSEFOCUS && !HasChildPathFocus() && !ControlHasFocus())
PostUserEvent(LINK(this, ORelationControl, AsynchDeactivate), nullptr, true);
- else if (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS)
+ else if (rNEvt.GetType() == NotifyEventType::GETFOCUS)
PostUserEvent(LINK(this, ORelationControl, AsynchActivate), nullptr, true);
return EditBrowseBox::PreNotify(rNEvt);
@@ -223,7 +222,7 @@ namespace dbaui
OConnectionLineDataVec& rLines = m_pConnData->GetConnLineDataList();
if ( rLines.size() <= o3tl::make_unsigned(nRow) )
{
- rLines.push_back(new OConnectionLineData());
+ rLines.emplace_back(new OConnectionLineData());
nRow = rLines.size() - 1;
// add new past-rLines row
m_ops.emplace_back(INSERT, make_pair(nRow+1, nRow+2));
@@ -285,7 +284,7 @@ namespace dbaui
void ORelationControl::InitController( CellControllerRef& /*rController*/, sal_Int32 nRow, sal_uInt16 nColumnId )
{
- OString sHelpId( HID_RELATIONDIALOG_LEFTFIELDCELL );
+ OUString sHelpId( HID_RELATIONDIALOG_LEFTFIELDCELL );
Reference< XPropertySet> xDef;
switch ( getColumnIdent(nColumnId) )
diff --git a/dbaccess/source/ui/control/SqlNameEdit.cxx b/dbaccess/source/ui/control/SqlNameEdit.cxx
index 89c0afc0bda1..9ac58cfda851 100644
--- a/dbaccess/source/ui/control/SqlNameEdit.cxx
+++ b/dbaccess/source/ui/control/SqlNameEdit.cxx
@@ -21,33 +21,33 @@
namespace dbaui
{
- static bool isCharOk(sal_Unicode _cChar,bool _bFirstChar, const OUString& _sAllowedChars)
+ static bool isCharOk(sal_Unicode _cChar,bool _bFirstChar, std::u16string_view _sAllowedChars)
{
return (
(_cChar >= 'A' && _cChar <= 'Z') ||
_cChar == '_' ||
- _sAllowedChars.indexOf(_cChar) != -1 ||
+ _sAllowedChars.find(_cChar) != std::u16string_view::npos ||
(!_bFirstChar && (_cChar >= '0' && _cChar <= '9')) ||
(_cChar >= 'a' && _cChar <= 'z')
);
}
- bool OSQLNameChecker::checkString(const OUString& _sToCheck,
+ bool OSQLNameChecker::checkString(std::u16string_view _sToCheck,
OUString& _rsCorrected)
{
bool bCorrected = false;
if ( m_bCheck )
{
sal_Int32 nMatch = 0;
- for (sal_Int32 i = nMatch; i < _sToCheck.getLength(); ++i)
+ for (size_t i = nMatch; i < _sToCheck.size(); ++i)
{
if ( !isCharOk( _sToCheck[i], i == 0, m_sAllowedChars ) )
{
- _rsCorrected += _sToCheck.subView(nMatch, i - nMatch);
+ _rsCorrected += _sToCheck.substr(nMatch, i - nMatch);
bCorrected = true;
nMatch = i + 1;
}
}
- _rsCorrected += _sToCheck.subView( nMatch );
+ _rsCorrected += _sToCheck.substr( nMatch );
}
return bCorrected;
}
diff --git a/dbaccess/source/ui/control/TableGrantCtrl.cxx b/dbaccess/source/ui/control/TableGrantCtrl.cxx
index 49719e814113..607c0199729a 100644
--- a/dbaccess/source/ui/control/TableGrantCtrl.cxx
+++ b/dbaccess/source/ui/control/TableGrantCtrl.cxx
@@ -151,14 +151,14 @@ void OTableGrantControl::Init()
bool OTableGrantControl::PreNotify(NotifyEvent& rNEvt)
{
- if (rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS)
+ if (rNEvt.GetType() == NotifyEventType::LOSEFOCUS)
if (!HasChildPathFocus())
{
if (m_nDeactivateEvent)
Application::RemoveUserEvent(m_nDeactivateEvent);
m_nDeactivateEvent = Application::PostUserEvent(LINK(this, OTableGrantControl, AsynchDeactivate), nullptr, true);
}
- if (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS)
+ if (rNEvt.GetType() == NotifyEventType::GETFOCUS)
{
if (m_nDeactivateEvent)
Application::RemoveUserEvent(m_nDeactivateEvent);
@@ -193,12 +193,6 @@ bool OTableGrantControl::IsTabAllowed(bool bForward) const
return EditBrowseBox::IsTabAllowed(bForward);
}
-#define GRANT_REVOKE_RIGHT(what) \
- if (m_pCheckCell->GetBox().get_active()) \
- xAuth->grantPrivileges(sTableName,PrivilegeObject::TABLE,what);\
- else \
- xAuth->revokePrivileges(sTableName,PrivilegeObject::TABLE,what)
-
bool OTableGrantControl::SaveModified()
{
@@ -219,25 +213,46 @@ bool OTableGrantControl::SaveModified()
switch( GetCurColumnId() )
{
case COL_INSERT:
- GRANT_REVOKE_RIGHT(Privilege::INSERT);
+ if (m_pCheckCell->GetBox().get_active())
+ xAuth->grantPrivileges(sTableName,PrivilegeObject::TABLE,Privilege::INSERT);
+ else
+ xAuth->revokePrivileges(sTableName,PrivilegeObject::TABLE,Privilege::INSERT);
break;
case COL_DELETE:
- GRANT_REVOKE_RIGHT(Privilege::DELETE);
+ if (m_pCheckCell->GetBox().get_active())
+ xAuth->grantPrivileges(sTableName,PrivilegeObject::TABLE,Privilege::DELETE);
+ else
+ xAuth->revokePrivileges(sTableName,PrivilegeObject::TABLE,Privilege::DELETE);
break;
case COL_UPDATE:
- GRANT_REVOKE_RIGHT(Privilege::UPDATE);
+ if (m_pCheckCell->GetBox().get_active())
+ xAuth->grantPrivileges(sTableName,PrivilegeObject::TABLE,Privilege::UPDATE);
+ else
+ xAuth->revokePrivileges(sTableName,PrivilegeObject::TABLE,Privilege::UPDATE);
break;
case COL_ALTER:
- GRANT_REVOKE_RIGHT(Privilege::ALTER);
+ if (m_pCheckCell->GetBox().get_active())
+ xAuth->grantPrivileges(sTableName,PrivilegeObject::TABLE,Privilege::ALTER);
+ else
+ xAuth->revokePrivileges(sTableName,PrivilegeObject::TABLE,Privilege::ALTER);
break;
case COL_SELECT:
- GRANT_REVOKE_RIGHT(Privilege::SELECT);
+ if (m_pCheckCell->GetBox().get_active())
+ xAuth->grantPrivileges(sTableName,PrivilegeObject::TABLE,Privilege::SELECT);
+ else
+ xAuth->revokePrivileges(sTableName,PrivilegeObject::TABLE,Privilege::SELECT);
break;
case COL_REF:
- GRANT_REVOKE_RIGHT(Privilege::REFERENCE);
+ if (m_pCheckCell->GetBox().get_active())
+ xAuth->grantPrivileges(sTableName,PrivilegeObject::TABLE,Privilege::REFERENCE);
+ else
+ xAuth->revokePrivileges(sTableName,PrivilegeObject::TABLE,Privilege::REFERENCE);
break;
case COL_DROP:
- GRANT_REVOKE_RIGHT(Privilege::DROP);
+ if (m_pCheckCell->GetBox().get_active())
+ xAuth->grantPrivileges(sTableName,PrivilegeObject::TABLE,Privilege::DROP);
+ else
+ xAuth->revokePrivileges(sTableName,PrivilegeObject::TABLE,Privilege::DROP);
break;
}
fillPrivilege(nRow);
diff --git a/dbaccess/source/ui/control/charsetlistbox.cxx b/dbaccess/source/ui/control/charsetlistbox.cxx
index 8915b65c9455..f9866905c3ea 100644
--- a/dbaccess/source/ui/control/charsetlistbox.cxx
+++ b/dbaccess/source/ui/control/charsetlistbox.cxx
@@ -34,7 +34,7 @@ namespace dbaui
}
}
- void CharSetListBox::SelectEntryByIanaName( const OUString& _rIanaName )
+ void CharSetListBox::SelectEntryByIanaName( std::u16string_view _rIanaName )
{
OCharsetDisplay::const_iterator aFind = m_aCharSets.findIanaName( _rIanaName );
if (aFind == m_aCharSets.end())
@@ -49,7 +49,7 @@ namespace dbaui
m_xControl->set_active_text((*aFind).getDisplayName());
}
- bool CharSetListBox::StoreSelectedCharSet( SfxItemSet& _rSet, const sal_uInt16 _nItemId )
+ bool CharSetListBox::StoreSelectedCharSet( SfxItemSet& _rSet, TypedWhichId<SfxStringItem> _nItemId )
{
bool bChangedSomething = false;
if (m_xControl->get_value_changed_from_saved())
diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx
index 0935caf8ff5d..be900d650f63 100644
--- a/dbaccess/source/ui/control/dbtreelistbox.cxx
+++ b/dbaccess/source/ui/control/dbtreelistbox.cxx
@@ -21,6 +21,7 @@
#include <dbexchange.hxx>
#include <callbacks.hxx>
+#include <com/sun/star/awt/PopupMenuDirection.hpp>
#include <com/sun/star/ui/XContextMenuInterceptor.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/frame/XController.hpp>
@@ -35,9 +36,9 @@
#include <toolkit/awt/vclxmenu.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <svx/dbaobjectex.hxx>
+#include <utility>
#include <vcl/commandevent.hxx>
#include <vcl/event.hxx>
-#include <vcl/menu.hxx>
#include <vcl/svapp.hxx>
#include <memory>
@@ -109,6 +110,7 @@ TreeListBox::TreeListBox(std::unique_ptr<weld::TreeView> xTreeView, bool bSQLTyp
, m_aDropTargetHelper(*this)
, m_pActionListener(nullptr)
, m_pContextMenuProvider(nullptr)
+ , m_aTimer("dbaccess TreeListBox m_aTimer")
{
m_xTreeView->connect_key_press(LINK(this, TreeListBox, KeyInputHdl));
m_xTreeView->connect_changed(LINK(this, TreeListBox, SelectHdl));
@@ -185,20 +187,28 @@ TreeListBox::~TreeListBox()
std::unique_ptr<weld::TreeIter> TreeListBox::GetEntryPosByName(std::u16string_view aName, const weld::TreeIter* pStart, const IEntryFilter* _pFilter) const
{
auto xEntry(m_xTreeView->make_iterator(pStart));
- if (!pStart && !m_xTreeView->get_iter_first(*xEntry))
- return nullptr;
+ if (pStart)
+ {
+ if (!m_xTreeView->iter_children(*xEntry))
+ return nullptr;
+ }
+ else
+ {
+ if (!m_xTreeView->get_iter_first(*xEntry))
+ return nullptr;
+ }
do
{
if (m_xTreeView->get_text(*xEntry) == aName)
{
- if (!_pFilter || _pFilter->includeEntry(reinterpret_cast<void*>(m_xTreeView->get_id(*xEntry).toUInt64())))
+ if (!_pFilter || _pFilter->includeEntry(weld::fromId<void*>(m_xTreeView->get_id(*xEntry))))
{
// found
return xEntry;
}
}
- } while (m_xTreeView->iter_next(*xEntry));
+ } while (m_xTreeView->iter_next_sibling(*xEntry));
return nullptr;
}
@@ -284,7 +294,7 @@ IMPL_LINK(TreeListBox, QueryTooltipHdl, const weld::TreeIter&, rIter, OUString)
{
OUString sQuickHelpText;
if (m_pActionListener &&
- m_pActionListener->requestQuickHelp(reinterpret_cast<void*>(m_xTreeView->get_id(rIter).toUInt64()), sQuickHelpText))
+ m_pActionListener->requestQuickHelp(weld::fromId<void*>(m_xTreeView->get_id(rIter)), sQuickHelpText))
{
return sQuickHelpText;
}
@@ -299,8 +309,8 @@ namespace
class SelectionSupplier : public SelectionSupplier_Base
{
public:
- explicit SelectionSupplier( const Any& _rSelection )
- :m_aSelection( _rSelection )
+ explicit SelectionSupplier( Any _aSelection )
+ :m_aSelection(std::move( _aSelection ))
{
}
@@ -365,10 +375,11 @@ IMPL_LINK(TreeListBox, CommandHdl, const CommandEvent&, rCEvt, bool)
if (aResourceName.isEmpty())
return false;
- css::uno::Sequence< css::uno::Any > aArgs( 3 );
- aArgs[0] <<= comphelper::makePropertyValue( "Value", aResourceName );
- aArgs[1] <<= comphelper::makePropertyValue( "Frame", m_pContextMenuProvider->getCommandController().getXController()->getFrame() );
- aArgs[2] <<= comphelper::makePropertyValue( "IsContextMenu", true );
+ css::uno::Sequence< css::uno::Any > aArgs{
+ css::uno::Any(comphelper::makePropertyValue( "Value", aResourceName )),
+ css::uno::Any(comphelper::makePropertyValue( "Frame", m_pContextMenuProvider->getCommandController().getXController()->getFrame() )),
+ css::uno::Any(comphelper::makePropertyValue( "IsContextMenu", true ))
+ };
css::uno::Reference< css::uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
css::uno::Reference<css::frame::XPopupMenuController> xMenuController
@@ -380,9 +391,10 @@ IMPL_LINK(TreeListBox, CommandHdl, const CommandEvent&, rCEvt, bool)
VclPtr<vcl::Window> xMenuParent = m_pContextMenuProvider->getMenuParent();
+ css::uno::Reference< css::awt::XWindow> xSourceWindow = VCLUnoHelper::GetInterface(xMenuParent);
+
rtl::Reference xPopupMenu( new VCLXPopupMenu );
xMenuController->setPopupMenu( xPopupMenu );
- VclPtr<PopupMenu> pContextMenu( static_cast< PopupMenu* >( xPopupMenu->GetMenu() ) );
// allow context menu interception
::comphelper::OInterfaceContainerHelper2* pInterceptors = m_pContextMenuProvider->getContextMenuInterceptors();
@@ -391,11 +403,11 @@ IMPL_LINK(TreeListBox, CommandHdl, const CommandEvent&, rCEvt, bool)
OUString aMenuIdentifier( "private:resource/popupmenu/" + aResourceName );
ContextMenuExecuteEvent aEvent;
- aEvent.SourceWindow = VCLUnoHelper::GetInterface(xMenuParent);
+ aEvent.SourceWindow = xSourceWindow;
aEvent.ExecutePosition.X = -1;
aEvent.ExecutePosition.Y = -1;
aEvent.ActionTriggerContainer = ::framework::ActionTriggerHelper::CreateActionTriggerContainerFromMenu(
- pContextMenu.get(), &aMenuIdentifier );
+ xPopupMenu, &aMenuIdentifier );
aEvent.Selection = new SelectionSupplier(m_pContextMenuProvider->getCurrentSelection(*m_xTreeView));
::comphelper::OInterfaceIteratorHelper2 aIter( *pInterceptors );
@@ -441,9 +453,9 @@ IMPL_LINK(TreeListBox, CommandHdl, const CommandEvent&, rCEvt, bool)
if ( bModifiedMenu )
{
- pContextMenu->Clear();
+ xPopupMenu->clear();
::framework::ActionTriggerHelper::CreateMenuFromActionTriggerContainer(
- pContextMenu, aEvent.ActionTriggerContainer );
+ xPopupMenu, aEvent.ActionTriggerContainer );
aEvent.ActionTriggerContainer.clear();
}
}
@@ -452,8 +464,8 @@ IMPL_LINK(TreeListBox, CommandHdl, const CommandEvent&, rCEvt, bool)
m_pContextMenuProvider->adjustMenuPosition(*m_xTreeView, aPos);
// do action for selected entry in popup menu
- pContextMenu->Execute(xMenuParent, aPos);
- pContextMenu.disposeAndClear();
+ css::uno::Reference<css::awt::XWindowPeer> xParent(xSourceWindow, css::uno::UNO_QUERY);
+ xPopupMenu->execute(xParent, css::awt::Rectangle(aPos.X(), aPos.Y(), 1, 1), css::awt::PopupMenuDirection::EXECUTE_DOWN);
css::uno::Reference<css::lang::XComponent> xComponent(xMenuController, css::uno::UNO_QUERY);
if (xComponent.is())
diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx
index 99be8a42763d..3847df5f54d0 100644
--- a/dbaccess/source/ui/control/opendoccontrols.cxx
+++ b/dbaccess/source/ui/control/opendoccontrols.cxx
@@ -130,24 +130,21 @@ namespace dbaui
{
OSL_ENSURE( _pAsciiModuleName, "OpenDocumentListBox::impl_init: invalid module name!" );
- Sequence< Sequence< PropertyValue> > aHistory = SvtHistoryOptions().GetList( EHistoryType::PickList );
+ std::vector< SvtHistoryOptions::HistoryItem > aHistory = SvtHistoryOptions::GetList( EHistoryType::PickList );
Reference< XNameAccess > xFilterFactory;
xFilterFactory.set(::comphelper::getProcessServiceFactory()->createInstance(
"com.sun.star.document.FilterFactory" ), css::uno::UNO_QUERY);
- sal_uInt32 nCount = aHistory.getLength();
- for ( sal_uInt32 nItem = 0; nItem < nCount; ++nItem )
+ for ( const SvtHistoryOptions::HistoryItem& rHistoryItem : aHistory )
{
try
{
// Get the current history item's properties.
- ::comphelper::SequenceAsHashMap aItemProperties( aHistory[ nItem ] );
- OUString sURL = aItemProperties.getUnpackedValueOrDefault( HISTORY_PROPERTYNAME_URL, OUString() );
- OUString sFilter = aItemProperties.getUnpackedValueOrDefault( HISTORY_PROPERTYNAME_FILTER, OUString() );
- OUString sTitle = aItemProperties.getUnpackedValueOrDefault( HISTORY_PROPERTYNAME_TITLE, OUString() );
- OUString sPassword = aItemProperties.getUnpackedValueOrDefault( HISTORY_PROPERTYNAME_PASSWORD, OUString() );
+ OUString sURL = rHistoryItem.sURL;
+ OUString sFilter = rHistoryItem.sFilter;
+ OUString sTitle = rHistoryItem.sTitle;
- // If the entry is an impress file then insert it into the
+ // If the entry is a Base file then insert it into the
// history list and the list box.
Sequence< PropertyValue > aProps;
xFilterFactory->getByName( sFilter ) >>= aProps;
@@ -160,9 +157,6 @@ namespace dbaui
// yes, it's a Base document
INetURLObject aURL;
aURL.SetSmartURL( sURL );
- // The password is set only when it is not empty.
- if ( !sPassword.isEmpty() )
- aURL.SetPass( sPassword );
if ( sTitle.isEmpty() )
sTitle = aURL.getBase( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::Unambiguous );
diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx
index c53f684dab4a..4d00c32293d2 100644
--- a/dbaccess/source/ui/control/sqledit.cxx
+++ b/dbaccess/source/ui/control/sqledit.cxx
@@ -33,9 +33,12 @@
#include <sqledit.hxx>
#include <cppuhelper/implbase.hxx>
#include <i18nlangtag/languagetag.hxx>
+#include <svl/itempool.hxx>
#include <svl/itemset.hxx>
+#include <vcl/commandevent.hxx>
#include <vcl/event.hxx>
#include <vcl/settings.hxx>
+#include <vcl/specialchars.hxx>
#include <vcl/svapp.hxx>
using namespace dbaui;
@@ -51,7 +54,7 @@ private:
virtual void SAL_CALL disposing(css::lang::EventObject const &) override
{
- osl::MutexGuard g(editor_.m_mutex);
+ std::unique_lock g(editor_.m_mutex);
editor_.m_notifier.clear();
}
@@ -65,11 +68,14 @@ private:
SQLEditView& editor_;
};
-SQLEditView::SQLEditView()
- : m_aHighlighter(HighlighterLanguage::SQL)
+SQLEditView::SQLEditView(std::unique_ptr<weld::ScrolledWindow> xScrolledWindow)
+ : m_xScrolledWindow(std::move(xScrolledWindow))
+ , m_aUpdateDataTimer("dbaccess SQLEditView m_aUpdateDataTimer")
+ , m_aHighlighter(HighlighterLanguage::SQL)
, m_bInUpdate(false)
, m_bDisableInternalUndo(false)
{
+ m_xScrolledWindow->connect_vadjustment_changed(LINK(this, SQLEditView, ScrollHdl));
}
void SQLEditView::DisableInternalUndo()
@@ -80,32 +86,31 @@ void SQLEditView::DisableInternalUndo()
void SQLEditView::SetItemPoolFont(SfxItemPool* pItemPool)
{
- StyleSettings aStyleSettings = Application::GetSettings().GetStyleSettings();
OUString sFontName(officecfg::Office::Common::Font::SourceViewFont::FontName::get().value_or(OUString()));
if (sFontName.isEmpty())
{
- vcl::Font aTmpFont(OutputDevice::GetDefaultFont(DefaultFontType::FIXED, Application::GetSettings().GetUILanguageTag().getLanguageType(), GetDefaultFontFlags::NONE));
+ vcl::Font aTmpFont(OutputDevice::GetDefaultFont(DefaultFontType::FIXED, Application::GetSettings().GetUILanguageTag().getLanguageType(), GetDefaultFontFlags::OnlyOne));
sFontName = aTmpFont.GetFamilyName();
}
Size aFontSize(0, officecfg::Office::Common::Font::SourceViewFont::FontHeight::get());
vcl::Font aAppFont(sFontName, aFontSize);
- pItemPool->SetPoolDefaultItem(SvxFontItem(aAppFont.GetFamilyType(), aAppFont.GetFamilyName(),
+ pItemPool->SetUserDefaultItem(SvxFontItem(aAppFont.GetFamilyType(), aAppFont.GetFamilyName(),
"", PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW,
EE_CHAR_FONTINFO));
- pItemPool->SetPoolDefaultItem(SvxFontItem(aAppFont.GetFamilyType(), aAppFont.GetFamilyName(),
+ pItemPool->SetUserDefaultItem(SvxFontItem(aAppFont.GetFamilyType(), aAppFont.GetFamilyName(),
"", PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW,
EE_CHAR_FONTINFO_CJK));
- pItemPool->SetPoolDefaultItem(SvxFontItem(aAppFont.GetFamilyType(), aAppFont.GetFamilyName(),
+ pItemPool->SetUserDefaultItem(SvxFontItem(aAppFont.GetFamilyType(), aAppFont.GetFamilyName(),
"", PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW,
EE_CHAR_FONTINFO_CTL));
- pItemPool->SetPoolDefaultItem(
+ pItemPool->SetUserDefaultItem(
SvxFontHeightItem(aAppFont.GetFontHeight() * 20, 100, EE_CHAR_FONTHEIGHT));
- pItemPool->SetPoolDefaultItem(
+ pItemPool->SetUserDefaultItem(
SvxFontHeightItem(aAppFont.GetFontHeight() * 20, 100, EE_CHAR_FONTHEIGHT_CJK));
- pItemPool->SetPoolDefaultItem(
+ pItemPool->SetUserDefaultItem(
SvxFontHeightItem(aAppFont.GetFontHeight() * 20, 100, EE_CHAR_FONTHEIGHT_CTL));
}
@@ -125,8 +130,9 @@ void SQLEditView::SetDrawingArea(weld::DrawingArea* pDrawingArea)
rEditEngine.SetDefaultHorizontalTextDirection(EEHorizontalTextDirection::L2R);
rEditEngine.SetModifyHdl(LINK(this, SQLEditView, ModifyHdl));
+ rEditEngine.SetStatusEventHdl(LINK(this, SQLEditView, EditStatusHdl));
- m_aUpdateDataTimer.SetTimeout(300);
+ m_aUpdateDataTimer.SetTimeout(150);
m_aUpdateDataTimer.SetInvokeHandler(LINK(this, SQLEditView, ImplUpdateDataHdl));
ImplSetFont();
@@ -139,7 +145,7 @@ void SQLEditView::SetDrawingArea(weld::DrawingArea* pDrawingArea)
officecfg::Office::Common::Font::SourceViewFont::get(),
css::uno::UNO_QUERY_THROW);
{
- osl::MutexGuard g(m_mutex);
+ std::unique_lock g(m_mutex);
m_notifier = n;
}
css::uno::Sequence< OUString > s { "FontHeight", "FontName" };
@@ -151,7 +157,7 @@ SQLEditView::~SQLEditView()
{
css::uno::Reference< css::beans::XMultiPropertySet > n;
{
- osl::MutexGuard g(m_mutex);
+ std::unique_lock g(m_mutex);
n = m_notifier;
}
if (n.is()) {
@@ -170,8 +176,6 @@ IMPL_LINK_NOARG(SQLEditView, ModifyHdl, LinkParamNone*, void)
{
if (m_bInUpdate)
return;
-
- m_aModifyLink.Call(nullptr);
m_aUpdateDataTimer.Start();
}
@@ -190,11 +194,11 @@ void SQLEditView::UpdateData()
m_bInUpdate = true;
EditEngine& rEditEngine = *GetEditEngine();
+ bool bModified = rEditEngine.IsModified();
bool bUndoEnabled = rEditEngine.IsUndoEnabled();
rEditEngine.EnableUndo(false);
// syntax highlighting
- bool bOrigModified = rEditEngine.IsModified();
for (sal_Int32 nLine=0; nLine < rEditEngine.GetParagraphCount(); ++nLine)
{
OUString aLine( rEditEngine.GetText( nLine ) );
@@ -214,12 +218,16 @@ void SQLEditView::UpdateData()
rEditEngine.QuickSetAttribs(aSet, ESelection(nLine, portion.nBegin, nLine, portion.nEnd));
}
}
- if (!bOrigModified)
- rEditEngine.ClearModifyFlag();
+
+ rEditEngine.ClearModifyFlag();
+
m_bInUpdate = false;
rEditEngine.EnableUndo(bUndoEnabled);
+ if (bModified)
+ m_aModifyLink.Call(nullptr);
+
Invalidate();
}
@@ -355,6 +363,139 @@ bool SQLEditView::KeyInput(const KeyEvent& rKEvt)
return WeldEditView::KeyInput(rKEvt);
}
+bool SQLEditView::Command(const CommandEvent& rCEvt)
+{
+ if (rCEvt.GetCommand() == CommandEventId::ContextMenu)
+ {
+ ::tools::Rectangle aRect(rCEvt.GetMousePosPixel(), Size(1, 1));
+ weld::Widget* pPopupParent = GetDrawingArea();
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pPopupParent, "vcl/ui/editmenu.ui"));
+ std::unique_ptr<weld::Menu> xContextMenu(xBuilder->weld_menu("menu"));
+
+ bool bEnableCut = true;
+ bool bEnableCopy = true;
+ bool bEnableDelete = true;
+ bool bEnablePaste = true;
+ bool bEnableSpecialChar = true;
+
+ EditView* pEditView = GetEditView();
+
+ if (!pEditView->HasSelection())
+ {
+ bEnableCut = false;
+ bEnableCopy = false;
+ bEnableDelete = false;
+ }
+
+ if (pEditView->IsReadOnly())
+ {
+ bEnableCut = false;
+ bEnablePaste = false;
+ bEnableDelete = false;
+ bEnableSpecialChar = false;
+ }
+
+ xContextMenu->set_sensitive("cut", bEnableCut);
+ xContextMenu->set_sensitive("copy", bEnableCopy);
+ xContextMenu->set_sensitive("delete", bEnableDelete);
+ xContextMenu->set_sensitive("paste", bEnablePaste);
+ xContextMenu->set_sensitive("specialchar", bEnableSpecialChar);
+ xContextMenu->set_visible("undo", false);
+ xContextMenu->set_visible("specialchar", vcl::GetGetSpecialCharsFunction() != nullptr);
+
+ OUString sCommand = xContextMenu->popup_at_rect(pPopupParent, aRect);
+
+ if (sCommand == "cut")
+ pEditView->Cut();
+ else if (sCommand == "copy")
+ pEditView->Copy();
+ else if (sCommand == "paste")
+ pEditView->Paste();
+ else if (sCommand == "delete")
+ pEditView->DeleteSelected();
+ else if (sCommand == "selectall")
+ {
+ sal_Int32 nPar = m_xEditEngine->GetParagraphCount();
+ if (nPar)
+ {
+ sal_Int32 nLen = m_xEditEngine->GetTextLen(nPar - 1);
+ pEditView->SetSelection(ESelection(0, 0, nPar - 1, nLen));
+ }
+ }
+ else if (sCommand == "specialchar")
+ {
+ OUString aChars = vcl::GetGetSpecialCharsFunction()(pPopupParent, m_xEditEngine->GetStandardFont(0));
+ if (!aChars.isEmpty())
+ {
+ pEditView->InsertText(aChars);
+ }
+ }
+
+ return true;
+ }
+ return WeldEditView::Command(rCEvt);
+}
+
+void SQLEditView::EditViewScrollStateChange()
+{
+ // editengine height has changed or editview scroll pos has changed
+ SetScrollBarRange();
+}
+
+void SQLEditView::SetScrollBarRange()
+{
+ EditEngine *pEditEngine = GetEditEngine();
+ if (!pEditEngine)
+ return;
+ if (!m_xScrolledWindow)
+ return;
+ EditView* pEditView = GetEditView();
+ if (!pEditView)
+ return;
+
+ int nVUpper = pEditEngine->GetTextHeight();
+ int nVCurrentDocPos = pEditView->GetVisArea().Top();
+ const Size aOut(pEditView->GetOutputArea().GetSize());
+ int nVStepIncrement = aOut.Height() * 2 / 10;
+ int nVPageIncrement = aOut.Height() * 8 / 10;
+ int nVPageSize = aOut.Height();
+
+ /* limit the page size to below nUpper because gtk's gtk_scrolled_window_start_deceleration has
+ effectively...
+
+ lower = gtk_adjustment_get_lower
+ upper = gtk_adjustment_get_upper - gtk_adjustment_get_page_size
+
+ and requires that upper > lower or the deceleration animation never ends
+ */
+ nVPageSize = std::min(nVPageSize, nVUpper);
+
+ m_xScrolledWindow->vadjustment_configure(nVCurrentDocPos, 0, nVUpper,
+ nVStepIncrement, nVPageIncrement, nVPageSize);
+}
+
+IMPL_LINK_NOARG(SQLEditView, ScrollHdl, weld::ScrolledWindow&, void)
+{
+ DoScroll();
+}
+
+IMPL_LINK_NOARG(SQLEditView, EditStatusHdl, EditStatus&, void)
+{
+ Resize();
+}
+
+void SQLEditView::DoScroll()
+{
+ if (m_xEditView)
+ {
+ auto currentDocPos = m_xEditView->GetVisArea().Top();
+ auto nDiff = currentDocPos - m_xScrolledWindow->vadjustment_get_value();
+ // we expect SetScrollBarRange callback to be triggered by Scroll
+ // to set where we ended up
+ m_xEditView->Scroll(0, nDiff);
+ }
+}
+
void SQLEditView::ConfigurationChanged(utl::ConfigurationBroadcaster*, ConfigurationHints)
{
UpdateData();
diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx
index 32a62da248e7..e68132d4ea82 100644
--- a/dbaccess/source/ui/control/tabletree.cxx
+++ b/dbaccess/source/ui/control/tabletree.cxx
@@ -28,7 +28,7 @@
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <com/sun/star/sdbc/SQLException.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <connectivity/dbmetadata.hxx>
@@ -39,7 +39,6 @@ namespace dbaui
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdb;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::container;
@@ -463,7 +462,7 @@ std::unique_ptr<weld::TreeIter> OTableTreeListBox::implAddEntry(
return nullptr;
}
-NamedDatabaseObject OTableTreeListBox::describeObject(weld::TreeIter& rEntry)
+NamedDatabaseObject OTableTreeListBox::describeObject(const weld::TreeIter& rEntry)
{
NamedDatabaseObject aObject;
@@ -511,7 +510,7 @@ bool OTableTreeListBox::impl_getAndAssertMetaData( Reference< XDatabaseMetaData
return _out_rMetaData.is();
}
-OUString OTableTreeListBox::getQualifiedTableName(weld::TreeIter& rEntry) const
+OUString OTableTreeListBox::getQualifiedTableName(const weld::TreeIter& rEntry) const
{
OSL_PRECOND( !isFolderEntry(rEntry), "OTableTreeListBox::getQualifiedTableName: folder entries not allowed here!" );
@@ -625,7 +624,7 @@ void OTableTreeListBox::CheckButtons()
} while (m_xTreeView->iter_next_sibling(*xEntry));
}
-TriState OTableTreeListBox::implDetermineState(weld::TreeIter& rEntry)
+TriState OTableTreeListBox::implDetermineState(const weld::TreeIter& rEntry)
{
if (!m_bShowToggles)
return TRISTATE_FALSE;
diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx
index 75973ad1e780..63f018f9e176 100644
--- a/dbaccess/source/ui/dlg/CollectionView.cxx
+++ b/dbaccess/source/ui/dlg/CollectionView.cxx
@@ -18,7 +18,7 @@
*/
#include <CollectionView.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <core_resource.hxx>
#include <strings.hrc>
#include <comphelper/interaction.hxx>
@@ -26,6 +26,7 @@
#include <cppuhelper/exc_hlp.hxx>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
+#include <o3tl/safeint.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <UITools.hxx>
@@ -41,14 +42,13 @@
#include <ucbhelper/commandenvironment.hxx>
#include <ucbhelper/content.hxx>
#include <connectivity/dbexception.hxx>
+#include <utility>
namespace dbaui
{
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ucb;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::task;
using namespace ::com::sun::star::sdbc;
@@ -57,10 +57,10 @@ using namespace comphelper;
OCollectionView::OCollectionView(weld::Window* pParent,
const Reference< XContent>& _xContent,
const OUString& _sDefaultName,
- const css::uno::Reference< css::uno::XComponentContext >& _rxContext)
+ css::uno::Reference< css::uno::XComponentContext > _xContext)
: GenericDialogController(pParent, "dbaccess/ui/collectionviewdialog.ui", "CollectionView")
, m_xContent(_xContent)
- , m_xContext(_rxContext)
+ , m_xContext(std::move(_xContext))
, m_bCreateForm(true)
, m_xFTCurrentPath(m_xBuilder->weld_label("currentPathLabel"))
, m_xNewFolder(m_xBuilder->weld_button("newFolderButton"))
@@ -141,7 +141,7 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click, weld::Button&, void)
Reference<XInteractionHandler2> xHandler(
InteractionHandler::createWithParent(m_xContext, m_xDialog->GetXWindow()));
- rtl::Reference<OInteractionRequest> pRequest = new OInteractionRequest(makeAny(aException));
+ rtl::Reference<OInteractionRequest> pRequest = new OInteractionRequest(Any(aException));
rtl::Reference<OInteractionApprove> pApprove = new OInteractionApprove;
pRequest->addContinuation(pApprove);
@@ -177,7 +177,7 @@ IMPL_LINK_NOARG(OCollectionView, NewFolder_Click, weld::Button&, void)
try
{
Reference<XHierarchicalNameContainer> xNameContainer(m_xContent,UNO_QUERY);
- if ( dbaui::insertHierachyElement(m_xDialog.get(),m_xContext,xNameContainer,OUString(),m_bCreateForm) )
+ if ( dbaui::insertHierarchyElement(m_xDialog.get(),m_xContext,xNameContainer,OUString(),m_bCreateForm) )
Initialize();
}
catch( const SQLException& )
@@ -256,9 +256,9 @@ void OCollectionView::initCurrentPath()
static const char s_sReportsCID[] = "private:reports";
m_bCreateForm = s_sFormsCID == sCID;
OUString sPath("/");
- if ( m_bCreateForm && sCID.getLength() != static_cast<sal_Int32>(strlen(s_sFormsCID)))
+ if ( m_bCreateForm && o3tl::make_unsigned(sCID.getLength()) != strlen(s_sFormsCID))
sPath = sCID.copy(strlen(s_sFormsCID));
- else if ( !m_bCreateForm && sCID.getLength() != static_cast<sal_Int32>(strlen(s_sReportsCID)) )
+ else if ( !m_bCreateForm && o3tl::make_unsigned(sCID.getLength()) != strlen(s_sReportsCID) )
sPath = sCID.copy(strlen(s_sReportsCID) - 2);
m_xFTCurrentPath->set_label(sPath);
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index 722ee44a87ca..66db8dc37ab3 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -36,7 +36,7 @@
#include "dsselect.hxx"
#include <svl/filenotation.hxx>
#include <com/sun/star/awt/XSystemDependentWindowPeer.hpp>
-#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
+#include <com/sun/star/ui/dialogs/XFolderPicker2.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/lang/SystemDependent.hpp>
#include <com/sun/star/mozilla/MozillaBootstrap.hpp>
@@ -46,7 +46,7 @@
#include <ucbhelper/content.hxx>
#include "finteraction.hxx"
#include <tools/urlobj.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#if defined _WIN32
#include <rtl/process.h>
@@ -65,14 +65,10 @@ namespace dbaui
using namespace ::com::sun::star::ucb;
using namespace ::com::sun::star::ui::dialogs;
using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::container;
using namespace ::com::sun::star::mozilla;
- using namespace ::dbtools;
using namespace ::svt;
- OConnectionHelper::OConnectionHelper(weld::Container* pPage, weld::DialogController* pController, const OUString& _rUIXMLDescription, const OString& _rId, const SfxItemSet& _rCoreAttrs)
+ OConnectionHelper::OConnectionHelper(weld::Container* pPage, weld::DialogController* pController, const OUString& _rUIXMLDescription, const OUString& _rId, const SfxItemSet& _rCoreAttrs)
: OGenericAdministrationPage(pPage, pController, _rUIXMLDescription, _rId, _rCoreAttrs)
, m_bUserGrabFocus(false)
, m_pCollection(nullptr)
@@ -151,7 +147,7 @@ namespace dbaui
{
try
{
- Reference< XFolderPicker2 > xFolderPicker = FolderPicker::create(m_xORB);
+ Reference< XFolderPicker2 > xFolderPicker = sfx2::createFolderPicker(m_xORB, GetFrameWeld());
bool bDoBrowse = false;
OUString sOldPath = getURLNoPrefix();
@@ -221,22 +217,11 @@ namespace dbaui
::sfx2::FileDialogHelper aFileDlg(
ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,
FileDialogFlags::NONE, GetFrameWeld());
- aFileDlg.AddFilter(sFilterName,"*.mdb;*.mde");
+ aFileDlg.AddFilter(sFilterName,"*.accdb;*.accde;*.mdb;*.mde");
aFileDlg.SetCurrentFilter(sFilterName);
askForFileName(aFileDlg);
}
break;
- case ::dbaccess::DST_MSACCESS_2007:
- {
- OUString sFilterName2(DBA_RES (STR_MSACCESS_2007_FILTERNAME));
- ::sfx2::FileDialogHelper aFileDlg(
- ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,
- FileDialogFlags::NONE, GetFrameWeld());
- aFileDlg.AddFilter(sFilterName2,"*.accdb;*.accde");
- aFileDlg.SetCurrentFilter(sFilterName2);
- askForFileName(aFileDlg);
- }
- break;
case ::dbaccess::DST_MYSQL_ODBC:
case ::dbaccess::DST_ODBC:
{
@@ -570,7 +555,7 @@ namespace dbaui
commitURL();
}
- bool OConnectionHelper::createDirectoryDeep(const OUString& _rPathURL)
+ bool OConnectionHelper::createDirectoryDeep(std::u16string_view _rPathURL)
{
// get a URL object analyzing the URL for us ...
INetURLObject aParser;
@@ -614,16 +599,14 @@ namespace dbaui
// the properties which need to be set on the new content
Sequence< OUString > aNewDirectoryProperties { "Title" };
- // the values to be set
- Sequence< Any > aNewDirectoryAttributes(1);
-
// loop
for ( std::vector< OUString >::const_reverse_iterator aLocalName = aToBeCreated.rbegin();
aLocalName != aToBeCreated.rend();
++aLocalName
)
{
- aNewDirectoryAttributes[0] <<= *aLocalName;
+ // the values to be set
+ Sequence< Any > aNewDirectoryAttributes{ Any(* aLocalName) };
if (!aParent.insertNewContent(sContentType, aNewDirectoryProperties, aNewDirectoryAttributes, aParent))
return false;
}
@@ -665,7 +648,7 @@ namespace dbaui
const ::dbaccess::DATASOURCE_TYPE eType = m_pCollection->determineType(m_eType);
- if ( ( ::dbaccess::DST_CALC == eType) || ( ::dbaccess::DST_WRITER == eType) || ( ::dbaccess::DST_MSACCESS == eType) || ( ::dbaccess::DST_MSACCESS_2007 == eType) )
+ if ( ( ::dbaccess::DST_CALC == eType) || ( ::dbaccess::DST_WRITER == eType) || ( ::dbaccess::DST_MSACCESS == eType) )
{
if( pathExists(sURL, true) == PATH_NOT_EXIST )
{
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.hxx b/dbaccess/source/ui/dlg/ConnectionHelper.hxx
index 5b765dfa50b1..bbcf24783355 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.hxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.hxx
@@ -38,7 +38,7 @@ namespace dbaui
bool m_bUserGrabFocus;
public:
- OConnectionHelper(weld::Container* pPage, weld::DialogController* pController, const OUString& _rUIXMLDescription, const OString& _rId, const SfxItemSet& _rCoreAttrs);
+ OConnectionHelper(weld::Container* pPage, weld::DialogController* pController, const OUString& _rUIXMLDescription, const OUString& _rId, const SfxItemSet& _rCoreAttrs);
virtual ~OConnectionHelper() override;
OUString m_eType; // the type can't be changed in this class, so we hold it as member.
@@ -74,7 +74,7 @@ namespace dbaui
sal_Int32 checkPathExistence(const OUString& _rURL);
IS_PATH_EXIST pathExists(const OUString& _rURL, bool bIsFile) const;
- bool createDirectoryDeep(const OUString& _rPathNormalized);
+ bool createDirectoryDeep(std::u16string_view _rPathNormalized);
bool commitURL();
/** opens the FileOpen dialog and asks for a FileName
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx
index 5082abf9ed98..557045800658 100644
--- a/dbaccess/source/ui/dlg/ConnectionPage.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx
@@ -35,18 +35,12 @@
#include <svl/filenotation.hxx>
#include <com/sun/star/ucb/XProgressHandler.hpp>
#include <connectivity/CommonTools.hxx>
+#include <o3tl/string_view.hxx>
namespace dbaui
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::ucb;
- using namespace ::com::sun::star::ui::dialogs;
using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::container;
- using namespace ::dbtools;
- using namespace ::svt;
std::unique_ptr<SfxTabPage> OConnectionTabPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* _rAttrSet)
{
@@ -111,7 +105,6 @@ namespace dbaui
m_xFT_Connection->set_label(DBA_RES(STR_COMMONURL));
break;
case ::dbaccess::DST_MSACCESS:
- case ::dbaccess::DST_MSACCESS_2007:
m_xFT_Connection->set_label(DBA_RES(STR_MSACCESS_MDB_FILE));
m_xConnectionURL->set_help_id(HID_DSADMIN_MSACCESS_MDB_FILE);
break;
@@ -203,7 +196,7 @@ namespace dbaui
m_xJavaDriverLabel->set_visible(bEnableJDBC);
m_xJavaDriver->set_visible(bEnableJDBC);
m_xTestJavaDriver->set_visible(bEnableJDBC);
- m_xTestJavaDriver->set_sensitive( !m_xJavaDriver->get_text().trim().isEmpty() );
+ m_xTestJavaDriver->set_sensitive( !o3tl::trim(m_xJavaDriver->get_text()).empty() );
m_xFL3->set_visible(bEnableJDBC);
checkTestConnection();
@@ -243,11 +236,11 @@ namespace dbaui
#if HAVE_FEATURE_JAVA
try
{
- if ( !m_xJavaDriver->get_text().trim().isEmpty() )
+ if ( !o3tl::trim(m_xJavaDriver->get_text()).empty() )
{
::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
m_xJavaDriver->set_text(m_xJavaDriver->get_text().trim()); // fdo#68341
- bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_xJavaDriver->get_text().trim());
+ bSuccess = ::connectivity::existsJavaClassByName(xJVM, o3tl::trim(m_xJavaDriver->get_text()));
}
}
catch(Exception&)
@@ -255,7 +248,7 @@ namespace dbaui
}
#endif
- const char* pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
+ TranslateId pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
const MessageType mt = bSuccess ? MessageType::Info : MessageType::Error;
OSQLMessageBox aMsg(GetFrameWeld(), DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt);
aMsg.run();
@@ -265,14 +258,14 @@ namespace dbaui
OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF");
bool bEnableTestConnection = !m_xConnectionURL->get_visible() || !m_xConnectionURL->GetTextNoPrefix().isEmpty();
if ( m_pCollection->determineType(m_eType) == ::dbaccess::DST_JDBC )
- bEnableTestConnection = bEnableTestConnection && (!m_xJavaDriver->get_text().trim().isEmpty());
+ bEnableTestConnection = bEnableTestConnection && (!o3tl::trim(m_xJavaDriver->get_text()).empty());
m_xTestConnection->set_sensitive(bEnableTestConnection);
return true;
}
IMPL_LINK(OConnectionTabPage, OnEditModified, weld::Entry&, rEdit, void)
{
if (&rEdit == m_xJavaDriver.get())
- m_xTestJavaDriver->set_sensitive( !m_xJavaDriver->get_text().trim().isEmpty() );
+ m_xTestJavaDriver->set_sensitive( !o3tl::trim(m_xJavaDriver->get_text()).empty() );
checkTestConnection();
// tell the listener we were modified
diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
index bee1b1f11493..0282e46a1d7f 100644
--- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
@@ -28,14 +28,6 @@
namespace dbaui
{
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::ucb;
- using namespace ::com::sun::star::ui::dialogs;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::container;
- using namespace ::svt;
-
std::unique_ptr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateDbaseTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet)
{
return std::make_unique<OConnectionTabPageSetup>( pPage, pController, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, STR_DBASE_HELPTEXT, STR_DBASE_HEADERTEXT, STR_DBASE_PATH_OR_FILE );
@@ -58,16 +50,16 @@ namespace dbaui
std::unique_ptr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateUserDefinedTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet)
{
- return std::make_unique<OConnectionTabPageSetup>(pPage, pController, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, nullptr, nullptr, STR_COMMONURL);
+ return std::make_unique<OConnectionTabPageSetup>(pPage, pController, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, TranslateId(), TranslateId(), STR_COMMONURL);
}
- OConnectionTabPageSetup::OConnectionTabPageSetup(weld::Container* pPage, weld::DialogController* pController, const OUString& _rUIXMLDescription, const OString& _rId, const SfxItemSet& _rCoreAttrs, const char* pHelpTextResId, const char* pHeaderResId, const char* pUrlResId)
+ OConnectionTabPageSetup::OConnectionTabPageSetup(weld::Container* pPage, weld::DialogController* pController, const OUString& _rUIXMLDescription, const OUString& _rId, const SfxItemSet& _rCoreAttrs, TranslateId pHelpTextResId, TranslateId pHeaderResId, TranslateId pUrlResId)
: OConnectionHelper(pPage, pController, _rUIXMLDescription, _rId, _rCoreAttrs)
, m_xHelpText(m_xBuilder->weld_label("helptext"))
, m_xHeaderText(m_xBuilder->weld_label("header"))
{
- if (pHelpTextResId != nullptr)
+ if (pHelpTextResId)
{
OUString sHelpText = DBA_RES(pHelpTextResId);
m_xHelpText->set_label(sHelpText);
@@ -75,10 +67,10 @@ namespace dbaui
else
m_xHelpText->hide();
- if (pHeaderResId != nullptr)
+ if (pHeaderResId)
m_xHeaderText->set_label(DBA_RES(pHeaderResId));
- if (pUrlResId != nullptr)
+ if (pUrlResId)
{
OUString sLabelText = DBA_RES(pUrlResId);
m_xFT_Connection->set_label(sLabelText);
diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx
index b04fb194d36d..27b8eab284ae 100644
--- a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx
+++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx
@@ -18,9 +18,10 @@
*/
#pragma once
-#include "ConnectionHelper.hxx"
+#include "ConnectionHelper.hxx"
#include "adminpages.hxx"
+#include <unotools/resmgr.hxx>
namespace dbaui
{
@@ -38,7 +39,7 @@ namespace dbaui
DECL_LINK(OnEditModified, weld::Entry&, void);
public:
- OConnectionTabPageSetup(weld::Container* pPage, weld::DialogController* pController, const OUString& _rUIXMLDescription, const OString& _rId, const SfxItemSet& _rCoreAttrs, const char* pHelpTextResId, const char* pHeaderResId, const char* pUrlResId);
+ OConnectionTabPageSetup(weld::Container* pPage, weld::DialogController* pController, const OUString& _rUIXMLDescription, const OUString& _rId, const SfxItemSet& _rCoreAttrs, TranslateId pHelpTextResId, TranslateId pHeaderResId, TranslateId pUrlResId);
virtual ~OConnectionTabPageSetup() override;
static std::unique_ptr<OGenericAdministrationPage> CreateDbaseTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet);
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index a15c011f3734..ad81680ba421 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -39,6 +39,9 @@
#include "TextConnectionHelper.hxx"
#include <osl/diagnose.h>
+#include <IItemSetHelper.hxx>
+#include <comphelper/string.hxx>
+
namespace dbaui
{
using namespace ::com::sun::star;
@@ -153,7 +156,7 @@ using namespace ::com::sun::star;
OSL_ENSURE(pCollection, "OLDAPConnectionPageSetup::FillItemSet : really need a DSN type collection !");
if (pCollection)
{
- OUString sUrl = pCollection->getPrefix( "sdbc:address:ldap:") + m_xETHostServer->get_text();
+ OUString sUrl = pCollection->getPrefix( u"sdbc:address:ldap:") + m_xETHostServer->get_text();
_rSet->Put(SfxStringItem(DSID_CONNECTURL, sUrl));
bChangedSomething = true;
}
@@ -236,9 +239,13 @@ using namespace ::com::sun::star;
if ( bHasMySQLNative )
m_xNATIVEDatabase->show();
- // if any of the options is checked, then there's nothing to do
+ // tdf#103068: if any of the options is checked, then just update the selected kind:
+ // it could happen that the selection and the wizard path are not in sync
if ( m_xODBCDatabase->get_active() || m_xJDBCDatabase->get_active() || m_xNATIVEDatabase->get_active() )
+ {
+ maClickHdl.Call(this);
return;
+ }
// prefer "native" or "JDBC"
if ( bHasMySQLNative )
@@ -324,7 +331,7 @@ using namespace ::com::sun::star;
}
// OMySQLJDBCConnectionPageSetup
- OGeneralSpecialJDBCConnectionPageSetup::OGeneralSpecialJDBCConnectionPageSetup( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rCoreAttrs ,sal_uInt16 _nPortId, const char* pDefaultPortResId, const char* pHelpTextResId, const char* pHeaderTextResId, const char* pDriverClassId)
+ OGeneralSpecialJDBCConnectionPageSetup::OGeneralSpecialJDBCConnectionPageSetup( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rCoreAttrs ,sal_uInt16 _nPortId, TranslateId pDefaultPortResId, TranslateId pHelpTextResId, TranslateId pHeaderTextResId, TranslateId pDriverClassId)
: OGenericAdministrationPage(pPage, pController, "dbaccess/ui/specialjdbcconnectionpage.ui", "SpecialJDBCConnectionPage", _rCoreAttrs)
, m_nPortId(_nPortId)
, m_xHeaderText(m_xBuilder->weld_label("header"))
@@ -448,7 +455,7 @@ using namespace ::com::sun::star;
OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue);
// to get the correct value when saveValue was called by base class
- if ( m_xETDriverClass->get_text().trim().isEmpty() )
+ if ( o3tl::trim(m_xETDriverClass->get_text()).empty() )
{
m_xETDriverClass->set_text(m_sDefaultJdbcDriverName);
m_xETDriverClass->save_value();
@@ -467,7 +474,7 @@ using namespace ::com::sun::star;
#if HAVE_FEATURE_JAVA
try
{
- if ( !m_xETDriverClass->get_text().trim().isEmpty() )
+ if ( !o3tl::trim(m_xETDriverClass->get_text()).empty() )
{
// TODO change jvmaccess
::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
@@ -479,7 +486,7 @@ using namespace ::com::sun::star;
{
}
#endif
- const char *pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
+ TranslateId pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
const MessageType mt = bSuccess ? MessageType::Info : MessageType::Error;
OSQLMessageBox aMsg(GetFrameWeld(), DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt);
aMsg.run();
@@ -488,8 +495,8 @@ using namespace ::com::sun::star;
void OGeneralSpecialJDBCConnectionPageSetup::callModifiedHdl(weld::Widget* pControl)
{
if (pControl == m_xETDriverClass.get())
- m_xPBTestJavaDriver->set_sensitive( !m_xETDriverClass->get_text().trim().isEmpty() );
- bool bRoadmapState = ((!m_xETDatabasename->get_text().isEmpty() ) && ( !m_xETHostname->get_text().isEmpty() ) && (!m_xNFPortNumber->get_text().isEmpty() ) && ( !m_xETDriverClass->get_text().trim().isEmpty() ));
+ m_xPBTestJavaDriver->set_sensitive( !o3tl::trim(m_xETDriverClass->get_text()).empty() );
+ bool bRoadmapState = ((!m_xETDatabasename->get_text().isEmpty() ) && ( !m_xETHostname->get_text().isEmpty() ) && (!m_xNFPortNumber->get_text().isEmpty() ) && ( !o3tl::trim(m_xETDriverClass->get_text()).empty() ));
SetRoadmapStateValue(bRoadmapState);
OGenericAdministrationPage::callModifiedHdl();
}
@@ -499,6 +506,129 @@ using namespace ::com::sun::star;
return std::make_unique<OJDBCConnectionPageSetup>(pPage, pController, _rAttrSet);
}
+ // OPostgresConnectionPageSetup
+ OPostgresConnectionPageSetup::OPostgresConnectionPageSetup( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rCoreAttrs , sal_uInt16 _nPortId )
+ : OGenericAdministrationPage(pPage, pController, "dbaccess/ui/postgrespage.ui", "SpecialPostgresPage", _rCoreAttrs)
+ , m_nPortId(_nPortId)
+ , m_xETDatabasename(m_xBuilder->weld_entry("dbNameEntry"))
+ , m_xETHostname(m_xBuilder->weld_entry("hostNameEntry"))
+ , m_xNFPortNumber(m_xBuilder->weld_spin_button("portNumEntry"))
+ , m_xConnectionURL(new OConnectionURLEdit(m_xBuilder->weld_entry("browseurl"), m_xBuilder->weld_label("browselabel")))
+ {
+ m_xETDatabasename->connect_changed(LINK(this, OGenericAdministrationPage, OnControlEntryModifyHdl));
+ m_xETHostname->connect_changed(LINK(this, OGenericAdministrationPage, OnControlEntryModifyHdl));
+ m_xNFPortNumber->connect_value_changed(LINK(this, OGenericAdministrationPage, OnControlSpinButtonModifyHdl));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>( _rCoreAttrs.GetItem(DSID_TYPECOLLECTION) );
+ if (pCollectionItem)
+ m_pCollection = pCollectionItem->getCollection();
+ OSL_ENSURE(m_pCollection, "OConnectionHelper::OConnectionHelper : really need a DSN type collection !");
+ m_xConnectionURL->SetTypeCollection(m_pCollection);
+
+ SetRoadmapStateValue(false);
+ }
+
+ OPostgresConnectionPageSetup::~OPostgresConnectionPageSetup()
+ {
+ }
+
+ std::unique_ptr<OGenericAdministrationPage> OPostgresConnectionPageSetup::CreatePostgresTabPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet )
+ {
+ return std::make_unique<OPostgresConnectionPageSetup>(pPage, pController,
+ _rAttrSet,
+ DSID_POSTGRES_PORTNUMBER);
+ }
+
+ void OPostgresConnectionPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
+ {
+ _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Entry>(m_xETDatabasename.get()));
+ _rControlList.emplace_back( new OSaveValueWidgetWrapper<OConnectionURLEdit>( m_xConnectionURL.get() ) );
+ _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Entry>(m_xETHostname.get()));
+ _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::SpinButton>(m_xNFPortNumber.get()));
+ }
+
+ bool OPostgresConnectionPageSetup::FillItemSet( SfxItemSet* _rSet )
+ {
+ bool bChangedSomething = false;
+ fillString(*_rSet,m_xConnectionURL.get(), DSID_CONNECTURL, bChangedSomething);
+ fillString(*_rSet,m_xETHostname.get(),DSID_CONN_HOSTNAME,bChangedSomething);
+ fillString(*_rSet,m_xETDatabasename.get(),DSID_DATABASENAME,bChangedSomething);
+ fillInt32(*_rSet,m_xNFPortNumber.get(),m_nPortId,bChangedSomething );
+ return bChangedSomething;
+ }
+
+ void OPostgresConnectionPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& /*_rControlList*/)
+ {
+ }
+
+ void OPostgresConnectionPageSetup::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
+ {
+ // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
+ SetRoadmapStateValue(true);
+ bool bValid, bReadonly;
+ getFlags(_rSet, bValid, bReadonly);
+
+ m_xConnectionURL->show();
+ m_xConnectionURL->ShowPrefix( false);
+
+ const SfxStringItem* pDatabaseName = _rSet.GetItem<SfxStringItem>(DSID_DATABASENAME);
+ const SfxStringItem* pUrlItem = _rSet.GetItem<SfxStringItem>(DSID_CONNECTURL);
+ const SfxStringItem* pHostName = _rSet.GetItem<SfxStringItem>(DSID_CONN_HOSTNAME);
+ const SfxInt32Item* pPortNumber = _rSet.GetItem<SfxInt32Item>(m_nPortId);
+
+ if ( bValid )
+ {
+ m_xETDatabasename->set_text(pDatabaseName->GetValue());
+ m_xETDatabasename->save_value();
+
+ OUString sUrl = pUrlItem->GetValue();
+ setURL( sUrl );
+ m_xConnectionURL->save_value();
+
+ m_xETHostname->set_text(pHostName->GetValue());
+ m_xETHostname->save_value();
+
+ m_xNFPortNumber->set_value(pPortNumber->GetValue());
+ m_xNFPortNumber->save_value();
+ }
+
+ OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue);
+
+ callModifiedHdl();
+ }
+
+ bool OPostgresConnectionPageSetup::commitPage( ::vcl::WizardTypes::CommitPageReason /*_eReason*/ )
+ {
+ return commitURL();
+ }
+
+ bool OPostgresConnectionPageSetup::commitURL()
+ {
+ OUString sURL = m_xConnectionURL->GetTextNoPrefix();
+ setURLNoPrefix(sURL);
+ m_xConnectionURL->SaveValueNoPrefix();
+ return true;
+ }
+
+ void OPostgresConnectionPageSetup::impl_setURL( std::u16string_view _rURL, bool _bPrefix )
+ {
+ OUString sURL( comphelper::string::stripEnd(_rURL, '*') );
+ OSL_ENSURE( m_pCollection, "OConnectionHelper::impl_setURL: have no interpreter for the URLs!" );
+ if ( _bPrefix )
+ m_xConnectionURL->SetText( sURL );
+ else
+ m_xConnectionURL->SetTextNoPrefix( sURL );
+ }
+
+ void OPostgresConnectionPageSetup::setURLNoPrefix( std::u16string_view _rURL )
+ {
+ impl_setURL( _rURL,false);
+ }
+
+ void OPostgresConnectionPageSetup::setURL( std::u16string_view _rURL )
+ {
+ impl_setURL( _rURL, true);
+ }
+
// OMySQLJDBCConnectionPageSetup
OJDBCConnectionPageSetup::OJDBCConnectionPageSetup(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs)
: OConnectionTabPageSetup(pPage, pController, "dbaccess/ui/jdbcconnectionpage.ui", "JDBCConnectionPage", rCoreAttrs,
@@ -591,7 +721,7 @@ using namespace ::com::sun::star;
{
}
#endif
- const char* pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
+ TranslateId pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
const MessageType mt = bSuccess ? MessageType::Info : MessageType::Error;
OSQLMessageBox aMsg(GetFrameWeld(), DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt);
aMsg.run();
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
index 64fa848c855f..909cfede5806 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
@@ -25,6 +25,8 @@
#include "admincontrols.hxx"
#include "TextConnectionHelper.hxx"
+#include <curledit.hxx>
+
namespace dbaui
{
class ODbTypeWizDialogSetup;
@@ -123,10 +125,10 @@ namespace dbaui
OGeneralSpecialJDBCConnectionPageSetup(weld::Container* pPage, weld::DialogController* pController
, const SfxItemSet& _rCoreAttrs
, sal_uInt16 _nPortId
- , const char* pDefaultPortResId
- , const char* pHelpTextResId
- , const char* pHeaderTextResId
- , const char* pDriverClassId );
+ , TranslateId pDefaultPortResId
+ , TranslateId pHelpTextResId
+ , TranslateId pHeaderTextResId
+ , TranslateId pDriverClassId );
virtual ~OGeneralSpecialJDBCConnectionPageSetup() override;
static std::unique_ptr<OGenericAdministrationPage> CreateMySQLJDBCTabPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet );
static std::unique_ptr<OGenericAdministrationPage> CreateOracleJDBCTabPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet );
@@ -141,7 +143,7 @@ namespace dbaui
DECL_LINK(OnTestJavaClickHdl, weld::Button&, void);
OUString m_sDefaultJdbcDriverName;
- sal_uInt16 m_nPortId;
+ TypedWhichId<SfxInt32Item> m_nPortId;
std::unique_ptr<weld::Label> m_xHeaderText;
std::unique_ptr<weld::Label> m_xFTHelpText;
@@ -214,6 +216,42 @@ namespace dbaui
DECL_LINK(OnSetupModeSelected, weld::Toggleable&, void);
};
+ // OPostgresPageSetup
+ class OPostgresConnectionPageSetup final : public OGenericAdministrationPage
+ {
+ public:
+ OPostgresConnectionPageSetup(weld::Container* pPage, weld::DialogController* pController
+ , const SfxItemSet& _rCoreAttrs
+ , sal_uInt16 _nPortId );
+ virtual ~OPostgresConnectionPageSetup() override;
+ static std::unique_ptr<OGenericAdministrationPage> CreatePostgresTabPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet );
+ ::dbaccess::ODsnTypeCollection* m_pCollection;
+
+ private:
+ virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) override;
+ virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
+ virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
+ virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
+ virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;
+
+ TypedWhichId<SfxInt32Item> m_nPortId;
+
+ std::unique_ptr<weld::Entry> m_xETDatabasename;
+ std::unique_ptr<weld::Entry> m_xETHostname;
+ std::unique_ptr<weld::SpinButton> m_xNFPortNumber;
+ std::unique_ptr<OConnectionURLEdit> m_xConnectionURL;
+
+ /** used for the connection URL
+ @param _rURL
+ The URL to check.
+ */
+ void impl_setURL( std::u16string_view _rURL, bool _bPrefix );
+ void setURLNoPrefix( std::u16string_view _rURL );
+ void setURL( std::u16string_view _rURL );
+ bool commitURL();
+ };
+
+
// OAuthentificationPageSetup
class OAuthentificationPageSetup final : public OGenericAdministrationPage
{
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index 215a8c8f53c4..3fa122bf6c69 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -43,7 +43,6 @@
#include <com/sun/star/sdbc/ConnectionPool.hpp>
#include <com/sun/star/sdbc/XDriver.hpp>
#include <com/sun/star/task/InteractionHandler.hpp>
-#include <com/sun/star/task/XInteractionRequest.hpp>
#include <com/sun/star/ucb/AuthenticationRequest.hpp>
#include <comphelper/interaction.hxx>
@@ -51,7 +50,7 @@
#include <connectivity/DriversConfig.hxx>
#include <connectivity/dbexception.hxx>
#include <osl/file.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <sal/log.hxx>
#include <typelib/typedescription.hxx>
@@ -63,6 +62,7 @@
#include <iterator>
#include <functional>
#include <o3tl/functional.hxx>
+#include <comphelper/string.hxx>
namespace dbaui
{
@@ -73,7 +73,6 @@ using namespace com::sun::star::ucb;
using namespace com::sun::star::task;
using namespace com::sun::star::sdbc;
using namespace com::sun::star::sdb;
-using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::util;
using namespace com::sun::star::container;
@@ -89,7 +88,7 @@ namespace
OSL_ENSURE( pPool, "implCheckItemType: invalid item pool!" );
if ( pPool )
{
- const SfxPoolItem& rDefItem = pPool->GetDefaultItem( _nId );
+ const SfxPoolItem& rDefItem = pPool->GetUserOrPoolDefaultItem( _nId );
bCorrectType = isItemType(&rDefItem);
}
return bCorrectType;
@@ -211,7 +210,7 @@ bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< PropertyVal
const SfxStringItem* pUser = m_pItemSetHelper->getOutputSet()->GetItem<SfxStringItem>(DSID_USER);
if (pUser && pUser->GetValue().getLength())
aReturn.emplace_back( "user", 0,
- makeAny(pUser->GetValue()), PropertyState_DIRECT_VALUE);
+ Any(pUser->GetValue()), PropertyState_DIRECT_VALUE);
// check if the connection type requires a password
if (hasAuthentication(*m_pItemSetHelper->getOutputSet()))
@@ -261,7 +260,7 @@ bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< PropertyVal
aRequest.HasAccount = false;
// aRequest.Account
- rtl::Reference<comphelper::OInteractionRequest> pRequest = new comphelper::OInteractionRequest(makeAny(aRequest));
+ rtl::Reference<comphelper::OInteractionRequest> pRequest = new comphelper::OInteractionRequest(Any(aRequest));
// build an interaction request
// two continuations (Ok and Cancel)
@@ -295,7 +294,7 @@ bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< PropertyVal
if (!sPassword.isEmpty())
aReturn.emplace_back( "password", 0,
- makeAny(sPassword), PropertyState_DIRECT_VALUE);
+ Any(sPassword), PropertyState_DIRECT_VALUE);
}
if ( !aReturn.empty() )
@@ -321,7 +320,7 @@ void ODbDataSourceAdministrationHelper::successfullyConnected()
OUString sPassword = pPassword->GetValue();
Reference< XPropertySet > xCurrentDatasource = getCurrentDataSource();
- lcl_putProperty(xCurrentDatasource,m_aDirectPropTranslator[DSID_PASSWORD], makeAny(sPassword));
+ lcl_putProperty(xCurrentDatasource,m_aDirectPropTranslator[DSID_PASSWORD], Any(sPassword));
}
}
}
@@ -466,7 +465,6 @@ OUString ODbDataSourceAdministrationHelper::getConnectionURL() const
case ::dbaccess::DST_WRITER:
break;
case ::dbaccess::DST_MSACCESS:
- case ::dbaccess::DST_MSACCESS_2007:
{
OUString sFileName = pCollection->cutPrefix(pUrlItem->GetValue());
OUString sNewFileName;
@@ -524,6 +522,39 @@ OUString ODbDataSourceAdministrationHelper::getConnectionURL() const
sNewUrl = pCollection->cutPrefix(pUrlItem->GetValue()) + lcl_createHostWithPort(nullptr,pPortNumber);
}
break;
+ case ::dbaccess::DST_POSTGRES:
+ {
+ sNewUrl = pCollection->cutPrefix(pUrlItem->GetValue());
+ OUString rURL(comphelper::string::stripEnd(pUrlItem->GetValue(), '*'));
+ const SfxStringItem* pHostName = m_pItemSetHelper->getOutputSet()->GetItem<SfxStringItem>(DSID_CONN_HOSTNAME);
+ const SfxInt32Item* pPortNumber = m_pItemSetHelper->getOutputSet()->GetItem<SfxInt32Item>(DSID_POSTGRES_PORTNUMBER);
+ const SfxStringItem* pDatabaseName = m_pItemSetHelper->getOutputSet()->GetItem<SfxStringItem>(DSID_DATABASENAME);
+ if (pHostName && pHostName->GetValue().getLength())
+ {
+ OUString hostname( pHostName->GetValue() );
+ hostname = hostname.replaceAll( "\\", "\\\\");
+ hostname = hostname.replaceAll( "\'", "\\'");
+ hostname = "'" + hostname + "'";
+ rURL += " host=" + hostname;
+ }
+ // tdf#157260: if port is already in the URL, don't add another one
+ if (pPortNumber && pPortNumber->GetValue() && (rURL.indexOf("port=") == -1))
+ {
+ OUString port = "'" + OUString::number(pPortNumber->GetValue()) + "'";
+ rURL += " port=" + port;
+ }
+ if (pDatabaseName && pDatabaseName->GetValue().getLength())
+ {
+ OUString dbname( pDatabaseName->GetValue() );
+ dbname = dbname.replaceAll( "\\", "\\\\");
+ dbname = dbname.replaceAll( "\'", "\\'");
+ dbname = "'" + dbname + "'";
+ rURL += " dbname=" + dbname;
+ }
+ sNewUrl = rURL;
+ return sNewUrl;
+ }
+ break;
case ::dbaccess::DST_JDBC:
// run through
default:
@@ -531,7 +562,7 @@ OUString ODbDataSourceAdministrationHelper::getConnectionURL() const
}
if ( !sNewUrl.isEmpty() )
sNewUrl = pCollection->getPrefix(eType) + sNewUrl;
- else
+ else if (pUrlItem)
sNewUrl = pUrlItem->GetValue();
return sNewUrl;
@@ -580,7 +611,7 @@ void ODbDataSourceAdministrationHelper::translateProperties(const Reference< XPr
// collect the names of the additional settings
PropertyValueSet aInfos;
- for (const PropertyValue& rAdditionalInfo : std::as_const(aAdditionalInfo))
+ for (const PropertyValue& rAdditionalInfo : aAdditionalInfo)
{
if( rAdditionalInfo.Name == "JDBCDRV" )
{ // compatibility
@@ -632,7 +663,7 @@ void ODbDataSourceAdministrationHelper::translateProperties(const SfxItemSet& _r
try { xInfo = _rxDest->getPropertySetInfo(); }
catch(Exception&) { }
- static const OUStringLiteral sUrlProp(u"URL");
+ static constexpr OUStringLiteral sUrlProp(u"URL");
// transfer the direct properties
for (auto const& elem : m_aDirectPropTranslator)
{
@@ -649,7 +680,7 @@ void ODbDataSourceAdministrationHelper::translateProperties(const SfxItemSet& _r
{
if ( sUrlProp == elem.second )
{
- Any aValue(makeAny(getConnectionURL()));
+ Any aValue(getConnectionURL());
// aValue <<= OUString();
lcl_putProperty(_rxDest, elem.second,aValue);
}
@@ -672,7 +703,7 @@ void ODbDataSourceAdministrationHelper::translateProperties(const SfxItemSet& _r
// overwrite and extend them
fillDatasourceInfo(_rSource, aInfo);
// and propagate the (newly composed) sequence to the set
- lcl_putProperty(_rxDest,PROPERTY_INFO, makeAny(aInfo));
+ lcl_putProperty(_rxDest,PROPERTY_INFO, Any(aInfo));
}
void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rSource, Sequence< css::beans::PropertyValue >& _rInfo)
@@ -701,7 +732,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS
OUString sCharSet;
implTranslateProperty(pCurrent) >>= sCharSet;
if ( !sCharSet.isEmpty() )
- aRelevantSettings.insert(PropertyValue(aTranslation->second, 0, makeAny(sCharSet), PropertyState_DIRECT_VALUE));
+ aRelevantSettings.insert(PropertyValue(aTranslation->second, 0, Any(sCharSet), PropertyState_DIRECT_VALUE));
}
else
aRelevantSettings.insert(PropertyValue(aTranslation->second, 0, implTranslateProperty(pCurrent), PropertyState_DIRECT_VALUE));
@@ -771,7 +802,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS
// here we have a special entry for types from oracle
if ( aTypeSettings.hasElements() )
{
- aRelevantSettings.insert(PropertyValue("TypeInfoSettings", 0, makeAny(aTypeSettings), PropertyState_DIRECT_VALUE));
+ aRelevantSettings.insert(PropertyValue("TypeInfoSettings", 0, Any(aTypeSettings), PropertyState_DIRECT_VALUE));
}
// check which values are still left ('cause they were not present in the original sequence, but are to be set)
@@ -861,8 +892,7 @@ OString ODbDataSourceAdministrationHelper::translatePropertyId( sal_Int32 _nId )
aString = indirectPos->second;
}
- OString aReturn( aString.getStr(), aString.getLength(), RTL_TEXTENCODING_ASCII_US );
- return aReturn;
+ return OUStringToOString( aString, RTL_TEXTENCODING_ASCII_US );
}
template<class T> static bool checkItemType(const SfxPoolItem* pItem){ return dynamic_cast<const T*>(pItem) != nullptr;}
@@ -915,7 +945,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet
{
sal_Int32 nValue = 0;
_rValue >>= nValue;
- _rSet.Put( SfxInt32Item( _nId, nValue ) );
+ _rSet.Put( SfxInt32Item( TypedWhichId<SfxInt32Item>(_nId), nValue ) );
}
else {
SAL_WARN( "dbaccess", "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid property value ("
@@ -982,7 +1012,7 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest)
::dbaccess::ODsnTypeCollection* pCollection = pTypeCollection->getCollection();
OSL_ENSURE(pCollection, "ODbAdminDialog::getDatasourceType: invalid type collection!");
- sal_uInt16 nPortNumberId = 0;
+ TypedWhichId<SfxInt32Item> nPortNumberId(0);
sal_Int32 nPortNumber = -1;
OUString sNewHostName;
OUString sUrlPart;
@@ -1002,6 +1032,9 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest)
case ::dbaccess::DST_LDAP:
nPortNumberId = DSID_CONN_LDAP_PORTNUMBER;
break;
+ case ::dbaccess::DST_POSTGRES:
+ nPortNumberId = DSID_POSTGRES_PORTNUMBER;
+ break;
default:
break;
}
@@ -1022,7 +1055,7 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest)
if ( !sNewHostName.isEmpty() )
_rDest.Put(SfxStringItem(DSID_CONN_HOSTNAME, sNewHostName));
- if ( nPortNumber != -1 && nPortNumberId != 0 )
+ if ( nPortNumber != -1 && nPortNumberId != TypedWhichId<SfxInt32Item>(0) )
_rDest.Put(SfxInt32Item(nPortNumberId, nPortNumber));
}
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.hxx b/dbaccess/source/ui/dlg/DbAdminImpl.hxx
index 22a61eceec80..dd4adcdc525b 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.hxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.hxx
@@ -40,8 +40,8 @@ namespace dbaui
{
void convert(const css::uno::Reference< css::uno::XComponentContext> & xContext,
const ::dbaccess::ODsnTypeCollection* _pCollection,
- const OUString& _sOldURLPrefix,
- const OUString& _sNewURLPrefix,
+ std::u16string_view _sOldURLPrefix,
+ std::u16string_view _sNewURLPrefix,
const css::uno::Reference< css::beans::XPropertySet >& _xDatasource);
};
class IItemSetHelper;
diff --git a/dbaccess/source/ui/dlg/DriverSettings.hxx b/dbaccess/source/ui/dlg/DriverSettings.hxx
index be488c3bd1e3..72ce3d459d3f 100644
--- a/dbaccess/source/ui/dlg/DriverSettings.hxx
+++ b/dbaccess/source/ui/dlg/DriverSettings.hxx
@@ -21,7 +21,6 @@
#include <sfx2/tabdlg.hxx>
class SfxTabPage;
-namespace vcl { class Window; }
namespace dbaui
{
/// a collection class for all details a driver needs
diff --git a/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx b/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx
index 41ed0e867c4b..df0d38e4ba87 100644
--- a/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx
+++ b/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx
@@ -11,9 +11,6 @@
#include <strings.hrc>
#include <core_resource.hxx>
-#define ALL_STRING DBA_RES(STR_QUERY_LIMIT_ALL)
-#define ALL_INT -1
-
namespace dbaui
{
@@ -27,7 +24,7 @@ QueryPropertiesDialog::QueryPropertiesDialog(
m_xRB_Distinct->set_active(bDistinct);
m_xRB_NonDistinct->set_active(!bDistinct);
- m_xLB_Limit->append(OUString::number(ALL_INT), ALL_STRING);
+ m_xLB_Limit->append(OUString::number(-1), DBA_RES(STR_QUERY_LIMIT_ALL)); // ALL_INT and ALL_STRING
/// Default values
sal_Int64 const aDefLimitAry[] =
{
diff --git a/dbaccess/source/ui/dlg/RelationDlg.cxx b/dbaccess/source/ui/dlg/RelationDlg.cxx
index cc449d9b7970..373f3c5242bd 100644
--- a/dbaccess/source/ui/dlg/RelationDlg.cxx
+++ b/dbaccess/source/ui/dlg/RelationDlg.cxx
@@ -22,7 +22,7 @@
#include <com/sun/star/sdbc/KeyRule.hpp>
#include <com/sun/star/sdbc/SQLException.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <JoinDesignView.hxx>
#include <JoinController.hxx>
#include <connectivity/dbexception.hxx>
@@ -33,8 +33,6 @@
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
using namespace ::dbaui;
using namespace ::dbtools;
diff --git a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx
index bcf039c5e16d..872824c6e14c 100644
--- a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx
+++ b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx
@@ -25,9 +25,7 @@ namespace dbaui
{
using namespace com::sun::star::uno;
using namespace com::sun::star::sdbc;
-using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
-using namespace com::sun::star::container;
// OTableSubscriptionDialog
OTableSubscriptionDialog::OTableSubscriptionDialog(weld::Window* pParent
diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
index 432f8b6cc150..3148aad27924 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
@@ -28,18 +28,25 @@
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <vcl/mnemonic.hxx>
+#include <o3tl/string_view.hxx>
namespace
{
-OUString lcl_getListEntry(const OUString& rStr, sal_Int32& rIdx)
+OUString lcl_getListEntry(std::u16string_view rStr, sal_Int32& rIdx)
{
- const OUString sTkn {rStr.getToken( 0, '\t', rIdx )};
+ const OUString sTkn {o3tl::getToken(rStr, 0, '\t', rIdx )};
if (rIdx>=0)
{
- rIdx = rStr.indexOf('\t', rIdx);
- if (rIdx>=0 && ++rIdx>=rStr.getLength())
+ size_t nFnd = rStr.find('\t', rIdx);
+ if (nFnd == std::u16string_view::npos)
rIdx = -1;
+ else
+ {
+ rIdx = nFnd + 1;
+ if (rIdx >= static_cast<sal_Int32>(rStr.size()))
+ rIdx = -1;
+ }
}
return sTkn;
}
@@ -93,24 +100,23 @@ namespace dbaui
{
short nFlag;
weld::Widget* pFrame;
- } aSections[] = {
+ } const aSections[] = {
{ TC_EXTENSION, m_xExtensionHeader.get() },
{ TC_SEPARATORS, m_xFormatHeader.get() },
{ TC_HEADER, m_xRowHeader.get() },
- { TC_CHARSET, m_xCharSetHeader.get() },
- { 0, nullptr }
+ { TC_CHARSET, m_xCharSetHeader.get() }
};
- for ( size_t section=0; section < SAL_N_ELEMENTS( aSections ) - 1; ++section )
+ for (auto const & section: aSections)
{
- if ( ( m_nAvailableSections & aSections[section].nFlag ) != 0 )
+ if ( ( m_nAvailableSections & section.nFlag ) != 0 )
{
// the section is visible, no need to do anything here
continue;
}
// hide all elements from this section
- aSections[section].pFrame->hide();
+ section.pFrame->hide();
}
m_xContainer->show();
@@ -350,22 +356,22 @@ namespace dbaui
return sExtension;
}
- OUString OTextConnectionHelper::GetSeparator(const weld::ComboBox& rBox, const OUString& rList)
+ OUString OTextConnectionHelper::GetSeparator(const weld::ComboBox& rBox, std::u16string_view rList)
{
sal_Unicode const nTok = '\t';
int nPos(rBox.find_text(rBox.get_active_text()));
if (nPos == -1)
- return rBox.get_active_text().copy(0);
+ return rBox.get_active_text();
if ( m_xTextSeparator.get() != &rBox || nPos != (rBox.get_count()-1) )
return OUString(
- static_cast< sal_Unicode >( rList.getToken((nPos*2)+1, nTok ).toInt32() ));
+ static_cast< sal_Unicode >( o3tl::toInt32(o3tl::getToken(rList, (nPos*2)+1, nTok )) ));
// somewhat strange ... translates for instance an "32" into " "
return OUString();
}
- void OTextConnectionHelper::SetSeparator( weld::ComboBox& rBox, const OUString& rList, const OUString& rVal )
+ void OTextConnectionHelper::SetSeparator( weld::ComboBox& rBox, std::u16string_view rList, const OUString& rVal )
{
if (rVal.getLength()==1)
{
@@ -373,9 +379,9 @@ namespace dbaui
for(sal_Int32 nIdx {0}; nIdx>=0;)
{
sal_Int32 nPrevIdx {nIdx};
- if (static_cast<sal_Unicode>(rList.getToken(1, '\t', nIdx).toInt32()) == nVal)
+ if (static_cast<sal_Unicode>(o3tl::toInt32(o3tl::getToken(rList, 1, '\t', nIdx))) == nVal)
{
- rBox.set_entry_text(rList.getToken(0, '\t', nPrevIdx));
+ rBox.set_entry_text(OUString(o3tl::getToken(rList,0, '\t', nPrevIdx)));
return;
}
}
diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx
index 41921f092f82..6755a422378e 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx
@@ -71,8 +71,8 @@ namespace dbaui
DECL_LINK(OnSetExtensionHdl, weld::Toggleable&, void);
DECL_LINK(OnEditModified, weld::Entry&, void);
- OUString GetSeparator(const weld::ComboBox& rBox, const OUString& rList);
- void SetSeparator(weld::ComboBox& rBox, const OUString& rList, const OUString& rVal);
+ OUString GetSeparator(const weld::ComboBox& rBox, std::u16string_view rList);
+ void SetSeparator(weld::ComboBox& rBox, std::u16string_view rList, const OUString& rVal);
void SetExtension(const OUString& _rVal);
public:
diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx
index 672830edd85b..40e33f41da78 100644
--- a/dbaccess/source/ui/dlg/UserAdmin.cxx
+++ b/dbaccess/source/ui/dlg/UserAdmin.cxx
@@ -45,10 +45,13 @@ using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::task;
using namespace dbaui;
-using namespace comphelper;
namespace {
+#define MNI_ACTION_ADD_USER "add"
+#define MNI_ACTION_DEL_USER "delete"
+#define MNI_ACTION_CHANGE_PASSWORD "password"
+
class OPasswordDialog : public weld::GenericDialogController
{
std::unique_ptr<weld::Frame> m_xUser;
@@ -111,20 +114,87 @@ IMPL_LINK(OPasswordDialog, ModifiedHdl, weld::Entry&, rEdit, void)
// OUserAdmin
OUserAdmin::OUserAdmin(weld::Container* pPage, weld::DialogController* pController,const SfxItemSet& _rAttrSet)
: OGenericAdministrationPage(pPage, pController, "dbaccess/ui/useradminpage.ui", "UserAdminPage", _rAttrSet)
+ , mxActionBar(m_xBuilder->weld_menu_button("action_menu"))
, m_xUSER(m_xBuilder->weld_combo_box("user"))
- , m_xNEWUSER(m_xBuilder->weld_button("add"))
- , m_xCHANGEPWD(m_xBuilder->weld_button("changepass"))
- , m_xDELETEUSER(m_xBuilder->weld_button("delete"))
, m_xTable(m_xBuilder->weld_container("table"))
, m_xTableCtrlParent(m_xTable->CreateChildFrame())
, m_xTableCtrl(VclPtr<OTableGrantControl>::Create(m_xTableCtrlParent))
{
+ mxActionBar->append_item(MNI_ACTION_ADD_USER, DBA_RES(STR_ADD_USER));
+ mxActionBar->append_item(MNI_ACTION_DEL_USER, DBA_RES(STR_DELETE_USER));
+ mxActionBar->append_item(MNI_ACTION_CHANGE_PASSWORD, DBA_RES(STR_CHANGE_PASSWORD));
+ mxActionBar->connect_selected(LINK(this,OUserAdmin,MenuSelectHdl));
+
m_xTableCtrl->Show();
m_xUSER->connect_changed(LINK(this, OUserAdmin, ListDblClickHdl));
- m_xNEWUSER->connect_clicked(LINK(this, OUserAdmin, UserHdl));
- m_xCHANGEPWD->connect_clicked(LINK(this, OUserAdmin, UserHdl));
- m_xDELETEUSER->connect_clicked(LINK(this, OUserAdmin, UserHdl));
+}
+
+IMPL_LINK(OUserAdmin, MenuSelectHdl, const OUString&, rIdent, void)
+{
+ try
+ {
+ if (rIdent == MNI_ACTION_ADD_USER) {
+ SfxPasswordDialog aPwdDlg(GetFrameWeld());
+ aPwdDlg.ShowExtras(SfxShowExtras::ALL);
+ if (aPwdDlg.run())
+ {
+ Reference<XDataDescriptorFactory> xUserFactory(m_xUsers,UNO_QUERY);
+ Reference<XPropertySet> xNewUser = xUserFactory->createDataDescriptor();
+ if(xNewUser.is())
+ {
+ xNewUser->setPropertyValue(PROPERTY_NAME,Any(aPwdDlg.GetUser()));
+ xNewUser->setPropertyValue(PROPERTY_PASSWORD,Any(aPwdDlg.GetPassword()));
+ Reference<XAppend> xAppend(m_xUsers,UNO_QUERY);
+ if(xAppend.is())
+ xAppend->appendByDescriptor(xNewUser);
+ }
+ }
+ }
+ else if (rIdent == MNI_ACTION_DEL_USER) {
+ if (m_xUsers.is() && m_xUsers->hasByName(GetUser()))
+ {
+ Reference<XDrop> xDrop(m_xUsers,UNO_QUERY);
+ if(xDrop.is())
+ {
+ std::unique_ptr<weld::MessageDialog> xQry(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Question, VclButtonsType::YesNo,
+ DBA_RES(STR_QUERY_USERADMIN_DELETE_USER)));
+ if (xQry->run() == RET_YES)
+ xDrop->dropByName(GetUser());
+ }
+ }
+ }
+ else if (rIdent == MNI_ACTION_CHANGE_PASSWORD) {
+ OUString sName = GetUser();
+ if(m_xUsers->hasByName(sName))
+ {
+ Reference<XUser> xUser;
+ m_xUsers->getByName(sName) >>= xUser;
+ if(xUser.is())
+ {
+ OPasswordDialog aDlg(GetFrameWeld(), sName);
+ if (aDlg.run() == RET_OK)
+ {
+ OUString sNewPassword,sOldPassword;
+ sNewPassword = aDlg.GetNewPassword();
+ sOldPassword = aDlg.GetOldPassword();
+
+ if(!sNewPassword.isEmpty())
+ xUser->changePassword(sOldPassword,sNewPassword);
+ }
+ }
+ }
+ }
+ FillUserNames();
+ }
+ catch(const SQLException& e)
+ {
+ ::dbtools::showError(::dbtools::SQLExceptionInfo(e), GetDialogController()->getDialog()->GetXWindow(), m_xORB);
+ }
+ catch(Exception& )
+ {
+ }
}
OUserAdmin::~OUserAdmin()
@@ -173,11 +243,11 @@ void OUserAdmin::FillUserNames()
}
Reference<XAppend> xAppend(m_xUsers,UNO_QUERY);
- m_xNEWUSER->set_sensitive(xAppend.is());
+ mxActionBar->set_item_sensitive(MNI_ACTION_ADD_USER, xAppend.is());
Reference<XDrop> xDrop(m_xUsers,UNO_QUERY);
- m_xDELETEUSER->set_sensitive(xDrop.is());
+ mxActionBar->set_item_sensitive(MNI_ACTION_DEL_USER, xDrop.is());
+ mxActionBar->set_item_sensitive(MNI_ACTION_CHANGE_PASSWORD, m_xUsers.is());
- m_xCHANGEPWD->set_sensitive(m_xUsers.is());
m_xTableCtrl->Enable(m_xUsers.is());
}
@@ -186,77 +256,6 @@ std::unique_ptr<SfxTabPage> OUserAdmin::Create( weld::Container* pPage, weld::Di
return std::make_unique<OUserAdmin>( pPage, pController, *_rAttrSet );
}
-IMPL_LINK(OUserAdmin, UserHdl, weld::Button&, rButton, void)
-{
- try
- {
- if (&rButton == m_xNEWUSER.get())
- {
- SfxPasswordDialog aPwdDlg(GetFrameWeld());
- aPwdDlg.ShowExtras(SfxShowExtras::ALL);
- if (aPwdDlg.run())
- {
- Reference<XDataDescriptorFactory> xUserFactory(m_xUsers,UNO_QUERY);
- Reference<XPropertySet> xNewUser = xUserFactory->createDataDescriptor();
- if(xNewUser.is())
- {
- xNewUser->setPropertyValue(PROPERTY_NAME,makeAny(aPwdDlg.GetUser()));
- xNewUser->setPropertyValue(PROPERTY_PASSWORD,makeAny(aPwdDlg.GetPassword()));
- Reference<XAppend> xAppend(m_xUsers,UNO_QUERY);
- if(xAppend.is())
- xAppend->appendByDescriptor(xNewUser);
- }
- }
- }
- else if (&rButton == m_xCHANGEPWD.get())
- {
- OUString sName = GetUser();
-
- if(m_xUsers->hasByName(sName))
- {
- Reference<XUser> xUser;
- m_xUsers->getByName(sName) >>= xUser;
- if(xUser.is())
- {
- OPasswordDialog aDlg(GetFrameWeld(), sName);
- if (aDlg.run() == RET_OK)
- {
- OUString sNewPassword,sOldPassword;
- sNewPassword = aDlg.GetNewPassword();
- sOldPassword = aDlg.GetOldPassword();
-
- if(!sNewPassword.isEmpty())
- xUser->changePassword(sOldPassword,sNewPassword);
- }
- }
- }
- }
- else
- {// delete user
- if(m_xUsers.is() && m_xUsers->hasByName(GetUser()))
- {
- Reference<XDrop> xDrop(m_xUsers,UNO_QUERY);
- if(xDrop.is())
- {
- std::unique_ptr<weld::MessageDialog> xQry(Application::CreateMessageDialog(GetFrameWeld(),
- VclMessageType::Question, VclButtonsType::YesNo,
- DBA_RES(STR_QUERY_USERADMIN_DELETE_USER)));
- if (xQry->run() == RET_YES)
- xDrop->dropByName(GetUser());
- }
- }
- }
- FillUserNames();
- }
- catch(const SQLException& e)
- {
- ::dbtools::showError(::dbtools::SQLExceptionInfo(e), GetDialogController()->getDialog()->GetXWindow(), m_xORB);
- }
- catch(Exception& )
- {
- }
-}
-
IMPL_LINK_NOARG(OUserAdmin, ListDblClickHdl, weld::ComboBox&, void)
{
m_xTableCtrl->setUserName(GetUser());
diff --git a/dbaccess/source/ui/dlg/UserAdmin.hxx b/dbaccess/source/ui/dlg/UserAdmin.hxx
index e9c2a13e7876..76460a8468e7 100644
--- a/dbaccess/source/ui/dlg/UserAdmin.hxx
+++ b/dbaccess/source/ui/dlg/UserAdmin.hxx
@@ -32,10 +32,8 @@ namespace dbaui
class OUserAdmin final : public OGenericAdministrationPage
{
+ std::unique_ptr<weld::MenuButton> mxActionBar;
std::unique_ptr<weld::ComboBox> m_xUSER;
- std::unique_ptr<weld::Button> m_xNEWUSER;
- std::unique_ptr<weld::Button> m_xCHANGEPWD;
- std::unique_ptr<weld::Button> m_xDELETEUSER;
std::unique_ptr<weld::Container> m_xTable;
css::uno::Reference<css::awt::XWindow> m_xTableCtrlParent;
VclPtr<OTableGrantControl> m_xTableCtrl; // show the grant rights of one user
@@ -48,7 +46,7 @@ class OUserAdmin final : public OGenericAdministrationPage
// methods
DECL_LINK(ListDblClickHdl, weld::ComboBox&, void);
- DECL_LINK(UserHdl, weld::Button&, void);
+ DECL_LINK(MenuSelectHdl, const OUString&, void);
void FillUserNames();
diff --git a/dbaccess/source/ui/dlg/UserAdminDlg.cxx b/dbaccess/source/ui/dlg/UserAdminDlg.cxx
index ec44c33994b9..3e554e1f3f57 100644
--- a/dbaccess/source/ui/dlg/UserAdminDlg.cxx
+++ b/dbaccess/source/ui/dlg/UserAdminDlg.cxx
@@ -31,15 +31,13 @@
#include <connectivity/dbtools.hxx>
#include <comphelper/types.hxx>
#include <cppuhelper/exc_hlp.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaui
{
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::sdbcx;
// OUserAdminDlg
OUserAdminDlg::OUserAdminDlg(weld::Window* pParent,
@@ -108,7 +106,7 @@ namespace dbaui
m_pImpl->saveChanges(*GetOutputItemSet());
return nRet;
}
- void OUserAdminDlg::PageCreated(const OString& rId, SfxTabPage& _rPage)
+ void OUserAdminDlg::PageCreated(const OUString& rId, SfxTabPage& _rPage)
{
// register ourself as modified listener
static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory( m_pImpl->getORB() );
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx
index 9806c3d7199a..c418728217b1 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -40,15 +40,12 @@ namespace dbaui
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::lang;
- using namespace ::dbtools;
ISaveValueWrapper::~ISaveValueWrapper()
{
}
- OGenericAdministrationPage::OGenericAdministrationPage(weld::Container* pPage, weld::DialogController* pController, const OUString& rUIXMLDescription, const OString& rId, const SfxItemSet& rAttrSet)
+ OGenericAdministrationPage::OGenericAdministrationPage(weld::Container* pPage, weld::DialogController* pController, const OUString& rUIXMLDescription, const OUString& rId, const SfxItemSet& rAttrSet)
: SfxTabPage(pPage, pController, rUIXMLDescription, rId, &rAttrSet)
, m_abEnableRoadmap(false)
, m_pAdminDialog(nullptr)
@@ -208,7 +205,7 @@ namespace dbaui
_bChangedSomething = true;
}
- void OGenericAdministrationPage::fillInt32(SfxItemSet& _rSet, const weld::SpinButton* pEdit, sal_uInt16 _nID, bool& _bChangedSomething)
+ void OGenericAdministrationPage::fillInt32(SfxItemSet& _rSet, const weld::SpinButton* pEdit, TypedWhichId<SfxInt32Item> _nID, bool& _bChangedSomething)
{
if (pEdit && pEdit->get_value_changed_from_saved())
{
@@ -216,19 +213,19 @@ namespace dbaui
_bChangedSomething = true;
}
}
- void OGenericAdministrationPage::fillString(SfxItemSet& _rSet, const weld::Entry* pEdit, sal_uInt16 _nID, bool& _bChangedSomething)
+ void OGenericAdministrationPage::fillString(SfxItemSet& _rSet, const weld::Entry* pEdit, TypedWhichId<SfxStringItem> _nID, bool& _bChangedSomething)
{
if (pEdit && pEdit->get_value_changed_from_saved())
{
- _rSet.Put(SfxStringItem(_nID, pEdit->get_text()));
+ _rSet.Put(SfxStringItem(_nID, pEdit->get_text().trim()));
_bChangedSomething = true;
}
}
- void OGenericAdministrationPage::fillString(SfxItemSet& _rSet, const dbaui::OConnectionURLEdit* pEdit, sal_uInt16 _nID, bool& _bChangedSomething)
+ void OGenericAdministrationPage::fillString(SfxItemSet& _rSet, const dbaui::OConnectionURLEdit* pEdit, TypedWhichId<SfxStringItem> _nID, bool& _bChangedSomething)
{
if (pEdit && pEdit->get_value_changed_from_saved())
{
- _rSet.Put(SfxStringItem(_nID, pEdit->GetText()));
+ _rSet.Put(SfxStringItem(_nID, pEdit->GetText().trim()));
_bChangedSomething = true;
}
}
diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx
index de8265751992..7d13a3886e44 100644
--- a/dbaccess/source/ui/dlg/adminpages.hxx
+++ b/dbaccess/source/ui/dlg/adminpages.hxx
@@ -23,6 +23,9 @@
#include <vcl/wizardmachine.hxx>
#include <curledit.hxx>
+class SfxInt32Item;
+class SfxStringItem;
+
namespace dbaui
{
/// helper class to wrap the savevalue and disable call
@@ -94,7 +97,7 @@ namespace dbaui
css::uno::Reference< css::uno::XComponentContext >
m_xORB;
public:
- OGenericAdministrationPage(weld::Container* pPage, weld::DialogController* pController, const OUString& rUIXMLDescription, const OString& rId, const SfxItemSet& rAttrSet);
+ OGenericAdministrationPage(weld::Container* pPage, weld::DialogController* pController, const OUString& rUIXMLDescription, const OUString& rId, const SfxItemSet& rAttrSet);
/// set a handler which gets called every time something on the page has been modified
void SetModifiedHandler(const Link<OGenericAdministrationPage const *, void>& _rHandler) { m_aModifiedHandler = _rHandler; }
@@ -203,7 +206,7 @@ namespace dbaui
@param _bChangedSomething
<TRUE/> if something changed otherwise <FALSE/>
*/
- static void fillInt32(SfxItemSet& _rSet,const weld::SpinButton* pEdit,sal_uInt16 _nID, bool& _bChangedSomething);
+ static void fillInt32(SfxItemSet& _rSet,const weld::SpinButton* pEdit,TypedWhichId<SfxInt32Item> _nID, bool& _bChangedSomething);
/** fills the String value into the item set when the value changed.
@param _rSet
@@ -215,8 +218,8 @@ namespace dbaui
@param _bChangedSomething
<TRUE/> if something changed otherwise <FALSE/>
*/
- static void fillString(SfxItemSet& _rSet,const weld::Entry* pEdit,sal_uInt16 _nID, bool& _bChangedSomething);
- static void fillString(SfxItemSet& _rSet,const dbaui::OConnectionURLEdit* pEdit,sal_uInt16 _nID, bool& _bChangedSomething);
+ static void fillString(SfxItemSet& _rSet,const weld::Entry* pEdit, TypedWhichId<SfxStringItem> _nID, bool& _bChangedSomething);
+ static void fillString(SfxItemSet& _rSet,const dbaui::OConnectionURLEdit* pEdit, TypedWhichId<SfxStringItem> _nID, bool& _bChangedSomething);
protected:
/** This link be used for controls where the tabpage does not need to take any special action when the control
diff --git a/dbaccess/source/ui/dlg/adodatalinks.cxx b/dbaccess/source/ui/dlg/adodatalinks.cxx
index 74703b010bcb..82af63688cc1 100644
--- a/dbaccess/source/ui/dlg/adodatalinks.cxx
+++ b/dbaccess/source/ui/dlg/adodatalinks.cxx
@@ -26,6 +26,8 @@
#include <comphelper/scopeguard.hxx>
#include <o3tl/char16_t2wchar_t.hxx>
+#include <systools/win32/comtools.hxx>
+#include <systools/win32/oleauto.hxx>
#include <initguid.h>
#include <adoid.h>
@@ -37,154 +39,87 @@ namespace {
OUString PromptNew(sal_IntPtr hWnd)
{
- HRESULT hr;
- IDataSourceLocator* dlPrompt = nullptr;
- ADOConnection* piTmpConnection = nullptr;
- BSTR _result=nullptr;
-
- // Initialize COM
- hr = ::CoInitializeEx( nullptr, COINIT_APARTMENTTHREADED );
- if (FAILED(hr) && hr != RPC_E_CHANGED_MODE)
- std::abort();
- const bool bDoUninit = SUCCEEDED(hr);
- comphelper::ScopeGuard g([bDoUninit] () {
- if (bDoUninit)
- CoUninitialize();
- });
-
- // Instantiate DataLinks object.
- hr = CoCreateInstance(
- CLSID_DataLinks, //clsid -- Data Links UI
- nullptr, //pUnkOuter
- CLSCTX_INPROC_SERVER, //dwClsContext
- IID_IDataSourceLocator, //riid
- reinterpret_cast<void**>(&dlPrompt) //ppvObj
- );
- if( FAILED( hr ) )
+ try
{
- return OUString();
- }
+ // Initialize COM
+ sal::systools::CoInitializeGuard aGuard(COINIT_APARTMENTTHREADED);
- dlPrompt->put_hWnd(hWnd);
- if( FAILED( hr ) )
- {
- dlPrompt->Release( );
- return OUString();
- }
+ // Instantiate DataLinks object.
+ sal::systools::COMReference<IDataSourceLocator> dlPrompt;
+ dlPrompt.CoCreateInstance(CLSID_DataLinks, //clsid -- Data Links UI
+ nullptr, //pUnkOuter
+ CLSCTX_INPROC_SERVER); //dwClsContext
- // Prompt for connection information.
- hr = dlPrompt->PromptNew(reinterpret_cast<IDispatch **>(&piTmpConnection));
+ sal::systools::ThrowIfFailed(dlPrompt->put_hWnd(hWnd), "put_hWnd failed");
- if( FAILED( hr ) || !piTmpConnection )
- {
- dlPrompt->Release( );
- return OUString();
- }
+ // Prompt for connection information.
+ sal::systools::COMReference<IDispatch> piDispatch;
+ sal::systools::ThrowIfFailed(dlPrompt->PromptNew(&piDispatch), "PromptNew failed");
+ sal::systools::COMReference<ADOConnection> piTmpConnection(piDispatch,
+ sal::systools::COM_QUERY_THROW);
+
+ sal::systools::BStr _result;
+ sal::systools::ThrowIfFailed(piTmpConnection->get_ConnectionString(&_result),
+ "get_ConnectionString failed");
- hr = piTmpConnection->get_ConnectionString(&_result);
- if( FAILED( hr ) )
+ return OUString(_result);
+ }
+ catch (const sal::systools::ComError&)
{
- piTmpConnection->Release( );
- dlPrompt->Release( );
return OUString();
}
-
- piTmpConnection->Release( );
- dlPrompt->Release( );
- // Don't we need SysFreeString(_result)?
- return OUString(o3tl::toU(_result));
}
OUString PromptEdit(sal_IntPtr hWnd, OUString const & connstr)
{
- HRESULT hr;
- IDataSourceLocator* dlPrompt = nullptr;
- ADOConnection* piTmpConnection = nullptr;
- BSTR _result=nullptr;
-
- // Initialize COM
- ::CoInitializeEx( nullptr, COINIT_APARTMENTTHREADED );
-
- hr = CoCreateInstance(CLSID_CADOConnection,
- nullptr,
- CLSCTX_INPROC_SERVER,
- IID_IADOConnection,
- reinterpret_cast<LPVOID *>(&piTmpConnection));
- if( FAILED( hr ) )
- {
- piTmpConnection->Release( );
- return connstr;
- }
-
-
- hr = piTmpConnection->put_ConnectionString(
- const_cast<BSTR>(o3tl::toW(connstr.getStr())));
- if( FAILED( hr ) )
+ try
{
- piTmpConnection->Release( );
- return connstr;
- }
+ // Initialize COM
+ sal::systools::CoInitializeGuard aGuard(COINIT_APARTMENTTHREADED);
- // Instantiate DataLinks object.
- hr = CoCreateInstance(
- CLSID_DataLinks, //clsid -- Data Links UI
- nullptr, //pUnkOuter
- CLSCTX_INPROC_SERVER, //dwClsContext
- IID_IDataSourceLocator, //riid
- reinterpret_cast<void**>(&dlPrompt) //ppvObj
- );
- if( FAILED( hr ) )
- {
- piTmpConnection->Release( );
- dlPrompt->Release( );
- return connstr;
- }
+ sal::systools::COMReference<ADOConnection> piTmpConnection;
+ piTmpConnection.CoCreateInstance(CLSID_CADOConnection, nullptr, CLSCTX_INPROC_SERVER);
- dlPrompt->put_hWnd(hWnd);
- if( FAILED( hr ) )
- {
- piTmpConnection->Release( );
- dlPrompt->Release( );
- return connstr;
- }
+ sal::systools::ThrowIfFailed(
+ piTmpConnection->put_ConnectionString(sal::systools::BStr(connstr)),
+ "put_ConnectionString failed");
- VARIANT_BOOL pbSuccess;
+ // Instantiate DataLinks object.
+ sal::systools::COMReference<IDataSourceLocator> dlPrompt;
+ dlPrompt.CoCreateInstance(CLSID_DataLinks, //clsid -- Data Links UI
+ nullptr, //pUnkOuter
+ CLSCTX_INPROC_SERVER); //dwClsContext
- // Prompt for connection information.
- hr = dlPrompt->PromptEdit(reinterpret_cast<IDispatch **>(&piTmpConnection),&pbSuccess);
- if( SUCCEEDED( hr ) && !pbSuccess ) //if user press cancel then sal_False == pbSuccess
- {
- piTmpConnection->Release( );
- dlPrompt->Release( );
- return connstr;
- }
+ sal::systools::ThrowIfFailed(dlPrompt->put_hWnd(hWnd), "put_hWnd failed");
- if( FAILED( hr ) )
- {
- // Prompt for new connection information.
- piTmpConnection->Release( );
- piTmpConnection = nullptr;
- hr = dlPrompt->PromptNew(reinterpret_cast<IDispatch **>(&piTmpConnection));
- if( FAILED( hr ) || !piTmpConnection )
+ try
{
- dlPrompt->Release( );
- return connstr;
+ // Prompt for connection information.
+ IDispatch* piDispatch = piTmpConnection.get();
+ VARIANT_BOOL pbSuccess;
+ sal::systools::ThrowIfFailed(dlPrompt->PromptEdit(&piDispatch, &pbSuccess),
+ "PromptEdit failed");
+ if (!pbSuccess) //if user press cancel then sal_False == pbSuccess
+ return connstr;
}
- }
+ catch (const sal::systools::ComError&)
+ {
+ // Prompt for new connection information.
+ sal::systools::COMReference<IDispatch> piDispatch;
+ sal::systools::ThrowIfFailed(dlPrompt->PromptNew(&piDispatch), "PromptNew failed");
+ piTmpConnection.set(piDispatch, sal::systools::COM_QUERY_THROW);
+ }
+
+ sal::systools::BStr _result;
+ sal::systools::ThrowIfFailed(piTmpConnection->get_ConnectionString(&_result),
+ "get_ConnectionString failed");
- hr = piTmpConnection->get_ConnectionString(&_result);
- if( FAILED( hr ) )
+ return OUString(_result);
+ }
+ catch (const sal::systools::ComError&)
{
- piTmpConnection->Release( );
- dlPrompt->Release( );
return connstr;
}
-
- piTmpConnection->Release( );
- dlPrompt->Release( );
- CoUninitialize();
- // Don't we need SysFreeString(_result)?
- return OUString(o3tl::toU(_result));
}
}
diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx
index 809b483cd19a..2d98688f5b6c 100644
--- a/dbaccess/source/ui/dlg/adtabdlg.cxx
+++ b/dbaccess/source/ui/dlg/adtabdlg.cxx
@@ -18,7 +18,7 @@
*/
#include <adtabdlg.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <core_resource.hxx>
#include <strings.hrc>
#include <connectivity/dbtools.hxx>
@@ -196,10 +196,9 @@ void TableListFacade::updateTableObjectList( bool _bAllowViews )
const OUString* pViewEnd = pViewBegin + sViews.getLength();
::comphelper::UStringMixEqual aEqualFunctor;
for(;pViewBegin != pViewEnd;++pViewBegin)
- aTables.erase(std::remove_if(aTables.begin(),aTables.end(),
+ std::erase_if(aTables,
[&aEqualFunctor, pViewBegin](const OUString& lhs)
- { return aEqualFunctor(lhs, *pViewBegin); } )
- , aTables.end());
+ { return aEqualFunctor(lhs, *pViewBegin); } );
sTables = Sequence< OUString>(aTables.data(), aTables.size());
sViews = Sequence< OUString>();
}
diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx
index 40964305a9f3..935a5370de11 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.cxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.cxx
@@ -46,7 +46,7 @@ namespace dbaui
struct BooleanSettingDesc
{
std::unique_ptr<weld::CheckButton>& xControl; // the dialog's control which displays this setting
- OString sControlId; // the widget name of the control in the .ui
+ OUString sControlId; // the widget name of the control in the .ui
sal_uInt16 nItemId; // the ID of the item (in an SfxItemSet) which corresponds to this setting
bool bInvertedDisplay; // true if and only if the checkbox is checked when the item is sal_False, and vice versa
bool bOptionalBool; // type is OptionalBool
@@ -217,7 +217,7 @@ namespace dbaui
else
OSL_FAIL( "SpecialSettingsPage::implInitControls: unknown boolean item type!" );
- if ( !aValue )
+ if ( !aValue.has_value() )
{
booleanSetting.xControl->set_state(TRISTATE_INDET);
}
@@ -287,9 +287,7 @@ namespace dbaui
: OGenericAdministrationPage(pPage, pController, "dbaccess/ui/generatedvaluespage.ui", "GeneratedValuesPage", _rCoreAttrs)
, m_xAutoRetrievingEnabled(m_xBuilder->weld_check_button("autoretrieve"))
, m_xGrid(m_xBuilder->weld_widget("grid"))
- , m_xAutoIncrementLabel(m_xBuilder->weld_label("statementft"))
, m_xAutoIncrement(m_xBuilder->weld_entry("statement"))
- , m_xAutoRetrievingLabel(m_xBuilder->weld_label("queryft"))
, m_xAutoRetrieving(m_xBuilder->weld_entry("query"))
{
m_xAutoRetrievingEnabled->connect_toggled(LINK(this, GeneratedValuesPage, OnAutoToggleHdl));
@@ -412,7 +410,7 @@ namespace dbaui
return nRet;
}
- void AdvancedSettingsDialog::PageCreated(const OString& rId, SfxTabPage& _rPage)
+ void AdvancedSettingsDialog::PageCreated(const OUString& rId, SfxTabPage& _rPage)
{
// register ourself as modified listener
static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory( getORB() );
diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx
index 38f100612b43..9eaca4a41b48 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.hxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.hxx
@@ -88,9 +88,7 @@ namespace dbaui
{
std::unique_ptr<weld::CheckButton> m_xAutoRetrievingEnabled;
std::unique_ptr<weld::Widget> m_xGrid;
- std::unique_ptr<weld::Label> m_xAutoIncrementLabel;
std::unique_ptr<weld::Entry> m_xAutoIncrement;
- std::unique_ptr<weld::Label> m_xAutoRetrievingLabel;
std::unique_ptr<weld::Entry> m_xAutoRetrieving;
public:
diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx
index 0c79cf0c9bae..2705d56362de 100644
--- a/dbaccess/source/ui/dlg/dbadmin.cxx
+++ b/dbaccess/source/ui/dlg/dbadmin.cxx
@@ -38,10 +38,7 @@ namespace dbaui
{
using namespace com::sun::star::uno;
using namespace com::sun::star::sdbc;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::util;
using namespace com::sun::star::beans;
-using namespace com::sun::star::container;
// ODbAdminDialog
ODbAdminDialog::ODbAdminDialog(weld::Window* pParent,
@@ -71,7 +68,7 @@ short ODbAdminDialog::Ok()
// TODO : AR_ERROR is not handled correctly, we always close the dialog here
}
-void ODbAdminDialog::PageCreated(const OString& rId, SfxTabPage& _rPage)
+void ODbAdminDialog::PageCreated(const OUString& rId, SfxTabPage& _rPage)
{
// register ourself as modified listener
static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory( getORB() );
@@ -80,7 +77,7 @@ void ODbAdminDialog::PageCreated(const OString& rId, SfxTabPage& _rPage)
SfxTabDialogController::PageCreated(rId, _rPage);
}
-void ODbAdminDialog::addDetailPage(const OString& rPageId, const char* pTextId, CreateTabPage pCreateFunc)
+void ODbAdminDialog::addDetailPage(const OUString& rPageId, TranslateId pTextId, CreateTabPage pCreateFunc)
{
AddTabPage(rPageId, DBA_RES(pTextId), pCreateFunc);
}
@@ -91,8 +88,9 @@ void ODbAdminDialog::impl_selectDataSource(const css::uno::Any& _aDataSourceName
Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
impl_resetPages( xDatasource );
- const DbuTypeCollectionItem& rCollectionItem = dynamic_cast<const DbuTypeCollectionItem&>(*getOutputSet()->GetItem(DSID_TYPECOLLECTION));
- ::dbaccess::ODsnTypeCollection* pCollection = rCollectionItem.getCollection();
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>(getOutputSet()->GetItem(DSID_TYPECOLLECTION));
+ assert(pCollectionItem && "must exist");
+ ::dbaccess::ODsnTypeCollection* pCollection = pCollectionItem->getCollection();
::dbaccess::DATASOURCE_TYPE eType = pCollection->determineType(getDatasourceType(*getOutputSet()));
// and insert the new ones
@@ -141,7 +139,7 @@ void ODbAdminDialog::impl_selectDataSource(const css::uno::Any& _aDataSourceName
case ::dbaccess::DST_USERDEFINE10:
{
OUString aTitle(DBA_RES(STR_PAGETITLE_ADVANCED));
- AddTabPage("user" + OString::number(eType - dbaccess::DST_USERDEFINE1 + 1), aTitle, ODriversSettings::CreateUser);
+ AddTabPage("user" + OUString::number(eType - dbaccess::DST_USERDEFINE1 + 1), aTitle, ODriversSettings::CreateUser);
}
break;
default:
@@ -177,11 +175,12 @@ void ODbAdminDialog::impl_resetPages(const Reference< XPropertySet >& _rxDatasou
// special case: MySQL Native does not have the generic "advanced" page
- const DbuTypeCollectionItem& rCollectionItem = dynamic_cast<const DbuTypeCollectionItem&>(*getOutputSet()->GetItem(DSID_TYPECOLLECTION));
- ::dbaccess::ODsnTypeCollection* pCollection = rCollectionItem.getCollection();
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>(getOutputSet()->GetItem(DSID_TYPECOLLECTION));
+ assert(pCollectionItem && "must exist");
+ ::dbaccess::ODsnTypeCollection* pCollection = pCollectionItem->getCollection();
if ( pCollection->determineType(getDatasourceType( *m_xExampleSet )) == ::dbaccess::DST_MYSQL_NATIVE )
{
- OString sMySqlNative("mysqlnative");
+ OUString sMySqlNative("mysqlnative");
AddTabPage(sMySqlNative, DBA_RES(STR_PAGETITLE_CONNECTION), ODriversSettings::CreateMySQLNATIVE);
RemoveTabPage("advanced");
m_sMainPageID = sMySqlNative;
@@ -262,168 +261,135 @@ void ODbAdminDialog::clearPassword()
m_pImpl->clearPassword();
}
-void ODbAdminDialog::createItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults, ::dbaccess::ODsnTypeCollection* _pTypeCollection)
+static ItemInfoPackage& getItemInfoPackageAdminDlg()
{
- // just to be sure...
- _rpSet = nullptr;
- _rpPool = nullptr;
- _rpDefaults = nullptr;
-
- const OUString sFilterAll( "%" );
- // create and initialize the defaults
- _rpDefaults = new std::vector<SfxPoolItem*>(DSID_LAST_ITEM_ID - DSID_FIRST_ITEM_ID + 1);
- SfxPoolItem** pCounter = _rpDefaults->data(); // want to modify this without affecting the out param _rppDefaults
- *pCounter++ = new SfxStringItem(DSID_NAME, OUString());
- *pCounter++ = new SfxStringItem(DSID_ORIGINALNAME, OUString());
- *pCounter++ = new SfxStringItem(DSID_CONNECTURL, OUString());
- *pCounter++ = new OStringListItem(DSID_TABLEFILTER, Sequence< OUString >(&sFilterAll, 1));
- *pCounter++ = new DbuTypeCollectionItem(DSID_TYPECOLLECTION, _pTypeCollection);
- *pCounter++ = new SfxBoolItem(DSID_INVALID_SELECTION, false);
- *pCounter++ = new SfxBoolItem(DSID_READONLY, false);
- *pCounter++ = new SfxStringItem(DSID_USER, OUString());
- *pCounter++ = new SfxStringItem(DSID_PASSWORD, OUString());
- *pCounter++ = new SfxStringItem(DSID_ADDITIONALOPTIONS, OUString());
- *pCounter++ = new SfxStringItem(DSID_CHARSET, OUString());
- *pCounter++ = new SfxBoolItem(DSID_PASSWORDREQUIRED, false);
- *pCounter++ = new SfxBoolItem(DSID_SHOWDELETEDROWS, false);
- *pCounter++ = new SfxBoolItem(DSID_ALLOWLONGTABLENAMES, false);
- *pCounter++ = new SfxStringItem(DSID_JDBCDRIVERCLASS, OUString());
- *pCounter++ = new SfxStringItem(DSID_FIELDDELIMITER, OUString(','));
- *pCounter++ = new SfxStringItem(DSID_TEXTDELIMITER, OUString('"'));
- *pCounter++ = new SfxStringItem(DSID_DECIMALDELIMITER, OUString('.'));
- *pCounter++ = new SfxStringItem(DSID_THOUSANDSDELIMITER, OUString());
- *pCounter++ = new SfxStringItem(DSID_TEXTFILEEXTENSION, "txt");
- *pCounter++ = new SfxBoolItem(DSID_TEXTFILEHEADER, true);
- *pCounter++ = new SfxBoolItem(DSID_PARAMETERNAMESUBST, false);
- *pCounter++ = new SfxInt32Item(DSID_CONN_PORTNUMBER, 8100);
- *pCounter++ = new SfxBoolItem(DSID_SUPPRESSVERSIONCL, false);
- *pCounter++ = new SfxBoolItem(DSID_CONN_SHUTSERVICE, false);
- *pCounter++ = new SfxInt32Item(DSID_CONN_DATAINC, 20);
- *pCounter++ = new SfxInt32Item(DSID_CONN_CACHESIZE, 20);
- *pCounter++ = new SfxStringItem(DSID_CONN_CTRLUSER, OUString());
- *pCounter++ = new SfxStringItem(DSID_CONN_CTRLPWD, OUString());
- *pCounter++ = new SfxBoolItem(DSID_USECATALOG, false);
- *pCounter++ = new SfxStringItem(DSID_CONN_HOSTNAME, OUString());
- *pCounter++ = new SfxStringItem(DSID_CONN_LDAP_BASEDN, OUString());
- *pCounter++ = new SfxInt32Item(DSID_CONN_LDAP_PORTNUMBER, 389);
- *pCounter++ = new SfxInt32Item(DSID_CONN_LDAP_ROWCOUNT, 100);
- *pCounter++ = new SfxBoolItem(DSID_SQL92CHECK, false);
- *pCounter++ = new SfxStringItem(DSID_AUTOINCREMENTVALUE, OUString());
- *pCounter++ = new SfxStringItem(DSID_AUTORETRIEVEVALUE, OUString());
- *pCounter++ = new SfxBoolItem(DSID_AUTORETRIEVEENABLED, false);
- *pCounter++ = new SfxBoolItem(DSID_APPEND_TABLE_ALIAS, false);
- *pCounter++ = new SfxInt32Item(DSID_MYSQL_PORTNUMBER, 3306);
- *pCounter++ = new SfxBoolItem(DSID_IGNOREDRIVER_PRIV, true);
- *pCounter++ = new SfxInt32Item(DSID_BOOLEANCOMPARISON, 0);
- *pCounter++ = new SfxInt32Item(DSID_ORACLE_PORTNUMBER, 1521);
- *pCounter++ = new SfxBoolItem(DSID_ENABLEOUTERJOIN, true);
- *pCounter++ = new SfxBoolItem(DSID_CATALOG, true);
- *pCounter++ = new SfxBoolItem(DSID_SCHEMA, true);
- *pCounter++ = new SfxBoolItem(DSID_INDEXAPPENDIX, true);
- *pCounter++ = new SfxBoolItem(DSID_CONN_LDAP_USESSL, false);
- *pCounter++ = new SfxStringItem(DSID_DOCUMENT_URL, OUString());
- *pCounter++ = new SfxBoolItem(DSID_DOSLINEENDS, false);
- *pCounter++ = new SfxStringItem(DSID_DATABASENAME, OUString());
- *pCounter++ = new SfxBoolItem(DSID_AS_BEFORE_CORRNAME, false);
- *pCounter++ = new SfxBoolItem(DSID_CHECK_REQUIRED_FIELDS, true);
- *pCounter++ = new SfxBoolItem(DSID_IGNORECURRENCY, false);
- *pCounter++ = new SfxStringItem(DSID_CONN_SOCKET, OUString());
- *pCounter++ = new SfxBoolItem(DSID_ESCAPE_DATETIME, true);
- *pCounter++ = new SfxStringItem(DSID_NAMED_PIPE, OUString());
- *pCounter++ = new OptionalBoolItem( DSID_PRIMARY_KEY_SUPPORT );
- *pCounter++ = new SfxInt32Item(DSID_MAX_ROW_SCAN, 100);
- *pCounter++ = new SfxBoolItem( DSID_RESPECTRESULTSETTYPE,false );
-
- // create the pool
- static SfxItemInfo const aItemInfos[DSID_LAST_ITEM_ID - DSID_FIRST_ITEM_ID + 1] =
+ class ItemInfoPackageAdminDlg : public ItemInfoPackage
{
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
- {0,false},
+ typedef std::array<ItemInfoStatic, DSID_LAST_ITEM_ID - DSID_FIRST_ITEM_ID + 1> ItemInfoArrayAdminDlg;
+ ItemInfoArrayAdminDlg maItemInfos {{
+ // m_nWhich, m_pItem, m_nSlotID, m_nItemInfoFlags
+ { DSID_NAME, new SfxStringItem(DSID_NAME, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_ORIGINALNAME, new SfxStringItem(DSID_ORIGINALNAME, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_CONNECTURL, new SfxStringItem(DSID_CONNECTURL, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+
+ // gets added in constructor below once for LO runtime as static default
+ { DSID_TABLEFILTER, nullptr, 0, SFX_ITEMINFOFLAG_NONE },
+
+ // gets added by callback for each new Pool as dynamic default
+ { DSID_TYPECOLLECTION, nullptr, 0, SFX_ITEMINFOFLAG_NONE },
+
+ { DSID_INVALID_SELECTION, new SfxBoolItem(DSID_INVALID_SELECTION, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_READONLY, new SfxBoolItem(DSID_READONLY, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_USER, new SfxStringItem(DSID_USER, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_PASSWORD, new SfxStringItem(DSID_PASSWORD, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_ADDITIONALOPTIONS, new SfxStringItem(DSID_ADDITIONALOPTIONS, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_CHARSET, new SfxStringItem(DSID_CHARSET, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_PASSWORDREQUIRED, new SfxBoolItem(DSID_PASSWORDREQUIRED, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_SHOWDELETEDROWS, new SfxBoolItem(DSID_SHOWDELETEDROWS, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_ALLOWLONGTABLENAMES, new SfxBoolItem(DSID_ALLOWLONGTABLENAMES, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_JDBCDRIVERCLASS, new SfxStringItem(DSID_JDBCDRIVERCLASS, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_FIELDDELIMITER, new SfxStringItem(DSID_FIELDDELIMITER, OUString(',')), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_TEXTDELIMITER, new SfxStringItem(DSID_TEXTDELIMITER, OUString('"')), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_DECIMALDELIMITER, new SfxStringItem(DSID_DECIMALDELIMITER, OUString('.')), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_THOUSANDSDELIMITER, new SfxStringItem(DSID_THOUSANDSDELIMITER, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_TEXTFILEEXTENSION, new SfxStringItem(DSID_TEXTFILEEXTENSION, "txt"), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_TEXTFILEHEADER, new SfxBoolItem(DSID_TEXTFILEHEADER, true), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_PARAMETERNAMESUBST, new SfxBoolItem(DSID_PARAMETERNAMESUBST, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_CONN_PORTNUMBER, new SfxInt32Item(DSID_CONN_PORTNUMBER, 8100), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_SUPPRESSVERSIONCL, new SfxBoolItem(DSID_SUPPRESSVERSIONCL, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_CONN_SHUTSERVICE, new SfxBoolItem(DSID_CONN_SHUTSERVICE, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_CONN_DATAINC, new SfxInt32Item(DSID_CONN_DATAINC, 20), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_CONN_CACHESIZE, new SfxInt32Item(DSID_CONN_CACHESIZE, 20), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_CONN_CTRLUSER, new SfxStringItem(DSID_CONN_CTRLUSER, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_CONN_CTRLPWD, new SfxStringItem(DSID_CONN_CTRLPWD, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_USECATALOG, new SfxBoolItem(DSID_USECATALOG, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_CONN_HOSTNAME, new SfxStringItem(DSID_CONN_HOSTNAME, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_CONN_LDAP_BASEDN, new SfxStringItem(DSID_CONN_LDAP_BASEDN, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_CONN_LDAP_PORTNUMBER, new SfxInt32Item(DSID_CONN_LDAP_PORTNUMBER, 389), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_CONN_LDAP_ROWCOUNT, new SfxInt32Item(DSID_CONN_LDAP_ROWCOUNT, 100), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_SQL92CHECK, new SfxBoolItem(DSID_SQL92CHECK, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_AUTOINCREMENTVALUE, new SfxStringItem(DSID_AUTOINCREMENTVALUE, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_AUTORETRIEVEVALUE, new SfxStringItem(DSID_AUTORETRIEVEVALUE, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_AUTORETRIEVEENABLED, new SfxBoolItem(DSID_AUTORETRIEVEENABLED, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_APPEND_TABLE_ALIAS, new SfxBoolItem(DSID_APPEND_TABLE_ALIAS, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_MYSQL_PORTNUMBER, new SfxInt32Item(DSID_MYSQL_PORTNUMBER, 3306), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_IGNOREDRIVER_PRIV, new SfxBoolItem(DSID_IGNOREDRIVER_PRIV, true), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_BOOLEANCOMPARISON, new SfxInt32Item(DSID_BOOLEANCOMPARISON, 0), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_ORACLE_PORTNUMBER, new SfxInt32Item(DSID_ORACLE_PORTNUMBER, 1521), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_ENABLEOUTERJOIN, new SfxBoolItem(DSID_ENABLEOUTERJOIN, true), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_CATALOG, new SfxBoolItem(DSID_CATALOG, true), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_SCHEMA, new SfxBoolItem(DSID_SCHEMA, true), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_INDEXAPPENDIX, new SfxBoolItem(DSID_INDEXAPPENDIX, true), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_CONN_LDAP_USESSL, new SfxBoolItem(DSID_CONN_LDAP_USESSL, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_DOCUMENT_URL, new SfxStringItem(DSID_DOCUMENT_URL, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_DOSLINEENDS, new SfxBoolItem(DSID_DOSLINEENDS, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_DATABASENAME, new SfxStringItem(DSID_DATABASENAME, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_AS_BEFORE_CORRNAME, new SfxBoolItem(DSID_AS_BEFORE_CORRNAME, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_CHECK_REQUIRED_FIELDS, new SfxBoolItem(DSID_CHECK_REQUIRED_FIELDS, true), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_IGNORECURRENCY, new SfxBoolItem(DSID_IGNORECURRENCY, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_CONN_SOCKET, new SfxStringItem(DSID_CONN_SOCKET, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_ESCAPE_DATETIME, new SfxBoolItem(DSID_ESCAPE_DATETIME, true), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_NAMED_PIPE, new SfxStringItem(DSID_NAMED_PIPE, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_PRIMARY_KEY_SUPPORT, new OptionalBoolItem( DSID_PRIMARY_KEY_SUPPORT ), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_MAX_ROW_SCAN, new SfxInt32Item(DSID_MAX_ROW_SCAN, 100), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_RESPECTRESULTSETTYPE, new SfxBoolItem( DSID_RESPECTRESULTSETTYPE,false ), 0, SFX_ITEMINFOFLAG_NONE },
+ { DSID_POSTGRES_PORTNUMBER, new SfxInt32Item(DSID_POSTGRES_PORTNUMBER, 5432), 0, SFX_ITEMINFOFLAG_NONE }
+ }};
+
+ virtual const ItemInfoStatic& getItemInfoStatic(size_t nIndex) const override { return maItemInfos[nIndex]; }
+
+ public:
+ ItemInfoPackageAdminDlg()
+ {
+ static constexpr OUString sFilterAll( u"%"_ustr );
+ setItemAtItemInfoStatic(
+ new OStringListItem(DSID_TABLEFILTER, Sequence< OUString >{sFilterAll}),
+ maItemInfos[DSID_TABLEFILTER - DSID_FIRST_ITEM_ID]);
+ }
+
+ virtual size_t size() const override { return maItemInfos.size(); }
+ virtual const ItemInfo& getItemInfo(size_t nIndex, SfxItemPool& /*rPool*/) override { return maItemInfos[nIndex]; }
};
- OSL_ENSURE(SAL_N_ELEMENTS(aItemInfos) == DSID_LAST_ITEM_ID,"Invalid Ids!");
- _rpPool = new SfxItemPool("DSAItemPool", DSID_FIRST_ITEM_ID, DSID_LAST_ITEM_ID,
- aItemInfos, _rpDefaults);
- _rpPool->FreezeIdRanges();
+ static std::unique_ptr<ItemInfoPackageAdminDlg> g_aItemInfoPackageAdminDlg;
+ if (!g_aItemInfoPackageAdminDlg)
+ g_aItemInfoPackageAdminDlg.reset(new ItemInfoPackageAdminDlg);
+ return *g_aItemInfoPackageAdminDlg;
+}
+
+void ODbAdminDialog::createItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, ::dbaccess::ODsnTypeCollection* _pTypeCollection)
+{
+ // just to be sure...
+ _rpSet = nullptr;
+ _rpPool = nullptr;
+ _rpPool = new SfxItemPool("DSAItemPool");
+
+ // here we have to use the callback to create all needed default entries since
+ // the DSID_TYPECOLLECTION needs the local given _pTypeCollection. Thus this will
+ // be a ItemInfoDynamic created by SfxItemPool::registerItemInfoPackage. That
+ // (and the contained Item) will be owned by the Pool and cleaned up when it goes
+ // down (see SfxItemPool::cleanupItemInfos())
+ _rpPool->registerItemInfoPackage(
+ getItemInfoPackageAdminDlg(),
+ [&_pTypeCollection](sal_uInt16 nWhich)
+ {
+ SfxPoolItem* pRetval(nullptr);
+ if (DSID_TYPECOLLECTION == nWhich)
+ pRetval = new DbuTypeCollectionItem(DSID_TYPECOLLECTION, _pTypeCollection);
+ return pRetval;
+ });
// and, finally, the set
_rpSet.reset(new SfxItemSet(*_rpPool));
}
-void ODbAdminDialog::destroyItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults)
+void ODbAdminDialog::destroyItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool)
{
// _first_ delete the set (referring the pool)
_rpSet.reset();
// delete the pool
- if (_rpPool)
- {
- _rpPool->ReleaseDefaults(true);
- // the "true" means delete the items, too
- _rpPool = nullptr;
- }
-
- // reset the defaults ptr
- _rpDefaults = nullptr;
- // no need to explicitly delete the defaults, this has been done by the ReleaseDefaults
+ _rpPool = nullptr;
}
} // namespace dbaui
diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx
index d12688d2cbd8..35db6e446ee4 100644
--- a/dbaccess/source/ui/dlg/dbfindex.cxx
+++ b/dbaccess/source/ui/dlg/dbfindex.cxx
@@ -29,6 +29,7 @@
#include <ucbhelper/content.hxx>
#include <svl/filenotation.hxx>
#include <rtl/strbuf.hxx>
+#include <utility>
namespace dbaui
{
@@ -36,12 +37,12 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ucb;
using namespace ::svt;
-constexpr OStringLiteral aGroupIdent("dBase III");
+constexpr OString aGroupIdent("dBase III"_ostr);
-ODbaseIndexDialog::ODbaseIndexDialog(weld::Window * pParent, const OUString& aDataSrcName)
+ODbaseIndexDialog::ODbaseIndexDialog(weld::Window * pParent, OUString aDataSrcName)
: GenericDialogController(pParent, "dbaccess/ui/dbaseindexdialog.ui", "DBaseIndexDialog")
- , m_aDSN(aDataSrcName)
+ , m_aDSN(std::move(aDataSrcName))
, m_xPB_OK(m_xBuilder->weld_button("ok"))
, m_xCB_Tables(m_xBuilder->weld_combo_box("table"))
, m_xIndexes(m_xBuilder->weld_widget("frame"))
@@ -253,9 +254,6 @@ void ODbaseIndexDialog::Init()
// first assume for all indexes they're free
- OUString const aIndexExt("ndx");
- OUString const aTableExt("dbf");
-
std::vector< OUString > aUsedIndexes;
aURL.SetSmartProtocol(INetProtocol::File);
@@ -266,11 +264,11 @@ void ODbaseIndexDialog::Init()
osl::FileBase::getSystemPathFromFileURL(rURL,aName);
aURL.SetSmartURL(aName);
OUString aExt = aURL.getExtension();
- if (aExt == aIndexExt)
+ if (aExt == "ndx")
{
m_aFreeIndexList.emplace_back(aURL.getName() );
}
- else if (aExt == aTableExt)
+ else if (aExt == "dbf")
{
m_aTableInfoList.emplace_back(aURL.getName() );
OTableInfo& rTabInfo = m_aTableInfoList.back();
@@ -370,7 +368,6 @@ void OTableInfo::WriteInfFile( const OUString& rDSN ) const
aInfFile.SetGroup( aGroupIdent );
// first, delete all table indices
- OString aNDX;
sal_uInt16 nKeyCnt = aInfFile.GetKeyCount();
sal_uInt16 nKey = 0;
@@ -378,7 +375,7 @@ void OTableInfo::WriteInfFile( const OUString& rDSN ) const
{
// Does the key point to an index file?...
OString aKeyName = aInfFile.GetKeyName( nKey );
- aNDX = aKeyName.copy(0,3);
+ OString aNDX = aKeyName.copy(0,3);
//...if yes, delete index file, nKey is at subsequent key
if (aNDX == "NDX")
@@ -414,7 +411,7 @@ void OTableInfo::WriteInfFile( const OUString& rDSN ) const
try
{
::ucbhelper::Content aContent(aURL.GetURLNoPass(),Reference<XCommandEnvironment>(), comphelper::getProcessComponentContext());
- aContent.executeCommand( "delete", makeAny( true ) );
+ aContent.executeCommand( "delete", Any( true ) );
}
catch (const Exception& )
{
diff --git a/dbaccess/source/ui/dlg/dbfindex.hxx b/dbaccess/source/ui/dlg/dbfindex.hxx
index 53b75640e6f4..938339314ecc 100644
--- a/dbaccess/source/ui/dlg/dbfindex.hxx
+++ b/dbaccess/source/ui/dlg/dbfindex.hxx
@@ -19,6 +19,7 @@
#pragma once
+#include <utility>
#include <vcl/weld.hxx>
#include <deque>
@@ -34,7 +35,7 @@ private:
public:
OTableIndex() { }
- explicit OTableIndex( const OUString& rFileName ) : aIndexFileName( rFileName ) { }
+ explicit OTableIndex( OUString aFileName ) : aIndexFileName(std::move( aFileName )) { }
const OUString& GetIndexFileName() const { return aIndexFileName; }
};
@@ -53,7 +54,7 @@ private:
TableIndexList aIndexList;
public:
- explicit OTableInfo( const OUString& rName ) : aTableName(rName) { }
+ explicit OTableInfo( OUString aName ) : aTableName(std::move(aName)) { }
void WriteInfFile( const OUString& rDSN ) const;
};
@@ -63,7 +64,6 @@ typedef std::deque< OTableInfo > TableInfoList;
// IndexDialog
class ODbaseIndexDialog : public weld::GenericDialogController
{
-protected:
OUString m_aDSN;
TableInfoList m_aTableInfoList;
TableIndexList m_aFreeIndexList;
@@ -87,6 +87,7 @@ protected:
DECL_LINK( OKClickHdl, weld::Button&, void );
DECL_LINK( OnListEntrySelected, weld::TreeView&, void );
+protected:
void Init();
void SetCtrls();
@@ -101,7 +102,7 @@ protected:
void checkButtons();
public:
- ODbaseIndexDialog(weld::Window * pParent, const OUString& rDataSrcName);
+ ODbaseIndexDialog(weld::Window * pParent, OUString aDataSrcName);
virtual ~ODbaseIndexDialog() override;
};
diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx
index d39fd3c79c29..f34e58c1717e 100644
--- a/dbaccess/source/ui/dlg/dbwiz.cxx
+++ b/dbaccess/source/ui/dlg/dbwiz.cxx
@@ -35,7 +35,6 @@ namespace dbaui
{
using namespace com::sun::star::uno;
using namespace com::sun::star::sdbc;
-using namespace com::sun::star::lang;
using namespace com::sun::star::util;
using namespace com::sun::star::beans;
using namespace com::sun::star::container;
@@ -77,8 +76,9 @@ ODbTypeWizDialog::ODbTypeWizDialog(weld::Window* _pParent, SfxItemSet const * _p
m_xFinish->set_help_id(HID_DBWIZ_FINISH);
// no local resources needed anymore
- const DbuTypeCollectionItem& rCollectionItem = dynamic_cast<const DbuTypeCollectionItem&>(*_pItems->GetItem(DSID_TYPECOLLECTION));
- m_pCollection = rCollectionItem.getCollection();
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>(_pItems->GetItem(DSID_TYPECOLLECTION));
+ assert(pCollectionItem && "must exist");
+ m_pCollection = pCollectionItem->getCollection();
ActivatePage();
setTitleBase(DBA_RES(STR_DATABASE_TYPE_CHANGE));
@@ -137,7 +137,6 @@ WizardState ODbTypeWizDialog::determineNextState( WizardState _nCurrentState ) c
case ::dbaccess::DST_KAB:
case ::dbaccess::DST_MACAB:
case ::dbaccess::DST_MSACCESS:
- case ::dbaccess::DST_MSACCESS_2007:
case ::dbaccess::DST_JDBC:
case ::dbaccess::DST_CALC:
case ::dbaccess::DST_WRITER:
@@ -214,10 +213,10 @@ void ODbTypeWizDialog::clearPassword()
std::unique_ptr<BuilderPage> ODbTypeWizDialog::createPage(WizardState _nState)
{
- const char* pStringId = STR_PAGETITLE_ADVANCED;
+ TranslateId pStringId = STR_PAGETITLE_ADVANCED;
std::unique_ptr<BuilderPage> xPage;
- OString sIdent(OString::number(_nState));
+ OUString sIdent(OUString::number(_nState));
weld::Container* pPageContainer = m_xAssistant->append_page(sIdent);
switch(_nState)
@@ -303,7 +302,7 @@ void ODbTypeWizDialog::enableConfirmSettings( bool _bEnable )
// As soon as it is to be used more wide-spread, we should find a proper concept
// for enabling both the Next and Finish buttons, depending on the current page state.
// Plus, the concept must also care for the case where those pages are embedded into
- // anormal tab dialog.
+ // a normal tab dialog.
}
void ODbTypeWizDialog::saveDatasource()
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index 1d9f89c8791f..8fb43e3d2fc2 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -43,7 +43,6 @@
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/frame/TerminationVetoException.hpp>
#include <com/sun/star/frame/XStorable.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/sdb/DatabaseContext.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
@@ -61,9 +60,10 @@
#include <comphelper/interaction.hxx>
#include <comphelper/namedvaluecollection.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <connectivity/DriversConfig.hxx>
+#include <utility>
namespace dbaui
{
@@ -72,7 +72,6 @@ using namespace vcl;
using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
using namespace com::sun::star::task;
using namespace com::sun::star::lang;
using namespace com::sun::star::io;
@@ -106,6 +105,7 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(weld::Window* _pParent
, m_sRM_JDBCText( DBA_RES( STR_PAGETITLE_JDBC ) )
, m_sRM_MySQLNativePageTitle( DBA_RES( STR_PAGETITLE_MYSQL_NATIVE ) )
, m_sRM_OracleText( DBA_RES( STR_PAGETITLE_ORACLE ) )
+ , m_sRM_PostgresText( DBA_RES( STR_PAGETITLE_POSTGRES ) )
, m_sRM_MySQLText( DBA_RES( STR_PAGETITLE_MYSQL ) )
, m_sRM_ODBCText( DBA_RES( STR_PAGETITLE_ODBC ) )
, m_sRM_DocumentOrSpreadSheetText( DBA_RES( STR_PAGETITLE_DOCUMENT_OR_SPREADSHEET ) )
@@ -115,15 +115,14 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(weld::Window* _pParent
, m_pGeneralPage( nullptr )
, m_pMySQLIntroPage( nullptr )
, m_pFinalPage( nullptr )
- , m_pCollection( nullptr )
{
// no local resources needed anymore
// extract the datasource type collection from the item set
- const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>( _pItems->GetItem(DSID_TYPECOLLECTION) );
- if (pCollectionItem)
- m_pCollection = pCollectionItem->getCollection();
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>(_pItems->GetItem(DSID_TYPECOLLECTION));
+ assert(pCollectionItem && "must exist");
+ m_pCollection = pCollectionItem->getCollection();
- OSL_ENSURE(m_pCollection, "ODbTypeWizDialogSetup::ODbTypeWizDialogSetup : really need a DSN type collection !");
+ assert(m_pCollection && "ODbTypeWizDialogSetup::ODbTypeWizDialogSetup : really need a DSN type collection !");
m_pImpl.reset(new ODbDataSourceAdministrationHelper(_rxORB, m_xAssistant.get(), _pParent, this));
m_pImpl->setDataSourceOrName(_aDataSourceName);
@@ -154,10 +153,14 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(weld::Window* _pParent
aPath.push_back(PAGE_DBSETUPWIZARD_INTRO);
declarePath( static_cast<PathId>(m_pCollection->size()+1), aPath);
+ // Set general help ID for the roadmap
+ SetRoadmapHelpId(HID_DBWIZ_ROADMAP);
+
m_xPrevPage->set_help_id(HID_DBWIZ_PREVIOUS);
m_xNextPage->set_help_id(HID_DBWIZ_NEXT);
m_xCancel->set_help_id(HID_DBWIZ_CANCEL);
m_xFinish->set_help_id(HID_DBWIZ_FINISH);
+ m_xHelp->set_help_id(HID_DBWIZ_HELP);
ActivatePage();
setTitleBase(DBA_RES(STR_DBWIZARDTITLE));
m_xAssistant->set_current_page(0);
@@ -210,6 +213,9 @@ OUString ODbTypeWizDialogSetup::getStateDisplayName(WizardState _nState) const
case PAGE_DBSETUPWIZARD_ORACLE:
sRoadmapItem = m_sRM_OracleText;
break;
+ case PAGE_DBSETUPWIZARD_POSTGRES:
+ sRoadmapItem = m_sRM_PostgresText;
+ break;
case PAGE_DBSETUPWIZARD_MYSQL_INTRO:
sRoadmapItem = m_sRM_MySQLText;
break;
@@ -267,7 +273,7 @@ static void lcl_removeUnused(const ::comphelper::NamedValueCollection& _aOld,con
}
}
-void DataSourceInfoConverter::convert(const Reference<XComponentContext> & xContext, const ::dbaccess::ODsnTypeCollection* _pCollection,const OUString& _sOldURLPrefix,const OUString& _sNewURLPrefix,const css::uno::Reference< css::beans::XPropertySet >& _xDatasource)
+void DataSourceInfoConverter::convert(const Reference<XComponentContext> & xContext, const ::dbaccess::ODsnTypeCollection* _pCollection, std::u16string_view _sOldURLPrefix, std::u16string_view _sNewURLPrefix,const css::uno::Reference< css::beans::XPropertySet >& _xDatasource)
{
if ( _pCollection->getPrefix(_sOldURLPrefix) == _pCollection->getPrefix(_sNewURLPrefix) )
return ;
@@ -282,7 +288,7 @@ void DataSourceInfoConverter::convert(const Reference<XComponentContext> & xCont
lcl_removeUnused(aOldProperties,aNewProperties,aDS);
aDS >>= aInfo;
- _xDatasource->setPropertyValue(PROPERTY_INFO,uno::makeAny(aInfo));
+ _xDatasource->setPropertyValue(PROPERTY_INFO,uno::Any(aInfo));
}
void ODbTypeWizDialogSetup::activateDatabasePath()
@@ -305,6 +311,9 @@ void ODbTypeWizDialogSetup::activateDatabasePath()
{
OUString sOld = m_sURL;
m_sURL = m_pGeneralPage->GetSelectedType();
+ if (m_sURL.startsWith("sdbc:mysql:") && sOld.startsWith("sdbc:mysql:"))
+ m_sURL = sOld; // The type of MySQL connection was already set elsewhere; just use it,
+ // instead of the hardcoded one from the selector
DataSourceInfoConverter::convert(getORB(), m_pCollection,sOld,m_sURL,m_pImpl->getCurrentDataSource());
::dbaccess::DATASOURCE_TYPE eType = VerifyDataSourceType(m_pCollection->determineType(m_sURL));
if (eType == ::dbaccess::DST_UNKNOWN)
@@ -457,7 +466,7 @@ std::unique_ptr<BuilderPage> ODbTypeWizDialogSetup::createPage(WizardState _nSta
{
std::unique_ptr<OGenericAdministrationPage> xPage;
- OString sIdent(OString::number(_nState));
+ OUString sIdent(OUString::number(_nState));
weld::Container* pPageContainer = m_xAssistant->append_page(sIdent);
switch(_nState)
@@ -487,16 +496,16 @@ std::unique_ptr<BuilderPage> ODbTypeWizDialogSetup::createPage(WizardState _nSta
break;
case PAGE_DBSETUPWIZARD_MYSQL_ODBC:
- m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getPrefix("sdbc:mysql:odbc:")));
+ m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getPrefix(u"sdbc:mysql:odbc:")));
xPage = OConnectionTabPageSetup::CreateODBCTabPage(pPageContainer, this, *m_pOutSet);
break;
case PAGE_DBSETUPWIZARD_MYSQL_JDBC:
- m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getPrefix("sdbc:mysql:jdbc:")));
+ m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getPrefix(u"sdbc:mysql:jdbc:")));
xPage = OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLJDBCTabPage(pPageContainer, this, *m_pOutSet);
break;
case PAGE_DBSETUPWIZARD_MYSQL_NATIVE:
- m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getPrefix("sdbc:mysql:mysqlc:")));
+ m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getPrefix(u"sdbc:mysql:mysqlc:")));
xPage = MySQLNativeSetupPage::Create(pPageContainer, this, *m_pOutSet);
break;
@@ -504,6 +513,10 @@ std::unique_ptr<BuilderPage> ODbTypeWizDialogSetup::createPage(WizardState _nSta
xPage = OGeneralSpecialJDBCConnectionPageSetup::CreateOracleJDBCTabPage(pPageContainer, this, *m_pOutSet);
break;
+ case PAGE_DBSETUPWIZARD_POSTGRES:
+ xPage = OPostgresConnectionPageSetup::CreatePostgresTabPage(pPageContainer, this, *m_pOutSet);
+ break;
+
case PAGE_DBSETUPWIZARD_LDAP:
xPage = OLDAPConnectionPageSetup::CreateLDAPTabPage(pPageContainer, this, *m_pOutSet);
break;
@@ -691,16 +704,13 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
{
if ( !lcl_handle( xHandler, aError ) )
{
- InteractiveIOException aRequest;
- aRequest.Classification = InteractionClassification_ERROR;
- if ( aError.isExtractableTo( ::cppu::UnoType< IOException >::get() ) )
- // assume saving the document failed
- aRequest.Code = IOErrorCode_CANT_WRITE;
- else
- aRequest.Code = IOErrorCode_GENERAL;
- aRequest.Message = e.Message;
- aRequest.Context = e.Context;
- lcl_handle( xHandler, makeAny( aRequest ) );
+ css::ucb::IOErrorCode code
+ = aError.isExtractableTo(::cppu::UnoType<IOException>::get())
+ ? IOErrorCode_CANT_WRITE // assume saving the document failed
+ : IOErrorCode_GENERAL;
+ InteractiveIOException aRequest(e.Message, e.Context,
+ InteractionClassification_ERROR, code);
+ lcl_handle( xHandler, Any( aRequest ) );
}
}
}
@@ -739,7 +749,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
OSL_ENSURE(xDatasource.is(),"DataSource is null!");
if ( xDatasource.is() )
- xDatasource->setPropertyValue( PROPERTY_INFO, makeAny( m_pCollection->getDefaultDBSettings( eType ) ) );
+ xDatasource->setPropertyValue( PROPERTY_INFO, Any( m_pCollection->getDefaultDBSettings( eType ) ) );
m_pImpl->translateProperties(xDatasource,*m_pOutSet);
}
else if ( m_pCollection->isFileSystemBased(eType) )
@@ -756,7 +766,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
m_pImpl->saveChanges(*m_pOutSet);
}
- void ODbTypeWizDialogSetup::RegisterDataSourceByLocation(const OUString& _sPath)
+ void ODbTypeWizDialogSetup::RegisterDataSourceByLocation(std::u16string_view _sPath)
{
Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
Reference< XDatabaseContext > xDatabaseContext( DatabaseContext::create(getORB()) );
@@ -772,15 +782,14 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
::sfx2::FileDialogHelper aFileDlg(
ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION,
FileDialogFlags::NONE, m_xAssistant.get());
+ aFileDlg.SetContext(sfx2::FileDialogHelper::BaseSaveAs);
std::shared_ptr<const SfxFilter> pFilter = getStandardDatabaseFilter();
if ( pFilter )
{
- INetURLObject aWorkURL( m_sWorkPath );
- aFileDlg.SetDisplayFolder( aWorkURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ));
-
OUString sDefaultName = DBA_RES( STR_DATABASEDEFAULTNAME );
OUString sExtension = pFilter->GetDefaultExtension();
- sDefaultName += sExtension.replaceAt( 0, 1, OUString() );
+ sDefaultName += sExtension.replaceAt( 0, 1, u"" );
+ INetURLObject aWorkURL( m_sWorkPath );
aWorkURL.Append( sDefaultName );
sDefaultName = createUniqueFileName( aWorkURL );
aFileDlg.SetFileName( sDefaultName );
@@ -816,7 +825,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
if (bFolderExists)
{
i++;
- pURL->setName(OUString(sLastSegmentName + OUString::number(i)));
+ pURL->setName(Concat2View(sLastSegmentName + OUString::number(i)));
}
}
}
@@ -834,7 +843,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
bElementExists = xSimpleFileAccess->exists( aExistenceCheck.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
if ( bElementExists )
{
- aExistenceCheck.setBase( OUString(BaseName + OUString::number( i ) ));
+ aExistenceCheck.setBase( Concat2View(BaseName + OUString::number( i ) ));
++i;
}
}
@@ -861,7 +870,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
OAsynchronousLink m_aAsyncCaller;
public:
- AsyncLoader( const Reference< XComponentContext >& _rxORB, const OUString& _rURL );
+ AsyncLoader( const Reference< XComponentContext >& _xORB, OUString _aURL );
void doLoadAsync();
@@ -875,8 +884,8 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
DECL_LINK( OnOpenDocument, void*, void );
};
- AsyncLoader::AsyncLoader( const Reference< XComponentContext >& _rxORB, const OUString& _rURL )
- :m_sURL( _rURL )
+ AsyncLoader::AsyncLoader( const Reference< XComponentContext >& _rxORB, OUString _aURL )
+ :m_sURL(std::move( _aURL ))
,m_aAsyncCaller( LINK( this, AsyncLoader, OnOpenDocument ) )
{
try
diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx
index 8b74872d904f..ed3d60692f34 100644
--- a/dbaccess/source/ui/dlg/detailpages.cxx
+++ b/dbaccess/source/ui/dlg/detailpages.cxx
@@ -45,14 +45,9 @@ namespace dbaui
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::container;
- using namespace ::dbtools;
OCommonBehaviourTabPage::OCommonBehaviourTabPage(weld::Container* pPage, weld::DialogController* pController,
- const OUString& rUIXMLDescription, const OString& rId, const SfxItemSet& rCoreAttrs,
+ const OUString& rUIXMLDescription, const OUString& rId, const SfxItemSet& rCoreAttrs,
OCommonBehaviourTabPageFlags nControlFlags)
: OGenericAdministrationPage(pPage, pController, rUIXMLDescription, rId, rCoreAttrs)
, m_nControlFlags(nControlFlags)
@@ -442,7 +437,7 @@ namespace dbaui
OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue);
// to get the correct value when saveValue was called by base class
- if ( m_bUseClass && m_xEDDriverClass->get_text().trim().isEmpty() )
+ if ( m_bUseClass && o3tl::trim(m_xEDDriverClass->get_text()).empty() )
{
m_xEDDriverClass->set_text(m_sDefaultJdbcDriverName);
m_xEDDriverClass->save_value();
@@ -457,7 +452,7 @@ namespace dbaui
#if HAVE_FEATURE_JAVA
try
{
- if (!m_xEDDriverClass->get_text().trim().isEmpty())
+ if (!o3tl::trim(m_xEDDriverClass->get_text()).empty())
{
// TODO change jvmaccess
::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
@@ -469,7 +464,7 @@ namespace dbaui
{
}
#endif
- const char* pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
+ TranslateId pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
const MessageType mt = bSuccess ? MessageType::Info : MessageType::Error;
OSQLMessageBox aMsg(GetFrameWeld(), DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt);
aMsg.run();
@@ -478,7 +473,7 @@ namespace dbaui
void OGeneralSpecialJDBCDetailsPage::callModifiedHdl(weld::Widget* pControl)
{
if (m_bUseClass && pControl == m_xEDDriverClass.get())
- m_xTestJavaDriver->set_sensitive(!m_xEDDriverClass->get_text().trim().isEmpty());
+ m_xTestJavaDriver->set_sensitive(!o3tl::trim(m_xEDDriverClass->get_text()).empty());
// tell the listener we were modified
OGenericAdministrationPage::callModifiedHdl();
diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx
index 2952f42e6155..aa01c12f930e 100644
--- a/dbaccess/source/ui/dlg/detailpages.hxx
+++ b/dbaccess/source/ui/dlg/detailpages.hxx
@@ -54,16 +54,10 @@ namespace dbaui
std::unique_ptr<weld::Label> m_xCharsetLabel;
std::unique_ptr<CharSetListBox> m_xCharset;
- std::unique_ptr<weld::CheckButton> m_xAutoRetrievingEnabled;
- std::unique_ptr<weld::Label> m_xAutoIncrementLabel;
- std::unique_ptr<weld::Entry> m_xAutoIncrement;
- std::unique_ptr<weld::Label> m_xAutoRetrievingLabel;
- std::unique_ptr<weld::Entry> m_xAutoRetrieving;
-
public:
virtual bool FillItemSet (SfxItemSet* _rCoreAttrs) override;
- OCommonBehaviourTabPage(weld::Container* pPage, weld::DialogController* pController, const OUString& rUIXMLDescription, const OString& rId, const SfxItemSet& _rCoreAttrs, OCommonBehaviourTabPageFlags nControlFlags);
+ OCommonBehaviourTabPage(weld::Container* pPage, weld::DialogController* pController, const OUString& rUIXMLDescription, const OUString& rId, const SfxItemSet& _rCoreAttrs, OCommonBehaviourTabPageFlags nControlFlags);
protected:
virtual ~OCommonBehaviourTabPage() override;
@@ -171,7 +165,7 @@ namespace dbaui
DECL_LINK(OnTestJavaClickHdl, weld::Button&, void);
OUString m_sDefaultJdbcDriverName;
- sal_uInt16 m_nPortId;
+ TypedWhichId<SfxInt32Item> m_nPortId;
bool m_bUseClass;
std::unique_ptr<weld::Entry> m_xEDHostname;
diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx
index ac3425999cf9..eab893e4e4b1 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -20,16 +20,21 @@
#include <core_resource.hxx>
#include <directsql.hxx>
#include <sqledit.hxx>
+#include <strings.hxx>
#include <strings.hrc>
#include <comphelper/types.hxx>
#include <osl/mutex.hxx>
#include <rtl/ustrbuf.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <com/sun/star/sdbc/SQLException.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/XMultipleResults.hpp>
+#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
+#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
namespace dbaui
{
@@ -45,10 +50,11 @@ namespace dbaui
, m_xExecute(m_xBuilder->weld_button("execute"))
, m_xSQLHistory(m_xBuilder->weld_combo_box("sqlhistory"))
, m_xStatus(m_xBuilder->weld_text_view("status"))
+ , m_xDirectSQL(m_xBuilder->weld_check_button("directsql"))
, m_xShowOutput(m_xBuilder->weld_check_button("showoutput"))
, m_xOutput(m_xBuilder->weld_text_view("output"))
, m_xClose(m_xBuilder->weld_button("close"))
- , m_xSQL(new SQLEditView)
+ , m_xSQL(new SQLEditView(m_xBuilder->weld_scrolled_window("scrolledwindow", true)))
, m_xSQLEd(new weld::CustomWeld(*m_xBuilder, "sql", *m_xSQL))
, m_nStatusCount(1)
, m_xConnection(_rxConn)
@@ -108,13 +114,25 @@ namespace dbaui
sal_Int32 DirectSQLDialog::getHistorySize() const
{
- CHECK_INVARIANTS("DirectSQLDialog::getHistorySize");
+ #ifdef DBG_UTIL
+ {
+ const char* pError = impl_CheckInvariants();
+ if (pError)
+ SAL_WARN("dbaccess.ui", "DirectSQLDialog::getHistorySize: " << pError);
+ }
+ #endif
return m_aStatementHistory.size();
}
void DirectSQLDialog::implEnsureHistoryLimit()
{
- CHECK_INVARIANTS("DirectSQLDialog::implEnsureHistoryLimit");
+ #ifdef DBG_UTIL
+ {
+ const char* pError = impl_CheckInvariants();
+ if (pError)
+ SAL_WARN("dbaccess.ui", "DirectSQLDialog::implEnsureHistoryLimit: " << pError);
+ }
+ #endif
if (getHistorySize() <= g_nHistoryLimit)
// nothing to do
@@ -131,7 +149,13 @@ namespace dbaui
void DirectSQLDialog::implAddToStatementHistory(const OUString& _rStatement)
{
- CHECK_INVARIANTS("DirectSQLDialog::implAddToStatementHistory");
+ #ifdef DBG_UTIL
+ {
+ const char* pError = impl_CheckInvariants();
+ if (pError)
+ SAL_WARN("dbaccess.ui", "DirectSQLDialog::implAddToStatementHistor: " << pError);
+ }
+ #endif
// add the statement to the history
m_aStatementHistory.push_back(_rStatement);
@@ -168,7 +192,13 @@ namespace dbaui
void DirectSQLDialog::implExecuteStatement(const OUString& _rStatement)
{
- CHECK_INVARIANTS("DirectSQLDialog::implExecuteStatement");
+ #ifdef DBG_UTIL
+ {
+ const char* pError = impl_CheckInvariants();
+ if (pError)
+ SAL_WARN("dbaccess.ui", "DirectSQLDialog::implExecuteStatement: " << pError);
+ }
+ #endif
::osl::MutexGuard aGuard(m_aMutex);
@@ -181,6 +211,19 @@ namespace dbaui
// create a statement
Reference< XStatement > xStatement = m_xConnection->createStatement();
+ if (m_xDirectSQL->get_active())
+ {
+ Reference< com::sun::star::beans::XPropertySet > xStatementProps(xStatement, UNO_QUERY_THROW);
+ try
+ {
+ xStatementProps->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, Any(false));
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION("dbaccess");
+ }
+ }
+
Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
css::uno::Reference< css::sdbc::XMultipleResults > xMR ( xStatement, UNO_QUERY );
@@ -195,7 +238,7 @@ namespace dbaui
}
else
addOutputText(
- OUString(OUString::number(xMR->getUpdateCount()) + " rows updated\n"));
+ Concat2View(OUString::number(xMR->getUpdateCount()) + " rows updated\n"));
for (;;)
{
hasRS = xMR->getMoreResults();
@@ -211,7 +254,28 @@ namespace dbaui
}
else
{
- if (_rStatement.toAsciiUpperCase().startsWith("SELECT"))
+ const OUString upperStatement = _rStatement.toAsciiUpperCase();
+ if (upperStatement.startsWith("UPDATE"))
+ {
+ sal_Int32 resultCount = xStatement->executeUpdate(_rStatement);
+ addOutputText(Concat2View(OUString::number(resultCount) + " rows updated\n"));
+ }
+ else if (upperStatement.startsWith("INSERT"))
+ {
+ sal_Int32 resultCount = xStatement->executeUpdate(_rStatement);
+ addOutputText(Concat2View(OUString::number(resultCount) + " rows inserted\n"));
+ }
+ else if (upperStatement.startsWith("DELETE"))
+ {
+ sal_Int32 resultCount = xStatement->executeUpdate(_rStatement);
+ addOutputText(Concat2View(OUString::number(resultCount) + " rows deleted\n"));
+ }
+ else if (upperStatement.startsWith("CREATE"))
+ {
+ xStatement->executeUpdate(_rStatement);
+ addOutputText(u"Command executed\n");
+ }
+ else if (upperStatement.startsWith("SELECT") || m_xShowOutput->get_active())
{
css::uno::Reference< css::sdbc::XResultSet > xRS = xStatement->executeQuery(_rStatement);
if (m_xShowOutput->get_active())
@@ -220,7 +284,7 @@ namespace dbaui
else
{
sal_Int32 resultCount = xStatement->executeUpdate(_rStatement);
- addOutputText(OUString(OUString::number(resultCount) + " rows updated\n"));
+ addOutputText(Concat2View(OUString::number(resultCount) + " rows updated\n"));
}
}
// successful
@@ -244,6 +308,10 @@ namespace dbaui
void DirectSQLDialog::display(const css::uno::Reference< css::sdbc::XResultSet >& xRS)
{
+
+ const Reference<XResultSetMetaData> xResultSetMetaData = Reference<XResultSetMetaDataSupplier>(xRS,UNO_QUERY_THROW)->getMetaData();
+ const sal_Int32 nColumnsCount = xResultSetMetaData->getColumnCount();
+
// get a handle for the rows
css::uno::Reference< css::sdbc::XRow > xRow( xRS, css::uno::UNO_QUERY );
// work through each of the rows
@@ -254,12 +322,31 @@ namespace dbaui
// work along the columns until that are none left
try
{
- int i = 1;
- for (;;)
+ for (sal_Int32 i = 1; i <= nColumnsCount; ++i)
{
- // be dumb, treat everything as a string
- out.append(xRow->getString(i) + ",");
- i++;
+ switch (xResultSetMetaData->getColumnType(i))
+ {
+ // tdf#153317, at least "Bit" type in Mysql/MariaDB gives: "\000" or "\001"
+ // so retrieve Sequence from getBytes, test if it has a length of 1 (so we avoid BLOB/CLOB or other complex types)
+ // and test if the value of first byte is one of those.
+ // In this case, there's a good chance it's a "Bit" field
+ case css::sdbc::DataType::BIT:
+ {
+ auto seq = xRow->getBytes(i);
+ if ((seq.getLength() == 1) && (seq[0] >= 0) && (seq[0] <= 1))
+ {
+ out.append(OUString::number(static_cast<int>(seq[0])) + ",");
+ }
+ else
+ {
+ out.append(xRow->getString(i) + ",");
+ }
+ break;
+ }
+ // for the rest, be dumb, treat everything as a string
+ default:
+ out.append(xRow->getString(i) + ",");
+ }
}
}
// trap for when we fall off the end of the row
@@ -267,7 +354,7 @@ namespace dbaui
{
}
// report the output
- addOutputText(out.makeStringAndClear());
+ addOutputText(out);
}
}
@@ -291,7 +378,13 @@ namespace dbaui
void DirectSQLDialog::executeCurrent()
{
- CHECK_INVARIANTS("DirectSQLDialog::executeCurrent");
+ #ifdef DBG_UTIL
+ {
+ const char* pError = impl_CheckInvariants();
+ if (pError)
+ SAL_WARN("dbaccess.ui", "DirectSQLDialog::executeCurrent: " << pError);
+ }
+ #endif
OUString sStatement = m_xSQL->GetText();
@@ -306,7 +399,13 @@ namespace dbaui
void DirectSQLDialog::switchToHistory(sal_Int32 _nHistoryPos)
{
- CHECK_INVARIANTS("DirectSQLDialog::switchToHistory");
+ #ifdef DBG_UTIL
+ {
+ const char* pError = impl_CheckInvariants();
+ if (pError)
+ SAL_WARN("dbaccess.ui", "DirectSQLDialog::switchToHistory: " << pError);
+ }
+ #endif
if ((_nHistoryPos >= 0) && (_nHistoryPos < getHistorySize()))
{
diff --git a/dbaccess/source/ui/dlg/dlgattr.cxx b/dbaccess/source/ui/dlg/dlgattr.cxx
index ce42469873c4..24a1c4e81c2d 100644
--- a/dbaccess/source/ui/dlg/dlgattr.cxx
+++ b/dbaccess/source/ui/dlg/dlgattr.cxx
@@ -25,7 +25,6 @@
#include <svx/dialogs.hrc>
#include <svl/itemset.hxx>
-#include <svl/zforlist.hxx>
#include <svx/svxids.hrc>
using namespace dbaui;
@@ -35,7 +34,7 @@ SbaSbAttrDlg::SbaSbAttrDlg(weld::Widget* pParent, const SfxItemSet* pCellAttrs,
SvNumberFormatter* pFormatter, bool bHasFormat)
: SfxTabDialogController(pParent, "dbaccess/ui/fielddialog.ui", "FieldDialog", pCellAttrs)
{
- pNumberInfoItem.reset( new SvxNumberInfoItem( pFormatter, 0 ) );
+ pNumberInfoItem.reset( new SvxNumberInfoItem( pFormatter, SID_ATTR_NUMBERFORMAT_INFO ) );
if (bHasFormat)
AddTabPage("format", RID_SVXPAGE_NUMBERFORMAT);
@@ -48,12 +47,12 @@ SbaSbAttrDlg::~SbaSbAttrDlg()
{
}
-void SbaSbAttrDlg::PageCreated(const OString& rPageId, SfxTabPage& rTabPage)
+void SbaSbAttrDlg::PageCreated(const OUString& rPageId, SfxTabPage& rTabPage)
{
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
if (rPageId == "format")
{
- aSet.Put (SvxNumberInfoItem( pNumberInfoItem->GetNumberFormatter(), static_cast<sal_uInt16>(SID_ATTR_NUMBERFORMAT_INFO)));
+ aSet.Put (SvxNumberInfoItem( pNumberInfoItem->GetNumberFormatter(), SID_ATTR_NUMBERFORMAT_INFO));
rTabPage.PageCreated(aSet);
}
}
diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx b/dbaccess/source/ui/dlg/dlgsave.cxx
index ce5d16881f1d..44c98cd49e63 100644
--- a/dbaccess/source/ui/dlg/dlgsave.cxx
+++ b/dbaccess/source/ui/dlg/dlgsave.cxx
@@ -24,58 +24,18 @@
#include <com/sun/star/sdbc/XRow.hpp>
#include <connectivity/dbtools.hxx>
#include <UITools.hxx>
-#include <SqlNameEdit.hxx>
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
#include <objectnamecheck.hxx>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
using namespace dbaui;
using namespace dbtools;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::container;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbc;
-namespace dbaui
-{
-class OSaveAsDlgImpl
-{
-public:
- OUString m_aQryLabel;
- OUString m_sTblLabel;
- OUString m_aName;
- const IObjectNameCheck& m_rObjectNameCheck;
- css::uno::Reference< css::sdbc::XDatabaseMetaData> m_xMetaData;
- sal_Int32 m_nType;
- SADFlags m_nFlags;
-
- OSQLNameChecker m_aChecker;
-
- std::unique_ptr<weld::Label> m_xDescription;
- std::unique_ptr<weld::Label> m_xCatalogLbl;
- std::unique_ptr<weld::ComboBox> m_xCatalog;
- std::unique_ptr<weld::Label> m_xSchemaLbl;
- std::unique_ptr<weld::ComboBox> m_xSchema;
- std::unique_ptr<weld::Label> m_xLabel;
- std::unique_ptr<weld::Entry> m_xTitle;
- std::unique_ptr<weld::Button> m_xPB_OK;
-
- DECL_LINK(TextFilterHdl, OUString&, bool);
-
- OSaveAsDlgImpl( weld::Builder* pParent, sal_Int32 _rType,
- const css::uno::Reference< css::sdbc::XConnection>& _xConnection,
- const OUString& rDefault,
- const IObjectNameCheck& _rObjectNameCheck,
- SADFlags _nFlags);
- OSaveAsDlgImpl( weld::Builder* pParent,
- const OUString& rDefault,
- const IObjectNameCheck& _rObjectNameCheck,
- SADFlags _nFlags);
-};
-
-} // dbaui
-
-IMPL_LINK(OSaveAsDlgImpl, TextFilterHdl, OUString&, rTest, bool)
+
+IMPL_LINK(OSaveAsDlg, TextFilterHdl, OUString&, rTest, bool)
{
OUString sCorrected;
if (m_aChecker.checkString(rTest, sCorrected))
@@ -83,69 +43,6 @@ IMPL_LINK(OSaveAsDlgImpl, TextFilterHdl, OUString&, rTest, bool)
return true;
}
-OSaveAsDlgImpl::OSaveAsDlgImpl(weld::Builder* pBuilder,
- sal_Int32 _rType,
- const Reference< XConnection>& _xConnection,
- const OUString& rDefault,
- const IObjectNameCheck& _rObjectNameCheck,
- SADFlags _nFlags)
- : m_aQryLabel(DBA_RES(STR_QRY_LABEL))
- , m_sTblLabel(DBA_RES(STR_TBL_LABEL))
- , m_aName(rDefault)
- , m_rObjectNameCheck( _rObjectNameCheck )
- , m_nType(_rType)
- , m_nFlags(_nFlags)
- , m_aChecker(OUString())
- , m_xDescription(pBuilder->weld_label("descriptionft"))
- , m_xCatalogLbl(pBuilder->weld_label("catalogft"))
- , m_xCatalog(pBuilder->weld_combo_box("catalog"))
- , m_xSchemaLbl(pBuilder->weld_label("schemaft"))
- , m_xSchema(pBuilder->weld_combo_box("schema"))
- , m_xLabel(pBuilder->weld_label("titleft"))
- , m_xTitle(pBuilder->weld_entry("title"))
- , m_xPB_OK(pBuilder->weld_button("ok"))
-{
- if ( _xConnection.is() )
- m_xMetaData = _xConnection->getMetaData();
-
- if (m_xMetaData.is())
- {
- OUString sExtraNameChars(m_xMetaData->getExtraNameCharacters());
- m_aChecker.setAllowedChars(sExtraNameChars);
- }
-
- m_xTitle->connect_insert_text(LINK(this, OSaveAsDlgImpl, TextFilterHdl));
- m_xSchema->connect_entry_insert_text(LINK(this, OSaveAsDlgImpl, TextFilterHdl));
- m_xCatalog->connect_entry_insert_text(LINK(this, OSaveAsDlgImpl, TextFilterHdl));
-}
-
-OSaveAsDlgImpl::OSaveAsDlgImpl(weld::Builder* pBuilder,
- const OUString& rDefault,
- const IObjectNameCheck& _rObjectNameCheck,
- SADFlags _nFlags)
- : m_aQryLabel(DBA_RES(STR_QRY_LABEL))
- , m_sTblLabel(DBA_RES(STR_TBL_LABEL))
- , m_aName(rDefault)
- , m_rObjectNameCheck( _rObjectNameCheck )
- , m_nType(CommandType::COMMAND)
- , m_nFlags(_nFlags)
- , m_aChecker(OUString())
- , m_xDescription(pBuilder->weld_label("descriptionft"))
- , m_xCatalogLbl(pBuilder->weld_label("catalogft"))
- , m_xCatalog(pBuilder->weld_combo_box("catalog"))
- , m_xSchemaLbl(pBuilder->weld_label("schemaft"))
- , m_xSchema(pBuilder->weld_combo_box("schema"))
- , m_xLabel(pBuilder->weld_label("titleft"))
- , m_xTitle(pBuilder->weld_entry("title"))
- , m_xPB_OK(pBuilder->weld_button("ok"))
-{
- m_xTitle->connect_insert_text(LINK(this, OSaveAsDlgImpl, TextFilterHdl));
- m_xSchema->connect_entry_insert_text(LINK(this, OSaveAsDlgImpl, TextFilterHdl));
- m_xCatalog->connect_entry_insert_text(LINK(this, OSaveAsDlgImpl, TextFilterHdl));
-}
-
-using namespace ::com::sun::star::lang;
-
namespace
{
typedef Reference< XResultSet > (SAL_CALL XDatabaseMetaData::*FGetMetaStrings)();
@@ -185,69 +82,93 @@ OSaveAsDlg::OSaveAsDlg( weld::Window * pParent,
SADFlags _nFlags)
: GenericDialogController(pParent, "dbaccess/ui/savedialog.ui", "SaveDialog")
, m_xContext( _rxContext )
+ , m_aName(rDefault)
+ , m_rObjectNameCheck( _rObjectNameCheck )
+ , m_nType(_rType)
+ , m_nFlags(_nFlags)
+ , m_aChecker(OUString())
+ , m_xDescription(m_xBuilder->weld_label("descriptionft"))
+ , m_xCatalogLbl(m_xBuilder->weld_label("catalogft"))
+ , m_xCatalog(m_xBuilder->weld_combo_box("catalog"))
+ , m_xSchemaLbl(m_xBuilder->weld_label("schemaft"))
+ , m_xSchema(m_xBuilder->weld_combo_box("schema"))
+ , m_xLabel(m_xBuilder->weld_label("titleft"))
+ , m_xTitle(m_xBuilder->weld_entry("title"))
+ , m_xPB_OK(m_xBuilder->weld_button("ok"))
{
- m_pImpl.reset( new OSaveAsDlgImpl(m_xBuilder.get(),_rType,_xConnection,rDefault,_rObjectNameCheck,_nFlags) );
+ if ( _xConnection.is() )
+ m_xMetaData = _xConnection->getMetaData();
+
+ if (m_xMetaData.is())
+ {
+ OUString sExtraNameChars(m_xMetaData->getExtraNameCharacters());
+ m_aChecker.setAllowedChars(sExtraNameChars);
+ }
+
+ m_xTitle->connect_insert_text(LINK(this, OSaveAsDlg, TextFilterHdl));
+ m_xSchema->connect_entry_insert_text(LINK(this, OSaveAsDlg, TextFilterHdl));
+ m_xCatalog->connect_entry_insert_text(LINK(this, OSaveAsDlg, TextFilterHdl));
switch (_rType) {
case CommandType::QUERY:
- implInitOnlyTitle(m_pImpl->m_aQryLabel);
+ implInitOnlyTitle(DBA_RES(STR_QRY_LABEL));
break;
case CommandType::TABLE:
- OSL_ENSURE( m_pImpl->m_xMetaData.is(), "OSaveAsDlg::OSaveAsDlg: no meta data for entering table names: this will crash!" );
+ OSL_ENSURE( m_xMetaData.is(), "OSaveAsDlg::OSaveAsDlg: no meta data for entering table names: this will crash!" );
{
- m_pImpl->m_xLabel->set_label(m_pImpl->m_sTblLabel);
- if(m_pImpl->m_xMetaData.is() && !m_pImpl->m_xMetaData->supportsCatalogsInTableDefinitions()) {
- m_pImpl->m_xCatalogLbl->hide();
- m_pImpl->m_xCatalog->hide();
+ m_xLabel->set_label(DBA_RES(STR_TBL_LABEL));
+ if(m_xMetaData.is() && !m_xMetaData->supportsCatalogsInTableDefinitions()) {
+ m_xCatalogLbl->hide();
+ m_xCatalog->hide();
} else {
// now fill the catalogs
- lcl_fillComboList( *m_pImpl->m_xCatalog, _xConnection,
+ lcl_fillComboList( *m_xCatalog, _xConnection,
&XDatabaseMetaData::getCatalogs, _xConnection->getCatalog() );
}
- if ( !m_pImpl->m_xMetaData->supportsSchemasInTableDefinitions()) {
- m_pImpl->m_xSchemaLbl->hide();
- m_pImpl->m_xSchema->hide();
+ if ( !m_xMetaData->supportsSchemasInTableDefinitions()) {
+ m_xSchemaLbl->hide();
+ m_xSchema->hide();
} else {
- lcl_fillComboList( *m_pImpl->m_xSchema, _xConnection,
- &XDatabaseMetaData::getSchemas, m_pImpl->m_xMetaData->getUserName() );
+ lcl_fillComboList( *m_xSchema, _xConnection,
+ &XDatabaseMetaData::getSchemas, m_xMetaData->getUserName() );
}
- OSL_ENSURE(m_pImpl->m_xMetaData.is(),"The metadata can not be null!");
- if(m_pImpl->m_aName.indexOf('.') != -1) {
+ OSL_ENSURE(m_xMetaData.is(),"The metadata can not be null!");
+ if(m_aName.indexOf('.') != -1) {
OUString sCatalog,sSchema,sTable;
- ::dbtools::qualifiedNameComponents(m_pImpl->m_xMetaData,
- m_pImpl->m_aName,
+ ::dbtools::qualifiedNameComponents(m_xMetaData,
+ m_aName,
sCatalog,
sSchema,
sTable,
::dbtools::EComposeRule::InDataManipulation);
- int nPos = m_pImpl->m_xCatalog->find_text(sCatalog);
+ int nPos = m_xCatalog->find_text(sCatalog);
if (nPos != -1)
- m_pImpl->m_xCatalog->set_active(nPos);
+ m_xCatalog->set_active(nPos);
if ( !sSchema.isEmpty() ) {
- nPos = m_pImpl->m_xSchema->find_text(sSchema);
+ nPos = m_xSchema->find_text(sSchema);
if (nPos != -1)
- m_pImpl->m_xSchema->set_active(nPos);
+ m_xSchema->set_active(nPos);
}
- m_pImpl->m_xTitle->set_text(sTable);
+ m_xTitle->set_text(sTable);
} else
- m_pImpl->m_xTitle->set_text(m_pImpl->m_aName);
- m_pImpl->m_xTitle->select_region(0, -1);
+ m_xTitle->set_text(m_aName);
+ m_xTitle->select_region(0, -1);
- sal_Int32 nLength = m_pImpl->m_xMetaData.is() ? m_pImpl->m_xMetaData->getMaxTableNameLength() : 0;
+ sal_Int32 nLength = m_xMetaData.is() ? m_xMetaData->getMaxTableNameLength() : 0;
if (nLength)
{
- m_pImpl->m_xTitle->set_max_length(nLength);
- m_pImpl->m_xSchema->set_entry_max_length(nLength);
- m_pImpl->m_xCatalog->set_entry_max_length(nLength);
+ m_xTitle->set_max_length(nLength);
+ m_xSchema->set_entry_max_length(nLength);
+ m_xCatalog->set_entry_max_length(nLength);
}
bool bCheck = _xConnection.is() && isSQL92CheckEnabled(_xConnection);
- m_pImpl->m_aChecker.setCheck(bCheck); // enable non valid sql chars as well
+ m_aChecker.setCheck(bCheck); // enable non valid sql chars as well
}
break;
@@ -266,8 +187,23 @@ OSaveAsDlg::OSaveAsDlg(weld::Window * pParent,
SADFlags _nFlags)
: GenericDialogController(pParent, "dbaccess/ui/savedialog.ui", "SaveDialog")
, m_xContext( _rxContext )
+ , m_aName(rDefault)
+ , m_rObjectNameCheck( _rObjectNameCheck )
+ , m_nType(CommandType::COMMAND)
+ , m_nFlags(_nFlags)
+ , m_aChecker(OUString())
+ , m_xDescription(m_xBuilder->weld_label("descriptionft"))
+ , m_xCatalogLbl(m_xBuilder->weld_label("catalogft"))
+ , m_xCatalog(m_xBuilder->weld_combo_box("catalog"))
+ , m_xSchemaLbl(m_xBuilder->weld_label("schemaft"))
+ , m_xSchema(m_xBuilder->weld_combo_box("schema"))
+ , m_xLabel(m_xBuilder->weld_label("titleft"))
+ , m_xTitle(m_xBuilder->weld_entry("title"))
+ , m_xPB_OK(m_xBuilder->weld_button("ok"))
{
- m_pImpl.reset( new OSaveAsDlgImpl(m_xBuilder.get(),rDefault,_rObjectNameCheck,_nFlags) );
+ m_xTitle->connect_insert_text(LINK(this, OSaveAsDlg, TextFilterHdl));
+ m_xSchema->connect_entry_insert_text(LINK(this, OSaveAsDlg, TextFilterHdl));
+ m_xCatalog->connect_entry_insert_text(LINK(this, OSaveAsDlg, TextFilterHdl));
implInitOnlyTitle(_sLabel);
implInit();
}
@@ -278,13 +214,13 @@ OSaveAsDlg::~OSaveAsDlg()
IMPL_LINK_NOARG(OSaveAsDlg, ButtonClickHdl, weld::Button&, void)
{
- m_pImpl->m_aName = m_pImpl->m_xTitle->get_text();
+ m_aName = m_xTitle->get_text();
- OUString sNameToCheck( m_pImpl->m_aName );
+ OUString sNameToCheck( m_aName );
- if ( m_pImpl->m_nType == CommandType::TABLE ) {
+ if ( m_nType == CommandType::TABLE ) {
sNameToCheck = ::dbtools::composeTableName(
- m_pImpl->m_xMetaData,
+ m_xMetaData,
getCatalog(),
getSchema(),
sNameToCheck,
@@ -294,58 +230,58 @@ IMPL_LINK_NOARG(OSaveAsDlg, ButtonClickHdl, weld::Button&, void)
}
SQLExceptionInfo aNameError;
- if ( m_pImpl->m_rObjectNameCheck.isNameValid( sNameToCheck, aNameError ) )
+ if ( m_rObjectNameCheck.isNameValid( sNameToCheck, aNameError ) )
m_xDialog->response(RET_OK);
showError(aNameError, m_xDialog->GetXWindow(), m_xContext);
- m_pImpl->m_xTitle->grab_focus();
+ m_xTitle->grab_focus();
}
IMPL_LINK_NOARG(OSaveAsDlg, EditModifyHdl, weld::Entry&, void)
{
- m_pImpl->m_xPB_OK->set_sensitive(!m_pImpl->m_xTitle->get_text().isEmpty());
+ m_xPB_OK->set_sensitive(!m_xTitle->get_text().isEmpty());
}
void OSaveAsDlg::implInitOnlyTitle(const OUString& _rLabel)
{
- m_pImpl->m_xLabel->set_label(_rLabel);
- m_pImpl->m_xCatalogLbl->hide();
- m_pImpl->m_xCatalog->hide();
- m_pImpl->m_xSchemaLbl->hide();
- m_pImpl->m_xSchema->hide();
-
- m_pImpl->m_xTitle->set_text(m_pImpl->m_aName);
- m_pImpl->m_aChecker.setCheck(false); // enable non valid sql chars as well
+ m_xLabel->set_label(_rLabel);
+ m_xCatalogLbl->hide();
+ m_xCatalog->hide();
+ m_xSchemaLbl->hide();
+ m_xSchema->hide();
+
+ m_xTitle->set_text(m_aName);
+ m_aChecker.setCheck(false); // enable non valid sql chars as well
}
void OSaveAsDlg::implInit()
{
- if ( !( m_pImpl->m_nFlags & SADFlags::AdditionalDescription ) ) {
+ if ( !( m_nFlags & SADFlags::AdditionalDescription ) ) {
// hide the description window
- m_pImpl->m_xDescription->hide();
+ m_xDescription->hide();
}
- if ( SADFlags::TitlePasteAs == ( m_pImpl->m_nFlags & SADFlags::TitlePasteAs ) )
+ if ( SADFlags::TitlePasteAs == ( m_nFlags & SADFlags::TitlePasteAs ) )
m_xDialog->set_title( DBA_RES( STR_TITLE_PASTE_AS ) );
- else if ( SADFlags::TitleRename == ( m_pImpl->m_nFlags & SADFlags::TitleRename ) )
+ else if ( SADFlags::TitleRename == ( m_nFlags & SADFlags::TitleRename ) )
m_xDialog->set_title( DBA_RES( STR_TITLE_RENAME ) );
- m_pImpl->m_xPB_OK->connect_clicked(LINK(this,OSaveAsDlg,ButtonClickHdl));
- m_pImpl->m_xTitle->connect_changed(LINK(this,OSaveAsDlg,EditModifyHdl));
- m_pImpl->m_xTitle->grab_focus();
+ m_xPB_OK->connect_clicked(LINK(this,OSaveAsDlg,ButtonClickHdl));
+ m_xTitle->connect_changed(LINK(this,OSaveAsDlg,EditModifyHdl));
+ m_xTitle->grab_focus();
}
const OUString& OSaveAsDlg::getName() const
{
- return m_pImpl->m_aName;
+ return m_aName;
}
OUString OSaveAsDlg::getCatalog() const
{
- return m_pImpl->m_xCatalog->get_visible() ? m_pImpl->m_xCatalog->get_active_text() : OUString();
+ return m_xCatalog->get_visible() ? m_xCatalog->get_active_text() : OUString();
}
OUString OSaveAsDlg::getSchema() const
{
- return m_pImpl->m_xSchema->get_visible() ? m_pImpl->m_xSchema->get_active_text() : OUString();
+ return m_xSchema->get_visible() ? m_xSchema->get_active_text() : OUString();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/dlg/dlgsize.cxx b/dbaccess/source/ui/dlg/dlgsize.cxx
index 544d9577fdd9..be9e96612a83 100644
--- a/dbaccess/source/ui/dlg/dlgsize.cxx
+++ b/dbaccess/source/ui/dlg/dlgsize.cxx
@@ -27,7 +27,7 @@ namespace dbaui
DlgSize::DlgSize(weld::Window* pParent, sal_Int32 nVal, bool bRow, sal_Int32 _nAlternativeStandard )
: GenericDialogController(pParent, bRow ? OUString("dbaccess/ui/rowheightdialog.ui") : OUString("dbaccess/ui/colwidthdialog.ui"),
- bRow ? OString("RowHeightDialog") : OString("ColWidthDialog"))
+ bRow ? OUString("RowHeightDialog") : OUString("ColWidthDialog"))
, m_nPrevValue(nVal)
, m_xMF_VALUE(m_xBuilder->weld_metric_spin_button("value", FieldUnit::CM))
, m_xCB_STANDARD(m_xBuilder->weld_check_button("automatic"))
diff --git a/dbaccess/source/ui/dlg/dsselect.cxx b/dbaccess/source/ui/dlg/dsselect.cxx
index 4c0b9a836382..34be198cb44c 100644
--- a/dbaccess/source/ui/dlg/dsselect.cxx
+++ b/dbaccess/source/ui/dlg/dsselect.cxx
@@ -24,17 +24,9 @@
namespace dbaui
{
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::ui::dialogs;
-
ODatasourceSelectDialog::ODatasourceSelectDialog(weld::Window* _pParent, const std::set<OUString>& _rDatasources)
: GenericDialogController(_pParent, "dbaccess/ui/choosedatasourcedialog.ui", "ChooseDataSourceDialog")
, m_xDatasource(m_xBuilder->weld_tree_view("treeview"))
- , m_xOk(m_xBuilder->weld_button("ok"))
- , m_xCancel(m_xBuilder->weld_button("cancel"))
- , m_xManageDatasources(m_xBuilder->weld_button("organize"))
{
m_xDatasource->set_size_request(-1, m_xDatasource->get_height_rows(6));
diff --git a/dbaccess/source/ui/dlg/dsselect.hxx b/dbaccess/source/ui/dlg/dsselect.hxx
index 87cdef17c7aa..bfd068898093 100644
--- a/dbaccess/source/ui/dlg/dsselect.hxx
+++ b/dbaccess/source/ui/dlg/dsselect.hxx
@@ -32,9 +32,6 @@ namespace dbaui
class ODatasourceSelectDialog final : public weld::GenericDialogController
{
std::unique_ptr<weld::TreeView> m_xDatasource;
- std::unique_ptr<weld::Button> m_xOk;
- std::unique_ptr<weld::Button> m_xCancel;
- std::unique_ptr<weld::Button> m_xManageDatasources;
#ifdef HAVE_ODBC_ADMINISTRATION
std::unique_ptr<OOdbcManagement> m_xODBCManagement;
#endif
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index da41b8984d6f..bb308845528e 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_features.h>
#include <core_resource.hxx>
#include "dsnItem.hxx"
#include "generalpage.hxx"
@@ -25,6 +26,7 @@
#include <dsitems.hxx>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/docfilt.hxx>
+#include <utility>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <svl/stritem.hxx>
@@ -76,7 +78,7 @@ namespace dbaui
OUString eType;
OUString sDisplayName;
- DisplayedType( const OUString& _eType, const OUString& _rDisplayName ) : eType( _eType ), sDisplayName( _rDisplayName ) { }
+ DisplayedType( OUString _eType, OUString _sDisplayName ) : eType(std::move( _eType )), sDisplayName(std::move( _sDisplayName )) { }
};
typedef std::vector< DisplayedType > DisplayedTypes;
@@ -154,9 +156,11 @@ namespace dbaui
if (m_xEmbeddedDBType->find_text(sDisplayName) == -1 &&
dbaccess::ODsnTypeCollection::isEmbeddedDatabase(sURLPrefix))
{
+#if !HAVE_FEATURE_MACOSX_SANDBOX
if( !officecfg::Office::Common::Misc::ExperimentalMode::get()
&& sURLPrefix.startsWith("sdbc:embedded:firebird") )
continue;
+#endif
aDisplayedTypes.emplace_back( sURLPrefix, sDisplayName );
m_bIsDisplayedTypesEmpty = false;
}
@@ -181,7 +185,7 @@ namespace dbaui
if ( eMessage != m_eLastMessage )
{
- const char* pResId = nullptr;
+ TranslateId pResId;
if ( smUnsupportedType == eMessage )
pResId = STR_UNSUPPORTED_DATASOURCE_TYPE;
OUString sMessage;
@@ -222,31 +226,29 @@ namespace dbaui
OUString OGeneralPageWizard::getEmbeddedDBName( const SfxItemSet& _rSet )
{
+ if (!m_pCollection)
+ return {};
// first check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
bool bValid, bReadonly;
getFlags( _rSet, bValid, bReadonly );
-
- // if the selection is invalid, disable everything
-
- implSetCurrentType( OUString() );
+ if (!bValid)
+ return {};
// compare the DSN prefix with the registered ones
- OUString sDisplayName;
-
- if (m_pCollection && bValid)
- {
- implSetCurrentType( dbaccess::ODsnTypeCollection::getEmbeddedDatabase() );
- sDisplayName = m_pCollection->getTypeDisplayName( m_eCurrentSelection );
- onTypeSelected(m_eCurrentSelection);
- }
-
- // select the correct datasource type
- if ( dbaccess::ODsnTypeCollection::isEmbeddedDatabase( m_eCurrentSelection )
- && m_xEmbeddedDBType->find_text(sDisplayName) == -1 )
+ OUString sDBURL;
+ if (const SfxStringItem* pUrlItem = _rSet.GetItem<SfxStringItem>(DSID_CONNECTURL))
+ if (dbaccess::ODsnTypeCollection::isEmbeddedDatabase(pUrlItem->GetValue()))
+ sDBURL = pUrlItem->GetValue();
+ if (sDBURL.isEmpty())
+ sDBURL = dbaccess::ODsnTypeCollection::getEmbeddedDatabase();
+ OUString sDisplayName = m_pCollection->getTypeDisplayName(sDBURL);
+
+ // ensure presence of the correct datasource type
+ if (!sDisplayName.isEmpty() && m_xEmbeddedDBType->find_text(sDisplayName) == -1)
{ // this indicates it's really a type which is known in general, but not supported on the current platform
// show a message saying so
// eSpecialMessage = smUnsupportedType;
- insertEmbeddedDBTypeEntryData( m_eCurrentSelection, sDisplayName );
+ insertEmbeddedDBTypeEntryData(sDBURL, sDisplayName);
}
return sDisplayName;
@@ -450,7 +452,6 @@ namespace dbaui
, m_xFT_EmbeddedDBLabel(m_xBuilder->weld_label("embeddeddbLabel"))
, m_xEmbeddedDBType(m_xBuilder->weld_combo_box("embeddeddbList"))
, m_xFT_DocListLabel(m_xBuilder->weld_label("docListLabel"))
- , m_xFT_HelpText(m_xBuilder->weld_label("helpText"))
, m_xLB_DocumentList(new OpenDocumentListBox(m_xBuilder->weld_combo_box("documentList"), "com.sun.star.sdb.OfficeDatabaseDocument"))
, m_xPB_OpenDatabase(new OpenDocumentButton(m_xBuilder->weld_button("openDatabase"), "com.sun.star.sdb.OfficeDatabaseDocument"))
, m_xFT_NoEmbeddedDBLabel(m_xBuilder->weld_label("noembeddeddbLabel"))
@@ -564,7 +565,7 @@ namespace dbaui
case ::dbaccess::DST_MYSQL_JDBC:
case ::dbaccess::DST_MYSQL_ODBC:
case ::dbaccess::DST_MYSQL_NATIVE:
- _inout_rDisplayName = "MySQL";
+ _inout_rDisplayName = "MySQL/MariaDB";
break;
default:
break;
@@ -664,6 +665,7 @@ namespace dbaui
::sfx2::FileDialogHelper aFileDlg(
ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,
FileDialogFlags::NONE, "sdatabase", SfxFilterFlags::NONE, SfxFilterFlags::NONE, GetFrameWeld());
+ aFileDlg.SetContext(sfx2::FileDialogHelper::BaseDataSource);
std::shared_ptr<const SfxFilter> pFilter = getStandardDatabaseFilter();
if ( pFilter )
{
@@ -676,7 +678,7 @@ namespace dbaui
// check for aFileDlg.GetCurrentFilter used to be here but current fpicker filter
// can be set to anything, see tdf#125267 how this breaks if other value
// than 'ODF Database' is selected. Let's therefore check only if wildcard matches
- if ( !pFilter->GetWildcard().Matches(sPath) )
+ if (pFilter && !pFilter->GetWildcard().Matches(sPath))
{
OUString sMessage(DBA_RES(STR_ERR_USE_CONNECT_TO));
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx
index 1abda980ec54..57ea5f5a4937 100644
--- a/dbaccess/source/ui/dlg/generalpage.hxx
+++ b/dbaccess/source/ui/dlg/generalpage.hxx
@@ -135,7 +135,6 @@ namespace dbaui
std::unique_ptr<weld::ComboBox> m_xEmbeddedDBType;
std::unique_ptr<weld::Label> m_xFT_DocListLabel;
- std::unique_ptr<weld::Label> m_xFT_HelpText;
std::unique_ptr<OpenDocumentListBox> m_xLB_DocumentList;
std::unique_ptr<OpenDocumentButton> m_xPB_OpenDatabase;
diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx
index dfa9bf355187..d12602ce2eec 100644
--- a/dbaccess/source/ui/dlg/indexdialog.cxx
+++ b/dbaccess/source/ui/dlg/indexdialog.cxx
@@ -409,7 +409,7 @@ namespace dbaui
updateToolbox();
}
- IMPL_LINK(DbaIndexDialog, OnIndexAction, const OString&, rClicked, void)
+ IMPL_LINK(DbaIndexDialog, OnIndexAction, const OUString&, rClicked, void)
{
if (rClicked == "ID_INDEX_NEW")
OnNewIndex();
@@ -537,28 +537,28 @@ namespace dbaui
bool DbaIndexDialog::implSaveModified(bool _bPlausibility)
{
- if (m_xPreviousSelection)
- {
- // try to commit the previously selected index
- if (m_xFields->IsModified() && !m_xFields->SaveModified())
- return false;
+ if (!m_xPreviousSelection)
+ return true;
- Indexes::iterator aPreviouslySelected = m_xIndexes->begin() + m_xIndexList->get_id(*m_xPreviousSelection).toUInt32();
+ // try to commit the previously selected index
+ if (m_xFields->IsModified() && !m_xFields->SaveModified())
+ return false;
- // the unique flag
- aPreviouslySelected->bUnique = m_xUnique->get_active();
- if (m_xUnique->get_state_changed_from_saved())
- aPreviouslySelected->setModified(true);
+ Indexes::iterator aPreviouslySelected = m_xIndexes->begin() + m_xIndexList->get_id(*m_xPreviousSelection).toUInt32();
- // the fields
- m_xFields->commitTo(aPreviouslySelected->aFields);
- if (m_xFields->GetSavedValue() != aPreviouslySelected->aFields)
- aPreviouslySelected->setModified(true);
+ // the unique flag
+ aPreviouslySelected->bUnique = m_xUnique->get_active();
+ if (m_xUnique->get_state_changed_from_saved())
+ aPreviouslySelected->setModified(true);
- // plausibility checks
- if (_bPlausibility && !implCheckPlausibility(aPreviouslySelected))
- return false;
- }
+ // the fields
+ m_xFields->commitTo(aPreviouslySelected->aFields);
+ if (m_xFields->GetSavedValue() != aPreviouslySelected->aFields)
+ aPreviouslySelected->setModified(true);
+
+ // plausibility checks
+ if (_bPlausibility && !implCheckPlausibility(aPreviouslySelected))
+ return false;
return true;
}
@@ -641,7 +641,7 @@ namespace dbaui
m_xUnique->set_sensitive(!aSelectedIndex->bPrimaryKey);
m_xUnique->save_state();
- m_xFields->initializeFrom(aSelectedIndex->aFields);
+ m_xFields->initializeFrom(std::vector(aSelectedIndex->aFields));
m_xFields->Enable(!aSelectedIndex->bPrimaryKey);
m_xFields->SaveValue();
diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
index 88cf056dbfc7..35b0e3f02a27 100644
--- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
+++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
@@ -20,6 +20,7 @@
#include <core_resource.hxx>
#include <indexfieldscontrol.hxx>
#include <strings.hrc>
+#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
#include <helpids.h>
#include <toolkit/helper/vclunohelper.hxx>
@@ -137,10 +138,10 @@ constexpr auto BROWSER_STANDARD_FLAGS = BrowserMode::COLUMNSELECTION | BrowserMo
_rDev.SetClipRegion();
}
- void IndexFieldsControl::initializeFrom(const IndexFields& _rFields)
+ void IndexFieldsControl::initializeFrom(IndexFields&& _rFields)
{
// copy the field descriptions
- m_aFields = _rFields;
+ m_aFields = std::move(_rFields);
m_aSeekRow = m_aFields.end();
SetUpdateMode(false);
@@ -266,7 +267,7 @@ constexpr auto BROWSER_STANDARD_FLAGS = BrowserMode::COLUMNSELECTION | BrowserMo
bool IndexFieldsControl::implGetFieldDesc(sal_Int32 _nRow, IndexFields::const_iterator& _rPos)
{
_rPos = m_aFields.end();
- if ((_nRow < 0) || (_nRow >= static_cast<sal_Int32>(m_aFields.size())))
+ if ((_nRow < 0) || (o3tl::make_unsigned(_nRow) >= m_aFields.size()))
return false;
_rPos = m_aFields.begin() + _nRow;
return true;
diff --git a/dbaccess/source/ui/dlg/odbcconfig.cxx b/dbaccess/source/ui/dlg/odbcconfig.cxx
index f3de8ba7037f..b2f3a45ff90d 100644
--- a/dbaccess/source/ui/dlg/odbcconfig.cxx
+++ b/dbaccess/source/ui/dlg/odbcconfig.cxx
@@ -61,10 +61,6 @@ typedef SQLRETURN (SQL_API* TSQLSetEnvAttr) (SQLHENV EnvironmentHandle, SQLINTEG
typedef SQLRETURN (SQL_API* TSQLDataSources) (SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR* ServerName,
SQLSMALLINT BufferLength1, SQLSMALLINT* NameLength1Ptr, SQLCHAR* Description, SQLSMALLINT BufferLength2, SQLSMALLINT* NameLength2Ptr);
-#define NSQLAllocHandle(a,b,c) (*reinterpret_cast<TSQLAllocHandle>(m_pAllocHandle))(a,b,c)
-#define NSQLFreeHandle(a,b) (*reinterpret_cast<TSQLFreeHandle>(m_pFreeHandle))(a,b)
-#define NSQLSetEnvAttr(a,b,c,d) (*reinterpret_cast<TSQLSetEnvAttr>(m_pSetEnvAttr))(a,b,c,d)
-#define NSQLDataSources(a,b,c,d,e,f,g,h) (*reinterpret_cast<TSQLDataSources>(m_pDataSources))(a,b,c,d,e,f,g,h)
#endif
// OOdbcLibWrapper
@@ -164,12 +160,12 @@ bool OOdbcEnumeration::allocEnv()
if (m_pImpl->hEnvironment)
// nothing to do
return true;
- SQLRETURN nResult = NSQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &m_pImpl->hEnvironment);
+ SQLRETURN nResult = (*reinterpret_cast<TSQLAllocHandle>(m_pAllocHandle))(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &m_pImpl->hEnvironment);
if (SQL_SUCCESS != nResult)
// can't do anything without environment
return false;
- NSQLSetEnvAttr(m_pImpl->hEnvironment, SQL_ATTR_ODBC_VERSION, reinterpret_cast<SQLPOINTER>(SQL_OV_ODBC3), SQL_IS_INTEGER);
+ (*reinterpret_cast<TSQLSetEnvAttr>(m_pSetEnvAttr))(m_pImpl->hEnvironment, SQL_ATTR_ODBC_VERSION, reinterpret_cast<SQLPOINTER>(SQL_OV_ODBC3),SQL_IS_INTEGER);
return true;
#else
return sal_False;
@@ -180,7 +176,7 @@ void OOdbcEnumeration::freeEnv()
{
#ifdef HAVE_ODBC_SUPPORT
if (m_pImpl->hEnvironment)
- NSQLFreeHandle(SQL_HANDLE_ENV, m_pImpl->hEnvironment);
+ (*reinterpret_cast<TSQLFreeHandle>(m_pFreeHandle))(SQL_HANDLE_ENV, m_pImpl->hEnvironment);
m_pImpl->hEnvironment = nullptr;
#endif
}
@@ -206,9 +202,11 @@ void OOdbcEnumeration::getDatasourceNames(std::set<OUString>& _rNames)
SQLRETURN nResult = SQL_SUCCESS;
rtl_TextEncoding nTextEncoding = osl_getThreadTextEncoding();
- for ( nResult = NSQLDataSources(m_pImpl->hEnvironment, SQL_FETCH_FIRST, szDSN, sizeof(szDSN), &pcbDSN, szDescription, sizeof(szDescription)-1, &pcbDescription);
+ for ( nResult = (*reinterpret_cast<TSQLDataSources>(m_pDataSources))(m_pImpl->hEnvironment, SQL_FETCH_FIRST, szDSN,
+ sizeof(szDSN), &pcbDSN, szDescription, sizeof(szDescription)-1, &pcbDescription);
;
- nResult = NSQLDataSources(m_pImpl->hEnvironment, SQL_FETCH_NEXT, szDSN, sizeof(szDSN), &pcbDSN, szDescription, sizeof(szDescription)-1, &pcbDescription)
+ nResult = (*reinterpret_cast<TSQLDataSources>(m_pDataSources))(m_pImpl->hEnvironment, SQL_FETCH_NEXT, szDSN,
+ sizeof(szDSN), &pcbDSN, szDescription, sizeof(szDescription)-1, &pcbDescription)
)
{
if (nResult != SQL_SUCCESS)
diff --git a/dbaccess/source/ui/dlg/optionalboolitem.cxx b/dbaccess/source/ui/dlg/optionalboolitem.cxx
index 5eb4b1272a15..30d176391ba4 100644
--- a/dbaccess/source/ui/dlg/optionalboolitem.cxx
+++ b/dbaccess/source/ui/dlg/optionalboolitem.cxx
@@ -25,7 +25,6 @@ namespace dbaui
// OptionalBoolItem
OptionalBoolItem::OptionalBoolItem( sal_uInt16 _nWhich )
:SfxPoolItem( _nWhich )
- ,m_aValue()
{
}
diff --git a/dbaccess/source/ui/dlg/optionalboolitem.hxx b/dbaccess/source/ui/dlg/optionalboolitem.hxx
index c500dfa2ac60..1c1d039e2650 100644
--- a/dbaccess/source/ui/dlg/optionalboolitem.hxx
+++ b/dbaccess/source/ui/dlg/optionalboolitem.hxx
@@ -37,7 +37,7 @@ namespace dbaui
virtual bool operator==( const SfxPoolItem& _rItem ) const override;
virtual OptionalBoolItem* Clone( SfxItemPool* _pPool = nullptr ) const override;
- bool HasValue() const { return !!m_aValue; }
+ bool HasValue() const { return m_aValue.has_value(); }
void ClearValue() { m_aValue.reset(); }
bool GetValue() const { return *m_aValue; }
void SetValue(bool _bValue) { m_aValue = _bValue; }
diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx
index a7bd8ae1538f..fddb77f4bd8c 100644
--- a/dbaccess/source/ui/dlg/paramdialog.cxx
+++ b/dbaccess/source/ui/dlg/paramdialog.cxx
@@ -27,18 +27,16 @@
#include <vcl/weld.hxx>
#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaui
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::util;
- using namespace ::connectivity;
// OParameterDialog
@@ -50,6 +48,7 @@ namespace dbaui
, m_nCurrentlySelected(-1)
, m_xConnection(_rxConnection)
, m_aPredicateInput( rxContext, _rxConnection, getParseContext() )
+ , m_aResetVisitFlag("dbaccess OParameterDialog m_aResetVisitFlag")
, m_xAllParams(m_xBuilder->weld_tree_view("allParamTreeview"))
, m_xParam(m_xBuilder->weld_entry("paramEntry"))
, m_xTravelNext(m_xBuilder->weld_button("next"))
@@ -123,15 +122,10 @@ namespace dbaui
OnEntrySelected();
if (m_xAllParams->n_children() == 1)
- {
m_xTravelNext->set_sensitive(false);
- }
if (m_xAllParams->n_children() > 1)
- {
- m_xOKBtn->set_has_default(false);
- m_xTravelNext->set_has_default(true);
- }
+ m_xDialog->change_default_widget(m_xOKBtn.get(), m_xTravelNext.get());
}
m_xParam->grab_focus();
@@ -279,7 +273,7 @@ namespace dbaui
return true;
}
- m_aFinalValues[m_nCurrentlySelected].Value <<= m_xParam->get_text();
+ m_aFinalValues.getArray()[m_nCurrentlySelected].Value <<= m_xParam->get_text();
}
// initialize the controls with the new values
@@ -321,8 +315,7 @@ namespace dbaui
if (!bVisited)
{
// yes, there isn't another one -> change the "default button"
- m_xTravelNext->set_has_default(false);
- m_xOKBtn->set_has_default(true);
+ m_xDialog->change_default_widget(m_xTravelNext.get(), m_xOKBtn.get());
}
}
diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx
index 1b75869cf15e..84f2c774c6e2 100644
--- a/dbaccess/source/ui/dlg/queryfilter.cxx
+++ b/dbaccess/source/ui/dlg/queryfilter.cxx
@@ -25,18 +25,15 @@
#include <com/sun/star/sdb/SQLFilterOperator.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
#include <comphelper/string.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <connectivity/dbtools.hxx>
#include <strings.hxx>
#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
using namespace dbaui;
-using namespace connectivity;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::util;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
@@ -180,9 +177,6 @@ DlgFilterCrit::~DlgFilterCrit()
{
}
-#define LbText(x) ((x).get_active_text())
-#define LbPos(x) ((x).get_active())
-
sal_Int32 DlgFilterCrit::GetOSQLPredicateType( std::u16string_view _rSelectedPredicate ) const
{
sal_Int32 nPredicateIndex = -1;
@@ -298,16 +292,16 @@ bool DlgFilterCrit::getCondition(const weld::ComboBox& _rField,const weld::Combo
{
// properly quote all parts of the table name, so
// e.g. <schema>.<table> becomes "<schema>"."<table>"
- OUString aCatlog,aSchema,aTable;
- ::dbtools::qualifiedNameComponents( m_xMetaData, sTableName, aCatlog, aSchema, aTable, ::dbtools::EComposeRule::InDataManipulation );
- sTableName = ::dbtools::composeTableName( m_xMetaData, aCatlog, aSchema, aTable, true, ::dbtools::EComposeRule::InDataManipulation );
+ OUString aCatalog,aSchema,aTable;
+ ::dbtools::qualifiedNameComponents( m_xMetaData, sTableName, aCatalog, aSchema, aTable, ::dbtools::EComposeRule::InDataManipulation );
+ sTableName = ::dbtools::composeTableName( m_xMetaData, aCatalog, aSchema, aTable, true, ::dbtools::EComposeRule::InDataManipulation );
}
}
xColumn->getPropertyValue(PROPERTY_REALNAME) >>= _rFilter.Name;
- static constexpr OUStringLiteral sAgg = u"AggregateFunction";
+ static constexpr OUString sAgg = u"AggregateFunction"_ustr;
if ( xInfo->hasPropertyByName(sAgg) )
xColumn->getPropertyValue(sAgg) >>= bHaving;
- static constexpr OUStringLiteral sFunction = u"Function";
+ static constexpr OUString sFunction = u"Function"_ustr;
if ( xInfo->hasPropertyByName(sFunction) )
xColumn->getPropertyValue(sFunction) >>= bFunction;
}
@@ -512,7 +506,7 @@ void DlgFilterCrit::SelectField(weld::ComboBox& rBox, std::u16string_view rField
void DlgFilterCrit::EnableLines()
{
// enabling/disabling of whole lines
- if( LbPos(*m_xLB_WHEREFIELD1) == 0 )
+ if( m_xLB_WHEREFIELD1->get_active() == 0 )
{
m_xLB_WHEREFIELD2->set_sensitive(false);
m_xLB_WHERECOND2->set_sensitive(false);
@@ -537,7 +531,7 @@ void DlgFilterCrit::EnableLines()
m_xET_WHEREVALUE3->set_sensitive(true);
}
- if( LbPos(*m_xLB_WHEREFIELD2) == 0 )
+ if( m_xLB_WHEREFIELD2->get_active() == 0 )
{
m_xLB_WHEREFIELD3->set_sensitive(false);
m_xLB_WHERECOND3->set_sensitive(false);
@@ -553,7 +547,7 @@ void DlgFilterCrit::EnableLines()
}
// comparison field equal to NOENTRY
- if( LbPos(*m_xLB_WHEREFIELD1) == 0 )
+ if( m_xLB_WHEREFIELD1->get_active() == 0 )
{
m_xLB_WHERECOMP1->set_sensitive(false);
m_xET_WHEREVALUE1->set_sensitive(false);
@@ -565,7 +559,7 @@ void DlgFilterCrit::EnableLines()
m_xET_WHEREVALUE1->set_sensitive(true);
}
- if( LbPos(*m_xLB_WHEREFIELD2) == 0 )
+ if( m_xLB_WHEREFIELD2->get_active() == 0 )
{
m_xLB_WHERECOND2->set_sensitive(false);
m_xLB_WHERECOMP2->set_sensitive(false);
@@ -579,7 +573,7 @@ void DlgFilterCrit::EnableLines()
m_xET_WHEREVALUE2->set_sensitive(true);
}
- if( LbPos(*m_xLB_WHEREFIELD3) == 0 )
+ if( m_xLB_WHEREFIELD3->get_active() == 0 )
{
m_xLB_WHERECOND3->set_sensitive(false);
m_xLB_WHERECOMP3->set_sensitive(false);
@@ -596,18 +590,18 @@ void DlgFilterCrit::EnableLines()
// comparison operator equal to ISNULL or ISNOTNULL
if(m_xLB_WHERECOMP1->get_count() > 2 &&
- ((LbPos(*m_xLB_WHERECOMP1) == m_xLB_WHERECOMP1->get_count()-1) ||
- (LbPos(*m_xLB_WHERECOMP1) == m_xLB_WHERECOMP1->get_count()-2)) )
+ ((m_xLB_WHERECOMP1->get_active() == m_xLB_WHERECOMP1->get_count()-1) ||
+ (m_xLB_WHERECOMP1->get_active() == m_xLB_WHERECOMP1->get_count()-2)) )
m_xET_WHEREVALUE1->set_sensitive(false);
if(m_xLB_WHERECOMP2->get_count() > 2 &&
- ((LbPos(*m_xLB_WHERECOMP2) == m_xLB_WHERECOMP2->get_count()-1) ||
- (LbPos(*m_xLB_WHERECOMP2) == m_xLB_WHERECOMP2->get_count()-2)) )
+ ((m_xLB_WHERECOMP2->get_active() == m_xLB_WHERECOMP2->get_count()-1) ||
+ (m_xLB_WHERECOMP2->get_active() == m_xLB_WHERECOMP2->get_count()-2)) )
m_xET_WHEREVALUE2->set_sensitive(false);
if(m_xLB_WHERECOMP3->get_count() > 2 &&
- ((LbPos(*m_xLB_WHERECOMP3) == m_xLB_WHERECOMP3->get_count()-1) ||
- (LbPos(*m_xLB_WHERECOMP3) == m_xLB_WHERECOMP3->get_count()-2)) )
+ ((m_xLB_WHERECOMP3->get_active() == m_xLB_WHERECOMP3->get_count()-1) ||
+ (m_xLB_WHERECOMP3->get_active() == m_xLB_WHERECOMP3->get_count()-2)) )
m_xET_WHEREVALUE3->set_sensitive(false);
}
@@ -617,17 +611,17 @@ IMPL_LINK( DlgFilterCrit, ListSelectHdl, weld::ComboBox&, rListBox, void )
weld::ComboBox* pComp;
if(&rListBox == m_xLB_WHEREFIELD1.get())
{
- aName = LbText(*m_xLB_WHEREFIELD1);
+ aName = m_xLB_WHEREFIELD1->get_active_text();
pComp = m_xLB_WHERECOMP1.get();
}
else if(&rListBox == m_xLB_WHEREFIELD2.get())
{
- aName = LbText(*m_xLB_WHEREFIELD2);
+ aName = m_xLB_WHEREFIELD2->get_active_text();
pComp = m_xLB_WHERECOMP2.get();
}
else
{
- aName = LbText(*m_xLB_WHEREFIELD3);
+ aName = m_xLB_WHEREFIELD3->get_active_text();
pComp = m_xLB_WHERECOMP3.get();
}
@@ -675,71 +669,49 @@ IMPL_LINK_NOARG(DlgFilterCrit, ListSelectCompHdl, weld::ComboBox&, void)
void DlgFilterCrit::BuildWherePart()
{
- Sequence<Sequence<PropertyValue> > aFilter,aHaving;
- aFilter.realloc(1);
- aHaving.realloc(1);
+ Sequence<Sequence<PropertyValue> > aFilter(1),aHaving(1);
- if( LbPos(*m_xLB_WHEREFIELD1) != 0 )
+ if( m_xLB_WHEREFIELD1->get_active() != 0 )
{
PropertyValue aValue;
if ( getCondition(*m_xLB_WHEREFIELD1,*m_xLB_WHERECOMP1,*m_xET_WHEREVALUE1,aValue) )
{
- aHaving[0].realloc(1);
- aHaving[0][0] = aValue;
+ aHaving = { { aValue } };
}
else
{
- aFilter[0].realloc(1);
- aFilter[0][0] = aValue;
+ aFilter = { { aValue} };
}
}
- if( LbPos(*m_xLB_WHEREFIELD2) != 0 )
+ if( m_xLB_WHEREFIELD2->get_active() != 0 )
{
PropertyValue aValue;
Sequence<Sequence<PropertyValue> >& _rValues = aFilter;
if ( getCondition(*m_xLB_WHEREFIELD2,*m_xLB_WHERECOMP2,*m_xET_WHEREVALUE2,aValue) )
_rValues = aHaving;
- PropertyValue* pPos = nullptr;
if ( m_xLB_WHERECOND2->get_active() )
- {
- sal_Int32 nPos = _rValues.getLength();
- _rValues.realloc( nPos + 1);
- _rValues[nPos].realloc( 1);
- pPos = &_rValues[nPos][0];
- }
- else
- {
- sal_Int32 nPos = _rValues.getLength() - 1;
- sal_Int32 nAndPos = _rValues[nPos].getLength();
- _rValues[nPos].realloc( _rValues[nPos].getLength() + 1);
- pPos = &_rValues[nPos][nAndPos];
- }
- *pPos = aValue;
+ _rValues.realloc( _rValues.getLength() + 1);
+ sal_Int32 nPos = _rValues.getLength() - 1;
+ sal_Int32 nAndPos = _rValues[nPos].getLength();
+ auto pValues = _rValues.getArray();
+ pValues[nPos].realloc( _rValues[nPos].getLength() + 1);
+ pValues[nPos].getArray()[nAndPos] = aValue;
}
- if( LbPos(*m_xLB_WHEREFIELD3) != 0 )
+ if( m_xLB_WHEREFIELD3->get_active() != 0 )
{
PropertyValue aValue;
Sequence<Sequence<PropertyValue> >& _rValues = aFilter;
if ( getCondition(*m_xLB_WHEREFIELD3,*m_xLB_WHERECOMP3,*m_xET_WHEREVALUE3,aValue) )
_rValues = aHaving;
- PropertyValue* pPos = nullptr;
if (m_xLB_WHERECOND3->get_active())
- {
- sal_Int32 nPos = _rValues.getLength();
- _rValues.realloc( nPos + 1);
- _rValues[nPos].realloc( 1);
- pPos = &_rValues[nPos][0];
- }
- else
- {
- sal_Int32 nPos = _rValues.getLength() - 1;
- sal_Int32 nAndPos = _rValues[nPos].getLength();
- _rValues[nPos].realloc( _rValues[nPos].getLength() + 1);
- pPos = &_rValues[nPos][nAndPos];
- }
- *pPos = aValue;
+ _rValues.realloc( _rValues.getLength() + 1);
+ sal_Int32 nPos = _rValues.getLength() - 1;
+ sal_Int32 nAndPos = _rValues[nPos].getLength();
+ auto pValues = _rValues.getArray();
+ pValues[nPos].realloc( _rValues[nPos].getLength() + 1);
+ pValues[nPos].getArray()[nAndPos] = aValue;
}
try
{
diff --git a/dbaccess/source/ui/dlg/queryorder.cxx b/dbaccess/source/ui/dlg/queryorder.cxx
index 40b25cdd3d54..5799fff7d68c 100644
--- a/dbaccess/source/ui/dlg/queryorder.cxx
+++ b/dbaccess/source/ui/dlg/queryorder.cxx
@@ -27,16 +27,13 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <connectivity/dbtools.hxx>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace dbaui;
-using namespace connectivity;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::util;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::beans;
@@ -126,8 +123,8 @@ void DlgOrderCrit::impl_initializeOrderList_nothrow()
{
try
{
- static const OUStringLiteral sNameProperty = u"Name";
- static const OUStringLiteral sAscendingProperty = u"IsAscending";
+ static constexpr OUStringLiteral sNameProperty = u"Name";
+ static constexpr OUStringLiteral sAscendingProperty = u"IsAscending";
Reference< XIndexAccess > xOrderColumns( m_xQueryComposer->getOrderColumns(), UNO_SET_THROW );
sal_Int32 nColumns = xOrderColumns->getCount();
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx
index 42024d9cf078..e5cd612c282c 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.cxx
+++ b/dbaccess/source/ui/dlg/sqlmessage.cxx
@@ -22,6 +22,7 @@
#include <strings.hrc>
#include <com/sun/star/sdbc/SQLException.hpp>
#include <com/sun/star/sdb/SQLContext.hpp>
+#include <utility>
#include <vcl/stdtext.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
@@ -50,8 +51,8 @@ namespace
OUString m_defaultImageID;
public:
- explicit ImageProvider(const OUString& defaultImageID)
- : m_defaultImageID(defaultImageID)
+ explicit ImageProvider(OUString defaultImageID)
+ : m_defaultImageID(std::move(defaultImageID))
{
}
@@ -66,7 +67,7 @@ namespace
private:
OUString m_label;
public:
- explicit LabelProvider(const char* labelResourceID)
+ explicit LabelProvider(TranslateId labelResourceID)
: m_label(DBA_RES(labelResourceID))
{
}
@@ -121,7 +122,7 @@ namespace
std::shared_ptr< LabelProvider > const & getLabelProvider( SQLExceptionInfo::TYPE _eType, bool _bSubLabel ) const
{
std::shared_ptr< LabelProvider >* ppProvider( &m_pErrorLabel );
- const char* pLabelID( STR_EXCEPTION_ERROR );
+ TranslateId pLabelID( STR_EXCEPTION_ERROR );
switch ( _eType )
{
@@ -266,7 +267,7 @@ class OExceptionChainDialog : public weld::GenericDialogController
ExceptionDisplayChain m_aExceptions;
public:
- OExceptionChainDialog(weld::Window* pParent, const ExceptionDisplayChain& rExceptions);
+ OExceptionChainDialog(weld::Window* pParent, ExceptionDisplayChain&& rExceptions);
protected:
DECL_LINK(OnExceptionSelected, weld::TreeView&, void);
@@ -274,11 +275,11 @@ protected:
}
-OExceptionChainDialog::OExceptionChainDialog(weld::Window* pParent, const ExceptionDisplayChain& rExceptions)
+OExceptionChainDialog::OExceptionChainDialog(weld::Window* pParent, ExceptionDisplayChain&& rExceptions)
: GenericDialogController(pParent, "dbaccess/ui/sqlexception.ui", "SQLExceptionDialog")
, m_xExceptionList(m_xBuilder->weld_tree_view("list"))
, m_xExceptionText(m_xBuilder->weld_text_view("description"))
- , m_aExceptions(rExceptions)
+ , m_aExceptions(std::move(rExceptions))
{
int nListWidth = m_xExceptionText->get_approximate_digit_width() * 28;
int nTextWidth = m_xExceptionText->get_approximate_digit_width() * 42;
@@ -481,7 +482,7 @@ void OSQLMessageBox::impl_createStandardButtons( MessBoxStyle _nStyle )
else
aTmp = m_sHelpURL;
- m_xDialog->set_help_id(OUStringToOString(aTmp, RTL_TEXTENCODING_UTF8));
+ m_xDialog->set_help_id(aTmp);
}
void OSQLMessageBox::impl_addDetailsButton()
@@ -555,20 +556,19 @@ void OSQLMessageBox::Construct(weld::Window* pParent, MessBoxStyle _nStyle, Mess
impl_addDetailsButton();
}
-OSQLMessageBox::OSQLMessageBox(weld::Window* pParent, const SQLExceptionInfo& rException, MessBoxStyle nStyle, const OUString& rHelpURL)
+OSQLMessageBox::OSQLMessageBox(weld::Window* pParent, const SQLExceptionInfo& rException, MessBoxStyle nStyle, OUString sHelpURL)
: m_pImpl(new SQLMessageBox_Impl(rException))
- , m_sHelpURL(rHelpURL)
+ , m_sHelpURL(std::move(sHelpURL))
{
Construct(pParent, nStyle, AUTO);
}
OSQLMessageBox::OSQLMessageBox(weld::Window* pParent, const OUString& rTitle, const OUString& rMessage, MessBoxStyle nStyle, MessageType eType, const ::dbtools::SQLExceptionInfo* pAdditionalErrorInfo )
{
- SQLContext aError;
- aError.Message = rTitle;
- aError.Details = rMessage;
+ css::uno::Any next;
if (pAdditionalErrorInfo)
- aError.NextException = pAdditionalErrorInfo->get();
+ next = pAdditionalErrorInfo->get();
+ SQLContext aError(rTitle, {}, {}, 0, next, rMessage);
m_pImpl.reset(new SQLMessageBox_Impl(SQLExceptionInfo(aError)));
@@ -581,7 +581,7 @@ OSQLMessageBox::~OSQLMessageBox()
IMPL_LINK_NOARG(OSQLMessageBox, ButtonClickHdl, weld::Button&, void)
{
- OExceptionChainDialog aDlg(m_xDialog.get(), m_pImpl->aDisplayInfo);
+ OExceptionChainDialog aDlg(m_xDialog.get(), std::vector(m_pImpl->aDisplayInfo));
aDlg.run();
}
diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index 91456123ec58..5b956558d15f 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -32,7 +32,7 @@
#include <UITools.hxx>
#include <osl/diagnose.h>
#include <TablesSingleDlg.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <cppuhelper/exc_hlp.hxx>
namespace dbaui
@@ -40,11 +40,8 @@ namespace dbaui
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::sdbcx;
- using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::container;
using namespace ::com::sun::star::util;
using namespace ::dbtools;
using namespace ::comphelper;
@@ -205,9 +202,9 @@ namespace dbaui
bool bModified = ( xModi.is() && xModi->isModified() );
Sequence< OUString > aNewTableFilter { "%" };
- xProp->setPropertyValue(PROPERTY_TABLEFILTER,makeAny(aNewTableFilter));
+ xProp->setPropertyValue(PROPERTY_TABLEFILTER,Any(aNewTableFilter));
- xProp->setPropertyValue( PROPERTY_TABLETYPEFILTER, makeAny( Sequence< OUString >() ) );
+ xProp->setPropertyValue( PROPERTY_TABLETYPEFILTER, Any( Sequence< OUString >() ) );
Reference< css::lang::XEventListener> xEvt;
aErrorInfo = ::dbaui::createConnection(xProp, m_xORB, xEvt, m_xCurrentConnection);
@@ -335,7 +332,7 @@ namespace dbaui
Sequence< OUString > OTableSubscriptionPage::collectDetailedSelection() const
{
Sequence< OUString > aTableFilter;
- constexpr OUStringLiteral sWildcard = u"%";
+ constexpr OUString sWildcard = u"%"_ustr;
std::unique_ptr<weld::TreeIter> xAllObjectsEntry(m_xTablesList->getAllObjectsEntry());
if (!xAllObjectsEntry)
@@ -412,7 +409,7 @@ namespace dbaui
sal_Int32 nOldLen = aTableFilter.getLength();
aTableFilter.realloc(nOldLen + 1);
// add the new name
- aTableFilter[nOldLen] = sComposedName.makeStringAndClear();
+ aTableFilter.getArray()[nOldLen] = sComposedName.makeStringAndClear();
}
if (bCatalogWildcard)
@@ -463,8 +460,7 @@ namespace dbaui
auto xRoot = m_xTablesList->getAllObjectsEntry();
if (xRoot && m_xTablesList->isWildcardChecked(*xRoot))
{
- aTableFilter.realloc(1);
- aTableFilter[0] = "%";
+ aTableFilter = { "%" };
}
else
{
diff --git a/dbaccess/source/ui/inc/AppElementType.hxx b/dbaccess/source/ui/inc/AppElementType.hxx
index 59105cf225f7..b7265e5af663 100644
--- a/dbaccess/source/ui/inc/AppElementType.hxx
+++ b/dbaccess/source/ui/inc/AppElementType.hxx
@@ -34,18 +34,18 @@ namespace dbaui
E_ELEMENT_TYPE_COUNT = E_NONE
};
- enum PreviewMode
+ enum class PreviewMode
{
- E_PREVIEWNONE = 0,
- E_DOCUMENT = 1,
- E_DOCUMENTINFO = 2
+ NONE = 0,
+ Document = 1,
+ DocumentInfo = 2
};
- enum ElementOpenMode
+ enum class ElementOpenMode
{
- E_OPEN_NORMAL,
- E_OPEN_DESIGN,
- E_OPEN_FOR_MAIL
+ Normal,
+ Design,
+ Mail
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/inc/ChildWindow.hxx b/dbaccess/source/ui/inc/ChildWindow.hxx
index 8da6c8570dea..c2f68ac46f78 100644
--- a/dbaccess/source/ui/inc/ChildWindow.hxx
+++ b/dbaccess/source/ui/inc/ChildWindow.hxx
@@ -16,7 +16,7 @@ namespace dbaui
class OChildWindow
{
protected:
- OChildWindow(weld::Container* pParent, const OUString& rUIXMLDescription, const OString& rID);
+ OChildWindow(weld::Container* pParent, const OUString& rUIXMLDescription, const OUString& rID);
std::unique_ptr<weld::Builder> m_xBuilder;
std::unique_ptr<weld::Container> m_xContainer;
@@ -29,7 +29,7 @@ public:
void Enable(bool bEnable) { m_xContainer->set_sensitive(bEnable); }
- void SetHelpId(const OString& rHelpId) { m_xContainer->set_help_id(rHelpId); }
+ void SetHelpId(const OUString& rHelpId) { m_xContainer->set_help_id(rHelpId); }
void Show() { m_xContainer->show(); }
};
diff --git a/dbaccess/source/ui/inc/CollectionView.hxx b/dbaccess/source/ui/inc/CollectionView.hxx
index c80e98f5e858..c49a5fd4fc14 100644
--- a/dbaccess/source/ui/inc/CollectionView.hxx
+++ b/dbaccess/source/ui/inc/CollectionView.hxx
@@ -55,7 +55,7 @@ namespace dbaui
OCollectionView(weld::Window * pParent,
const css::uno::Reference< css::ucb::XContent>& _xContent,
const OUString& _sDefaultName,
- const css::uno::Reference< css::uno::XComponentContext >& _rxContext);
+ css::uno::Reference< css::uno::XComponentContext > _xContext);
virtual ~OCollectionView() override;
const css::uno::Reference< css::ucb::XContent>& getSelectedFolder() const { return m_xContent;}
OUString getName() const;
diff --git a/dbaccess/source/ui/inc/ConnectionLine.hxx b/dbaccess/source/ui/inc/ConnectionLine.hxx
index 954c7e02d3a3..360395f94b6e 100644
--- a/dbaccess/source/ui/inc/ConnectionLine.hxx
+++ b/dbaccess/source/ui/inc/ConnectionLine.hxx
@@ -45,7 +45,7 @@ namespace dbaui
Point m_aSourceDescrLinePos,
m_aDestDescrLinePos;
public:
- OConnectionLine( OTableConnection* pConn, OConnectionLineDataRef const & pLineData );
+ OConnectionLine( OTableConnection* pConn, OConnectionLineDataRef pLineData );
OConnectionLine( const OConnectionLine& rLine );
~OConnectionLine();
diff --git a/dbaccess/source/ui/inc/ConnectionLineAccess.hxx b/dbaccess/source/ui/inc/ConnectionLineAccess.hxx
index 1652b8b0b53c..5e14186b0765 100644
--- a/dbaccess/source/ui/inc/ConnectionLineAccess.hxx
+++ b/dbaccess/source/ui/inc/ConnectionLineAccess.hxx
@@ -20,21 +20,20 @@
#include "TableConnection.hxx"
#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
-#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase.hxx>
#include <toolkit/awt/vclxaccessiblecomponent.hxx>
#include <vcl/vclptr.hxx>
namespace dbaui
{
- typedef ::cppu::ImplHelper2< css::accessibility::XAccessibleRelationSet,
- css::accessibility::XAccessible
- > OConnectionLineAccess_BASE;
class OTableConnection;
/** the class OConnectionLineAccess represents the accessible object for the connection between two table windows
like they are used in the QueryDesign and the RelationDesign
*/
- class OConnectionLineAccess : public VCLXAccessibleComponent
- , public OConnectionLineAccess_BASE
+ class OConnectionLineAccess : public cppu::ImplInheritanceHelper<
+ VCLXAccessibleComponent,
+ css::accessibility::XAccessibleRelationSet,
+ css::accessibility::XAccessible>
{
VclPtr<const OTableConnection> m_pLine; // the window which I should give accessibility to
protected:
@@ -45,20 +44,6 @@ namespace dbaui
public:
OConnectionLineAccess(OTableConnection* _pLine);
- // XInterface
- virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
- virtual void SAL_CALL acquire( ) noexcept override
- { // here inline is allowed because we do not use this class outside this dll
- VCLXAccessibleComponent::acquire( );
- }
- virtual void SAL_CALL release( ) noexcept override
- { // here inline is allowed because we do not use this class outside this dll
- VCLXAccessibleComponent::release( );
- }
-
- // XTypeProvider
- virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
-
// XServiceInfo
virtual OUString SAL_CALL getImplementationName() override;
@@ -66,9 +51,9 @@ namespace dbaui
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
// XAccessibleContext
- virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override;
- virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override;
- virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) override;
+ virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
+ virtual sal_Int64 SAL_CALL getAccessibleIndexInParent( ) override;
virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
virtual OUString SAL_CALL getAccessibleDescription( ) override;
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
diff --git a/dbaccess/source/ui/inc/ConnectionLineData.hxx b/dbaccess/source/ui/inc/ConnectionLineData.hxx
index 10ad0bfddfd9..2a41c93d9aab 100644
--- a/dbaccess/source/ui/inc/ConnectionLineData.hxx
+++ b/dbaccess/source/ui/inc/ConnectionLineData.hxx
@@ -48,7 +48,7 @@ namespace dbaui
virtual ~OConnectionLineData() override;
public:
OConnectionLineData();
- OConnectionLineData( const OUString& rSourceFieldName, const OUString& rDestFieldName );
+ OConnectionLineData( OUString sSourceFieldName, OUString sDestFieldName );
OConnectionLineData( const OConnectionLineData& rConnLineData );
// provide a copy of own instance (this is somehow more acceptable for me compared to a virtual assignment operator
void CopyFrom(const OConnectionLineData& rSource);
diff --git a/dbaccess/source/ui/inc/DExport.hxx b/dbaccess/source/ui/inc/DExport.hxx
index 3e2804a654e0..a79999647077 100644
--- a/dbaccess/source/ui/inc/DExport.hxx
+++ b/dbaccess/source/ui/inc/DExport.hxx
@@ -137,7 +137,7 @@ namespace dbaui
// required for automatic type recognition
ODatabaseExport(
sal_Int32 nRows,
- const TPositions& _rColumnPositions,
+ TPositions&& _rColumnPositions,
const css::uno::Reference< css::util::XNumberFormatter >& _rxNumberF,
const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
const TColumnVector* rList,
@@ -153,7 +153,7 @@ namespace dbaui
void enableCheckOnly() { m_bCheckOnly = true; }
bool isCheckEnabled() const { return m_bCheckOnly; }
- static css::uno::Reference< css::sdbc::XPreparedStatement > createPreparedStatment( const css::uno::Reference< css::sdbc::XDatabaseMetaData>& _xMetaData
+ static css::uno::Reference< css::sdbc::XPreparedStatement > createPreparedStatement( const css::uno::Reference< css::sdbc::XDatabaseMetaData>& _xMetaData
,const css::uno::Reference< css::beans::XPropertySet>& _xDestTable
,const TPositions& _rvColumnPositions);
};
diff --git a/dbaccess/source/ui/inc/FieldControls.hxx b/dbaccess/source/ui/inc/FieldControls.hxx
index d0fca32a61b8..7eb88ec4e077 100644
--- a/dbaccess/source/ui/inc/FieldControls.hxx
+++ b/dbaccess/source/ui/inc/FieldControls.hxx
@@ -19,6 +19,7 @@
#pragma once
#include "SqlNameEdit.hxx"
+#include <unotools/resmgr.hxx>
namespace dbaui
{
@@ -28,7 +29,7 @@ namespace dbaui
short m_nPos;
OUString m_strHelpText;
public:
- OPropColumnEditCtrl(std::unique_ptr<weld::Entry> xEntry, OUString const & _rAllowedChars, const char* pHelpId, short nPosition);
+ OPropColumnEditCtrl(std::unique_ptr<weld::Entry> xEntry, OUString const & _rAllowedChars, TranslateId pHelpId, short nPosition);
short GetPos() const { return m_nPos; }
const OUString& GetHelp() const { return m_strHelpText; }
@@ -41,7 +42,7 @@ namespace dbaui
OUString m_strHelpText;
public:
- OPropEditCtrl(std::unique_ptr<weld::Entry> xEntry, const char* pHelpId, short nPosition);
+ OPropEditCtrl(std::unique_ptr<weld::Entry> xEntry, TranslateId pHelpId, short nPosition);
void set_text(const OUString& rText) { m_xEntry->set_text(rText); }
OUString get_text() const { return m_xEntry->get_text(); }
@@ -61,7 +62,7 @@ namespace dbaui
OUString m_strHelpText;
public:
- OPropNumericEditCtrl(std::unique_ptr<weld::SpinButton> xSpinButton, const char* pHelpId, short nPosition);
+ OPropNumericEditCtrl(std::unique_ptr<weld::SpinButton> xSpinButton, TranslateId pHelpId, short nPosition);
void set_text(const OUString& rText) { m_xSpinButton->set_text(rText); }
OUString get_text() const { return m_xSpinButton->get_text(); }
@@ -87,7 +88,7 @@ namespace dbaui
OUString m_strHelpText;
public:
- OPropListBoxCtrl(std::unique_ptr<weld::ComboBox> xComboBox, const char* pHelpId, short nPosition);
+ OPropListBoxCtrl(std::unique_ptr<weld::ComboBox> xComboBox, TranslateId pHelpId, short nPosition);
virtual ~OPropListBoxCtrl() override
{
m_xComboBox->clear();
diff --git a/dbaccess/source/ui/inc/FieldDescControl.hxx b/dbaccess/source/ui/inc/FieldDescControl.hxx
index 8288ae3155e9..410e086116fe 100644
--- a/dbaccess/source/ui/inc/FieldDescControl.hxx
+++ b/dbaccess/source/ui/inc/FieldDescControl.hxx
@@ -24,6 +24,7 @@
#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
#include <com/sun/star/util/XNumberFormatter.hpp>
#include "TypeInfo.hxx"
+#include <unotools/resmgr.hxx>
// field description columns of a table
#define FIELD_NAME 1
@@ -116,9 +117,9 @@ namespace dbaui
void UpdateFormatSample(OFieldDescription const * pFieldDescr);
bool isTextFormat(const OFieldDescription* _pFieldDescr,sal_uInt32& _nFormatKey) const;
- std::unique_ptr<OPropNumericEditCtrl> CreateNumericControl(const OString& rId, const char* pHelpId, short _nProperty, const OString& _sHelpId);
- void InitializeControl(weld::Widget* _pControl,const OString& _sHelpId);
- void InitializeControl(OPropListBoxCtrl* _pControl,const OString& _sHelpId,bool _bAddChangeHandler);
+ std::unique_ptr<OPropNumericEditCtrl> CreateNumericControl(const OUString& rId, TranslateId pHelpId, short _nProperty, const OUString& _sHelpId);
+ void InitializeControl(weld::Widget* _pControl,const OUString& _sHelpId);
+ void InitializeControl(OPropListBoxCtrl* _pControl,const OUString& _sHelpId,bool _bAddChangeHandler);
bool IsFocusInEditableWidget() const;
@@ -164,7 +165,7 @@ namespace dbaui
void SetReadOnly( bool bReadOnly );
void Enable(bool bEnable) { m_xContainer->set_sensitive(bEnable); }
- void SetHelpId(const OString& rId) { m_xContainer->set_help_id(rId); }
+ void SetHelpId(const OUString& rId) { m_xContainer->set_help_id(rId); }
virtual bool isCutAllowed() override;
virtual bool isCopyAllowed() override;
diff --git a/dbaccess/source/ui/inc/GeneralUndo.hxx b/dbaccess/source/ui/inc/GeneralUndo.hxx
index e99ff2c4f330..1bbb593e333d 100644
--- a/dbaccess/source/ui/inc/GeneralUndo.hxx
+++ b/dbaccess/source/ui/inc/GeneralUndo.hxx
@@ -31,7 +31,7 @@ namespace dbaui
OUString m_strComment; // undo, redo comment
public:
- OCommentUndoAction(const char* pCommentID) { m_strComment = DBA_RES(pCommentID); }
+ OCommentUndoAction(TranslateId pCommentID) { m_strComment = DBA_RES(pCommentID); }
virtual OUString GetComment() const override { return m_strComment; }
};
diff --git a/dbaccess/source/ui/inc/HtmlReader.hxx b/dbaccess/source/ui/inc/HtmlReader.hxx
index 3c1fa88d2d60..5c4ddde13f4e 100644
--- a/dbaccess/source/ui/inc/HtmlReader.hxx
+++ b/dbaccess/source/ui/inc/HtmlReader.hxx
@@ -54,7 +54,7 @@ namespace dbaui
// required for automatic type recognition
OHTMLReader(SvStream& rIn,
sal_Int32 nRows,
- const TPositions &_rColumnPositions,
+ TPositions&& _rColumnPositions,
const css::uno::Reference< css::util::XNumberFormatter >& _rxNumberF,
const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
const TColumnVector* rList,
diff --git a/dbaccess/source/ui/inc/JAccess.hxx b/dbaccess/source/ui/inc/JAccess.hxx
index 3a630faa2bca..6d0d52ec0233 100644
--- a/dbaccess/source/ui/inc/JAccess.hxx
+++ b/dbaccess/source/ui/inc/JAccess.hxx
@@ -20,18 +20,16 @@
#include "JoinTableView.hxx"
#include <toolkit/awt/vclxaccessiblecomponent.hxx>
-#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase.hxx>
#include <vcl/vclptr.hxx>
namespace dbaui
{
class OJoinTableView;
- typedef ::cppu::ImplHelper1< css::accessibility::XAccessible
- > OJoinDesignViewAccess_BASE;
/** the class OJoinDesignViewAccess represents the accessible object for join views
like the QueryDesign and the RelationDesign
*/
- class OJoinDesignViewAccess : public VCLXAccessibleComponent, public OJoinDesignViewAccess_BASE
+ class OJoinDesignViewAccess : public cppu::ImplInheritanceHelper<VCLXAccessibleComponent, css::accessibility::XAccessible>
{
VclPtr<OJoinTableView> m_pTableView; // the window which I should give accessibility to
@@ -40,18 +38,14 @@ namespace dbaui
*/
OJoinDesignViewAccess( OJoinTableView* _pTableView);
- // XInterface
- DECLARE_XINTERFACE( )
- DECLARE_XTYPEPROVIDER( )
-
virtual OUString SAL_CALL getImplementationName() override;
// XAccessible
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
// XAccessibleContext
- virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override;
- virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override;
+ virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
void notifyAccessibleEvent(
diff --git a/dbaccess/source/ui/inc/JoinExchange.hxx b/dbaccess/source/ui/inc/JoinExchange.hxx
index 73f9ea884540..7401ec886e44 100644
--- a/dbaccess/source/ui/inc/JoinExchange.hxx
+++ b/dbaccess/source/ui/inc/JoinExchange.hxx
@@ -47,7 +47,7 @@ namespace dbaui
virtual void SAL_CALL release( ) noexcept override;
// XUnoTunnel
- static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
+ static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& _rIdentifier ) override;
static OJoinExchangeData GetSourceDescription(const css::uno::Reference< css::datatransfer::XTransferable >& _rxObject);
diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx
index 80de958ea627..9e2e2bf57e25 100644
--- a/dbaccess/source/ui/inc/JoinTableView.hxx
+++ b/dbaccess/source/ui/inc/JoinTableView.hxx
@@ -18,10 +18,10 @@
*/
#pragma once
+#include <svtools/scrolladaptor.hxx>
#include <vcl/window.hxx>
#include <vcl/timer.hxx>
#include <vcl/idle.hxx>
-#include <vcl/scrbar.hxx>
#include <vcl/vclptr.hxx>
#include <vcl/transfer.hxx>
@@ -50,9 +50,8 @@ namespace dbaui
class OJoinTableView;
class OScrollWindowHelper : public vcl::Window
{
- VclPtr<ScrollBar> m_aHScrollBar;
- VclPtr<ScrollBar> m_aVScrollBar;
- VclPtr<vcl::Window> m_pCornerWindow;
+ VclPtr<ScrollAdaptor> m_aHScrollBar;
+ VclPtr<ScrollAdaptor> m_aVScrollBar;
VclPtr<OJoinTableView> m_pTableView;
protected:
@@ -68,8 +67,8 @@ namespace dbaui
void resetRange(const Point& _aSize);
// own methods
- ScrollBar& GetHScrollBar() { return *m_aHScrollBar; }
- ScrollBar& GetVScrollBar() { return *m_aVScrollBar; }
+ ScrollAdaptor& GetHScrollBar() { return *m_aHScrollBar; }
+ ScrollAdaptor& GetVScrollBar() { return *m_aVScrollBar; }
};
@@ -121,9 +120,10 @@ namespace dbaui
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
// own methods
- ScrollBar& GetHScrollBar() { return static_cast<OScrollWindowHelper*>(GetParent())->GetHScrollBar(); }
- ScrollBar& GetVScrollBar() { return static_cast<OScrollWindowHelper*>(GetParent())->GetVScrollBar(); }
- DECL_LINK( ScrollHdl, ScrollBar*, void );
+ ScrollAdaptor& GetHScrollBar() { return static_cast<OScrollWindowHelper*>(GetParent())->GetHScrollBar(); }
+ ScrollAdaptor& GetVScrollBar() { return static_cast<OScrollWindowHelper*>(GetParent())->GetVScrollBar(); }
+ DECL_LINK(VertScrollHdl, weld::Scrollbar&, void);
+ DECL_LINK(HorzScrollHdl, weld::Scrollbar&, void);
void DrawConnections(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect);
void InvalidateConnections();
@@ -163,7 +163,7 @@ namespace dbaui
void addConnection(OTableConnection* _pConnection,bool _bAddData = true);
bool ScrollPane( tools::Long nDelta, bool bHoriz, bool bPaintScrollBars );
- sal_uLong GetTabWinCount() const;
+ sal_Int64 GetTabWinCount() const;
const Point& GetScrollOffset() const { return m_aScrollOffset; }
OJoinDesignView* getDesignView() const { return m_pView; }
diff --git a/dbaccess/source/ui/inc/RelationController.hxx b/dbaccess/source/ui/inc/RelationController.hxx
index a457f38b8057..d4aa52faf080 100644
--- a/dbaccess/source/ui/inc/RelationController.hxx
+++ b/dbaccess/source/ui/inc/RelationController.hxx
@@ -34,7 +34,7 @@ namespace dbaui
{
css::uno::Reference< css::container::XNameAccess > m_xTables;
std::unique_ptr<weld::WaitObject> m_xWaitObject;
- sal_uLong m_nThreadEvent;
+ sal_Int32 m_nThreadEvent;
bool m_bRelationsPossible;
protected:
// all the features which should be handled by this class
@@ -70,7 +70,7 @@ namespace dbaui
// ask the user if the design should be saved when it is modified
virtual short saveModified() override;
virtual void reset() override;
- virtual void impl_initialize() override;
+ virtual void impl_initialize(const ::comphelper::NamedValueCollection& rArguments) override;
virtual OUString getPrivateTitle( ) const override;
DECL_LINK( OnThreadFinished, void*, void );
};
diff --git a/dbaccess/source/ui/inc/RtfReader.hxx b/dbaccess/source/ui/inc/RtfReader.hxx
index 0bda00b2f5fa..58f6aa26ba2b 100644
--- a/dbaccess/source/ui/inc/RtfReader.hxx
+++ b/dbaccess/source/ui/inc/RtfReader.hxx
@@ -45,7 +45,7 @@ namespace dbaui
// required for automatic type recognition
ORTFReader( SvStream& rIn,
sal_Int32 nRows,
- const TPositions &_rColumnPositions,
+ TPositions&& _rColumnPositions,
const css::uno::Reference< css::util::XNumberFormatter >& _rxNumberF,
const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
const TColumnVector* rList,
diff --git a/dbaccess/source/ui/inc/SqlNameEdit.hxx b/dbaccess/source/ui/inc/SqlNameEdit.hxx
index 257b18ebbfdb..14d845b4b17c 100644
--- a/dbaccess/source/ui/inc/SqlNameEdit.hxx
+++ b/dbaccess/source/ui/inc/SqlNameEdit.hxx
@@ -19,6 +19,7 @@
#pragma once
#include <svtools/editbrowsebox.hxx>
+#include <utility>
#include <vcl/weld.hxx>
namespace dbaui
@@ -28,8 +29,8 @@ namespace dbaui
OUString m_sAllowedChars;
bool m_bCheck; // true when we should check for invalid chars
public:
- OSQLNameChecker(const OUString& _rAllowedChars)
- :m_sAllowedChars(_rAllowedChars)
+ OSQLNameChecker(OUString _sAllowedChars)
+ :m_sAllowedChars(std::move(_sAllowedChars))
,m_bCheck(true)
{
}
@@ -42,7 +43,7 @@ namespace dbaui
{
m_bCheck = _bCheck;
}
- bool checkString(const OUString& _sToCheck,OUString& _rsCorrected);
+ bool checkString(std::u16string_view _sToCheck,OUString& _rsCorrected);
};
class OSQLNameEditControl : public svt::EditControl
diff --git a/dbaccess/source/ui/inc/TableConnection.hxx b/dbaccess/source/ui/inc/TableConnection.hxx
index 3c6ce0fdf76c..a38aa1fe030b 100644
--- a/dbaccess/source/ui/inc/TableConnection.hxx
+++ b/dbaccess/source/ui/inc/TableConnection.hxx
@@ -47,7 +47,7 @@ namespace dbaui
void clearLineData();
public:
- OTableConnection( OJoinTableView* pContainer, const TTableConnectionData::value_type& pTabConnData );
+ OTableConnection( OJoinTableView* pContainer, TTableConnectionData::value_type aTabConnData );
OTableConnection( const OTableConnection& rConn );
/** destructor
diff --git a/dbaccess/source/ui/inc/TableConnectionData.hxx b/dbaccess/source/ui/inc/TableConnectionData.hxx
index 38de2289458f..096a6de70ad3 100644
--- a/dbaccess/source/ui/inc/TableConnectionData.hxx
+++ b/dbaccess/source/ui/inc/TableConnectionData.hxx
@@ -47,8 +47,8 @@ namespace dbaui
OTableConnectionData& operator=( const OTableConnectionData& rConnData );
public:
OTableConnectionData();
- OTableConnectionData( const TTableWindowData::value_type& _pReferencingTable,
- const TTableWindowData::value_type& _pReferencedTable );
+ OTableConnectionData( TTableWindowData::value_type _aReferencingTable,
+ TTableWindowData::value_type _aReferencedTable );
OTableConnectionData( const OTableConnectionData& rConnData );
virtual ~OTableConnectionData();
diff --git a/dbaccess/source/ui/inc/TableController.hxx b/dbaccess/source/ui/inc/TableController.hxx
index ce2017b586d1..13af9cf51c48 100644
--- a/dbaccess/source/ui/inc/TableController.hxx
+++ b/dbaccess/source/ui/inc/TableController.hxx
@@ -121,7 +121,7 @@ namespace dbaui
private:
void startTableListening();
void stopTableListening();
- virtual void impl_initialize() override;
+ virtual void impl_initialize(const ::comphelper::NamedValueCollection& rArguments) override;
};
}
diff --git a/dbaccess/source/ui/inc/TableCopyHelper.hxx b/dbaccess/source/ui/inc/TableCopyHelper.hxx
index b543dade80bb..636ca85c7752 100644
--- a/dbaccess/source/ui/inc/TableCopyHelper.hxx
+++ b/dbaccess/source/ui/inc/TableCopyHelper.hxx
@@ -72,7 +72,7 @@ namespace dbaui
OUString sDefaultTableName;
OUString aUrl;
- tools::SvRef<SotTempStream> aHtmlRtfStorage;
+ std::unique_ptr<SvStream> aHtmlRtfStorage;
ElementType nType;
std::unique_ptr<weld::TreeIter> xDroppedAt;
sal_Int8 nAction;
diff --git a/dbaccess/source/ui/inc/TableRow.hxx b/dbaccess/source/ui/inc/TableRow.hxx
index fe1852fb2032..4f34a94bf58e 100644
--- a/dbaccess/source/ui/inc/TableRow.hxx
+++ b/dbaccess/source/ui/inc/TableRow.hxx
@@ -18,7 +18,6 @@
*/
#pragma once
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <tools/long.hxx>
#include "TypeInfo.hxx"
diff --git a/dbaccess/source/ui/inc/TableRowExchange.hxx b/dbaccess/source/ui/inc/TableRowExchange.hxx
index 729862721d44..9450ab2ff827 100644
--- a/dbaccess/source/ui/inc/TableRowExchange.hxx
+++ b/dbaccess/source/ui/inc/TableRowExchange.hxx
@@ -28,11 +28,11 @@ namespace dbaui
{
std::vector< std::shared_ptr<OTableRow> > m_vTableRow;
public:
- OTableRowExchange(const std::vector< std::shared_ptr<OTableRow> >& _rvTableRow);
+ OTableRowExchange(std::vector< std::shared_ptr<OTableRow> >&& _rvTableRow);
protected:
virtual void AddSupportedFormats() override;
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
- virtual bool WriteObject( tools::SvRef<SotTempStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor ) override;
+ virtual bool WriteObject( SvStream& rOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor ) override;
virtual void ObjectReleased() override;
};
}
diff --git a/dbaccess/source/ui/inc/TableWindow.hxx b/dbaccess/source/ui/inc/TableWindow.hxx
index c3bed06c75b8..2ccf236d0c98 100644
--- a/dbaccess/source/ui/inc/TableWindow.hxx
+++ b/dbaccess/source/ui/inc/TableWindow.hxx
@@ -112,7 +112,7 @@ namespace dbaui
*/
void impl_updateImage();
- OTableWindow( vcl::Window* pParent, const TTableWindowData::value_type& pTabWinData );
+ OTableWindow( vcl::Window* pParent, TTableWindowData::value_type aTabWinData );
public:
virtual ~OTableWindow() override;
diff --git a/dbaccess/source/ui/inc/TableWindowAccess.hxx b/dbaccess/source/ui/inc/TableWindowAccess.hxx
index b51e4c80f4b8..09aa268f1e6c 100644
--- a/dbaccess/source/ui/inc/TableWindowAccess.hxx
+++ b/dbaccess/source/ui/inc/TableWindowAccess.hxx
@@ -20,25 +20,24 @@
#include "TableWindow.hxx"
#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
-#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase.hxx>
#include <toolkit/awt/vclxaccessiblecomponent.hxx>
#include <vcl/vclptr.hxx>
namespace dbaui
{
- typedef ::cppu::ImplHelper2< css::accessibility::XAccessibleRelationSet,
- css::accessibility::XAccessible
- > OTableWindowAccess_BASE;
class OTableWindow;
/** the class OTableWindowAccess represents the accessible object for table windows
like they are used in the QueryDesign and the RelationDesign
*/
- class OTableWindowAccess : public VCLXAccessibleComponent
- , public OTableWindowAccess_BASE
+ class OTableWindowAccess : public cppu::ImplInheritanceHelper<
+ VCLXAccessibleComponent,
+ css::accessibility::XAccessibleRelationSet,
+ css::accessibility::XAccessible>
{
VclPtr<OTableWindow> m_pTable; // the window which I should give accessibility to
- css::uno::Reference< css::accessibility::XAccessible > getParentChild(sal_Int32 _nIndex);
+ css::uno::Reference< css::accessibility::XAccessible > getParentChild(sal_Int64 _nIndex);
protected:
/** this function is called upon disposing the component
*/
@@ -48,20 +47,6 @@ namespace dbaui
public:
OTableWindowAccess( OTableWindow* _pTable);
- // XInterface
- virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
- virtual void SAL_CALL acquire( ) noexcept override
- { // here inline is allowed because we do not use this class outside this dll
- VCLXAccessibleComponent::acquire( );
- }
- virtual void SAL_CALL release( ) noexcept override
- { // here inline is allowed because we do not use this class outside this dll
- VCLXAccessibleComponent::release( );
- }
-
- // XTypeProvider
- virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
-
// XServiceInfo
virtual OUString SAL_CALL getImplementationName() override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
@@ -70,9 +55,9 @@ namespace dbaui
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
// XAccessibleContext
- virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override;
- virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override;
- virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) override;
+ virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
+ virtual sal_Int64 SAL_CALL getAccessibleIndexInParent( ) override;
virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
virtual OUString SAL_CALL getAccessibleName( ) override;
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
diff --git a/dbaccess/source/ui/inc/TableWindowData.hxx b/dbaccess/source/ui/inc/TableWindowData.hxx
index f7aea00b9713..0160ea723316 100644
--- a/dbaccess/source/ui/inc/TableWindowData.hxx
+++ b/dbaccess/source/ui/inc/TableWindowData.hxx
@@ -34,7 +34,7 @@ namespace dbaui
mutable ::osl::Mutex m_aMutex;
void listen();
- protected:
+
// the columns of the table
css::uno::Reference< css::beans::XPropertySet > m_xTable; // can either be a table or a query
css::uno::Reference< css::container::XIndexAccess> m_xKeys;
@@ -51,9 +51,9 @@ namespace dbaui
public:
explicit OTableWindowData( const css::uno::Reference< css::beans::XPropertySet>& _xTable
- ,const OUString& _rComposedName
- ,const OUString& strTableName
- ,const OUString& rWinName );
+ ,OUString _sComposedName
+ ,OUString strTableName
+ ,OUString sWinName );
virtual ~OTableWindowData() override;
/** late constructor
diff --git a/dbaccess/source/ui/inc/TableWindowListBox.hxx b/dbaccess/source/ui/inc/TableWindowListBox.hxx
index 0d3890cf26c7..cdad4947ca8d 100644
--- a/dbaccess/source/ui/inc/TableWindowListBox.hxx
+++ b/dbaccess/source/ui/inc/TableWindowListBox.hxx
@@ -90,7 +90,7 @@ namespace dbaui
virtual void Command(const CommandEvent& rEvt) override;
OTableWindow* GetTabWin(){ return m_pTabWin; }
- int GetEntryFromText( const OUString& rEntryText );
+ int GetEntryFromText( std::u16string_view rEntryText );
};
class TableWindowListBoxHelper final : public DropTargetHelper
diff --git a/dbaccess/source/ui/inc/TokenWriter.hxx b/dbaccess/source/ui/inc/TokenWriter.hxx
index 82e36240fc29..b82bd71a5feb 100644
--- a/dbaccess/source/ui/inc/TokenWriter.hxx
+++ b/dbaccess/source/ui/inc/TokenWriter.hxx
@@ -83,7 +83,7 @@ namespace dbaui
const css::uno::Reference< css::util::XNumberFormatter >& _rxNumberF);
// import data
- ODatabaseImportExport( const SharedConnection& _rxConnection,
+ ODatabaseImportExport( SharedConnection _xConnection,
const css::uno::Reference< css::util::XNumberFormatter >& _rxNumberF,
const css::uno::Reference< css::uno::XComponentContext >& _rM);
diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx
index 71bdc92c35da..c622c73f65c5 100644
--- a/dbaccess/source/ui/inc/UITools.hxx
+++ b/dbaccess/source/ui/inc/UITools.hxx
@@ -24,6 +24,7 @@
#include <editeng/svxenum.hxx>
#include <vcl/taskpanelist.hxx>
#include <connectivity/dbtools.hxx>
+#include <unotools/resmgr.hxx>
#include <memory>
#include <string_view>
@@ -114,7 +115,7 @@ namespace dbaui
@param _rTypeInfoIters the vector filled with map iterators
*/
void fillTypeInfo( const css::uno::Reference< css::sdbc::XConnection>& _rxConnection,
- const OUString& _rsTypeNames,
+ std::u16string_view _rsTypeNames,
OTypeInfoMap& _rTypeInfoMap,
std::vector<OTypeInfoMap::iterator>& _rTypeInfoIters);
@@ -310,7 +311,7 @@ namespace dbaui
@return
RET_YES, RET_NO, RET_ALL
*/
- sal_Int32 askForUserAction(weld::Window* pParent, const char* pTitle, const char* pText, bool bAll, std::u16string_view rName);
+ sal_Int32 askForUserAction(weld::Window* pParent, TranslateId pTitle, TranslateId pText, bool bAll, std::u16string_view rName);
/** creates a new view from a query or table
@param _sName
@@ -371,7 +372,7 @@ namespace dbaui
@return
<TRUE/> if the insert operation was successful, otherwise <FALSE/>.
*/
- bool insertHierachyElement(
+ bool insertHierarchyElement(
weld::Window* pParent,
const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
const css::uno::Reference< css::container::XHierarchicalNameContainer>& _xNames,
diff --git a/dbaccess/source/ui/inc/UserAdminDlg.hxx b/dbaccess/source/ui/inc/UserAdminDlg.hxx
index 941eab5faed3..95edbe5f5527 100644
--- a/dbaccess/source/ui/inc/UserAdminDlg.hxx
+++ b/dbaccess/source/ui/inc/UserAdminDlg.hxx
@@ -47,7 +47,7 @@ namespace dbaui
css::uno::Reference< css::sdbc::XConnection> m_xConnection;
bool m_bOwnConnection;
protected:
- virtual void PageCreated(const OString& rId, SfxTabPage& _rPage) override;
+ virtual void PageCreated(const OUString& rId, SfxTabPage& _rPage) override;
public:
OUserAdminDlg(weld::Window* pParent, SfxItemSet* pItems,
const css::uno::Reference< css::uno::XComponentContext >& rxORB,
diff --git a/dbaccess/source/ui/inc/WColumnSelect.hxx b/dbaccess/source/ui/inc/WColumnSelect.hxx
index 706ccfd0371c..38b1317fd507 100644
--- a/dbaccess/source/ui/inc/WColumnSelect.hxx
+++ b/dbaccess/source/ui/inc/WColumnSelect.hxx
@@ -49,7 +49,7 @@ namespace dbaui
OFieldDescription const * _pSrcField,
std::vector< OUString>& _rRightColumns,
const OUString& _sColumnName,
- const OUString& _sExtraChars,
+ std::u16string_view _sExtraChars,
sal_Int32 _nMaxNameLen,
const ::comphelper::UStringMixEqual& _aCase);
@@ -57,7 +57,7 @@ namespace dbaui
weld::TreeView const * _pLeft,
std::vector< OUString>& _rRightColumns,
const OUString& _sColumnName,
- const OUString& _sExtraChars,
+ std::u16string_view _sExtraChars,
sal_Int32 _nMaxNameLen,
const ::comphelper::UStringMixEqual& _aCase);
diff --git a/dbaccess/source/ui/inc/WCopyTable.hxx b/dbaccess/source/ui/inc/WCopyTable.hxx
index 1d650d7a6171..d3c0672f8e0b 100644
--- a/dbaccess/source/ui/inc/WCopyTable.hxx
+++ b/dbaccess/source/ui/inc/WCopyTable.hxx
@@ -183,7 +183,7 @@ namespace dbaui
public:
NamedTableCopySource(
const css::uno::Reference< css::sdbc::XConnection >& _rxConnection,
- const OUString& _rTableName
+ OUString _sTableName
);
// ICopyTableSourceObject overridables
@@ -309,9 +309,9 @@ namespace dbaui
// used for importing rtf/html sources
OCopyTableWizard(
weld::Window* pParent,
- const OUString& _rDefaultName,
+ OUString _sDefaultName,
sal_Int16 _nOperation,
- const ODatabaseExport::TColumns& _rDestColumns,
+ ODatabaseExport::TColumns&& _rDestColumns,
const ODatabaseExport::TColumnVector& _rSourceColVec,
const css::uno::Reference< css::sdbc::XConnection >& _xConnection,
const css::uno::Reference< css::util::XNumberFormatter >& _xFormatter,
@@ -395,7 +395,7 @@ namespace dbaui
OUString convertColumnName( const TColumnFindFunctor& _rCmpFunctor,
const OUString& _sColumnName,
- const OUString& _sExtraChars,
+ std::u16string_view _sExtraChars,
sal_Int32 _nMaxNameLen);
TOTypeInfoSP convertType(const TOTypeInfoSP&_pType, bool& _bNotConvert);
diff --git a/dbaccess/source/ui/inc/WTabPage.hxx b/dbaccess/source/ui/inc/WTabPage.hxx
index cc7564cbae59..ef3d7f23b20c 100644
--- a/dbaccess/source/ui/inc/WTabPage.hxx
+++ b/dbaccess/source/ui/inc/WTabPage.hxx
@@ -31,7 +31,7 @@ namespace dbaui
OCopyTableWizard* m_pParent;
bool m_bFirstTime; // Page is called the first time; should be set in the reset method
- OWizardPage(weld::Container* pPage, OCopyTableWizard* pWizard, const OUString& rUIXMLDescription, const OString& rID);
+ OWizardPage(weld::Container* pPage, OCopyTableWizard* pWizard, const OUString& rUIXMLDescription, const OUString& rID);
public:
virtual ~OWizardPage() override;
diff --git a/dbaccess/source/ui/inc/WTypeSelect.hxx b/dbaccess/source/ui/inc/WTypeSelect.hxx
index 8a953302a978..56af0e355d1a 100644
--- a/dbaccess/source/ui/inc/WTypeSelect.hxx
+++ b/dbaccess/source/ui/inc/WTypeSelect.hxx
@@ -103,7 +103,6 @@ namespace dbaui
DECL_LINK( ButtonClickHdl, weld::Button&, void );
protected:
std::unique_ptr<OWizTypeSelectList> m_xColumnNames;
- std::unique_ptr<weld::Label> m_xColumns;
std::unique_ptr<weld::Container> m_xControlContainer;
std::unique_ptr<OWizTypeSelectControl> m_xTypeControl;
std::unique_ptr<weld::Label> m_xAutoType;
diff --git a/dbaccess/source/ui/inc/advancedsettingsdlg.hxx b/dbaccess/source/ui/inc/advancedsettingsdlg.hxx
index b28fe5ce3857..7c38562145a5 100644
--- a/dbaccess/source/ui/inc/advancedsettingsdlg.hxx
+++ b/dbaccess/source/ui/inc/advancedsettingsdlg.hxx
@@ -37,7 +37,7 @@ namespace dbaui
std::unique_ptr<ODbDataSourceAdministrationHelper> m_pImpl;
protected:
- virtual void PageCreated(const OString& rId, SfxTabPage& _rPage) override;
+ virtual void PageCreated(const OUString& rId, SfxTabPage& _rPage) override;
virtual short Ok() override;
public:
diff --git a/dbaccess/source/ui/inc/callbacks.hxx b/dbaccess/source/ui/inc/callbacks.hxx
index 38e419b5b289..e380b2671d6c 100644
--- a/dbaccess/source/ui/inc/callbacks.hxx
+++ b/dbaccess/source/ui/inc/callbacks.hxx
@@ -22,8 +22,6 @@
#include <sot/exchange.hxx>
class Point;
-class PopupMenu;
-class Control;
struct AcceptDropEvent;
struct ExecuteDropEvent;
diff --git a/dbaccess/source/ui/inc/charsetlistbox.hxx b/dbaccess/source/ui/inc/charsetlistbox.hxx
index aedfb6ec50a4..a12b425cd9c1 100644
--- a/dbaccess/source/ui/inc/charsetlistbox.hxx
+++ b/dbaccess/source/ui/inc/charsetlistbox.hxx
@@ -19,10 +19,12 @@
#pragma once
+#include <svl/typedwhich.hxx>
#include <vcl/weld.hxx>
#include "charsets.hxx"
class SfxItemSet;
+class SfxStringItem;
namespace dbaui
{
@@ -32,8 +34,8 @@ namespace dbaui
public:
CharSetListBox(std::unique_ptr<weld::ComboBox> xControl);
- void SelectEntryByIanaName( const OUString& _rIanaName );
- bool StoreSelectedCharSet( SfxItemSet& _rSet, const sal_uInt16 _nItemId );
+ void SelectEntryByIanaName( std::u16string_view _rIanaName );
+ bool StoreSelectedCharSet( SfxItemSet& _rSet, TypedWhichId<SfxStringItem> _nItemId );
weld::ComboBox* get_widget() { return m_xControl.get(); }
void connect_changed(const Link<weld::ComboBox&, void>& rLink) { m_xControl->connect_changed(rLink); }
diff --git a/dbaccess/source/ui/inc/charsets.hxx b/dbaccess/source/ui/inc/charsets.hxx
index ed1f88d7beab..49977bd56262 100644
--- a/dbaccess/source/ui/inc/charsets.hxx
+++ b/dbaccess/source/ui/inc/charsets.hxx
@@ -43,7 +43,7 @@ namespace dbaui
// various find operations
const_iterator findEncoding(const rtl_TextEncoding _eEncoding) const;
- const_iterator findIanaName(const OUString& _rIanaName) const;
+ const_iterator findIanaName(std::u16string_view _rIanaName) const;
const_iterator findDisplayName(const OUString& _rDisplayName) const;
/// get access to the first element of the charset collection
@@ -72,7 +72,7 @@ namespace dbaui
const OUString& getDisplayName() const { return m_sDisplayName; }
private:
- CharsetDisplayDerefHelper(const ::dbtools::CharsetIteratorDerefHelper& _rBase, const OUString& _rDisplayName);
+ CharsetDisplayDerefHelper(const ::dbtools::CharsetIteratorDerefHelper& _rBase, OUString _sDisplayName);
};
//- OCharsetDisplay::ExtendedCharsetIterator
@@ -97,7 +97,7 @@ namespace dbaui
const ExtendedCharsetIterator& operator++();
protected:
- ExtendedCharsetIterator( const OCharsetDisplay* _pContainer, const base_iterator& _rPosition );
+ ExtendedCharsetIterator( const OCharsetDisplay* _pContainer, base_iterator _aPosition );
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/inc/curledit.hxx b/dbaccess/source/ui/inc/curledit.hxx
index a99c2c3affe3..6042f761ce2f 100644
--- a/dbaccess/source/ui/inc/curledit.hxx
+++ b/dbaccess/source/ui/inc/curledit.hxx
@@ -43,7 +43,7 @@ public:
public:
bool get_visible() const { return m_xEntry->get_visible(); }
void connect_changed(const Link<weld::Entry&, void>& rLink) { m_xEntry->connect_changed(rLink); }
- void set_help_id(const OString& rName) { m_xEntry->set_help_id(rName); }
+ void set_help_id(const OUString& rName) { m_xEntry->set_help_id(rName); }
void hide()
{
m_xEntry->hide();
diff --git a/dbaccess/source/ui/inc/databaseobjectview.hxx b/dbaccess/source/ui/inc/databaseobjectview.hxx
index d6b23878a8f0..46df99181627 100644
--- a/dbaccess/source/ui/inc/databaseobjectview.hxx
+++ b/dbaccess/source/ui/inc/databaseobjectview.hxx
@@ -91,7 +91,7 @@ namespace dbaui
const css::uno::Reference< css::uno::XComponentContext >& _rxORB,
const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI >& _rxApplication,
const css::uno::Reference< css::frame::XFrame >& _rxParentFrame,
- const OUString& _rComponentURL
+ OUString _sComponentURL
);
virtual ~DatabaseObjectView(){}
diff --git a/dbaccess/source/ui/inc/datasourceconnector.hxx b/dbaccess/source/ui/inc/datasourceconnector.hxx
index 541c49607c90..56f7bf2f067b 100644
--- a/dbaccess/source/ui/inc/datasourceconnector.hxx
+++ b/dbaccess/source/ui/inc/datasourceconnector.hxx
@@ -48,7 +48,7 @@ namespace dbaui
ODatasourceConnector(
const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
weld::Window* _pMessageParent,
- const OUString& _rContextInformation
+ OUString _sContextInformation
);
/// returns <TRUE/> if the object is able to create data source connections
diff --git a/dbaccess/source/ui/inc/dbadmin.hxx b/dbaccess/source/ui/inc/dbadmin.hxx
index fb948f940fb8..ac56418ab71c 100644
--- a/dbaccess/source/ui/inc/dbadmin.hxx
+++ b/dbaccess/source/ui/inc/dbadmin.hxx
@@ -22,6 +22,7 @@
#include <sfx2/tabdlg.hxx>
#include <dsntypes.hxx>
#include "IItemSetHelper.hxx"
+#include <unotools/resmgr.hxx>
#include <memory>
namespace com::sun::star {
@@ -48,7 +49,7 @@ class ODbAdminDialog final : public SfxTabDialogController, public IItemSetHelpe
private:
std::unique_ptr<ODbDataSourceAdministrationHelper> m_pImpl;
- OString m_sMainPageID;
+ OUString m_sMainPageID;
public:
/** ctor. The itemset given should have been created by <method>createItemSet</method> and should be destroyed
@@ -62,10 +63,10 @@ public:
@param _pTypeCollection pointer to an <type>ODatasourceMap</type>. May be NULL, in this case
the pool will not contain a typecollection default.
*/
- static void createItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults, ::dbaccess::ODsnTypeCollection* _pTypeCollection);
+ static void createItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, ::dbaccess::ODsnTypeCollection* _pTypeCollection);
/** destroy and item set / item pool / pool defaults previously created by <method>createItemSet</method>
*/
- static void destroyItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults);
+ static void destroyItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool);
/** selects the DataSource
@param _rName
@@ -88,9 +89,9 @@ public:
private:
// adds a new detail page and remove all the old ones
- void addDetailPage(const OString& rPageId, const char* pTextId, CreateTabPage pCreateFunc);
+ void addDetailPage(const OUString& rPageId, TranslateId pTextId, CreateTabPage pCreateFunc);
- virtual void PageCreated(const OString& rId, SfxTabPage& _rPage) override;
+ virtual void PageCreated(const OUString& rId, SfxTabPage& _rPage) override;
virtual short Ok() override;
/// select a datasource with a given name, adjust the item set accordingly, and everything like that ..
diff --git a/dbaccess/source/ui/inc/dbexchange.hxx b/dbaccess/source/ui/inc/dbexchange.hxx
index 7fb0c6ee0b96..050f5bd3b849 100644
--- a/dbaccess/source/ui/inc/dbexchange.hxx
+++ b/dbaccess/source/ui/inc/dbexchange.hxx
@@ -75,7 +75,7 @@ namespace dbaui
virtual void AddSupportedFormats() override;
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
virtual void ObjectReleased() override;
- virtual bool WriteObject( tools::SvRef<SotTempStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor ) override;
+ virtual bool WriteObject( SvStream& rOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor ) override;
};
}
diff --git a/dbaccess/source/ui/inc/dbwiz.hxx b/dbaccess/source/ui/inc/dbwiz.hxx
index 0c51ab1a9cfb..744c308a6822 100644
--- a/dbaccess/source/ui/inc/dbwiz.hxx
+++ b/dbaccess/source/ui/inc/dbwiz.hxx
@@ -37,7 +37,6 @@ namespace com::sun::star {
}
using vcl::WizardTypes::WizardState;
-using vcl::WizardTypes::CommitPageReason;
namespace dbaccess
{
diff --git a/dbaccess/source/ui/inc/dbwizsetup.hxx b/dbaccess/source/ui/inc/dbwizsetup.hxx
index 424a34534c60..50f463fac42a 100644
--- a/dbaccess/source/ui/inc/dbwizsetup.hxx
+++ b/dbaccess/source/ui/inc/dbwizsetup.hxx
@@ -38,7 +38,6 @@ namespace com::sun::star {
}
using vcl::WizardTypes::WizardState;
-using vcl::WizardTypes::CommitPageReason;
using vcl::RoadmapWizardTypes::PathId;
namespace dbaui
@@ -72,6 +71,7 @@ private:
OUString m_sRM_JDBCText;
OUString m_sRM_MySQLNativePageTitle;
OUString m_sRM_OracleText;
+ OUString m_sRM_PostgresText;
OUString m_sRM_MySQLText;
OUString m_sRM_ODBCText;
OUString m_sRM_DocumentOrSpreadSheetText;
@@ -147,7 +147,7 @@ private:
*/
void declareAuthDepPath( const OUString& _sURL, PathId _nPathId, const vcl::RoadmapWizardTypes::WizardPath& _rPaths);
- void RegisterDataSourceByLocation(const OUString& sPath);
+ void RegisterDataSourceByLocation(std::u16string_view sPath);
bool SaveDatabaseDocument();
void activateDatabasePath();
OUString createUniqueFileName(const INetURLObject& rURL);
diff --git a/dbaccess/source/ui/inc/defaultobjectnamecheck.hxx b/dbaccess/source/ui/inc/defaultobjectnamecheck.hxx
index 59705fe61260..c75528940e15 100644
--- a/dbaccess/source/ui/inc/defaultobjectnamecheck.hxx
+++ b/dbaccess/source/ui/inc/defaultobjectnamecheck.hxx
@@ -23,6 +23,7 @@
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/sdb/tools/XConnectionTools.hpp>
#include <memory>
@@ -30,14 +31,14 @@ namespace dbaui
{
// HierarchicalNameCheck
- struct HierarchicalNameCheck_Impl;
/** class implementing the IObjectNameCheck interface, and checking given object names
against a hierarchical name container
*/
class HierarchicalNameCheck :public IObjectNameCheck
{
private:
- std::unique_ptr< HierarchicalNameCheck_Impl > m_pImpl;
+ css::uno::Reference< css::container::XHierarchicalNameAccess > mxHierarchicalNames;
+ OUString msRelativeRoot;
public:
/** constructs a HierarchicalNameCheck instance
@@ -67,7 +68,6 @@ namespace dbaui
};
// DynamicTableOrQueryNameCheck
- struct DynamicTableOrQueryNameCheck_Impl;
/** class implementing the IObjectNameCheck interface, and checking a given name
for being valid as either a query or a table name.
@@ -84,7 +84,8 @@ namespace dbaui
class DynamicTableOrQueryNameCheck :public IObjectNameCheck
{
private:
- std::unique_ptr< DynamicTableOrQueryNameCheck_Impl > m_pImpl;
+ sal_Int32 mnCommandType;
+ css::uno::Reference< css::sdb::tools::XObjectNames > mxObjectNames;
public:
/** constructs a DynamicTableOrQueryNameCheck instance
diff --git a/dbaccess/source/ui/inc/directsql.hxx b/dbaccess/source/ui/inc/directsql.hxx
index b9f419d9a686..bfe8195fc5ff 100644
--- a/dbaccess/source/ui/inc/directsql.hxx
+++ b/dbaccess/source/ui/inc/directsql.hxx
@@ -21,7 +21,6 @@
#include <sal/config.h>
-#include <sal/log.hxx>
#include <vcl/weld.hxx>
#include <deque>
#include <string_view>
@@ -46,6 +45,7 @@ namespace dbaui
std::unique_ptr<weld::Button> m_xExecute;
std::unique_ptr<weld::ComboBox> m_xSQLHistory;
std::unique_ptr<weld::TextView> m_xStatus;
+ std::unique_ptr<weld::CheckButton> m_xDirectSQL;
std::unique_ptr<weld::CheckButton> m_xShowOutput;
std::unique_ptr<weld::TextView> m_xOutput;
std::unique_ptr<weld::Button> m_xClose;
@@ -108,17 +108,6 @@ namespace dbaui
#endif
};
-#ifdef DBG_UTIL
-#define CHECK_INVARIANTS(methodname) \
- { \
- const char* pError = impl_CheckInvariants(); \
- if (pError) \
- SAL_WARN("dbaccess.ui", methodname ": " << pError); \
- }
-#else
-#define CHECK_INVARIANTS(methodname)
-#endif
-
} // namespace dbaui
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/inc/dlgattr.hxx b/dbaccess/source/ui/inc/dlgattr.hxx
index 6c3a00f95472..83fe0466e4f8 100644
--- a/dbaccess/source/ui/inc/dlgattr.hxx
+++ b/dbaccess/source/ui/inc/dlgattr.hxx
@@ -34,7 +34,7 @@ namespace dbaui
SbaSbAttrDlg(weld::Widget* pParent, const SfxItemSet*, SvNumberFormatter*, bool bHasFormat);
virtual ~SbaSbAttrDlg() override;
- virtual void PageCreated(const OString& rPageId, SfxTabPage& rTabPage) override;
+ virtual void PageCreated(const OUString& rPageId, SfxTabPage& rTabPage) override;
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/inc/dlgsave.hxx b/dbaccess/source/ui/inc/dlgsave.hxx
index d56fc6ade293..f3b33a278500 100644
--- a/dbaccess/source/ui/inc/dlgsave.hxx
+++ b/dbaccess/source/ui/inc/dlgsave.hxx
@@ -19,6 +19,8 @@
#pragma once
+#include "SqlNameEdit.hxx"
+#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <o3tl/typed_flags_set.hxx>
#include <vcl/weld.hxx>
@@ -42,13 +44,30 @@ namespace o3tl {
namespace dbaui
{
- class OSaveAsDlgImpl;
class IObjectNameCheck;
class OSaveAsDlg : public weld::GenericDialogController
{
private:
- std::unique_ptr<OSaveAsDlgImpl> m_pImpl;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
+ OUString m_aName;
+ const IObjectNameCheck& m_rObjectNameCheck;
+ css::uno::Reference< css::sdbc::XDatabaseMetaData> m_xMetaData;
+ sal_Int32 m_nType;
+ SADFlags m_nFlags;
+
+ OSQLNameChecker m_aChecker;
+
+ std::unique_ptr<weld::Label> m_xDescription;
+ std::unique_ptr<weld::Label> m_xCatalogLbl;
+ std::unique_ptr<weld::ComboBox> m_xCatalog;
+ std::unique_ptr<weld::Label> m_xSchemaLbl;
+ std::unique_ptr<weld::ComboBox> m_xSchema;
+ std::unique_ptr<weld::Label> m_xLabel;
+ std::unique_ptr<weld::Entry> m_xTitle;
+ std::unique_ptr<weld::Button> m_xPB_OK;
+
+ DECL_LINK(TextFilterHdl, OUString&, bool);
+
public:
OSaveAsDlg( weld::Window * pParent, sal_Int32 _rType,
const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
diff --git a/dbaccess/source/ui/inc/dsitems.hxx b/dbaccess/source/ui/inc/dsitems.hxx
index 09410d31b83f..9d2d3544325c 100644
--- a/dbaccess/source/ui/inc/dsitems.hxx
+++ b/dbaccess/source/ui/inc/dsitems.hxx
@@ -20,76 +20,83 @@
#pragma once
#include <sal/types.h>
+#include <svl/typedwhich.hxx>
+
+class OptionalBoolItem;
+class SfxBoolItem;
+class SfxInt32Item;
+class SfxStringItem;
typedef sal_Int32 ItemID;
// item ids for the data source administration dialog
-#define DSID_NAME 1 // name of a data source, SfxStringItem
-#define DSID_ORIGINALNAME 2 // original name, internal, SfxStringItem
-#define DSID_CONNECTURL 3 // connection URL, SfxStringItem
+#define DSID_NAME TypedWhichId<SfxStringItem>(1) // name of a data source, SfxStringItem
+#define DSID_ORIGINALNAME TypedWhichId<SfxStringItem>(2) // original name, internal, SfxStringItem
+#define DSID_CONNECTURL TypedWhichId<SfxStringItem>(3) // connection URL, SfxStringItem
#define DSID_TABLEFILTER 4 // table filter, OStringListItem
#define DSID_TYPECOLLECTION 5 // collection of data source types, ODsnTypeCollection
-#define DSID_INVALID_SELECTION 6 // is the selection (thus the set data) invalid?, SfxBoolItem
-#define DSID_READONLY 7 // is the selection (thus the set data) readonly?, SfxBoolItem
-#define DSID_USER 8 // the user name used for logon, SfxStringItem
-#define DSID_PASSWORD 9 // the password used for logon, SfxStringItem
-#define DSID_ADDITIONALOPTIONS 10 // additional options used for connecting, SfxStringItem
-#define DSID_CHARSET 11 // character set to use, SfxStringItem by now
-#define DSID_PASSWORDREQUIRED 12 // is the password required to connect?, SfxBoolItem
-#define DSID_SHOWDELETEDROWS 13 // show deleted rows?, SfxBoolItem
-#define DSID_ALLOWLONGTABLENAMES 14 // allow tables names longer than 8.3?, SfxBoolItem
-#define DSID_JDBCDRIVERCLASS 15 // JDBC driver class, SfxStringItem
-#define DSID_FIELDDELIMITER 16 // field delimiter, SfxUInt16Item
-#define DSID_TEXTDELIMITER 17 // text delimiter, SfxUInt16Item
-#define DSID_DECIMALDELIMITER 18 // decimal delimiter, SfxUInt16Item
-#define DSID_THOUSANDSDELIMITER 19 // thousands delimiter, SfxUInt16Item
-#define DSID_TEXTFILEEXTENSION 20 // extension for text files, SfxStringItem
-#define DSID_TEXTFILEHEADER 21 // the text file contains a header?, SfxBoolItem
-#define DSID_PARAMETERNAMESUBST 22
-#define DSID_CONN_PORTNUMBER 23
-#define DSID_SUPPRESSVERSIONCL 24 // meta data: sal_True if the data source described by the set is to-be-deleted
-#define DSID_CONN_SHUTSERVICE 25
-#define DSID_CONN_DATAINC 26
-#define DSID_CONN_CACHESIZE 27
-#define DSID_CONN_CTRLUSER 28
-#define DSID_CONN_CTRLPWD 29
-#define DSID_USECATALOG 30 // should the driver use the catalog name when the database is filebased
-#define DSID_CONN_HOSTNAME 31
-#define DSID_CONN_LDAP_BASEDN 32
-#define DSID_CONN_LDAP_PORTNUMBER 33
-#define DSID_CONN_LDAP_ROWCOUNT 34
-#define DSID_SQL92CHECK 35
-#define DSID_AUTOINCREMENTVALUE 36
-#define DSID_AUTORETRIEVEVALUE 37
-#define DSID_AUTORETRIEVEENABLED 38
-#define DSID_APPEND_TABLE_ALIAS 39
-#define DSID_MYSQL_PORTNUMBER 40
-#define DSID_IGNOREDRIVER_PRIV 41
-#define DSID_BOOLEANCOMPARISON 42
-#define DSID_ORACLE_PORTNUMBER 43
-#define DSID_ENABLEOUTERJOIN 44
-#define DSID_CATALOG 45
-#define DSID_SCHEMA 46
-#define DSID_INDEXAPPENDIX 47
-#define DSID_CONN_LDAP_USESSL 48
-#define DSID_DOCUMENT_URL 49
-#define DSID_DOSLINEENDS 50
-#define DSID_DATABASENAME 51
-#define DSID_AS_BEFORE_CORRNAME 52
-#define DSID_CHECK_REQUIRED_FIELDS 53
-#define DSID_IGNORECURRENCY 54
-#define DSID_CONN_SOCKET 55
-#define DSID_ESCAPE_DATETIME 56
-#define DSID_NAMED_PIPE 57
-#define DSID_PRIMARY_KEY_SUPPORT 58
-#define DSID_MAX_ROW_SCAN 59
-#define DSID_RESPECTRESULTSETTYPE 60
+#define DSID_INVALID_SELECTION TypedWhichId<SfxBoolItem>(6) // is the selection (thus the set data) invalid?, SfxBoolItem
+#define DSID_READONLY TypedWhichId<SfxBoolItem>(7) // is the selection (thus the set data) readonly?, SfxBoolItem
+#define DSID_USER TypedWhichId<SfxStringItem>(8) // the user name used for logon, SfxStringItem
+#define DSID_PASSWORD TypedWhichId<SfxStringItem>(9) // the password used for logon, SfxStringItem
+#define DSID_ADDITIONALOPTIONS TypedWhichId<SfxStringItem>(10) // additional options used for connecting, SfxStringItem
+#define DSID_CHARSET TypedWhichId<SfxStringItem>(11) // character set to use, SfxStringItem by now
+#define DSID_PASSWORDREQUIRED TypedWhichId<SfxBoolItem>(12) // is the password required to connect?, SfxBoolItem
+#define DSID_SHOWDELETEDROWS TypedWhichId<SfxBoolItem>(13) // show deleted rows?, SfxBoolItem
+#define DSID_ALLOWLONGTABLENAMES TypedWhichId<SfxBoolItem>(14) // allow tables names longer than 8.3?, SfxBoolItem
+#define DSID_JDBCDRIVERCLASS TypedWhichId<SfxStringItem>(15) // JDBC driver class, SfxStringItem
+#define DSID_FIELDDELIMITER TypedWhichId<SfxStringItem>(16) // field delimiter, SfxUInt16Item
+#define DSID_TEXTDELIMITER TypedWhichId<SfxStringItem>(17) // text delimiter, SfxUInt16Item
+#define DSID_DECIMALDELIMITER TypedWhichId<SfxStringItem>(18) // decimal delimiter, SfxUInt16Item
+#define DSID_THOUSANDSDELIMITER TypedWhichId<SfxStringItem>(19) // thousands delimiter, SfxUInt16Item
+#define DSID_TEXTFILEEXTENSION TypedWhichId<SfxStringItem>(20) // extension for text files, SfxStringItem
+#define DSID_TEXTFILEHEADER TypedWhichId<SfxBoolItem>(21) // the text file contains a header?, SfxBoolItem
+#define DSID_PARAMETERNAMESUBST TypedWhichId<SfxBoolItem>(22)
+#define DSID_CONN_PORTNUMBER TypedWhichId<SfxInt32Item>(23)
+#define DSID_SUPPRESSVERSIONCL TypedWhichId<SfxBoolItem>(24) // meta data: sal_True if the data source described by the set is to-be-deleted
+#define DSID_CONN_SHUTSERVICE TypedWhichId<SfxBoolItem>(25)
+#define DSID_CONN_DATAINC TypedWhichId<SfxInt32Item>(26)
+#define DSID_CONN_CACHESIZE TypedWhichId<SfxInt32Item>(27)
+#define DSID_CONN_CTRLUSER TypedWhichId<SfxStringItem>(28)
+#define DSID_CONN_CTRLPWD TypedWhichId<SfxStringItem>(29)
+#define DSID_USECATALOG TypedWhichId<SfxBoolItem>(30) // should the driver use the catalog name when the database is filebased
+#define DSID_CONN_HOSTNAME TypedWhichId<SfxStringItem>(31)
+#define DSID_CONN_LDAP_BASEDN TypedWhichId<SfxStringItem>(32)
+#define DSID_CONN_LDAP_PORTNUMBER TypedWhichId<SfxInt32Item>(33)
+#define DSID_CONN_LDAP_ROWCOUNT TypedWhichId<SfxInt32Item>(34)
+#define DSID_SQL92CHECK TypedWhichId<SfxBoolItem>(35)
+#define DSID_AUTOINCREMENTVALUE TypedWhichId<SfxStringItem>(36)
+#define DSID_AUTORETRIEVEVALUE TypedWhichId<SfxStringItem>(37)
+#define DSID_AUTORETRIEVEENABLED TypedWhichId<SfxBoolItem>(38)
+#define DSID_APPEND_TABLE_ALIAS TypedWhichId<SfxBoolItem>(39)
+#define DSID_MYSQL_PORTNUMBER TypedWhichId<SfxInt32Item>(40)
+#define DSID_IGNOREDRIVER_PRIV TypedWhichId<SfxBoolItem>(41)
+#define DSID_BOOLEANCOMPARISON TypedWhichId<SfxInt32Item>(42)
+#define DSID_ORACLE_PORTNUMBER TypedWhichId<SfxInt32Item>(43)
+#define DSID_ENABLEOUTERJOIN TypedWhichId<SfxBoolItem>(44)
+#define DSID_CATALOG TypedWhichId<SfxBoolItem>(45)
+#define DSID_SCHEMA TypedWhichId<SfxBoolItem>(46)
+#define DSID_INDEXAPPENDIX TypedWhichId<SfxBoolItem>(47)
+#define DSID_CONN_LDAP_USESSL TypedWhichId<SfxBoolItem>(48)
+#define DSID_DOCUMENT_URL TypedWhichId<SfxStringItem>(49)
+#define DSID_DOSLINEENDS TypedWhichId<SfxBoolItem>(50)
+#define DSID_DATABASENAME TypedWhichId<SfxStringItem>(51)
+#define DSID_AS_BEFORE_CORRNAME TypedWhichId<SfxBoolItem>(52)
+#define DSID_CHECK_REQUIRED_FIELDS TypedWhichId<SfxBoolItem>(53)
+#define DSID_IGNORECURRENCY TypedWhichId<SfxBoolItem>(54)
+#define DSID_CONN_SOCKET TypedWhichId<SfxStringItem>(55)
+#define DSID_ESCAPE_DATETIME TypedWhichId<SfxBoolItem>(56)
+#define DSID_NAMED_PIPE TypedWhichId<SfxStringItem>(57)
+#define DSID_PRIMARY_KEY_SUPPORT TypedWhichId<OptionalBoolItem>(58)
+#define DSID_MAX_ROW_SCAN TypedWhichId<SfxInt32Item>(59)
+#define DSID_RESPECTRESULTSETTYPE TypedWhichId<SfxBoolItem>(60)
+#define DSID_POSTGRES_PORTNUMBER TypedWhichId<SfxInt32Item>(61)
// don't forget to adjust DSID_LAST_ITEM_ID below!
// item range. Adjust this if you introduce new items above
#define DSID_FIRST_ITEM_ID DSID_NAME
-#define DSID_LAST_ITEM_ID DSID_RESPECTRESULTSETTYPE
+#define DSID_LAST_ITEM_ID DSID_POSTGRES_PORTNUMBER
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/inc/dsmeta.hxx b/dbaccess/source/ui/inc/dsmeta.hxx
index 69b13ebb7965..0c8646a53cbd 100644
--- a/dbaccess/source/ui/inc/dsmeta.hxx
+++ b/dbaccess/source/ui/inc/dsmeta.hxx
@@ -42,7 +42,6 @@ namespace dbaui
// DataSourceMetaData
class FeatureSet;
- class DataSourceMetaData_Impl;
/** encapsulates meta data for a data source
On the long run, this class should a) encapsulate *all* meta data which
@@ -65,7 +64,7 @@ namespace dbaui
static AuthenticationMode getAuthentication( const OUString& _sURL );
private:
- std::shared_ptr< DataSourceMetaData_Impl > m_pImpl;
+ OUString m_sURL;
};
// FeatureSet
diff --git a/dbaccess/source/ui/inc/exsrcbrw.hxx b/dbaccess/source/ui/inc/exsrcbrw.hxx
index eaeb56e336bd..0ecda1ed647e 100644
--- a/dbaccess/source/ui/inc/exsrcbrw.hxx
+++ b/dbaccess/source/ui/inc/exsrcbrw.hxx
@@ -21,6 +21,7 @@
#include "brwctrlr.hxx"
+#include <comphelper/interfacecontainer3.hxx>
#include <comphelper/uno3.hxx>
// SbaExternalSourceBrowser
@@ -32,7 +33,7 @@ namespace dbaui
:public SbaXDataBrowserController
,public css::util::XModifyBroadcaster
{
- ::comphelper::OInterfaceContainerHelper2 m_aModifyListeners;
+ ::comphelper::OInterfaceContainerHelper3<css::util::XModifyListener> m_aModifyListeners;
// for multiplexing the modify events
rtl::Reference<SbaXFormAdapter> m_pDataSourceImpl;
bool m_bInQueryDispatch;
diff --git a/dbaccess/source/ui/inc/formadapter.hxx b/dbaccess/source/ui/inc/formadapter.hxx
index c4fa9d96af66..c6d565896215 100644
--- a/dbaccess/source/ui/inc/formadapter.hxx
+++ b/dbaccess/source/ui/inc/formadapter.hxx
@@ -53,6 +53,7 @@
#include <com/sun/star/io/XPersistObject.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/util/XCancellable.hpp>
+#include <comphelper/interfacecontainer3.hxx>
#include <comphelper/uno3.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/implbase12.hxx>
@@ -133,8 +134,8 @@ namespace dbaui
SbaXVetoableChangeMultiplexer m_aVetoablePropertyChangeListeners;
SbaXPropertiesChangeMultiplexer m_aPropertiesChangeListeners;
- ::comphelper::OInterfaceContainerHelper2 m_aDisposeListeners;
- ::comphelper::OInterfaceContainerHelper2 m_aContainerListeners;
+ ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> m_aDisposeListeners;
+ ::comphelper::OInterfaceContainerHelper3<css::container::XContainerListener> m_aContainerListeners;
// hierarchy administration
css::uno::Reference< css::uno::XInterface > m_xParent;
diff --git a/dbaccess/source/ui/inc/imageprovider.hxx b/dbaccess/source/ui/inc/imageprovider.hxx
index d2719a59b657..28784e6dbfa1 100644
--- a/dbaccess/source/ui/inc/imageprovider.hxx
+++ b/dbaccess/source/ui/inc/imageprovider.hxx
@@ -19,17 +19,13 @@
#pragma once
-#include <vcl/image.hxx>
-
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
-#include <memory>
+namespace com::sun::star::sdb::application { class XTableUIProvider; }
namespace dbaui
{
- // ImageProvider
- struct ImageProvider_Data;
/** provides images for database objects such as tables, queries, forms, reports ...
At the moment, this class cares for small icons only, that is, icons which can be used
@@ -38,9 +34,6 @@ namespace dbaui
*/
class ImageProvider
{
- private:
- std::shared_ptr< ImageProvider_Data > m_pData;
-
public:
/** creates a semi-functional ImageProvider instance
@@ -100,6 +93,13 @@ namespace dbaui
the image to be used for folders of this type
*/
static OUString getDatabaseImage();
+ private:
+ /// the connection we work with
+ css::uno::Reference< css::sdbc::XConnection > mxConnection;
+ /// the views of the connection, if the DB supports views
+ css::uno::Reference< css::container::XNameAccess > mxViews;
+ /// interface for providing table's UI
+ css::uno::Reference< css::sdb::application::XTableUIProvider > mxTableUI;
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/inc/indexcollection.hxx b/dbaccess/source/ui/inc/indexcollection.hxx
index d677eed06c5f..3d227b0b3869 100644
--- a/dbaccess/source/ui/inc/indexcollection.hxx
+++ b/dbaccess/source/ui/inc/indexcollection.hxx
@@ -29,7 +29,6 @@ namespace dbaui
// OIndexCollection
class OIndexCollection
{
- protected:
css::uno::Reference< css::container::XNameAccess >
m_xIndexes;
diff --git a/dbaccess/source/ui/inc/indexdialog.hxx b/dbaccess/source/ui/inc/indexdialog.hxx
index f03b04f6f0b8..b3ba37936e79 100644
--- a/dbaccess/source/ui/inc/indexdialog.hxx
+++ b/dbaccess/source/ui/inc/indexdialog.hxx
@@ -74,7 +74,7 @@ namespace dbaui
void IndexSelected();
DECL_LINK( OnIndexSelected, weld::TreeView&, void );
- DECL_LINK( OnIndexAction, const OString&, void );
+ DECL_LINK( OnIndexAction, const OUString&, void );
DECL_LINK( OnEntryEditing, const weld::TreeIter&, bool );
DECL_LINK( OnEntryEdited, const IterString&, bool );
DECL_LINK( OnModifiedClick, weld::Toggleable&, void );
diff --git a/dbaccess/source/ui/inc/indexfieldscontrol.hxx b/dbaccess/source/ui/inc/indexfieldscontrol.hxx
index a973d4c1b495..90ae7172e3df 100644
--- a/dbaccess/source/ui/inc/indexfieldscontrol.hxx
+++ b/dbaccess/source/ui/inc/indexfieldscontrol.hxx
@@ -54,7 +54,7 @@ namespace dbaui
void Init(const css::uno::Sequence< OUString >& _rAvailableFields, bool _bAddIndexAppendix);
- void initializeFrom(const IndexFields& _rFields);
+ void initializeFrom(IndexFields&& _rFields);
void commitTo(IndexFields& _rFields);
bool SaveModified() override;
diff --git a/dbaccess/source/ui/inc/linkeddocuments.hxx b/dbaccess/source/ui/inc/linkeddocuments.hxx
index 961b2ea4cddf..c20f3a87ae51 100644
--- a/dbaccess/source/ui/inc/linkeddocuments.hxx
+++ b/dbaccess/source/ui/inc/linkeddocuments.hxx
@@ -53,7 +53,7 @@ namespace dbaui
const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
const css::uno::Reference< css::container::XNameAccess >& _rxContainer,
const css::uno::Reference< css::sdbc::XConnection>& _xConnection,
- const OUString& _sDataSourceName
+ OUString _sDataSourceName
);
~OLinkedDocumentsAccess();
diff --git a/dbaccess/source/ui/inc/querycontroller.hxx b/dbaccess/source/ui/inc/querycontroller.hxx
index 94bb5d8f4ffa..a2e334871692 100644
--- a/dbaccess/source/ui/inc/querycontroller.hxx
+++ b/dbaccess/source/ui/inc/querycontroller.hxx
@@ -187,7 +187,7 @@ namespace dbaui
// ask the user if the design should be saved when it is modified
virtual short saveModified() override;
virtual void reset() override;
- virtual void impl_initialize() override;
+ virtual void impl_initialize(const ::comphelper::NamedValueCollection& rArguments) override;
void impl_reset( const bool i_bIgnoreQuerySettings = false );
/// tells the user that we needed to switch to SQL view automatically
diff --git a/dbaccess/source/ui/inc/sbagrid.hrc b/dbaccess/source/ui/inc/sbagrid.hrc
index c84dbccead66..921faa6a9bd2 100644
--- a/dbaccess/source/ui/inc/sbagrid.hrc
+++ b/dbaccess/source/ui/inc/sbagrid.hrc
@@ -26,8 +26,8 @@
// Columns
// Formatting
-#define SBA_DEF_RANGEFORMAT (SBA_WHICHID_START+143) // RangeItem
-#define SBA_DEF_FMTVALUE (SBA_WHICHID_START+144) // SfxULONG, Format
+#define SBA_DEF_RANGEFORMAT TypedWhichId<SfxRangeItem>(SBA_WHICHID_START+143) // RangeItem
+#define SBA_DEF_FMTVALUE TypedWhichId<SfxUInt32Item>(SBA_WHICHID_START+144) // SfxULONG, Format
// Justification
#define SBA_ATTR_ALIGN_HOR_JUSTIFY (SBA_WHICHID_START + 145) // SvxHorJustifyItem
diff --git a/dbaccess/source/ui/inc/sbagrid.hxx b/dbaccess/source/ui/inc/sbagrid.hxx
index afde7e7bed59..ae96bb291bbb 100644
--- a/dbaccess/source/ui/inc/sbagrid.hxx
+++ b/dbaccess/source/ui/inc/sbagrid.hxx
@@ -25,6 +25,7 @@
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/util/URL.hpp>
+#include <comphelper/multiinterfacecontainer4.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/uno3.hxx>
#include "sbamultiplex.hxx"
@@ -61,8 +62,8 @@ namespace dbaui
virtual ~SbaXGridControl() override;
// UNO
- DECLARE_UNO3_DEFAULTS(SbaXGridControl, FmXGridControl)
- virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override;
+ DECLARE_UNO3_AGG_DEFAULTS(SbaXGridControl, FmXGridControl)
+ virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type& _rType) override;
// XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
@@ -92,8 +93,8 @@ namespace dbaui
:public FmXGridPeer
,public css::frame::XDispatch
{
- cppu::OMultiTypeInterfaceContainerHelperVar<
- css::util::URL, void, SbaURLCompare> m_aStatusListeners;
+ comphelper::OMultiTypeInterfaceContainerHelperVar4< css::util::URL, css::frame::XStatusListener,
+ SbaURLCompare> m_aStatusListeners;
public:
SbaXGridPeer(const css::uno::Reference< css::uno::XComponentContext >&);
@@ -106,8 +107,6 @@ namespace dbaui
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
- UNO3_GETIMPLEMENTATION_DECL(SbaXGridPeer)
-
// css::frame::XDispatch
virtual void SAL_CALL dispatch(const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& aArgs) override;
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > & xControl, const css::util::URL& aURL) override;
@@ -164,7 +163,7 @@ namespace dbaui
virtual void PreExecuteColumnContextMenu(sal_uInt16 nColId, weld::Menu& rMenu,
weld::Menu& rInsertMenu, weld::Menu& rChangeMenu,
weld::Menu& rShowMenu) override;
- virtual void PostExecuteColumnContextMenu(sal_uInt16 nColId, const weld::Menu& rMenu, const OString& rExecutionResult) override;
+ virtual void PostExecuteColumnContextMenu(sal_uInt16 nColId, const weld::Menu& rMenu, const OUString& rExecutionResult) override;
private:
// DragSourceHelper overridables
@@ -231,7 +230,7 @@ namespace dbaui
@return
The description of the specified object.
*/
- virtual OUString GetAccessibleObjectDescription( ::vcl::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const override;
+ virtual OUString GetAccessibleObjectDescription( AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const override;
using FmGridControl::DeleteSelectedRows;
/** copies the currently selected rows to the clipboard
@@ -255,7 +254,7 @@ namespace dbaui
// DbGridControl overridables
virtual void PreExecuteRowContextMenu(weld::Menu& rMenu) override;
- virtual void PostExecuteRowContextMenu(const OString& rExecutionResult) override;
+ virtual void PostExecuteRowContextMenu(const OUString& rExecutionResult) override;
// DbGridControl overridables
virtual void onRowChange() override;
diff --git a/dbaccess/source/ui/inc/sbamultiplex.hxx b/dbaccess/source/ui/inc/sbamultiplex.hxx
index a61aa79e9793..47fd753d4af6 100644
--- a/dbaccess/source/ui/inc/sbamultiplex.hxx
+++ b/dbaccess/source/ui/inc/sbamultiplex.hxx
@@ -31,9 +31,8 @@
#include <com/sun/star/sdbc/XRowSetListener.hpp>
#include <com/sun/star/frame/XStatusListener.hpp>
#include <comphelper/uno3.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
-#include <comphelper/interfacecontainer2.hxx>
-#include <cppuhelper/queryinterface.hxx>
+#include <comphelper/interfacecontainer3.hxx>
+#include <comphelper/multiinterfacecontainer3.hxx>
#include <cppuhelper/weak.hxx>
namespace dbaui
@@ -51,342 +50,254 @@ namespace dbaui
virtual void SAL_CALL release() noexcept override { m_rParent.release(); }
};
- // declaration of a listener multiplexer class
- #define BEGIN_DECLARE_LISTENER_MULTIPLEXER(classname, listenerclass) \
- class classname \
- :public OSbaWeakSubObject \
- ,public listenerclass \
- ,public ::comphelper::OInterfaceContainerHelper2 \
- { \
- public: \
- classname( ::cppu::OWeakObject& rSource, \
- ::osl::Mutex& rMutex); \
- DECLARE_UNO3_DEFAULTS(classname, OSbaWeakSubObject) \
- virtual css::uno::Any SAL_CALL queryInterface( \
- const css::uno::Type& _rType) override; \
- \
- /* css::lang::XEventListener */ \
- virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; \
-
- #define DECLARE_MULTIPLEXER_VOID_METHOD(methodname, eventtype) \
- virtual void SAL_CALL methodname(const eventtype& e) override; \
-
- #define DECLARE_MULTIPLEXER_BOOL_METHOD(methodname, eventtype) \
- virtual sal_Bool SAL_CALL methodname(const eventtype& e) override; \
-
- #define END_DECLARE_LISTENER_MULTIPLEXER() \
- /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */ \
- using OSbaWeakSubObject::operator new; \
- using OSbaWeakSubObject::operator delete; \
- }; \
-
- // implementation of a listener multiplexer class
-
- #define IMPLEMENT_LISTENER_MULTIPLEXER_CORE(classname, listenerclass) \
- \
- classname::classname(::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex) \
- :OSbaWeakSubObject(rSource) \
- ,OInterfaceContainerHelper2(_rMutex) \
- { \
- } \
- \
- css::uno::Any SAL_CALL classname::queryInterface( \
- const css::uno::Type& _rType) \
- { \
- css::uno::Any aReturn = \
- OSbaWeakSubObject::queryInterface(_rType); \
- if (!aReturn.hasValue()) \
- aReturn = ::cppu::queryInterface(_rType, \
- static_cast< listenerclass* >(this), \
- static_cast< css::lang::XEventListener* >(static_cast< listenerclass* >(this)) \
- ); \
- \
- return aReturn; \
- } \
- void SAL_CALL classname::disposing(const css::lang::EventObject& )\
- { \
- } \
-
- #define IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(classname, listenerclass, methodname, eventtype) \
- void SAL_CALL classname::methodname(const eventtype& e) \
- { \
- eventtype aMulti(e); \
- aMulti.Source = &m_rParent; \
- ::comphelper::OInterfaceIteratorHelper2 aIt(*this); \
- while (aIt.hasMoreElements()) \
- static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \
- } \
-
- #define IMPLEMENT_LISTENER_MULTIPLEXER_BOOL_METHOD(classname, listenerclass, methodname, eventtype) \
- sal_Bool SAL_CALL classname::methodname(const eventtype& e) \
- { \
- eventtype aMulti(e); \
- aMulti.Source = &m_rParent; \
- ::comphelper::OInterfaceIteratorHelper2 aIt(*this); \
- bool bResult = true; \
- while (bResult && aIt.hasMoreElements()) \
- bResult = static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \
- return bResult; \
- } \
-
- // helper for classes which do event multiplexing
- #define IMPLEMENT_LISTENER_ADMINISTRATION(classname, listenernamespace, listenerdesc, multiplexer, broadcasterclass, broadcaster) \
- void SAL_CALL classname::add##listenerdesc(const css::uno::Reference< css::listenernamespace::X##listenerdesc >& l)\
- { \
- multiplexer.addInterface(l); \
- if (multiplexer.getLength() == 1) \
- { \
- css::uno::Reference< broadcasterclass > xBroadcaster(broadcaster, css::uno::UNO_QUERY); \
- if (xBroadcaster.is()) \
- xBroadcaster->add##listenerdesc(&multiplexer); \
- } \
- } \
- void SAL_CALL classname::remove##listenerdesc(const css::uno::Reference< css::listenernamespace::X##listenerdesc >& l)\
- { \
- if (multiplexer.getLength() == 1) \
- { \
- css::uno::Reference< broadcasterclass > xBroadcaster(broadcaster, css::uno::UNO_QUERY); \
- if (xBroadcaster.is()) \
- xBroadcaster->remove##listenerdesc(&multiplexer); \
- } \
- multiplexer.removeInterface(l); \
- } \
-
- #define STOP_MULTIPLEXER_LISTENING(listenerdesc, multiplexer, broadcasterclass, broadcaster) \
- if (multiplexer.getLength()) \
- { \
- css::uno::Reference< broadcasterclass > xBroadcaster(broadcaster, css::uno::UNO_QUERY); \
- if (xBroadcaster.is()) \
- xBroadcaster->remove##listenerdesc(&multiplexer); \
- } \
-
- #define START_MULTIPLEXER_LISTENING(listenerdesc, multiplexer, broadcasterclass, broadcaster) \
- if (multiplexer.getLength()) \
- { \
- css::uno::Reference< broadcasterclass > xBroadcaster(broadcaster, css::uno::UNO_QUERY); \
- if (xBroadcaster.is()) \
- xBroadcaster->add##listenerdesc(&multiplexer); \
- } \
-
- // declaration of property listener multiplexers
- // (with support for specialized and unspecialized property listeners)
-
- #define DECLARE_PROPERTY_MULTIPLEXER(classname, listenerclass, methodname, eventtype) \
- class classname final \
- :public OSbaWeakSubObject \
- ,public listenerclass \
- { \
- typedef ::cppu::OMultiTypeInterfaceContainerHelperVar< \
- OUString > ListenerContainerMap; \
- ListenerContainerMap m_aListeners; \
- \
- public: \
- classname( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex ); \
- DECLARE_UNO3_DEFAULTS(classname, OSbaWeakSubObject) \
- virtual css::uno::Any SAL_CALL queryInterface( \
- const css::uno::Type& _rType) override; \
- \
- /* css::lang::XEventListener */ \
- virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; \
- \
- virtual void SAL_CALL methodname(const eventtype& e) override; \
- \
- void addInterface(const OUString& rName, const css::uno::Reference< css::uno::XInterface >& rListener); \
- void removeInterface(const OUString& rName, const css::uno::Reference< css::uno::XInterface >& rListener); \
- \
- void disposeAndClear(); \
- \
- sal_Int32 getOverallLen() const; \
- \
- ::cppu::OInterfaceContainerHelper* getContainer(const OUString& rName) \
- { return m_aListeners.getContainer(rName); } \
- \
- private: \
- void Notify(::cppu::OInterfaceContainerHelper& rListeners, const eventtype& e); \
- }; \
-
- // implementation of property listener multiplexers
- #define IMPLEMENT_PROPERTY_MULTIPLEXER(classname, listenerclass, methodname, eventtype) \
- classname::classname(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex) \
- :OSbaWeakSubObject(rSource) \
- ,m_aListeners(rMutex) \
- { \
- } \
- \
- css::uno::Any SAL_CALL classname::queryInterface( \
- const css::uno::Type& _rType) \
- { \
- css::uno::Any aReturn = \
- OSbaWeakSubObject::queryInterface(_rType); \
- if (!aReturn.hasValue()) \
- aReturn = ::cppu::queryInterface(_rType, \
- static_cast< listenerclass* >(this), \
- static_cast< css::lang::XEventListener* >(static_cast< listenerclass* >(this)) \
- ); \
- \
- return aReturn; \
- } \
- void SAL_CALL classname::disposing(const css::lang::EventObject& )\
- { \
- } \
- \
- void SAL_CALL classname::methodname(const eventtype& e) \
- { \
- ::cppu::OInterfaceContainerHelper* pListeners = m_aListeners.getContainer(e.PropertyName); \
- if (pListeners) \
- Notify(*pListeners, e); \
- \
- /* do the notification for the unspecialized listeners, too */ \
- pListeners = m_aListeners.getContainer(OUString()); \
- if (pListeners) \
- Notify(*pListeners, e); \
- } \
- \
- void classname::addInterface(const OUString& rName, \
- const css::uno::Reference< css::uno::XInterface > & rListener) \
- { \
- m_aListeners.addInterface(rName, rListener); \
- } \
- \
- void classname::removeInterface(const OUString& rName, \
- const css::uno::Reference< css::uno::XInterface > & rListener) \
- { \
- m_aListeners.removeInterface(rName, rListener); \
- } \
- \
- void classname::disposeAndClear() \
- { \
- css::lang::EventObject aEvt(m_rParent); \
- m_aListeners.disposeAndClear(aEvt); \
- } \
- \
- sal_Int32 classname::getOverallLen() const \
- { \
- sal_Int32 nLen = 0; \
- const css::uno::Sequence< OUString > aContained = m_aListeners.getContainedTypes(); \
- for ( OUString const & s : aContained) \
- { \
- ::cppu::OInterfaceContainerHelper* pListeners = m_aListeners.getContainer(s); \
- if (!pListeners) \
- continue; \
- nLen += pListeners->getLength(); \
- } \
- return nLen; \
- } \
- \
- void classname::Notify(::cppu::OInterfaceContainerHelper& rListeners, const eventtype& e) \
- { \
- eventtype aMulti(e); \
- aMulti.Source = &m_rParent; \
- ::cppu::OInterfaceIteratorHelper aIt(rListeners); \
- while (aIt.hasMoreElements()) \
- static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \
- } \
-
- // helper for classes which do property event multiplexing
- #define IMPLEMENT_PROPERTY_LISTENER_ADMINISTRATION(classname, listenerdesc, multiplexer, broadcasterclass, broadcaster) \
- void SAL_CALL classname::add##listenerdesc(const OUString& rName, const css::uno::Reference< css::beans::X##listenerdesc >& l )\
- { \
- multiplexer.addInterface(rName, l); \
- if (multiplexer.getOverallLen() == 1) \
- { \
- css::uno::Reference< broadcasterclass > xBroadcaster(broadcaster, css::uno::UNO_QUERY); \
- if (xBroadcaster.is()) \
- xBroadcaster->add##listenerdesc(OUString(), &multiplexer); \
- } \
- } \
- void SAL_CALL classname::remove##listenerdesc(const OUString& rName, const css::uno::Reference< css::beans::X##listenerdesc >& l )\
- { \
- if (multiplexer.getOverallLen() == 1) \
- { \
- css::uno::Reference< broadcasterclass > xBroadcaster(broadcaster, css::uno::UNO_QUERY); \
- if (xBroadcaster.is()) \
- xBroadcaster->remove##listenerdesc(OUString(), &multiplexer); \
- } \
- multiplexer.removeInterface(rName, l); \
- } \
-
- #define STOP_PROPERTY_MULTIPLEXER_LISTENING(listenerdesc, multiplexer, broadcasterclass, broadcaster) \
- if (multiplexer.getOverallLen()) \
- { \
- css::uno::Reference< broadcasterclass > xBroadcaster(broadcaster, css::uno::UNO_QUERY); \
- if (xBroadcaster.is()) \
- xBroadcaster->remove##listenerdesc(OUString(), &multiplexer); \
- } \
-
- #define START_PROPERTY_MULTIPLEXER_LISTENING(listenerdesc, multiplexer, broadcasterclass, broadcaster) \
- if (multiplexer.getOverallLen()) \
- { \
- css::uno::Reference< broadcasterclass > xBroadcaster(broadcaster, css::uno::UNO_QUERY); \
- if (xBroadcaster.is()) \
- xBroadcaster->add##listenerdesc(OUString(), &multiplexer); \
- } \
-
// some listener multiplexers
// css::frame::XStatusListener
- BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXStatusMultiplexer, css::frame::XStatusListener)
- DECLARE_MULTIPLEXER_VOID_METHOD(statusChanged, css::frame::FeatureStateEvent)
+ class SbaXStatusMultiplexer
+ :public OSbaWeakSubObject
+ ,public css::frame::XStatusListener
+ ,public ::comphelper::OInterfaceContainerHelper3<css::frame::XStatusListener>
+ {
+ public:
+ SbaXStatusMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex);
+ DECLARE_UNO3_DEFAULTS(SbaXStatusMultiplexer, OSbaWeakSubObject)
+ virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override;
+
+ /* css::lang::XEventListener */
+ virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
+
+ virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& e) override;
private:
css::frame::FeatureStateEvent m_aLastKnownStatus;
- public: \
+ public:
const css::frame::FeatureStateEvent& getLastEvent( ) const { return m_aLastKnownStatus; }
- END_DECLARE_LISTENER_MULTIPLEXER()
+ /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */
+ using OSbaWeakSubObject::operator new;
+ using OSbaWeakSubObject::operator delete;
+ };
// css::form::XLoadListener
- BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXLoadMultiplexer, css::form::XLoadListener)
- DECLARE_MULTIPLEXER_VOID_METHOD(loaded, css::lang::EventObject)
- DECLARE_MULTIPLEXER_VOID_METHOD(unloaded, css::lang::EventObject)
- DECLARE_MULTIPLEXER_VOID_METHOD(unloading, css::lang::EventObject)
- DECLARE_MULTIPLEXER_VOID_METHOD(reloading, css::lang::EventObject)
- DECLARE_MULTIPLEXER_VOID_METHOD(reloaded, css::lang::EventObject)
- END_DECLARE_LISTENER_MULTIPLEXER()
+ class SbaXLoadMultiplexer
+ :public OSbaWeakSubObject
+ ,public css::form::XLoadListener
+ ,public ::comphelper::OInterfaceContainerHelper3<css::form::XLoadListener>
+ {
+ public:
+ SbaXLoadMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex);
+ DECLARE_UNO3_DEFAULTS(SbaXLoadMultiplexer, OSbaWeakSubObject)
+ virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override;
+
+ /* css::lang::XEventListener */
+ virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
+
+ virtual void SAL_CALL loaded(const css::lang::EventObject& e) override;
+ virtual void SAL_CALL unloaded(const css::lang::EventObject& e) override;
+ virtual void SAL_CALL unloading(const css::lang::EventObject& e) override;
+ virtual void SAL_CALL reloading(const css::lang::EventObject& e) override;
+ virtual void SAL_CALL reloaded(const css::lang::EventObject& e) override;
+ /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */
+ using OSbaWeakSubObject::operator new;
+ using OSbaWeakSubObject::operator delete;
+ };
// css::form::XDatabaseParameterListener
- BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXParameterMultiplexer, css::form::XDatabaseParameterListener)
- DECLARE_MULTIPLEXER_BOOL_METHOD(approveParameter, css::form::DatabaseParameterEvent)
- END_DECLARE_LISTENER_MULTIPLEXER()
+ class SbaXParameterMultiplexer
+ :public OSbaWeakSubObject
+ ,public css::form::XDatabaseParameterListener
+ ,public ::comphelper::OInterfaceContainerHelper3<css::form::XDatabaseParameterListener>
+ {
+ public:
+ SbaXParameterMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex);
+ DECLARE_UNO3_DEFAULTS(SbaXParameterMultiplexer, OSbaWeakSubObject)
+ virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override;
+
+ /* css::lang::XEventListener */
+ virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
+ virtual sal_Bool SAL_CALL approveParameter(const css::form::DatabaseParameterEvent& e) override;
+ /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */
+ using OSbaWeakSubObject::operator new;
+ using OSbaWeakSubObject::operator delete;
+ };
// css::form::XSubmitListener
- BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXSubmitMultiplexer, css::form::XSubmitListener)
- DECLARE_MULTIPLEXER_BOOL_METHOD(approveSubmit, css::lang::EventObject)
- END_DECLARE_LISTENER_MULTIPLEXER()
+ class SbaXSubmitMultiplexer
+ :public OSbaWeakSubObject
+ ,public css::form::XSubmitListener
+ ,public ::comphelper::OInterfaceContainerHelper3<css::form::XSubmitListener>
+ {
+ public:
+ SbaXSubmitMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex);
+ DECLARE_UNO3_DEFAULTS(SbaXSubmitMultiplexer, OSbaWeakSubObject)
+ virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override;
+
+ /* css::lang::XEventListener */
+ virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
+ virtual sal_Bool SAL_CALL approveSubmit(const css::lang::EventObject& e) override;
+ /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */
+ using OSbaWeakSubObject::operator new;
+ using OSbaWeakSubObject::operator delete;
+ };
// css::form::XResetListener
- BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXResetMultiplexer, css::form::XResetListener)
- DECLARE_MULTIPLEXER_BOOL_METHOD(approveReset, css::lang::EventObject)
- DECLARE_MULTIPLEXER_VOID_METHOD(resetted, css::lang::EventObject)
- END_DECLARE_LISTENER_MULTIPLEXER()
+ class SbaXResetMultiplexer
+ :public OSbaWeakSubObject
+ ,public css::form::XResetListener
+ ,public ::comphelper::OInterfaceContainerHelper3<css::form::XResetListener>
+ {
+ public:
+ SbaXResetMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex);
+ DECLARE_UNO3_DEFAULTS(SbaXResetMultiplexer, OSbaWeakSubObject)
+ virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override;
+
+ /* css::lang::XEventListener */
+ virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
+ virtual sal_Bool SAL_CALL approveReset(const css::lang::EventObject& e) override;
+ virtual void SAL_CALL resetted(const css::lang::EventObject& e) override;
+ /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */
+ using OSbaWeakSubObject::operator new;
+ using OSbaWeakSubObject::operator delete;
+ };
// css::sdbc::XRowSetListener
- BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXRowSetMultiplexer, css::sdbc::XRowSetListener)
- DECLARE_MULTIPLEXER_VOID_METHOD(cursorMoved, css::lang::EventObject)
- DECLARE_MULTIPLEXER_VOID_METHOD(rowChanged, css::lang::EventObject)
- DECLARE_MULTIPLEXER_VOID_METHOD(rowSetChanged, css::lang::EventObject)
- END_DECLARE_LISTENER_MULTIPLEXER()
+ class SbaXRowSetMultiplexer
+ :public OSbaWeakSubObject
+ ,public css::sdbc::XRowSetListener
+ ,public ::comphelper::OInterfaceContainerHelper3<css::sdbc::XRowSetListener>
+ {
+ public:
+ SbaXRowSetMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex);
+ DECLARE_UNO3_DEFAULTS(SbaXRowSetMultiplexer, OSbaWeakSubObject)
+ virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override;
+
+ /* css::lang::XEventListener */
+ virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
+ virtual void SAL_CALL cursorMoved(const css::lang::EventObject& e) override;
+ virtual void SAL_CALL rowChanged(const css::lang::EventObject& e) override;
+ virtual void SAL_CALL rowSetChanged(const css::lang::EventObject& e) override;
+ /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */
+ using OSbaWeakSubObject::operator new;
+ using OSbaWeakSubObject::operator delete;
+ };
// css::sdb::XRowSetApproveListener
- BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXRowSetApproveMultiplexer, css::sdb::XRowSetApproveListener)
- DECLARE_MULTIPLEXER_BOOL_METHOD(approveCursorMove, css::lang::EventObject)
- DECLARE_MULTIPLEXER_BOOL_METHOD(approveRowChange, css::sdb::RowChangeEvent)
- DECLARE_MULTIPLEXER_BOOL_METHOD(approveRowSetChange, css::lang::EventObject)
- END_DECLARE_LISTENER_MULTIPLEXER()
+ class SbaXRowSetApproveMultiplexer
+ :public OSbaWeakSubObject
+ ,public css::sdb::XRowSetApproveListener
+ ,public ::comphelper::OInterfaceContainerHelper3<css::sdb::XRowSetApproveListener>
+ {
+ public:
+ SbaXRowSetApproveMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex);
+ DECLARE_UNO3_DEFAULTS(SbaXRowSetApproveMultiplexer, OSbaWeakSubObject)
+ virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override;
+
+ /* css::lang::XEventListener */
+ virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
+ virtual sal_Bool SAL_CALL approveCursorMove(const css::lang::EventObject& e) override;
+ virtual sal_Bool SAL_CALL approveRowChange(const css::sdb::RowChangeEvent& e) override;
+ virtual sal_Bool SAL_CALL approveRowSetChange(const css::lang::EventObject& e) override;
+ /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */
+ using OSbaWeakSubObject::operator new;
+ using OSbaWeakSubObject::operator delete;
+ };
// css::sdb::XSQLErrorListener
- BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXSQLErrorMultiplexer, css::sdb::XSQLErrorListener)
- DECLARE_MULTIPLEXER_VOID_METHOD(errorOccured, css::sdb::SQLErrorEvent)
- END_DECLARE_LISTENER_MULTIPLEXER()
+ class SbaXSQLErrorMultiplexer
+ :public OSbaWeakSubObject
+ ,public css::sdb::XSQLErrorListener
+ ,public ::comphelper::OInterfaceContainerHelper3<css::sdb::XSQLErrorListener>
+ {
+ public:
+ SbaXSQLErrorMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex);
+ DECLARE_UNO3_DEFAULTS(SbaXSQLErrorMultiplexer, OSbaWeakSubObject)
+ virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override;
+
+ /* css::lang::XEventListener */
+ virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
+ virtual void SAL_CALL errorOccured(const css::sdb::SQLErrorEvent& e) override;
+ /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */
+ using OSbaWeakSubObject::operator new;
+ using OSbaWeakSubObject::operator delete;
+ };
// css::beans::XPropertyChangeListener
- DECLARE_PROPERTY_MULTIPLEXER(SbaXPropertyChangeMultiplexer, css::beans::XPropertyChangeListener, propertyChange, css::beans::PropertyChangeEvent)
+ class SbaXPropertyChangeMultiplexer final
+ :public OSbaWeakSubObject
+ ,public css::beans::XPropertyChangeListener
+ {
+ typedef ::comphelper::OMultiTypeInterfaceContainerHelperVar3<css::beans::XPropertyChangeListener, OUString> ListenerContainerMap;
+ ListenerContainerMap m_aListeners;
+
+ public:
+ SbaXPropertyChangeMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex );
+ DECLARE_UNO3_DEFAULTS(SbaXPropertyChangeMultiplexer, OSbaWeakSubObject)
+ virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override;
+
+ /* css::lang::XEventListener */
+ virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
+
+ virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent& e) override;
+
+ void addInterface(const OUString& rName, const css::uno::Reference< css::beans::XPropertyChangeListener >& rListener);
+ void removeInterface(const OUString& rName, const css::uno::Reference< css::beans::XPropertyChangeListener >& rListener);
+
+ void disposeAndClear();
+
+ sal_Int32 getOverallLen() const;
+
+ ::comphelper::OInterfaceContainerHelper3<css::beans::XPropertyChangeListener>* getContainer(const OUString& rName)
+ { return m_aListeners.getContainer(rName); }
+
+ private:
+ void Notify(::comphelper::OInterfaceContainerHelper3<css::beans::XPropertyChangeListener>& rListeners, const css::beans::PropertyChangeEvent& e);
+ };
// css::beans::XVetoableChangeListener
- DECLARE_PROPERTY_MULTIPLEXER(SbaXVetoableChangeMultiplexer, css::beans::XVetoableChangeListener, vetoableChange, css::beans::PropertyChangeEvent)
+ class SbaXVetoableChangeMultiplexer final
+ :public OSbaWeakSubObject
+ ,public css::beans::XVetoableChangeListener
+ {
+ typedef ::comphelper::OMultiTypeInterfaceContainerHelperVar3<css::beans::XVetoableChangeListener, OUString > ListenerContainerMap;
+ ListenerContainerMap m_aListeners;
+
+ public:
+ SbaXVetoableChangeMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex );
+ DECLARE_UNO3_DEFAULTS(SbaXVetoableChangeMultiplexer, OSbaWeakSubObject)
+ virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override;
+
+ /* css::lang::XEventListener */
+ virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
+
+ virtual void SAL_CALL vetoableChange(const css::beans::PropertyChangeEvent& e) override;
+
+ void addInterface(const OUString& rName, const css::uno::Reference< css::beans::XVetoableChangeListener >& rListener);
+ void removeInterface(const OUString& rName, const css::uno::Reference< css::beans::XVetoableChangeListener >& rListener);
+
+ void disposeAndClear();
+
+ sal_Int32 getOverallLen() const;
+
+ private:
+ void Notify(::comphelper::OInterfaceContainerHelper3<css::beans::XVetoableChangeListener>& rListeners, const css::beans::PropertyChangeEvent& e);
+ };
// css::beans::XPropertiesChangeListener
- BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXPropertiesChangeMultiplexer, css::beans::XPropertiesChangeListener)
- DECLARE_MULTIPLEXER_VOID_METHOD(propertiesChange, css::uno::Sequence< css::beans::PropertyChangeEvent >)
- END_DECLARE_LISTENER_MULTIPLEXER()
+ class SbaXPropertiesChangeMultiplexer
+ :public OSbaWeakSubObject
+ ,public css::beans::XPropertiesChangeListener
+ ,public ::comphelper::OInterfaceContainerHelper3<css::beans::XPropertiesChangeListener>
+ {
+ public:
+ SbaXPropertiesChangeMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex);
+ DECLARE_UNO3_DEFAULTS(SbaXPropertiesChangeMultiplexer, OSbaWeakSubObject)
+ virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override;
+
+ /* css::lang::XEventListener */
+ virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
+ virtual void SAL_CALL propertiesChange(const css::uno::Sequence< css::beans::PropertyChangeEvent >& e) override;
+ /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */
+ using OSbaWeakSubObject::operator new;
+ using OSbaWeakSubObject::operator delete;
+ };
// the SbaXPropertiesChangeMultiplexer doesn't care about the property names a listener logs on for, it simply
// forwards _all_ changes to _all_ listeners
}
diff --git a/dbaccess/source/ui/inc/singledoccontroller.hxx b/dbaccess/source/ui/inc/singledoccontroller.hxx
index e5e11ba7a2f0..6b535882bc80 100644
--- a/dbaccess/source/ui/inc/singledoccontroller.hxx
+++ b/dbaccess/source/ui/inc/singledoccontroller.hxx
@@ -31,9 +31,8 @@ class SfxUndoManager;
namespace dbaui
{
+class UndoManager;
- // OSingleDocumentController
- struct OSingleDocumentController_Data;
typedef ::cppu::ImplInheritanceHelper< DBSubComponentController
, css::document::XUndoManagerSupplier
> OSingleDocumentController_Base;
@@ -70,7 +69,8 @@ namespace dbaui
using OSingleDocumentController_Base::disposing;
private:
- std::unique_ptr< OSingleDocumentController_Data > m_pData;
+ // no Reference! see UndoManager::acquire
+ std::unique_ptr<UndoManager> m_pUndoManager;
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/inc/sqledit.hxx b/dbaccess/source/ui/inc/sqledit.hxx
index 6f85ba825a71..d0f8672cc698 100644
--- a/dbaccess/source/ui/inc/sqledit.hxx
+++ b/dbaccess/source/ui/inc/sqledit.hxx
@@ -25,6 +25,7 @@
#include <svtools/colorcfg.hxx>
#include <svx/weldeditview.hxx>
#include <vcl/timer.hxx>
+#include <mutex>
namespace com::sun::star::beans { class XMultiPropertySet; }
@@ -36,6 +37,7 @@ namespace dbaui
class ChangesListener;
friend class ChangesListener;
+ std::unique_ptr<weld::ScrolledWindow> m_xScrolledWindow;
Link<LinkParamNone*,void> m_aModifyLink;
const svtools::ColorConfig m_aColorConfig;
Timer m_aUpdateDataTimer;
@@ -44,7 +46,7 @@ namespace dbaui
rtl::Reference<SfxItemPool> m_pItemPool;
rtl::Reference<ChangesListener> m_listener;
- osl::Mutex m_mutex;
+ std::mutex m_mutex;
css::uno::Reference<css::beans::XMultiPropertySet> m_notifier;
bool m_bInUpdate;
@@ -52,6 +54,8 @@ namespace dbaui
DECL_LINK(ModifyHdl, LinkParamNone*, void);
DECL_LINK(ImplUpdateDataHdl, Timer*, void);
+ DECL_LINK(ScrollHdl, weld::ScrolledWindow&, void);
+ DECL_LINK(EditStatusHdl, EditStatus&, void);
Color GetColorValue(TokenType aToken);
@@ -62,13 +66,20 @@ namespace dbaui
static void SetItemPoolFont(SfxItemPool* pItemPool);
void UpdateData();
+
+ void SetScrollBarRange();
+ void DoScroll();
+
+ virtual void EditViewScrollStateChange() override;
+
public:
- SQLEditView();
+ SQLEditView(std::unique_ptr<weld::ScrolledWindow> xScrolledWindow);
virtual void makeEditEngine() override;
virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
virtual ~SQLEditView() override;
virtual bool KeyInput(const KeyEvent& rKEvt) override;
+ virtual bool Command(const CommandEvent& rCEvt) override;
void SetTextAndUpdate(const OUString& rNewText);
diff --git a/dbaccess/source/ui/inc/sqlmessage.hxx b/dbaccess/source/ui/inc/sqlmessage.hxx
index a2541dc0fe38..481732985d12 100644
--- a/dbaccess/source/ui/inc/sqlmessage.hxx
+++ b/dbaccess/source/ui/inc/sqlmessage.hxx
@@ -89,7 +89,7 @@ public:
weld::Window* pParent,
const dbtools::SQLExceptionInfo& _rException,
MessBoxStyle _nStyle = MessBoxStyle::Ok | MessBoxStyle::DefaultOk,
- const OUString& _rHelpURL = OUString()
+ OUString _sHelpURL = OUString()
);
/** display a database related error message
@@ -106,7 +106,7 @@ public:
const ::dbtools::SQLExceptionInfo* _pAdditionalErrorInfo = nullptr );
void set_title(const OUString& rTitle) { m_xDialog->set_title(rTitle); }
- void add_button(const OUString& rText, int nResponse, const OString& rHelpId = OString()) { m_xDialog->add_button(rText, nResponse, rHelpId); }
+ void add_button(const OUString& rText, int nResponse, const OUString& rHelpId = {}) { m_xDialog->add_button(rText, nResponse, rHelpId); }
void set_default_response(int nResponse) { m_xDialog->set_default_response(nResponse); }
virtual ~OSQLMessageBox() override;
diff --git a/dbaccess/source/ui/inc/tabletree.hxx b/dbaccess/source/ui/inc/tabletree.hxx
index 941ba2a1a80c..ebfbf7d29c4a 100644
--- a/dbaccess/source/ui/inc/tabletree.hxx
+++ b/dbaccess/source/ui/inc/tabletree.hxx
@@ -104,7 +104,7 @@ public:
void checkedButton_noBroadcast(const weld::TreeIter& rEntry);
private:
- TriState implDetermineState(weld::TreeIter& rEntry);
+ TriState implDetermineState(const weld::TreeIter& rEntry);
void implEmphasize(const weld::TreeIter& rEntry, bool _bChecked, bool _bUpdateDescendants = true, bool _bUpdateAncestors = true);
@@ -139,13 +139,13 @@ public:
/** returns a NamedDatabaseObject record which describes the given entry
*/
css::sdb::application::NamedDatabaseObject
- describeObject(weld::TreeIter& rEntry);
+ describeObject(const weld::TreeIter& rEntry);
/** returns the fully qualified name of a table entry
@param _pEntry
the entry whose name is to be obtained. Must not denote a folder entry.
*/
- OUString getQualifiedTableName(weld::TreeIter& rEntry) const;
+ OUString getQualifiedTableName(const weld::TreeIter& rEntry) const;
std::unique_ptr<weld::TreeIter> getEntryByQualifiedName(const OUString& rName);
};
diff --git a/dbaccess/source/ui/inc/unoadmin.hxx b/dbaccess/source/ui/inc/unoadmin.hxx
index 944dccf87ae6..a1d6de4e8a0f 100644
--- a/dbaccess/source/ui/inc/unoadmin.hxx
+++ b/dbaccess/source/ui/inc/unoadmin.hxx
@@ -25,7 +25,6 @@
class SfxItemSet;
class SfxItemPool;
-class SfxPoolItem;
namespace dbaui
{
@@ -38,8 +37,6 @@ class ODatabaseAdministrationDialog
protected:
std::unique_ptr<SfxItemSet> m_pDatasourceItems; // item set for the dialog
rtl::Reference<SfxItemPool> m_pItemPool; // item pool for the item set for the dialog
- std::vector<SfxPoolItem*>*
- m_pItemPoolDefaults; // pool defaults
std::unique_ptr<::dbaccess::ODsnTypeCollection>
m_pCollection; // datasource type collection
diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx
index 637f173da20e..61905563f940 100644
--- a/dbaccess/source/ui/inc/unodatbr.hxx
+++ b/dbaccess/source/ui/inc/unodatbr.hxx
@@ -31,8 +31,10 @@
#include <com/sun/star/sdb/application/DatabaseObject.hpp>
#include <com/sun/star/sdb/application/DatabaseObjectContainer.hpp>
#include <com/sun/star/sdb/XDatabaseRegistrationsListener.hpp>
+#include <comphelper/interfacecontainer2.hxx>
#include <cppuhelper/implbase5.hxx>
#include "callbacks.hxx"
+#include <utility>
#include <vcl/transfer.hxx>
#include <svx/dataaccessdescriptor.hxx>
#include "TableCopyHelper.hxx"
@@ -46,6 +48,7 @@ namespace com::sun::star::container { class XNameContainer; }
namespace dbaui
{
struct DBTreeEditedEntry;
+ struct DBTreeListUserData;
class ImageProvider;
typedef ::cppu::ImplHelper5 < css::frame::XStatusListener
@@ -72,7 +75,7 @@ namespace dbaui
bool bEnabled;
ExternalFeature() : bEnabled( false ) { }
- ExternalFeature( const css::util::URL& _rURL ) : aURL( _rURL ), bEnabled( false ) { }
+ ExternalFeature( css::util::URL _aURL ) : aURL(std::move( _aURL )), bEnabled( false ) { }
};
typedef std::map< sal_uInt16, ExternalFeature > ExternalFeaturesMap;
@@ -219,7 +222,7 @@ namespace dbaui
virtual vcl::Window* getMenuParent() const override;
virtual void adjustMenuPosition(const weld::TreeView& rControl, ::Point& rPos) const override;
- virtual void impl_initialize() override;
+ virtual void impl_initialize(const ::comphelper::NamedValueCollection& rArguments) override;
// SbaGridListener overridables
virtual void RowChanged() override;
@@ -289,7 +292,7 @@ namespace dbaui
/** close the connection (and collapse the list entries) of the given list entries
*/
- void closeConnection(weld::TreeIter& rEntry, bool bDisposeConnection = true);
+ void closeConnection(const weld::TreeIter& rEntry, bool bDisposeConnection = true);
void populateTree(const css::uno::Reference< css::container::XNameAccess>& xNameAccess, const weld::TreeIter& rParent, EntryType eEntryType);
void initializeTreeModel();
@@ -308,7 +311,7 @@ namespace dbaui
*/
std::unique_ptr<ImageProvider> getImageProviderFor(const weld::TreeIter* pAnyEntry);
- void implAdministrate(weld::TreeIter& rApplyTo);
+ void implAdministrate(const weld::TreeIter& rApplyTo);
bool implCopyObject(ODataClipboard& rExchange, const weld::TreeIter& rApplyTo, sal_Int32 nCommandType);
@@ -349,14 +352,12 @@ namespace dbaui
bool _bSelectDirect
);
- std::unique_ptr<weld::TreeIter> implGetConnectionEntry(weld::TreeIter& rEntry) const;
+ std::unique_ptr<weld::TreeIter> implGetConnectionEntry(const weld::TreeIter& rEntry) const;
/// inserts an entry into the tree
std::unique_ptr<weld::TreeIter> implAppendEntry(
const weld::TreeIter* pParent,
const OUString& rName,
- void* pUserData,
- EntryType eEntryType
- );
+ const DBTreeListUserData* pUserData);
/// loads the grid control with the data object specified (which may be a table, a query or a command)
bool implLoadAnything(const OUString& _rDataSourceName, const OUString& _rCommand,
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index cc24fe114c63..a1e02b8745be 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -40,11 +40,11 @@
#include <TypeInfo.hxx>
#include <FieldDescriptions.hxx>
#include <UITools.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <WCopyTable.hxx>
#include <unotools/syslocale.hxx>
-#include <svl/zforlist.hxx>
+#include <svl/numformat.hxx>
#include <connectivity/dbexception.hxx>
#include <connectivity/FValue.hxx>
#include <com/sun/star/sdb/application/CopyTableOperation.hpp>
@@ -68,20 +68,19 @@ namespace CopyTableOperation = ::com::sun::star::sdb::application::CopyTableOper
// ODatabaseExport
ODatabaseExport::ODatabaseExport(sal_Int32 nRows,
- const TPositions &_rColumnPositions,
+ TPositions&&_rColumnPositions,
const Reference< XNumberFormatter >& _rxNumberF,
const Reference< css::uno::XComponentContext >& _rxContext,
const TColumnVector* pList,
const OTypeInfoMap* _pInfoMap,
bool _bAutoIncrementEnabled,
SvStream& _rInputStream)
- :m_vColumnPositions(_rColumnPositions)
+ :m_vColumnPositions(std::move(_rColumnPositions))
,m_aDestColumns(true)
,m_xFormatter(_rxNumberF)
,m_xContext(_rxContext)
,m_pFormatter(nullptr)
,m_rInputStream( _rInputStream )
- ,m_pTypeInfo()
,m_pColumnList(pList)
,m_pInfoMap(_pInfoMap)
,m_nColumnPos(0)
@@ -132,7 +131,6 @@ ODatabaseExport::ODatabaseExport(const SharedConnection& _rxConnection,
,m_xContext(_rxContext)
,m_pFormatter(nullptr)
,m_rInputStream( _rInputStream )
- ,m_pTypeInfo()
,m_pColumnList(nullptr)
,m_pInfoMap(nullptr)
,m_nColumnPos(0)
@@ -190,11 +188,11 @@ ODatabaseExport::ODatabaseExport(const SharedConnection& _rxConnection,
sal_Int32 nPos = 1;
OSL_ENSURE((nPos) < static_cast<sal_Int32>(aTypes.size()),"aTypes: Illegal index for vector");
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- OUString sTypeName = aValue;
+ OUString sTypeName = aValue.getString();
++nPos;
OSL_ENSURE((nPos) < static_cast<sal_Int32>(aTypes.size()),"aTypes: Illegal index for vector");
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- sal_Int32 nType = aValue;
+ sal_Int32 nType = aValue.getInt32();
++nPos;
if( nType == DataType::VARCHAR )
@@ -206,44 +204,44 @@ ODatabaseExport::ODatabaseExport(const SharedConnection& _rxConnection,
OSL_ENSURE((nPos) < static_cast<sal_Int32>(aTypes.size()),"aTypes: Illegal index for vector");
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- m_pTypeInfo->nPrecision = aValue;
+ m_pTypeInfo->nPrecision = aValue.getInt32();
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow); //LiteralPrefix
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow); //LiteralSuffix
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- m_pTypeInfo->aCreateParams = aValue;
+ m_pTypeInfo->aCreateParams = aValue.getString();
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- m_pTypeInfo->bNullable = static_cast<sal_Int32>(aValue) == ColumnValue::NULLABLE;
+ m_pTypeInfo->bNullable = aValue.getInt32() == ColumnValue::NULLABLE;
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
// bCaseSensitive
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- m_pTypeInfo->nSearchType = aValue;
+ m_pTypeInfo->nSearchType = aValue.getInt16();
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
// bUnsigned
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- m_pTypeInfo->bCurrency = aValue;
+ m_pTypeInfo->bCurrency = aValue.getBool();
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- m_pTypeInfo->bAutoIncrement = aValue;
+ m_pTypeInfo->bAutoIncrement = aValue.getBool();
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- m_pTypeInfo->aLocalTypeName = aValue;
+ m_pTypeInfo->aLocalTypeName = aValue.getString();
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- m_pTypeInfo->nMinimumScale = aValue;
+ m_pTypeInfo->nMinimumScale = aValue.getInt16();
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- m_pTypeInfo->nMaximumScale = aValue;
+ m_pTypeInfo->nMaximumScale = aValue.getInt16();
nPos = 18;
aValue.fill(nPos,aTypes[nPos],xRow);
- m_pTypeInfo->nNumPrecRadix = aValue;
+ m_pTypeInfo->nNumPrecRadix = aValue.getInt32();
// check if values are less than zero like it happens in a oracle jdbc driver
if( m_pTypeInfo->nPrecision < 0)
@@ -657,18 +655,18 @@ void ODatabaseExport::CreateDefaultColumn(const OUString& _rColumnName)
void ODatabaseExport::createRowSet()
{
- m_pUpdateHelper = std::make_shared<OParameterUpdateHelper>(createPreparedStatment(m_xConnection->getMetaData(),m_xTable,m_vColumnPositions));
+ m_pUpdateHelper = std::make_shared<OParameterUpdateHelper>(createPreparedStatement(m_xConnection->getMetaData(),m_xTable,m_vColumnPositions));
}
bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTextColor, const FontDescriptor& _rFont)
{
bool bHaveDefaultTable = !m_sDefaultTableName.isEmpty();
- OUString sTableName( bHaveDefaultTable ? m_sDefaultTableName : _rTableName );
+ const OUString& rTableName(bHaveDefaultTable ? m_sDefaultTableName : _rTableName);
OCopyTableWizard aWizard(
nullptr,
- sTableName,
+ rTableName,
bHaveDefaultTable ? CopyTableOperation::AppendData : CopyTableOperation::CopyDefinitionAndData,
- m_aDestColumns,
+ ODatabaseExport::TColumns(m_aDestColumns),
m_vDestVector,
m_xConnection,
m_xFormatter,
@@ -691,7 +689,7 @@ bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTe
bError = !m_xTable.is();
if(m_xTable.is())
{
- m_xTable->setPropertyValue(PROPERTY_FONT,makeAny(_rFont));
+ m_xTable->setPropertyValue(PROPERTY_FONT,Any(_rFont));
if(_aTextColor.hasValue())
m_xTable->setPropertyValue(PROPERTY_TEXTCOLOR,_aTextColor);
}
@@ -773,14 +771,14 @@ void ODatabaseExport::ensureFormatter()
if ( !m_pFormatter )
{
Reference< XNumberFormatsSupplier > xSupplier = m_xFormatter->getNumberFormatsSupplier();
- auto pSupplierImpl = comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>(xSupplier);
+ auto pSupplierImpl = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>(xSupplier);
m_pFormatter = pSupplierImpl ? pSupplierImpl->GetNumberFormatter() : nullptr;
Reference<XPropertySet> xNumberFormatSettings = xSupplier->getNumberFormatSettings();
xNumberFormatSettings->getPropertyValue("NullDate") >>= m_aNullDate;
}
}
-Reference< XPreparedStatement > ODatabaseExport::createPreparedStatment( const Reference<XDatabaseMetaData>& _xMetaData
+Reference< XPreparedStatement > ODatabaseExport::createPreparedStatement( const Reference<XDatabaseMetaData>& _xMetaData
,const Reference<XPropertySet>& _xDestTable
,const TPositions& _rvColumns)
{
@@ -825,8 +823,7 @@ Reference< XPreparedStatement > ODatabaseExport::createPreparedStatment( const R
{
if ( !elem.isEmpty() )
{
- aSql.append(elem);
- aSql.append(",");
+ aSql.append(elem + ",");
aValues.append("?,");
}
}
diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx
index 6e3d329e3ef2..c2917a6300e0 100644
--- a/dbaccess/source/ui/misc/HtmlReader.cxx
+++ b/dbaccess/source/ui/misc/HtmlReader.cxx
@@ -64,14 +64,14 @@ OHTMLReader::OHTMLReader(SvStream& rIn,const SharedConnection& _rxConnection,
OHTMLReader::OHTMLReader(SvStream& rIn,
sal_Int32 nRows,
- const TPositions &_rColumnPositions,
+ TPositions&& _rColumnPositions,
const Reference< css::util::XNumberFormatter >& _rxNumberF,
const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
const TColumnVector* pList,
const OTypeInfoMap* _pInfoMap,
bool _bAutoIncrementEnabled)
: HTMLParser(rIn)
- , ODatabaseExport( nRows, _rColumnPositions, _rxNumberF, _rxContext, pList, _pInfoMap, _bAutoIncrementEnabled, rIn )
+ , ODatabaseExport( nRows, std::move(_rColumnPositions), _rxNumberF, _rxContext, pList, _pInfoMap, _bAutoIncrementEnabled, rIn )
, m_nTableCount(0)
, m_nColumnWidth(87)
{
@@ -312,7 +312,7 @@ void OHTMLReader::TableFontOn(FontDescriptor& _rFont, Color &_rTextColor)
while( nPos != -1 )
{
// list of fonts, VCL: semicolon as separator, HTML: comma
- OUString aFName = rFace.getToken( 0, ',', nPos );
+ std::u16string_view aFName = o3tl::getToken(rFace, 0, ',', nPos );
aFName = comphelper::string::strip(aFName, ' ');
if( !aFontName.isEmpty() )
aFontName.append(";");
@@ -465,7 +465,7 @@ bool OHTMLReader::CreateTable(HtmlTokenId nToken)
if ( isCheckEnabled() )
return true;
- return !executeWizard(aTableName,makeAny(nTextColor),aFont) && m_xTable.is();
+ return !executeWizard(aTableName,Any(nTextColor),aFont) && m_xTable.is();
}
void OHTMLReader::setTextEncoding()
diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx
index 065fee9ce9c0..6fced2dfc16f 100644
--- a/dbaccess/source/ui/misc/RowSetDrop.cxx
+++ b/dbaccess/source/ui/misc/RowSetDrop.cxx
@@ -33,11 +33,7 @@
using namespace dbaui;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::util;
using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdb;
-using namespace ::com::sun::star::lang;
// export data
ORowSetImportExport::ORowSetImportExport(weld::Window* pParent,
diff --git a/dbaccess/source/ui/misc/RtfReader.cxx b/dbaccess/source/ui/misc/RtfReader.cxx
index 1a247ca88b06..8895d494f817 100644
--- a/dbaccess/source/ui/misc/RtfReader.cxx
+++ b/dbaccess/source/ui/misc/RtfReader.cxx
@@ -57,14 +57,14 @@ ORTFReader::ORTFReader( SvStream& rIn,
ORTFReader::ORTFReader(SvStream& rIn,
sal_Int32 nRows,
- const TPositions &_rColumnPositions,
+ TPositions&& _rColumnPositions,
const Reference< css::util::XNumberFormatter >& _rxNumberF,
const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
const TColumnVector* pList,
const OTypeInfoMap* _pInfoMap,
bool _bAutoIncrementEnabled)
:SvRTFParser(rIn)
- ,ODatabaseExport( nRows, _rColumnPositions, _rxNumberF, _rxContext, pList, _pInfoMap, _bAutoIncrementEnabled, rIn )
+ ,ODatabaseExport( nRows, std::move(_rColumnPositions), _rxNumberF, _rxContext, pList, _pInfoMap, _bAutoIncrementEnabled, rIn )
{
m_bAppendFirstLine = false;
}
diff --git a/dbaccess/source/ui/misc/TableCopyHelper.cxx b/dbaccess/source/ui/misc/TableCopyHelper.cxx
index b61718f3da71..5d22c90468c8 100644
--- a/dbaccess/source/ui/misc/TableCopyHelper.cxx
+++ b/dbaccess/source/ui/misc/TableCopyHelper.cxx
@@ -35,7 +35,7 @@
#include <svx/dbaexchange.hxx>
#include <unotools/ucbhelper.hxx>
#include <tools/urlobj.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <sal/log.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <unotools/tempfile.hxx>
@@ -48,12 +48,10 @@ using namespace ::svx;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::task;
using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdb::application;
using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::ucb;
OTableCopyHelper::OTableCopyHelper(OGenericUnoController* _pController)
@@ -89,15 +87,15 @@ void OTableCopyHelper::insertTable( std::u16string_view i_rSourceDataSource, con
Reference< XDataAccessDescriptorFactory > xFactory( DataAccessDescriptorFactory::get( aContext ) );
Reference< XPropertySet > xSource( xFactory->createDataAccessDescriptor(), UNO_SET_THROW );
- xSource->setPropertyValue( PROPERTY_COMMAND_TYPE, makeAny( i_nCommandType ) );
- xSource->setPropertyValue( PROPERTY_COMMAND, makeAny( i_rCommand ) );
- xSource->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( xSrcConnection ) );
- xSource->setPropertyValue( PROPERTY_RESULT_SET, makeAny( i_rSourceRows ) );
- xSource->setPropertyValue( PROPERTY_SELECTION, makeAny( i_rSelection ) );
- xSource->setPropertyValue( PROPERTY_BOOKMARK_SELECTION, makeAny( i_bBookmarkSelection ) );
+ xSource->setPropertyValue( PROPERTY_COMMAND_TYPE, Any( i_nCommandType ) );
+ xSource->setPropertyValue( PROPERTY_COMMAND, Any( i_rCommand ) );
+ xSource->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, Any( xSrcConnection ) );
+ xSource->setPropertyValue( PROPERTY_RESULT_SET, Any( i_rSourceRows ) );
+ xSource->setPropertyValue( PROPERTY_SELECTION, Any( i_rSelection ) );
+ xSource->setPropertyValue( PROPERTY_BOOKMARK_SELECTION, Any( i_bBookmarkSelection ) );
Reference< XPropertySet > xDest( xFactory->createDataAccessDescriptor(), UNO_SET_THROW );
- xDest->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( i_rDestConnection ) );
+ xDest->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, Any( i_rDestConnection ) );
auto xInteractionHandler = InteractionHandler::createWithParent(aContext, VCLUnoHelper::GetInterface(m_pController->getView()));
@@ -182,16 +180,15 @@ void OTableCopyHelper::pasteTable( SotClipboardFormatId _nFormatId
try
{
DropDescriptor aTrans;
- bool bOk;
if ( _nFormatId != SotClipboardFormatId::RTF )
- bOk = const_cast<TransferableDataHelper&>(_rTransData).GetSotStorageStream(SotClipboardFormatId::HTML ,aTrans.aHtmlRtfStorage);
+ aTrans.aHtmlRtfStorage = _rTransData.GetSotStorageStream(SotClipboardFormatId::HTML);
else
- bOk = const_cast<TransferableDataHelper&>(_rTransData).GetSotStorageStream(SotClipboardFormatId::RTF,aTrans.aHtmlRtfStorage);
+ aTrans.aHtmlRtfStorage = _rTransData.GetSotStorageStream(SotClipboardFormatId::RTF);
aTrans.nType = E_TABLE;
aTrans.bHtml = SotClipboardFormatId::HTML == _nFormatId;
aTrans.sDefaultTableName = GetTableNameForAppend();
- if ( !bOk || !copyTagTable(aTrans,false,_xConnection) )
+ if ( !aTrans.aHtmlRtfStorage || !copyTagTable(aTrans,false,_xConnection) )
m_pController->showError(SQLException(DBA_RES(STR_NO_TABLE_FORMAT_INSIDE), *m_pController, "S1000", 0, Any()));
}
catch(const SQLException&)
@@ -256,25 +253,21 @@ bool OTableCopyHelper::copyTagTable(const TransferableDataHelper& _aDroppedData
bool bHtml = _aDroppedData.HasFormat(SotClipboardFormatId::HTML);
if ( bHtml || _aDroppedData.HasFormat(SotClipboardFormatId::RTF) )
{
- bool bOk;
- if ( bHtml )
- bOk = const_cast<TransferableDataHelper&>(_aDroppedData).GetSotStorageStream(SotClipboardFormatId::HTML ,_rAsyncDrop.aHtmlRtfStorage);
- else
- bOk = const_cast<TransferableDataHelper&>(_aDroppedData).GetSotStorageStream(SotClipboardFormatId::RTF,_rAsyncDrop.aHtmlRtfStorage);
+ _rAsyncDrop.aHtmlRtfStorage = _aDroppedData.GetSotStorageStream(bHtml ? SotClipboardFormatId::HTML : SotClipboardFormatId::RTF);
_rAsyncDrop.bHtml = bHtml;
_rAsyncDrop.bError = !copyTagTable(_rAsyncDrop,true,_xConnection);
- bRet = ( !_rAsyncDrop.bError && bOk && _rAsyncDrop.aHtmlRtfStorage.is() );
+ bRet = ( !_rAsyncDrop.bError && _rAsyncDrop.aHtmlRtfStorage );
if ( bRet )
{
// now we need to copy the stream
- ::utl::TempFile aTmp;
+ ::utl::TempFileNamed aTmp;
_rAsyncDrop.aUrl = aTmp.GetURL();
- ::tools::SvRef<SotTempStream> aNew = new SotTempStream( aTmp.GetFileName() );
+ std::unique_ptr<SvStream> aNew = SotTempStream::Create( aTmp.GetFileName() );
_rAsyncDrop.aHtmlRtfStorage->Seek(STREAM_SEEK_TO_BEGIN);
- _rAsyncDrop.aHtmlRtfStorage->CopyTo( aNew.get() );
- _rAsyncDrop.aHtmlRtfStorage = aNew;
+ aNew->WriteStream(*_rAsyncDrop.aHtmlRtfStorage);
+ _rAsyncDrop.aHtmlRtfStorage = std::move(aNew);
}
else
_rAsyncDrop.aHtmlRtfStorage = nullptr;
@@ -286,7 +279,7 @@ void OTableCopyHelper::asyncCopyTagTable( DropDescriptor& _rDesc
,std::u16string_view i_rDestDataSource
,const SharedConnection& _xConnection)
{
- if ( _rDesc.aHtmlRtfStorage.is() )
+ if ( _rDesc.aHtmlRtfStorage )
{
copyTagTable(_rDesc,false,_xConnection);
_rDesc.aHtmlRtfStorage = nullptr;
diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx
index 174a2d4e4ea7..fd2f098db4d0 100644
--- a/dbaccess/source/ui/misc/TokenWriter.cxx
+++ b/dbaccess/source/ui/misc/TokenWriter.cxx
@@ -18,7 +18,7 @@
*/
#include <TokenWriter.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/stream.hxx>
#include <osl/diagnose.h>
#include <rtl/tencinfo.h>
@@ -48,6 +48,7 @@
#include <svtools/htmlout.hxx>
#include <sfx2/frmhtmlw.hxx>
#include <svl/numuno.hxx>
+#include <utility>
#include <vcl/svapp.hxx>
#include <UITools.hxx>
#include <toolkit/helper/vclunohelper.hxx>
@@ -55,6 +56,7 @@
#include <vcl/settings.hxx>
#include <svtools/rtfout.hxx>
#include <svtools/htmlcfg.hxx>
+#include <o3tl/string_view.hxx>
#include <connectivity/formattedcolumnvalue.hxx>
#include <memory>
@@ -78,6 +80,7 @@ ODatabaseImportExport::ODatabaseImportExport(const svx::ODataAccessDescriptor& _
const Reference< XComponentContext >& _rM,
const Reference< css::util::XNumberFormatter >& _rxNumberF)
:m_bBookmarkSelection( false )
+ ,m_pStream(nullptr)
,m_xFormatter(_rxNumberF)
,m_xContext(_rM)
,m_nCommandType(CommandType::TABLE)
@@ -93,11 +96,11 @@ ODatabaseImportExport::ODatabaseImportExport(const svx::ODataAccessDescriptor& _
}
// import data
-ODatabaseImportExport::ODatabaseImportExport( const ::dbtools::SharedConnection& _rxConnection,
+ODatabaseImportExport::ODatabaseImportExport( ::dbtools::SharedConnection _xConnection,
const Reference< XNumberFormatter >& _rxNumberF, const Reference< XComponentContext >& _rM )
:m_bBookmarkSelection( false )
,m_pStream(nullptr)
- ,m_xConnection(_rxConnection)
+ ,m_xConnection(std::move(_xConnection))
,m_xFormatter(_rxNumberF)
,m_xContext(_rM)
,m_nCommandType(css::sdb::CommandType::TABLE)
@@ -120,7 +123,7 @@ void ODatabaseImportExport::dispose()
Reference< XComponent > xComponent(m_xConnection, UNO_QUERY);
if (xComponent.is())
{
- Reference< XEventListener> xEvt(static_cast<cppu::OWeakObject*>(this),UNO_QUERY);
+ Reference< XEventListener> xEvt(this);
xComponent->removeEventListener(xEvt);
}
m_xConnection.clear();
@@ -133,6 +136,7 @@ void ODatabaseImportExport::dispose()
m_xRow.clear();
m_xRowLocate.clear();
m_xFormatter.clear();
+ m_xRowSetColumns.clear();
}
void SAL_CALL ODatabaseImportExport::disposing( const EventObject& Source )
@@ -163,7 +167,7 @@ void ODatabaseImportExport::impl_initFromDescriptor( const ODataAccessDescriptor
{
Reference< XConnection > xPureConn( _aDataDescriptor[DataAccessDescriptorProperty::Connection], UNO_QUERY );
m_xConnection.reset( xPureConn, SharedConnection::NoTakeOwnership );
- Reference< XEventListener> xEvt(static_cast<cppu::OWeakObject*>(this),UNO_QUERY);
+ Reference< XEventListener> xEvt(this);
Reference< XComponent > xComponent(m_xConnection, UNO_QUERY);
if (xComponent.is() && xEvt.is())
xComponent->addEventListener(xEvt);
@@ -212,7 +216,7 @@ void ODatabaseImportExport::initialize()
{ // we need a connection
OSL_ENSURE(!m_sDataSourceName.isEmpty(),"There must be a datsource name!");
Reference<XNameAccess> xDatabaseContext( DatabaseContext::create(m_xContext), UNO_QUERY_THROW);
- Reference< XEventListener> xEvt(static_cast<cppu::OWeakObject*>(this),UNO_QUERY);
+ Reference< XEventListener> xEvt(this);
Reference< XConnection > xConnection;
SQLExceptionInfo aInfo = ::dbaui::createConnection( m_sDataSourceName, xDatabaseContext, m_xContext, xEvt, xConnection );
@@ -258,9 +262,9 @@ void ODatabaseImportExport::initialize()
{
m_xResultSet.set( m_xContext->getServiceManager()->createInstanceWithContext("com.sun.star.sdb.RowSet", m_xContext), UNO_QUERY );
Reference< XPropertySet > xProp( m_xResultSet, UNO_QUERY_THROW );
- xProp->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( m_xConnection.getTyped() ) );
- xProp->setPropertyValue( PROPERTY_COMMAND_TYPE, makeAny( m_nCommandType ) );
- xProp->setPropertyValue( PROPERTY_COMMAND, makeAny( m_sName ) );
+ xProp->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, Any( m_xConnection.getTyped() ) );
+ xProp->setPropertyValue( PROPERTY_COMMAND_TYPE, Any( m_nCommandType ) );
+ xProp->setPropertyValue( PROPERTY_COMMAND, Any( m_sName ) );
Reference< XRowSet > xRowSet( xProp, UNO_QUERY );
xRowSet->execute();
}
@@ -317,13 +321,13 @@ bool ODatabaseImportExport::Read()
bool ORTFImportExport::Write()
{
ODatabaseImportExport::Write();
- m_pStream->WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_RTF );
- m_pStream->WriteCharPtr(OOO_STRING_SVTOOLS_RTF_ANSI);
+ m_pStream->WriteChar( '{' ).WriteOString( OOO_STRING_SVTOOLS_RTF_RTF );
+ m_pStream->WriteOString(OOO_STRING_SVTOOLS_RTF_ANSI);
if (sal_uInt32 nCpg = rtl_getWindowsCodePageFromTextEncoding(m_eDestEnc); nCpg && nCpg != 65001)
{
- m_pStream->WriteCharPtr(OOO_STRING_SVTOOLS_RTF_ANSICPG).WriteUInt32AsString(nCpg);
+ m_pStream->WriteOString(OOO_STRING_SVTOOLS_RTF_ANSICPG).WriteNumberAsString(nCpg);
}
- m_pStream->WriteCharPtr(SAL_NEWLINE_STRING);
+ m_pStream->WriteOString(SAL_NEWLINE_STRING);
bool bBold = ( css::awt::FontWeight::BOLD == m_aFont.Weight );
bool bItalic = ( css::awt::FontSlant_ITALIC == m_aFont.Slant );
@@ -341,37 +345,37 @@ bool ORTFImportExport::Write()
aFonts = OUStringToOString(aName, RTL_TEXTENCODING_MS_1252);
}
- m_pStream->WriteCharPtr( "{\\fonttbl" );
+ m_pStream->WriteOString( "{\\fonttbl" );
if (!aFonts.isEmpty())
{
sal_Int32 nIdx{0};
sal_Int32 nTok{-1}; // to compensate pre-increment
do {
- m_pStream->WriteCharPtr( "\\f" );
- m_pStream->WriteInt32AsString(++nTok);
- m_pStream->WriteCharPtr( "\\fcharset0\\fnil " );
- m_pStream->WriteOString( aFonts.getToken(0, ';', nIdx) );
+ m_pStream->WriteOString( "\\f" );
+ m_pStream->WriteNumberAsString(++nTok);
+ m_pStream->WriteOString( "\\fcharset0\\fnil " );
+ m_pStream->WriteOString( o3tl::getToken(aFonts, 0, ';', nIdx) );
m_pStream->WriteChar( ';' );
} while (nIdx>=0);
}
m_pStream->WriteChar( '}' ) ;
- m_pStream->WriteCharPtr( SAL_NEWLINE_STRING );
+ m_pStream->WriteOString( SAL_NEWLINE_STRING );
// write the rtf color table
- m_pStream->WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_COLORTBL ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_RED );
- m_pStream->WriteUInt32AsString(aColor.GetRed());
- m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_GREEN );
- m_pStream->WriteUInt32AsString(aColor.GetGreen());
- m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_BLUE );
- m_pStream->WriteUInt32AsString(aColor.GetBlue());
+ m_pStream->WriteChar( '{' ).WriteOString( OOO_STRING_SVTOOLS_RTF_COLORTBL ).WriteOString( OOO_STRING_SVTOOLS_RTF_RED );
+ m_pStream->WriteNumberAsString(aColor.GetRed());
+ m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_GREEN );
+ m_pStream->WriteNumberAsString(aColor.GetGreen());
+ m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_BLUE );
+ m_pStream->WriteNumberAsString(aColor.GetBlue());
- m_pStream->WriteCharPtr( ";\\red255\\green255\\blue255;\\red192\\green192\\blue192;}" )
- .WriteCharPtr( SAL_NEWLINE_STRING );
+ m_pStream->WriteOString( ";\\red255\\green255\\blue255;\\red192\\green192\\blue192;}" )
+ .WriteOString( SAL_NEWLINE_STRING );
static char const aCell1[] = "\\clbrdrl\\brdrs\\brdrcf0\\clbrdrt\\brdrs\\brdrcf0\\clbrdrb\\brdrs\\brdrcf0\\clbrdrr\\brdrs\\brdrcf0\\clshdng10000\\clcfpat2\\cellx";
- m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_TROWD ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_TRGAPH );
- m_pStream->WriteInt32AsString(40);
- m_pStream->WriteCharPtr( SAL_NEWLINE_STRING );
+ m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_TROWD ).WriteOString( OOO_STRING_SVTOOLS_RTF_TRGAPH );
+ m_pStream->WriteOString("40");
+ m_pStream->WriteOString( SAL_NEWLINE_STRING );
if(m_xObject.is())
{
@@ -390,14 +394,14 @@ bool ORTFImportExport::Write()
for( sal_Int32 i=1; i<=nCount; ++i )
{
- m_pStream->WriteCharPtr( aCell1 );
- m_pStream->WriteInt32AsString(i*CELL_X);
- m_pStream->WriteCharPtr( SAL_NEWLINE_STRING );
+ m_pStream->WriteOString( aCell1 );
+ m_pStream->WriteNumberAsString(i*CELL_X);
+ m_pStream->WriteOString( SAL_NEWLINE_STRING );
}
// column description
- m_pStream->WriteChar( '{' ).WriteCharPtr( SAL_NEWLINE_STRING );
- m_pStream->WriteCharPtr( "\\trrh-270\\pard\\intbl" );
+ m_pStream->WriteChar( '{' ).WriteOString( SAL_NEWLINE_STRING );
+ m_pStream->WriteOString( "\\trrh-270\\pard\\intbl" );
std::unique_ptr<OString[]> pHorzChar(new OString[nCount]);
@@ -427,28 +431,28 @@ bool ORTFImportExport::Write()
pHorzChar[i-1] = pChar; // to avoid to always rummage in the ITEMSET later on
- m_pStream->WriteCharPtr( SAL_NEWLINE_STRING );
+ m_pStream->WriteOString( SAL_NEWLINE_STRING );
m_pStream->WriteChar( '{' );
- m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_QC ); // column header always centered
+ m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_QC ); // column header always centered
- if ( bBold ) m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_B );
- if ( bItalic ) m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_I );
- if ( bUnderline ) m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_UL );
- if ( bStrikeout ) m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_STRIKE );
+ if ( bBold ) m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_B );
+ if ( bItalic ) m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_I );
+ if ( bUnderline ) m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_UL );
+ if ( bStrikeout ) m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_STRIKE );
- m_pStream->WriteCharPtr( "\\fs20\\f0\\cf0\\cb2" );
+ m_pStream->WriteOString( "\\fs20\\f0\\cf0\\cb2" );
m_pStream->WriteChar( ' ' );
RTFOutFuncs::Out_String(*m_pStream, sColumnName, m_eDestEnc);
- m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_CELL );
+ m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_CELL );
m_pStream->WriteChar( '}' );
- m_pStream->WriteCharPtr( SAL_NEWLINE_STRING );
- m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PARD ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_INTBL );
+ m_pStream->WriteOString( SAL_NEWLINE_STRING );
+ m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_PARD ).WriteOString( OOO_STRING_SVTOOLS_RTF_INTBL );
}
- m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_ROW );
- m_pStream->WriteCharPtr( SAL_NEWLINE_STRING ).WriteChar( '}' );
- m_pStream->WriteCharPtr( SAL_NEWLINE_STRING );
+ m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_ROW );
+ m_pStream->WriteOString( SAL_NEWLINE_STRING ).WriteChar( '}' );
+ m_pStream->WriteOString( SAL_NEWLINE_STRING );
sal_Int32 k=1;
sal_Int32 kk=0;
@@ -485,7 +489,7 @@ bool ORTFImportExport::Write()
}
}
- m_pStream->WriteChar( '}' ).WriteCharPtr( SAL_NEWLINE_STRING );
+ m_pStream->WriteChar( '}' ).WriteOString( SAL_NEWLINE_STRING );
m_pStream->WriteUChar( 0 );
return ((*m_pStream).GetError() == ERRCODE_NONE);
}
@@ -493,17 +497,17 @@ bool ORTFImportExport::Write()
void ORTFImportExport::appendRow(OString const * pHorzChar,sal_Int32 _nColumnCount,sal_Int32& k,sal_Int32& kk)
{
++kk;
- m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_TROWD ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_TRGAPH );
- m_pStream->WriteInt32AsString(40);
- m_pStream->WriteCharPtr( SAL_NEWLINE_STRING );
+ m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_TROWD ).WriteOString( OOO_STRING_SVTOOLS_RTF_TRGAPH );
+ m_pStream->WriteOString("40");
+ m_pStream->WriteOString( SAL_NEWLINE_STRING );
static char const aCell2[] = "\\clbrdrl\\brdrs\\brdrcf2\\clbrdrt\\brdrs\\brdrcf2\\clbrdrb\\brdrs\\brdrcf2\\clbrdrr\\brdrs\\brdrcf2\\clshdng10000\\clcfpat1\\cellx";
for ( sal_Int32 i=1; i<=_nColumnCount; ++i )
{
- m_pStream->WriteCharPtr( aCell2 );
- m_pStream->WriteInt32AsString(i*CELL_X);
- m_pStream->WriteCharPtr( SAL_NEWLINE_STRING );
+ m_pStream->WriteOString( aCell2 );
+ m_pStream->WriteNumberAsString(i*CELL_X);
+ m_pStream->WriteOString( SAL_NEWLINE_STRING );
}
const bool bBold = ( css::awt::FontWeight::BOLD == m_aFont.Weight );
@@ -513,19 +517,19 @@ void ORTFImportExport::appendRow(OString const * pHorzChar,sal_Int32 _nColumnCou
Reference< XRowSet > xRowSet(m_xRow,UNO_QUERY);
m_pStream->WriteChar( '{' );
- m_pStream->WriteCharPtr( "\\trrh-270\\pard\\intbl" );
+ m_pStream->WriteOString( "\\trrh-270\\pard\\intbl" );
for ( sal_Int32 i=1; i <= _nColumnCount; ++i )
{
- m_pStream->WriteCharPtr( SAL_NEWLINE_STRING );
+ m_pStream->WriteOString( SAL_NEWLINE_STRING );
m_pStream->WriteChar( '{' );
m_pStream->WriteOString( pHorzChar[i-1] );
- if ( bBold ) m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_B );
- if ( bItalic ) m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_I );
- if ( bUnderline ) m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_UL );
- if ( bStrikeout ) m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_STRIKE );
+ if ( bBold ) m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_B );
+ if ( bItalic ) m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_I );
+ if ( bUnderline ) m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_UL );
+ if ( bStrikeout ) m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_STRIKE );
- m_pStream->WriteCharPtr( "\\fs20\\f1\\cf0\\cb1 " );
+ m_pStream->WriteOString( "\\fs20\\f1\\cf0\\cb1 " );
try
{
@@ -540,12 +544,12 @@ void ORTFImportExport::appendRow(OString const * pHorzChar,sal_Int32 _nColumnCou
SAL_WARN("dbaccess.ui","RTF WRITE!");
}
- m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_CELL );
+ m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_CELL );
m_pStream->WriteChar( '}' );
- m_pStream->WriteCharPtr( SAL_NEWLINE_STRING );
- m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PARD ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_INTBL );
+ m_pStream->WriteOString( SAL_NEWLINE_STRING );
+ m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_PARD ).WriteOString( OOO_STRING_SVTOOLS_RTF_INTBL );
}
- m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_ROW ).WriteCharPtr( SAL_NEWLINE_STRING );
+ m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_ROW ).WriteOString( SAL_NEWLINE_STRING );
m_pStream->WriteChar( '}' );
++k;
}
@@ -568,13 +572,6 @@ bool ORTFImportExport::Read()
const sal_Int16 OHTMLImportExport::nCellSpacing = 0;
const char OHTMLImportExport::sIndentSource[nIndentMax+1] = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
-// Macros for HTML-Export
-#define TAG_ON( tag ) HTMLOutFuncs::Out_AsciiTag( (*m_pStream), tag )
-#define TAG_OFF( tag ) HTMLOutFuncs::Out_AsciiTag( (*m_pStream), tag, false )
-#define OUT_LF() m_pStream->WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( GetIndentStr() )
-#define TAG_ON_LF( tag ) (TAG_ON( tag ).WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( GetIndentStr() ))
-#define TAG_OFF_LF( tag ) (TAG_OFF( tag ).WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( GetIndentStr() ))
-
OHTMLImportExport::OHTMLImportExport(const svx::ODataAccessDescriptor& _aDataDescriptor,
const Reference< XComponentContext >& _rM,
const Reference< css::util::XNumberFormatter >& _rxNumberF)
@@ -585,8 +582,7 @@ OHTMLImportExport::OHTMLImportExport(const svx::ODataAccessDescriptor& _aDataDes
#endif
{
// set HTML configuration
- SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
- m_eDestEnc = rHtmlOptions.GetTextEncoding();
+ m_eDestEnc = RTL_TEXTENCODING_UTF8;
strncpy( sIndent, sIndentSource ,std::min(sizeof(sIndent),sizeof(sIndentSource)));
sIndent[0] = 0;
}
@@ -596,13 +592,13 @@ bool OHTMLImportExport::Write()
ODatabaseImportExport::Write();
if(m_xObject.is())
{
- m_pStream->WriteChar( '<' ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_doctype ).WriteChar( ' ' ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_doctype40 ).WriteChar( '>' ).WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( SAL_NEWLINE_STRING );
- TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_html );
+ m_pStream->WriteChar( '<' ).WriteOString( OOO_STRING_SVTOOLS_HTML_doctype ).WriteChar( ' ' ).WriteOString( OOO_STRING_SVTOOLS_HTML_doctype5 ).WriteChar( '>' ).WriteOString( SAL_NEWLINE_STRING ).WriteOString( SAL_NEWLINE_STRING );
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_html).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
WriteHeader();
- OUT_LF();
+ m_pStream->WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
WriteBody();
- OUT_LF();
- TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_html );
+ m_pStream->WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_html, false).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
return ((*m_pStream).GetError() == ERRCODE_NONE);
}
@@ -633,46 +629,53 @@ void OHTMLImportExport::WriteHeader()
xDocProps->setTitle(m_sName);
}
- IncIndent(1); TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_head );
+ IncIndent(1);
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_head).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
SfxFrameHTMLWriter::Out_DocInfo( (*m_pStream), OUString(),
- xDocProps, sIndent, osl_getThreadTextEncoding() );
- OUT_LF();
- IncIndent(-1); OUT_LF(); TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_head );
+ xDocProps, sIndent );
+ m_pStream->WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
+ IncIndent(-1);
+ m_pStream->WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_head, false).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
}
void OHTMLImportExport::WriteBody()
{
IncIndent(1);
- m_pStream->WriteCharPtr( "<" ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_style ).WriteCharPtr( " " ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_O_type ).WriteCharPtr( "=\"text/css\">" );
+ m_pStream->WriteOString( "<" ).WriteOString( OOO_STRING_SVTOOLS_HTML_style ).WriteOString( " " ).WriteOString( OOO_STRING_SVTOOLS_HTML_O_type ).WriteOString( "=\"text/css\">" );
- m_pStream->WriteCharPtr( "<!-- " ); OUT_LF();
- m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_HTML_body ).WriteCharPtr( " { " ).WriteCharPtr( "font-family: " ).WriteChar( '"' ).WriteOString( OUStringToOString(m_aFont.Name, osl_getThreadTextEncoding()) ).WriteChar( '\"' );
+ m_pStream->WriteOString( "<!-- " );
+ m_pStream->WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
+ m_pStream->WriteOString( OOO_STRING_SVTOOLS_HTML_body ).WriteOString( " { " ).WriteOString( "font-family: " ).WriteChar( '"' ).WriteOString( OUStringToOString(m_aFont.Name, osl_getThreadTextEncoding()) ).WriteChar( '\"' );
// TODO : think about the encoding of the font name
- m_pStream->WriteCharPtr( "; " ).WriteCharPtr( "font-size: " );
- m_pStream->WriteInt32AsString(m_aFont.Height);
+ m_pStream->WriteOString( "; " ).WriteOString( "font-size: " );
+ m_pStream->WriteNumberAsString(m_aFont.Height);
m_pStream->WriteChar( '}' );
- OUT_LF();
- m_pStream->WriteCharPtr( " -->" );
- IncIndent(-1); OUT_LF(); TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_style );
- OUT_LF();
+ m_pStream->WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
+ m_pStream->WriteOString( " -->" );
+ IncIndent(-1);
+ m_pStream->WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_style, false).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
+ m_pStream->WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
// default Textcolour black
- m_pStream->WriteChar( '<' ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_body ).WriteChar( ' ' ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_O_text ).WriteChar( '=' );
+ m_pStream->WriteChar( '<' ).WriteOString( OOO_STRING_SVTOOLS_HTML_body ).WriteChar( ' ' ).WriteOString( OOO_STRING_SVTOOLS_HTML_O_text ).WriteChar( '=' );
::Color aColor;
if(m_xObject.is())
m_xObject->getPropertyValue(PROPERTY_TEXTCOLOR) >>= aColor;
HTMLOutFuncs::Out_Color( (*m_pStream), aColor );
- m_pStream->WriteCharPtr( " " OOO_STRING_SVTOOLS_HTML_O_bgcolor "=" );
+ m_pStream->WriteOString( " " OOO_STRING_SVTOOLS_HTML_O_bgcolor "=" );
HTMLOutFuncs::Out_Color( (*m_pStream), aColor );
- m_pStream->WriteChar( '>' ); OUT_LF();
+ m_pStream->WriteChar( '>' );
+ m_pStream->WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
WriteTables();
- TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_body );
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_body, false).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
}
void OHTMLImportExport::WriteTables()
@@ -681,7 +684,7 @@ void OHTMLImportExport::WriteTables()
" "
OOO_STRING_SVTOOLS_HTML_frame
"="
- OOO_STRING_SVTOOLS_HTML_TF_void;
+ OOO_STRING_SVTOOLS_HTML_TF_void ""_ostr;
Sequence< OUString> aNames;
Reference<XNameAccess> xColumns;
@@ -695,8 +698,9 @@ void OHTMLImportExport::WriteTables()
{
sal_Int32 nCount = m_xResultSetMetaData->getColumnCount();
aNames.realloc(nCount);
+ auto aNamesRange = asNonConstRange(aNames);
for (sal_Int32 i= 0; i < nCount; ++i)
- aNames[i] = m_xResultSetMetaData->getColumnName(i+1);
+ aNamesRange[i] = m_xResultSetMetaData->getColumnName(i+1);
bUseResultMetaData = true;
}
}
@@ -718,27 +722,27 @@ void OHTMLImportExport::WriteTables()
"=1";
IncIndent(1);
- TAG_ON( aStrOut.getStr() );
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, aStrOut);
FontOn();
- TAG_ON( OOO_STRING_SVTOOLS_HTML_caption );
- TAG_ON( OOO_STRING_SVTOOLS_HTML_bold );
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_caption);
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_bold);
m_pStream->WriteOString( OUStringToOString(m_sName, osl_getThreadTextEncoding()) );
// TODO : think about the encoding of the name
- TAG_OFF( OOO_STRING_SVTOOLS_HTML_bold );
- TAG_OFF( OOO_STRING_SVTOOLS_HTML_caption );
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_bold, false);
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_caption, false);
FontOff();
- OUT_LF();
+ m_pStream->WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
// </FONT>
IncIndent(1);
- TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_thead );
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_thead).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
IncIndent(1);
- TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_tablerow );
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_tablerow).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
if(m_xObject.is())
{
@@ -782,22 +786,20 @@ void OHTMLImportExport::WriteTables()
}
IncIndent(-1);
- TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_tablerow );
- TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_thead );
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_tablerow, false).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_thead, false).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
IncIndent(1);
- TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_tbody );
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_tbody).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
// 2. and now the data
Reference< XRowSet > xRowSet(m_xRow,UNO_QUERY);
- sal_Int32 kk=0;
m_xResultSet->beforeFirst(); // set back before the first row
while(m_xResultSet->next())
{
IncIndent(1);
- TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_tablerow );
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_tablerow).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
- ++kk;
for(sal_Int32 i=1;i<=aNames.getLength();++i)
{
if(i == aNames.getLength())
@@ -820,21 +822,24 @@ void OHTMLImportExport::WriteTables()
}
WriteCell(pFormat[i-1],pColWidth[i-1],nHeight,pHorJustify[i-1],aValue,OOO_STRING_SVTOOLS_HTML_tabledata);
}
- TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_tablerow );
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_tablerow, false).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
}
}
else
{
IncIndent(-1);
- TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_tablerow );
- TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_thead );
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_tablerow, false).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_thead, false).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
IncIndent(1);
- TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_tbody );
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_tbody).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
}
- IncIndent(-1); OUT_LF(); TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_tbody );
- IncIndent(-1); TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_table );
+ IncIndent(-1);
+ m_pStream->WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_tbody, false).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
+ IncIndent(-1);
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_table, false).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
}
void OHTMLImportExport::WriteCell( sal_Int32 nFormat, sal_Int32 nWidthPixel, sal_Int32 nHeightPixel, const char* pChar,
@@ -862,7 +867,7 @@ void OHTMLImportExport::WriteCell( sal_Int32 nFormat, sal_Int32 nWidthPixel, sal
"=" +
pChar;
- SvNumberFormatsSupplierObj* pSupplierImpl = m_xFormatter.is() ? comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>(m_xFormatter->getNumberFormatsSupplier()) : nullptr;
+ SvNumberFormatsSupplierObj* pSupplierImpl = m_xFormatter.is() ? comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>(m_xFormatter->getNumberFormatsSupplier()) : nullptr;
SvNumberFormatter* pFormatter = pSupplierImpl ? pSupplierImpl->GetNumberFormatter() : nullptr;
if(pFormatter)
{
@@ -879,7 +884,7 @@ void OHTMLImportExport::WriteCell( sal_Int32 nFormat, sal_Int32 nWidthPixel, sal
}
}
- TAG_ON( aStrTD.getStr() );
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, aStrTD);
FontOn();
@@ -888,24 +893,24 @@ void OHTMLImportExport::WriteCell( sal_Int32 nFormat, sal_Int32 nWidthPixel, sal
bool bUnderline = ( css::awt::FontUnderline::NONE != m_aFont.Underline );
bool bStrikeout = ( css::awt::FontStrikeout::NONE != m_aFont.Strikeout );
- if ( bBold ) TAG_ON( OOO_STRING_SVTOOLS_HTML_bold );
- if ( bItalic ) TAG_ON( OOO_STRING_SVTOOLS_HTML_italic );
- if ( bUnderline ) TAG_ON( OOO_STRING_SVTOOLS_HTML_underline );
- if ( bStrikeout ) TAG_ON( OOO_STRING_SVTOOLS_HTML_strike );
+ if ( bBold ) HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_bold);
+ if ( bItalic ) HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_italic);
+ if ( bUnderline ) HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_underline);
+ if ( bStrikeout ) HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_strike);
if ( rValue.isEmpty() )
- TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak ); // no completely empty cell
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_linebreak); // no completely empty cell
else
- HTMLOutFuncs::Out_String( (*m_pStream), rValue ,m_eDestEnc);
+ HTMLOutFuncs::Out_String( (*m_pStream), rValue );
- if ( bStrikeout ) TAG_OFF( OOO_STRING_SVTOOLS_HTML_strike );
- if ( bUnderline ) TAG_OFF( OOO_STRING_SVTOOLS_HTML_underline );
- if ( bItalic ) TAG_OFF( OOO_STRING_SVTOOLS_HTML_italic );
- if ( bBold ) TAG_OFF( OOO_STRING_SVTOOLS_HTML_bold );
+ if ( bStrikeout ) HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_strike, false);
+ if ( bUnderline ) HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_underline, false);
+ if ( bItalic ) HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_italic, false);
+ if ( bBold ) HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_bold, false);
FontOff();
- TAG_OFF_LF( pHtmlTag );
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, pHtmlTag, false).WriteOString(SAL_NEWLINE_STRING).WriteOString(GetIndentStr());
}
void OHTMLImportExport::FontOn()
@@ -934,7 +939,7 @@ void OHTMLImportExport::FontOn()
m_xObject->getPropertyValue(PROPERTY_TEXTCOLOR) >>= aColor;
HTMLOutFuncs::Out_Color( (*m_pStream), aColor );
- m_pStream->WriteCharPtr( ">" );
+ m_pStream->WriteOString( ">" );
}
inline void OHTMLImportExport::FontOff()
@@ -942,7 +947,7 @@ inline void OHTMLImportExport::FontOff()
#if OSL_DEBUG_LEVEL > 0
OSL_ENSURE(m_bCheckFont,"No FontOn() called");
#endif
- TAG_OFF( OOO_STRING_SVTOOLS_HTML_font );
+ HTMLOutFuncs::Out_AsciiTag(*m_pStream, OOO_STRING_SVTOOLS_HTML_font, false);
#if OSL_DEBUG_LEVEL > 0
m_bCheckFont = false;
#endif
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index 08b6bc5f2af0..b8efb2fb60c0 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -64,6 +64,7 @@
#include <svx/svxids.hrc>
#include <sal/log.hxx>
+#include <svl/numformat.hxx>
#include <svl/itempool.hxx>
#include <helpids.h>
#include <svl/itemset.hxx>
@@ -82,7 +83,7 @@
#include <dlgsize.hxx>
#include <svtools/editbrowsebox.hxx>
#include <tools/urlobj.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <svl/numuno.hxx>
#include <svl/filenotation.hxx>
#include <connectivity/FValue.hxx>
@@ -105,7 +106,6 @@ using namespace ::com::sun::star::ucb;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::ui::dialogs;
using namespace ::svt;
using ::com::sun::star::ucb::InteractiveIOException;
using ::com::sun::star::ucb::IOErrorCode_NO_FILE;
@@ -394,7 +394,7 @@ TOTypeInfoSP getTypeInfoFromType(const OTypeInfoMap& _rTypeInfo,
}
void fillTypeInfo( const Reference< css::sdbc::XConnection>& _rxConnection,
- const OUString& _rsTypeNames,
+ std::u16string_view _rsTypeNames,
OTypeInfoMap& _rTypeInfoMap,
std::vector<OTypeInfoMap::iterator>& _rTypeInfoIters)
{
@@ -431,52 +431,52 @@ void fillTypeInfo( const Reference< css::sdbc::XConnection>& _rxConnection,
}
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- pInfo->aTypeName = aValue;
+ pInfo->aTypeName = aValue.getString();
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- pInfo->nType = aValue;
+ pInfo->nType = aValue.getInt32();
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- pInfo->nPrecision = aValue;
+ pInfo->nPrecision = aValue.getInt32();
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow); // LiteralPrefix
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow); //LiteralSuffix
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- pInfo->aCreateParams = aValue;
+ pInfo->aCreateParams = aValue.getString();
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- pInfo->bNullable = static_cast<sal_Int32>(aValue) == ColumnValue::NULLABLE;
+ pInfo->bNullable = aValue.getInt32() == ColumnValue::NULLABLE;
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
// bCaseSensitive
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- pInfo->nSearchType = aValue;
+ pInfo->nSearchType = aValue.getInt16();
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
// bUnsigned
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- pInfo->bCurrency = static_cast<bool>(aValue);
+ pInfo->bCurrency = aValue.getBool();
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- pInfo->bAutoIncrement = static_cast<bool>(aValue);
+ pInfo->bAutoIncrement = aValue.getBool();
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- pInfo->aLocalTypeName = aValue;
+ pInfo->aLocalTypeName = aValue.getString();
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- pInfo->nMinimumScale = aValue;
+ pInfo->nMinimumScale = aValue.getInt16();
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- pInfo->nMaximumScale = aValue;
+ pInfo->nMaximumScale = aValue.getInt16();
assert(nPos == 15);
// 16 and 17 are unused
nPos = 18;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- pInfo->nNumPrecRadix = aValue;
+ pInfo->nNumPrecRadix = aValue.getInt32();
// check if values are less than zero like it happens in a oracle jdbc driver
if( pInfo->nPrecision < 0)
@@ -488,108 +488,108 @@ void fillTypeInfo( const Reference< css::sdbc::XConnection>& _rxConnection,
if( pInfo->nNumPrecRadix <= 1)
pInfo->nNumPrecRadix = 10;
- OUString aName;
+ std::u16string_view aName;
switch(pInfo->nType)
{
case DataType::CHAR:
- aName = _rsTypeNames.getToken(TYPE_CHAR, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_CHAR, ';');
break;
case DataType::VARCHAR:
- aName = _rsTypeNames.getToken(TYPE_TEXT, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_TEXT, ';');
break;
case DataType::DECIMAL:
- aName = _rsTypeNames.getToken(TYPE_DECIMAL, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_DECIMAL, ';');
break;
case DataType::NUMERIC:
- aName = _rsTypeNames.getToken(TYPE_NUMERIC, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_NUMERIC, ';');
break;
case DataType::BIGINT:
- aName = _rsTypeNames.getToken(TYPE_BIGINT, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_BIGINT, ';');
break;
case DataType::FLOAT:
- aName = _rsTypeNames.getToken(TYPE_FLOAT, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_FLOAT, ';');
break;
case DataType::DOUBLE:
- aName = _rsTypeNames.getToken(TYPE_DOUBLE, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_DOUBLE, ';');
break;
case DataType::LONGVARCHAR:
- aName = _rsTypeNames.getToken(TYPE_MEMO, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_MEMO, ';');
break;
case DataType::LONGVARBINARY:
- aName = _rsTypeNames.getToken(TYPE_IMAGE, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_IMAGE, ';');
break;
case DataType::DATE:
- aName = _rsTypeNames.getToken(TYPE_DATE, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_DATE, ';');
break;
case DataType::TIME:
- aName = _rsTypeNames.getToken(TYPE_TIME, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_TIME, ';');
break;
case DataType::TIMESTAMP:
- aName = _rsTypeNames.getToken(TYPE_DATETIME, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_DATETIME, ';');
break;
case DataType::BIT:
if ( !pInfo->aCreateParams.isEmpty() )
{
- aName = _rsTypeNames.getToken(TYPE_BIT, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_BIT, ';');
break;
}
[[fallthrough]];
case DataType::BOOLEAN:
- aName = _rsTypeNames.getToken(TYPE_BOOL, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_BOOL, ';');
break;
case DataType::TINYINT:
- aName = _rsTypeNames.getToken(TYPE_TINYINT, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_TINYINT, ';');
break;
case DataType::SMALLINT:
- aName = _rsTypeNames.getToken(TYPE_SMALLINT, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_SMALLINT, ';');
break;
case DataType::INTEGER:
- aName = _rsTypeNames.getToken(TYPE_INTEGER, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_INTEGER, ';');
break;
case DataType::REAL:
- aName = _rsTypeNames.getToken(TYPE_REAL, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_REAL, ';');
break;
case DataType::BINARY:
- aName = _rsTypeNames.getToken(TYPE_BINARY, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_BINARY, ';');
break;
case DataType::VARBINARY:
- aName = _rsTypeNames.getToken(TYPE_VARBINARY, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_VARBINARY, ';');
break;
case DataType::SQLNULL:
- aName = _rsTypeNames.getToken(TYPE_SQLNULL, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_SQLNULL, ';');
break;
case DataType::OBJECT:
- aName = _rsTypeNames.getToken(TYPE_OBJECT, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_OBJECT, ';');
break;
case DataType::DISTINCT:
- aName = _rsTypeNames.getToken(TYPE_DISTINCT, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_DISTINCT, ';');
break;
case DataType::STRUCT:
- aName = _rsTypeNames.getToken(TYPE_STRUCT, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_STRUCT, ';');
break;
case DataType::ARRAY:
- aName = _rsTypeNames.getToken(TYPE_ARRAY, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_ARRAY, ';');
break;
case DataType::BLOB:
- aName = _rsTypeNames.getToken(TYPE_BLOB, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_BLOB, ';');
break;
case DataType::CLOB:
- aName = _rsTypeNames.getToken(TYPE_CLOB, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_CLOB, ';');
break;
case DataType::REF:
- aName = _rsTypeNames.getToken(TYPE_REF, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_REF, ';');
break;
case DataType::OTHER:
- aName = _rsTypeNames.getToken(TYPE_OTHER, ';');
+ aName = o3tl::getToken(_rsTypeNames, TYPE_OTHER, ';');
break;
}
- if ( !aName.isEmpty() )
+ if ( !aName.empty() )
{
pInfo->aUIName = aName;
pInfo->aUIName += " [ ";
}
pInfo->aUIName += pInfo->aTypeName;
- if ( !aName.isEmpty() )
+ if ( !aName.empty() )
pInfo->aUIName += " ]";
// Now that we have the type info, save it in the multimap
_rTypeInfoMap.emplace(pInfo->nType,pInfo);
@@ -609,20 +609,20 @@ void fillTypeInfo( const Reference< css::sdbc::XConnection>& _rxConnection,
void setColumnProperties(const Reference<XPropertySet>& _rxColumn,const OFieldDescription* _pFieldDesc)
{
- _rxColumn->setPropertyValue(PROPERTY_NAME,makeAny(_pFieldDesc->GetName()));
- _rxColumn->setPropertyValue(PROPERTY_TYPENAME,makeAny(_pFieldDesc->getTypeInfo()->aTypeName));
- _rxColumn->setPropertyValue(PROPERTY_TYPE,makeAny(_pFieldDesc->GetType()));
- _rxColumn->setPropertyValue(PROPERTY_PRECISION,makeAny(_pFieldDesc->GetPrecision()));
- _rxColumn->setPropertyValue(PROPERTY_SCALE,makeAny(_pFieldDesc->GetScale()));
- _rxColumn->setPropertyValue(PROPERTY_ISNULLABLE, makeAny(_pFieldDesc->GetIsNullable()));
- _rxColumn->setPropertyValue(PROPERTY_ISAUTOINCREMENT, css::uno::makeAny(_pFieldDesc->IsAutoIncrement()));
- _rxColumn->setPropertyValue(PROPERTY_DESCRIPTION,makeAny(_pFieldDesc->GetDescription()));
+ _rxColumn->setPropertyValue(PROPERTY_NAME,Any(_pFieldDesc->GetName()));
+ _rxColumn->setPropertyValue(PROPERTY_TYPENAME,Any(_pFieldDesc->getTypeInfo()->aTypeName));
+ _rxColumn->setPropertyValue(PROPERTY_TYPE,Any(_pFieldDesc->GetType()));
+ _rxColumn->setPropertyValue(PROPERTY_PRECISION,Any(_pFieldDesc->GetPrecision()));
+ _rxColumn->setPropertyValue(PROPERTY_SCALE,Any(_pFieldDesc->GetScale()));
+ _rxColumn->setPropertyValue(PROPERTY_ISNULLABLE, Any(_pFieldDesc->GetIsNullable()));
+ _rxColumn->setPropertyValue(PROPERTY_ISAUTOINCREMENT, css::uno::Any(_pFieldDesc->IsAutoIncrement()));
+ _rxColumn->setPropertyValue(PROPERTY_DESCRIPTION,Any(_pFieldDesc->GetDescription()));
if ( _rxColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_ISCURRENCY) && _pFieldDesc->IsCurrency() )
- _rxColumn->setPropertyValue(PROPERTY_ISCURRENCY, css::uno::makeAny(_pFieldDesc->IsCurrency()));
+ _rxColumn->setPropertyValue(PROPERTY_ISCURRENCY, css::uno::Any(_pFieldDesc->IsCurrency()));
// set autoincrement value when available
// and only set when the entry is not empty, that lets the value in the column untouched
if ( _pFieldDesc->IsAutoIncrement() && !_pFieldDesc->GetAutoIncrementValue().isEmpty() && _rxColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_AUTOINCREMENTCREATION) )
- _rxColumn->setPropertyValue(PROPERTY_AUTOINCREMENTCREATION,makeAny(_pFieldDesc->GetAutoIncrementValue()));
+ _rxColumn->setPropertyValue(PROPERTY_AUTOINCREMENTCREATION,Any(_pFieldDesc->GetAutoIncrementValue()));
}
OUString createDefaultName(const Reference< XDatabaseMetaData>& _xMetaData,const Reference<XNameAccess>& _xTables,const OUString& _sName)
@@ -738,9 +738,9 @@ void callColumnFormatDialog(const Reference<XPropertySet>& xAffectedCol,
if(callColumnFormatDialog(_pParent,_pFormatter,nDataType,nFormatKey,eJustify,bHasFormat))
{
- xAffectedCol->setPropertyValue(PROPERTY_ALIGN, makeAny(static_cast<sal_Int16>(dbaui::mapTextAlign(eJustify))));
+ xAffectedCol->setPropertyValue(PROPERTY_ALIGN, Any(static_cast<sal_Int16>(dbaui::mapTextAlign(eJustify))));
if (bHasFormat)
- xAffectedCol->setPropertyValue(PROPERTY_FORMATKEY, makeAny(nFormatKey));
+ xAffectedCol->setPropertyValue(PROPERTY_FORMATKEY, Any(nFormatKey));
}
}
@@ -750,6 +750,31 @@ void callColumnFormatDialog(const Reference<XPropertySet>& xAffectedCol,
}
}
+static ItemInfoPackage& getItemInfoPackageColumnFormatDialog()
+{
+ class ItemInfoPackageColumnFormatDialog : public ItemInfoPackage
+ {
+ typedef std::array<ItemInfoStatic, SBA_ATTR_ALIGN_HOR_JUSTIFY - SBA_DEF_RANGEFORMAT + 1> ItemInfoArrayColumnFormatDialog;
+ ItemInfoArrayColumnFormatDialog maItemInfos {{
+ // m_nWhich, m_pItem, m_nSlotID, m_nItemInfoFlags
+ { SBA_DEF_RANGEFORMAT, new SfxRangeItem(SBA_DEF_RANGEFORMAT, SBA_DEF_FMTVALUE, SBA_ATTR_ALIGN_HOR_JUSTIFY), 0, SFX_ITEMINFOFLAG_NONE },
+ { SBA_DEF_FMTVALUE, new SfxUInt32Item(SBA_DEF_FMTVALUE), SID_ATTR_NUMBERFORMAT_VALUE, SFX_ITEMINFOFLAG_NONE },
+ { SBA_ATTR_ALIGN_HOR_JUSTIFY, new SvxHorJustifyItem(SvxCellHorJustify::Standard, SBA_ATTR_ALIGN_HOR_JUSTIFY), SID_ATTR_ALIGN_HOR_JUSTIFY, SFX_ITEMINFOFLAG_NONE },
+ }};
+
+ virtual const ItemInfoStatic& getItemInfoStatic(size_t nIndex) const override { return maItemInfos[nIndex]; }
+
+ public:
+ virtual size_t size() const override { return maItemInfos.size(); }
+ virtual const ItemInfo& getItemInfo(size_t nIndex, SfxItemPool& /*rPool*/) override { return maItemInfos[nIndex]; }
+ };
+
+ static std::unique_ptr<ItemInfoPackageColumnFormatDialog> g_aItemInfoPackageColumnFormatDialog;
+ if (!g_aItemInfoPackageColumnFormatDialog)
+ g_aItemInfoPackageColumnFormatDialog.reset(new ItemInfoPackageColumnFormatDialog);
+ return *g_aItemInfoPackageColumnFormatDialog;
+}
+
bool callColumnFormatDialog(weld::Widget* _pParent,
SvNumberFormatter* _pFormatter,
sal_Int32 _nDataType,
@@ -760,34 +785,15 @@ bool callColumnFormatDialog(weld::Widget* _pParent,
bool bRet = false;
// UNO->ItemSet
- static SfxItemInfo aItemInfos[] =
- {
- { 0, false },
- { SID_ATTR_NUMBERFORMAT_VALUE, true },
- { SID_ATTR_ALIGN_HOR_JUSTIFY, true },
- { SID_ATTR_NUMBERFORMAT_ONE_AREA, true },
- { SID_ATTR_NUMBERFORMAT_INFO, true }
- };
- static const sal_uInt16 aAttrMap[] =
- {
+ static const auto aAttrMap = svl::Items<
SBA_DEF_RANGEFORMAT, SBA_ATTR_ALIGN_HOR_JUSTIFY,
- SID_ATTR_NUMBERFORMAT_ONE_AREA, SID_ATTR_NUMBERFORMAT_ONE_AREA,
SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_INFO,
- 0
- };
+ SID_ATTR_NUMBERFORMAT_ONE_AREA, SID_ATTR_NUMBERFORMAT_ONE_AREA
+ >;
- std::vector<SfxPoolItem*> pDefaults
- {
- new SfxRangeItem(SBA_DEF_RANGEFORMAT, SBA_DEF_FMTVALUE, SBA_ATTR_ALIGN_HOR_JUSTIFY),
- new SfxUInt32Item(SBA_DEF_FMTVALUE),
- new SvxHorJustifyItem(SvxCellHorJustify::Standard, SBA_ATTR_ALIGN_HOR_JUSTIFY),
- new SfxBoolItem(SID_ATTR_NUMBERFORMAT_ONE_AREA, false),
- new SvxNumberInfoItem(SID_ATTR_NUMBERFORMAT_INFO)
- };
-
- rtl::Reference<SfxItemPool> pPool(new SfxItemPool("GridBrowserProperties", SBA_DEF_RANGEFORMAT, SBA_ATTR_ALIGN_HOR_JUSTIFY, aItemInfos, &pDefaults));
+ rtl::Reference<SfxItemPool> pPool(new SfxItemPool("GridBrowserProperties"));
+ pPool->registerItemInfoPackage(getItemInfoPackageColumnFormatDialog());
pPool->SetDefaultMetric( MapUnit::MapTwip ); // ripped, don't understand why
- pPool->FreezeIdRanges(); // the same
std::optional<SfxItemSet> pFormatDescriptor(SfxItemSet(*pPool, aAttrMap));
// fill it
@@ -853,8 +859,6 @@ bool callColumnFormatDialog(weld::Widget* _pParent,
pFormatDescriptor.reset();
pPool.clear();
- for (SfxPoolItem* pDefault : pDefaults)
- delete pDefault;
return bRet;
}
@@ -882,7 +886,7 @@ bool appendToFilter(const Reference<XConnection>& _xConnection,
xProp->getPropertyValue(PROPERTY_TABLEFILTER) >>= aFilter;
// first check if we have something like SCHEMA.%
bool bHasToInsert = true;
- for (const OUString& rItem : std::as_const(aFilter))
+ for (const OUString& rItem : aFilter)
{
if(rItem.indexOf('%') != -1)
{
@@ -908,7 +912,7 @@ bool appendToFilter(const Reference<XConnection>& _xConnection,
{
aFilter.realloc(aFilter.getLength()+1);
aFilter.getArray()[aFilter.getLength()-1] = _sName;
- xProp->setPropertyValue(PROPERTY_TABLEFILTER,makeAny(aFilter));
+ xProp->setPropertyValue(PROPERTY_TABLEFILTER,Any(aFilter));
}
}
}
@@ -929,7 +933,7 @@ void notifySystemWindow(vcl::Window const * _pWindow, vcl::Window* _pToRegister,
void adjustBrowseBoxColumnWidth( ::svt::EditBrowseBox* _pBox, sal_uInt16 _nColId )
{
sal_Int32 nColSize = -1;
- sal_uInt32 nDefaultWidth = _pBox->GetDefaultColumnWidth( _pBox->GetColumnTitle( _nColId ) );
+ ::tools::Long nDefaultWidth = _pBox->GetDefaultColumnWidth( _pBox->GetColumnTitle( _nColId ) );
if ( nDefaultWidth != _pBox->GetColumnWidth( _nColId ) )
{
Size aSizeMM = _pBox->PixelToLogic( Size( _pBox->GetColumnWidth( _nColId ), 0 ), MapMode( MapUnit::MapMM ) );
@@ -983,17 +987,17 @@ void fillAutoIncrementValue(const Reference<XPropertySet>& _xDatasource,
_xDatasource->getPropertyValue(PROPERTY_INFO) >>= aInfo;
// search the right propertyvalue
- const PropertyValue* pValue =std::find_if(aInfo.begin(), aInfo.end(),
+ const PropertyValue* pValue =std::find_if(std::cbegin(aInfo), std::cend(aInfo),
[](const PropertyValue& lhs)
{return lhs.Name == PROPERTY_AUTOINCREMENTCREATION;} );
- if ( pValue != aInfo.end() )
+ if ( pValue != std::cend(aInfo) )
pValue->Value >>= _rsAutoIncrementValue;
- pValue =std::find_if(aInfo.begin(), aInfo.end(),
+ pValue =std::find_if(std::cbegin(aInfo), std::cend(aInfo),
[](const PropertyValue& lhs)
{return lhs.Name == "IsAutoRetrievingEnabled";} );
- if ( pValue != aInfo.end() )
+ if ( pValue != std::cend(aInfo) )
pValue->Value >>= _rAutoIncrementValueEnabled;
}
@@ -1037,7 +1041,7 @@ void setEvalDateFormatForFormatter(Reference< css::util::XNumberFormatter > cons
Reference< css::util::XNumberFormatsSupplier > xSupplier = _rxFormatter->getNumberFormatsSupplier();
- auto pSupplierImpl = comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>(xSupplier);
+ auto pSupplierImpl = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>(xSupplier);
OSL_ENSURE(pSupplierImpl,"No Supplier!");
if ( pSupplierImpl )
@@ -1047,29 +1051,40 @@ void setEvalDateFormatForFormatter(Reference< css::util::XNumberFormatter > cons
}
}
+static bool TypeIsGreater(const TOTypeInfoSP& lhs, const TOTypeInfoSP& rhs)
+{
+ assert(lhs);
+ if (!rhs)
+ return true;
+ if (lhs->nNumPrecRadix == rhs->nNumPrecRadix)
+ return lhs->nPrecision > rhs->nPrecision;
+ if (lhs->nPrecision == rhs->nPrecision)
+ return lhs->nNumPrecRadix > rhs->nNumPrecRadix;
+ if ((lhs->nNumPrecRadix > rhs->nNumPrecRadix) == (lhs->nPrecision > rhs->nPrecision))
+ return lhs->nPrecision > rhs->nPrecision;
+ return std::pow(lhs->nNumPrecRadix, lhs->nPrecision)
+ > std::pow(rhs->nNumPrecRadix, rhs->nPrecision);
+}
+
TOTypeInfoSP queryPrimaryKeyType(const OTypeInfoMap& _rTypeInfo)
{
- TOTypeInfoSP pTypeInfo;
- // first we search for a type which supports autoIncrement
+ TOTypeInfoSP pTypeInfo, pFallback;
+ // first we search for a largest type which supports autoIncrement
for (auto const& elem : _rTypeInfo)
{
- // OJ: we don't want to set an autoincrement column to be key
- // because we don't have the possibility to know how to create
- // such auto increment column later on
- // so until we know how to do it, we create a column without autoincrement
- // therefore we have searched
- if ( elem.second->nType == DataType::INTEGER )
- {
- pTypeInfo = elem.second; // alternative
- break;
- }
- else if ( !pTypeInfo && elem.second->nType == DataType::DOUBLE )
- pTypeInfo = elem.second; // alternative
- else if ( !pTypeInfo && elem.second->nType == DataType::REAL )
- pTypeInfo = elem.second; // alternative
+ if (elem.second->bAutoIncrement && TypeIsGreater(elem.second, pTypeInfo))
+ pTypeInfo = elem.second;
+ if (pTypeInfo)
+ continue;
+ if (elem.second->nType == DataType::INTEGER)
+ pFallback = elem.second; // default alternative
+ else if (!pFallback && elem.second->nType == DataType::DOUBLE)
+ pFallback = elem.second; // alternative
+ else if (!pFallback && elem.second->nType == DataType::REAL)
+ pFallback = elem.second; // alternative
}
if ( !pTypeInfo ) // just a fallback
- pTypeInfo = queryTypeInfoByType(DataType::VARCHAR,_rTypeInfo);
+ pTypeInfo = pFallback ? pFallback : queryTypeInfoByType(DataType::VARCHAR, _rTypeInfo);
OSL_ENSURE(pTypeInfo,"checkColumns: can't find a type which is usable as a key!");
return pTypeInfo;
@@ -1147,7 +1162,7 @@ TOTypeInfoSP queryTypeInfoByType(sal_Int32 _nDataType,const OTypeInfoMap& _rType
return pTypeInfo;
}
-sal_Int32 askForUserAction(weld::Window* pParent, const char* pTitle, const char* pText, bool _bAll, std::u16string_view _sName)
+sal_Int32 askForUserAction(weld::Window* pParent, TranslateId pTitle, TranslateId pText, bool _bAll, std::u16string_view _sName)
{
SolarMutexGuard aGuard;
OUString aMsg = DBA_RES(pText);
@@ -1204,11 +1219,11 @@ Reference< XPropertySet > createView( const OUString& _rName, const Reference< X
sTable,
::dbtools::EComposeRule::InDataManipulation);
- xView->setPropertyValue(PROPERTY_CATALOGNAME,makeAny(sCatalog));
- xView->setPropertyValue(PROPERTY_SCHEMANAME,makeAny(sSchema));
- xView->setPropertyValue(PROPERTY_NAME,makeAny(sTable));
+ xView->setPropertyValue(PROPERTY_CATALOGNAME,Any(sCatalog));
+ xView->setPropertyValue(PROPERTY_SCHEMANAME,Any(sSchema));
+ xView->setPropertyValue(PROPERTY_NAME,Any(sTable));
- xView->setPropertyValue( PROPERTY_COMMAND, makeAny( _rCommand ) );
+ xView->setPropertyValue( PROPERTY_COMMAND, Any( _rCommand ) );
Reference<XAppend> xAppend(xViews,UNO_QUERY);
if(xAppend.is())
@@ -1250,7 +1265,7 @@ Reference<XPropertySet> createView( const OUString& _rName, const Reference< XCo
return createView( _rName, _rxConnection, sCommand );
}
-bool insertHierachyElement(weld::Window* pParent, const Reference< XComponentContext >& _rxContext,
+bool insertHierarchyElement(weld::Window* pParent, const Reference< XComponentContext >& _rxContext,
const Reference<XHierarchicalNameContainer>& _xNames,
const OUString& _sParentFolder,
bool _bForm,
@@ -1258,7 +1273,7 @@ bool insertHierachyElement(weld::Window* pParent, const Reference< XComponentCon
const Reference<XContent>& _xContent,
bool _bMove)
{
- OSL_ENSURE( _xNames.is(), "insertHierachyElement: illegal name container!" );
+ OSL_ENSURE( _xNames.is(), "insertHierarchyElement: illegal name container!" );
if ( !_xNames.is() )
return false;
@@ -1271,7 +1286,7 @@ bool insertHierachyElement(weld::Window* pParent, const Reference< XComponentCon
xNameAccess.set(xChild->getParent(),UNO_QUERY);
}
- OSL_ENSURE( xNameAccess.is(), "insertHierachyElement: could not find the proper name container!" );
+ OSL_ENSURE( xNameAccess.is(), "insertHierarchyElement: could not find the proper name container!" );
if ( !xNameAccess.is() )
return false;
@@ -1324,11 +1339,11 @@ bool insertHierachyElement(weld::Window* pParent, const Reference< XComponentCon
{"Parent", uno::Any(xNameAccess)},
{PROPERTY_EMBEDDEDOBJECT, uno::Any(_xContent)},
}));
- OUString sServiceName(_bCollection ? (_bForm ? OUString(SERVICE_NAME_FORM_COLLECTION) : OUString(SERVICE_NAME_REPORT_COLLECTION)) : OUString(SERVICE_SDB_DOCUMENTDEFINITION));
+ OUString sServiceName(_bCollection ? (_bForm ? SERVICE_NAME_FORM_COLLECTION : SERVICE_NAME_REPORT_COLLECTION) : SERVICE_SDB_DOCUMENTDEFINITION);
Reference<XContent > xNew( xORB->createInstanceWithArguments( sServiceName, aArguments ), UNO_QUERY_THROW );
Reference< XNameContainer > xNameContainer( xNameAccess, UNO_QUERY_THROW );
- xNameContainer->insertByName( sNewName, makeAny( xNew ) );
+ xNameContainer->insertByName( sNewName, Any( xNew ) );
}
catch( const IllegalArgumentException& e )
{
diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx
index 738c85124708..6176c19700ef 100644
--- a/dbaccess/source/ui/misc/WCPage.cxx
+++ b/dbaccess/source/ui/misc/WCPage.cxx
@@ -34,7 +34,6 @@ using namespace ::dbtools;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::util;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
@@ -106,8 +105,8 @@ IMPL_LINK(OCopyTable, RadioChangeHdl, weld::Toggleable&, rButton, void)
SetAppendDataRadio();
return;
}
- m_pParent->EnableNextButton(m_xRB_View->get_active());
- bool bKey = m_bPKeyAllowed && m_xRB_View->get_active();
+ m_pParent->EnableNextButton(!m_xRB_View->get_active());
+ bool bKey = m_bPKeyAllowed && !m_xRB_View->get_active();
m_xFT_KeyName->set_sensitive(bKey && m_xCB_PrimaryColumn->get_active());
m_xEdKeyName->set_sensitive(bKey && m_xCB_PrimaryColumn->get_active());
m_xCB_PrimaryColumn->set_sensitive(bKey);
diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx
index 544b79d03267..28f4d50e4a81 100644
--- a/dbaccess/source/ui/misc/WColumnSelect.cxx
+++ b/dbaccess/source/ui/misc/WColumnSelect.cxx
@@ -26,17 +26,14 @@
#include <com/sun/star/sdb/application/CopyTableOperation.hpp>
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
using namespace dbaui;
namespace CopyTableOperation = ::com::sun::star::sdb::application::CopyTableOperation;
OUString OWizColumnSelect::GetTitle() const { return DBA_RES(STR_WIZ_COLUMN_SELECT_TITLE); }
-OWizardPage::OWizardPage(weld::Container* pPage, OCopyTableWizard* pWizard, const OUString& rUIXMLDescription, const OString& rID)
+OWizardPage::OWizardPage(weld::Container* pPage, OCopyTableWizard* pWizard, const OUString& rUIXMLDescription, const OUString& rID)
: ::vcl::OWizardPage(pPage, pWizard, rUIXMLDescription, rID)
, m_pParent(pWizard)
, m_bFirstTime(true)
@@ -73,7 +70,7 @@ OWizColumnSelect::~OWizColumnSelect()
{
while (m_xNewColumnNames->n_children())
{
- delete reinterpret_cast<OFieldDescription*>(m_xNewColumnNames->get_id(0).toInt64());
+ delete weld::fromId<OFieldDescription*>(m_xNewColumnNames->get_id(0));
m_xNewColumnNames->remove(0);
}
}
@@ -90,7 +87,7 @@ void OWizColumnSelect::Reset()
for (auto const& column : rSrcColumns)
{
- OUString sId(OUString::number(reinterpret_cast<sal_Int64>(column->second)));
+ OUString sId(weld::toId(column->second));
m_xOrgColumnNames->append(sId, column->first);
}
@@ -121,7 +118,7 @@ void OWizColumnSelect::Activate( )
{
if (rSrcColumns.find(column->first) != rSrcColumns.end())
{
- OUString sId(OUString::number(reinterpret_cast<sal_Int64>(new OFieldDescription(*(column->second)))));
+ OUString sId(weld::toId(new OFieldDescription(*(column->second))));
m_xNewColumnNames->append(sId, column->first);
int nRemove = m_xOrgColumnNames->find_text(column->first);
if (nRemove != -1)
@@ -140,7 +137,7 @@ bool OWizColumnSelect::LeavePage()
for(sal_Int32 i=0 ; i< m_xNewColumnNames->n_children();++i)
{
- OFieldDescription* pField = reinterpret_cast<OFieldDescription*>(m_xNewColumnNames->get_id(i).toInt64());
+ OFieldDescription* pField = weld::fromId<OFieldDescription*>(m_xNewColumnNames->get_id(i));
OSL_ENSURE(pField,"The field information can not be null!");
m_pParent->insertColumn(i,pField);
}
@@ -275,7 +272,7 @@ void OWizColumnSelect::createNewColumn( weld::TreeView* _pListbox,
OFieldDescription const * _pSrcField,
std::vector< OUString>& _rRightColumns,
const OUString& _sColumnName,
- const OUString& _sExtraChars,
+ std::u16string_view _sExtraChars,
sal_Int32 _nMaxNameLen,
const ::comphelper::UStringMixEqual& _aCase)
{
@@ -290,7 +287,7 @@ void OWizColumnSelect::createNewColumn( weld::TreeView* _pListbox,
if ( !m_pParent->supportsPrimaryKey() )
pNewField->SetPrimaryKey(false);
- _pListbox->append(OUString::number(reinterpret_cast<sal_Int64>(pNewField)), sConvertedName);
+ _pListbox->append(weld::toId(pNewField), sConvertedName);
_rRightColumns.push_back(sConvertedName);
if ( !bNotConvert )
@@ -301,14 +298,14 @@ void OWizColumnSelect::moveColumn( weld::TreeView* _pRight,
weld::TreeView const * _pLeft,
std::vector< OUString>& _rRightColumns,
const OUString& _sColumnName,
- const OUString& _sExtraChars,
+ std::u16string_view _sExtraChars,
sal_Int32 _nMaxNameLen,
const ::comphelper::UStringMixEqual& _aCase)
{
if(_pRight == m_xNewColumnNames.get())
{
// we copy the column into the new format for the dest
- OFieldDescription* pSrcField = reinterpret_cast<OFieldDescription*>(_pLeft->get_id(_pLeft->find_text(_sColumnName)).toInt64());
+ OFieldDescription* pSrcField = weld::fromId<OFieldDescription*>(_pLeft->get_id(_pLeft->find_text(_sColumnName)));
createNewColumn(_pRight,pSrcField,_rRightColumns,_sColumnName,_sExtraChars,_nMaxNameLen,_aCase);
}
else
@@ -332,7 +329,7 @@ void OWizColumnSelect::moveColumn( weld::TreeView* _pRight,
OSL_ENSURE( aPos != rSrcVector.end(),"Invalid position for the iterator here!");
ODatabaseExport::TColumnVector::size_type nPos = (aPos - rSrcVector.begin()) - adjustColumnPosition(_pLeft, _sColumnName, (aPos - rSrcVector.begin()), _aCase);
- OUString sId(OUString::number(reinterpret_cast<sal_Int64>(aSrcIter->second)));
+ OUString sId(weld::toId(aSrcIter->second));
const OUString& rStr = (*aIter).first;
_pRight->insert(nullptr, nPos, &rStr, &sId, nullptr, nullptr, false, nullptr);
_rRightColumns.push_back(rStr);
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index 6ef0819c4099..a2737543c705 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -53,7 +53,10 @@
#include <o3tl/safeint.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+
+#include <algorithm>
+#include <utility>
using namespace ::dbaui;
using namespace ::com::sun::star::uno;
@@ -131,12 +134,12 @@ bool ObjectCopySource::isView() const
void ObjectCopySource::copyUISettingsTo( const Reference< XPropertySet >& _rxObject ) const
{
const OUString aCopyProperties[] = {
- OUString(PROPERTY_FONT), OUString(PROPERTY_ROW_HEIGHT), OUString(PROPERTY_TEXTCOLOR),OUString(PROPERTY_TEXTLINECOLOR),OUString(PROPERTY_TEXTEMPHASIS),OUString(PROPERTY_TEXTRELIEF)
+ PROPERTY_FONT, PROPERTY_ROW_HEIGHT, PROPERTY_TEXTCOLOR,PROPERTY_TEXTLINECOLOR,PROPERTY_TEXTEMPHASIS,PROPERTY_TEXTRELIEF
};
- for (const auto & aCopyPropertie : aCopyProperties)
+ for (const auto & aCopyProperty : aCopyProperties)
{
- if ( m_xObjectPSI->hasPropertyByName( aCopyPropertie ) )
- _rxObject->setPropertyValue( aCopyPropertie, m_xObject->getPropertyValue( aCopyPropertie ) );
+ if ( m_xObjectPSI->hasPropertyByName( aCopyProperty ) )
+ _rxObject->setPropertyValue( aCopyProperty, m_xObject->getPropertyValue( aCopyProperty ) );
}
}
@@ -155,17 +158,17 @@ void ObjectCopySource::copyFilterAndSortingTo( const Reference< XConnection >& _
OUStringBuffer sStatement = "SELECT * FROM " + sTargetName + " WHERE 0=1";
- for (const std::pair<OUString,OUString> & aPropertie : aProperties)
+ for (const std::pair<OUString,OUString> & aProperty : aProperties)
{
- if ( m_xObjectPSI->hasPropertyByName( aPropertie.first ) )
+ if ( m_xObjectPSI->hasPropertyByName( aProperty.first ) )
{
OUString sFilter;
- m_xObject->getPropertyValue( aPropertie.first ) >>= sFilter;
+ m_xObject->getPropertyValue( aProperty.first ) >>= sFilter;
if ( !sFilter.isEmpty() )
{
- sStatement.append(aPropertie.second);
+ sStatement.append(aProperty.second);
sFilter = sFilter.replaceFirst(sSourceName,sTargetNameTemp);
- _rxObject->setPropertyValue( aPropertie.first, makeAny(sFilter) );
+ _rxObject->setPropertyValue( aProperty.first, Any(sFilter) );
sStatement.append(sFilter);
}
}
@@ -210,8 +213,7 @@ OUString ObjectCopySource::getSelectStatement() const
}
else
{ // table
- OUStringBuffer aSQL;
- aSQL.append( "SELECT " );
+ OUStringBuffer aSQL( "SELECT " );
// we need to create the sql stmt with column names
// otherwise it is possible that names don't match
@@ -248,11 +250,10 @@ OUString ObjectCopySource::getSelectStatement() const
}
// NamedTableCopySource
-NamedTableCopySource::NamedTableCopySource( const Reference< XConnection >& _rxConnection, const OUString& _rTableName )
+NamedTableCopySource::NamedTableCopySource( const Reference< XConnection >& _rxConnection, OUString _sTableName )
:m_xConnection( _rxConnection, UNO_SET_THROW )
,m_xMetaData( _rxConnection->getMetaData(), UNO_SET_THROW )
- ,m_sTableName( _rTableName )
- ,m_aColumnInfo()
+ ,m_sTableName(std::move( _sTableName ))
{
::dbtools::qualifiedNameComponents( m_xMetaData, m_sTableName, m_sTableCatalog, m_sTableSchema, m_sTableBareName, ::dbtools::EComposeRule::Complete );
impl_ensureColumnInfo_throw();
@@ -268,7 +269,7 @@ bool NamedTableCopySource::isView() const
OUString sTableType;
try
{
- Reference< XResultSet > xTableDesc( m_xMetaData->getTables( makeAny( m_sTableCatalog ), m_sTableSchema, m_sTableBareName,
+ Reference< XResultSet > xTableDesc( m_xMetaData->getTables( Any( m_sTableCatalog ), m_sTableSchema, m_sTableBareName,
Sequence< OUString >() ) );
Reference< XRow > xTableDescRow( xTableDesc, UNO_QUERY_THROW );
OSL_VERIFY( xTableDesc->next() );
@@ -328,9 +329,8 @@ void NamedTableCopySource::impl_ensureColumnInfo_throw()
Sequence< OUString > NamedTableCopySource::getColumnNames() const
{
Sequence< OUString > aNames( m_aColumnInfo.size() );
- size_t nPos = 0;
- for (auto const& elem : m_aColumnInfo)
- aNames[ nPos++ ] = elem.GetName();
+ std::transform(m_aColumnInfo.begin(), m_aColumnInfo.end(), aNames.getArray(),
+ [](const auto& elem) { return elem.GetName(); });
return aNames;
}
@@ -341,13 +341,13 @@ Sequence< OUString > NamedTableCopySource::getPrimaryKeyColumnNames() const
try
{
- Reference< XResultSet > xPKDesc( m_xMetaData->getPrimaryKeys( makeAny( m_sTableCatalog ), m_sTableSchema, m_sTableBareName ) );
+ Reference< XResultSet > xPKDesc( m_xMetaData->getPrimaryKeys( Any( m_sTableCatalog ), m_sTableSchema, m_sTableBareName ) );
Reference< XRow > xPKDescRow( xPKDesc, UNO_QUERY_THROW );
while ( xPKDesc->next() )
{
sal_Int32 len( aPKColNames.getLength() );
aPKColNames.realloc( len + 1 );
- aPKColNames[ len ] = xPKDescRow->getString( 4 ); // COLUMN_NAME
+ aPKColNames.getArray()[ len ] = xPKDescRow->getString( 4 ); // COLUMN_NAME
}
}
catch( const Exception& )
@@ -578,17 +578,17 @@ OCopyTableWizard::OCopyTableWizard(weld::Window* pParent, const OUString& _rDefa
weld::Container* OCopyTableWizard::CreatePageContainer()
{
- OString sIdent(OString::number(m_nPageCount));
+ OUString sIdent(OUString::number(m_nPageCount));
weld::Container* pPageContainer = m_xAssistant->append_page(sIdent);
return pPageContainer;
}
-OCopyTableWizard::OCopyTableWizard( weld::Window* pParent, const OUString& _rDefaultName, sal_Int16 _nOperation,
- const ODatabaseExport::TColumns& _rSourceColumns, const ODatabaseExport::TColumnVector& _rSourceColVec,
+OCopyTableWizard::OCopyTableWizard( weld::Window* pParent, OUString _sDefaultName, sal_Int16 _nOperation,
+ ODatabaseExport::TColumns&& _rSourceColumns, const ODatabaseExport::TColumnVector& _rSourceColVec,
const Reference< XConnection >& _xConnection, const Reference< XNumberFormatter >& _xFormatter,
TypeSelectionPageFactory _pTypeSelectionPageFactory, SvStream& _rTypeSelectionPageArg, const Reference< XComponentContext >& _rxContext )
: vcl::RoadmapWizardMachine(pParent)
- , m_vSourceColumns(_rSourceColumns)
+ , m_vSourceColumns(std::move(_rSourceColumns))
, m_mNameMapping(_xConnection->getMetaData().is() && _xConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers())
, m_xDestConnection( _xConnection )
, m_rSourceObject( DummyCopySource::Instance() )
@@ -598,7 +598,7 @@ OCopyTableWizard::OCopyTableWizard( weld::Window* pParent, const OUString& _rDef
, m_nPageCount(0)
, m_bDeleteSourceColumns(false)
, m_bInterConnectionCopy( false )
- , m_sName(_rDefaultName)
+ , m_sName(std::move(_sDefaultName))
, m_nOperation( _nOperation )
, m_ePressed( WIZARD_NONE )
, m_bCreatePrimaryKeyColumn(false)
@@ -651,9 +651,9 @@ void OCopyTableWizard::construct()
if (!m_vDestColumns.empty())
// source is a html or rtf table
- m_xNextPage->set_has_default(true);
+ m_xAssistant->change_default_widget(nullptr, m_xNextPage.get());
else
- m_xFinish->set_has_default(true);
+ m_xAssistant->change_default_widget(nullptr, m_xFinish.get());
m_pTypeInfo = std::make_shared<OTypeInfo>();
m_pTypeInfo->aUIName = m_sTypeNames.getToken(TYPE_OTHER, ';');
@@ -671,6 +671,7 @@ OCopyTableWizard::~OCopyTableWizard()
m_aTypeInfoIndex.clear();
m_aTypeInfo.clear();
m_aDestTypeInfoIndex.clear();
+ m_aDestTypeInfo.clear();
}
IMPL_LINK_NOARG(OCopyTableWizard, ImplPrevHdl, weld::Button&, void)
@@ -736,6 +737,7 @@ bool OCopyTableWizard::CheckColumns(sal_Int32& _rnBreakPos)
OFieldDescription* pField = new OFieldDescription();
pField->SetName(m_aKeyName);
pField->FillFromTypeInfo(pTypeInfo,true,true);
+ pField->SetAutoIncrement(pTypeInfo->bAutoIncrement);
pField->SetPrimaryKey(true);
m_bAddPKFirstTime = false;
insertColumn(0,pField);
@@ -841,9 +843,8 @@ IMPL_LINK_NOARG(OCopyTableWizard, ImplOKHdl, weld::Button&, void)
{
OUString sMsg(DBA_RES(STR_TABLEDESIGN_NO_PRIM_KEY));
- SQLContext aError;
- aError.Message = sMsg;
- ::rtl::Reference xRequest( new ::comphelper::OInteractionRequest( makeAny( aError ) ) );
+ SQLContext aError(sMsg, {}, {}, 0, {}, {});
+ ::rtl::Reference xRequest( new ::comphelper::OInteractionRequest( Any( aError ) ) );
::rtl::Reference xYes = new ::comphelper::OInteractionApprove;
xRequest->addContinuation( xYes );
xRequest->addContinuation( new ::comphelper::OInteractionDisapprove );
@@ -991,7 +992,7 @@ void OCopyTableWizard::loadData( const ICopyTableSourceObject& _rSourceObject,
_rColumns.clear();
OFieldDescription* pActFieldDescr = nullptr;
- OUString const sCreateParam("x");
+ static constexpr OUStringLiteral sCreateParam(u"x");
// ReadOnly-Flag
// On drop no line must be editable.
// On add only empty lines must be editable.
@@ -1074,7 +1075,7 @@ void OCopyTableWizard::appendColumns( Reference<XColumnsSupplier> const & _rxCol
if(!_bKeyColumns)
dbaui::setColumnProperties(xColumn,pField);
else
- xColumn->setPropertyValue(PROPERTY_NAME,makeAny(pField->GetName()));
+ xColumn->setPropertyValue(PROPERTY_NAME,Any(pField->GetName()));
xAppend->appendByDescriptor(xColumn);
xColumn = nullptr;
@@ -1109,7 +1110,7 @@ void OCopyTableWizard::appendKey( Reference<XKeysSupplier> const & _rxSup, const
Reference<XPropertySet> xKey = xKeyFactory->createDataDescriptor();
OSL_ENSURE(xKey.is(),"Key is null!");
- xKey->setPropertyValue(PROPERTY_TYPE,makeAny(KeyType::PRIMARY));
+ xKey->setPropertyValue(PROPERTY_TYPE,Any(KeyType::PRIMARY));
Reference<XColumnsSupplier> xColSup(xKey,UNO_QUERY);
if(xColSup.is())
@@ -1201,9 +1202,9 @@ Reference< XPropertySet > OCopyTableWizard::createTable()
}
}
- xTable->setPropertyValue(PROPERTY_CATALOGNAME,makeAny(sCatalog));
- xTable->setPropertyValue(PROPERTY_SCHEMANAME,makeAny(sSchema));
- xTable->setPropertyValue(PROPERTY_NAME,makeAny(sTable));
+ xTable->setPropertyValue(PROPERTY_CATALOGNAME,Any(sCatalog));
+ xTable->setPropertyValue(PROPERTY_SCHEMANAME,Any(sSchema));
+ xTable->setPropertyValue(PROPERTY_NAME,Any(sTable));
Reference< XColumnsSupplier > xSuppDestinationColumns( xTable, UNO_QUERY );
// now append the columns
@@ -1358,7 +1359,7 @@ void OCopyTableWizard::setOperation( const sal_Int16 _nOperation )
OUString OCopyTableWizard::convertColumnName(const TColumnFindFunctor& _rCmpFunctor,
const OUString& _sColumnName,
- const OUString& _sExtraChars,
+ std::u16string_view _sExtraChars,
sal_Int32 _nMaxNameLen)
{
OUString sAlias = _sColumnName;
diff --git a/dbaccess/source/ui/misc/WExtendPages.cxx b/dbaccess/source/ui/misc/WExtendPages.cxx
index f34661cabd7d..c7eac9181e00 100644
--- a/dbaccess/source/ui/misc/WExtendPages.cxx
+++ b/dbaccess/source/ui/misc/WExtendPages.cxx
@@ -31,7 +31,7 @@ void OWizHTMLExtend::createReaderAndCallParser(sal_Int32 _nRows)
{
tools::SvRef<OHTMLReader> xParser = new OHTMLReader(*m_pParserStream,
_nRows,
- m_pParent->GetColumnPositions(),
+ std::vector(m_pParent->GetColumnPositions()),
m_pParent->GetFormatter(),
m_pParent->GetComponentContext(),
&m_pParent->getDestVector(),
@@ -44,7 +44,7 @@ void OWizRTFExtend::createReaderAndCallParser(sal_Int32 _nRows)
{
tools::SvRef<ORTFReader> xParser = new ORTFReader(*m_pParserStream,
_nRows,
- m_pParent->GetColumnPositions(),
+ std::vector(m_pParent->GetColumnPositions()),
m_pParent->GetFormatter(),
m_pParent->GetComponentContext(),
&m_pParent->getDestVector(),
diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx
index 75ff6e3372f1..a6bb59da8eea 100644
--- a/dbaccess/source/ui/misc/WNameMatch.cxx
+++ b/dbaccess/source/ui/misc/WNameMatch.cxx
@@ -119,7 +119,7 @@ bool OWizNameMatching::LeavePage()
bool bRightEntry = m_xCTRL_RIGHT->get_iter_first(*xRightEntry);
while (bLeftEntry && bRightEntry)
{
- OFieldDescription* pSrcField = reinterpret_cast<OFieldDescription*>(m_xCTRL_LEFT->get_id(*xLeftEntry).toInt64());
+ OFieldDescription* pSrcField = weld::fromId<OFieldDescription*>(m_xCTRL_LEFT->get_id(*xLeftEntry));
OSL_ENSURE(pSrcField,"OWizNameMatching: OColumn can not be null!");
sal_Int32 nPos = 0;
@@ -132,7 +132,7 @@ bool OWizNameMatching::LeavePage()
if (m_xCTRL_LEFT->get_toggle(*xLeftEntry) == TRISTATE_TRUE)
{
- OFieldDescription* pDestField = reinterpret_cast<OFieldDescription*>(m_xCTRL_RIGHT->get_id(*xRightEntry).toInt64());
+ OFieldDescription* pDestField = weld::fromId<OFieldDescription*>(m_xCTRL_RIGHT->get_id(*xRightEntry));
OSL_ENSURE(pDestField,"OWizNameMatching: OColumn can not be null!");
const ODatabaseExport::TColumnVector& rDestColumns = m_pParent->getDestVector();
sal_Int32 nPosDest = 1;
@@ -268,7 +268,7 @@ IMPL_LINK_NOARG( OWizNameMatching, TableListRightSelectHdl, weld::TreeView&, voi
if (nPos == -1)
return;
- OFieldDescription* pColumn = reinterpret_cast<OFieldDescription*>(m_xCTRL_RIGHT->get_id(nPos).toInt64());
+ OFieldDescription* pColumn = weld::fromId<OFieldDescription*>(m_xCTRL_RIGHT->get_id(nPos));
if (pColumn->IsAutoIncrement())
{
m_xCTRL_RIGHT->unselect(nPos);
@@ -319,7 +319,7 @@ void OWizNameMatching::FillListBox(weld::TreeView& rTreeView, const ODatabaseExp
rTreeView.set_toggle(nRow, bChecked ? TRISTATE_TRUE : TRISTATE_FALSE);
}
rTreeView.set_text(nRow, elem->first, 0);
- rTreeView.set_id(nRow, OUString::number(reinterpret_cast<sal_Int64>(elem->second)));
+ rTreeView.set_id(nRow, weld::toId(elem->second));
++nRow;
}
diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx
index 245e6281ed87..f27dcc921168 100644
--- a/dbaccess/source/ui/misc/WTypeSelect.cxx
+++ b/dbaccess/source/ui/misc/WTypeSelect.cxx
@@ -19,7 +19,7 @@
#include <WTypeSelect.hxx>
#include <bitmaps.hlst>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <FieldDescriptions.hxx>
#include <WCopyTable.hxx>
@@ -33,7 +33,6 @@
using namespace ::dbaui;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::sdbc;
@@ -86,7 +85,7 @@ void OWizTypeSelectControl::CellModified(sal_Int32 nRow, sal_uInt16 nColId )
OFieldDescription* pCurFieldDescr = getCurrentFieldDescData();
const sal_Int32 nPos = pListBox->find_text(pCurFieldDescr->GetName());
- pCurFieldDescr = reinterpret_cast< OFieldDescription* >( pListBox->get_id(nPos).toInt64() );
+ pCurFieldDescr = weld::fromId<OFieldDescription*>(pListBox->get_id(nPos));
OSL_ENSURE( pCurFieldDescr, "OWizTypeSelectControl::CellModified: Columnname/type not found in the listbox!" );
if ( !pCurFieldDescr )
return;
@@ -153,7 +152,7 @@ void OWizTypeSelectControl::CellModified(sal_Int32 nRow, sal_uInt16 nColId )
pListBox->remove(nPos);
pListBox->insert_text(nPos, pCurFieldDescr->GetName());
- pListBox->set_id(nPos, OUString::number(reinterpret_cast<sal_Int64>(pCurFieldDescr)));
+ pListBox->set_id(nPos, weld::toId(pCurFieldDescr));
pWiz->replaceColumn(nPos,pCurFieldDescr,sOldName);
}
@@ -205,7 +204,6 @@ OUString OWizTypeSelectControl::getAutoIncrementValue() const
OWizTypeSelect::OWizTypeSelect(weld::Container* pPage, OCopyTableWizard* pWizard, SvStream* pStream)
: OWizardPage(pPage, pWizard, "dbaccess/ui/typeselectpage.ui", "TypeSelect")
, m_xColumnNames(new OWizTypeSelectList(m_xBuilder->weld_tree_view("columnnames")))
- , m_xColumns(m_xBuilder->weld_label("columns"))
, m_xControlContainer(m_xBuilder->weld_container("control_container"))
, m_xTypeControl(new OWizTypeSelectControl(m_xControlContainer.get(), this))
, m_xAutoType(m_xBuilder->weld_label("autotype"))
@@ -248,7 +246,7 @@ OUString OWizTypeSelect::GetTitle() const
IMPL_LINK_NOARG(OWizTypeSelect, ColumnSelectHdl, weld::TreeView&, void)
{
- OFieldDescription* pField = reinterpret_cast<OFieldDescription*>(m_xColumnNames->get_selected_id().toInt64());
+ OFieldDescription* pField = weld::fromId<OFieldDescription*>(m_xColumnNames->get_selected_id());
if (pField)
m_xTypeControl->DisplayData(pField);
@@ -265,7 +263,7 @@ void OWizTypeSelect::Reset()
const ODatabaseExport::TColumnVector& rDestColumns = m_pParent->getDestVector();
for (auto const& column : rDestColumns)
{
- OUString sId(OUString::number(reinterpret_cast<sal_Int64>(column->second)));
+ OUString sId(weld::toId(column->second));
m_xColumnNames->append(sId, column->first);
if (column->second->IsPrimaryKey())
m_xColumnNames->set_image(nCount, BMP_PRIMARY_KEY);
@@ -288,7 +286,7 @@ void OWizTypeSelect::Activate( )
bool OWizTypeSelect::LeavePage()
{
bool bDuplicateName = false;
- OFieldDescription* pField = reinterpret_cast<OFieldDescription*>(m_xColumnNames->get_selected_id().toInt64());
+ OFieldDescription* pField = weld::fromId<OFieldDescription*>(m_xColumnNames->get_selected_id());
if ( pField )
{
m_xTypeControl->SaveData(pField);
@@ -339,7 +337,7 @@ bool OWizTypeSelectList::IsPrimaryKeyAllowed() const
for( sal_Int32 j = 0; m_bPKey && j < nCount; ++j )
{
- OFieldDescription* pField = reinterpret_cast<OFieldDescription*>(m_xControl->get_id(aRows[j]).toInt64());
+ OFieldDescription* pField = weld::fromId<OFieldDescription*>(m_xControl->get_id(aRows[j]));
if(!pField || pField->getTypeInfo()->nSearchType == ColumnSearch::NONE)
return false;
}
@@ -374,7 +372,7 @@ IMPL_LINK(OWizTypeSelectList, CommandHdl, const CommandEvent&, rCEvt, bool)
bool bCheckOk = false;
for(sal_Int32 j = 0 ; j < nCount ; ++j)
{
- OFieldDescription* pFieldDescr = reinterpret_cast<OFieldDescription*>(m_xControl->get_id(j).toInt64());
+ OFieldDescription* pFieldDescr = weld::fromId<OFieldDescription*>(m_xControl->get_id(j));
// if at least one of the fields is selected but not in the primary key,
// or is in the primary key but not selected, then don't check the
// primary key checkbox.
@@ -390,26 +388,26 @@ IMPL_LINK(OWizTypeSelectList, CommandHdl, const CommandEvent&, rCEvt, bool)
if (bCheckOk)
xContextMenu->set_active("primarykey", true);
- OString sCommand(xContextMenu->popup_at_rect(m_xControl.get(), tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1,1))));
- if (sCommand == "primarykey")
+ OUString sCommand(xContextMenu->popup_at_rect(m_xControl.get(), tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1,1))));
+ if (sCommand != "primarykey")
+ return true;
+
+ for (sal_Int32 j = 0 ; j < nCount; ++j)
{
- for (sal_Int32 j = 0 ; j < nCount; ++j)
+ OFieldDescription* pFieldDescr = weld::fromId<OFieldDescription*>(m_xControl->get_id(j));
+ if (pFieldDescr)
{
- OFieldDescription* pFieldDescr = reinterpret_cast<OFieldDescription*>(m_xControl->get_id(j).toInt64());
- if (pFieldDescr)
+ if(!bCheckOk && m_xControl->is_selected(j))
{
- if(!bCheckOk && m_xControl->is_selected(j))
- {
- setPrimaryKey(pFieldDescr,j,true);
- }
- else
- {
- setPrimaryKey(pFieldDescr,j);
- }
+ setPrimaryKey(pFieldDescr,j,true);
+ }
+ else
+ {
+ setPrimaryKey(pFieldDescr,j);
}
}
- m_aChangeHdl.Call(*m_xControl);
}
+ m_aChangeHdl.Call(*m_xControl);
return true;
}
diff --git a/dbaccess/source/ui/misc/asyncmodaldialog.cxx b/dbaccess/source/ui/misc/asyncmodaldialog.cxx
index 3c59a58f8b85..8323d47dba6f 100644
--- a/dbaccess/source/ui/misc/asyncmodaldialog.cxx
+++ b/dbaccess/source/ui/misc/asyncmodaldialog.cxx
@@ -22,7 +22,7 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <vcl/svapp.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaui
{
diff --git a/dbaccess/source/ui/misc/charsets.cxx b/dbaccess/source/ui/misc/charsets.cxx
index 86e55b226df0..5224e65d3c63 100644
--- a/dbaccess/source/ui/misc/charsets.cxx
+++ b/dbaccess/source/ui/misc/charsets.cxx
@@ -23,6 +23,7 @@
#include <strings.hrc>
#include <rtl/tencinfo.h>
#include <svx/txenctab.hxx>
+#include <utility>
namespace dbaui
{
@@ -30,8 +31,7 @@ namespace dbaui
// OCharsetDisplay
OCharsetDisplay::OCharsetDisplay()
- : OCharsetMap()
- , m_aSystemDisplayName(DBA_RES( STR_RSC_CHARSETS ))
+ : m_aSystemDisplayName(DBA_RES( STR_RSC_CHARSETS ))
{
}
@@ -62,7 +62,7 @@ namespace dbaui
return const_iterator( this, aBaseIter );
}
- OCharsetDisplay::const_iterator OCharsetDisplay::findIanaName(const OUString& _rIanaName) const
+ OCharsetDisplay::const_iterator OCharsetDisplay::findIanaName(std::u16string_view _rIanaName) const
{
OCharsetMap::const_iterator aBaseIter = OCharsetMap::findIanaName(_rIanaName);
return const_iterator( this, aBaseIter );
@@ -87,17 +87,17 @@ namespace dbaui
{
}
- CharsetDisplayDerefHelper::CharsetDisplayDerefHelper(const ::dbtools::CharsetIteratorDerefHelper& _rBase, const OUString& _rDisplayName)
+ CharsetDisplayDerefHelper::CharsetDisplayDerefHelper(const ::dbtools::CharsetIteratorDerefHelper& _rBase, OUString _sDisplayName)
:CharsetDisplayDerefHelper_Base(_rBase)
- ,m_sDisplayName(_rDisplayName)
+ ,m_sDisplayName(std::move(_sDisplayName))
{
OSL_ENSURE( !m_sDisplayName.isEmpty(), "CharsetDisplayDerefHelper::CharsetDisplayDerefHelper: invalid display name!" );
}
// OCharsetDisplay::ExtendedCharsetIterator
- OCharsetDisplay::ExtendedCharsetIterator::ExtendedCharsetIterator( const OCharsetDisplay* _pContainer, const base_iterator& _rPosition )
+ OCharsetDisplay::ExtendedCharsetIterator::ExtendedCharsetIterator( const OCharsetDisplay* _pContainer, base_iterator _aPosition )
:m_pContainer(_pContainer)
- ,m_aPosition(_rPosition)
+ ,m_aPosition(std::move(_aPosition))
{
OSL_ENSURE(m_pContainer, "OCharsetDisplay::ExtendedCharsetIterator::ExtendedCharsetIterator : invalid container!");
}
diff --git a/dbaccess/source/ui/misc/controllerframe.cxx b/dbaccess/source/ui/misc/controllerframe.cxx
index 599398e5d00f..365e144390c0 100644
--- a/dbaccess/source/ui/misc/controllerframe.cxx
+++ b/dbaccess/source/ui/misc/controllerframe.cxx
@@ -29,7 +29,7 @@
#include <cppuhelper/implbase.hxx>
#include <rtl/ref.hxx>
#include <sfx2/objsh.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/window.hxx>
@@ -42,7 +42,6 @@ namespace dbaui
using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::uno::UNO_SET_THROW;
using ::com::sun::star::uno::Exception;
- using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::Any;
using ::com::sun::star::frame::XFrame;
using ::com::sun::star::frame::FrameAction;
@@ -104,9 +103,6 @@ namespace dbaui
{
explicit ControllerFrame_Data( IController& _rController )
:m_rController( _rController )
- ,m_xFrame()
- ,m_xDocEventBroadcaster()
- ,m_pListener()
,m_bActive( false )
,m_bIsTopLevelDocumentWindow( false )
{
diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx b/dbaccess/source/ui/misc/databaseobjectview.cxx
index 49d3cfe5591a..47c3932ca21a 100644
--- a/dbaccess/source/ui/misc/databaseobjectview.cxx
+++ b/dbaccess/source/ui/misc/databaseobjectview.cxx
@@ -31,7 +31,8 @@
#include <connectivity/dbtools.hxx>
#include <osl/diagnose.h>
#include <toolkit/helper/vclunohelper.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+#include <utility>
#include <vcl/window.hxx>
namespace dbaui
@@ -51,12 +52,11 @@ namespace dbaui
DatabaseObjectView::DatabaseObjectView( const Reference< XComponentContext >& _rxORB,
const Reference< XDatabaseDocumentUI >& _rxApplication,
const Reference< XFrame >& _rxParentFrame,
- const OUString& _rComponentURL )
+ OUString _sComponentURL )
:m_xORB ( _rxORB )
,m_xParentFrame ( _rxParentFrame )
- ,m_xFrameLoader ( )
,m_xApplication ( _rxApplication )
- ,m_sComponentURL ( _rComponentURL )
+ ,m_sComponentURL (std::move( _sComponentURL ))
{
OSL_ENSURE( m_xORB.is(), "DatabaseObjectView::DatabaseObjectView: invalid service factory!" );
OSL_ENSURE( m_xApplication.is(), "DatabaseObjectView::DatabaseObjectView: invalid connection!" );
@@ -72,7 +72,7 @@ namespace dbaui
Reference< XComponent > DatabaseObjectView::createNew( const Reference< XDataSource >& _xDataSource, const ::comphelper::NamedValueCollection& i_rDispatchArgs )
{
- return doCreateView( makeAny( _xDataSource ), OUString(), i_rDispatchArgs );
+ return doCreateView( Any( _xDataSource ), OUString(), i_rDispatchArgs );
}
Reference< XComponent > DatabaseObjectView::openExisting( const Any& _rDataSource, const OUString& _rName,
@@ -104,21 +104,10 @@ namespace dbaui
if ( !m_xFrameLoader.is() )
{
Reference< XSingleServiceFactory > xFact = TaskCreator::create(m_xORB);
- Sequence< Any > lArgs(3);
- NamedValue aProp;
- sal_Int32 nArg = 0;
-
- aProp.Name = "ParentFrame";
- aProp.Value <<= m_xParentFrame;
- lArgs[nArg++] <<= aProp;
-
- aProp.Name = "TopWindow";
- aProp.Value <<= true;
- lArgs[nArg++] <<= aProp;
-
- aProp.Name = "SupportPersistentWindowState";
- aProp.Value <<= true;
- lArgs[nArg++] <<= aProp;
+ Sequence< Any > lArgs{ Any(NamedValue("ParentFrame", Any(m_xParentFrame))),
+ Any(NamedValue("TopWindow", Any(true))),
+ Any(NamedValue("SupportPersistentWindowState",
+ Any(true))) };
m_xFrameLoader.set(xFact->createInstanceWithArguments(lArgs), UNO_QUERY_THROW);
@@ -158,20 +147,20 @@ namespace dbaui
Reference<XDataSource> xDataSource;
if ( _aDataSource >>= sDataSource )
{
- i_rDispatchArgs.put( OUString(PROPERTY_DATASOURCENAME), sDataSource );
+ i_rDispatchArgs.put( PROPERTY_DATASOURCENAME, sDataSource );
}
else if ( _aDataSource >>= xDataSource )
{
- i_rDispatchArgs.put( OUString(PROPERTY_DATASOURCE), xDataSource );
+ i_rDispatchArgs.put( PROPERTY_DATASOURCE, xDataSource );
}
- i_rDispatchArgs.put( OUString(PROPERTY_ACTIVE_CONNECTION), getConnection() );
+ i_rDispatchArgs.put( PROPERTY_ACTIVE_CONNECTION, getConnection() );
}
// QueryDesigner
QueryDesigner::QueryDesigner( const Reference< XComponentContext >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication,
const Reference< XFrame >& _rxParentFrame, bool _bCreateView )
- :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, _bCreateView ? OUString(URL_COMPONENT_VIEWDESIGN) : OUString(URL_COMPONENT_QUERYDESIGN) )
+ :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, _bCreateView ? URL_COMPONENT_VIEWDESIGN : URL_COMPONENT_QUERYDESIGN )
,m_nCommandType( _bCreateView ? CommandType::TABLE : CommandType::QUERY )
{
}
@@ -185,22 +174,22 @@ namespace dbaui
const bool bGraphicalDesign = i_rDispatchArgs.getOrDefault( PROPERTY_GRAPHICAL_DESIGN, true );
const bool bEditViewAsSQLCommand = ( m_nCommandType == CommandType::TABLE ) && !bGraphicalDesign;
- i_rDispatchArgs.put( OUString(PROPERTY_COMMAND_TYPE), m_nCommandType );
+ i_rDispatchArgs.put( PROPERTY_COMMAND_TYPE, m_nCommandType );
if ( bIncludeQueryName )
{
- i_rDispatchArgs.put( OUString(PROPERTY_COMMAND), _rObjectName );
+ i_rDispatchArgs.put( PROPERTY_COMMAND, _rObjectName );
}
if ( bEditViewAsSQLCommand )
{
- i_rDispatchArgs.put( OUString(PROPERTY_ESCAPE_PROCESSING), false );
+ i_rDispatchArgs.put( PROPERTY_ESCAPE_PROCESSING, false );
}
}
// TableDesigner
TableDesigner::TableDesigner( const Reference< XComponentContext >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame )
- :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, static_cast< OUString >( URL_COMPONENT_TABLEDESIGN ) )
+ :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, URL_COMPONENT_TABLEDESIGN )
{
}
@@ -211,7 +200,7 @@ namespace dbaui
if ( !_rObjectName.isEmpty() )
{
- i_rDispatchArgs.put( OUString(PROPERTY_CURRENTTABLE), _rObjectName );
+ i_rDispatchArgs.put( PROPERTY_CURRENTTABLE, _rObjectName );
}
}
@@ -254,7 +243,7 @@ namespace dbaui
// ResultSetBrowser
ResultSetBrowser::ResultSetBrowser( const Reference< XComponentContext >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame,
bool _bTable )
- :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, static_cast < OUString >( URL_COMPONENT_DATASOURCEBROWSER ) )
+ :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, URL_COMPONENT_DATASOURCEBROWSER )
,m_bTable(_bTable)
{
}
@@ -264,27 +253,27 @@ namespace dbaui
{
DatabaseObjectView::fillDispatchArgs( i_rDispatchArgs, _aDataSource, _rQualifiedName );
OSL_ENSURE( !_rQualifiedName.isEmpty(),"A Table name must be set");
- OUString sCatalog;
- OUString sSchema;
- OUString sTable;
- if ( m_bTable )
- ::dbtools::qualifiedNameComponents( getConnection()->getMetaData(), _rQualifiedName, sCatalog, sSchema, sTable, ::dbtools::EComposeRule::InDataManipulation );
-
- i_rDispatchArgs.put( OUString(PROPERTY_COMMAND_TYPE), (m_bTable ? CommandType::TABLE : CommandType::QUERY) );
- i_rDispatchArgs.put( OUString(PROPERTY_COMMAND), _rQualifiedName );
- i_rDispatchArgs.put( OUString(PROPERTY_ENABLE_BROWSER), false );
+ i_rDispatchArgs.put( PROPERTY_COMMAND, _rQualifiedName );
+ i_rDispatchArgs.put( PROPERTY_ENABLE_BROWSER, false );
if ( m_bTable )
{
- i_rDispatchArgs.put( OUString(PROPERTY_UPDATE_CATALOGNAME), sCatalog );
- i_rDispatchArgs.put( OUString(PROPERTY_UPDATE_SCHEMANAME), sSchema );
- i_rDispatchArgs.put( OUString(PROPERTY_UPDATE_TABLENAME), sTable );
+ OUString sCatalog;
+ OUString sSchema;
+ OUString sTable;
+ ::dbtools::qualifiedNameComponents( getConnection()->getMetaData(), _rQualifiedName, sCatalog, sSchema, sTable, ::dbtools::EComposeRule::InDataManipulation );
+ i_rDispatchArgs.put( PROPERTY_UPDATE_CATALOGNAME, sCatalog );
+ i_rDispatchArgs.put( PROPERTY_UPDATE_SCHEMANAME, sSchema );
+ i_rDispatchArgs.put( PROPERTY_UPDATE_TABLENAME, sTable );
+ i_rDispatchArgs.put( PROPERTY_COMMAND_TYPE, CommandType::TABLE );
}
+ else
+ i_rDispatchArgs.put( PROPERTY_COMMAND_TYPE, CommandType::QUERY );
}
// RelationDesigner
RelationDesigner::RelationDesigner( const Reference< XComponentContext >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame )
- :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, static_cast< OUString >( URL_COMPONENT_RELATIONDESIGN ) )
+ :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, URL_COMPONENT_RELATIONDESIGN )
{
}
} // namespace dbaui
diff --git a/dbaccess/source/ui/misc/datasourceconnector.cxx b/dbaccess/source/ui/misc/datasourceconnector.cxx
index 49053e569000..a170d02963f9 100644
--- a/dbaccess/source/ui/misc/datasourceconnector.cxx
+++ b/dbaccess/source/ui/misc/datasourceconnector.cxx
@@ -30,10 +30,12 @@
#include <connectivity/dbexception.hxx>
#include <com/sun/star/sdbc/XDataSource.hpp>
#include <UITools.hxx>
+#include <utility>
+#include <vcl/mnemonic.hxx>
#include <vcl/outdev.hxx>
#include <vcl/stdtext.hxx>
#include <vcl/weld.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <strings.hrc>
#include <strings.hxx>
@@ -59,10 +61,10 @@ namespace dbaui
}
ODatasourceConnector::ODatasourceConnector( const Reference< XComponentContext >& _rxContext, weld::Window* _pMessageParent,
- const OUString& _rContextInformation )
+ OUString _sContextInformation )
:m_pErrorMessageParent(_pMessageParent)
,m_xContext(_rxContext)
- ,m_sContextInformation( _rContextInformation )
+ ,m_sContextInformation(std::move( _sContextInformation ))
{
}
@@ -155,11 +157,9 @@ namespace dbaui
{
OUString sMessage( DBA_RES( STR_WARNINGS_DURING_CONNECT ) );
sMessage = sMessage.replaceFirst( "$buttontext$", GetStandardText( StandardButtonType::More ) );
- sMessage = OutputDevice::GetNonMnemonicString( sMessage );
+ sMessage = removeMnemonicFromString( sMessage );
- SQLWarning aContext;
- aContext.Message = sMessage;
- aContext.NextException = aWarnings;
+ SQLWarning aContext(sMessage, {}, {}, 0, aWarnings);
aInfo = aContext;
}
xConnectionWarnings->clearWarnings();
@@ -174,10 +174,7 @@ namespace dbaui
{
if ( !m_sContextInformation.isEmpty() )
{
- SQLException aError;
- aError.Message = m_sContextInformation;
- aError.NextException = aInfo.get();
-
+ SQLException aError(m_sContextInformation, {}, {}, 0, aInfo.get());
aInfo = aError;
}
}
diff --git a/dbaccess/source/ui/misc/dbaundomanager.cxx b/dbaccess/source/ui/misc/dbaundomanager.cxx
index 4bf73c2b2e81..9ed72bbdf477 100644
--- a/dbaccess/source/ui/misc/dbaundomanager.cxx
+++ b/dbaccess/source/ui/misc/dbaundomanager.cxx
@@ -47,7 +47,6 @@ namespace dbaui
,rParent( i_parent )
,rMutex( i_mutex )
,bDisposed( false )
- ,aUndoManager()
,aUndoHelper( *this )
{
}
diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
index c036f8bdee82..0d3676db5d80 100644
--- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
+++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
@@ -37,12 +37,12 @@
#include <connectivity/dbexception.hxx>
#include <connectivity/dbmetadata.hxx>
#include <connectivity/dbtools.hxx>
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/interfacecontainer3.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/debug.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
@@ -124,7 +124,7 @@ namespace dbaui
public:
::dbtools::SQLExceptionInfo m_aCurrentError;
- ::comphelper::OInterfaceContainerHelper2
+ ::comphelper::OInterfaceContainerHelper3<css::util::XModifyListener>
m_aModifyListeners;
// <properties>
@@ -141,8 +141,7 @@ namespace dbaui
bool m_bNotAttached;
explicit DBSubComponentController_Impl(osl::Mutex& i_rMutex)
- :m_aDocScriptSupport()
- ,m_aModifyListeners( i_rMutex )
+ :m_aModifyListeners( i_rMutex )
,m_nDocStartNumber(0)
,m_bSuspended( false )
,m_bEditable(true)
@@ -153,14 +152,14 @@ namespace dbaui
bool documentHasScriptSupport() const
{
- OSL_PRECOND( !!m_aDocScriptSupport,
+ OSL_PRECOND( m_aDocScriptSupport.has_value(),
"DBSubComponentController_Impl::documentHasScriptSupport: not completely initialized, yet - don't know!?" );
- return !!m_aDocScriptSupport && *m_aDocScriptSupport;
+ return m_aDocScriptSupport.has_value() && *m_aDocScriptSupport;
}
void setDocumentScriptSupport( const bool _bSupport )
{
- OSL_PRECOND( !m_aDocScriptSupport,
+ OSL_PRECOND( !m_aDocScriptSupport.has_value(),
"DBSubComponentController_Impl::setDocumentScriptSupport: already initialized!" );
m_aDocScriptSupport = ::std::optional< bool >( _bSupport );
}
@@ -177,11 +176,9 @@ namespace dbaui
{
}
- void DBSubComponentController::impl_initialize()
+ void DBSubComponentController::impl_initialize(const ::comphelper::NamedValueCollection& rArguments)
{
- OGenericUnoController::impl_initialize();
-
- const ::comphelper::NamedValueCollection& rArguments( getInitParams() );
+ OGenericUnoController::impl_initialize(rArguments);
Reference< XConnection > xConnection;
xConnection = rArguments.getOrDefault( PROPERTY_ACTIVE_CONNECTION, xConnection );
@@ -211,7 +208,7 @@ namespace dbaui
if ( _rType.equals( cppu::UnoType<XScriptInvocationContext>::get() ) )
{
if ( m_pImpl->documentHasScriptSupport() )
- return makeAny( Reference< XScriptInvocationContext >( this ) );
+ return Any( Reference< XScriptInvocationContext >( this ) );
return Any();
}
@@ -223,11 +220,12 @@ namespace dbaui
Sequence< Type > aTypes( DBSubComponentController_Base::getTypes() );
if ( !m_pImpl->documentHasScriptSupport() )
{
- auto newEnd = std::remove_if( aTypes.begin(), aTypes.end(),
+ auto [begin, end] = asNonConstRange(aTypes);
+ auto newEnd = std::remove_if( begin, end,
[](const Type& type)
{ return type == cppu::UnoType<XScriptInvocationContext>::get(); } );
- aTypes.realloc( std::distance(aTypes.begin(), newEnd) );
- }
+ aTypes.realloc( std::distance(begin, newEnd) );
+ }
return aTypes;
}
@@ -535,8 +533,7 @@ namespace dbaui
Reference< XTitle > xTitle(getPrivateModel(),UNO_QUERY);
if ( xTitle.is() )
{
- sTitle.append( xTitle->getTitle() );
- sTitle.append(" : ");
+ sTitle.append( xTitle->getTitle() + " : ");
}
sTitle.append( getPrivateTitle() );
return sTitle.makeStringAndClear();
diff --git a/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx b/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx
index 53ef26fa3284..cc44de2bdee0 100644
--- a/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx
+++ b/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx
@@ -24,7 +24,6 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
-#include <com/sun/star/sdb/tools/XConnectionTools.hpp>
#include <com/sun/star/sdbc/SQLException.hpp>
#include <connectivity/dbexception.hxx>
@@ -32,7 +31,7 @@
#include <rtl/ustrbuf.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <memory>
@@ -47,7 +46,6 @@ namespace dbaui
using ::com::sun::star::sdbc::SQLException;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::sdbc::XConnection;
- using ::com::sun::star::sdb::tools::XObjectNames;
using ::com::sun::star::sdb::tools::XConnectionTools;
using ::com::sun::star::uno::UNO_QUERY;
@@ -60,29 +58,20 @@ namespace dbaui
{
void lcl_fillNameExistsError( std::u16string_view _rObjectName, SQLExceptionInfo& _out_rErrorToDisplay )
{
- SQLException aError;
OUString sErrorMessage = DBA_RES(STR_NAMED_OBJECT_ALREADY_EXISTS);
- aError.Message = sErrorMessage.replaceAll("$#$", _rObjectName);
+ SQLException aError(sErrorMessage.replaceAll("$#$", _rObjectName), {}, {}, 0, {});
_out_rErrorToDisplay = aError;
}
}
- // HierarchicalNameCheck_Impl
- struct HierarchicalNameCheck_Impl
- {
- Reference< XHierarchicalNameAccess > xHierarchicalNames;
- OUString sRelativeRoot;
- };
-
// HierarchicalNameCheck
HierarchicalNameCheck::HierarchicalNameCheck( const Reference< XHierarchicalNameAccess >& _rxNames, const OUString& _rRelativeRoot )
- :m_pImpl( new HierarchicalNameCheck_Impl )
{
- m_pImpl->xHierarchicalNames = _rxNames;
- m_pImpl->sRelativeRoot = _rRelativeRoot;
+ mxHierarchicalNames = _rxNames;
+ msRelativeRoot = _rRelativeRoot;
- if ( !m_pImpl->xHierarchicalNames.is() )
+ if ( !mxHierarchicalNames.is() )
throw IllegalArgumentException();
}
@@ -95,15 +84,14 @@ namespace dbaui
try
{
OUStringBuffer aCompleteName;
- if ( !m_pImpl->sRelativeRoot.isEmpty() )
+ if ( !msRelativeRoot.isEmpty() )
{
- aCompleteName.append( m_pImpl->sRelativeRoot );
- aCompleteName.append( "/" );
+ aCompleteName.append( msRelativeRoot + "/" );
}
aCompleteName.append( _rObjectName );
OUString sCompleteName( aCompleteName.makeStringAndClear() );
- if ( !m_pImpl->xHierarchicalNames->hasByHierarchicalName( sCompleteName ) )
+ if ( !mxHierarchicalNames->hasByHierarchicalName( sCompleteName ) )
return true;
}
catch( const Exception& )
@@ -115,26 +103,18 @@ namespace dbaui
return false;
}
- // DynamicTableOrQueryNameCheck_Impl
- struct DynamicTableOrQueryNameCheck_Impl
- {
- sal_Int32 nCommandType;
- Reference< XObjectNames > xObjectNames;
- };
-
// DynamicTableOrQueryNameCheck
DynamicTableOrQueryNameCheck::DynamicTableOrQueryNameCheck( const Reference< XConnection >& _rxSdbLevelConnection, sal_Int32 _nCommandType )
- :m_pImpl( new DynamicTableOrQueryNameCheck_Impl )
{
Reference< XConnectionTools > xConnTools( _rxSdbLevelConnection, UNO_QUERY );
if ( xConnTools.is() )
- m_pImpl->xObjectNames.set( xConnTools->getObjectNames() );
- if ( !m_pImpl->xObjectNames.is() )
+ mxObjectNames.set( xConnTools->getObjectNames() );
+ if ( !mxObjectNames.is() )
throw IllegalArgumentException();
if ( ( _nCommandType != CommandType::QUERY ) && ( _nCommandType != CommandType::TABLE ) )
throw IllegalArgumentException();
- m_pImpl->nCommandType = _nCommandType;
+ mnCommandType = _nCommandType;
}
DynamicTableOrQueryNameCheck::~DynamicTableOrQueryNameCheck()
@@ -145,7 +125,7 @@ namespace dbaui
{
try
{
- m_pImpl->xObjectNames->checkNameForCreate( m_pImpl->nCommandType, _rObjectName );
+ mxObjectNames->checkNameForCreate( mnCommandType, _rObjectName );
return true;
}
catch( const SQLException& )
diff --git a/dbaccess/source/ui/misc/dsmeta.cxx b/dbaccess/source/ui/misc/dsmeta.cxx
index 58831f081185..3673d4d3d9bb 100644
--- a/dbaccess/source/ui/misc/dsmeta.cxx
+++ b/dbaccess/source/ui/misc/dsmeta.cxx
@@ -28,7 +28,6 @@
namespace dbaui
{
- using namespace dbaccess;
using namespace ::com::sun::star;
namespace {
@@ -53,45 +52,39 @@ namespace dbaui
{
/// one of the items from dsitems.hxx
ItemID nItemID;
- const char* pAsciiFeatureName;
+ OUString pAsciiFeatureName;
};
- }
-
// global tables
- static const FeatureMapping* lcl_getFeatureMappings()
- {
- static const FeatureMapping s_aMappings[] = {
- { DSID_AUTORETRIEVEENABLED, "GeneratedValues" },
- { DSID_AUTOINCREMENTVALUE, "GeneratedValues" },
- { DSID_AUTORETRIEVEVALUE, "GeneratedValues" },
- { DSID_SQL92CHECK, "UseSQL92NamingConstraints" },
- { DSID_APPEND_TABLE_ALIAS, "AppendTableAliasInSelect" },
- { DSID_AS_BEFORE_CORRNAME, "UseKeywordAsBeforeAlias" },
- { DSID_ENABLEOUTERJOIN, "UseBracketedOuterJoinSyntax" },
- { DSID_IGNOREDRIVER_PRIV, "IgnoreDriverPrivileges" },
- { DSID_PARAMETERNAMESUBST, "ParameterNameSubstitution" },
- { DSID_SUPPRESSVERSIONCL, "DisplayVersionColumns" },
- { DSID_CATALOG, "UseCatalogInSelect" },
- { DSID_SCHEMA, "UseSchemaInSelect" },
- { DSID_INDEXAPPENDIX, "UseIndexDirectionKeyword" },
- { DSID_DOSLINEENDS, "UseDOSLineEnds" },
- { DSID_BOOLEANCOMPARISON, "BooleanComparisonMode" },
- { DSID_CHECK_REQUIRED_FIELDS, "FormsCheckRequiredFields" },
- { DSID_IGNORECURRENCY, "IgnoreCurrency" },
- { DSID_ESCAPE_DATETIME, "EscapeDateTime" },
- { DSID_PRIMARY_KEY_SUPPORT, "PrimaryKeySupport" },
- { DSID_RESPECTRESULTSETTYPE, "RespectDriverResultSetType" },
- { DSID_MAX_ROW_SCAN, "MaxRowScan" },
- { 0, nullptr }
- };
- return s_aMappings;
+ const FeatureMapping s_aMappings[] = {
+ { DSID_AUTORETRIEVEENABLED, "GeneratedValues" },
+ { DSID_AUTOINCREMENTVALUE, "GeneratedValues" },
+ { DSID_AUTORETRIEVEVALUE, "GeneratedValues" },
+ { DSID_SQL92CHECK, "UseSQL92NamingConstraints" },
+ { DSID_APPEND_TABLE_ALIAS, "AppendTableAliasInSelect" },
+ { DSID_AS_BEFORE_CORRNAME, "UseKeywordAsBeforeAlias" },
+ { DSID_ENABLEOUTERJOIN, "UseBracketedOuterJoinSyntax" },
+ { DSID_IGNOREDRIVER_PRIV, "IgnoreDriverPrivileges" },
+ { DSID_PARAMETERNAMESUBST, "ParameterNameSubstitution" },
+ { DSID_SUPPRESSVERSIONCL, "DisplayVersionColumns" },
+ { DSID_CATALOG, "UseCatalogInSelect" },
+ { DSID_SCHEMA, "UseSchemaInSelect" },
+ { DSID_INDEXAPPENDIX, "UseIndexDirectionKeyword" },
+ { DSID_DOSLINEENDS, "UseDOSLineEnds" },
+ { DSID_BOOLEANCOMPARISON, "BooleanComparisonMode" },
+ { DSID_CHECK_REQUIRED_FIELDS, "FormsCheckRequiredFields" },
+ { DSID_IGNORECURRENCY, "IgnoreCurrency" },
+ { DSID_ESCAPE_DATETIME, "EscapeDateTime" },
+ { DSID_PRIMARY_KEY_SUPPORT, "PrimaryKeySupport" },
+ { DSID_RESPECTRESULTSETTYPE, "RespectDriverResultSetType" },
+ { DSID_MAX_ROW_SCAN, "MaxRowScan" },
+ };
}
static const FeatureSet& lcl_getFeatureSet( const OUString& _rURL )
{
typedef std::map< OUString, FeatureSet > FeatureSets;
- static FeatureSets s_aFeatureSets = [&]()
+ static FeatureSets s_aFeatureSets = []()
{
FeatureSets tmp;
::connectivity::DriversConfig aDriverConfig( ::comphelper::getProcessComponentContext() );
@@ -101,12 +94,10 @@ namespace dbaui
FeatureSet aCurrentSet;
const ::comphelper::NamedValueCollection aCurrentFeatures( aDriverConfig.getFeatures( pattern ).getNamedValues() );
- const FeatureMapping* pFeatureMapping = lcl_getFeatureMappings();
- while ( pFeatureMapping->pAsciiFeatureName )
+ for ( const FeatureMapping& rFeatureMapping : s_aMappings )
{
- if ( aCurrentFeatures.has( pFeatureMapping->pAsciiFeatureName ) )
- aCurrentSet.put( pFeatureMapping->nItemID );
- ++pFeatureMapping;
+ if ( aCurrentFeatures.has( rFeatureMapping.pAsciiFeatureName ) )
+ aCurrentSet.put( rFeatureMapping.nItemID );
}
tmp[ pattern ] = aCurrentSet;
@@ -120,7 +111,7 @@ namespace dbaui
static AuthenticationMode getAuthenticationMode( const OUString& _sURL )
{
- static std::map< OUString, FeatureSupport > s_aSupport = [&]()
+ static std::map< OUString, FeatureSupport > s_aSupport = []()
{
std::map< OUString, FeatureSupport > tmp;
::connectivity::DriversConfig aDriverConfig(::comphelper::getProcessComponentContext());
@@ -148,26 +139,9 @@ namespace dbaui
return s_aSupport[ _sURL ].eAuthentication;
}
- // DataSourceMetaData_Impl
- class DataSourceMetaData_Impl
- {
- public:
- explicit DataSourceMetaData_Impl(const OUString& rURL);
-
- const OUString& getType() const { return m_sURL; }
-
- private:
- const OUString m_sURL;
- };
-
- DataSourceMetaData_Impl::DataSourceMetaData_Impl( const OUString& _sURL )
- :m_sURL( _sURL )
- {
- }
-
// DataSourceMetaData
DataSourceMetaData::DataSourceMetaData( const OUString& _sURL )
- :m_pImpl( std::make_shared<DataSourceMetaData_Impl>( _sURL ) )
+ :m_sURL( _sURL )
{
}
@@ -177,7 +151,7 @@ namespace dbaui
const FeatureSet& DataSourceMetaData::getFeatureSet() const
{
- return lcl_getFeatureSet( m_pImpl->getType() );
+ return lcl_getFeatureSet( m_sURL );
}
AuthenticationMode DataSourceMetaData::getAuthentication( const OUString& _sURL )
diff --git a/dbaccess/source/ui/misc/imageprovider.cxx b/dbaccess/source/ui/misc/imageprovider.cxx
index b69ec70e6a80..388df30e271f 100644
--- a/dbaccess/source/ui/misc/imageprovider.cxx
+++ b/dbaccess/source/ui/misc/imageprovider.cxx
@@ -25,7 +25,7 @@
#include <com/sun/star/sdb/application/DatabaseObject.hpp>
#include <com/sun/star/sdbcx/XViewsSupplier.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace dbaui
{
@@ -43,26 +43,16 @@ namespace dbaui
namespace GraphicColorMode = css::graphic::GraphicColorMode;
namespace DatabaseObject = css::sdb::application::DatabaseObject;
- // ImageProvider_Data
- struct ImageProvider_Data
- {
- /// the connection we work with
- Reference< XConnection > xConnection;
- /// the views of the connection, if the DB supports views
- Reference< XNameAccess > xViews;
- /// interface for providing table's UI
- Reference< XTableUIProvider > xTableUI;
- };
-
namespace
{
- void lcl_getConnectionProvidedTableIcon_nothrow( const ImageProvider_Data& _rData,
+ void lcl_getConnectionProvidedTableIcon_nothrow(
+ const css::uno::Reference< css::sdb::application::XTableUIProvider >& _xTableUI,
const OUString& _rName, Reference< XGraphic >& _out_rxGraphic )
{
try
{
- if ( _rData.xTableUI.is() )
- _out_rxGraphic = _rData.xTableUI->getTableIcon( _rName, GraphicColorMode::NORMAL );
+ if ( _xTableUI.is() )
+ _out_rxGraphic = _xTableUI->getTableIcon( _rName, GraphicColorMode::NORMAL );
}
catch( const Exception& )
{
@@ -70,13 +60,15 @@ namespace dbaui
}
}
- void lcl_getTableImageResourceID_nothrow( const ImageProvider_Data& _rData, const OUString& _rName,
+ void lcl_getTableImageResourceID_nothrow(
+ const css::uno::Reference< css::container::XNameAccess >& _xViews,
+ const OUString& _rName,
OUString& _out_rResourceID)
{
_out_rResourceID = OUString();
try
{
- bool bIsView = _rData.xViews.is() && _rData.xViews->hasByName( _rName );
+ bool bIsView = _xViews.is() && _xViews->hasByName( _rName );
if ( bIsView )
{
_out_rResourceID = VIEW_TREE_ICON;
@@ -94,21 +86,19 @@ namespace dbaui
}
// ImageProvider
ImageProvider::ImageProvider()
- :m_pData( std::make_shared<ImageProvider_Data>() )
{
}
ImageProvider::ImageProvider( const Reference< XConnection >& _rxConnection )
- :m_pData( std::make_shared<ImageProvider_Data>() )
+ : mxConnection(_rxConnection)
{
- m_pData->xConnection = _rxConnection;
try
{
- Reference< XViewsSupplier > xSuppViews( m_pData->xConnection, UNO_QUERY );
+ Reference< XViewsSupplier > xSuppViews( mxConnection, UNO_QUERY );
if ( xSuppViews.is() )
- m_pData->xViews.set( xSuppViews->getViews(), UNO_SET_THROW );
+ mxViews.set( xSuppViews->getViews(), UNO_SET_THROW );
- m_pData->xTableUI.set( _rxConnection, UNO_QUERY );
+ mxTableUI.set( _rxConnection, UNO_QUERY );
}
catch( const Exception& )
{
@@ -127,7 +117,7 @@ namespace dbaui
{
// no -> determine by type
OUString sImageResourceID;
- lcl_getTableImageResourceID_nothrow( *m_pData, _rName, sImageResourceID );
+ lcl_getTableImageResourceID_nothrow( mxViews, _rName, sImageResourceID );
return sImageResourceID;
}
}
@@ -138,7 +128,7 @@ namespace dbaui
if (_nDatabaseObjectType == DatabaseObject::TABLE)
{
// check whether the connection can give us an icon
- lcl_getConnectionProvidedTableIcon_nothrow( *m_pData, _rName, xGraphic );
+ lcl_getConnectionProvidedTableIcon_nothrow( mxTableUI, _rName, xGraphic );
}
return xGraphic;
}
diff --git a/dbaccess/source/ui/misc/indexcollection.cxx b/dbaccess/source/ui/misc/indexcollection.cxx
index 8a5448e623f9..169512ce723b 100644
--- a/dbaccess/source/ui/misc/indexcollection.cxx
+++ b/dbaccess/source/ui/misc/indexcollection.cxx
@@ -18,7 +18,7 @@
*/
#include <indexcollection.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <com/sun/star/sdbc/SQLException.hpp>
#include <com/sun/star/sdbcx/XAppend.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -122,10 +122,10 @@ namespace dbaui
}
// set the properties
- static constexpr OUStringLiteral s_sNamePropertyName = u"Name";
+ static constexpr OUString s_sNamePropertyName = u"Name"_ustr;
// the index' own props
- xIndexDescriptor->setPropertyValue("IsUnique", css::uno::makeAny(_rPos->bUnique));
- xIndexDescriptor->setPropertyValue(s_sNamePropertyName, makeAny(_rPos->sName));
+ xIndexDescriptor->setPropertyValue("IsUnique", css::uno::Any(_rPos->bUnique));
+ xIndexDescriptor->setPropertyValue(s_sNamePropertyName, Any(_rPos->sName));
// the fields
for (auto const& field : _rPos->aFields)
@@ -136,8 +136,8 @@ namespace dbaui
OSL_ENSURE(xColDescriptor.is(), "OIndexCollection::commitNewIndex: invalid column descriptor!");
if (xColDescriptor.is())
{
- xColDescriptor->setPropertyValue("IsAscending", css::uno::makeAny(field.bSortAscending));
- xColDescriptor->setPropertyValue(s_sNamePropertyName, makeAny(field.sFieldName));
+ xColDescriptor->setPropertyValue("IsAscending", css::uno::Any(field.bSortAscending));
+ xColDescriptor->setPropertyValue(s_sNamePropertyName, Any(field.sFieldName));
xAppendCols->appendByDescriptor(xColDescriptor);
}
}
diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx
index 13effe4ccd93..d1f7fa6aa1a1 100644
--- a/dbaccess/source/ui/misc/linkeddocuments.cxx
+++ b/dbaccess/source/ui/misc/linkeddocuments.cxx
@@ -20,7 +20,7 @@
#include <core_resource.hxx>
#include <linkeddocuments.hxx>
#include <osl/diagnose.h>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <unotools/confignode.hxx>
#include <comphelper/classids.hxx>
#include <comphelper/namedvaluecollection.hxx>
@@ -38,6 +38,7 @@
#include <browserids.hxx>
#include <com/sun/star/container/XHierarchicalNameContainer.hpp>
#include <comphelper/mimeconfighelper.hxx>
+#include <utility>
#include <vcl/weld.hxx>
#include <cppuhelper/exc_hlp.hxx>
@@ -51,13 +52,10 @@ namespace dbaui
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::frame;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::util;
using namespace ::com::sun::star::ucb;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb::application;
using namespace ::com::sun::star::task;
- using namespace ::svt;
namespace
{
@@ -65,24 +63,22 @@ namespace dbaui
sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11,
sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15 )
{
- Sequence< sal_Int8 > aResult( 16 );
- aResult[0] = static_cast<sal_Int8>(n1 >> 24);
- aResult[1] = static_cast<sal_Int8>(( n1 << 8 ) >> 24);
- aResult[2] = static_cast<sal_Int8>(( n1 << 16 ) >> 24);
- aResult[3] = static_cast<sal_Int8>(( n1 << 24 ) >> 24);
- aResult[4] = static_cast<sal_Int8>(n2 >> 8);
- aResult[5] = static_cast<sal_Int8>(( n2 << 8 ) >> 8);
- aResult[6] = static_cast<sal_Int8>(n3 >> 8);
- aResult[7] = static_cast<sal_Int8>(( n3 << 8 ) >> 8);
- aResult[8] = b8;
- aResult[9] = b9;
- aResult[10] = b10;
- aResult[11] = b11;
- aResult[12] = b12;
- aResult[13] = b13;
- aResult[14] = b14;
- aResult[15] = b15;
-
+ Sequence< sal_Int8 > aResult{ /* [ 0] */ static_cast<sal_Int8>(n1 >> 24),
+ /* [ 1] */ static_cast<sal_Int8>(( n1 << 8 ) >> 24),
+ /* [ 2] */ static_cast<sal_Int8>(( n1 << 16 ) >> 24),
+ /* [ 3] */ static_cast<sal_Int8>(( n1 << 24 ) >> 24),
+ /* [ 4] */ static_cast<sal_Int8>(n2 >> 8),
+ /* [ 5] */ static_cast<sal_Int8>(( n2 << 8 ) >> 8),
+ /* [ 6] */ static_cast<sal_Int8>(n3 >> 8),
+ /* [ 7] */ static_cast<sal_Int8>(( n3 << 8 ) >> 8),
+ /* [ 8] */ static_cast<sal_Int8>(b8),
+ /* [ 9] */ static_cast<sal_Int8>(b9),
+ /* [10] */ static_cast<sal_Int8>(b10),
+ /* [11] */ static_cast<sal_Int8>(b11),
+ /* [12] */ static_cast<sal_Int8>(b12),
+ /* [13] */ static_cast<sal_Int8>(b13),
+ /* [14] */ static_cast<sal_Int8>(b14),
+ /* [15] */ static_cast<sal_Int8>(b15) };
return aResult;
}
}
@@ -90,13 +86,13 @@ namespace dbaui
// OLinkedDocumentsAccess
OLinkedDocumentsAccess::OLinkedDocumentsAccess( weld::Window* pDialogParent, const Reference< XDatabaseDocumentUI >& i_rDocumentUI,
const Reference< XComponentContext >& _rxContext, const Reference< XNameAccess >& _rxContainer,
- const Reference< XConnection>& _xConnection, const OUString& _sDataSourceName )
+ const Reference< XConnection>& _xConnection, OUString _sDataSourceName )
:m_xContext(_rxContext)
,m_xDocumentContainer(_rxContainer)
,m_xConnection(_xConnection)
,m_xDocumentUI( i_rDocumentUI )
,m_pDialogParent(pDialogParent)
- ,m_sDataSourceName(_sDataSourceName)
+ ,m_sDataSourceName(std::move(_sDataSourceName))
{
OSL_ENSURE(m_xContext.is(), "OLinkedDocumentsAccess::OLinkedDocumentsAccess: invalid service factory!");
assert(m_pDialogParent && "OLinkedDocumentsAccess::OLinkedDocumentsAccess: really need a dialog parent!");
@@ -119,15 +115,15 @@ namespace dbaui
OUString sOpenMode;
switch ( _eOpenMode )
{
- case E_OPEN_NORMAL:
+ case ElementOpenMode::Normal:
sOpenMode = "open";
break;
- case E_OPEN_FOR_MAIL:
+ case ElementOpenMode::Mail:
aArguments.put( "Hidden", true );
[[fallthrough]];
- case E_OPEN_DESIGN:
+ case ElementOpenMode::Design:
sOpenMode = "openDesign";
break;
@@ -137,7 +133,7 @@ namespace dbaui
}
aArguments.put( "OpenMode", sOpenMode );
- aArguments.put( OUString(PROPERTY_ACTIVE_CONNECTION), m_xConnection );
+ aArguments.put( PROPERTY_ACTIVE_CONNECTION, m_xConnection );
Reference<XHierarchicalNameContainer> xHier(m_xDocumentContainer,UNO_QUERY);
if ( xHier.is() && xHier->hasByHierarchicalName(_rLinkName) )
@@ -253,7 +249,7 @@ namespace dbaui
::comphelper::NamedValueCollection aCreationArgs( i_rCreationArgs );
if ( aClassId.hasElements() )
aCreationArgs.put( "ClassID", aClassId );
- aCreationArgs.put( OUString(PROPERTY_ACTIVE_CONNECTION), m_xConnection );
+ aCreationArgs.put( PROPERTY_ACTIVE_CONNECTION, m_xConnection );
// separate values which are real creation args from args relevant for opening the doc
::comphelper::NamedValueCollection aCommandArgs;
@@ -304,16 +300,13 @@ namespace dbaui
OUString sMessage = DBA_RES(STR_COULDNOTOPEN_LINKEDDOC);
sMessage = sMessage.replaceFirst("$file$",_rLinkName);
- css::sdbc::SQLException aSQLException;
- aSQLException.Message = sMessage;
+ css::sdbc::SQLException aSQLException(sMessage, {}, {}, 0, {});
aInfo = dbtools::SQLExceptionInfo(aSQLException);
}
}
catch(const css::io::WrongFormatException &e)
{
- css::sdbc::SQLException aSQLException;
- aSQLException.Message = e.Message;
- aSQLException.Context = e.Context;
+ css::sdbc::SQLException aSQLException(e.Message, e.Context, {}, 0, {});
aInfo = dbtools::SQLExceptionInfo(aSQLException);
// more like a hack, insert an empty message
@@ -331,9 +324,7 @@ namespace dbaui
css::sdbc::SQLException a;
if ( !(aAny >>= a) || (a.ErrorCode != dbtools::ParameterInteractionCancelled) )
{
- css::sdbc::SQLException aSQLException;
- aSQLException.Message = e.Message;
- aSQLException.Context = e.Context;
+ css::sdbc::SQLException aSQLException(e.Message, e.Context, {}, 0, {});
aInfo = dbtools::SQLExceptionInfo(aSQLException);
// more like a hack, insert an empty message
diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx
index c07da46c955f..6f58676629d0 100644
--- a/dbaccess/source/ui/misc/singledoccontroller.cxx
+++ b/dbaccess/source/ui/misc/singledoccontroller.cxx
@@ -35,22 +35,10 @@ namespace dbaui
using ::com::sun::star::document::XUndoManager;
using ::com::sun::star::beans::PropertyValue;
- // OSingleDocumentController_Data
- struct OSingleDocumentController_Data
- {
- // no Reference! see UndoManager::acquire
- std::unique_ptr<UndoManager> m_pUndoManager;
-
- OSingleDocumentController_Data( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex )
- : m_pUndoManager(new UndoManager(i_parent, i_mutex))
- {
- }
- };
-
// OSingleDocumentController
OSingleDocumentController::OSingleDocumentController( const Reference< XComponentContext >& _rxORB )
:OSingleDocumentController_Base( _rxORB )
- ,m_pData( new OSingleDocumentController_Data( *this, getMutex() ) )
+ ,m_pUndoManager(new UndoManager(*this, getMutex()))
{
}
@@ -62,7 +50,7 @@ namespace dbaui
{
OSingleDocumentController_Base::disposing();
ClearUndoManager();
- m_pData->m_pUndoManager->disposing();
+ m_pUndoManager->disposing();
}
void OSingleDocumentController::ClearUndoManager()
@@ -72,7 +60,7 @@ namespace dbaui
SfxUndoManager& OSingleDocumentController::GetUndoManager() const
{
- return m_pData->m_pUndoManager->GetSfxUndoManager();
+ return m_pUndoManager->GetSfxUndoManager();
}
void OSingleDocumentController::addUndoActionAndInvalidate(std::unique_ptr<SfxUndoAction> _pAction)
@@ -91,7 +79,7 @@ namespace dbaui
Reference< XUndoManager > SAL_CALL OSingleDocumentController::getUndoManager( )
{
// see UndoManager::acquire
- return m_pData->m_pUndoManager.get();
+ return m_pUndoManager.get();
}
FeatureState OSingleDocumentController::GetState(sal_uInt16 _nId) const
@@ -123,8 +111,9 @@ namespace dbaui
{
size_t nCount(GetUndoManager().GetUndoActionCount());
Sequence<OUString> aSeq(nCount);
+ auto aSeqRange = asNonConstRange(aSeq);
for (size_t n = 0; n < nCount; ++n)
- aSeq[n] = GetUndoManager().GetUndoActionComment(n);
+ aSeqRange[n] = GetUndoManager().GetUndoActionComment(n);
aReturn.aValue <<= aSeq;
aReturn.bEnabled = true;
break;
@@ -134,8 +123,9 @@ namespace dbaui
{
size_t nCount(GetUndoManager().GetRedoActionCount());
Sequence<OUString> aSeq(nCount);
+ auto aSeqRange = asNonConstRange(aSeq);
for (size_t n = 0; n < nCount; ++n)
- aSeq[n] = GetUndoManager().GetRedoActionComment(n);
+ aSeqRange[n] = GetUndoManager().GetRedoActionComment(n);
aReturn.aValue <<= aSeq;
aReturn.bEnabled = true;
break;
diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx b/dbaccess/source/ui/querydesign/ConnectionLine.cxx
index 96086d60b682..b22a05424df3 100644
--- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx
+++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx
@@ -22,6 +22,7 @@
#include <TableWindow.hxx>
#include <TableWindowListBox.hxx>
#include <TableConnection.hxx>
+#include <utility>
#include <vcl/svapp.hxx>
#include <math.h>
#include <osl/diagnose.h>
@@ -121,9 +122,9 @@ namespace
}
}
-OConnectionLine::OConnectionLine( OTableConnection* _pConn, OConnectionLineDataRef const & _pLineData )
+OConnectionLine::OConnectionLine( OTableConnection* _pConn, OConnectionLineDataRef _pLineData )
: m_pTabConn( _pConn )
- , m_pData( _pLineData )
+ , m_pData(std::move( _pLineData ))
{
}
@@ -307,7 +308,7 @@ static double dist_Euklid(const Point &p1, const Point& p2,const Point& pM, Poin
{
Point v(p2 - p1);
Point w(pM - p1);
- double a = sqrt(static_cast<double>(v.X()*v.X() + v.Y()*v.Y()));
+ double a = std::hypot(v.X(), v.Y());
double l = (v.X() * w.Y() - v.Y() * w.X()) / a;
double a2 = w.X()*v.X()+w.Y()*v.Y();
a = a2 / (a * a);
diff --git a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
index 763e53990276..1fa17c06207c 100644
--- a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
+++ b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
@@ -25,18 +25,16 @@
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <TableConnection.hxx>
#include <TableWindow.hxx>
-#include <comphelper/sequence.hxx>
namespace dbaui
{
using namespace ::com::sun::star::accessibility;
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star;
OConnectionLineAccess::OConnectionLineAccess(OTableConnection* _pLine)
- : VCLXAccessibleComponent(_pLine->GetComponentInterface().is() ? _pLine->GetWindowPeer() : nullptr)
+ : ImplInheritanceHelper(_pLine->GetComponentInterface().is() ? _pLine->GetWindowPeer() : nullptr)
,m_pLine(_pLine)
{
}
@@ -45,32 +43,23 @@ namespace dbaui
m_pLine = nullptr;
VCLXAccessibleComponent::disposing();
}
- Any SAL_CALL OConnectionLineAccess::queryInterface( const Type& aType )
- {
- Any aRet(VCLXAccessibleComponent::queryInterface( aType ));
- return aRet.hasValue() ? aRet : OConnectionLineAccess_BASE::queryInterface( aType );
- }
- Sequence< Type > SAL_CALL OConnectionLineAccess::getTypes( )
- {
- return ::comphelper::concatSequences(VCLXAccessibleComponent::getTypes(),OConnectionLineAccess_BASE::getTypes());
- }
OUString SAL_CALL OConnectionLineAccess::getImplementationName()
{
return "org.openoffice.comp.dbu.ConnectionLineAccessibility";
}
// XAccessibleContext
- sal_Int32 SAL_CALL OConnectionLineAccess::getAccessibleChildCount( )
+ sal_Int64 SAL_CALL OConnectionLineAccess::getAccessibleChildCount( )
{
return 0;
}
- Reference< XAccessible > SAL_CALL OConnectionLineAccess::getAccessibleChild( sal_Int32 /*i*/ )
+ Reference< XAccessible > SAL_CALL OConnectionLineAccess::getAccessibleChild( sal_Int64 /*i*/ )
{
return Reference< XAccessible >();
}
- sal_Int32 SAL_CALL OConnectionLineAccess::getAccessibleIndexInParent( )
+ sal_Int64 SAL_CALL OConnectionLineAccess::getAccessibleIndexInParent( )
{
::osl::MutexGuard aGuard( m_aMutex );
- sal_Int32 nIndex = -1;
+ sal_Int64 nIndex = -1;
if( m_pLine )
{
// search the position of our table window in the table window map
@@ -113,7 +102,7 @@ namespace dbaui
{
::osl::MutexGuard aGuard( m_aMutex );
tools::Rectangle aRect(m_pLine ? m_pLine->GetBoundingRect() : tools::Rectangle());
- return awt::Rectangle(aRect.getX(),aRect.getY(),aRect.getWidth(),aRect.getHeight());
+ return awt::Rectangle(aRect.Left(),aRect.Top(),aRect.getOpenWidth(),aRect.getOpenHeight());
}
awt::Point SAL_CALL OConnectionLineAccess::getLocation( )
{
@@ -144,11 +133,11 @@ namespace dbaui
if( nIndex < 0 || nIndex >= getRelationCount() )
throw IndexOutOfBoundsException();
- Sequence< Reference<XInterface> > aSeq(m_pLine ? 2 : 0);
+ Sequence<Reference<XAccessible>> aSeq;
if( m_pLine )
{
- aSeq[0] = m_pLine->GetSourceWin()->GetAccessible();
- aSeq[1] = m_pLine->GetDestWin()->GetAccessible();
+ aSeq = { m_pLine->GetSourceWin()->GetAccessible(),
+ m_pLine->GetDestWin()->GetAccessible() };
}
return AccessibleRelation(AccessibleRelationType::CONTROLLED_BY,aSeq);
diff --git a/dbaccess/source/ui/querydesign/ConnectionLineData.cxx b/dbaccess/source/ui/querydesign/ConnectionLineData.cxx
index db7177294e64..8267cc3ed8c2 100644
--- a/dbaccess/source/ui/querydesign/ConnectionLineData.cxx
+++ b/dbaccess/source/ui/querydesign/ConnectionLineData.cxx
@@ -18,15 +18,16 @@
*/
#include <ConnectionLineData.hxx>
+#include <utility>
using namespace dbaui;
OConnectionLineData::OConnectionLineData()
{
}
-OConnectionLineData::OConnectionLineData( const OUString& rSourceFieldName, const OUString& rDestFieldName )
- :m_aSourceFieldName( rSourceFieldName )
- ,m_aDestFieldName( rDestFieldName )
+OConnectionLineData::OConnectionLineData( OUString sSourceFieldName, OUString sDestFieldName )
+ :m_aSourceFieldName(std::move( sSourceFieldName ))
+ ,m_aDestFieldName(std::move( sDestFieldName ))
{
}
diff --git a/dbaccess/source/ui/querydesign/JAccess.cxx b/dbaccess/source/ui/querydesign/JAccess.cxx
index 8068f0fa7f21..13a18b918db7 100644
--- a/dbaccess/source/ui/querydesign/JAccess.cxx
+++ b/dbaccess/source/ui/querydesign/JAccess.cxx
@@ -29,11 +29,10 @@ namespace dbaui
{
using namespace ::com::sun::star::accessibility;
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
OJoinDesignViewAccess::OJoinDesignViewAccess(OJoinTableView* _pTableView)
- :VCLXAccessibleComponent(_pTableView->GetComponentInterface().is() ? _pTableView->GetWindowPeer() : nullptr)
+ :ImplInheritanceHelper(_pTableView->GetComponentInterface().is() ? _pTableView->GetWindowPeer() : nullptr)
,m_pTableView(_pTableView)
{
}
@@ -47,24 +46,24 @@ namespace dbaui
m_pTableView = nullptr;
}
// XAccessibleContext
- sal_Int32 SAL_CALL OJoinDesignViewAccess::getAccessibleChildCount( )
+ sal_Int64 SAL_CALL OJoinDesignViewAccess::getAccessibleChildCount( )
{
// TODO may be this will change to only visible windows
// this is the same assumption mt implements
::osl::MutexGuard aGuard( m_aMutex );
- sal_Int32 nChildCount = 0;
+ sal_Int64 nChildCount = 0;
if ( m_pTableView )
nChildCount = m_pTableView->GetTabWinCount() + m_pTableView->getTableConnections().size();
return nChildCount;
}
- Reference< XAccessible > SAL_CALL OJoinDesignViewAccess::getAccessibleChild( sal_Int32 i )
+ Reference< XAccessible > SAL_CALL OJoinDesignViewAccess::getAccessibleChild( sal_Int64 i )
{
Reference< XAccessible > aRet;
::osl::MutexGuard aGuard( m_aMutex );
if(i < 0 || i >= getAccessibleChildCount() || !m_pTableView)
throw IndexOutOfBoundsException();
// check if we should return a table window or a connection
- sal_Int32 nTableWindowCount = m_pTableView->GetTabWinCount();
+ sal_Int64 nTableWindowCount = m_pTableView->GetTabWinCount();
if( i < nTableWindowCount )
{
OJoinTableView::OTableWindowMap::const_iterator aIter = std::next(m_pTableView->GetTabWinMap().begin(), i);
@@ -82,10 +81,6 @@ namespace dbaui
{
return this;
}
- // XInterface
- IMPLEMENT_FORWARD_XINTERFACE2( OJoinDesignViewAccess, VCLXAccessibleComponent, OJoinDesignViewAccess_BASE )
- // XTypeProvider
- IMPLEMENT_FORWARD_XTYPEPROVIDER2( OJoinDesignViewAccess, VCLXAccessibleComponent, OJoinDesignViewAccess_BASE )
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx
index 114f77d99865..5ef77a5ebc18 100644
--- a/dbaccess/source/ui/querydesign/JoinController.cxx
+++ b/dbaccess/source/ui/querydesign/JoinController.cxx
@@ -34,12 +34,8 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdb;
-using namespace ::com::sun::star::ui::dialogs;
using namespace ::dbtools;
using namespace ::comphelper;
@@ -204,6 +200,7 @@ AddTableDialogContext& OJoinController::impl_getDialogContext() const
OJoinController* pNonConstThis = const_cast< OJoinController* >( this );
pNonConstThis->m_pDialogContext.reset( new AddTableDialogContext( *pNonConstThis ) );
}
+ assert(m_pDialogContext && "always exists at this point");
return *m_pDialogContext;
}
@@ -277,7 +274,7 @@ void OJoinController::SaveTabWinsPosSize( OJoinTableView::OTableWindowMap* pTabW
void OJoinController::removeConnectionData(const TTableConnectionData::value_type& _pData)
{
- m_vTableConnectionData.erase( std::remove(m_vTableConnectionData.begin(),m_vTableConnectionData.end(),_pData),m_vTableConnectionData.end());
+ std::erase(m_vTableConnectionData, _pData);
}
void OJoinController::describeSupportedFeatures()
diff --git a/dbaccess/source/ui/querydesign/JoinDesignView.cxx b/dbaccess/source/ui/querydesign/JoinDesignView.cxx
index c0d3ea81c7a0..ae09be66c26b 100644
--- a/dbaccess/source/ui/querydesign/JoinDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinDesignView.cxx
@@ -24,11 +24,6 @@
#include <vcl/settings.hxx>
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::util;
namespace dbaui
{
diff --git a/dbaccess/source/ui/querydesign/JoinExchange.cxx b/dbaccess/source/ui/querydesign/JoinExchange.cxx
index 2fda531e716c..8b218ccf269f 100644
--- a/dbaccess/source/ui/querydesign/JoinExchange.cxx
+++ b/dbaccess/source/ui/querydesign/JoinExchange.cxx
@@ -20,12 +20,10 @@
#include <JoinExchange.hxx>
#include <sot/formats.hxx>
#include <comphelper/servicehelper.hxx>
-#include <cppuhelper/typeprovider.hxx>
namespace dbaui
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::datatransfer;
void OJoinExchObj::setDescriptors(const OJoinExchangeData& jxdSource,bool _bFirstEntry)
@@ -56,25 +54,21 @@ namespace dbaui
OJoinExchangeData OJoinExchObj::GetSourceDescription(const Reference< XTransferable >& _rxObject)
{
OJoinExchangeData aReturn;
- auto pImplementation = comphelper::getUnoTunnelImplementation<OJoinExchObj>(_rxObject);
+ auto pImplementation = comphelper::getFromUnoTunnel<OJoinExchObj>(_rxObject);
if (pImplementation)
aReturn = pImplementation->m_jxdSourceDescription;
return aReturn;
}
- Sequence< sal_Int8 > OJoinExchObj::getUnoTunnelId()
+ const Sequence< sal_Int8 > & OJoinExchObj::getUnoTunnelId()
{
- static ::cppu::OImplementationId implId;
-
- return implId.getImplementationId();
+ static const comphelper::UnoIdInit implId;
+ return implId.getSeq();
}
sal_Int64 SAL_CALL OJoinExchObj::getSomething( const Sequence< sal_Int8 >& _rIdentifier )
{
- if (isUnoTunnelId<OJoinExchObj>(_rIdentifier))
- return reinterpret_cast<sal_Int64>(this);
-
- return 0;
+ return comphelper::getSomethingImpl(_rIdentifier, this);
}
void OJoinExchObj::AddSupportedFormats()
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index ff31bcefddc0..88085c8eadd8 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -46,7 +46,7 @@
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <cppuhelper/exc_hlp.hxx>
#include <connectivity/dbtools.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <algorithm>
#include <functional>
@@ -54,7 +54,6 @@ using namespace dbaui;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::accessibility;
-using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
#define LINE_SIZE 50
@@ -66,14 +65,14 @@ using namespace ::com::sun::star::lang;
#define TABWIN_HEIGHT_STD 120
OScrollWindowHelper::OScrollWindowHelper( vcl::Window* pParent) : Window( pParent)
- ,m_aHScrollBar( VclPtr<ScrollBar>::Create(this, WB_HSCROLL|WB_REPEAT|WB_DRAG) )
- ,m_aVScrollBar( VclPtr<ScrollBar>::Create(this, WB_VSCROLL|WB_REPEAT|WB_DRAG) )
- ,m_pCornerWindow(VclPtr<ScrollBarBox>::Create(this, WB_3DLOOK))
+ ,m_aHScrollBar( VclPtr<ScrollAdaptor>::Create(this, true) )
+ ,m_aVScrollBar( VclPtr<ScrollAdaptor>::Create(this, false) )
,m_pTableView(nullptr)
{
+ StyleSettings aSystemStyle = Application::GetSettings().GetStyleSettings();
+ SetBackground(aSystemStyle.GetFaceColor());
// ScrollBars
-
GetHScrollBar().SetRange( Range(0, 1000) );
GetVScrollBar().SetRange( Range(0, 1000) );
@@ -82,7 +81,6 @@ OScrollWindowHelper::OScrollWindowHelper( vcl::Window* pParent) : Window( pParen
GetHScrollBar().Show();
GetVScrollBar().Show();
- m_pCornerWindow->Show();
// normally we should be SCROLL_PANE
SetAccessibleRole(AccessibleRole::SCROLL_PANE);
@@ -97,7 +95,6 @@ void OScrollWindowHelper::dispose()
{
m_aHScrollBar.disposeAndClear();
m_aVScrollBar.disposeAndClear();
- m_pCornerWindow.disposeAndClear();
m_pTableView.clear();
vcl::Window::dispose();
}
@@ -106,8 +103,8 @@ void OScrollWindowHelper::setTableView(OJoinTableView* _pTableView)
{
m_pTableView = _pTableView;
// ScrollBars
- GetHScrollBar().SetScrollHdl( LINK(m_pTableView, OJoinTableView, ScrollHdl) );
- GetVScrollBar().SetScrollHdl( LINK(m_pTableView, OJoinTableView, ScrollHdl) );
+ GetHScrollBar().SetScrollHdl( LINK(m_pTableView, OJoinTableView, HorzScrollHdl) );
+ GetVScrollBar().SetScrollHdl( LINK(m_pTableView, OJoinTableView, VertScrollHdl) );
}
void OScrollWindowHelper::resetRange(const Point& _aSize)
@@ -135,11 +132,6 @@ void OScrollWindowHelper::Resize()
Size( nVScrollWidth, aTotalOutputSize.Height()-nHScrollHeight )
);
- m_pCornerWindow->SetPosSizePixel(
- Point( aTotalOutputSize.Width() - nVScrollWidth, aTotalOutputSize.Height() - nHScrollHeight),
- Size( nVScrollWidth, nHScrollHeight )
- );
-
GetHScrollBar().SetPageSize( aTotalOutputSize.Width() );
GetHScrollBar().SetVisibleSize( aTotalOutputSize.Width() );
@@ -162,6 +154,7 @@ void OScrollWindowHelper::Resize()
OJoinTableView::OJoinTableView( vcl::Window* pParent, OJoinDesignView* pView )
:Window( pParent,WB_BORDER )
,DropTargetHelper(this)
+ ,m_aDragScrollIdle("dbaccess OJoinTableView m_aDragScrollIdle")
,m_aDragOffset( Point(0,0) )
,m_aScrollOffset( Point(0,0) )
,m_pDragWin( nullptr )
@@ -200,10 +193,16 @@ void OJoinTableView::dispose()
vcl::Window::dispose();
}
-IMPL_LINK( OJoinTableView, ScrollHdl, ScrollBar*, pScrollBar, void )
+IMPL_LINK(OJoinTableView, HorzScrollHdl, weld::Scrollbar&, rScrollbar, void)
+{
+ // move all windows
+ ScrollPane(rScrollbar.adjustment_get_value() - m_aScrollOffset.X(), true, false);
+}
+
+IMPL_LINK(OJoinTableView, VertScrollHdl, weld::Scrollbar&, rScrollbar, void)
{
// move all windows
- ScrollPane( pScrollBar->GetDelta(), (pScrollBar == &GetHScrollBar()), false );
+ ScrollPane(rScrollbar.adjustment_get_value() - m_aScrollOffset.Y(), false, false);
}
void OJoinTableView::Resize()
@@ -236,7 +235,7 @@ void OJoinTableView::Resize()
}
}
-sal_uLong OJoinTableView::GetTabWinCount() const
+sal_Int64 OJoinTableView::GetTabWinCount() const
{
return m_aTableMap.size();
}
@@ -257,7 +256,7 @@ bool OJoinTableView::RemoveConnection(VclPtr<OTableConnection>& rConn, bool _bDe
modified();
if ( m_pAccessible )
m_pAccessible->notifyAccessibleEvent( AccessibleEventId::CHILD,
- makeAny(xConn->GetAccessible()),
+ Any(xConn->GetAccessible()),
Any());
if (_bDelete)
xConn->disposeOnce();
@@ -337,7 +336,7 @@ void OJoinTableView::AddTabWin(const OUString& _rComposedName, const OUString& r
if ( m_pAccessible )
m_pAccessible->notifyAccessibleEvent( AccessibleEventId::CHILD,
Any(),
- makeAny(pNewTabWin->GetAccessible()));
+ Any(pNewTabWin->GetAccessible()));
}
else
{
@@ -373,7 +372,7 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin )
{
if ( m_pAccessible )
m_pAccessible->notifyAccessibleEvent( AccessibleEventId::CHILD,
- makeAny(pTabWin->GetAccessible()),Any()
+ Any(pTabWin->GetAccessible()),Any()
);
pTabWin->Hide();
@@ -404,7 +403,7 @@ namespace
bool isScrollAllowed( OJoinTableView* _pView,tools::Long nDelta, bool bHoriz)
{
// adjust ScrollBar-Positions
- ScrollBar& rBar = bHoriz ? _pView->GetHScrollBar() : _pView->GetVScrollBar() ;
+ ScrollAdaptor& rBar = bHoriz ? _pView->GetHScrollBar() : _pView->GetVScrollBar();
tools::Long nOldThumbPos = rBar.GetThumbPos();
tools::Long nNewThumbPos = nOldThumbPos + nDelta;
@@ -580,9 +579,9 @@ void OJoinTableView::SetDefaultTabWinPosSize( OTableWindow* pTabWin )
aBottom.AdjustX(aNewSize.Width() );
aBottom.AdjustY(aNewSize.Height() );
- if(!GetHScrollBar().GetRange().IsInside(aBottom.X()))
+ if(!GetHScrollBar().GetRange().Contains(aBottom.X()))
GetHScrollBar().SetRange( Range(0, aBottom.X()) );
- if(!GetVScrollBar().GetRange().IsInside(aBottom.Y()))
+ if(!GetVScrollBar().GetRange().Contains(aBottom.Y()))
GetVScrollBar().SetRange( Range(0, aBottom.Y()) );
pTabWin->SetPosSizePixel( aNewPos, aNewSize );
@@ -1122,7 +1121,7 @@ void OJoinTableView::executePopup(const Point& rPos, VclPtr<OTableConnection>& r
weld::Window* pPopupParent = weld::GetPopupParent(*this, aRect);
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pPopupParent, "dbaccess/ui/joinviewmenu.ui"));
std::unique_ptr<weld::Menu> xContextMenu(xBuilder->weld_menu("menu"));
- OString sIdent = xContextMenu->popup_at_rect(pPopupParent, aRect);
+ OUString sIdent = xContextMenu->popup_at_rect(pPopupParent, aRect);
if (sIdent == "delete")
RemoveConnection(rSelConnection, true);
else if (sIdent == "edit")
@@ -1218,7 +1217,7 @@ bool OJoinTableView::PreNotify(NotifyEvent& rNEvt)
bool bHandled = false;
switch (rNEvt.GetType())
{
- case MouseNotifyEvent::COMMAND:
+ case NotifyEventType::COMMAND:
{
const CommandEvent* pCommand = rNEvt.GetCommandEvent();
if (pCommand->GetCommand() == CommandEventId::Wheel)
@@ -1235,7 +1234,7 @@ bool OJoinTableView::PreNotify(NotifyEvent& rNEvt)
}
}
break;
- case MouseNotifyEvent::KEYINPUT:
+ case NotifyEventType::KEYINPUT:
{
if (m_aTableMap.empty())
// no tab wins -> no conns -> no traveling
@@ -1363,7 +1362,7 @@ bool OJoinTableView::PreNotify(NotifyEvent& rNEvt)
}
}
break;
- case MouseNotifyEvent::GETFOCUS:
+ case NotifyEventType::GETFOCUS:
{
if (m_aTableMap.empty())
// no tab wins -> no conns -> no focus change
@@ -1545,7 +1544,7 @@ void OJoinTableView::addConnection(OTableConnection* _pConnection,bool _bAddData
if ( m_pAccessible )
m_pAccessible->notifyAccessibleEvent( AccessibleEventId::CHILD,
Any(),
- makeAny(_pConnection->GetAccessible()));
+ Any(_pConnection->GetAccessible()));
}
bool OJoinTableView::allowQueries() const
diff --git a/dbaccess/source/ui/querydesign/QTableConnectionData.cxx b/dbaccess/source/ui/querydesign/QTableConnectionData.cxx
index f96a5b1cd033..ce66828facb5 100644
--- a/dbaccess/source/ui/querydesign/QTableConnectionData.cxx
+++ b/dbaccess/source/ui/querydesign/QTableConnectionData.cxx
@@ -25,8 +25,7 @@
using namespace dbaui;
OQueryTableConnectionData::OQueryTableConnectionData()
- : OTableConnectionData()
- , m_nFromEntryIndex(0)
+ : m_nFromEntryIndex(0)
, m_nDestEntryIndex(0)
, m_eJoinType (INNER_JOIN)
, m_bNatural(false)
diff --git a/dbaccess/source/ui/querydesign/QTableWindow.cxx b/dbaccess/source/ui/querydesign/QTableWindow.cxx
index cc70e1276a19..93cbf6026d4c 100644
--- a/dbaccess/source/ui/querydesign/QTableWindow.cxx
+++ b/dbaccess/source/ui/querydesign/QTableWindow.cxx
@@ -34,7 +34,6 @@
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::container;
using namespace ::com::sun::star::beans;
using namespace dbaui;
OQueryTableWindow::OQueryTableWindow( vcl::Window* pParent, const TTableWindowData::value_type& pTabWinData)
@@ -110,7 +109,7 @@ void OQueryTableWindow::OnEntryDoubleClicked(weld::TreeIter& rEntry)
return;
weld::TreeView& rTreeView = m_xListBox->get_widget();
- OTableFieldInfo* pInf = reinterpret_cast<OTableFieldInfo*>(rTreeView.get_id(rEntry).toUInt64());
+ OTableFieldInfo* pInf = weld::fromId<OTableFieldInfo*>(rTreeView.get_id(rEntry));
OSL_ENSURE(pInf != nullptr, "OQueryTableWindow::OnEntryDoubleClicked : field doesn't have FieldInfo !");
// build up DragInfo
@@ -144,7 +143,7 @@ bool OQueryTableWindow::ExistsField(const OUString& strFieldName, OTableFieldDes
{
if (bCase(strFieldName, rTreeView.get_text(*xEntry)))
{
- OTableFieldInfo* pInf = reinterpret_cast<OTableFieldInfo*>(rTreeView.get_id(*xEntry).toUInt64());
+ OTableFieldInfo* pInf = weld::fromId<OTableFieldInfo*>(rTreeView.get_id(*xEntry));
assert(pInf && "OQueryTableWindow::ExistsField : field doesn't have FieldInfo !");
rInfo->SetTabWindow(this);
diff --git a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx
index 601d25f9c01c..13262f570290 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx
@@ -37,7 +37,7 @@ namespace dbaui
virtual void Redo() override = 0;
public:
- OQueryDesignFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, const char* pCommentID);
+ OQueryDesignFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, TranslateId pCommentID);
virtual ~OQueryDesignFieldUndoAct() override;
void SetColumnPosition(sal_uInt16 _nColumnPosition)
@@ -90,7 +90,7 @@ namespace dbaui
OTableFieldDescRef pDescr; // the deleted column description
public:
- OTabFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, const char* pCommentID) : OQueryDesignFieldUndoAct(pSelBrwBox, pCommentID) { }
+ OTabFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, TranslateId pCommentID) : OQueryDesignFieldUndoAct(pSelBrwBox, pCommentID) { }
void SetTabFieldDescr(OTableFieldDescRef const & pDescription) { pDescr = pDescription; }
};
diff --git a/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx b/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx
index d3ce81bde0c6..8a87423930a7 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx
@@ -32,7 +32,7 @@ namespace dbaui
VclPtr<OJoinTableView> m_pOwner; // in this container it all happens
public:
- OQueryDesignUndoAction(OJoinTableView* pOwner, const char* pCommentID) : OCommentUndoAction(pCommentID), m_pOwner(pOwner) { }
+ OQueryDesignUndoAction(OJoinTableView* pOwner, TranslateId pCommentID) : OCommentUndoAction(pCommentID), m_pOwner(pOwner) { }
};
}
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index baf90e28997b..7de007624f3d 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -23,8 +23,9 @@
#include <querycontroller.hxx>
#include <sqlbison.hxx>
#include <vcl/split.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <o3tl/safeint.hxx>
+#include <o3tl/string_view.hxx>
#include <osl/diagnose.h>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
@@ -52,12 +53,10 @@
#include <string_view>
using namespace ::dbaui;
-using namespace ::utl;
using namespace ::connectivity;
using namespace ::dbtools;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::i18n;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
@@ -96,7 +95,7 @@ namespace
bool bHaving,
bool _bAddOrOnOneLine);
- OUString quoteTableAlias(bool _bQuote, const OUString& _sAliasName, const OUString& _sQuote)
+ OUString quoteTableAlias(bool _bQuote, const OUString& _sAliasName, std::u16string_view _sQuote)
{
OUString sRet;
if ( _bQuote && !_sAliasName.isEmpty() )
@@ -160,12 +159,8 @@ namespace
OUString aSourceFieldName(_aDragLeft->GetField());
OUString aDestFieldName(_aDragRight->GetField());
// the connection could point on the other side
- if(pConn->GetSourceWin() == _aDragRight->GetTabWindow())
- {
- OUString aTmp(aSourceFieldName);
- aSourceFieldName = aDestFieldName;
- aDestFieldName = aTmp;
- }
+ if (pConn->GetSourceWin() == _aDragRight->GetTabWindow())
+ std::swap(aSourceFieldName, aDestFieldName);
pConn->GetData()->AppendConnLine( aSourceFieldName,aDestFieldName);
pConn->UpdateLineList();
// Modified-Flag
@@ -290,11 +285,12 @@ namespace
{
if(!aCondition.isEmpty())
aCondition.append(C_AND);
- aCondition.append(quoteTableAlias(true,pData->GetAliasName(JTCS_FROM),aQuote));
- aCondition.append(::dbtools::quoteName(aQuote, lineData->GetFieldName(JTCS_FROM) ));
- aCondition.append(" = ");
- aCondition.append(quoteTableAlias(true,pData->GetAliasName(JTCS_TO),aQuote));
- aCondition.append(::dbtools::quoteName(aQuote, lineData->GetFieldName(JTCS_TO) ));
+ aCondition.append(
+ quoteTableAlias(true,pData->GetAliasName(JTCS_FROM),aQuote)
+ + ::dbtools::quoteName(aQuote, lineData->GetFieldName(JTCS_FROM) )
+ + " = "
+ + quoteTableAlias(true,pData->GetAliasName(JTCS_TO),aQuote)
+ + ::dbtools::quoteName(aQuote, lineData->GetFieldName(JTCS_TO) ));
}
}
catch(SQLException&)
@@ -326,7 +322,7 @@ namespace
if(_rJoin.endsWith(")"))
{
bBrace = true;
- _rJoin = _rJoin.replaceAt(_rJoin.getLength()-1,1,OUString(' '));
+ _rJoin = _rJoin.replaceAt(_rJoin.getLength()-1,1, u" ");
}
_rJoin += C_AND + BuildJoinCriteria(_xConnection,&pData->GetConnLineDataList(),pData);
if(bBrace)
@@ -658,10 +654,7 @@ namespace
if ( field->isAggregateFunction() )
{
OSL_ENSURE(!field->GetFunction().isEmpty(),"Function name must not be empty! ;-(");
- aTmpStr = field->GetFunction() +
- "(" +
- aTmpStr +
- ")";
+ aTmpStr = field->GetFunction() + "(" + aTmpStr + ")";
}
if (!rFieldAlias.isEmpty() &&
@@ -669,10 +662,10 @@ namespace
field->isNumericOrAggregateFunction() ||
field->isOtherFunction()))
{
- aTmpStr.append(" AS ");
- aTmpStr.append(::dbtools::quoteName(aQuote, rFieldAlias));
+ aTmpStr.append(" AS " + ::dbtools::quoteName(aQuote, rFieldAlias));
}
- aFieldListStr.append(aTmpStr.makeStringAndClear());
+ aFieldListStr.append(aTmpStr);
+ aTmpStr.setLength(0);
aFieldListStr.append(", ");
}
}
@@ -921,14 +914,11 @@ namespace
{
aWorkStr += quoteTableAlias(bMulti,field->GetAlias(),aQuote) + ::dbtools::quoteName(aQuote, aColumnName);
}
- aWorkStr += " " + OUString( ";ASC;DESC" ).getToken( static_cast<sal_uInt16>(eOrder), ';' ) + ",";
+ aWorkStr += OUString::Concat(" ") + o3tl::getToken( u";ASC;DESC", static_cast<sal_uInt16>(eOrder), ';' ) + ",";
}
}
- {
- OUString sTemp(comphelper::string::stripEnd(aWorkStr, ','));
- aWorkStr = sTemp;
- }
+ aWorkStr = comphelper::string::stripEnd(aWorkStr, ',');
if ( !aWorkStr.isEmpty() )
{
@@ -1084,7 +1074,7 @@ namespace
}
if(!aTableListStr.isEmpty())
- aTableListStr = aTableListStr.replaceAt(aTableListStr.getLength()-1,1, OUString() );
+ aTableListStr = aTableListStr.replaceAt(aTableListStr.getLength()-1,1, u"" );
return aTableListStr;
}
OUString GenerateGroupBy(const OQueryDesignView* _pView,OTableFields& _rFieldList, bool bMulti )
@@ -1142,9 +1132,8 @@ namespace
}
if ( !aGroupByStr.isEmpty() )
{
- aGroupByStr = aGroupByStr.replaceAt(aGroupByStr.getLength()-1,1, OUString(' ') );
- OUString aGroupByStr2 = " GROUP BY " + aGroupByStr;
- aGroupByStr = aGroupByStr2;
+ aGroupByStr = aGroupByStr.replaceAt(aGroupByStr.getLength()-1,1, u" " );
+ aGroupByStr = " GROUP BY " + aGroupByStr;
}
}
catch(SQLException&)
@@ -1821,27 +1810,26 @@ namespace
else
return false;
- if ( eJoinType == CROSS_JOIN || bNatural )
- {
+ if ( eJoinType != CROSS_JOIN && !bNatural )
+ return true;
- OQueryTableWindow* pLeftWindow = static_cast<OQueryTableView*>(_pView->getTableView())->FindTable( getTableRange(_pView,pNode->getChild(0)) );
- OQueryTableWindow* pRightWindow = static_cast<OQueryTableView*>(_pView->getTableView())->FindTable( getTableRange(_pView,pRightTableRef) );
- OSL_ENSURE(pLeftWindow && pRightWindow,"Table Windows could not be found!");
- if ( !pLeftWindow || !pRightWindow )
- return false;
+ OQueryTableWindow* pLeftWindow = static_cast<OQueryTableView*>(_pView->getTableView())->FindTable( getTableRange(_pView,pNode->getChild(0)) );
+ OQueryTableWindow* pRightWindow = static_cast<OQueryTableView*>(_pView->getTableView())->FindTable( getTableRange(_pView,pRightTableRef) );
+ OSL_ENSURE(pLeftWindow && pRightWindow,"Table Windows could not be found!");
+ if ( !pLeftWindow || !pRightWindow )
+ return false;
- OTableFieldDescRef aDragLeft = new OTableFieldDesc();
- aDragLeft->SetTabWindow(pLeftWindow);
- aDragLeft->SetTable(pLeftWindow->GetTableName());
- aDragLeft->SetAlias(pLeftWindow->GetAliasName());
+ OTableFieldDescRef aDragLeft = new OTableFieldDesc();
+ aDragLeft->SetTabWindow(pLeftWindow);
+ aDragLeft->SetTable(pLeftWindow->GetTableName());
+ aDragLeft->SetAlias(pLeftWindow->GetAliasName());
- OTableFieldDescRef aDragRight = new OTableFieldDesc();
- aDragRight->SetTabWindow(pRightWindow);
- aDragRight->SetTable(pRightWindow->GetTableName());
- aDragRight->SetAlias(pRightWindow->GetAliasName());
+ OTableFieldDescRef aDragRight = new OTableFieldDesc();
+ aDragRight->SetTabWindow(pRightWindow);
+ aDragRight->SetTable(pRightWindow->GetTableName());
+ aDragRight->SetAlias(pRightWindow->GetAliasName());
- insertConnection(_pView,eJoinType,aDragLeft,aDragRight,bNatural);
- }
+ insertConnection(_pView,eJoinType,aDragLeft,aDragRight,bNatural);
return true;
}
@@ -2174,7 +2162,7 @@ namespace
if ( SQL_ISRULE(pColumnRef,general_set_fct) )
{
aInfo->SetFunctionType(nFunctionType|FKT_AGGREGATE);
- aInfo->SetFunction(comphelper::string::stripEnd(aColumns.getToken(0,'('), ' '));
+ aInfo->SetFunction(OUString(comphelper::string::stripEnd(o3tl::getToken(aColumns,0,'('), ' ')));
}
else
aInfo->SetFunctionType(nFunctionType|FKT_OTHER);
@@ -2363,7 +2351,7 @@ namespace
OUString getParseErrorMessage( SqlParseError _eErrorCode )
{
- const char* pResId;
+ TranslateId pResId;
switch (_eErrorCode)
{
case eIllegalJoin:
@@ -2682,7 +2670,7 @@ void OQueryDesignView::fillValidFields(std::u16string_view sAliasName, weld::Com
bool OQueryDesignView::PreNotify(NotifyEvent& rNEvt)
{
- if (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS)
+ if (rNEvt.GetType() == NotifyEventType::GETFOCUS)
{
if ( m_pSelectionBox && m_pSelectionBox->HasChildPathFocus() )
m_eChildFocus = SELECTION;
@@ -2772,14 +2760,11 @@ OUString OQueryDesignView::getStatement()
OUStringBuffer aSqlCmd("SELECT ");
if(rController.isDistinct())
aSqlCmd.append(" DISTINCT ");
- aSqlCmd.append(aFieldListStr);
- aSqlCmd.append(" FROM ");
- aSqlCmd.append(aTableListStr);
+ aSqlCmd.append(aFieldListStr + " FROM " + aTableListStr);
if (!aCriteriaListStr.isEmpty())
{
- aSqlCmd.append(" WHERE ");
- aSqlCmd.append(aCriteriaListStr.makeStringAndClear());
+ aSqlCmd.append(" WHERE " + aCriteriaListStr);
}
Reference<XDatabaseMetaData> xMeta;
if ( xConnection.is() )
@@ -2792,8 +2777,7 @@ OUString OQueryDesignView::getStatement()
// ----------------- construct GroupBy and attach ------------
if(!aHavingStr.isEmpty())
{
- aSqlCmd.append(" HAVING ");
- aSqlCmd.append(aHavingStr.makeStringAndClear());
+ aSqlCmd.append(" HAVING " + aHavingStr);
}
// ----------------- construct sorting and attach ------------
OUString sOrder;
diff --git a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx
index 33cafc1509d7..e3b6cd0e94bb 100644
--- a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx
@@ -35,7 +35,7 @@ OQueryTabConnUndoAction::~OQueryTabConnUndoAction()
}
}
-OQueryTabConnUndoAction::OQueryTabConnUndoAction(OQueryTableView* pOwner, const char* pCommentID)
+OQueryTabConnUndoAction::OQueryTabConnUndoAction(OQueryTableView* pOwner, TranslateId pCommentID)
: OQueryDesignUndoAction(pOwner, pCommentID)
, m_pConnection(nullptr)
, m_bOwnerOfConn(false)
diff --git a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx
index 3ccb80bf67f1..21077074ee84 100644
--- a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx
+++ b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx
@@ -34,7 +34,7 @@ namespace dbaui
// am I the only owner of the connection? (changes with every redo and undo)
public:
- OQueryTabConnUndoAction(OQueryTableView* pOwner, const char* pCommentID);
+ OQueryTabConnUndoAction(OQueryTableView* pOwner, TranslateId pCommentID);
virtual ~OQueryTabConnUndoAction() override;
virtual void Undo() override = 0;
diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
index 3171c8789dcb..2afe74db4232 100644
--- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
@@ -20,12 +20,11 @@
#include "QueryTabWinUndoAct.hxx"
#include <osl/diagnose.h>
#include "QTableWindow.hxx"
-#include <TableConnection.hxx>
#include "QueryDesignFieldUndoAct.hxx"
#include <QueryTableView.hxx>
using namespace dbaui;
-OQueryDesignFieldUndoAct::OQueryDesignFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, const char* pCommentID)
+OQueryDesignFieldUndoAct::OQueryDesignFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, TranslateId pCommentID)
: OCommentUndoAction(pCommentID)
, pOwner(pSelBrwBox)
, m_nColumnPosition(BROWSER_INVALIDID)
@@ -37,7 +36,7 @@ OQueryDesignFieldUndoAct::~OQueryDesignFieldUndoAct()
pOwner = nullptr;
}
-OQueryTabWinUndoAct::OQueryTabWinUndoAct(OQueryTableView* pOwner, const char* pCommentID)
+OQueryTabWinUndoAct::OQueryTabWinUndoAct(OQueryTableView* pOwner, TranslateId pCommentID)
: OQueryDesignUndoAction(pOwner, pCommentID)
, m_pTabWin(nullptr)
, m_bOwnerOfObjects(false)
diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx
index 992a6ff0f2b6..9b433054288e 100644
--- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx
+++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx
@@ -39,7 +39,7 @@ namespace dbaui
// am I the only owner of the managed objects? (changes with every redo or undo)
public:
- OQueryTabWinUndoAct(OQueryTableView* pOwner, const char* pCommentID);
+ OQueryTabWinUndoAct(OQueryTableView* pOwner, TranslateId pCommentID);
virtual ~OQueryTabWinUndoAct() override;
void SetOwnership(bool bTakeIt) { m_bOwnerOfObjects = bTakeIt; }
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index 9b252dbf8b1e..663d3a9e65a6 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -19,7 +19,7 @@
#include <QueryTableView.hxx>
#include <TableFieldDescription.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <helpids.h>
#include "QTableWindow.hxx"
@@ -224,7 +224,7 @@ void OQueryTableView::ReSync()
pTabWin.disposeAndClear();
arrInvalidTables.push_back(pData->GetAliasName());
- rTabWinDataList.erase( std::remove(rTabWinDataList.begin(), rTabWinDataList.end(), *aIter), rTabWinDataList.end());
+ std::erase(rTabWinDataList, *aIter);
continue;
}
@@ -253,7 +253,7 @@ void OQueryTableView::ReSync()
if (bInvalid)
{
// no -> bad luck, no connection
- rTabConnDataList.erase( std::remove(rTabConnDataList.begin(), rTabConnDataList.end(), *aConIter), rTabConnDataList.end());
+ std::erase(rTabConnDataList, *aConIter);
continue;
}
@@ -430,7 +430,7 @@ void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString&
if ( m_pAccessible )
m_pAccessible->notifyAccessibleEvent( AccessibleEventId::CHILD,
Any(),
- makeAny(pNewTabWin->GetAccessible())
+ Any(pNewTabWin->GetAccessible())
);
do {
@@ -561,11 +561,7 @@ void OQueryTableView::AddConnection(const OJoinExchangeData& jxdSource, const OJ
{
// the connection could point on the other side
if(pConn->GetSourceWin() == pDestWin)
- {
- OUString aTmp(aSourceFieldName);
- aSourceFieldName = aDestFieldName;
- aDestFieldName = aTmp;
- }
+ std::swap(aSourceFieldName, aDestFieldName);
pConn->GetData()->AppendConnLine( aSourceFieldName,aDestFieldName );
@@ -693,7 +689,7 @@ void OQueryTableView::RemoveTabWin(OTableWindow* pTabWin)
modified();
if ( m_pAccessible )
m_pAccessible->notifyAccessibleEvent( AccessibleEventId::CHILD,
- makeAny(pTabWin->GetAccessible()),
+ Any(pTabWin->GetAccessible()),
Any()
);
}
@@ -738,7 +734,7 @@ void OQueryTableView::HideTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc
// the TabWin data must also be passed out of my responsibility
TTableWindowData& rTabWinDataList = m_pView->getController().getTableWindowData();
- rTabWinDataList.erase( std::remove(rTabWinDataList.begin(), rTabWinDataList.end(), pTabWin->GetData()), rTabWinDataList.end());
+ std::erase(rTabWinDataList, pTabWin->GetData());
// The data should not be destroyed as TabWin itself - which is still alive - needs them
// Either it goes back into my responsibility, (via ShowTabWin), then I add the data back,
// or the Undo-Action, which currently has full responsibility for the window
diff --git a/dbaccess/source/ui/querydesign/QueryTextView.cxx b/dbaccess/source/ui/querydesign/QueryTextView.cxx
index 4af5a1c591a8..f8d8471e53e3 100644
--- a/dbaccess/source/ui/querydesign/QueryTextView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTextView.cxx
@@ -26,20 +26,21 @@
#include <undosqledit.hxx>
using namespace dbaui;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
// end of temp classes
OQueryTextView::OQueryTextView(OQueryContainerWindow* pParent, OQueryController& rController)
: InterimItemWindow(pParent, "dbaccess/ui/queryview.ui", "QueryView")
, m_rController(rController)
- , m_xSQL(new SQLEditView)
+ , m_xSQL(new SQLEditView(m_xBuilder->weld_scrolled_window("scrolledwindow", true)))
, m_xSQLEd(new weld::CustomWeld(*m_xBuilder, "sql", *m_xSQL))
+ , m_timerUndoActionCreation("dbaccess OQueryTextView m_timerUndoActionCreation")
+ , m_timerInvalidate("dbaccess OQueryTextView m_timerInvalidate")
, m_bStopTimer(false)
{
m_xSQL->DisableInternalUndo();
m_xSQL->SetHelpId(HID_CTL_QRYSQLEDIT);
m_xSQL->SetModifyHdl(LINK(this, OQueryTextView, ModifyHdl));
+ m_xSQL->SetAcceptsTab(true);
m_timerUndoActionCreation.SetTimeout(1000);
m_timerUndoActionCreation.SetInvokeHandler(LINK(this, OQueryTextView, OnUndoActionTimer));
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 6e65bfc1781d..fbf7abdafb77 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -48,7 +48,8 @@
#include <i18nlangtag/languagetag.hxx>
#include <vcl/commandevent.hxx>
#include <vcl/svapp.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+#include <o3tl/string_view.hxx>
using namespace ::svt;
using namespace ::dbaui;
@@ -56,8 +57,6 @@ using namespace ::connectivity;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::util;
using namespace ::com::sun::star::accessibility;
#define DEFAULT_QUERY_COLS 20
@@ -68,14 +67,14 @@ using namespace ::com::sun::star::accessibility;
namespace
{
- bool isFieldNameAsterisk(const OUString& _sFieldName )
+ bool isFieldNameAsterisk(std::u16string_view _sFieldName )
{
- bool bAsterisk = _sFieldName.isEmpty() || _sFieldName.toChar() == '*';
+ bool bAsterisk = _sFieldName.empty() || _sFieldName[0] == '*';
if ( !bAsterisk )
{
sal_Int32 nTokenCount = comphelper::string::getTokenCount(_sFieldName, '.');
- if ( (nTokenCount == 2 && _sFieldName.getToken(1,'.')[0] == '*' )
- || (nTokenCount == 3 && _sFieldName.getToken(2,'.')[0] == '*' ) )
+ if ( (nTokenCount == 2 && o3tl::getToken(_sFieldName,1,'.')[0] == '*' )
+ || (nTokenCount == 3 && o3tl::getToken(_sFieldName,2,'.')[0] == '*' ) )
{
bAsterisk = true;
}
@@ -103,6 +102,7 @@ namespace
OSelectionBrowseBox::OSelectionBrowseBox( vcl::Window* pParent )
:EditBrowseBox( pParent,EditBrowseBoxFlags::NO_HANDLE_COLUMN_CONTENT, WB_3DLOOK, BrowserMode::COLUMNSELECTION | BrowserMode::KEEPHIGHLIGHT | BrowserMode::HIDESELECT |
BrowserMode::HIDECURSOR | BrowserMode::HLINES | BrowserMode::VLINES )
+ ,m_timerInvalidate("dbaccess OSelectionBrowseBox m_timerInvalidate")
,m_nSeekRow(0)
,m_nMaxColumns(0)
,m_aFunctionStrings(DBA_RES(STR_QUERY_FUNCTIONS))
@@ -145,7 +145,7 @@ OSelectionBrowseBox::OSelectionBrowseBox( vcl::Window* pParent )
const OUString aTxt(DBA_RES(STR_QUERY_SORTTEXT));
for (sal_Int32 nIdx {0}; nIdx>=0;)
- rOrderBox.append_text(aTxt.getToken(0, ';', nIdx));
+ rOrderBox.append_text(OUString(o3tl::getToken(aTxt, 0, ';', nIdx)));
m_bVisibleRow.insert(m_bVisibleRow.end(), BROW_ROW_CNT, true);
@@ -491,7 +491,7 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, sal
getDesignView()->fillValidFields(aTable, rComboBox);
// replace with alias.*
- if (aField.trim() == "*")
+ if (o3tl::trim(aField) == u"*")
{
aField = aTable + ".*";
}
@@ -574,7 +574,7 @@ void OSelectionBrowseBox::notifyFunctionFieldChanged(const OUString& _sOldFuncti
RowModified(GetBrowseRow(BROW_FUNCTION_ROW), _nColumnId);
}
-void OSelectionBrowseBox::clearEntryFunctionField(const OUString& _sFieldName,OTableFieldDescRef const & _pEntry, bool& _bListAction,sal_uInt16 _nColumnId)
+void OSelectionBrowseBox::clearEntryFunctionField(std::u16string_view _sFieldName,OTableFieldDescRef const & _pEntry, bool& _bListAction,sal_uInt16 _nColumnId)
{
if ( !(isFieldNameAsterisk( _sFieldName ) && (!_pEntry->isNoneFunction() || _pEntry->IsGroupBy())) )
return;
@@ -917,8 +917,10 @@ bool OSelectionBrowseBox::SaveModified()
case BROW_VIS_ROW:
{
bool bOldValue = m_pVisibleCell->GetBox().get_saved_state() != TRISTATE_FALSE;
- strOldCellContents = bOldValue ? OUStringLiteral(u"1") : OUStringLiteral(u"0");
- sNewValue = !bOldValue ? OUStringLiteral(u"1") : OUStringLiteral(u"0");
+ strOldCellContents
+ = bOldValue ? std::u16string_view(u"1") : std::u16string_view(u"0");
+ sNewValue
+ = !bOldValue ? std::u16string_view(u"1") : std::u16string_view(u"0");
}
if((m_bOrderByUnRelated || pEntry->GetOrderDir() == ORDER_NONE) &&
(m_bGroupByUnRelated || !pEntry->IsGroupBy()))
@@ -1050,7 +1052,7 @@ bool OSelectionBrowseBox::SaveModified()
sal_Int32 nPos = rComboBox.get_active();
// these functions are only available in CORE
OUString sFunctionName = rComboBox.get_text(nPos);
- OUString sGroupFunctionName = m_aFunctionStrings.copy(m_aFunctionStrings.lastIndexOf(';')+1);
+ std::u16string_view sGroupFunctionName = m_aFunctionStrings.subView(m_aFunctionStrings.lastIndexOf(';')+1);
bool bGroupBy = false;
if ( sGroupFunctionName == sFunctionName ) // check if the function name is GROUP
{
@@ -1553,7 +1555,7 @@ OTableFieldDescRef OSelectionBrowseBox::InsertField(const OJoinExchangeData& jxd
weld::TreeView& rTreeView = jxdSource.pListBox->get_widget();
OUString aFieldName = rTreeView.get_text(jxdSource.nEntry);
sal_uInt32 nFieldIndex = jxdSource.nEntry;
- OTableFieldInfo* pInf = reinterpret_cast<OTableFieldInfo*>(rTreeView.get_id(jxdSource.nEntry).toUInt64());
+ OTableFieldInfo* pInf = weld::fromId<OTableFieldInfo*>(rTreeView.get_id(jxdSource.nEntry));
// construct DragInfo, such that I use the other InsertField
OTableFieldDescRef aInfo = new OTableFieldDesc(pSourceWin->GetTableName(),aFieldName);
@@ -1949,7 +1951,7 @@ void OSelectionBrowseBox::Command(const CommandEvent& rEvt)
weld::Window* pPopupParent = weld::GetPopupParent(*this, aRect);
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pPopupParent, "dbaccess/ui/querycolmenu.ui"));
std::unique_ptr<weld::Menu> xContextMenu(xBuilder->weld_menu("menu"));
- OString sIdent = xContextMenu->popup_at_rect(pPopupParent, aRect);
+ OUString sIdent = xContextMenu->popup_at_rect(pPopupParent, aRect);
if (sIdent == "delete")
RemoveField(nColId);
else if (sIdent == "width")
@@ -1969,7 +1971,7 @@ void OSelectionBrowseBox::Command(const CommandEvent& rEvt)
xContextMenu->set_active("alias", m_bVisibleRow[BROW_COLUMNALIAS_ROW]);
xContextMenu->set_active("distinct", static_cast<OQueryController&>(getDesignView()->getController()).isDistinct());
- OString sIdent = xContextMenu->popup_at_rect(pPopupParent, aRect);
+ OUString sIdent = xContextMenu->popup_at_rect(pPopupParent, aRect);
if (sIdent == "functions")
{
SetRowVisible(BROW_FUNCTION_ROW, !IsRowVisible(BROW_FUNCTION_ROW));
@@ -2084,8 +2086,8 @@ sal_Int32 OSelectionBrowseBox::GetNoneVisibleRows() const
{
sal_Int32 nErg(0);
// only the first 11 rows are interesting
- sal_Int32 const nSize = SAL_N_ELEMENTS(nVisibleRowMask);
- for(sal_Int32 i=0;i<nSize;i++)
+ std::size_t const nSize = std::size(nVisibleRowMask);
+ for(std::size_t i=0;i<nSize;i++)
{
if(!m_bVisibleRow[i])
nErg |= nVisibleRowMask[i];
@@ -2096,8 +2098,8 @@ sal_Int32 OSelectionBrowseBox::GetNoneVisibleRows() const
void OSelectionBrowseBox::SetNoneVisibleRow(sal_Int32 nRows)
{
// only the first 11 rows are interesting
- sal_Int32 const nSize = SAL_N_ELEMENTS(nVisibleRowMask);
- for(sal_Int32 i=0;i< nSize;i++)
+ std::size_t const nSize = std::size(nVisibleRowMask);
+ for(std::size_t i=0;i< nSize;i++)
m_bVisibleRow[i] = !(nRows & nVisibleRowMask[i]);
}
@@ -2105,6 +2107,8 @@ OUString OSelectionBrowseBox::GetCellText(sal_Int32 nRow, sal_uInt16 nColId) con
{
sal_uInt16 nPos = GetColumnPos(nColId);
+ if ( nPos == 0 || nPos == BROWSER_INVALIDID || nPos > getFields().size() )
+ return OUString();
OTableFieldDescRef pEntry = getFields()[nPos-1];
OSL_ENSURE(pEntry != nullptr, "OSelectionBrowseBox::GetCellText : invalid column id, prepare for GPF ... ");
@@ -2276,16 +2280,16 @@ void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, sal_uInt16 nColId, con
break;
case BROW_FUNCTION_ROW:
{
- OUString sGroupFunctionName = m_aFunctionStrings.copy(m_aFunctionStrings.lastIndexOf(';')+1);
+ std::u16string_view sGroupFunctionName = m_aFunctionStrings.subView(m_aFunctionStrings.lastIndexOf(';')+1);
pEntry->SetFunction(strNewText);
// first reset this two member
sal_Int32 nFunctionType = pEntry->GetFunctionType();
nFunctionType &= ~FKT_AGGREGATE;
pEntry->SetFunctionType(nFunctionType);
- if ( pEntry->IsGroupBy() && !sGroupFunctionName.equalsIgnoreAsciiCase(strNewText) )
+ if ( pEntry->IsGroupBy() && !o3tl::equalsIgnoreAsciiCase(sGroupFunctionName, strNewText) )
pEntry->SetGroupBy(false);
- if ( sGroupFunctionName.equalsIgnoreAsciiCase(strNewText) )
+ if ( o3tl::equalsIgnoreAsciiCase(sGroupFunctionName, strNewText) )
pEntry->SetGroupBy(true);
else if ( !strNewText.isEmpty() )
{
@@ -2530,7 +2534,7 @@ void OSelectionBrowseBox::enableControl(const OTableFieldDescRef& _rEntry,Window
_pControl->EnableInput(bEnable);
}
-void OSelectionBrowseBox::setTextCellContext(const OTableFieldDescRef& _rEntry,const OUString& _sText,const OString& _sHelpId)
+void OSelectionBrowseBox::setTextCellContext(const OTableFieldDescRef& _rEntry,const OUString& _sText,const OUString& _sHelpId)
{
weld::Entry& rEntry = m_pTextCell->get_widget();
rEntry.set_text(_sText);
@@ -2596,12 +2600,12 @@ OUString OSelectionBrowseBox::GetRowDescription( sal_Int32 _nRow ) const
return aLabel.getToken(nToken, ';');
}
-OUString OSelectionBrowseBox::GetAccessibleObjectName( ::vcl::AccessibleBrowseBoxObjType _eObjType,sal_Int32 _nPosition) const
+OUString OSelectionBrowseBox::GetAccessibleObjectName( AccessibleBrowseBoxObjType _eObjType,sal_Int32 _nPosition) const
{
OUString sRetText;
switch( _eObjType )
{
- case ::vcl::BBTYPE_ROWHEADERCELL:
+ case AccessibleBrowseBoxObjType::RowHeaderCell:
sRetText = GetRowDescription(_nPosition);
break;
default:
@@ -2689,7 +2693,7 @@ void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef const & _pEntry)
Reference< XAccessible > OSelectionBrowseBox::CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos )
{
OTableFieldDescRef pEntry;
- if(getFields().size() > o3tl::make_unsigned(_nColumnPos - 1))
+ if ( _nColumnPos != 0 && _nColumnPos != BROWSER_INVALIDID && _nColumnPos <= getFields().size() )
pEntry = getFields()[_nColumnPos - 1];
if ( _nRow == BROW_VIS_ROW && pEntry.is() )
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx
index b156b721a421..d5e11c03e332 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx
@@ -172,7 +172,7 @@ namespace dbaui
@return
The name of the specified object.
*/
- virtual OUString GetAccessibleObjectName( ::vcl::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const override;
+ virtual OUString GetAccessibleObjectName( AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const override;
// IAccessibleTableProvider
/** Creates the accessible object of a data table cell.
@@ -227,7 +227,7 @@ namespace dbaui
void appendUndoAction(const OUString& _rOldValue,std::u16string_view _rNewValue,sal_Int32 _nRow);
OTableFields& getFields() const;
static void enableControl(const OTableFieldDescRef& _rEntry,Window* _pControl);
- void setTextCellContext(const OTableFieldDescRef& _rEntry,const OUString& _sText,const OString& _sHelpId);
+ void setTextCellContext(const OTableFieldDescRef& _rEntry,const OUString& _sText,const OUString& _sHelpId);
void invalidateUndoRedo();
OTableFieldDescRef getEntry(OTableFields::size_type _nPos);
@@ -306,7 +306,7 @@ namespace dbaui
@param _bListAction
When <TRUE/> a list action will be created.
*/
- void clearEntryFunctionField(const OUString& _sFieldName,OTableFieldDescRef const & _pEntry, bool& _bListAction,sal_uInt16 _nColumnId);
+ void clearEntryFunctionField(std::u16string_view _sFieldName,OTableFieldDescRef const & _pEntry, bool& _bListAction,sal_uInt16 _nColumnId);
/** remove or insert the necessary function types
@param _pEntry
diff --git a/dbaccess/source/ui/querydesign/TableConnection.cxx b/dbaccess/source/ui/querydesign/TableConnection.cxx
index ada4b5990890..1e9d31f419c0 100644
--- a/dbaccess/source/ui/querydesign/TableConnection.cxx
+++ b/dbaccess/source/ui/querydesign/TableConnection.cxx
@@ -21,17 +21,16 @@
#include <ConnectionLine.hxx>
#include <TableConnectionData.hxx>
#include <JoinTableView.hxx>
+#include <utility>
using namespace dbaui;
-using namespace comphelper;
-using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::accessibility;
namespace dbaui
{
- OTableConnection::OTableConnection( OJoinTableView* _pContainer,const TTableConnectionData::value_type& _pTabConnData )
+ OTableConnection::OTableConnection( OJoinTableView* _pContainer, TTableConnectionData::value_type _aTabConnData )
:Window(_pContainer)
- ,m_pData( _pTabConnData )
+ ,m_pData(std::move( _aTabConnData ))
,m_pParent( _pContainer )
,m_bSelected( false )
{
diff --git a/dbaccess/source/ui/querydesign/TableConnectionData.cxx b/dbaccess/source/ui/querydesign/TableConnectionData.cxx
index 107d8a9d1a48..aa524a5ac7f9 100644
--- a/dbaccess/source/ui/querydesign/TableConnectionData.cxx
+++ b/dbaccess/source/ui/querydesign/TableConnectionData.cxx
@@ -18,6 +18,7 @@
*/
#include <TableConnectionData.hxx>
+#include <utility>
#include <osl/diagnose.h>
using namespace dbaui;
@@ -27,10 +28,10 @@ OTableConnectionData::OTableConnectionData()
Init();
}
-OTableConnectionData::OTableConnectionData(const TTableWindowData::value_type& _pReferencingTable
- ,const TTableWindowData::value_type& _pReferencedTable )
- :m_pReferencingTable(_pReferencingTable)
- ,m_pReferencedTable(_pReferencedTable)
+OTableConnectionData::OTableConnectionData(TTableWindowData::value_type _pReferencingTable
+ ,TTableWindowData::value_type _pReferencedTable )
+ :m_pReferencingTable(std::move(_pReferencingTable))
+ ,m_pReferencedTable(std::move(_pReferencedTable))
{
Init();
}
diff --git a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx
index c8f0a402218f..4d556f94f203 100644
--- a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx
+++ b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx
@@ -23,7 +23,6 @@
#include <com/sun/star/sdbc/DataType.hpp>
#include <comphelper/namedvaluecollection.hxx>
-using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace comphelper;
@@ -182,10 +181,11 @@ void OTableFieldDesc::Save( ::comphelper::NamedValueCollection& o_rSettings, con
sal_Int32 c = 0;
Sequence< PropertyValue > aCriteria( m_aCriteria.size() );
+ auto pCriteria = aCriteria.getArray();
for (auto const& criteria : m_aCriteria)
{
- aCriteria[c].Name = "Criterion_" + OUString::number( c );
- aCriteria[c].Value <<= criteria;
+ pCriteria[c].Name = "Criterion_" + OUString::number( c );
+ pCriteria[c].Value <<= criteria;
++c;
}
diff --git a/dbaccess/source/ui/querydesign/TableFieldInfo.cxx b/dbaccess/source/ui/querydesign/TableFieldInfo.cxx
index a0c8ff747e34..808862c11c4e 100644
--- a/dbaccess/source/ui/querydesign/TableFieldInfo.cxx
+++ b/dbaccess/source/ui/querydesign/TableFieldInfo.cxx
@@ -27,6 +27,4 @@ OTableFieldInfo::OTableFieldInfo()
{
}
-OTableFieldInfo::~OTableFieldInfo() {}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/querydesign/TableFieldInfo.hxx b/dbaccess/source/ui/querydesign/TableFieldInfo.hxx
index 14e588845d39..e7d2c9b72da4 100644
--- a/dbaccess/source/ui/querydesign/TableFieldInfo.hxx
+++ b/dbaccess/source/ui/querydesign/TableFieldInfo.hxx
@@ -31,7 +31,6 @@ namespace dbaui
public:
OTableFieldInfo();
- ~OTableFieldInfo();
ETableFieldType GetKeyType() const { return m_eFieldType; }
void SetKey(ETableFieldType bKey) { m_eFieldType = bKey; }
diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx
index 8660a503f1a4..a1e4d34c1d56 100644
--- a/dbaccess/source/ui/querydesign/TableWindow.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindow.cxx
@@ -25,6 +25,7 @@
#include <JoinTableView.hxx>
#include <JoinDesignView.hxx>
#include <osl/diagnose.h>
+#include <utility>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <vcl/commandevent.hxx>
@@ -32,7 +33,7 @@
#include <vcl/ptrstyle.hxx>
#include <vcl/wall.hxx>
#include <vcl/weldutils.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <com/sun/star/container/XContainer.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -43,15 +44,11 @@
#include <connectivity/dbtools.hxx>
using namespace dbaui;
-using namespace ::utl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::sdb;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::accessibility;
namespace DatabaseObject = css::sdb::application::DatabaseObject;
@@ -86,11 +83,11 @@ void Draw3DBorder(vcl::RenderContext& rRenderContext, const tools::Rectangle& rR
}
-OTableWindow::OTableWindow( vcl::Window* pParent, const TTableWindowData::value_type& pTabWinData )
+OTableWindow::OTableWindow( vcl::Window* pParent, TTableWindowData::value_type pTabWinData )
: ::comphelper::OContainerListener(m_aMutex)
, Window( pParent, WB_3DLOOK|WB_MOVEABLE )
, m_xTitle( VclPtr<OTableWindowTitle>::Create(this) )
- , m_pData( pTabWinData )
+ , m_pData(std::move( pTabWinData ))
, m_nMoveCount(0)
, m_nMoveIncrement(1)
, m_nSizingFlags( SizingFlags::NONE )
@@ -192,7 +189,7 @@ void OTableWindow::FillListBox()
if (GetData()->IsShowAll())
{
- rTreeView.append(OUString::number(reinterpret_cast<sal_uInt64>(createUserData(nullptr,false))), OUString("*"));
+ rTreeView.append(weld::toId(createUserData(nullptr,false)), OUString("*"));
}
Reference<XNameAccess> xPKeyColumns;
@@ -220,7 +217,7 @@ void OTableWindow::FillListBox()
OUString sId;
Reference<XPropertySet> xColumn(xColumns->getByName(*pIter),UNO_QUERY);
if (xColumn.is())
- sId = OUString::number(reinterpret_cast<sal_uInt64>(createUserData(xColumn, bPrimaryKeyColumn)));
+ sId = weld::toId(createUserData(xColumn, bPrimaryKeyColumn));
rTreeView.append(sId, *pIter);
@@ -255,7 +252,7 @@ void OTableWindow::clearListBox()
weld::TreeView& rTreeView = m_xListBox->get_widget();
rTreeView.all_foreach([this, &rTreeView](weld::TreeIter& rEntry){
- void* pUserData = reinterpret_cast<void*>(rTreeView.get_id(rEntry).toUInt64());
+ void* pUserData = weld::fromId<void*>(rTreeView.get_id(rEntry));
deleteUserData(pUserData);
return false;
});
@@ -563,7 +560,7 @@ bool OTableWindow::PreNotify(NotifyEvent& rNEvt)
bool bHandled = false;
switch (rNEvt.GetType())
{
- case MouseNotifyEvent::KEYINPUT:
+ case NotifyEventType::KEYINPUT:
{
if ( getDesignView()->getController().isReadOnly() )
break;
@@ -673,7 +670,7 @@ bool OTableWindow::PreNotify(NotifyEvent& rNEvt)
}
break;
}
- case MouseNotifyEvent::KEYUP:
+ case NotifyEventType::KEYUP:
{
const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
const vcl::KeyCode& rCode = pKeyEvent->GetKeyCode();
diff --git a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
index f49b97c7787c..138850267c47 100644
--- a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
@@ -24,19 +24,17 @@
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
-#include <comphelper/sequence.hxx>
#include <vcl/vclevent.hxx>
namespace dbaui
{
using namespace ::com::sun::star::accessibility;
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star;
OTableWindowAccess::OTableWindowAccess(OTableWindow* _pTable)
- :VCLXAccessibleComponent(_pTable->GetComponentInterface().is() ? _pTable->GetWindowPeer() : nullptr)
+ :ImplInheritanceHelper(_pTable->GetComponentInterface().is() ? _pTable->GetWindowPeer() : nullptr)
,m_pTable(_pTable)
{
}
@@ -55,15 +53,6 @@ namespace dbaui
VCLXAccessibleComponent::ProcessWindowEvent( rVclWindowEvent );
}
- Any SAL_CALL OTableWindowAccess::queryInterface( const Type& aType )
- {
- Any aRet(VCLXAccessibleComponent::queryInterface( aType ));
- return aRet.hasValue() ? aRet : OTableWindowAccess_BASE::queryInterface( aType );
- }
- Sequence< Type > SAL_CALL OTableWindowAccess::getTypes( )
- {
- return ::comphelper::concatSequences(VCLXAccessibleComponent::getTypes(),OTableWindowAccess_BASE::getTypes());
- }
OUString SAL_CALL OTableWindowAccess::getImplementationName()
{
return "org.openoffice.comp.dbu.TableWindowAccessibility";
@@ -74,10 +63,10 @@ namespace dbaui
"com.sun.star.accessibility.AccessibleContext" };
}
// XAccessibleContext
- sal_Int32 SAL_CALL OTableWindowAccess::getAccessibleChildCount( )
+ sal_Int64 SAL_CALL OTableWindowAccess::getAccessibleChildCount( )
{
::osl::MutexGuard aGuard( m_aMutex );
- sal_Int32 nCount = 0;
+ sal_Int64 nCount = 0;
if(m_pTable)
{
++nCount;
@@ -86,7 +75,7 @@ namespace dbaui
}
return nCount;
}
- Reference< XAccessible > SAL_CALL OTableWindowAccess::getAccessibleChild( sal_Int32 i )
+ Reference< XAccessible > SAL_CALL OTableWindowAccess::getAccessibleChild( sal_Int64 i )
{
::osl::MutexGuard aGuard( m_aMutex );
Reference< XAccessible > aRet;
@@ -114,10 +103,10 @@ namespace dbaui
}
return aRet;
}
- sal_Int32 SAL_CALL OTableWindowAccess::getAccessibleIndexInParent( )
+ sal_Int64 SAL_CALL OTableWindowAccess::getAccessibleIndexInParent( )
{
::osl::MutexGuard aGuard( m_aMutex );
- sal_Int32 nIndex = -1;
+ sal_Int64 nIndex = -1;
if( m_pTable )
{
// search the position of our table window in the table window map
@@ -151,16 +140,16 @@ namespace dbaui
Reference< XAccessible > aRet;
if(m_pTable && !m_pTable->isDisposed())
{
- Point aPoint(_aPoint.X,_aPoint.Y);
- tools::Rectangle aRect(m_pTable->GetDesktopRectPixel());
- if( aRect.IsInside(aPoint) )
+ AbsoluteScreenPixelPoint aPoint(_aPoint.X,_aPoint.Y);
+ AbsoluteScreenPixelRectangle aRect(m_pTable->GetDesktopRectPixel());
+ if( aRect.Contains(aPoint) )
aRet = this;
- else if( m_pTable->GetListBox()->GetDesktopRectPixel().IsInside(aPoint))
+ else if( m_pTable->GetListBox()->GetDesktopRectPixel().Contains(aPoint))
aRet = m_pTable->GetListBox()->GetAccessible();
}
return aRet;
}
- Reference< XAccessible > OTableWindowAccess::getParentChild(sal_Int32 _nIndex)
+ Reference< XAccessible > OTableWindowAccess::getParentChild(sal_Int64 _nIndex)
{
Reference< XAccessible > xReturn;
Reference< XAccessible > xParent = getAccessibleParent();
@@ -191,8 +180,7 @@ namespace dbaui
{
OJoinTableView* pView = m_pTable->getTableView();
auto aIter = pView->getTableConnections(m_pTable) + nIndex;
- aRet.TargetSet.realloc(1);
- aRet.TargetSet[0] = getParentChild(aIter - pView->getTableConnections().begin());
+ aRet.TargetSet = { getParentChild(aIter - pView->getTableConnections().begin()) };
aRet.RelationType = AccessibleRelationType::CONTROLLER_FOR;
}
return aRet;
@@ -213,19 +201,19 @@ namespace dbaui
auto aIter = pView->getTableConnections(m_pTable);
auto aEnd = rConnectionList.end();
- std::vector< Reference<XInterface> > aRelations;
+ std::vector< Reference<css::accessibility::XAccessible> > aRelations;
aRelations.reserve(5); // just guessing
// TODO JNA aIter comes from pView->getTableConnections(m_pTable)
// and aEnd comes from pView->getTableConnections().end()
for (; aIter != aEnd ; ++aIter )
{
- uno::Reference<uno::XInterface> xInterface(
+ uno::Reference<css::accessibility::XAccessible> xAccessible(
getParentChild(aIter - rConnectionList.begin()));
- aRelations.push_back(xInterface);
+ aRelations.push_back(xAccessible);
}
- Sequence< Reference<XInterface> > aSeq(aRelations.data(), aRelations.size());
- return AccessibleRelation(AccessibleRelationType::CONTROLLER_FOR,aSeq);
+ Sequence<Reference<css::accessibility::XAccessible>> aSeq(aRelations.data(), aRelations.size());
+ return AccessibleRelation(AccessibleRelationType::CONTROLLER_FOR, aSeq);
}
return AccessibleRelation();
}
diff --git a/dbaccess/source/ui/querydesign/TableWindowData.cxx b/dbaccess/source/ui/querydesign/TableWindowData.cxx
index d07c8214a17c..3cbead6e406c 100644
--- a/dbaccess/source/ui/querydesign/TableWindowData.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowData.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/lang/XComponent.hpp>
+#include <utility>
using namespace dbaui;
using namespace ::com::sun::star::lang;
@@ -37,13 +38,13 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
OTableWindowData::OTableWindowData( const Reference< XPropertySet>& _xTable
- ,const OUString& _rComposedName
- ,const OUString& rTableName
- ,const OUString& rWinName )
+ ,OUString _sComposedName
+ ,OUString sTableName
+ ,OUString sWinName )
:m_xTable(_xTable)
- ,m_aTableName( rTableName )
- ,m_aWinName( rWinName )
- ,m_sComposedName(_rComposedName)
+ ,m_aTableName(std::move( sTableName ))
+ ,m_aWinName(std::move( sWinName ))
+ ,m_sComposedName(std::move(_sComposedName))
,m_aPosition( Point(-1,-1) )
,m_aSize( Size(-1,-1) )
,m_bShowAll( true )
diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
index a1a8a17c4735..3066f8429f35 100644
--- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
@@ -28,6 +28,7 @@
#include <com/sun/star/sdbc/SQLException.hpp>
#include <vcl/svapp.hxx>
#include <vcl/commandevent.hxx>
+#include <o3tl/string_view.hxx>
using namespace dbaui;
using namespace ::com::sun::star::sdbc;
@@ -92,7 +93,7 @@ void OTableWindowListBox::dispose()
InterimItemWindow::dispose();
}
-int OTableWindowListBox::GetEntryFromText(const OUString& rEntryText)
+int OTableWindowListBox::GetEntryFromText(std::u16string_view rEntryText)
{
// iterate through the list
OJoinDesignView* pView = m_pTabWin->getDesignView();
@@ -111,7 +112,7 @@ int OTableWindowListBox::GetEntryFromText(const OUString& rEntryText)
for (int nEntry = 0, nCount = m_xTreeView->n_children(); nEntry < nCount; ++nEntry)
{
if (bCase ? rEntryText == m_xTreeView->get_text(nEntry)
- : rEntryText.equalsIgnoreAsciiCase(m_xTreeView->get_text(nEntry)))
+ : o3tl::equalsIgnoreAsciiCase(rEntryText, m_xTreeView->get_text(nEntry)))
return nEntry;
}
}
diff --git a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
index 3d625b8bb777..0b0ebaa4c7e1 100644
--- a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
@@ -19,9 +19,6 @@
#include <TableWindowTitle.hxx>
#include <TableWindow.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/help.hxx>
-#include <vcl/settings.hxx>
#include <vcl/commandevent.hxx>
#include <vcl/event.hxx>
#include <TableWindowListBox.hxx>
@@ -29,8 +26,6 @@
#include <JoinController.hxx>
using namespace dbaui;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
OTableWindowTitle::OTableWindowTitle(OTableWindow* pParent)
: InterimItemWindow(pParent, "dbaccess/ui/tabletitle.ui", "TableTitle")
, m_pTabWin( pParent )
diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
index f499135080b2..37624aceb419 100644
--- a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
+++ b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
@@ -8,13 +8,13 @@
*/
#include "limitboxcontroller.hxx"
-#include <apitools.hxx>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
+#include <comphelper/propertyvalue.hxx>
#include <vcl/InterimItemWindow.hxx>
#include <vcl/event.hxx>
#include <vcl/svapp.hxx>
@@ -106,8 +106,6 @@ private:
{
if (!m_xWidget->get_value_changed_from_saved())
return;
- uno::Sequence< beans::PropertyValue > aArgs( 1 );
- aArgs[0].Name = "DBLimit.Value";
sal_Int64 nLimit;
OUString sActiveText = m_xWidget->get_active_text();
if (sActiveText == DBA_RES(STR_QUERY_LIMIT_ALL))
@@ -119,8 +117,7 @@ private:
nLimit = -1;
}
set_value(nLimit);
- aArgs[0].Value <<= nLimit;
- m_pControl->dispatchCommand( aArgs );
+ m_pControl->dispatchCommand({ comphelper::makePropertyValue("DBLimit.Value", nLimit) });
}
///Initialize entries
@@ -177,7 +174,7 @@ IMPL_LINK_NOARG(LimitBox, ActivateHdl, weld::ComboBox&, bool)
LimitBoxController::LimitBoxController(
const uno::Reference< uno::XComponentContext >& rxContext ) :
- svt::ToolboxController( rxContext,
+ LimitBoxController_Base( rxContext,
uno::Reference< frame::XFrame >(),
".uno:DBLimit" ),
m_xLimitBox( nullptr )
@@ -188,34 +185,21 @@ LimitBoxController::~LimitBoxController()
{
}
-/// XInterface
-uno::Any SAL_CALL LimitBoxController::queryInterface( const uno::Type& aType )
-{
- uno::Any a = ToolboxController::queryInterface( aType );
- if ( a.hasValue() )
- return a;
-
- return ::cppu::queryInterface( aType, static_cast< lang::XServiceInfo* >( this ));
-}
-
-void SAL_CALL LimitBoxController::acquire() noexcept
-{
- ToolboxController::acquire();
-}
-
-void SAL_CALL LimitBoxController::release() noexcept
-{
- ToolboxController::release();
-}
-
-
/// XServiceInfo
OUString SAL_CALL LimitBoxController::getImplementationName()
{
return "org.libreoffice.comp.dbu.LimitBoxController";
}
-IMPLEMENT_SERVICE_INFO_SUPPORTS(LimitBoxController)
+sal_Bool SAL_CALL LimitBoxController::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ }
css::uno::Sequence< OUString > SAL_CALL LimitBoxController::getSupportedServiceNames()
{
diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.hxx b/dbaccess/source/ui/querydesign/limitboxcontroller.hxx
index af1e5a666882..142280937235 100644
--- a/dbaccess/source/ui/querydesign/limitboxcontroller.hxx
+++ b/dbaccess/source/ui/querydesign/limitboxcontroller.hxx
@@ -24,19 +24,14 @@ class LimitBox;
* It is communicating with querycontroller and this channel make enable
* to set\get the value of limitbox when switching between views
*/
-class LimitBoxController: public svt::ToolboxController,
- public css::lang::XServiceInfo
+typedef cppu::ImplInheritanceHelper< ::svt::ToolboxController, css::lang::XServiceInfo> LimitBoxController_Base;
+class LimitBoxController: public LimitBoxController_Base
{
public:
explicit LimitBoxController(
const css::uno::Reference< css::uno::XComponentContext >& rxContext );
virtual ~LimitBoxController() override;
- /// XInterface
- virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
- virtual void SAL_CALL acquire() noexcept override;
- virtual void SAL_CALL release() noexcept override;
-
/// XServiceInfo
DECLARE_SERVICE_INFO();
diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx
index 68b4c5c86865..29c69856b41b 100644
--- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx
+++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx
@@ -35,7 +35,6 @@ namespace dbaui
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
@@ -157,7 +156,7 @@ namespace dbaui
}
bool OQueryContainerWindow::PreNotify( NotifyEvent& rNEvt )
{
- if (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS && m_pViewSwitch)
+ if (rNEvt.GetType() == NotifyEventType::GETFOCUS && m_pViewSwitch)
{
OJoinController& rController = m_pViewSwitch->getDesignView()->getController();
rController.InvalidateFeature(SID_CUT);
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index aa9145d5cb7a..d963ca3c293d 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -62,12 +62,14 @@
#include <cppuhelper/exc_hlp.hxx>
#include <svl/undo.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
+#include <utility>
#include <vcl/stdtext.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <osl/mutex.hxx>
+#include <o3tl/string_view.hxx>
#include <memory>
#include <vector>
@@ -119,7 +121,7 @@ namespace dbaui
namespace
{
- OUString lcl_getObjectResourceString(const char* pResId, sal_Int32 _nCommandType)
+ OUString lcl_getObjectResourceString(TranslateId pResId, sal_Int32 _nCommandType)
{
OUString sMessageText = DBA_RES(pResId);
OUString sObjectType = DBA_RES(RSC_QUERY_OBJECT_TYPE[_nCommandType]);
@@ -128,13 +130,11 @@ namespace dbaui
}
}
-using namespace ::com::sun::star::io;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::ui;
-using namespace ::com::sun::star::ui::dialogs;
using namespace ::com::sun::star::awt;
using namespace ::dbtools;
@@ -149,8 +149,8 @@ namespace
return;
xLayoutManager->lock();
- static constexpr OUStringLiteral s_sDesignToolbar = u"private:resource/toolbar/designobjectbar";
- static constexpr OUStringLiteral s_sSqlToolbar = u"private:resource/toolbar/sqlobjectbar";
+ static constexpr OUString s_sDesignToolbar = u"private:resource/toolbar/designobjectbar"_ustr;
+ static constexpr OUString s_sSqlToolbar = u"private:resource/toolbar/sqlobjectbar"_ustr;
if ( _bDesign )
{
xLayoutManager->destroyElement( s_sSqlToolbar );
@@ -245,7 +245,7 @@ void SAL_CALL OQueryController::getFastPropertyValue( Any& o_rValue, sal_Int32 i
{
::comphelper::NamedValueCollection aCurrentDesign;
aCurrentDesign.put( "GraphicalDesign", isGraphicalDesign() );
- aCurrentDesign.put( OUString(PROPERTY_ESCAPE_PROCESSING), m_bEscapeProcessing );
+ aCurrentDesign.put( PROPERTY_ESCAPE_PROCESSING, m_bEscapeProcessing );
if ( isGraphicalDesign() )
{
@@ -281,7 +281,8 @@ void SAL_CALL OQueryController::getFastPropertyValue( Any& o_rValue, sal_Int32 i
// one additional property:
const sal_Int32 nLength = aProps.getLength();
aProps.realloc( nLength + 1 );
- aProps[ nLength ] = Property(
+ auto pProps = aProps.getArray();
+ pProps[ nLength ] = Property(
"CurrentQueryDesign",
PROPERTY_ID_CURRENT_QUERY_DESIGN,
::cppu::UnoType< Sequence< PropertyValue > >::get(),
@@ -289,8 +290,8 @@ void SAL_CALL OQueryController::getFastPropertyValue( Any& o_rValue, sal_Int32 i
);
std::sort(
- aProps.begin(),
- aProps.end(),
+ pProps,
+ pProps + aProps.getLength(),
::comphelper::PropertyCompareByName()
);
@@ -477,6 +478,7 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >&
std::unique_ptr<::connectivity::OSQLParseNode> pNode = m_aSqlParser.parseTree(aErrorMsg,m_sStatement,m_bGraphicalDesign);
if ( pNode )
{
+ assert(m_pSqlIterator && "SqlIterator must exist");
delete m_pSqlIterator->getParseTree();
m_pSqlIterator->setParseTree(pNode.release());
m_pSqlIterator->traverseAll();
@@ -610,11 +612,9 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >&
void OQueryController::impl_showAutoSQLViewError( const css::uno::Any& _rErrorDetails )
{
- SQLContext aErrorContext;
- aErrorContext.Message = lcl_getObjectResourceString( STR_ERROR_PARSING_STATEMENT, m_nCommandType );
- aErrorContext.Context = *this;
- aErrorContext.Details = lcl_getObjectResourceString( STR_INFO_OPENING_IN_SQL_VIEW, m_nCommandType );
- aErrorContext.NextException = _rErrorDetails;
+ SQLContext aErrorContext(
+ lcl_getObjectResourceString(STR_ERROR_PARSING_STATEMENT, m_nCommandType), *this, {}, 0,
+ _rErrorDetails, lcl_getObjectResourceString(STR_INFO_OPENING_IN_SQL_VIEW, m_nCommandType));
showError( aErrorContext );
}
@@ -646,11 +646,9 @@ void OQueryController::impl_setViewMode( ::dbtools::SQLExceptionInfo* _pErrorInf
setModified( wasModified );
}
-void OQueryController::impl_initialize()
+void OQueryController::impl_initialize(const ::comphelper::NamedValueCollection& rArguments)
{
- OJoinController::impl_initialize();
-
- const NamedValueCollection& rArguments( getInitParams() );
+ OJoinController::impl_initialize(rArguments);
OUString sCommand;
m_nCommandType = CommandType::QUERY;
@@ -734,11 +732,11 @@ void OQueryController::impl_initialize()
if ( aCurrentQueryDesignProps.hasElements() )
{
::comphelper::NamedValueCollection aCurrentQueryDesign( aCurrentQueryDesignProps );
- if ( aCurrentQueryDesign.has( OUString(PROPERTY_GRAPHICAL_DESIGN) ) )
+ if ( aCurrentQueryDesign.has( PROPERTY_GRAPHICAL_DESIGN ) )
{
aCurrentQueryDesign.get_ensureType( PROPERTY_GRAPHICAL_DESIGN, m_bGraphicalDesign );
}
- if ( aCurrentQueryDesign.has( OUString(PROPERTY_ESCAPE_PROCESSING) ) )
+ if ( aCurrentQueryDesign.has( PROPERTY_ESCAPE_PROCESSING ) )
{
aCurrentQueryDesign.get_ensureType( PROPERTY_ESCAPE_PROCESSING, m_bEscapeProcessing );
}
@@ -873,7 +871,7 @@ OUString OQueryController::getPrivateTitle( ) const
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( getMutex() );
OUString aDefaultName = DBA_RES(editingView() ? STR_VIEW_TITLE : STR_QRY_TITLE);
- return aDefaultName.getToken(0, ' ') + OUString::number(getCurrentStartNumber());
+ return o3tl::getToken(aDefaultName, 0, ' ') + OUString::number(getCurrentStartNumber());
}
}
return m_sName;
@@ -1113,15 +1111,15 @@ void OQueryController::executeQuery()
{
auto aProps(::comphelper::InitPropertySequence(
{
- { PROPERTY_DATASOURCENAME, makeAny(sDataSourceName) },
- { PROPERTY_COMMAND_TYPE, makeAny(CommandType::COMMAND) },
- { PROPERTY_COMMAND, makeAny(sTranslatedStmt) },
- { PROPERTY_ENABLE_BROWSER, makeAny(false) },
- { PROPERTY_ACTIVE_CONNECTION, makeAny(getConnection()) },
- { PROPERTY_UPDATE_CATALOGNAME, makeAny(m_sUpdateCatalogName) },
- { PROPERTY_UPDATE_SCHEMANAME, makeAny(m_sUpdateSchemaName) },
- { PROPERTY_UPDATE_TABLENAME, makeAny(OUString()) },
- { PROPERTY_ESCAPE_PROCESSING, makeAny(m_bEscapeProcessing) }
+ { PROPERTY_DATASOURCENAME, Any(sDataSourceName) },
+ { PROPERTY_COMMAND_TYPE, Any(CommandType::COMMAND) },
+ { PROPERTY_COMMAND, Any(sTranslatedStmt) },
+ { PROPERTY_ENABLE_BROWSER, Any(false) },
+ { PROPERTY_ACTIVE_CONNECTION, Any(getConnection()) },
+ { PROPERTY_UPDATE_CATALOGNAME, Any(m_sUpdateCatalogName) },
+ { PROPERTY_UPDATE_SCHEMANAME, Any(m_sUpdateSchemaName) },
+ { PROPERTY_UPDATE_TABLENAME, Any(OUString()) },
+ { PROPERTY_ESCAPE_PROCESSING, Any(m_bEscapeProcessing) }
}));
xDisp->dispatch(aWantToDispatch, aProps);
@@ -1261,7 +1259,7 @@ bool OQueryController::doSaveAsDoc(bool _bSaveAs)
{
xQuery = xFact->createDataDescriptor();
// to set the name is only allowed when the query is new
- xQuery->setPropertyValue( PROPERTY_NAME, makeAny( m_sName ) );
+ xQuery->setPropertyValue( PROPERTY_NAME, Any( m_sName ) );
}
else
{
@@ -1286,18 +1284,18 @@ bool OQueryController::doSaveAsDoc(bool _bSaveAs)
}
else
{ // we're creating a query, or a *new* view
- xQuery->setPropertyValue( PROPERTY_COMMAND, makeAny( sTranslatedStmt ) );
+ xQuery->setPropertyValue( PROPERTY_COMMAND, Any( sTranslatedStmt ) );
if ( editingView() )
{
- xQuery->setPropertyValue( PROPERTY_CATALOGNAME, makeAny( m_sUpdateCatalogName ) );
- xQuery->setPropertyValue( PROPERTY_SCHEMANAME, makeAny( m_sUpdateSchemaName ) );
+ xQuery->setPropertyValue( PROPERTY_CATALOGNAME, Any( m_sUpdateCatalogName ) );
+ xQuery->setPropertyValue( PROPERTY_SCHEMANAME, Any( m_sUpdateSchemaName ) );
}
if ( editingQuery() )
{
- xQuery->setPropertyValue( PROPERTY_UPDATE_TABLENAME, makeAny( OUString() ) );
- xQuery->setPropertyValue( PROPERTY_ESCAPE_PROCESSING, css::uno::makeAny( m_bEscapeProcessing ) );
+ xQuery->setPropertyValue( PROPERTY_UPDATE_TABLENAME, Any( OUString() ) );
+ xQuery->setPropertyValue( PROPERTY_ESCAPE_PROCESSING, css::uno::Any( m_bEscapeProcessing ) );
xQuery->setPropertyValue( PROPERTY_LAYOUTINFORMATION, getViewData() );
}
@@ -1314,7 +1312,7 @@ bool OQueryController::doSaveAsDoc(bool _bSaveAs)
{
Reference< XNameContainer > xCont( xElements, UNO_QUERY );
if ( xCont.is() )
- xCont->insertByName( m_sName, makeAny( xQuery ) );
+ xCont->insertByName( m_sName, Any( xQuery ) );
}
if ( editingView() )
@@ -1379,8 +1377,8 @@ struct CommentStrip
{
OUString maComment;
bool mbLastOnLine;
- CommentStrip( const OUString& rComment, bool bLastOnLine )
- : maComment( rComment), mbLastOnLine( bLastOnLine) {}
+ CommentStrip( OUString sComment, bool bLastOnLine )
+ : maComment(std::move( sComment)), mbLastOnLine( bLastOnLine) {}
};
}
@@ -1679,7 +1677,7 @@ void OQueryController::impl_reset( const bool i_bForceCurrentControllerSettings
{
if ( !i_bForceCurrentControllerSettings && m_bGraphicalDesign && !editingView() )
{
- impl_showAutoSQLViewError( makeAny( m_pSqlIterator->getErrors() ) );
+ impl_showAutoSQLViewError( Any( m_pSqlIterator->getErrors() ) );
}
bError = true;
}
@@ -1722,9 +1720,9 @@ void OQueryController::reset()
void OQueryController::setStatement_fireEvent( const OUString& _rNewStatement, bool _bFireStatementChange )
{
- Any aOldValue = makeAny( m_sStatement );
+ Any aOldValue( m_sStatement );
m_sStatement = _rNewStatement;
- Any aNewValue = makeAny( m_sStatement );
+ Any aNewValue( m_sStatement );
sal_Int32 nHandle = PROPERTY_ID_ACTIVECOMMAND;
if ( _bFireStatementChange )
@@ -1736,9 +1734,9 @@ void OQueryController::setEscapeProcessing_fireEvent( const bool _bEscapeProcess
if ( _bEscapeProcessing == m_bEscapeProcessing )
return;
- Any aOldValue = makeAny( m_bEscapeProcessing );
+ Any aOldValue( m_bEscapeProcessing );
m_bEscapeProcessing = _bEscapeProcessing;
- Any aNewValue = makeAny( m_bEscapeProcessing );
+ Any aNewValue( m_bEscapeProcessing );
sal_Int32 nHandle = PROPERTY_ID_ESCAPE_PROCESSING;
fire( &nHandle, &aNewValue, &aOldValue, 1, false );
@@ -1760,9 +1758,7 @@ bool OQueryController::allowQueries() const
if ( !getSdbMetaData().supportsSubqueriesInFrom() )
return false;
- const NamedValueCollection& rArguments( getInitParams() );
- sal_Int32 nCommandType = rArguments.getOrDefault( PROPERTY_COMMAND_TYPE, sal_Int32(CommandType::QUERY) );
- bool bCreatingView = ( nCommandType == CommandType::TABLE );
+ bool bCreatingView = ( m_nCommandType == CommandType::TABLE );
return !bCreatingView;
}
@@ -1775,7 +1771,7 @@ Any SAL_CALL OQueryController::getViewData()
::comphelper::NamedValueCollection aViewSettings;
saveViewSettings( aViewSettings, false );
- return makeAny( aViewSettings.getPropertyValues() );
+ return Any( aViewSettings.getPropertyValues() );
}
void SAL_CALL OQueryController::restoreViewData(const Any& /*Data*/)
diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx b/dbaccess/source/ui/querydesign/querydlg.cxx
index 91631f9f3b93..a54b78e24353 100644
--- a/dbaccess/source/ui/querydesign/querydlg.cxx
+++ b/dbaccess/source/ui/querydesign/querydlg.cxx
@@ -21,7 +21,7 @@
#include <JoinController.hxx>
#include <JoinDesignView.hxx>
#include <strings.hrc>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include "QTableConnectionData.hxx"
#include <core_resource.hxx>
#include <QueryTableView.hxx>
@@ -150,7 +150,7 @@ IMPL_LINK_NOARG( DlgQryJoin, LBChangeHdl, weld::ComboBox&, void )
OUString sFirstWinName = m_pConnData->getReferencingTable()->GetWinName();
OUString sSecondWinName = m_pConnData->getReferencedTable()->GetWinName();
const EJoinType eOldJoinType = eJoinType;
- const char* pResId = nullptr;
+ TranslateId pResId;
const sal_Int32 nPos = m_xLB_JoinType->get_active();
const sal_Int32 nJoinType = m_xLB_JoinType->get_id(nPos).toInt32();
bool bAddHint = true;
@@ -167,13 +167,9 @@ IMPL_LINK_NOARG( DlgQryJoin, LBChangeHdl, weld::ComboBox&, void )
eJoinType = LEFT_JOIN;
break;
case ID_RIGHT_JOIN:
- {
- pResId = STR_QUERY_LEFTRIGHT_JOIN;
- eJoinType = RIGHT_JOIN;
- OUString sTemp = sFirstWinName;
- sFirstWinName = sSecondWinName;
- sSecondWinName = sTemp;
- }
+ pResId = STR_QUERY_LEFTRIGHT_JOIN;
+ eJoinType = RIGHT_JOIN;
+ std::swap( sFirstWinName, sSecondWinName );
break;
case ID_FULL_JOIN:
pResId = STR_QUERY_FULL_JOIN;
diff --git a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
index 1e38bb2f7e03..46b3671c40e2 100644
--- a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
+++ b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
@@ -38,11 +38,9 @@ using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
ORelationTableConnectionData::ORelationTableConnectionData()
- :OTableConnectionData()
- ,m_nUpdateRules(KeyRule::NO_ACTION)
+ :m_nUpdateRules(KeyRule::NO_ACTION)
,m_nDeleteRules(KeyRule::NO_ACTION)
,m_nCardinality(Cardinality::Undefined)
{
@@ -113,9 +111,7 @@ void ORelationTableConnectionData::ChangeOrientation()
}
// adapt member
- TTableWindowData::value_type pTemp = m_pReferencingTable;
- m_pReferencingTable = m_pReferencedTable;
- m_pReferencedTable = pTemp;
+ std::swap( m_pReferencingTable, m_pReferencedTable );
}
void ORelationTableConnectionData::SetCardinality()
@@ -257,11 +253,11 @@ bool ORelationTableConnectionData::Update()
xTableProp->getPropertyValue(PROPERTY_NAME) >>= sSourceName;
OUString sKeyName = sSourceName + getReferencedTable()->GetTableName();
- xKey->setPropertyValue(PROPERTY_NAME,makeAny(sKeyName));
- xKey->setPropertyValue(PROPERTY_TYPE,makeAny(KeyType::FOREIGN));
- xKey->setPropertyValue(PROPERTY_REFERENCEDTABLE,makeAny(getReferencedTable()->GetTableName()));
- xKey->setPropertyValue(PROPERTY_UPDATERULE, makeAny(GetUpdateRules()));
- xKey->setPropertyValue(PROPERTY_DELETERULE, makeAny(GetDeleteRules()));
+ xKey->setPropertyValue(PROPERTY_NAME,Any(sKeyName));
+ xKey->setPropertyValue(PROPERTY_TYPE,Any(KeyType::FOREIGN));
+ xKey->setPropertyValue(PROPERTY_REFERENCEDTABLE,Any(getReferencedTable()->GetTableName()));
+ xKey->setPropertyValue(PROPERTY_UPDATERULE, Any(GetUpdateRules()));
+ xKey->setPropertyValue(PROPERTY_DELETERULE, Any(GetDeleteRules()));
}
Reference<XColumnsSupplier> xColSup(xKey,UNO_QUERY);
@@ -279,8 +275,8 @@ bool ORelationTableConnectionData::Update()
Reference<XPropertySet> xColumn = xColumnFactory->createDataDescriptor();
if ( xColumn.is() )
{
- xColumn->setPropertyValue(PROPERTY_NAME,makeAny(elem->GetSourceFieldName()));
- xColumn->setPropertyValue(PROPERTY_RELATEDCOLUMN,makeAny(elem->GetDestFieldName()));
+ xColumn->setPropertyValue(PROPERTY_NAME,Any(elem->GetSourceFieldName()));
+ xColumn->setPropertyValue(PROPERTY_RELATEDCOLUMN,Any(elem->GetDestFieldName()));
xColumnAppend->appendByDescriptor(xColumn);
}
}
diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx
index 0750a77a01df..ebeca9a64b24 100644
--- a/dbaccess/source/ui/relationdesign/RelationController.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationController.cxx
@@ -44,7 +44,7 @@
#include <RTableConnectionData.hxx>
#include <RelationTableView.hxx>
#include <RelationDesignView.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/thread.hxx>
#include <osl/mutex.hxx>
@@ -58,16 +58,13 @@ org_openoffice_comp_dbu_ORelationDesign_get_implementation(
}
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::io;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::ui::dialogs;
-using namespace ::com::sun::star::util;
using namespace ::dbtools;
using namespace ::dbaui;
using namespace ::comphelper;
@@ -138,7 +135,7 @@ void ORelationController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue
{
::comphelper::NamedValueCollection aWindowsData;
saveTableWindows( aWindowsData );
- getDataSource()->setPropertyValue( PROPERTY_LAYOUTINFORMATION, makeAny( aWindowsData.getPropertyValues() ) );
+ getDataSource()->setPropertyValue( PROPERTY_LAYOUTINFORMATION, Any( aWindowsData.getPropertyValues() ) );
setModified(false);
}
}
@@ -159,9 +156,9 @@ void ORelationController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue
InvalidateFeature(_nId);
}
-void ORelationController::impl_initialize()
+void ORelationController::impl_initialize(const ::comphelper::NamedValueCollection& rArguments)
{
- OJoinController::impl_initialize();
+ OJoinController::impl_initialize(rArguments);
if( !getSdbMetaData().supportsRelations() )
{// check if this database supports relations
diff --git a/dbaccess/source/ui/relationdesign/RelationDesignView.cxx b/dbaccess/source/ui/relationdesign/RelationDesignView.cxx
index 014579cf7c7f..161702f08196 100644
--- a/dbaccess/source/ui/relationdesign/RelationDesignView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationDesignView.cxx
@@ -24,10 +24,6 @@
using namespace ::dbaui;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
ORelationDesignView::ORelationDesignView(vcl::Window* _pParent, ORelationController& _rController,const Reference< XComponentContext >& _rxContext)
:OJoinDesignView( _pParent, _rController, _rxContext )
@@ -51,7 +47,7 @@ void ORelationDesignView::initialize()
bool ORelationDesignView::PreNotify( NotifyEvent& rNEvt )
{
bool bDone = false;
- if(rNEvt.GetType() == MouseNotifyEvent::GETFOCUS)
+ if(rNEvt.GetType() == NotifyEventType::GETFOCUS)
{
if(m_pTableView && !m_pTableView->HasChildPathFocus())
{
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index d18f1cfa8037..87a769ce83b3 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -28,7 +28,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <connectivity/dbtools.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <helpids.h>
#include <RelationDesignView.hxx>
#include <JoinController.hxx>
@@ -51,7 +51,6 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::accessibility;
@@ -110,7 +109,7 @@ void ORelationTableView::ReSync()
pTabWin.disposeAndClear();
arrInvalidTables.push_back(pData->GetTableName());
- rTabWinDataList.erase( std::remove(rTabWinDataList.begin(), rTabWinDataList.end(), *aIter), rTabWinDataList.end());
+ std::erase(rTabWinDataList, *aIter);
continue;
}
@@ -140,7 +139,7 @@ void ORelationTableView::ReSync()
if (bInvalid)
{
// no -> bad luck, the connection is gone
- rTabConnDataList.erase( std::remove(rTabConnDataList.begin(), rTabConnDataList.end(), *aConIter), rTabConnDataList.end() );
+ std::erase(rTabConnDataList, *aConIter);
continue;
}
}
@@ -309,7 +308,7 @@ void ORelationTableView::AddTabWin(const OUString& _rComposedName, const OUStrin
if ( m_pAccessible )
m_pAccessible->notifyAccessibleEvent( AccessibleEventId::CHILD,
Any(),
- makeAny(pNewTabWin->GetAccessible()));
+ Any(pNewTabWin->GetAccessible()));
}
else
{
diff --git a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx
index 067bc43d3de8..4a4a499380a9 100644
--- a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx
+++ b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx
@@ -18,7 +18,7 @@
*/
#include <FieldDescriptions.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <strings.hxx>
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <comphelper/types.hxx>
@@ -38,8 +38,7 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::util;
OFieldDescription::OFieldDescription()
- :m_pType()
- ,m_nType(DataType::VARCHAR)
+ :m_nType(DataType::VARCHAR)
,m_nPrecision(0)
,m_nScale(0)
,m_nIsNullable(ColumnValue::NULLABLE)
@@ -81,8 +80,7 @@ OFieldDescription::~OFieldDescription()
}
OFieldDescription::OFieldDescription(const Reference< XPropertySet >& xAffectedCol,bool _bUseAsDest)
- :m_pType()
- ,m_nType(DataType::VARCHAR)
+ :m_nType(DataType::VARCHAR)
,m_nPrecision(0)
,m_nScale(0)
,m_nIsNullable(ColumnValue::NULLABLE)
@@ -189,7 +187,10 @@ void OFieldDescription::FillFromTypeInfo(const TOTypeInfoSP& _pType,bool _bForce
SetPrecision(std::min<sal_Int32>(nPrec,_pType->nPrecision));
}
break;
+ case DataType::TIME:
+ case DataType::TIME_WITH_TIMEZONE:
case DataType::TIMESTAMP:
+ case DataType::TIMESTAMP_WITH_TIMEZONE:
if ( bForce && _pType->nMaximumScale)
{
SetScale(std::min<sal_Int32>(GetScale() ? GetScale() : DEFAULT_NUMERIC_SCALE,_pType->nMaximumScale));
@@ -237,7 +238,7 @@ void OFieldDescription::SetName(const OUString& _rName)
try
{
if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_NAME) )
- m_xDest->setPropertyValue(PROPERTY_NAME,makeAny(_rName));
+ m_xDest->setPropertyValue(PROPERTY_NAME,Any(_rName));
else
m_sName = _rName;
}
@@ -252,7 +253,7 @@ void OFieldDescription::SetHelpText(const OUString& _sHelpText)
try
{
if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_HELPTEXT) )
- m_xDest->setPropertyValue(PROPERTY_HELPTEXT,makeAny(_sHelpText));
+ m_xDest->setPropertyValue(PROPERTY_HELPTEXT,Any(_sHelpText));
else
m_sHelpText = _sHelpText;
}
@@ -267,7 +268,7 @@ void OFieldDescription::SetDescription(const OUString& _rDescription)
try
{
if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_DESCRIPTION) )
- m_xDest->setPropertyValue(PROPERTY_DESCRIPTION,makeAny(_rDescription));
+ m_xDest->setPropertyValue(PROPERTY_DESCRIPTION,Any(_rDescription));
else
m_sDescription = _rDescription;
}
@@ -310,7 +311,7 @@ void OFieldDescription::SetAutoIncrementValue(const OUString& _sAutoIncValue)
try
{
if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_AUTOINCREMENTCREATION) )
- m_xDest->setPropertyValue(PROPERTY_AUTOINCREMENTCREATION,makeAny(_sAutoIncValue));
+ m_xDest->setPropertyValue(PROPERTY_AUTOINCREMENTCREATION,Any(_sAutoIncValue));
else
m_sAutoIncrementValue = _sAutoIncValue;
}
@@ -329,7 +330,7 @@ void OFieldDescription::SetType(const TOTypeInfoSP& _pType)
try
{
if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_TYPE) )
- m_xDest->setPropertyValue(PROPERTY_TYPE,makeAny(m_pType->nType));
+ m_xDest->setPropertyValue(PROPERTY_TYPE,Any(m_pType->nType));
else
m_nType = m_pType->nType;
}
@@ -344,7 +345,7 @@ void OFieldDescription::SetTypeValue(sal_Int32 _nType)
try
{
if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_TYPE) )
- m_xDest->setPropertyValue(PROPERTY_TYPE,makeAny(_nType));
+ m_xDest->setPropertyValue(PROPERTY_TYPE,Any(_nType));
else
{
m_nType = _nType;
@@ -362,7 +363,7 @@ void OFieldDescription::SetPrecision(sal_Int32 _rPrecision)
try
{
if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_PRECISION) )
- m_xDest->setPropertyValue(PROPERTY_PRECISION,makeAny(_rPrecision));
+ m_xDest->setPropertyValue(PROPERTY_PRECISION,Any(_rPrecision));
else
m_nPrecision = _rPrecision;
}
@@ -377,7 +378,7 @@ void OFieldDescription::SetScale(sal_Int32 _rScale)
try
{
if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_SCALE) )
- m_xDest->setPropertyValue(PROPERTY_SCALE,makeAny(_rScale));
+ m_xDest->setPropertyValue(PROPERTY_SCALE,Any(_rScale));
else
m_nScale = _rScale;
}
@@ -392,7 +393,7 @@ void OFieldDescription::SetIsNullable(sal_Int32 _rIsNullable)
try
{
if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_ISNULLABLE) )
- m_xDest->setPropertyValue(PROPERTY_ISNULLABLE,makeAny(_rIsNullable));
+ m_xDest->setPropertyValue(PROPERTY_ISNULLABLE,Any(_rIsNullable));
else
m_nIsNullable = _rIsNullable;
}
@@ -407,7 +408,7 @@ void OFieldDescription::SetFormatKey(sal_Int32 _rFormatKey)
try
{
if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_FORMATKEY) )
- m_xDest->setPropertyValue(PROPERTY_FORMATKEY,makeAny(_rFormatKey));
+ m_xDest->setPropertyValue(PROPERTY_FORMATKEY,Any(_rFormatKey));
else
m_nFormatKey = _rFormatKey;
}
@@ -422,7 +423,7 @@ void OFieldDescription::SetHorJustify(const SvxCellHorJustify& _rHorJustify)
try
{
if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_ALIGN) )
- m_xDest->setPropertyValue(PROPERTY_ALIGN,makeAny( dbaui::mapTextAlign(_rHorJustify)));
+ m_xDest->setPropertyValue(PROPERTY_ALIGN,Any( dbaui::mapTextAlign(_rHorJustify)));
else
m_eHorJustify = _rHorJustify;
}
@@ -437,7 +438,7 @@ void OFieldDescription::SetAutoIncrement(bool _bAuto)
try
{
if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_ISAUTOINCREMENT) )
- m_xDest->setPropertyValue(PROPERTY_ISAUTOINCREMENT,makeAny(_bAuto));
+ m_xDest->setPropertyValue(PROPERTY_ISAUTOINCREMENT,Any(_bAuto));
else
m_bIsAutoIncrement = _bAuto;
}
@@ -604,7 +605,7 @@ void OFieldDescription::SetTypeName(const OUString& _sTypeName)
try
{
if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_TYPENAME) )
- m_xDest->setPropertyValue(PROPERTY_TYPENAME,makeAny(_sTypeName));
+ m_xDest->setPropertyValue(PROPERTY_TYPENAME,Any(_sTypeName));
else
m_sTypeName = _sTypeName;
}
@@ -622,11 +623,11 @@ void OFieldDescription::copyColumnSettingsTo(const Reference< XPropertySet >& _r
Reference<XPropertySetInfo> xInfo = _rxColumn->getPropertySetInfo();
if ( GetFormatKey() != NumberFormat::ALL && xInfo->hasPropertyByName(PROPERTY_FORMATKEY) )
- _rxColumn->setPropertyValue(PROPERTY_FORMATKEY,makeAny(GetFormatKey()));
+ _rxColumn->setPropertyValue(PROPERTY_FORMATKEY,Any(GetFormatKey()));
if ( GetHorJustify() != SvxCellHorJustify::Standard && xInfo->hasPropertyByName(PROPERTY_ALIGN) )
- _rxColumn->setPropertyValue(PROPERTY_ALIGN,makeAny(dbaui::mapTextAlign(GetHorJustify())));
+ _rxColumn->setPropertyValue(PROPERTY_ALIGN,Any(dbaui::mapTextAlign(GetHorJustify())));
if ( !GetHelpText().isEmpty() && xInfo->hasPropertyByName(PROPERTY_HELPTEXT) )
- _rxColumn->setPropertyValue(PROPERTY_HELPTEXT,makeAny(GetHelpText()));
+ _rxColumn->setPropertyValue(PROPERTY_HELPTEXT,Any(GetHelpText()));
if ( GetControlDefault().hasValue() && xInfo->hasPropertyByName(PROPERTY_CONTROLDEFAULT) )
_rxColumn->setPropertyValue(PROPERTY_CONTROLDEFAULT,GetControlDefault());
@@ -635,7 +636,7 @@ void OFieldDescription::copyColumnSettingsTo(const Reference< XPropertySet >& _r
if(xInfo->hasPropertyByName(PROPERTY_WIDTH))
_rxColumn->setPropertyValue(PROPERTY_WIDTH,m_aWidth);
if(xInfo->hasPropertyByName(PROPERTY_HIDDEN))
- _rxColumn->setPropertyValue(PROPERTY_HIDDEN,makeAny(m_bHidden));
+ _rxColumn->setPropertyValue(PROPERTY_HIDDEN,Any(m_bHidden));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index a89397ccb2a5..b9328604b277 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -36,6 +36,7 @@
#include <connectivity/dbtools.hxx>
#include <SqlNameEdit.hxx>
#include <TableRowExchange.hxx>
+#include <o3tl/safeint.hxx>
#include <sot/storage.hxx>
#include <svx/svxids.hrc>
#include <UITools.hxx>
@@ -48,14 +49,10 @@ using namespace ::dbaui;
using namespace ::comphelper;
using namespace ::svt;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::container;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdb;
#define HANDLE_ID 0
@@ -69,7 +66,8 @@ using namespace ::com::sun::star::sdb;
#define MAX_DESCR_LEN 256
OTableEditorCtrl::ClipboardInvalidator::ClipboardInvalidator(OTableEditorCtrl* _pOwner)
-: m_pOwner(_pOwner)
+: m_aInvalidateTimer("dbaccess ClipboardInvalidator")
+, m_pOwner(_pOwner)
{
m_aInvalidateTimer.SetTimeout(500);
@@ -302,7 +300,7 @@ void OTableEditorCtrl::PaintCell(OutputDevice& rDev, const tools::Rectangle& rRe
{
const OUString aText( GetCellText( m_nCurrentPos, nColumnId ));
- rDev.Push( PushFlags::CLIPREGION );
+ rDev.Push( vcl::PushFlags::CLIPREGION );
rDev.SetClipRegion(vcl::Region(rRect));
rDev.DrawText( rRect, aText, DrawTextFlags::Left | DrawTextFlags::VCenter );
rDev.Pop();
@@ -476,7 +474,7 @@ void OTableEditorCtrl::CursorMoved()
OTableRowView::CursorMoved();
}
-sal_Int32 OTableEditorCtrl::HasFieldName( const OUString& rFieldName )
+sal_Int32 OTableEditorCtrl::HasFieldName( std::u16string_view rFieldName )
{
Reference<XConnection> xCon = GetView()->getController().getConnection();
@@ -733,7 +731,7 @@ void OTableEditorCtrl::CopyRows()
}
if(!vClipboardList.empty())
{
- rtl::Reference<OTableRowExchange> pData = new OTableRowExchange(vClipboardList);
+ rtl::Reference<OTableRowExchange> pData = new OTableRowExchange(std::move(vClipboardList));
pData->CopyToClipboard(GetParent());
}
}
@@ -772,9 +770,8 @@ void OTableEditorCtrl::InsertRows( sal_Int32 nRow )
TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard(GetParent()));
if(aTransferData.HasFormat(SotClipboardFormatId::SBA_TABED))
{
- ::tools::SvRef<SotTempStream> aStreamRef;
- bool bOk = aTransferData.GetSotStorageStream(SotClipboardFormatId::SBA_TABED,aStreamRef);
- if (bOk && aStreamRef.is())
+ std::unique_ptr<SvStream> aStreamRef = aTransferData.GetSotStorageStream(SotClipboardFormatId::SBA_TABED);
+ if (aStreamRef)
{
aStreamRef->Seek(STREAM_SEEK_TO_BEGIN);
aStreamRef->ResetError();
@@ -805,7 +802,7 @@ void OTableEditorCtrl::InsertRows( sal_Int32 nRow )
RowInserted( nRow,vInsertedUndoRedoRows.size() );
// Create the Undo-Action
- GetUndoManager().AddUndoAction( std::make_unique<OTableEditorInsUndoAct>(this, nRow,vInsertedUndoRedoRows) );
+ GetUndoManager().AddUndoAction( std::make_unique<OTableEditorInsUndoAct>(this, nRow, std::move(vInsertedUndoRedoRows)) );
GetView()->getController().setModified( true );
InvalidateFeatures();
}
@@ -969,7 +966,7 @@ void OTableEditorCtrl::SetCellData( sal_Int32 nRow, sal_uInt16 nColId, const css
case FIELD_PROPERTY_BOOL_DEFAULT:
sValue = GetView()->GetDescWin()->BoolStringPersistent(::comphelper::getString(_rNewData));
- pFieldDescr->SetControlDefault(makeAny(sValue));
+ pFieldDescr->SetControlDefault(Any(sValue));
break;
case FIELD_PROPERTY_FORMAT:
@@ -1049,7 +1046,7 @@ Any OTableEditorCtrl::GetCellData( sal_Int32 nRow, sal_uInt16 nColId )
break;
}
- return makeAny(sValue);
+ return Any(sValue);
}
OUString OTableEditorCtrl::GetCellText( sal_Int32 nRow, sal_uInt16 nColId ) const
@@ -1410,11 +1407,25 @@ void OTableEditorCtrl::Command(const CommandEvent& rEvt)
xContextMenu->remove("paste");
if (!IsDeleteAllowed())
xContextMenu->remove("delete");
- if (!IsPrimaryKeyAllowed())
- xContextMenu->remove("primarykey");
- if (!IsInsertNewAllowed(nRow))
+ // tdf#71224: WORKAROUND for the moment, we don't implement insert field at specific position
+ // It's not SQL standard and each database has made its choice (some use "BEFORE", other "FIRST" and "AFTER")
+ // and some, like Postgresql, don't allow this.
+ // So for the moment, test if the table already exists (and so it's an edition), in this case only
+ // we remove "Insert Fields" entry. Indeed, in case of new table, there's no pb.
+ //
+ // The real fix is to implement the insert for each database + error message for those which don't support this
+ //if (!IsInsertNewAllowed(nRow))
+ if ( GetView()->getController().getTable().is() )
xContextMenu->remove("insert");
- xContextMenu->set_active("primarykey", IsRowSelected(GetCurRow()) && IsPrimaryKey());
+
+ if (IsPrimaryKeyAllowed())
+ {
+ xContextMenu->set_active("primarykey", IsRowSelected(GetCurRow()) && IsPrimaryKey());
+ }
+ else
+ {
+ xContextMenu->remove("primarykey");
+ }
if( SetDataPtr(m_nDataPos) )
pDescrWin->SaveData( pActRow->GetActFieldDescr() );
@@ -1422,7 +1433,7 @@ void OTableEditorCtrl::Command(const CommandEvent& rEvt)
// All actions which change the number of rows must be run asynchronously
// otherwise there may be problems between the Context menu and the Browser
m_nDataPos = GetCurRow();
- OString sIdent = xContextMenu->popup_at_rect(pPopupParent, aRect);
+ OUString sIdent = xContextMenu->popup_at_rect(pPopupParent, aRect);
if (sIdent == "cut")
cut();
else if (sIdent == "copy")
@@ -1601,7 +1612,7 @@ void OTableEditorCtrl::SwitchType( const TOTypeInfoSP& _pType )
// Store the old description
pDescrWin->SaveData( pActFieldDescr );
- if ( nRow < 0 || nRow > static_cast<tools::Long>(m_pRowList->size()) )
+ if ( nRow < 0 || o3tl::make_unsigned(nRow) > m_pRowList->size() )
return;
// Show the new description
std::shared_ptr<OTableRow> pRow = (*m_pRowList)[nRow];
@@ -1659,7 +1670,7 @@ void OTableEditorCtrl::DeactivateCell(bool bUpdate)
bool OTableEditorCtrl::PreNotify( NotifyEvent& rNEvt )
{
- if (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS)
+ if (rNEvt.GetType() == NotifyEventType::GETFOCUS)
{
if( pHelpTextCell && pHelpTextCell->HasChildPathFocus() )
m_eChildFocus = HELPTEXT;
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.hxx b/dbaccess/source/ui/tabledesign/TEditControl.hxx
index 74e3594cf0b2..7b1d467815db 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.hxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.hxx
@@ -176,7 +176,7 @@ namespace dbaui
DECL_LINK( InvalidateFieldType, void*, void );
void InitCellController();
- sal_Int32 HasFieldName( const OUString& rFieldName );
+ sal_Int32 HasFieldName( std::u16string_view rFieldName );
OUString GenerateName( const OUString& rName );
bool SetDataPtr( sal_Int32 nRow );
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index 27c9a3aab3bb..924d9010b362 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -50,9 +50,10 @@
#include <connectivity/dbtools.hxx>
#include <connectivity/dbmetadata.hxx>
#include <cppuhelper/exc_hlp.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
+#include <o3tl/string_view.hxx>
#include <algorithm>
#include <functional>
@@ -67,7 +68,6 @@ org_openoffice_comp_dbu_OTableDesign_get_implementation(
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::io;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::lang;
@@ -75,7 +75,6 @@ using namespace ::com::sun::star::container;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
-using namespace ::com::sun::star::ui;
using namespace ::com::sun::star::util;
using namespace ::dbtools;
using namespace ::dbaui;
@@ -110,7 +109,6 @@ Sequence< OUString> OTableController::getSupportedServiceNames()
OTableController::OTableController(const Reference< XComponentContext >& _rM) : OTableController_BASE(_rM)
,m_sTypeNames(DBA_RES(STR_TABLEDESIGN_DBFIELDTYPES))
- ,m_pTypeInfo()
,m_bAllowAutoIncrementValue(false)
,m_bNew(true)
{
@@ -315,9 +313,9 @@ bool OTableController::doSaveDoc(bool _bSaveAs)
xTable = xFact->createDataDescriptor();
OSL_ENSURE(xTable.is(),"OTableController::doSaveDoc: Create query failed!");
// to set the name is only allowed when the query is new
- xTable->setPropertyValue(PROPERTY_CATALOGNAME,makeAny(sCatalog));
- xTable->setPropertyValue(PROPERTY_SCHEMANAME,makeAny(sSchema));
- xTable->setPropertyValue(PROPERTY_NAME,makeAny(m_sName));
+ xTable->setPropertyValue(PROPERTY_CATALOGNAME,Any(sCatalog));
+ xTable->setPropertyValue(PROPERTY_SCHEMANAME,Any(sSchema));
+ xTable->setPropertyValue(PROPERTY_NAME,Any(m_sName));
// now append the columns
Reference<XColumnsSupplier> xColSup(xTable,UNO_QUERY);
@@ -455,13 +453,11 @@ void OTableController::doEditIndexes()
}
-void OTableController::impl_initialize()
+void OTableController::impl_initialize(const ::comphelper::NamedValueCollection& rArguments)
{
try
{
- OTableController_BASE::impl_initialize();
-
- const NamedValueCollection& rArguments( getInitParams() );
+ OTableController_BASE::impl_initialize(rArguments);
rArguments.get_ensureType( PROPERTY_CURRENTTABLE, m_sName );
@@ -663,7 +659,7 @@ void OTableController::appendColumns(Reference<XColumnsSupplier> const & _rxColS
if(!_bKeyColumns)
::dbaui::setColumnProperties(xColumn,pField);
else
- xColumn->setPropertyValue(PROPERTY_NAME,makeAny(pField->GetName()));
+ xColumn->setPropertyValue(PROPERTY_NAME,Any(pField->GetName()));
xAppend->appendByDescriptor(xColumn);
xColumn = nullptr;
@@ -722,7 +718,7 @@ void OTableController::appendPrimaryKey(Reference<XKeysSupplier> const & _rxSup,
Reference<XPropertySet> xKey = xKeyFactory->createDataDescriptor();
OSL_ENSURE(xKey.is(),"Key is null!");
- xKey->setPropertyValue(PROPERTY_TYPE,makeAny(KeyType::PRIMARY));
+ xKey->setPropertyValue(PROPERTY_TYPE,Any(KeyType::PRIMARY));
Reference<XColumnsSupplier> xColSup(xKey,UNO_QUERY);
if(xColSup.is())
@@ -903,15 +899,15 @@ bool OTableController::checkColumns(bool _bNew)
{
case RET_YES:
{
- auto pNewRow = std::make_shared<OTableRow>();
TOTypeInfoSP pTypeInfo = ::dbaui::queryPrimaryKeyType(m_aTypeInfo);
if ( !pTypeInfo )
break;
+ auto pNewRow = std::make_shared<OTableRow>();
pNewRow->SetFieldType( pTypeInfo );
OFieldDescription* pActFieldDescr = pNewRow->GetActFieldDescr();
- pActFieldDescr->SetAutoIncrement(false);
+ pActFieldDescr->SetAutoIncrement(pTypeInfo->bAutoIncrement);
pActFieldDescr->SetIsNullable(ColumnValue::NO_NULLS);
pActFieldDescr->SetName( createUniqueName("ID" ));
@@ -1121,14 +1117,14 @@ void OTableController::alterColumns()
xColumns->getByName(pField->GetName()) >>= xColumn;
Reference<XPropertySetInfo> xInfo = xColumn->getPropertySetInfo();
if ( xInfo->hasPropertyByName(PROPERTY_HELPTEXT) )
- xColumn->setPropertyValue(PROPERTY_HELPTEXT,makeAny(pField->GetHelpText()));
+ xColumn->setPropertyValue(PROPERTY_HELPTEXT,Any(pField->GetHelpText()));
if(xInfo->hasPropertyByName(PROPERTY_CONTROLDEFAULT))
xColumn->setPropertyValue(PROPERTY_CONTROLDEFAULT,pField->GetControlDefault());
if(xInfo->hasPropertyByName(PROPERTY_FORMATKEY))
- xColumn->setPropertyValue(PROPERTY_FORMATKEY,makeAny(pField->GetFormatKey()));
+ xColumn->setPropertyValue(PROPERTY_FORMATKEY,Any(pField->GetFormatKey()));
if(xInfo->hasPropertyByName(PROPERTY_ALIGN))
- xColumn->setPropertyValue(PROPERTY_ALIGN,makeAny(dbaui::mapTextAlign(pField->GetHorJustify())));
+ xColumn->setPropertyValue(PROPERTY_ALIGN,Any(dbaui::mapTextAlign(pField->GetHorJustify())));
}
}
// second drop all columns which could be found by name
@@ -1164,15 +1160,11 @@ void OTableController::alterColumns()
}
catch (const SQLException&)
{
+ const auto caughtException = ::cppu::getCaughtException();
OUString sError( DBA_RES( STR_TABLEDESIGN_COULD_NOT_DROP_COL ) );
sError = sError.replaceFirst( "$column$", rColumnName );
- SQLException aNewException;
- aNewException.Message = sError;
- aNewException.SQLState = "S1000";
- aNewException.NextException = ::cppu::getCaughtException();
-
- throw aNewException;
+ throw SQLException(sError, {}, "S1000", 0, caughtException);
}
}
}
@@ -1444,7 +1436,7 @@ OUString OTableController::getPrivateTitle() const
if ( sTitle.isEmpty() )
{
OUString aName = DBA_RES(STR_TBL_TITLE);
- sTitle = aName.getToken(0,' ') + OUString::number(getCurrentStartNumber());
+ sTitle = o3tl::getToken(aName,0,' ') + OUString::number(getCurrentStartNumber());
}
}
catch( const Exception& )
diff --git a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
index 1526682eddd7..18e24c3d5e12 100644
--- a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
@@ -116,7 +116,7 @@ void OTableRowView::Command(const CommandEvent& rEvt)
sal_Int32 nSelectRowCount = GetSelectRowCount();
xContextMenu->set_sensitive("cut", nSelectRowCount != 0);
xContextMenu->set_sensitive("copy", nSelectRowCount != 0);
- OString sIdent = xContextMenu->popup_at_rect(pPopupParent, aRect);
+ OUString sIdent = xContextMenu->popup_at_rect(pPopupParent, aRect);
if (sIdent == "cut")
cut();
else if (sIdent == "copy")
diff --git a/dbaccess/source/ui/tabledesign/TableDesignView.cxx b/dbaccess/source/ui/tabledesign/TableDesignView.cxx
index f0570ddba9db..e16bf2e546bf 100644
--- a/dbaccess/source/ui/tabledesign/TableDesignView.cxx
+++ b/dbaccess/source/ui/tabledesign/TableDesignView.cxx
@@ -30,11 +30,9 @@
#include <memory>
using namespace ::dbaui;
-using namespace ::utl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::datatransfer::clipboard;
using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
OTableBorderWindow::OTableBorderWindow(OTableDesignView* pParent)
: InterimItemWindow(pParent, "dbaccess/ui/tableborderwindow.ui", "TableBorderWindow", false)
@@ -166,7 +164,7 @@ IMPL_LINK_NOARG(OTableDesignView, FieldDescFocusIn, weld::Widget&, void)
bool OTableDesignView::PreNotify( NotifyEvent& rNEvt )
{
- if (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS)
+ if (rNEvt.GetType() == NotifyEventType::GETFOCUS)
{
if( GetDescWin() && GetDescWin()->HasChildPathFocus() )
m_eChildFocus = DESCRIPTION;
diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx
index 7e6c4f111e5f..9f110d472017 100644
--- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx
+++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx
@@ -28,9 +28,9 @@ using namespace dbaui;
OTableFieldDescWin::OTableFieldDescWin(weld::Container* pParent, OTableDesignView* pView)
: OChildWindow(pParent, "dbaccess/ui/fielddescpanel.ui", "FieldDescPanel")
- , m_xHelpBar(new OTableDesignHelpBar(m_xBuilder->weld_text_view("textview")))
+ , m_aHelpBar(m_xBuilder->weld_text_view("textview"))
, m_xBox(m_xBuilder->weld_container("box"))
- , m_xFieldControl(new OTableFieldControl(m_xBox.get(), m_xHelpBar.get(), pView))
+ , m_xFieldControl(new OTableFieldControl(m_xBox.get(), &m_aHelpBar, pView))
, m_xHeader(m_xBuilder->weld_label("header"))
, m_eChildFocus(NONE)
{
@@ -39,13 +39,13 @@ OTableFieldDescWin::OTableFieldDescWin(weld::Container* pParent, OTableDesignVie
m_xFieldControl->SetHelpId(HID_TAB_DESIGN_FIELDCONTROL);
- m_xHelpBar->connect_focus_in(LINK(this, OTableFieldDescWin, HelpFocusIn));
+ m_aHelpBar.connect_focus_in(LINK(this, OTableFieldDescWin, HelpFocusIn));
m_xFieldControl->connect_focus_in(LINK(this, OTableFieldDescWin, FieldFocusIn));
}
bool OTableFieldDescWin::HasChildPathFocus() const
{
- return m_xFieldControl->HasChildPathFocus() || m_xHelpBar->HasFocus();
+ return m_xFieldControl->HasChildPathFocus() || m_aHelpBar.HasFocus();
}
OTableFieldDescWin::~OTableFieldDescWin()
@@ -81,7 +81,7 @@ IClipboardTest* OTableFieldDescWin::getActiveChild() const
pTest = m_xFieldControl.get();
break;
default:
- pTest = m_xHelpBar.get();
+ pTest = const_cast<OTableDesignHelpBar*>(&m_aHelpBar);
break;
}
return pTest;
diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx
index 9f15c1e1b90b..f14e468c561e 100644
--- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx
+++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx
@@ -21,10 +21,10 @@
#include <IClipBoardTest.hxx>
#include <ChildWindow.hxx>
#include "TableFieldControl.hxx"
+#include <TableDesignHelpBar.hxx>
namespace dbaui
{
- class OTableDesignHelpBar;
class OTableDesignView;
class OFieldDescription;
@@ -38,7 +38,7 @@ namespace dbaui
NONE
};
private:
- std::unique_ptr<OTableDesignHelpBar> m_xHelpBar;
+ OTableDesignHelpBar m_aHelpBar;
std::unique_ptr<weld::Container> m_xBox;
std::unique_ptr<OTableFieldControl> m_xFieldControl;
std::unique_ptr<weld::Label> m_xHeader;
diff --git a/dbaccess/source/ui/tabledesign/TableRow.cxx b/dbaccess/source/ui/tabledesign/TableRow.cxx
index 54c6f3b48aec..02976fb59589 100644
--- a/dbaccess/source/ui/tabledesign/TableRow.cxx
+++ b/dbaccess/source/ui/tabledesign/TableRow.cxx
@@ -23,9 +23,7 @@
#include <comphelper/types.hxx>
using namespace dbaui;
-using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
OTableRow::OTableRow()
:m_pActFieldDescr( nullptr )
@@ -130,53 +128,52 @@ namespace dbaui
_rStr.ReadInt32( _rRow.m_nPos );
sal_Int32 nValue = 0;
_rStr.ReadInt32( nValue );
- if ( nValue )
+ if ( !nValue )
+ return _rStr;
+ OFieldDescription* pFieldDesc = new OFieldDescription();
+ _rRow.m_pActFieldDescr = pFieldDesc;
+ pFieldDesc->SetName(_rStr.ReadUniOrByteString(_rStr.GetStreamCharSet()));
+ pFieldDesc->SetDescription(_rStr.ReadUniOrByteString(_rStr.GetStreamCharSet()));
+ pFieldDesc->SetHelpText(_rStr.ReadUniOrByteString(_rStr.GetStreamCharSet()));
+
+ _rStr.ReadInt32( nValue );
+ Any aControlDefault;
+ switch ( nValue )
{
- OFieldDescription* pFieldDesc = new OFieldDescription();
- _rRow.m_pActFieldDescr = pFieldDesc;
- pFieldDesc->SetName(_rStr.ReadUniOrByteString(_rStr.GetStreamCharSet()));
- pFieldDesc->SetDescription(_rStr.ReadUniOrByteString(_rStr.GetStreamCharSet()));
- pFieldDesc->SetHelpText(_rStr.ReadUniOrByteString(_rStr.GetStreamCharSet()));
-
- _rStr.ReadInt32( nValue );
- Any aControlDefault;
- switch ( nValue )
+ case 1:
{
- case 1:
- {
- double nControlDefault;
- _rStr.ReadDouble( nControlDefault );
- aControlDefault <<= nControlDefault;
- break;
- }
- case 2:
- aControlDefault <<= _rStr.ReadUniOrByteString(_rStr.GetStreamCharSet());
- break;
+ double nControlDefault;
+ _rStr.ReadDouble( nControlDefault );
+ aControlDefault <<= nControlDefault;
+ break;
}
-
- pFieldDesc->SetControlDefault(aControlDefault);
-
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetTypeValue(nValue);
-
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetPrecision(nValue);
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetScale(nValue);
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetIsNullable(nValue);
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetFormatKey(nValue);
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetHorJustify(static_cast<SvxCellHorJustify>(nValue));
-
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetAutoIncrement(nValue != 0);
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetPrimaryKey(nValue != 0);
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetCurrency(nValue != 0);
+ case 2:
+ aControlDefault <<= _rStr.ReadUniOrByteString(_rStr.GetStreamCharSet());
+ break;
}
+
+ pFieldDesc->SetControlDefault(aControlDefault);
+
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetTypeValue(nValue);
+
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetPrecision(nValue);
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetScale(nValue);
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetIsNullable(nValue);
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetFormatKey(nValue);
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetHorJustify(static_cast<SvxCellHorJustify>(nValue));
+
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetAutoIncrement(nValue != 0);
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetPrimaryKey(nValue != 0);
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetCurrency(nValue != 0);
return _rStr;
}
}
diff --git a/dbaccess/source/ui/tabledesign/TableRowExchange.cxx b/dbaccess/source/ui/tabledesign/TableRowExchange.cxx
index 916b8112f7c5..19917e7a26d1 100644
--- a/dbaccess/source/ui/tabledesign/TableRowExchange.cxx
+++ b/dbaccess/source/ui/tabledesign/TableRowExchange.cxx
@@ -26,22 +26,20 @@ namespace dbaui
{
constexpr sal_uInt32 FORMAT_OBJECT_ID_SBA_TABED = 1;
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::beans;
- OTableRowExchange::OTableRowExchange(const std::vector< std::shared_ptr<OTableRow> >& _rvTableRow)
- : m_vTableRow(_rvTableRow)
+ OTableRowExchange::OTableRowExchange(std::vector< std::shared_ptr<OTableRow> >&& _rvTableRow)
+ : m_vTableRow(std::move(_rvTableRow))
{
}
- bool OTableRowExchange::WriteObject( tools::SvRef<SotTempStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& /*rFlavor*/ )
+ bool OTableRowExchange::WriteObject( SvStream& rOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& /*rFlavor*/ )
{
if(nUserObjectId == FORMAT_OBJECT_ID_SBA_TABED)
{
std::vector< std::shared_ptr<OTableRow> >* pRows = static_cast< std::vector< std::shared_ptr<OTableRow> >* >(pUserObject);
if(pRows)
{
- (*rxOStm).WriteInt32( pRows->size() ); // first stream the size
+ rOStm.WriteInt32( pRows->size() ); // first stream the size
for (auto const& row : *pRows)
- WriteOTableRow(*rxOStm, *row);
+ WriteOTableRow(rOStm, *row);
return true;
}
}
diff --git a/dbaccess/source/ui/tabledesign/TableUndo.cxx b/dbaccess/source/ui/tabledesign/TableUndo.cxx
index 3a2ea9783879..7829a09d6959 100644
--- a/dbaccess/source/ui/tabledesign/TableUndo.cxx
+++ b/dbaccess/source/ui/tabledesign/TableUndo.cxx
@@ -25,12 +25,13 @@
#include <TableDesignView.hxx>
#include <FieldDescriptions.hxx>
#include <svx/svxids.hrc>
+#include <utility>
using namespace dbaui;
using namespace ::svt;
-OTableDesignUndoAct::OTableDesignUndoAct(OTableRowView* pOwner, const char* pCommentID)
+OTableDesignUndoAct::OTableDesignUndoAct(OTableRowView* pOwner, TranslateId pCommentID)
: OCommentUndoAction(pCommentID)
, m_pTabDgnCtrl(pOwner)
{
@@ -106,7 +107,7 @@ void OTableDesignCellUndoAct::Redo()
OTableDesignUndoAct::Redo();
}
-OTableEditorUndoAct::OTableEditorUndoAct(OTableEditorCtrl* pOwner, const char* pCommentID)
+OTableEditorUndoAct::OTableEditorUndoAct(OTableEditorCtrl* pOwner, TranslateId pCommentID)
: OTableDesignUndoAct(pOwner, pCommentID)
, pTabEdCtrl(pOwner)
{
@@ -116,11 +117,11 @@ OTableEditorUndoAct::~OTableEditorUndoAct()
{
}
-OTableEditorTypeSelUndoAct::OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, sal_Int32 nRowID, sal_uInt16 nColumn, const TOTypeInfoSP& _pOldType )
+OTableEditorTypeSelUndoAct::OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, sal_Int32 nRowID, sal_uInt16 nColumn, TOTypeInfoSP _pOldType )
:OTableEditorUndoAct( pOwner ,STR_TABED_UNDO_TYPE_CHANGED)
,m_nCol( nColumn )
,m_nRow( nRowID )
- ,m_pOldType( _pOldType )
+ ,m_pOldType(std::move( _pOldType ))
{
}
@@ -178,7 +179,7 @@ OTableEditorDelUndoAct::~OTableEditorDelUndoAct()
void OTableEditorDelUndoAct::Undo()
{
// Insert the deleted line
- sal_uLong nPos;
+ sal_Int32 nPos;
std::shared_ptr<OTableRow> pNewOrigRow;
std::vector< std::shared_ptr<OTableRow> >* pOriginalRows = pTabEdCtrl->GetRowList();
@@ -213,9 +214,9 @@ void OTableEditorDelUndoAct::Redo()
OTableEditorInsUndoAct::OTableEditorInsUndoAct( OTableEditorCtrl* pOwner,
tools::Long nInsertPosition ,
- const std::vector< std::shared_ptr<OTableRow> >& _vInsertedRows)
+ std::vector< std::shared_ptr<OTableRow> >&& _vInsertedRows)
:OTableEditorUndoAct( pOwner,STR_TABED_UNDO_ROWINSERTED )
- ,m_vInsertedRows(_vInsertedRows)
+ ,m_vInsertedRows(std::move(_vInsertedRows))
,m_nInsPos( nInsertPosition )
{
}
diff --git a/dbaccess/source/ui/tabledesign/TableUndo.hxx b/dbaccess/source/ui/tabledesign/TableUndo.hxx
index 6a0eeae16529..1863555f7556 100644
--- a/dbaccess/source/ui/tabledesign/TableUndo.hxx
+++ b/dbaccess/source/ui/tabledesign/TableUndo.hxx
@@ -39,7 +39,7 @@ namespace dbaui
virtual void Undo() override;
virtual void Redo() override;
public:
- OTableDesignUndoAct(OTableRowView* pOwner, const char* pCommentID);
+ OTableDesignUndoAct(OTableRowView* pOwner, TranslateId pCommentID);
virtual ~OTableDesignUndoAct() override;
};
@@ -50,7 +50,7 @@ namespace dbaui
VclPtr<OTableEditorCtrl> pTabEdCtrl;
public:
- OTableEditorUndoAct(OTableEditorCtrl* pOwner, const char* pCommentID);
+ OTableEditorUndoAct(OTableEditorCtrl* pOwner, TranslateId pCommentID);
virtual ~OTableEditorUndoAct() override;
};
@@ -78,7 +78,7 @@ namespace dbaui
virtual void Undo() override;
virtual void Redo() override;
public:
- OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, sal_Int32 nRowID, sal_uInt16 nColumn, const TOTypeInfoSP& _pOldType );
+ OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, sal_Int32 nRowID, sal_uInt16 nColumn, TOTypeInfoSP _pOldType );
virtual ~OTableEditorTypeSelUndoAct() override;
};
@@ -103,7 +103,7 @@ namespace dbaui
public:
OTableEditorInsUndoAct( OTableEditorCtrl* pOwner,
tools::Long nInsertPosition,
- const std::vector< std::shared_ptr<OTableRow> >& _vInsertedRows);
+ std::vector< std::shared_ptr<OTableRow> >&& _vInsertedRows);
virtual ~OTableEditorInsUndoAct() override;
};
diff --git a/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx b/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx
index 3d24cfc242a7..50d2f92723d3 100644
--- a/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx
+++ b/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx
@@ -28,7 +28,6 @@ namespace dbaui
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
namespace {
diff --git a/dbaccess/source/ui/uno/ColumnControl.cxx b/dbaccess/source/ui/uno/ColumnControl.cxx
index 51930de95119..78b0f2fee53c 100644
--- a/dbaccess/source/ui/uno/ColumnControl.cxx
+++ b/dbaccess/source/ui/uno/ColumnControl.cxx
@@ -19,7 +19,7 @@
#include "ColumnControl.hxx"
#include "ColumnPeer.hxx"
-#include <apitools.hxx>
+#include <strings.hxx>
#include <vcl/window.hxx>
#include <com/sun/star/awt/PosSize.hpp>
@@ -35,11 +35,10 @@ namespace dbaui
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::sdbc;
OColumnControl::OColumnControl(const Reference<XComponentContext>& rxContext)
- :UnoControl(), m_xContext(rxContext)
+ : m_xContext(rxContext)
{
}
@@ -47,13 +46,21 @@ OUString SAL_CALL OColumnControl::getImplementationName()
{
return SERVICE_CONTROLDEFAULT;
}
-IMPLEMENT_SERVICE_INFO_SUPPORTS(OColumnControl)
+sal_Bool SAL_CALL OColumnControl::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ }
css::uno::Sequence< OUString > SAL_CALL OColumnControl::getSupportedServiceNames()
{
return { "com.sun.star.awt.UnoControl","com.sun.star.sdb.ColumnDescriptorControl" };
}
-OUString OColumnControl::GetComponentServiceName()
+OUString OColumnControl::GetComponentServiceName() const
{
return "com.sun.star.sdb.ColumnDescriptorControl";
}
@@ -69,7 +76,7 @@ void SAL_CALL OColumnControl::createPeer(const Reference< XToolkit >& /*rToolkit
vcl::Window* pParentWin = nullptr;
if (rParentPeer.is())
{
- VCLXWindow* pParent = comphelper::getUnoTunnelImplementation<VCLXWindow>(rParentPeer);
+ VCLXWindow* pParent = dynamic_cast<VCLXWindow*>(rParentPeer.get());
if (pParent)
pParentWin = pParent->GetWindow();
}
diff --git a/dbaccess/source/ui/uno/ColumnControl.hxx b/dbaccess/source/ui/uno/ColumnControl.hxx
index 9c6054d623e2..63f06651284c 100644
--- a/dbaccess/source/ui/uno/ColumnControl.hxx
+++ b/dbaccess/source/ui/uno/ColumnControl.hxx
@@ -33,7 +33,7 @@ namespace dbaui
explicit OColumnControl(const css::uno::Reference< css::uno::XComponentContext>& rxContext);
// UnoControl
- virtual OUString GetComponentServiceName() override;
+ virtual OUString GetComponentServiceName() const override;
// XServiceInfo
DECLARE_SERVICE_INFO();
diff --git a/dbaccess/source/ui/uno/ColumnModel.cxx b/dbaccess/source/ui/uno/ColumnModel.cxx
index cadc33075c9a..de83b6176dd6 100644
--- a/dbaccess/source/ui/uno/ColumnModel.cxx
+++ b/dbaccess/source/ui/uno/ColumnModel.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <stringconstants.hxx>
+#include <strings.hxx>
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
com_sun_star_comp_dbu_OColumnControlModel_get_implementation(
@@ -104,13 +105,42 @@ css::uno::Sequence<sal_Int8> OColumnControlModel::getImplementationId()
return css::uno::Sequence<sal_Int8>();
}
-IMPLEMENT_GETTYPES2(OColumnControlModel,OColumnControlModel_BASE,comphelper::OPropertyContainer)
-IMPLEMENT_PROPERTYCONTAINER_DEFAULTS(OColumnControlModel)
+css::uno::Sequence< css::uno::Type > OColumnControlModel::getTypes()
+{
+ return ::comphelper::concatSequences(
+ OColumnControlModel_BASE::getTypes( ),
+ OPropertyContainer::getTypes( )
+ );
+}
+css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL OColumnControlModel::getPropertySetInfo()
+{
+ Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+}
+::cppu::IPropertyArrayHelper& OColumnControlModel::getInfoHelper()
+{
+ return *OColumnControlModel::getArrayHelper();
+}
+::cppu::IPropertyArrayHelper* OColumnControlModel::createArrayHelper( ) const
+{
+ css::uno::Sequence< css::beans::Property > aProps;
+ describeProperties(aProps);
+ return new ::cppu::OPropertyArrayHelper(aProps);
+}
+
OUString SAL_CALL OColumnControlModel::getImplementationName()
{
return "com.sun.star.comp.dbu.OColumnControlModel";
}
-IMPLEMENT_SERVICE_INFO_SUPPORTS(OColumnControlModel)
+sal_Bool SAL_CALL OColumnControlModel::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ }
css::uno::Sequence< OUString > SAL_CALL OColumnControlModel::getSupportedServiceNames()
{
return { "com.sun.star.awt.UnoControlModel","com.sun.star.sdb.ColumnDescriptorControlModel" };
diff --git a/dbaccess/source/ui/uno/ColumnModel.hxx b/dbaccess/source/ui/uno/ColumnModel.hxx
index 2b492f61372d..400d03652d1a 100644
--- a/dbaccess/source/ui/uno/ColumnModel.hxx
+++ b/dbaccess/source/ui/uno/ColumnModel.hxx
@@ -29,7 +29,6 @@
#include <comphelper/uno3.hxx>
#include <cppuhelper/compbase4.hxx>
#include <connectivity/CommonTools.hxx>
-#include <apitools.hxx>
namespace dbaui
{
@@ -85,7 +84,10 @@ public:
virtual void SAL_CALL read(const css::uno::Reference< css::io::XObjectInputStream>& _rxInStream) override;
// OPropertyArrayUsageHelper
- DECLARE_PROPERTYCONTAINER_DEFAULTS( );
+ virtual css::uno::Reference< css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override;
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
+
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override;
};
diff --git a/dbaccess/source/ui/uno/ColumnPeer.cxx b/dbaccess/source/ui/uno/ColumnPeer.cxx
index 48f5fbce5692..34c4a23da647 100644
--- a/dbaccess/source/ui/uno/ColumnPeer.cxx
+++ b/dbaccess/source/ui/uno/ColumnPeer.cxx
@@ -25,10 +25,8 @@
namespace dbaui
{
-using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::sdbc;
OColumnPeer::OColumnPeer(vcl::Window* _pParent,const Reference<XComponentContext>& _rxContext)
diff --git a/dbaccess/source/ui/uno/DBTypeWizDlg.cxx b/dbaccess/source/ui/uno/DBTypeWizDlg.cxx
index 8c9d16596386..c7fbb5e1614d 100644
--- a/dbaccess/source/ui/uno/DBTypeWizDlg.cxx
+++ b/dbaccess/source/ui/uno/DBTypeWizDlg.cxx
@@ -34,7 +34,6 @@ namespace dbaui
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
ODBTypeWizDialog::ODBTypeWizDialog(const Reference< XComponentContext >& _rxORB)
diff --git a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx
index 63c3d6304b0d..4942f2bcb89c 100644
--- a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx
+++ b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx
@@ -36,9 +36,7 @@ namespace dbaui
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::sdbc;
ODBTypeWizDialogSetup::ODBTypeWizDialogSetup(const Reference< XComponentContext >& _rxORB)
:ODatabaseAdministrationDialog(_rxORB)
diff --git a/dbaccess/source/ui/uno/TableFilterDlg.cxx b/dbaccess/source/ui/uno/TableFilterDlg.cxx
index cd01f2587370..01f9f9d0d7ba 100644
--- a/dbaccess/source/ui/uno/TableFilterDlg.cxx
+++ b/dbaccess/source/ui/uno/TableFilterDlg.cxx
@@ -34,7 +34,6 @@ namespace dbaui
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
OTableFilterDialog::OTableFilterDialog(const Reference< XComponentContext >& _rxORB)
diff --git a/dbaccess/source/ui/uno/UserSettingsDlg.cxx b/dbaccess/source/ui/uno/UserSettingsDlg.cxx
index 7039c7396d86..64903bedc812 100644
--- a/dbaccess/source/ui/uno/UserSettingsDlg.cxx
+++ b/dbaccess/source/ui/uno/UserSettingsDlg.cxx
@@ -34,7 +34,6 @@ namespace dbaui
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
OUserSettingsDialog::OUserSettingsDialog(const Reference< XComponentContext >& _rxORB)
diff --git a/dbaccess/source/ui/uno/admindlg.cxx b/dbaccess/source/ui/uno/admindlg.cxx
index 3e524372eea5..d27eb12901f6 100644
--- a/dbaccess/source/ui/uno/admindlg.cxx
+++ b/dbaccess/source/ui/uno/admindlg.cxx
@@ -33,7 +33,6 @@ org_openoffice_comp_dbu_ODatasourceAdministrationDialog_get_implementation(
namespace dbaui
{
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
ODataSourcePropertyDialog::ODataSourcePropertyDialog(const Reference<XComponentContext>& _rxORB)
diff --git a/dbaccess/source/ui/uno/composerdialogs.cxx b/dbaccess/source/ui/uno/composerdialogs.cxx
index 650f1fe26932..9551f96f78b2 100644
--- a/dbaccess/source/ui/uno/composerdialogs.cxx
+++ b/dbaccess/source/ui/uno/composerdialogs.cxx
@@ -24,8 +24,9 @@
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <queryfilter.hxx>
#include <queryorder.hxx>
+#include <strings.hxx>
#include <connectivity/dbtools.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <vcl/svapp.hxx>
@@ -48,11 +49,10 @@ namespace dbaui
#define PROPERTY_ID_QUERYCOMPOSER 100
#define PROPERTY_ID_ROWSET 101
-#define PROPERTY_QUERYCOMPOSER "QueryComposer"
-#define PROPERTY_ROWSET "RowSet"
+constexpr OUStringLiteral PROPERTY_QUERYCOMPOSER = u"QueryComposer";
+constexpr OUStringLiteral PROPERTY_ROWSET = u"RowSet";
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::sdbcx;
@@ -80,7 +80,21 @@ namespace dbaui
return css::uno::Sequence<sal_Int8>();
}
- IMPLEMENT_PROPERTYCONTAINER_DEFAULTS( ComposerDialog )
+ css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL ComposerDialog::getPropertySetInfo()
+ {
+ Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+ }
+ ::cppu::IPropertyArrayHelper& ComposerDialog::getInfoHelper()
+ {
+ return *ComposerDialog::getArrayHelper();
+ }
+ ::cppu::IPropertyArrayHelper* ComposerDialog::createArrayHelper( ) const
+ {
+ css::uno::Sequence< css::beans::Property > aProps;
+ describeProperties(aProps);
+ return new ::cppu::OPropertyArrayHelper(aProps);
+ }
std::unique_ptr<weld::DialogController> ComposerDialog::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
{
@@ -141,7 +155,15 @@ namespace dbaui
{
return "com.sun.star.uno.comp.sdb.RowsetFilterDialog";
}
- IMPLEMENT_SERVICE_INFO_SUPPORTS(RowsetFilterDialog)
+ sal_Bool SAL_CALL RowsetFilterDialog::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ }
css::uno::Sequence< OUString > SAL_CALL RowsetFilterDialog::getSupportedServiceNames()
{
return { "com.sun.star.sdb.FilterDialog" };
@@ -163,9 +185,9 @@ namespace dbaui
aArguments[1] >>= xRowSet;
Reference<css::awt::XWindow> xParentWindow;
aArguments[2] >>= xParentWindow;
- setPropertyValue( "QueryComposer", makeAny( xQueryComposer ) );
- setPropertyValue( "RowSet", makeAny( xRowSet ) );
- setPropertyValue( "ParentWindow", makeAny( xParentWindow ) );
+ setPropertyValue( "QueryComposer", Any( xQueryComposer ) );
+ setPropertyValue( "RowSet", Any( xRowSet ) );
+ setPropertyValue( "ParentWindow", Any( xParentWindow ) );
}
else
ComposerDialog::initialize(aArguments);
@@ -189,7 +211,15 @@ namespace dbaui
{
return "com.sun.star.uno.comp.sdb.RowsetOrderDialog";
}
- IMPLEMENT_SERVICE_INFO_SUPPORTS(RowsetOrderDialog)
+ sal_Bool SAL_CALL RowsetOrderDialog::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ }
css::uno::Sequence< OUString > SAL_CALL RowsetOrderDialog::getSupportedServiceNames()
{
return { "com.sun.star.sdb.OrderDialog" };
@@ -208,13 +238,13 @@ namespace dbaui
aArguments[0] >>= xQueryComposer;
Reference<css::beans::XPropertySet> xRowSet;
aArguments[1] >>= xRowSet;
- setPropertyValue( "QueryComposer", makeAny( xQueryComposer ) );
- setPropertyValue( "RowSet", makeAny( xRowSet ) );
+ setPropertyValue( "QueryComposer", Any( xQueryComposer ) );
+ setPropertyValue( "RowSet", Any( xRowSet ) );
if (aArguments.getLength() == 3)
{
Reference<css::awt::XWindow> xParentWindow;
aArguments[2] >>= xParentWindow;
- setPropertyValue("ParentWindow", makeAny(xParentWindow));
+ setPropertyValue("ParentWindow", Any(xParentWindow));
}
}
else
diff --git a/dbaccess/source/ui/uno/composerdialogs.hxx b/dbaccess/source/ui/uno/composerdialogs.hxx
index bc1468a034b1..4e71b1c64704 100644
--- a/dbaccess/source/ui/uno/composerdialogs.hxx
+++ b/dbaccess/source/ui/uno/composerdialogs.hxx
@@ -27,7 +27,6 @@
#include <comphelper/proparrhlp.hxx>
#include <connectivity/CommonTools.hxx>
#include <svtools/genericunodialog.hxx>
-#include <apitools.hxx>
namespace dbaui
{
@@ -55,7 +54,9 @@ namespace dbaui
public:
virtual css::uno::Sequence<sal_Int8> SAL_CALL getImplementationId() override;
- DECLARE_PROPERTYCONTAINER_DEFAULTS( );
+ virtual css::uno::Reference< css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override;
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
protected:
// own overridables
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx
index 12e3575dbafd..880600342dea 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -59,12 +59,13 @@
#include <connectivity/dbtools.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/implbase.hxx>
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/interfacecontainer3.hxx>
+#include <o3tl/safeint.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
#include <svtools/genericunodialog.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <unotools/sharedunocomponent.hxx>
#include <vcl/svapp.hxx>
@@ -79,7 +80,6 @@ namespace dbaui
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::Any;
- using ::com::sun::star::uno::makeAny;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::XComponentContext;
using ::com::sun::star::beans::XPropertySetInfo;
@@ -338,7 +338,7 @@ private:
// other
Reference< XInteractionHandler > m_xInteractionHandler;
- ::comphelper::OInterfaceContainerHelper2
+ ::comphelper::OInterfaceContainerHelper3<XCopyTableListener>
m_aCopyTableListeners;
sal_Int16 m_nOverrideExecutionResult;
};
@@ -370,16 +370,10 @@ CopyTableWizard::CopyTableWizard( const Reference< XComponentContext >& _rxORB )
:CopyTableWizard_Base( _rxORB )
,m_xContext( _rxORB )
,m_nOperation( CopyTableOperation::CopyDefinitionAndData )
- ,m_sDestinationTable()
,m_aPrimaryKeyName( false, "ID" )
,m_bUseHeaderLineAsColumnNames( true )
- ,m_xSourceConnection()
,m_nCommandType( CommandType::COMMAND )
- ,m_pSourceObject()
- ,m_xSourceResultSet()
- ,m_aSourceSelection()
,m_bSourceSelectionBookmarks( true )
- ,m_xDestConnection()
,m_aCopyTableListeners( m_aMutex )
,m_nOverrideExecutionResult( -1 )
{
@@ -578,8 +572,7 @@ namespace
// see whether the document model can provide a handler
if ( xDocumentModel.is() )
{
- ::comphelper::NamedValueCollection aModelArgs( xDocumentModel->getArgs() );
- xHandler = aModelArgs.getOrDefault( "InteractionHandler", xHandler );
+ xHandler = ::comphelper::NamedValueCollection::getOrDefault( xDocumentModel->getArgs(), u"InteractionHandler", xHandler );
}
return xHandler;
@@ -666,7 +659,7 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X
OUString sUnsupportedSetting;
const OUString aSettings[] = {
- OUString(PROPERTY_FILTER), OUString(PROPERTY_ORDER), OUString(PROPERTY_HAVING_CLAUSE), OUString(PROPERTY_GROUP_BY)
+ PROPERTY_FILTER, PROPERTY_ORDER, PROPERTY_HAVING_CLAUSE, PROPERTY_GROUP_BY
};
for (const auto & aSetting : aSettings)
{
@@ -805,79 +798,79 @@ SharedConnection CopyTableWizard::impl_extractConnection_throw( const Reference<
do
{
- Reference< XPropertySetInfo > xPSI( _rxDataSourceDescriptor->getPropertySetInfo(), UNO_SET_THROW );
+ Reference< XPropertySetInfo > xPSI( _rxDataSourceDescriptor->getPropertySetInfo(), UNO_SET_THROW );
- // if there's an ActiveConnection, use it
- if ( xPSI->hasPropertyByName( PROPERTY_ACTIVE_CONNECTION ) )
- {
- Reference< XConnection > xPure;
- OSL_VERIFY( _rxDataSourceDescriptor->getPropertyValue( PROPERTY_ACTIVE_CONNECTION ) >>= xPure );
- xConnection.reset( xPure, SharedConnection::NoTakeOwnership );
- }
- if ( xConnection.is() )
- {
- xInteractionHandler = lcl_getInteractionHandler_throw( xConnection.getTyped(), m_xInteractionHandler );
- SAL_WARN_IF( !xInteractionHandler.is(), "dbaccess.ui", "CopyTableWizard::impl_extractConnection_throw: lcl_getInteractionHandler_throw returned nonsense!" );
- break;
- }
-
- // there could be a DataSourceName or a DatabaseLocation, describing the css.sdb.DataSource
- OUString sDataSource, sDatabaseLocation;
- if ( xPSI->hasPropertyByName( PROPERTY_DATASOURCENAME ) )
- OSL_VERIFY( _rxDataSourceDescriptor->getPropertyValue( PROPERTY_DATASOURCENAME ) >>= sDataSource );
- if ( xPSI->hasPropertyByName( PROPERTY_DATABASE_LOCATION ) )
- OSL_VERIFY( _rxDataSourceDescriptor->getPropertyValue( PROPERTY_DATABASE_LOCATION ) >>= sDatabaseLocation );
-
- // need a DatabaseContext for loading the data source
- Reference< XDatabaseContext > xDatabaseContext = DatabaseContext::create( m_xContext );
- Reference< XDataSource > xDataSource;
- if ( !sDataSource.isEmpty() )
- xDataSource.set( xDatabaseContext->getByName( sDataSource ), UNO_QUERY_THROW );
- if ( !xDataSource.is() && !sDatabaseLocation.isEmpty() )
- xDataSource.set( xDatabaseContext->getByName( sDatabaseLocation ), UNO_QUERY_THROW );
-
- if ( xDataSource.is() )
- {
- // first, try connecting with completion
- xInteractionHandler = lcl_getInteractionHandler_throw( xDataSource, m_xInteractionHandler );
- SAL_WARN_IF( !xInteractionHandler.is(), "dbaccess.ui", "CopyTableWizard::impl_extractConnection_throw: lcl_getInteractionHandler_throw returned nonsense!" );
- if ( xInteractionHandler.is() )
+ // if there's an ActiveConnection, use it
+ if ( xPSI->hasPropertyByName( PROPERTY_ACTIVE_CONNECTION ) )
+ {
+ Reference< XConnection > xPure;
+ OSL_VERIFY( _rxDataSourceDescriptor->getPropertyValue( PROPERTY_ACTIVE_CONNECTION ) >>= xPure );
+ xConnection.reset( xPure, SharedConnection::NoTakeOwnership );
+ }
+ if ( xConnection.is() )
{
- Reference< XCompletedConnection > xInteractiveConnection( xDataSource, UNO_QUERY );
- if ( xInteractiveConnection.is() )
- xConnection.reset( xInteractiveConnection->connectWithCompletion( xInteractionHandler ), SharedConnection::TakeOwnership );
+ xInteractionHandler = lcl_getInteractionHandler_throw( xConnection.getTyped(), m_xInteractionHandler );
+ SAL_WARN_IF( !xInteractionHandler.is(), "dbaccess.ui", "CopyTableWizard::impl_extractConnection_throw: lcl_getInteractionHandler_throw returned nonsense!" );
+ break;
}
- // interactively connecting was not successful or possible -> connect without interaction
- if ( !xConnection.is() )
+ // there could be a DataSourceName or a DatabaseLocation, describing the css.sdb.DataSource
+ OUString sDataSource, sDatabaseLocation;
+ if ( xPSI->hasPropertyByName( PROPERTY_DATASOURCENAME ) )
+ OSL_VERIFY( _rxDataSourceDescriptor->getPropertyValue( PROPERTY_DATASOURCENAME ) >>= sDataSource );
+ if ( xPSI->hasPropertyByName( PROPERTY_DATABASE_LOCATION ) )
+ OSL_VERIFY( _rxDataSourceDescriptor->getPropertyValue( PROPERTY_DATABASE_LOCATION ) >>= sDatabaseLocation );
+
+ // need a DatabaseContext for loading the data source
+ Reference< XDatabaseContext > xDatabaseContext = DatabaseContext::create( m_xContext );
+ Reference< XDataSource > xDataSource;
+ if ( !sDataSource.isEmpty() )
+ xDataSource.set( xDatabaseContext->getByName( sDataSource ), UNO_QUERY_THROW );
+ if ( !xDataSource.is() && !sDatabaseLocation.isEmpty() )
+ xDataSource.set( xDatabaseContext->getByName( sDatabaseLocation ), UNO_QUERY_THROW );
+
+ if ( xDataSource.is() )
{
- xConnection.reset( xDataSource->getConnection( OUString(), OUString() ), SharedConnection::TakeOwnership );
+ // first, try connecting with completion
+ xInteractionHandler = lcl_getInteractionHandler_throw( xDataSource, m_xInteractionHandler );
+ SAL_WARN_IF( !xInteractionHandler.is(), "dbaccess.ui", "CopyTableWizard::impl_extractConnection_throw: lcl_getInteractionHandler_throw returned nonsense!" );
+ if ( xInteractionHandler.is() )
+ {
+ Reference< XCompletedConnection > xInteractiveConnection( xDataSource, UNO_QUERY );
+ if ( xInteractiveConnection.is() )
+ xConnection.reset( xInteractiveConnection->connectWithCompletion( xInteractionHandler ), SharedConnection::TakeOwnership );
+ }
+
+ // interactively connecting was not successful or possible -> connect without interaction
+ if ( !xConnection.is() )
+ {
+ xConnection.reset( xDataSource->getConnection( OUString(), OUString() ), SharedConnection::TakeOwnership );
+ }
}
- }
- if ( xConnection.is() )
- break;
+ if ( xConnection.is() )
+ break;
- // finally, there could be a ConnectionResource/ConnectionInfo
- OUString sConnectionResource;
- Sequence< PropertyValue > aConnectionInfo;
- if ( xPSI->hasPropertyByName( PROPERTY_CONNECTION_RESOURCE ) )
- OSL_VERIFY( _rxDataSourceDescriptor->getPropertyValue( PROPERTY_CONNECTION_RESOURCE ) >>= sConnectionResource );
- if ( xPSI->hasPropertyByName( PROPERTY_CONNECTION_INFO ) )
- OSL_VERIFY( _rxDataSourceDescriptor->getPropertyValue( PROPERTY_CONNECTION_INFO ) >>= aConnectionInfo );
-
- Reference< XDriverManager > xDriverManager;
- try {
- xDriverManager.set( ConnectionPool::create( m_xContext ), UNO_QUERY_THROW );
- } catch( const Exception& ) { }
- if ( !xDriverManager.is() )
- // no connection pool installed
- xDriverManager.set( DriverManager::create( m_xContext ), UNO_QUERY_THROW );
-
- if ( aConnectionInfo.hasElements() )
- xConnection.set( xDriverManager->getConnectionWithInfo( sConnectionResource, aConnectionInfo ), UNO_SET_THROW );
- else
- xConnection.set( xDriverManager->getConnection( sConnectionResource ), UNO_SET_THROW );
+ // finally, there could be a ConnectionResource/ConnectionInfo
+ OUString sConnectionResource;
+ Sequence< PropertyValue > aConnectionInfo;
+ if ( xPSI->hasPropertyByName( PROPERTY_CONNECTION_RESOURCE ) )
+ OSL_VERIFY( _rxDataSourceDescriptor->getPropertyValue( PROPERTY_CONNECTION_RESOURCE ) >>= sConnectionResource );
+ if ( xPSI->hasPropertyByName( PROPERTY_CONNECTION_INFO ) )
+ OSL_VERIFY( _rxDataSourceDescriptor->getPropertyValue( PROPERTY_CONNECTION_INFO ) >>= aConnectionInfo );
+
+ Reference< XDriverManager > xDriverManager;
+ try {
+ xDriverManager.set( ConnectionPool::create( m_xContext ), UNO_QUERY_THROW );
+ } catch( const Exception& ) { }
+ if ( !xDriverManager.is() )
+ // no connection pool installed
+ xDriverManager.set( DriverManager::create( m_xContext ), UNO_QUERY_THROW );
+
+ if ( aConnectionInfo.hasElements() )
+ xConnection.set( xDriverManager->getConnectionWithInfo( sConnectionResource, aConnectionInfo ), UNO_SET_THROW );
+ else
+ xConnection.set( xDriverManager->getConnection( sConnectionResource ), UNO_SET_THROW );
}
while ( false );
@@ -948,40 +941,39 @@ namespace
class ValueTransfer
{
public:
- ValueTransfer( const sal_Int32& _rSourcePos, const sal_Int32& _rDestPos, const std::vector< sal_Int32 >& _rColTypes,
+ ValueTransfer( std::vector< sal_Int32 > _rColTypes,
const Reference< XRow >& _rxSource, const Reference< XParameters >& _rxDest )
- :m_rSourcePos( _rSourcePos )
- ,m_rDestPos( _rDestPos )
- ,m_rColTypes( _rColTypes )
+ :m_ColTypes( std::move(_rColTypes) )
,m_xSource( _rxSource )
,m_xDest( _rxDest )
{
}
template< typename VALUE_TYPE >
- void transferValue( VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( sal_Int32 ),
+ void transferValue( sal_Int32 _nSourcePos, sal_Int32 _nDestPos,
+ VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( sal_Int32 ),
void (SAL_CALL XParameters::*_pSetter)( sal_Int32, VALUE_TYPE ) )
{
- VALUE_TYPE value( (m_xSource.get()->*_pGetter)( m_rSourcePos ) );
+ VALUE_TYPE value( (m_xSource.get()->*_pGetter)( _nSourcePos ) );
if ( m_xSource->wasNull() )
- m_xDest->setNull( m_rDestPos, m_rColTypes[ m_rSourcePos ] );
+ m_xDest->setNull( _nDestPos, m_ColTypes[ _nSourcePos ] );
else
- (m_xDest.get()->*_pSetter)( m_rDestPos, value );
+ (m_xDest.get()->*_pSetter)( _nDestPos, value );
}
- template< typename VALUE_TYPE >
- void transferComplexValue( VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( sal_Int32 ),
+
+ template< typename VALUE_TYPE >
+ void transferComplexValue( sal_Int32 _nSourcePos, sal_Int32 _nDestPos,
+ VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( sal_Int32 ),
void (SAL_CALL XParameters::*_pSetter)( sal_Int32, const VALUE_TYPE& ) )
{
- const VALUE_TYPE value( (m_xSource.get()->*_pGetter)( m_rSourcePos ) );
+ const VALUE_TYPE value( (m_xSource.get()->*_pGetter)( _nSourcePos ) );
if ( m_xSource->wasNull() )
- m_xDest->setNull( m_rDestPos, m_rColTypes[ m_rSourcePos ] );
+ m_xDest->setNull( _nDestPos, m_ColTypes[ _nSourcePos ] );
else
- (m_xDest.get()->*_pSetter)( m_rDestPos, value );
+ (m_xDest.get()->*_pSetter)( _nDestPos, value );
}
private:
- const sal_Int32& m_rSourcePos;
- const sal_Int32& m_rDestPos;
- const std::vector< sal_Int32 > m_rColTypes;
+ const std::vector< sal_Int32 > m_ColTypes;
const Reference< XRow > m_xSource;
const Reference< XParameters > m_xDest;
};
@@ -989,13 +981,12 @@ namespace
bool CopyTableWizard::impl_processCopyError_nothrow( const CopyTableRowEvent& _rEvent )
{
- Reference< XCopyTableListener > xListener;
try
{
- ::comphelper::OInterfaceIteratorHelper2 aIter( m_aCopyTableListeners );
+ ::comphelper::OInterfaceIteratorHelper3 aIter( m_aCopyTableListeners );
while ( aIter.hasMoreElements() )
{
- xListener.set( aIter.next(), UNO_QUERY_THROW );
+ Reference< XCopyTableListener > xListener( aIter.next() );
sal_Int16 nListenerChoice = xListener->copyRowError( _rEvent );
switch ( nListenerChoice )
{
@@ -1020,26 +1011,22 @@ bool CopyTableWizard::impl_processCopyError_nothrow( const CopyTableRowEvent& _r
try
{
- SQLContext aError;
- aError.Context = *this;
- aError.Message = DBA_RES(STR_ERROR_OCCURRED_WHILE_COPYING);
-
+ css::uno::Any next;
::dbtools::SQLExceptionInfo aInfo( _rEvent.Error );
if ( aInfo.isValid() )
- aError.NextException = _rEvent.Error;
+ next = _rEvent.Error;
else
{
// a non-SQL exception happened
Exception aException;
OSL_VERIFY( _rEvent.Error >>= aException );
- SQLContext aContext;
- aContext.Context = aException.Context;
- aContext.Message = aException.Message;
- aContext.Details = _rEvent.Error.getValueTypeName();
- aError.NextException <<= aContext;
+ SQLContext aContext(aException.Message, aException.Context, {}, 0, {},
+ _rEvent.Error.getValueTypeName());
+ next <<= aContext;
}
+ SQLContext aError(DBA_RES(STR_ERROR_OCCURRED_WHILE_COPYING), *this, {}, 0, next, {});
- ::rtl::Reference< ::comphelper::OInteractionRequest > xRequest( new ::comphelper::OInteractionRequest( makeAny( aError ) ) );
+ ::rtl::Reference< ::comphelper::OInteractionRequest > xRequest( new ::comphelper::OInteractionRequest( Any( aError ) ) );
::rtl::Reference< ::comphelper::OInteractionApprove > xYes = new ::comphelper::OInteractionApprove;
xRequest->addContinuation( xYes );
@@ -1074,6 +1061,7 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
const OCopyTableWizard& rWizard = impl_getDialog_throw();
ODatabaseExport::TPositions aColumnPositions = rWizard.GetColumnPositions();
+ const bool bShouldCreatePrimaryKey = rWizard.shouldCreatePrimaryKey();
Reference< XRow > xRow ( _rxSourceResultSet, UNO_QUERY_THROW );
Reference< XRowLocate > xRowLocate ( _rxSourceResultSet, UNO_QUERY_THROW );
@@ -1098,7 +1086,7 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
}
// now create, fill and execute the prepared statement
- Reference< XPreparedStatement > xStatement( ODatabaseExport::createPreparedStatment( xDestMetaData, _rxDestTable, aColumnPositions ), UNO_SET_THROW );
+ Reference< XPreparedStatement > xStatement( ODatabaseExport::createPreparedStatement( xDestMetaData, _rxDestTable, aColumnPositions ), UNO_SET_THROW );
Reference< XParameters > xStatementParams( xStatement, UNO_QUERY_THROW );
const bool bSelectedRecordsOnly = m_aSourceSelection.hasElements();
@@ -1145,16 +1133,16 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
aCopyEvent.Error.clear();
try
{
+ bool bInsertedPrimaryKey = false;
// notify listeners
m_aCopyTableListeners.notifyEach( &XCopyTableListener::copyingRow, aCopyEvent );
- sal_Int32 nDestColumn( 0 );
sal_Int32 nSourceColumn( 1 );
- ValueTransfer aTransfer( nSourceColumn, nDestColumn, aSourceColTypes, xRow, xStatementParams );
+ ValueTransfer aTransfer( aSourceColTypes, xRow, xStatementParams );
for ( auto const& rColumnPos : aColumnPositions )
{
- nDestColumn = rColumnPos.first;
+ sal_Int32 nDestColumn = rColumnPos.first;
if ( nDestColumn == COLUMN_POSITION_NOT_FOUND )
{
++nSourceColumn;
@@ -1162,7 +1150,15 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
continue;
}
- if ( ( nSourceColumn < 1 ) || ( nSourceColumn >= static_cast<sal_Int32>(aSourceColTypes.size()) ) )
+ if ( bShouldCreatePrimaryKey && !bInsertedPrimaryKey )
+ {
+ xStatementParams->setInt( 1, nRowCount );
+ ++nSourceColumn;
+ bInsertedPrimaryKey = true;
+ continue;
+ }
+
+ if ( ( nSourceColumn < 1 ) || ( o3tl::make_unsigned(nSourceColumn) >= aSourceColTypes.size() ) )
{ // ( we have to check here against 1 because the parameters are 1 based)
::dbtools::throwSQLException("Internal error: invalid column type index.",
::dbtools::StandardSQLState::INVALID_DESCRIPTOR_INDEX, *this);
@@ -1172,7 +1168,7 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
{
case DataType::DOUBLE:
case DataType::REAL:
- aTransfer.transferValue( &XRow::getDouble, &XParameters::setDouble );
+ aTransfer.transferValue( nSourceColumn, nDestColumn, &XRow::getDouble, &XParameters::setDouble );
break;
case DataType::CHAR:
@@ -1180,64 +1176,64 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
case DataType::LONGVARCHAR:
case DataType::DECIMAL:
case DataType::NUMERIC:
- aTransfer.transferComplexValue( &XRow::getString, &XParameters::setString );
+ aTransfer.transferComplexValue( nSourceColumn, nDestColumn, &XRow::getString, &XParameters::setString );
break;
case DataType::BIGINT:
- aTransfer.transferValue( &XRow::getLong, &XParameters::setLong );
+ aTransfer.transferValue( nSourceColumn, nDestColumn, &XRow::getLong, &XParameters::setLong );
break;
case DataType::FLOAT:
- aTransfer.transferValue( &XRow::getFloat, &XParameters::setFloat );
+ aTransfer.transferValue( nSourceColumn, nDestColumn, &XRow::getFloat, &XParameters::setFloat );
break;
case DataType::LONGVARBINARY:
case DataType::BINARY:
case DataType::VARBINARY:
- aTransfer.transferComplexValue( &XRow::getBytes, &XParameters::setBytes );
+ aTransfer.transferComplexValue( nSourceColumn, nDestColumn, &XRow::getBytes, &XParameters::setBytes );
break;
case DataType::DATE:
- aTransfer.transferComplexValue( &XRow::getDate, &XParameters::setDate );
+ aTransfer.transferComplexValue( nSourceColumn, nDestColumn, &XRow::getDate, &XParameters::setDate );
break;
case DataType::TIME:
- aTransfer.transferComplexValue( &XRow::getTime, &XParameters::setTime );
+ aTransfer.transferComplexValue( nSourceColumn, nDestColumn, &XRow::getTime, &XParameters::setTime );
break;
case DataType::TIMESTAMP:
- aTransfer.transferComplexValue( &XRow::getTimestamp, &XParameters::setTimestamp );
+ aTransfer.transferComplexValue( nSourceColumn, nDestColumn, &XRow::getTimestamp, &XParameters::setTimestamp );
break;
case DataType::BIT:
if ( aSourcePrec[nSourceColumn] > 1 )
{
- aTransfer.transferComplexValue( &XRow::getBytes, &XParameters::setBytes );
+ aTransfer.transferComplexValue( nSourceColumn, nDestColumn, &XRow::getBytes, &XParameters::setBytes );
break;
}
[[fallthrough]];
case DataType::BOOLEAN:
- aTransfer.transferValue( &XRow::getBoolean, &XParameters::setBoolean );
+ aTransfer.transferValue( nSourceColumn, nDestColumn, &XRow::getBoolean, &XParameters::setBoolean );
break;
case DataType::TINYINT:
- aTransfer.transferValue( &XRow::getByte, &XParameters::setByte );
+ aTransfer.transferValue( nSourceColumn, nDestColumn, &XRow::getByte, &XParameters::setByte );
break;
case DataType::SMALLINT:
- aTransfer.transferValue( &XRow::getShort, &XParameters::setShort );
+ aTransfer.transferValue( nSourceColumn, nDestColumn, &XRow::getShort, &XParameters::setShort );
break;
case DataType::INTEGER:
- aTransfer.transferValue( &XRow::getInt, &XParameters::setInt );
+ aTransfer.transferValue( nSourceColumn, nDestColumn, &XRow::getInt, &XParameters::setInt );
break;
case DataType::BLOB:
- aTransfer.transferComplexValue( &XRow::getBlob, &XParameters::setBlob );
+ aTransfer.transferComplexValue( nSourceColumn, nDestColumn, &XRow::getBlob, &XParameters::setBlob );
break;
case DataType::CLOB:
- aTransfer.transferComplexValue( &XRow::getClob, &XParameters::setClob );
+ aTransfer.transferComplexValue( nSourceColumn, nDestColumn, &XRow::getClob, &XParameters::setClob );
break;
default:
@@ -1263,6 +1259,7 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
}
catch( const Exception& )
{
+ TOOLS_WARN_EXCEPTION("dbaccess", "");
aCopyEvent.Error = ::cppu::getCaughtException();
}
@@ -1357,42 +1354,48 @@ void CopyTableWizard::impl_doCopy_nothrow()
// tdf#119962
const Reference< XDatabaseMetaData > xDestMetaData( m_xDestConnection->getMetaData(), UNO_SET_THROW );
- const OUString sComposedTableName = ::dbtools::composeTableName( xDestMetaData, xTable, ::dbtools::EComposeRule::InDataManipulation, true );
+ OUString sDatabaseDest = xDestMetaData->getDatabaseProductName().toAsciiLowerCase();
+ // If we created a new primary key, then it won't necessarily be an IDENTITY column
+ const bool bShouldCreatePrimaryKey = rWizard.shouldCreatePrimaryKey();
+ if ( !bShouldCreatePrimaryKey && (sDatabaseDest.indexOf("firebird") != -1) )
+ {
+ const OUString sComposedTableName = ::dbtools::composeTableName( xDestMetaData, xTable, ::dbtools::EComposeRule::InDataManipulation, true );
- OUString aSchema,aTable;
- xTable->getPropertyValue("SchemaName") >>= aSchema;
- xTable->getPropertyValue("Name") >>= aTable;
- Any aCatalog = xTable->getPropertyValue("CatalogName");
+ OUString aSchema,aTable;
+ xTable->getPropertyValue("SchemaName") >>= aSchema;
+ xTable->getPropertyValue("Name") >>= aTable;
+ Any aCatalog = xTable->getPropertyValue("CatalogName");
- const Reference< XResultSet > xResultPKCL(xDestMetaData->getPrimaryKeys(aCatalog,aSchema,aTable));
- Reference< XRow > xRowPKCL(xResultPKCL, UNO_QUERY_THROW);
- OUString sPKCL;
- if ( xRowPKCL.is() )
- {
- if (xResultPKCL->next())
+ const Reference< XResultSet > xResultPKCL(xDestMetaData->getPrimaryKeys(aCatalog,aSchema,aTable));
+ Reference< XRow > xRowPKCL(xResultPKCL, UNO_QUERY_THROW);
+ OUString sPKCL;
+ if ( xRowPKCL.is() )
{
- sPKCL = xRowPKCL->getString(4);
+ if (xResultPKCL->next())
+ {
+ sPKCL = xRowPKCL->getString(4);
+ }
}
- }
- if (!sPKCL.isEmpty())
- {
- OUString strSql = "SELECT MAX(\"" + sPKCL + "\") FROM " + sComposedTableName;
+ if (!sPKCL.isEmpty())
+ {
+ OUString strSql = "SELECT MAX(\"" + sPKCL + "\") FROM " + sComposedTableName;
- Reference< XResultSet > xResultMAXNUM(m_xDestConnection->createStatement()->executeQuery(strSql));
- Reference< XRow > xRow(xResultMAXNUM, UNO_QUERY_THROW);
+ Reference< XResultSet > xResultMAXNUM(m_xDestConnection->createStatement()->executeQuery(strSql));
+ Reference< XRow > xRow(xResultMAXNUM, UNO_QUERY_THROW);
- sal_Int64 maxVal = -1L;
- if (xResultMAXNUM->next())
- {
- maxVal = xRow->getLong(1);
- }
+ sal_Int64 maxVal = -1L;
+ if (xResultMAXNUM->next())
+ {
+ maxVal = xRow->getLong(1);
+ }
- if (maxVal > 0L)
- {
- strSql = "ALTER TABLE " + sComposedTableName + " ALTER \"" + sPKCL + "\" RESTART WITH " + OUString::number(maxVal + 1);
+ if (maxVal > 0L)
+ {
+ strSql = "ALTER TABLE " + sComposedTableName + " ALTER \"" + sPKCL + "\" RESTART WITH " + OUString::number(maxVal + 1);
- m_xDestConnection->createStatement()->execute(strSql);
+ m_xDestConnection->createStatement()->execute(strSql);
+ }
}
}
}
@@ -1410,6 +1413,7 @@ void CopyTableWizard::impl_doCopy_nothrow()
catch( const Exception& )
{
aError = ::cppu::getCaughtException();
+ SAL_WARN("dbaccess", exceptionToString(aError));
// silence the error of the user cancelling the parameter's dialog
SQLException aSQLError;
@@ -1452,7 +1456,7 @@ OUString CopyTableWizard::impl_getServerSideCopyStatement_throw(const Reference<
}
}
const OUString sComposedTableName = ::dbtools::composeTableName( xDestMetaData, _xTable, ::dbtools::EComposeRule::InDataManipulation, true );
- OUString sSql("INSERT INTO " + sComposedTableName + " ( " + sColumns.makeStringAndClear() + " ) " + m_pSourceObject->getSelectStatement());
+ OUString sSql("INSERT INTO " + sComposedTableName + " ( " + sColumns + " ) " + m_pSourceObject->getSelectStatement());
return sSql;
}
diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx
index c2e67359b908..8b6b5abe178d 100644
--- a/dbaccess/source/ui/uno/dbinteraction.cxx
+++ b/dbaccess/source/ui/uno/dbinteraction.cxx
@@ -18,8 +18,7 @@
*/
#include "dbinteraction.hxx"
-#include <apitools.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <connectivity/dbexception.hxx>
#include <sqlmessage.hxx>
@@ -55,9 +54,7 @@ namespace dbaui
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ucb;
using namespace ::com::sun::star::sdb;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::task;
- using namespace ::com::sun::star::beans;
using namespace ::dbtools;
// BasicInteractionHandler
@@ -350,7 +347,15 @@ namespace dbaui
{
return "com.sun.star.comp.dbaccess.DatabaseInteractionHandler";
}
- IMPLEMENT_SERVICE_INFO_SUPPORTS(SQLExceptionInteractionHandler)
+ sal_Bool SAL_CALL SQLExceptionInteractionHandler::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ }
css::uno::Sequence< OUString > SAL_CALL SQLExceptionInteractionHandler::getSupportedServiceNames()
{
return { "com.sun.star.sdb.DatabaseInteractionHandler" };
@@ -361,7 +366,15 @@ namespace dbaui
{
return "com.sun.star.comp.dbaccess.LegacyInteractionHandler";
}
- IMPLEMENT_SERVICE_INFO_SUPPORTS(LegacyInteractionHandler)
+ sal_Bool SAL_CALL LegacyInteractionHandler::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ }
css::uno::Sequence< OUString > SAL_CALL LegacyInteractionHandler::getSupportedServiceNames()
{
return { "com.sun.star.sdb.InteractionHandler" };
diff --git a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx
index 620e4917ea93..5b1636f90bea 100644
--- a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx
+++ b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx
@@ -18,7 +18,6 @@
*/
#include <textconnectionsettings.hxx>
-#include <apitools.hxx>
#include <unoadmin.hxx>
#include <stringconstants.hxx>
#include <propertystorage.hxx>
@@ -64,7 +63,6 @@ namespace dbaui
class OTextConnectionSettingsDialog
:public OTextConnectionSettingsDialog_BASE
,public OTextConnectionSettingsDialog_PBASE
- ,public ::cppu::WeakImplHelper< css::sdb::XTextConnectionSettings >
{
PropertyValues m_aPropertyValues;
@@ -74,7 +72,10 @@ namespace dbaui
virtual css::uno::Sequence<sal_Int8> SAL_CALL getImplementationId() override;
DECLARE_SERVICE_INFO();
- DECLARE_PROPERTYCONTAINER_DEFAULTS( );
+ virtual css::uno::Reference< css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override;
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
+
virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) override;
virtual sal_Bool SAL_CALL convertFastPropertyValue( Any& rConvertedValue, Any& rOldValue, sal_Int32 nHandle, const Any& rValue) override;
@@ -123,7 +124,15 @@ namespace dbaui
{
return "com.sun.star.comp.dbaccess.OTextConnectionSettingsDialog";
}
- IMPLEMENT_SERVICE_INFO_SUPPORTS(OTextConnectionSettingsDialog)
+ sal_Bool SAL_CALL OTextConnectionSettingsDialog::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ }
css::uno::Sequence< OUString > SAL_CALL OTextConnectionSettingsDialog::getSupportedServiceNames()
{
return { "com.sun.star.sdb.TextConnectionSettings" };
@@ -149,43 +158,44 @@ namespace dbaui
// but whose values are stored in our item set
sal_Int32 nProp = aProps.getLength();
aProps.realloc( nProp + 6 );
+ auto pProps = aProps.getArray();
- aProps[ nProp++ ] = Property(
+ pProps[ nProp++ ] = Property(
"HeaderLine",
PROPERTY_ID_HEADER_LINE,
::cppu::UnoType< sal_Bool >::get(),
PropertyAttribute::TRANSIENT
);
- aProps[ nProp++ ] = Property(
+ pProps[ nProp++ ] = Property(
"FieldDelimiter",
PROPERTY_ID_FIELD_DELIMITER,
::cppu::UnoType< OUString >::get(),
PropertyAttribute::TRANSIENT
);
- aProps[ nProp++ ] = Property(
+ pProps[ nProp++ ] = Property(
"StringDelimiter",
PROPERTY_ID_STRING_DELIMITER,
::cppu::UnoType< OUString >::get(),
PropertyAttribute::TRANSIENT
);
- aProps[ nProp++ ] = Property(
+ pProps[ nProp++ ] = Property(
"DecimalDelimiter",
PROPERTY_ID_DECIMAL_DELIMITER,
::cppu::UnoType< OUString >::get(),
PropertyAttribute::TRANSIENT
);
- aProps[ nProp++ ] = Property(
+ pProps[ nProp++ ] = Property(
"ThousandDelimiter",
PROPERTY_ID_THOUSAND_DELIMITER,
::cppu::UnoType< OUString >::get(),
PropertyAttribute::TRANSIENT
);
- aProps[ nProp++ ] = Property(
+ pProps[ nProp++ ] = Property(
"CharSet",
PROPERTY_ID_ENCODING,
::cppu::UnoType< OUString >::get(),
diff --git a/dbaccess/source/ui/uno/unoDirectSql.cxx b/dbaccess/source/ui/uno/unoDirectSql.cxx
index 0fa9b6ee5e19..0a59588a3633 100644
--- a/dbaccess/source/ui/uno/unoDirectSql.cxx
+++ b/dbaccess/source/ui/uno/unoDirectSql.cxx
@@ -25,7 +25,8 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <directsql.hxx>
#include <datasourceconnector.hxx>
-#include <tools/diagnose_ex.h>
+#include <strings.hxx>
+#include <comphelper/diagnose_ex.hxx>
#include <vcl/svapp.hxx>
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
@@ -39,10 +40,8 @@ namespace dbaui
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
- using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdbc;
// ODirectSQLDialog
@@ -66,13 +65,36 @@ namespace dbaui
{
return "com.sun.star.comp.sdb.DirectSQLDialog";
}
- IMPLEMENT_SERVICE_INFO_SUPPORTS(ODirectSQLDialog)
+ sal_Bool SAL_CALL ODirectSQLDialog::supportsService(const OUString& _rServiceName)
+ {
+ const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
+ for (const OUString& s : aSupported)
+ if (s == _rServiceName)
+ return true;
+
+ return false;
+ }
css::uno::Sequence< OUString > SAL_CALL ODirectSQLDialog::getSupportedServiceNames( )
{
return { SERVICE_SDB_DIRECTSQLDIALOG };
}
- IMPLEMENT_PROPERTYCONTAINER_DEFAULTS( ODirectSQLDialog )
+ css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL ODirectSQLDialog::getPropertySetInfo()
+ {
+ Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+ }
+ ::cppu::IPropertyArrayHelper& ODirectSQLDialog::getInfoHelper()
+ {
+ return *ODirectSQLDialog::getArrayHelper();
+ }
+ ::cppu::IPropertyArrayHelper* ODirectSQLDialog::createArrayHelper( ) const
+ {
+ css::uno::Sequence< css::beans::Property > aProps;
+ describeProperties(aProps);
+ return new ::cppu::OPropertyArrayHelper(aProps);
+ }
+
std::unique_ptr<weld::DialogController> ODirectSQLDialog::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
{
diff --git a/dbaccess/source/ui/uno/unoDirectSql.hxx b/dbaccess/source/ui/uno/unoDirectSql.hxx
index 3030eabeaae4..c83f975d63dd 100644
--- a/dbaccess/source/ui/uno/unoDirectSql.hxx
+++ b/dbaccess/source/ui/uno/unoDirectSql.hxx
@@ -20,7 +20,6 @@
#pragma once
#include <svtools/genericunodialog.hxx>
-#include <apitools.hxx>
#include <com/sun/star/sdbc/XConnection.hpp>
#include <comphelper/proparrhlp.hxx>
#include <connectivity/CommonTools.hxx>
@@ -47,7 +46,9 @@ namespace dbaui
DECLARE_SERVICE_INFO();
- DECLARE_PROPERTYCONTAINER_DEFAULTS( );
+ virtual css::uno::Reference< css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override;
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
protected:
// OGenericUnoDialog overridables
diff --git a/dbaccess/source/ui/uno/unoadmin.cxx b/dbaccess/source/ui/uno/unoadmin.cxx
index 3d863b92e8f9..b2c50fc3ab0e 100644
--- a/dbaccess/source/ui/uno/unoadmin.cxx
+++ b/dbaccess/source/ui/uno/unoadmin.cxx
@@ -27,15 +27,13 @@ namespace dbaui
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
ODatabaseAdministrationDialog::ODatabaseAdministrationDialog(const Reference< XComponentContext >& _rxORB)
- :ODatabaseAdministrationDialogBase(_rxORB)
- ,m_pItemPoolDefaults(nullptr)
+: ODatabaseAdministrationDialogBase(_rxORB)
{
m_pCollection.reset( new ::dbaccess::ODsnTypeCollection(_rxORB) );
- ODbAdminDialog::createItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults, m_pCollection.get());
+ ODbAdminDialog::createItemSet(m_pDatasourceItems, m_pItemPool, m_pCollection.get());
}
ODatabaseAdministrationDialog::~ODatabaseAdministrationDialog()
@@ -43,7 +41,7 @@ ODatabaseAdministrationDialog::~ODatabaseAdministrationDialog()
::osl::MutexGuard aGuard(m_aMutex);
if (m_xDialog)
destroyDialog();
- ODbAdminDialog::destroyItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults);
+ ODbAdminDialog::destroyItemSet(m_pDatasourceItems, m_pItemPool);
}
void ODatabaseAdministrationDialog::implInitialize(const Any& _rValue)
diff --git a/dbaccess/uiconfig/dbapp/menubar/menubar.xml b/dbaccess/uiconfig/dbapp/menubar/menubar.xml
index 7038a63608a7..29e65762524c 100644
--- a/dbaccess/uiconfig/dbapp/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbapp/menubar/menubar.xml
@@ -127,10 +127,9 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:MacroSignature"/>
<menu:menuitem menu:id=".uno:MacroOrganizer?TabId:short=1"/>
- <menu:menuseparator/>
- <menu:menuitem menu:id=".uno:OpenXMLFilterSettings"/>
</menu:menupopup>
</menu:menu>
+ <menu:menuitem menu:id=".uno:OpenXMLFilterSettings"/>
<menu:menuitem menu:id="service:com.sun.star.deployment.ui.PackageManagerDialog" menu:style="text"/>
<menu:menuitem menu:id=".uno:ConfigureDialog" menu:style="text"/>
<menu:menuitem menu:id=".uno:OptionsTreeDialog"/>
diff --git a/dbaccess/uiconfig/dbquery/menubar/menubar.xml b/dbaccess/uiconfig/dbquery/menubar/menubar.xml
index 8227446b4b89..762a5533de74 100644
--- a/dbaccess/uiconfig/dbquery/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbquery/menubar/menubar.xml
@@ -82,10 +82,9 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:MacroSignature"/>
<menu:menuitem menu:id=".uno:MacroOrganizer?TabId:short=1"/>
- <menu:menuseparator/>
- <menu:menuitem menu:id=".uno:OpenXMLFilterSettings"/>
</menu:menupopup>
</menu:menu>
+ <menu:menuitem menu:id=".uno:OpenXMLFilterSettings"/>
<menu:menuitem menu:id="service:com.sun.star.deployment.ui.PackageManagerDialog" menu:style="text"/>
<menu:menuitem menu:id=".uno:ConfigureDialog" menu:style="text"/>
<menu:menuitem menu:id=".uno:OptionsTreeDialog"/>
diff --git a/dbaccess/uiconfig/dbrelation/menubar/menubar.xml b/dbaccess/uiconfig/dbrelation/menubar/menubar.xml
index 6e3df781eca9..0c2a73ec31d5 100644
--- a/dbaccess/uiconfig/dbrelation/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbrelation/menubar/menubar.xml
@@ -66,10 +66,9 @@
<menu:menuitem menu:id=".uno:MacroSignature"/>
<menu:menuitem menu:id=".uno:MacroOrganizer?TabId:short=1"/>
<menu:menuitem menu:id=".uno:ScriptOrganizer"/>
- <menu:menuseparator/>
- <menu:menuitem menu:id=".uno:OpenXMLFilterSettings"/>
</menu:menupopup>
</menu:menu>
+ <menu:menuitem menu:id=".uno:OpenXMLFilterSettings"/>
<menu:menuitem menu:id="service:com.sun.star.deployment.ui.PackageManagerDialog" menu:style="text"/>
<menu:menuitem menu:id=".uno:ConfigureDialog" menu:style="text"/>
<menu:menuitem menu:id=".uno:OptionsTreeDialog"/>
diff --git a/dbaccess/uiconfig/dbtable/menubar/menubar.xml b/dbaccess/uiconfig/dbtable/menubar/menubar.xml
index bbd4a7428f74..80511e8ea4d6 100644
--- a/dbaccess/uiconfig/dbtable/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbtable/menubar/menubar.xml
@@ -66,10 +66,9 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:MacroSignature"/>
<menu:menuitem menu:id=".uno:MacroOrganizer?TabId:short=1"/>
- <menu:menuseparator/>
- <menu:menuitem menu:id=".uno:OpenXMLFilterSettings"/>
</menu:menupopup>
</menu:menu>
+ <menu:menuitem menu:id=".uno:OpenXMLFilterSettings"/>
<menu:menuitem menu:id="service:com.sun.star.deployment.ui.PackageManagerDialog" menu:style="text"/>
<menu:menuitem menu:id=".uno:ConfigureDialog" menu:style="text"/>
<menu:menuitem menu:id=".uno:OptionsTreeDialog"/>
diff --git a/dbaccess/uiconfig/dbtdata/menubar/menubar.xml b/dbaccess/uiconfig/dbtdata/menubar/menubar.xml
index bbf379953e85..e787d60d7355 100644
--- a/dbaccess/uiconfig/dbtdata/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbtdata/menubar/menubar.xml
@@ -91,10 +91,9 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:MacroSignature"/>
<menu:menuitem menu:id=".uno:MacroOrganizer?TabId:short=1"/>
- <menu:menuseparator/>
- <menu:menuitem menu:id=".uno:OpenXMLFilterSettings"/>
</menu:menupopup>
</menu:menu>
+ <menu:menuitem menu:id=".uno:OpenXMLFilterSettings"/>
<menu:menuitem menu:id="service:com.sun.star.deployment.ui.PackageManagerDialog" menu:style="text"/>
<menu:menuitem menu:id=".uno:ConfigureDialog" menu:style="text"/>
<menu:menuitem menu:id=".uno:OptionsTreeDialog"/>
diff --git a/dbaccess/uiconfig/ui/applycolpage.ui b/dbaccess/uiconfig/ui/applycolpage.ui
index dd7b5ab71e6c..cfcb23259c8f 100644
--- a/dbaccess/uiconfig/ui/applycolpage.ui
+++ b/dbaccess/uiconfig/ui/applycolpage.ui
@@ -159,6 +159,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image2</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -172,6 +173,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image1</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -185,6 +187,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image3</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -198,6 +201,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image4</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/dbaccess/uiconfig/ui/connectionpage.ui b/dbaccess/uiconfig/ui/connectionpage.ui
index cfac643b97d6..5e1257bf5689 100644
--- a/dbaccess/uiconfig/ui/connectionpage.ui
+++ b/dbaccess/uiconfig/ui/connectionpage.ui
@@ -1,105 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.38.2 -->
<interface domain="dba">
<requires lib="gtk+" version="3.20"/>
<object class="GtkBox" id="ConnectionPage">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="border_width">6</property>
+ <property name="border-width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=2 -->
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
+ <property name="can-focus">False</property>
<property name="margin-start">12</property>
<property name="margin-top">6</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
+ <property name="row-spacing">6</property>
+ <property name="column-spacing">12</property>
<child>
<object class="GtkLabel" id="browseurllabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="connectionpage|browseurllabel">Path to the dBASE files:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">browseurl</property>
+ <property name="use-underline">True</property>
+ <property name="wrap">True</property>
+ <property name="mnemonic-widget">browseurl</property>
+ <property name="width-chars">38</property>
+ <property name="max-width-chars">38</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="create">
<property name="label" translatable="yes" context="connectionpage|create">_Create New</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="browse">
<property name="label" translatable="yes" context="connectionpage|browse">_Browse…</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=1 -->
<object class="GtkGrid">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
<child>
<object class="GtkEntry" id="browseurl">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="truncate-multiline">True</property>
+ <property name="can-focus">True</property>
<property name="hexpand">True</property>
+ <property name="truncate-multiline">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="browselabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
</object>
@@ -107,7 +111,7 @@
<child type="label">
<object class="GtkLabel" id="generalLabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="connectionpage|generalLabel">General</property>
<attributes>
<attribute name="weight" value="bold"/>
@@ -124,60 +128,60 @@
<child>
<object class="GtkFrame" id="frame2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=2 -->
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
+ <property name="can-focus">False</property>
<property name="margin-start">12</property>
<property name="margin-top">6</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="row-spacing">6</property>
+ <property name="column-spacing">12</property>
<child>
<object class="GtkLabel" id="userNameLabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="connectionpage|userNameLabel">_User name:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">userNameEntry</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">userNameEntry</property>
<property name="xalign">1</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="userNameEntry">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="truncate-multiline">True</property>
+ <property name="can-focus">True</property>
<property name="hexpand">True</property>
+ <property name="truncate-multiline">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="passCheckbutton">
<property name="label" translatable="yes" context="connectionpage|passCheckbutton">Password required</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
@@ -188,7 +192,7 @@
<child type="label">
<object class="GtkLabel" id="userlabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="connectionpage|userlabel">User Authentication</property>
<attributes>
<attribute name="weight" value="bold"/>
@@ -205,27 +209,27 @@
<child>
<object class="GtkFrame" id="frame3">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
+ <property name="margin-start">12</property>
+ <property name="margin-top">6</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="spacing">12</property>
- <property name="margin-start">12</property>
- <property name="margin-top">6</property>
<child>
<object class="GtkLabel" id="javaDriverLabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="connectionpage|javaDriverLabel">_JDBC driver class:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">driverEntry</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">driverEntry</property>
<property name="xalign">1</property>
</object>
<packing>
@@ -237,9 +241,9 @@
<child>
<object class="GtkEntry" id="driverEntry">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="truncate-multiline">True</property>
+ <property name="can-focus">True</property>
<property name="hexpand">True</property>
+ <property name="truncate-multiline">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -251,8 +255,8 @@
<object class="GtkButton" id="driverButton">
<property name="label" translatable="yes" context="connectionpage|driverButton">Test Class</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -265,7 +269,7 @@
<child type="label">
<object class="GtkLabel" id="JDBCLabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="connectionpage|JDBCLabel">JDBC Properties</property>
<attributes>
<attribute name="weight" value="bold"/>
@@ -283,8 +287,8 @@
<object class="GtkButton" id="connectionButton">
<property name="label" translatable="yes" context="connectionpage|connectionButton">Test Connection</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
<property name="halign">end</property>
<property name="valign">end</property>
<property name="vexpand">True</property>
diff --git a/dbaccess/uiconfig/ui/copytablepage.ui b/dbaccess/uiconfig/ui/copytablepage.ui
index c6eea4f00b61..e2e71e476413 100644
--- a/dbaccess/uiconfig/ui/copytablepage.ui
+++ b/dbaccess/uiconfig/ui/copytablepage.ui
@@ -164,6 +164,9 @@
<property name="width_chars">72</property>
<property name="max_width_chars">72</property>
<property name="xalign">0</property>
+ <attributes>
+ <attribute name="scale" value="0.9"/>
+ </attributes>
</object>
<packing>
<property name="left_attach">0</property>
diff --git a/dbaccess/uiconfig/ui/dbaseindexdialog.ui b/dbaccess/uiconfig/ui/dbaseindexdialog.ui
index 06349d7de9ef..644a4e1c9ad7 100644
--- a/dbaccess/uiconfig/ui/dbaseindexdialog.ui
+++ b/dbaccess/uiconfig/ui/dbaseindexdialog.ui
@@ -298,6 +298,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image1</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -311,6 +312,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image2</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -324,6 +326,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image3</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -337,6 +340,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image4</property>
+ <property name="always-show-image">True</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/dbaccess/uiconfig/ui/dbwizconnectionpage.ui b/dbaccess/uiconfig/ui/dbwizconnectionpage.ui
index 07c46bc0d4de..7e9ed7d3ea60 100644
--- a/dbaccess/uiconfig/ui/dbwizconnectionpage.ui
+++ b/dbaccess/uiconfig/ui/dbwizconnectionpage.ui
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.38.2 -->
<interface domain="dba">
<requires lib="gtk+" version="3.20"/>
<object class="GtkBox" id="ConnectionPage">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="border_width">6</property>
+ <property name="border-width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="header">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">start</property>
- <property name="margin_bottom">12</property>
+ <property name="margin-bottom">12</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -29,12 +29,12 @@
<child>
<object class="GtkLabel" id="helptext">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_bottom">6</property>
+ <property name="can-focus">False</property>
+ <property name="margin-bottom">6</property>
<property name="label" translatable="yes" context="dbwizconnectionpage|helptext">label</property>
<property name="wrap">True</property>
- <property name="width_chars">72</property>
- <property name="max_width_chars">72</property>
+ <property name="width-chars">72</property>
+ <property name="max-width-chars">72</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -44,86 +44,89 @@
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=2 -->
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
+ <property name="row-spacing">6</property>
+ <property name="column-spacing">12</property>
<child>
<object class="GtkLabel" id="browseurllabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="dbwizconnectionpage|browseurllabel">Path to the dBASE files:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">browseurl</property>
+ <property name="use-underline">True</property>
+ <property name="wrap">True</property>
+ <property name="mnemonic-widget">browseurl</property>
+ <property name="width-chars">38</property>
+ <property name="max-width-chars">38</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="create">
<property name="label" translatable="yes" context="dbwizconnectionpage|create">_Create New</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="browse">
<property name="label" translatable="yes" context="dbwizconnectionpage|browse">_Browse…</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=1 -->
<object class="GtkGrid">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<child>
<object class="GtkEntry" id="browseurl">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<property name="hexpand">True</property>
+ <property name="activates-default">True</property>
<property name="truncate-multiline">True</property>
- <property name="activates_default">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="browselabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
</object>
diff --git a/dbaccess/uiconfig/ui/dbwizmysqlintropage.ui b/dbaccess/uiconfig/ui/dbwizmysqlintropage.ui
index b2646d31b7be..64f5a34881cc 100644
--- a/dbaccess/uiconfig/ui/dbwizmysqlintropage.ui
+++ b/dbaccess/uiconfig/ui/dbwizmysqlintropage.ui
@@ -90,7 +90,7 @@ Please contact your system administrator if you are unsure about the following s
</child>
<child>
<object class="GtkRadioButton" id="directly">
- <property name="label" translatable="yes" context="dbwizmysqlintropage|directly">Connect directly</property>
+ <property name="label" translatable="yes" context="dbwizmysqlintropage|directly">Connect directly (using MariaDB C connector)</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
@@ -125,7 +125,7 @@ Please contact your system administrator if you are unsure about the following s
<object class="GtkLabel" id="header">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes" context="dbwizmysqlintropage|header">Set Up a Connection to a MySQL Database</property>
+ <property name="label" translatable="yes" context="dbwizmysqlintropage|header">Set Up a Connection to a MySQL/MariaDB Database</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
diff --git a/dbaccess/uiconfig/ui/dbwizmysqlnativepage.ui b/dbaccess/uiconfig/ui/dbwizmysqlnativepage.ui
index f426fa7b7418..b2537b2fda46 100644
--- a/dbaccess/uiconfig/ui/dbwizmysqlnativepage.ui
+++ b/dbaccess/uiconfig/ui/dbwizmysqlnativepage.ui
@@ -32,7 +32,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
- <property name="label" translatable="yes" context="dbwizmysqlnativepage|helptext">Please enter the required information to connect to a MySQL database.</property>
+ <property name="label" translatable="yes" context="dbwizmysqlnativepage|helptext">Please enter the required information to connect to a MySQL/MariaDB database.</property>
<property name="wrap">True</property>
<property name="width_chars">72</property>
<property name="max_width_chars">72</property>
@@ -67,7 +67,7 @@
<object class="GtkLabel" id="header">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes" context="dbwizmysqlnativepage|header">Set Up a Connection to a MySQL Database</property>
+ <property name="label" translatable="yes" context="dbwizmysqlnativepage|header">Set Up a Connection to a MySQL/MariaDB Database</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
diff --git a/dbaccess/uiconfig/ui/directsqldialog.ui b/dbaccess/uiconfig/ui/directsqldialog.ui
index 7546c9c7472d..c1c06f40a383 100644
--- a/dbaccess/uiconfig/ui/directsqldialog.ui
+++ b/dbaccess/uiconfig/ui/directsqldialog.ui
@@ -1,33 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.38.2 -->
<interface domain="dba">
<requires lib="gtk+" version="3.20"/>
<object class="GtkDialog" id="DirectSQLDialog">
- <property name="can_focus">False</property>
- <property name="border_width">6</property>
+ <property name="can-focus">False</property>
+ <property name="border-width">6</property>
<property name="title" translatable="yes" context="directsqldialog|DirectSQLDialog">Execute SQL Statement</property>
<property name="resizable">False</property>
<property name="modal">True</property>
- <property name="type_hint">dialog</property>
- <child>
- <placeholder/>
- </child>
+ <property name="type-hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
+ <property name="can-focus">False</property>
+ <property name="layout-style">end</property>
<child>
<object class="GtkButton" id="help">
<property name="label" translatable="yes" context="stock">_Help</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="can-default">True</property>
+ <property name="receives-default">True</property>
<property name="use-underline">True</property>
</object>
<packing>
@@ -41,9 +38,9 @@
<object class="GtkButton" id="close">
<property name="label" translatable="yes" context="stock">_Close</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="can-default">True</property>
+ <property name="receives-default">True</property>
<property name="use-underline">True</property>
</object>
<packing>
@@ -56,132 +53,169 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="pack_type">end</property>
+ <property name="pack-type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=1 n-rows=5 -->
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="row_spacing">6</property>
+ <property name="can-focus">False</property>
<property name="margin-start">12</property>
<property name="margin-top">6</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="row-spacing">6</property>
<child>
- <object class="GtkScrolledWindow">
+ <object class="GtkScrolledWindow" id="scrolledwindow">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="border_width">0</property>
- <property name="shadow_type">in</property>
+ <property name="border-width">0</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">always</property>
+ <property name="shadow-type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<child>
<object class="GtkDrawingArea" id="sql">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<property name="events">GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="sql-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="directsqldialog|extended_tip|sql">Enter the SQL administration command that you want to run.</property>
+ </object>
+ </child>
</object>
</child>
</object>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="sql_label">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="directsqldialog|sql_label">_Command to execute:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">sql</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">sql</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=2 -->
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="column_spacing">12</property>
+ <property name="can-focus">False</property>
+ <property name="column-spacing">12</property>
+ <child>
+ <object class="GtkCheckButton" id="directsql">
+ <property name="label" translatable="yes" context="directsqldialog|directsql">Run SQL command _directly</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="directsql-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="directsqldialog|extended_tip|directsql">Execute the SQL command directly without escape processing.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
<child>
<object class="GtkCheckButton" id="showoutput">
<property name="label" translatable="yes" context="directsqldialog|showoutput">_Show output of "select" statements</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="showoutput-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="directsqldialog|extended_tip|showoutput">Show the result of the SQL SELECT command in the Output box.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="execute">
<property name="label" translatable="yes" context="directsqldialog|execute">_Execute</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="can-default">True</property>
+ <property name="has-default">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="sqlhistory">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="sqlhistory-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="directsqldialog|extended_tip|sqlhistory">Lists the previously executed SQL commands. To run a command again, click the command, and then click Execute.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="sqlhistory_label">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="directsqldialog|sqlhistory_label">_Previous commands:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">sqlhistory</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">sqlhistory</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">3</property>
</packing>
</child>
</object>
@@ -189,7 +223,7 @@
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="directsqldialog|label1">SQL Command</property>
<attributes>
<attribute name="weight" value="bold"/>
@@ -206,21 +240,26 @@
<child>
<object class="GtkFrame" id="frame2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="can-focus">False</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow2">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="shadow_type">in</property>
+ <property name="can-focus">True</property>
<property name="margin-start">12</property>
<property name="margin-top">6</property>
+ <property name="shadow-type">in</property>
<child>
<object class="GtkTextView" id="status">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<property name="editable">False</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="status-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="directsqldialog|extended_tip|status">Displays the results, including errors, of the SQL command that you ran.</property>
+ </object>
+ </child>
</object>
</child>
</object>
@@ -228,7 +267,7 @@
<child type="label">
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="directsqldialog|label2">Status</property>
<attributes>
<attribute name="weight" value="bold"/>
@@ -245,21 +284,26 @@
<child>
<object class="GtkFrame" id="frame3">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="can-focus">False</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="shadow_type">in</property>
+ <property name="can-focus">True</property>
<property name="margin-start">12</property>
<property name="margin-top">6</property>
+ <property name="shadow-type">in</property>
<child>
<object class="GtkTextView" id="output">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<property name="editable">False</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="output-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="directsqldialog|extended_tip|output">Displays the results of the SQL command that you ran.</property>
+ </object>
+ </child>
</object>
</child>
</object>
@@ -267,7 +311,7 @@
<child type="label">
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="directsqldialog|label3">Output</property>
<attributes>
<attribute name="weight" value="bold"/>
diff --git a/dbaccess/uiconfig/ui/generalpagewizard.ui b/dbaccess/uiconfig/ui/generalpagewizard.ui
index 4a8736a42850..00efb8fe80de 100644
--- a/dbaccess/uiconfig/ui/generalpagewizard.ui
+++ b/dbaccess/uiconfig/ui/generalpagewizard.ui
@@ -1,90 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.38.2 -->
<interface domain="dba">
<requires lib="gtk+" version="3.20"/>
- <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">document-open</property>
+ </object>
+ <!-- n-columns=1 n-rows=12 -->
<object class="GtkGrid" id="PageGeneral">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="border_width">6</property>
+ <property name="border-width">6</property>
<property name="orientation">vertical</property>
- <property name="row_spacing">6</property>
+ <property name="row-spacing">6</property>
<child>
<object class="GtkLabel" id="headerText">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="generalpagewizard|headerText">Welcome to the %PRODUCTNAME Database Wizard</property>
- <property name="single_line_mode">True</property>
+ <property name="single-line-mode">True</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="helpText">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes" context="generalpagewizard|helpText">Use the Database Wizard to create a new database, open an existing database file, or connect to a database stored on a server.</property>
<property name="wrap">True</property>
- <property name="width_chars">72</property>
- <property name="max_width_chars">72</property>
+ <property name="width-chars">72</property>
+ <property name="max-width-chars">72</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="sourceTypeHeader">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="generalpagewizard|sourceTypeHeader">What do you want to do?</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="createDatabase">
<property name="label" translatable="yes" context="generalpagewizard|createDatabase">Create a n_ew database</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
+ <property name="can-focus">True</property>
+ <property name="has-focus">True</property>
+ <property name="receives-default">False</property>
<property name="margin-start">12</property>
- <property name="use_underline">True</property>
+ <property name="use-underline">True</property>
<property name="active">True</property>
- <property name="draw_indicator">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="createDatabase-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="generalpagewizard|extended_tip|createDatabase">Select to create a new database.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="embeddeddbBox">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="margin-start">24</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="embeddeddbLabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="generalpagewizard|embeddeddbLabel">_Embedded database:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">embeddeddbList</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">embeddeddbList</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -96,7 +107,7 @@
<child>
<object class="GtkComboBoxText" id="embeddeddbList">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
</object>
<packing>
<property name="expand">False</property>
@@ -106,39 +117,44 @@
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">5</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="openExistingDatabase">
<property name="label" translatable="yes" context="generalpagewizard|openExistingDatabase">Open an existing database _file</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
<property name="margin-start">12</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<property name="group">createDatabase</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="openExistingDatabase-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="generalpagewizard|extended_tip|openExistingDatabase">Select to open a database file from a list of recently used files or from a file selection dialog.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">6</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkBox" id="docListBox">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="margin-start">24</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="docListLabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="generalpagewizard|docListLabel">_Recently used:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">documentList</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">documentList</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -150,7 +166,7 @@
<child>
<object class="GtkComboBoxText" id="documentList">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
@@ -159,76 +175,108 @@
<property name="position">1</property>
</packing>
</child>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="docListBox-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="generalpagewizard|extended_tip|docListBox">Select a database file to open from the list of recently used files. Click Finish to open the file immediately and to exit the wizard.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">7</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkButton" id="openDatabase">
<property name="label" translatable="yes" context="generalpagewizard|openDatabase">Open</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
<property name="halign">start</property>
<property name="margin-start">24</property>
- <property name="always_show_image">True</property>
+ <property name="image">image1</property>
+ <property name="use-underline">True</property>
+ <property name="always-show-image">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="openDatabase-atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes" context="generalpagewizard|extended_tip|openDatabase">Opens a file selection dialog where you can select a database file. Click Open or OK in the file selection dialog to open the file immediately and to exit the wizard.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">8</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="connectDatabase">
<property name="label" translatable="yes" context="generalpagewizard|connectDatabase">Connect to an e_xisting database</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
<property name="margin-start">12</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<property name="group">createDatabase</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="connectDatabase-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="generalpagewizard|extended_tip|connectDatabase">Select to create a database document for an existing database connection.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">9</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="datasourceType">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">start</property>
<property name="margin-start">24</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="datasourceType-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="generalpagewizard|extended_tip|datasourceType">Select the database type for the existing database connection.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">10</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">10</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="specialMessage">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">11</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">11</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="noembeddeddbLabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="generalpagewizard|noembeddeddbLabel">It is not possible to create a new database, because neither HSQLDB, nor Firebird is
available in this setup.</property>
+ <child internal-child="accessible">
+ <object class="AtkObject">
+ <property name="AtkObject::accessible-role">static</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">4</property>
</packing>
</child>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="PageGeneral-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="generalpagewizard|extended_tip|PageGeneral">The Database Wizard creates a database file that contains information about a database.</property>
+ </object>
+ </child>
</object>
</interface>
diff --git a/dbaccess/uiconfig/ui/indexdesigndialog.ui b/dbaccess/uiconfig/ui/indexdesigndialog.ui
index 05617dbf6c9f..837b29c86d81 100644
--- a/dbaccess/uiconfig/ui/indexdesigndialog.ui
+++ b/dbaccess/uiconfig/ui/indexdesigndialog.ui
@@ -81,11 +81,10 @@
<child>
<object class="GtkToolbar" id="ACTIONS">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
<child>
<object class="GtkToolButton" id="ID_INDEX_NEW">
<property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="valign">start</property>
<property name="label" translatable="yes" context="indexdesigndialog|ID_INDEX_NEW">New Index</property>
<property name="use_underline">True</property>
@@ -99,7 +98,6 @@
<child>
<object class="GtkToolButton" id="ID_INDEX_DROP">
<property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="valign">start</property>
<property name="label" translatable="yes" context="indexdesigndialog|ID_INDEX_DROP">Delete Current Index</property>
<property name="use_underline">True</property>
@@ -113,7 +111,6 @@
<child>
<object class="GtkToolButton" id="ID_INDEX_RENAME">
<property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="valign">start</property>
<property name="label" translatable="yes" context="indexdesigndialog|ID_INDEX_RENAME">Rename Current Index</property>
<property name="use_underline">True</property>
@@ -127,7 +124,6 @@
<child>
<object class="GtkToolButton" id="ID_INDEX_SAVE">
<property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="valign">start</property>
<property name="label" translatable="yes" context="indexdesigndialog|ID_INDEX_SAVE">Save Current Index</property>
<property name="use_underline">True</property>
@@ -141,7 +137,6 @@
<child>
<object class="GtkToolButton" id="ID_INDEX_RESET">
<property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="valign">start</property>
<property name="label" translatable="yes" context="indexdesigndialog|ID_INDEX_RESET">Reset Current Index</property>
<property name="use_underline">True</property>
diff --git a/dbaccess/uiconfig/ui/jdbcconnectionpage.ui b/dbaccess/uiconfig/ui/jdbcconnectionpage.ui
index 906385de1661..8c295091c5b4 100644
--- a/dbaccess/uiconfig/ui/jdbcconnectionpage.ui
+++ b/dbaccess/uiconfig/ui/jdbcconnectionpage.ui
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.38.2 -->
<interface domain="dba">
<requires lib="gtk+" version="3.20"/>
<object class="GtkBox" id="JDBCConnectionPage">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="border_width">6</property>
+ <property name="border-width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="header">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">start</property>
- <property name="margin_bottom">6</property>
+ <property name="margin-bottom">6</property>
<property name="label" translatable="yes" context="jdbcconnectionpage|header">Set Up a Connection to a JDBC Database</property>
<attributes>
<attribute name="weight" value="bold"/>
@@ -30,11 +30,11 @@
<child>
<object class="GtkLabel" id="helptext">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="jdbcconnectionpage|helptext">Please enter the required information to connect to a JDBC database. Please contact your system administrator if you are unsure about the following settings.</property>
<property name="wrap">True</property>
- <property name="width_chars">72</property>
- <property name="max_width_chars">72</property>
+ <property name="width-chars">72</property>
+ <property name="max-width-chars">72</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -44,84 +44,89 @@
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=2 -->
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="row-spacing">6</property>
+ <property name="column-spacing">12</property>
<child>
<object class="GtkLabel" id="browseurllabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="jdbcconnectionpage|browseurllabel">Path to the dBASE files:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">browseurl</property>
+ <property name="use-underline">True</property>
+ <property name="wrap">True</property>
+ <property name="mnemonic-widget">browseurl</property>
+ <property name="width-chars">38</property>
+ <property name="max-width-chars">38</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="create">
<property name="label" translatable="yes" context="jdbcconnectionpage|create">_Create New</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="browse">
<property name="label" translatable="yes" context="jdbcconnectionpage|browse">_Browse…</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=1 -->
<object class="GtkGrid">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
<child>
<object class="GtkEntry" id="browseurl">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<property name="hexpand">True</property>
+ <property name="activates-default">True</property>
<property name="truncate-multiline">True</property>
- <property name="activates_default">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="browselabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
</object>
@@ -134,7 +139,7 @@
<child>
<object class="GtkBox" id="box">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
@@ -142,11 +147,11 @@
<child>
<object class="GtkLabel" id="jdbcLabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes" context="jdbcconnectionpage|jdbcLabel">JDBC d_river class:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">jdbcEntry</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">jdbcEntry</property>
</object>
<packing>
<property name="expand">False</property>
@@ -157,16 +162,16 @@
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="spacing">12</property>
<child>
<object class="GtkEntry" id="jdbcEntry">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<property name="hexpand">True</property>
+ <property name="activates-default">True</property>
<property name="truncate-multiline">True</property>
- <property name="activates_default">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -178,9 +183,9 @@
<object class="GtkButton" id="jdbcButton">
<property name="label" translatable="yes" context="jdbcconnectionpage|jdbcButton">_Test Class</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/dbaccess/uiconfig/ui/ldapconnectionpage.ui b/dbaccess/uiconfig/ui/ldapconnectionpage.ui
index 5968c1d63ed9..c02c7bdb9f51 100644
--- a/dbaccess/uiconfig/ui/ldapconnectionpage.ui
+++ b/dbaccess/uiconfig/ui/ldapconnectionpage.ui
@@ -172,7 +172,7 @@
</child>
<child>
<object class="GtkCheckButton" id="useSSLCheckbutton">
- <property name="label" translatable="yes" context="ldapconnectionpage|useSSLCheckbutton">Use _secure connection (SSL)</property>
+ <property name="label" translatable="yes" context="ldapconnectionpage|useSSLCheckbutton">Use _secure connection (TLS/SSL)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
diff --git a/dbaccess/uiconfig/ui/ldappage.ui b/dbaccess/uiconfig/ui/ldappage.ui
index 947f0b602627..8cd5bc8b8257 100644
--- a/dbaccess/uiconfig/ui/ldappage.ui
+++ b/dbaccess/uiconfig/ui/ldappage.ui
@@ -66,7 +66,7 @@
</child>
<child>
<object class="GtkCheckButton" id="useSSLCheckbutton">
- <property name="label" translatable="yes" context="ldappage|useSSLCheckbutton">Use secure connection (SSL)</property>
+ <property name="label" translatable="yes" context="ldappage|useSSLCheckbutton">Use secure connection (TLS/SSL)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
diff --git a/dbaccess/uiconfig/ui/parametersdialog.ui b/dbaccess/uiconfig/ui/parametersdialog.ui
index 5ca6bde3de60..0f1192cfb266 100644
--- a/dbaccess/uiconfig/ui/parametersdialog.ui
+++ b/dbaccess/uiconfig/ui/parametersdialog.ui
@@ -20,7 +20,6 @@
<property name="default_width">0</property>
<property name="default_height">0</property>
<property name="type_hint">dialog</property>
- <property name="gravity">north</property>
<child>
<placeholder/>
</child>
diff --git a/dbaccess/uiconfig/ui/postgrespage.ui b/dbaccess/uiconfig/ui/postgrespage.ui
new file mode 100644
index 000000000000..e5867ec4122d
--- /dev/null
+++ b/dbaccess/uiconfig/ui/postgrespage.ui
@@ -0,0 +1,285 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.40.0 -->
+<interface domain="dba">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="upper">1000000000000</property>
+ <property name="step-increment">1</property>
+ <property name="page-increment">10</property>
+ </object>
+ <object class="GtkBox" id="SpecialPostgresPage">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="border-width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="header">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="margin-bottom">6</property>
+ <property name="label" translatable="yes" context="postgrespage|header">Set up a connection to a PostgreSQL database</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="header-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialpostgrespage|header">Set up connection to a PostgreSQL database</property>
+ <property name="AtkObject::accessible-role">static</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="helpLabel">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes" context="postgrespage|helpLabel">Please enter the required information to connect to a PostgreSQL database, either by entering the host name, port number and server, or by entering the connection string.</property>
+ <property name="wrap">True</property>
+ <property name="width-chars">72</property>
+ <property name="max-width-chars">72</property>
+ <property name="xalign">0</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="helpLabel-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialpostgrespage|helpLabel">Please enter the required information to connect to a PostgreSQL database. Please contact your system administrator if you are unsure about the following settings. </property>
+ <property name="AtkObject::accessible-role">static</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="helpSupport">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes" context="postgrespage|helpSupport">Please contact your system administrator if you are unsure</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <!-- n-columns=2 n-rows=3 -->
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="row-spacing">6</property>
+ <property name="column-spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="dbNameLabel">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes" context="specialpostgrespage|dbNameLabel">_Database name:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">dbNameEntry</property>
+ <property name="xalign">1</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="hostNameLabel">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes" context="specialpostgrespage|hostNameLabel">_Server:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">hostNameEntry</property>
+ <property name="xalign">1</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="portNumLabel">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes" context="specialpostgrespage|portNumLabel">_Port number:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">portNumEntry</property>
+ <property name="xalign">1</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="dbNameEntry">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="activates-default">True</property>
+ <property name="truncate-multiline">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="dbNameEntry-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="postgrespage|extended_tip|dbNameEntry">Enter the name of the database.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="hostNameEntry">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="activates-default">True</property>
+ <property name="truncate-multiline">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="hostNameEntry-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="postgrespage|extended_tip|hostNameEntry">Enter the server url of the database. </property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkSpinButton" id="portNumEntry">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="activates-default">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="adjustment">adjustment1</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="portNumEntry-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="postgrespage|extended_tip|portNumEntry">Enter the port number of the DBMS service. Default for PostgreSQL is 5432.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="portNumDefLabel">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes" context="specialpostgrespage|portNumDefLabel">Default: 5432</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <!-- n-columns=1 n-rows=2 -->
+ <object class="GtkGrid" id="grid2">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="row-spacing">6</property>
+ <property name="column-spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="connectionStringLabel">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" context="specialpostgrespage|connectionStringLabel">Alternatively, enter the driver-specific connection string here</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">browseurl</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <!-- n-columns=2 n-rows=1 -->
+ <object class="GtkGrid" id="grid3">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkEntry" id="browseurl">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="activates-default">True</property>
+ <property name="truncate-multiline">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="browseurl-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="postgrespage|extended_tip|browseurl">Enter the complete connector URL to access the PostGreSQL DBMS service. The connector URL is in the form "postgresql://myHost:port/MyDatabase".</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="browselabel">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/dbaccess/uiconfig/ui/queryview.ui b/dbaccess/uiconfig/ui/queryview.ui
index 3688fd855ece..ed31cfc345cd 100644
--- a/dbaccess/uiconfig/ui/queryview.ui
+++ b/dbaccess/uiconfig/ui/queryview.ui
@@ -8,12 +8,14 @@
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
- <object class="GtkScrolledWindow">
+ <object class="GtkScrolledWindow" id="scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="border_width">0</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">always</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkViewport">
diff --git a/dbaccess/uiconfig/ui/specialjdbcconnectionpage.ui b/dbaccess/uiconfig/ui/specialjdbcconnectionpage.ui
index 9255f6709f4d..8a9141b250ae 100644
--- a/dbaccess/uiconfig/ui/specialjdbcconnectionpage.ui
+++ b/dbaccess/uiconfig/ui/specialjdbcconnectionpage.ui
@@ -21,10 +21,15 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_bottom">6</property>
- <property name="label" translatable="yes" context="specialjdbcconnectionpage|header">Set up connection to a MySQL database using JDBC</property>
+ <property name="label" translatable="yes" context="specialjdbcconnectionpage|header">Set up connection to a MySQL/MariaDB database using JDBC</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
+ <child internal-child="accessible">
+ <object class="AtkObject">
+ <property name="AtkObject::accessible-role">static</property>
+ </object>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -36,11 +41,16 @@
<object class="GtkLabel" id="helpLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes" context="specialjdbcconnectionpage|helpLabel">Please enter the required information to connect to a MySQL database using JDBC. Note that a JDBC driver class must be installed on your system and registered with %PRODUCTNAME. Please contact your system administrator if you are unsure about the following settings. </property>
+ <property name="label" translatable="yes" context="specialjdbcconnectionpage|helpLabel">Please enter the required information to connect to a MySQL/MariaDB database using JDBC. Note that a JDBC driver class must be installed on your system and registered with %PRODUCTNAME. Please contact your system administrator if you are unsure about the following settings. </property>
<property name="wrap">True</property>
<property name="width_chars">72</property>
<property name="max_width_chars">72</property>
<property name="xalign">0</property>
+ <child internal-child="accessible">
+ <object class="AtkObject">
+ <property name="AtkObject::accessible-role">static</property>
+ </object>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -151,6 +161,11 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="specialjdbcconnectionpage|portNumDefLabel">Default: 3306</property>
+ <child internal-child="accessible">
+ <object class="AtkObject">
+ <property name="AtkObject::accessible-role">static</property>
+ </object>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -185,7 +200,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
- <property name="label" translatable="yes" context="specialjdbcconnectionpage|jdbcDriverLabel">MySQL JDBC d_river class:</property>
+ <property name="label" translatable="yes" context="specialjdbcconnectionpage|jdbcDriverLabel">MySQL/MariaDB JDBC d_river class:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">jdbcDriverEntry</property>
</object>
diff --git a/dbaccess/uiconfig/ui/specialsettingspage.ui b/dbaccess/uiconfig/ui/specialsettingspage.ui
index 9cb5f66ab3fb..9281d4cd479e 100644
--- a/dbaccess/uiconfig/ui/specialsettingspage.ui
+++ b/dbaccess/uiconfig/ui/specialsettingspage.ui
@@ -1,316 +1,406 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.38.2 -->
<interface domain="dba">
<requires lib="gtk+" version="3.20"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">1000000</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
+ <property name="step-increment">1</property>
+ <property name="page-increment">10</property>
</object>
<object class="GtkBox" id="SpecialSettingsPage">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="border_width">6</property>
+ <property name="border-width">6</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=1 n-rows=17 -->
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">6</property>
+ <property name="can-focus">False</property>
+ <property name="row-spacing">6</property>
<child>
<object class="GtkCheckButton" id="usesql92">
<property name="label" translatable="yes" context="specialsettingspage|usesql92">Use SQL92 naming constraints</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="usesql92-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingspage|extended_tip|usesql92">Only allows characters that conform to the SQL92 naming convention in a name in a data source. All other characters are rejected. Each name must begin with a lowercase letter, an uppercase letter, or an underscore ( _ ). The remaining characters can be ASCII letters, numbers, and underscores.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="append">
<property name="label" translatable="yes" context="specialsettingspage|append">Append the table alias name on SELECT statements</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="append-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettings|extended_tip|append">Appends the alias to the table name in SELECT statements.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="useas">
<property name="label" translatable="yes" context="specialsettingspage|useas">Use keyword AS before table alias names</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="useas-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingspage|extended_tip|useas">Some databases use the keyword "AS" between a name and its alias, while other databases use a whitespace. Enable this option to insert AS before the alias.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="useoj">
<property name="label" translatable="yes" context="specialsettingspage|useoj">Use Outer Join syntax '{oj }'</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="useoj-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingsoage|extended_tip|useoj">Use escape sequences for outer joins. The syntax for this escape sequence is {oj outer-join}</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="ignoreprivs">
<property name="label" translatable="yes" context="specialsettingspage|ignoreprivs">Ignore the privileges from the database driver</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="ignoreprivs-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingspage|extended_tip|ignoreprivs">Ignores access privileges that are provided by the database driver.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="replaceparams">
<property name="label" translatable="yes" context="specialsettingspage|replaceparams">Replace named parameters with '?'</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="replaceparams-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingspage|extended_tip|replaceparams">Replaces named parameters in a data source with a question mark (?).</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">5</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="displayver">
<property name="label" translatable="yes" context="specialsettingspage|displayver">Display version columns (when available)</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="displayver-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingspage|extended_tip|displayver">Displays the internal version number of the record in the database table.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">6</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="usecatalogname">
<property name="label" translatable="yes" context="specialsettingspage|usecatalogname">Use catalog name in SELECT statements</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="usecatalogname-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingspage|extended_tip|usecatalogname">Uses the current data source of the catalog. This option is useful when the ODBC data source is a database server. Do not select this option if the ODBC data source is a dBASE driver.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">7</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="useschemaname">
<property name="label" translatable="yes" context="specialsettingspage|useschemaname">Use schema name in SELECT statements</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="useschemaname-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingspage|extended_tip|useschemaname">Allows you to use the schema name in SELECT statements.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">8</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="createindex">
<property name="label" translatable="yes" context="specialsettingspage|createindex">Create index with ASC or DESC statement</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="createindex-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingspage|extended_tip|createindex">Creates an index with ASC or DESC statements.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">9</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="eol">
<property name="label" translatable="yes" context="specialsettingspage|eol">End text lines with CR+LF</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="eol-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingspage|extended_tip|eol">Select to use the CR + LF code pair to end every text line (preferred for DOS and Windows operating systems).</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">10</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">10</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="ignorecurrency">
<property name="label" translatable="yes" context="specialsettingspage|ignorecurrency">Ignore currency field information</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="ignorecurrency-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingspage|extended_tip|ignorecurrency">Only for Oracle JDBC connections. When enabled it specifies that no column is treated as a currency field. The field type returned from the database driver is discarded.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">11</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">11</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="inputchecks">
<property name="label" translatable="yes" context="specialsettingspage|inputchecks">Form data input checks for required fields</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="inputchecks-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingspage|extended_tip|inputchecks">When you enter a new record or update an existing record in a form, and you leave a field empty which is bound to a database column which requires input, then you will see a message complaining about the empty field.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">12</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">12</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="useodbcliterals">
<property name="label" translatable="yes" context="specialsettingspage|useodbcliterals">Use ODBC conformant date/time literals</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="useodbcliterals-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingspage|extended_tip|useodbcliterals">Use date/time literals that conform to ODBC standard.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">13</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">13</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="primarykeys">
<property name="label" translatable="yes" context="specialsettingspage|primarykeys">Supports primary keys</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="primarykeys-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingspage|extended_tip|primarykeys">Enable to overrule Base's heuristics used to detect whether the database supports primary keys.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">14</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">14</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="resulttype">
<property name="label" translatable="yes" context="specialsettingspage|resulttype">Respect the result set type from the database driver</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="resulttype-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingspage|extended_tip|resulttype">Use the database driver different scroll capabilities of a result set.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">15</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">15</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=2 -->
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
+ <property name="can-focus">False</property>
+ <property name="row-spacing">6</property>
+ <property name="column-spacing">12</property>
<child>
<object class="GtkLabel" id="comparisonft">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
<property name="label" translatable="yes" context="specialsettingspage|comparisonft">Comparison of Boolean values:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">comparison</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">comparison</property>
<property name="xalign">1</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="comparison">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
<items>
<item translatable="yes" context="specialsettingspage|comparison">Default</item>
<item translatable="yes" context="specialsettingspage|comparison">SQL</item>
<item translatable="yes" context="specialsettingspage|comparison">Mixed</item>
<item translatable="yes" context="specialsettingspage|comparison">MS Access</item>
</items>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="comparison-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingspage|extended_tip|comparison">Select the type of Boolean comparison that you want to use.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="rowsft">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
<property name="label" translatable="yes" context="specialsettingspage|rowsft">Rows to scan column types:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">rows</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">rows</property>
<property name="xalign">1</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="rows">
- <property name="can_focus">True</property>
- <property name="no_show_all">True</property>
- <property name="activates_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="no-show-all">True</property>
+ <property name="activates-default">True</property>
<property name="truncate-multiline">True</property>
<property name="adjustment">adjustment1</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="rows-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="specialsettingspage|extended_tip|rows">Select the number of rows to let the driver detect the data type.</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">16</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">16</property>
</packing>
</child>
</object>
diff --git a/dbaccess/uiconfig/ui/tabledesignrowmenu.ui b/dbaccess/uiconfig/ui/tabledesignrowmenu.ui
index 20f2971c1bed..d17e60062b5b 100644
--- a/dbaccess/uiconfig/ui/tabledesignrowmenu.ui
+++ b/dbaccess/uiconfig/ui/tabledesignrowmenu.ui
@@ -26,6 +26,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="tabledesignrowmenu|paste">_Paste</property>
+ <property name="use-underline">True</property>
</object>
</child>
<child>
@@ -33,6 +34,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="tabledesignrowmenu|delete">_Delete</property>
+ <property name="use-underline">True</property>
</object>
</child>
<child>
@@ -40,6 +42,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="tabledesignrowmenu|insert">Insert Rows</property>
+ <property name="use-underline">True</property>
</object>
</child>
<child>
@@ -53,6 +56,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="tabledesignrowmenu|primarykey">Primary Key</property>
+ <property name="use-underline">True</property>
</object>
</child>
</object>
diff --git a/dbaccess/uiconfig/ui/useradminpage.ui b/dbaccess/uiconfig/ui/useradminpage.ui
index ac425dc5f7f6..7407e2574757 100644
--- a/dbaccess/uiconfig/ui/useradminpage.ui
+++ b/dbaccess/uiconfig/ui/useradminpage.ui
@@ -1,45 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.38.2 -->
<interface domain="dba">
<requires lib="gtk+" version="3.20"/>
+ <object class="GtkMenu" id="menu">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ </object>
<object class="GtkBox" id="UserAdminPage">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="border_width">6</property>
+ <property name="border-width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
+ <property name="margin-start">6</property>
+ <property name="margin-end">6</property>
+ <property name="margin-top">6</property>
<property name="hexpand">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
+ <property name="margin-top">6</property>
<property name="hexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
- <property name="margin-start">12</property>
- <property name="margin-top">6</property>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">start</property>
- <property name="hexpand">True</property>
<property name="label" translatable="yes" context="useradminpage|label3">Us_er:</property>
- <property name="use_underline">True</property>
+ <property name="use-underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -51,7 +56,7 @@
<child>
<object class="GtkComboBoxText" id="user">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
@@ -60,54 +65,20 @@
<property name="position">1</property>
</packing>
</child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="box3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="spacing">12</property>
<child>
- <object class="GtkButton" id="add">
- <property name="label" translatable="yes" context="useradminpage|add">_Add User...</property>
+ <object class="GtkMenuButton" id="action_menu">
+ <property name="label" translatable="yes" context="templatedlg|action_menu|label">_Manage</property>
+ <property name="use-underline">True</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="changepass">
- <property name="label" translatable="yes" context="useradminpage|changepass">Change _Password...</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="delete">
- <property name="label" translatable="yes" context="useradminpage|delete">_Delete User...</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="focus-on-click">False</property>
+ <property name="receives-default">True</property>
+ <property name="halign">end</property>
+ <property name="popup">menu</property>
+ <property name="draw-indicator">True</property>
+ <child>
+ <placeholder/>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -119,7 +90,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">0</property>
</packing>
</child>
</object>
@@ -127,7 +98,7 @@
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="useradminpage|label1">User Selection</property>
<attributes>
<attribute name="weight" value="bold"/>
@@ -144,21 +115,23 @@
<child>
<object class="GtkFrame" id="frame2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
+ <property name="margin-start">6</property>
+ <property name="margin-end">6</property>
+ <property name="margin-bottom">6</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
<child>
<object class="GtkBox" id="table">
+ <property name="height-request">150</property>
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-top">6</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="visible">True</property>
- <property name="height_request">150</property>
- <property name="can_focus">False</property>
<property name="orientation">vertical</property>
- <property name="margin-start">12</property>
- <property name="margin-top">6</property>
<child>
<placeholder/>
</child>
@@ -167,7 +140,7 @@
<child type="label">
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="useradminpage|label2">Access Rights for Selected User</property>
<attributes>
<attribute name="weight" value="bold"/>
diff --git a/dbaccess/win32/source/odbcconfig/odbcconfig.cxx b/dbaccess/win32/source/odbcconfig/odbcconfig.cxx
index 0cc48725c5e1..127d840c839e 100644
--- a/dbaccess/win32/source/odbcconfig/odbcconfig.cxx
+++ b/dbaccess/win32/source/odbcconfig/odbcconfig.cxx
@@ -18,11 +18,9 @@
*/
-#if !defined WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-#include <odbcinst.h>
+#include <sal/config.h>
+
+#include <systools/win32/odbccp32.hxx>
// displays the error text for the last error (GetLastError), and returns this error value
static int displayLastError()
@@ -102,7 +100,9 @@ extern "C" int APIENTRY wWinMain( HINSTANCE _hAppInstance, HINSTANCE, LPWSTR, in
if ( !IsWindow( hAppWindow ) )
return displayLastError();
- if (!SQLManageDataSources(hAppWindow))
+ // Have a odbccp32 variable, to not call FreeLibrary before displayLastError
+ sal::systools::odbccp32 odbccp32;
+ if (!odbccp32.SQLManageDataSources(hAppWindow))
return displayLastError();
return 0;