diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2011-03-09 23:17:51 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2011-03-09 23:17:51 -0600 |
commit | 9da3711604902d631ce93f45f74cfe30d1ec9409 (patch) | |
tree | 7228c5ec4f24b456c7b213f3448f6079982342e0 /dbaccess | |
parent | 14b3638399d2665b4fc1d69eb3a74d1f726b9153 (diff) | |
parent | c290b52a7aa1cd705ccbcf1faeecf9f03f0f70b0 (diff) |
Merge commit 'ooo/DEV300_m101' into integration/dev300_m101
* commit 'ooo/DEV300_m101': (76 commits)
masterfix DEV300: #i10000# usage of L10N build_type
removetooltypes01: Fix build problems after rebase to DEV300m99 in basctl, cui, reportdesign, sw
hr75: #i116747#: remove obsolete copyright notices
gnumake3: remove comphelper version; fix including extract.hxx
removetooltypes01: #i112600# Replace missing tools types replacement
removetooltypes01: #i112600# remove tooltypes from reportdesign
removetooltypes01: #i112600# remove tooltypes from dbaccess
undoapi: don't use deprecated JUnit API, this seems to fail now (but didn't before the rebase)
undoapi: those two classes do not belong into JAVATESTFILES, but JAVAFILES only
undoapi: (I|Sfx)UndoManager now working with size_t instead of USHORT
gridsort: give the UnoControl(Model/Base) classes a ctor taking a service factory, so we have access to the factory which created us, and don't need to resort to the process'es service factory
dba34b: #109956# notify column value in correct order
dba34b: #i114309# set default values for bit boolean and reset when we are on the insertrow
undoapi: assert unknown slots in ImplInvalidateFeature
dba34b: #i110907# check if design handle event
dba34b: #i109956# notify column values when row is refreshed
dba34b: #i115753# add test again
undoapi: renamed Undo.* to RptUndo.*, to not confuse a certain IDE with different same-named files in the source tree ...
undoapi: migrated report designer to use an own, model-bound UndoManager, instead of the UndoManager formerly bound to the controller
undoapi: split OSingleDocumentController into DBSubComponentController (which the report design's controller will be derived from) and the still-so-named OSingleDocumentController. Module reportdesign does not compile with this change, this is yet to come.
...
Conflicts:
dbaccess/inc/IEnvironment.hxx
dbaccess/inc/dataview.hxx
dbaccess/qa/complex/dbaccess/RowSet.java
dbaccess/source/core/api/CacheSet.cxx
dbaccess/source/core/api/KeySet.hxx
dbaccess/source/core/api/OptimisticSet.hxx
dbaccess/source/core/api/RowSet.cxx
dbaccess/source/core/api/RowSetCache.cxx
dbaccess/source/ext/adabas/Acomponentmodule.cxx
dbaccess/source/ext/adabas/Aservices.cxx
dbaccess/source/filter/migration/cfgimport.cxx
dbaccess/source/filter/migration/cfgimport.hxx
dbaccess/source/filter/migration/cfgservices.cxx
dbaccess/source/filter/migration/makefile.mk
dbaccess/source/inc/cfg_reghelper.hxx
dbaccess/source/sdbtools/misc/sdbt_services.cxx
dbaccess/source/shared/cfg_reghelper.cxx
dbaccess/source/shared/cfgstrings.cxx
dbaccess/source/shared/registrationhelper.cxx
dbaccess/source/ui/app/AppController.cxx
dbaccess/source/ui/app/AppDetailPageHelper.cxx
dbaccess/source/ui/app/AppDetailPageHelper.hxx
dbaccess/source/ui/app/AppDetailView.cxx
dbaccess/source/ui/app/AppIconControl.cxx
dbaccess/source/ui/app/AppSwapWindow.cxx
dbaccess/source/ui/browser/brwctrlr.cxx
dbaccess/source/ui/browser/dataview.cxx
dbaccess/source/ui/browser/unodatbr.cxx
dbaccess/source/ui/control/dbtreelistbox.cxx
dbaccess/source/ui/control/opendoccontrols.cxx
dbaccess/source/ui/control/tabletree.cxx
dbaccess/source/ui/dlg/ConnectionHelper.cxx
dbaccess/source/ui/dlg/ConnectionPage.src
dbaccess/source/ui/dlg/ExtensionNotPresent.cxx
dbaccess/source/ui/dlg/ExtensionNotPresent.hrc
dbaccess/source/ui/dlg/ExtensionNotPresent.src
dbaccess/source/ui/dlg/TablesSingleDlg.cxx
dbaccess/source/ui/dlg/adodatalinks.hxx
dbaccess/source/ui/dlg/dbadmin2.src
dbaccess/source/ui/dlg/dbadminsetup.src
dbaccess/source/ui/dlg/dlgattr.cxx
dbaccess/source/ui/dlg/dlgsize.src
dbaccess/source/ui/dlg/makefile.mk
dbaccess/source/ui/dlg/sqlmessage.cxx
dbaccess/source/ui/inc/ExtensionNotPresent.hxx
dbaccess/source/ui/inc/TokenWriter.hxx
dbaccess/source/ui/inc/imageprovider.hxx
dbaccess/source/ui/misc/DExport.cxx
dbaccess/source/ui/misc/HtmlReader.cxx
dbaccess/source/ui/misc/RowSetDrop.cxx
dbaccess/source/ui/misc/RtfReader.cxx
dbaccess/source/ui/misc/TokenWriter.cxx
dbaccess/source/ui/misc/imageprovider.cxx
dbaccess/source/ui/misc/linkeddocuments.cxx
dbaccess/source/ui/misc/singledoccontroller.cxx
dbaccess/source/ui/querydesign/ConnectionData.hxx
dbaccess/source/ui/querydesign/JoinTableView.cxx
dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
dbaccess/source/ui/querydesign/TableConnectionData.cxx
dbaccess/source/ui/querydesign/TableWindowListBox.cxx
dbaccess/source/ui/relationdesign/RelationController.cxx
dbaccess/source/ui/relationdesign/RelationTableView.cxx
dbaccess/source/ui/tabledesign/table.src
reportdesign/inc/RptPage.hxx
reportdesign/qa/complex/reportdesign/ReportDesignerTest.java
reportdesign/source/core/api/ReportDefinition.cxx
reportdesign/source/core/sdr/ReportUndoFactory.cxx
reportdesign/source/core/sdr/UndoEnv.cxx
reportdesign/source/filter/xml/xmlservices.cxx
reportdesign/source/ui/dlg/GroupsSorting.cxx
reportdesign/source/ui/dlg/Navigator.cxx
reportdesign/source/ui/inspection/metadata.cxx
reportdesign/source/ui/misc/RptUndo.cxx
reportdesign/source/ui/misc/UITools.cxx
reportdesign/source/ui/misc/rptuiservices.cxx
reportdesign/source/ui/report/DesignView.cxx
reportdesign/source/ui/report/FixedTextColor.cxx
reportdesign/source/ui/report/ReportController.cxx
reportdesign/source/ui/report/ReportSection.cxx
reportdesign/source/ui/report/SectionView.cxx
reportdesign/source/ui/report/SectionWindow.cxx
reportdesign/source/ui/report/StartMarker.cxx
reportdesign/source/ui/report/ViewsWindow.cxx
reportdesign/source/ui/report/dlgedfunc.cxx
reportdesign/source/ui/report/report.src
Diffstat (limited to 'dbaccess')
319 files changed, 4683 insertions, 5818 deletions
diff --git a/dbaccess/inc/AsyncronousLink.hxx b/dbaccess/inc/AsyncronousLink.hxx index 36334a868..2157ebd3e 100644 --- a/dbaccess/inc/AsyncronousLink.hxx +++ b/dbaccess/inc/AsyncronousLink.hxx @@ -50,7 +50,7 @@ namespace dbaui protected: ::osl::Mutex m_aEventSafety; ::osl::Mutex m_aDestructionSafety; - ULONG m_nEventId; + sal_uLong m_nEventId; public: /** constructs the object diff --git a/dbaccess/inc/IEnvironment.hxx b/dbaccess/inc/IEnvironment.hxx deleted file mode 100644 index 3033623e7..000000000 --- a/dbaccess/inc/IEnvironment.hxx +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef DBAUI_IENVIRONMENT_HXX -#define DBAUI_IENVIRONMENT_HXX - -#include <com/sun/star/sdbc/SQLException.hpp> - -#include <connectivity/standardsqlstate.hxx> - -namespace dbtools -{ - class SQLExceptionInfo; -} - -namespace dbaui -{ - // interface class for a generell environment - class IEnvironment - { - public: - /** appends an error in the current environment. - */ - virtual void appendError( - const ::rtl::OUString& _rErrorMessage, - const ::dbtools::StandardSQLState _eSQLState = ::dbtools::SQL_GENERAL_ERROR, - const sal_Int32 _nErrorCode = 1000 - ) = 0; - - /** clears the error state. - */ - virtual void clearError() = 0; - - /** @retrun - returns <TRUE/> when an error was set otherwise <FALSE/> - */ - virtual sal_Bool hasError() const = 0; - - /** returns the current error - */ - virtual const ::dbtools::SQLExceptionInfo& getError() const = 0; - - /** displays the current error, or does nothing if there is no current error - */ - virtual void displayError() = 0; - - /** gives access to the currently used connection - @return - the currently used connection. - */ - virtual const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& getConnection() const = 0; - }; -} -#endif // DBAUI_IENVIRONMENT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/inc/dataview.hxx b/dbaccess/inc/dataview.hxx index ac3e56211..e105db3d9 100644 --- a/dbaccess/inc/dataview.hxx +++ b/dbaccess/inc/dataview.hxx @@ -28,12 +28,14 @@ #ifndef DBAUI_DATAVIEW_HXX #define DBAUI_DATAVIEW_HXX -#include <vcl/window.hxx> +#include "dbaccessdllapi.h" + #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <svtools/acceleratorexecute.hxx> #include <sal/macros.h> +#include <vcl/fixed.hxx> + #include <memory> -#include "dbaccessdllapi.h" class FixedLine; class SvtMiscOptions; @@ -46,7 +48,7 @@ namespace dbaui protected: IController& m_rController; // the controller in where we resides in - FixedLine* m_pSeparator; // our separator above the toolbox (may be NULL) + FixedLine m_aSeparator; ::std::auto_ptr< ::svt::AcceleratorExecute> m_pAccel; public: @@ -71,9 +73,6 @@ namespace dbaui */ virtual void resizeControls(const Size& /*_rDiff*/) { Resize(); } - void enableSeparator( const sal_Bool _bEnable = sal_True ); - sal_Bool isSeparatorEnabled() const { return NULL != m_pSeparator; } - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() { return m_xServiceFactory;} // the default implementation simply calls resizeAll( GetSizePixel() ) diff --git a/dbaccess/inc/dbaccess_helpid.hrc b/dbaccess/inc/dbaccess_helpid.hrc index 0dcf6d624..2ab9c80c8 100644 --- a/dbaccess/inc/dbaccess_helpid.hrc +++ b/dbaccess/inc/dbaccess_helpid.hrc @@ -28,446 +28,440 @@ #ifndef _DBA_DBACCESS_HELPID_HRC_ #define _DBA_DBACCESS_HELPID_HRC_ -#ifndef _SOLAR_HRC -#include <svl/solar.hrc> // HID_DBACCESS_START -#endif - -#define HID_DSADMIN_CHARSET (HID_DBACCESS_START + 9) - -#define HID_DLG_FILTERCRIT (HID_DBACCESS_START + 15) -#define HID_DLG_ORDERCRIT (HID_DBACCESS_START + 16) - -#define HID_DATABROWSE_HEADER (HID_DBACCESS_START + 17) -#define HID_CTL_TABBROWSER (HID_DBACCESS_START + 18) -#define UID_DATABROWSE_DATAWINDOW (HID_DBACCESS_START + 19) -#define HID_CTL_TREEVIEW (HID_DBACCESS_START + 20) -#define UID_CTL_CONTENT (HID_DBACCESS_START + 21) -#define HID_TLB_TABBROWSER (HID_DBACCESS_START + 22) -#define HID_TLB_TREELISTBOX (HID_DBACCESS_START + 23) -#define HID_DSADMIN_DIALOG (HID_DBACCESS_START + 24) - - -#define HID_DSADMIN_TABCONTROL (HID_DBACCESS_START + 27) -#define HID_DSADMIN_PAGE_GENERAL (HID_DBACCESS_START + 28) -#define HID_DSADMIN_PAGE_DBASE (HID_DBACCESS_START + 29) -#define HID_DSADMIN_PAGE_JDBC (HID_DBACCESS_START + 30) -#define HID_DSADMIN_PAGE_ODBC (HID_DBACCESS_START + 31) -#define HID_DSADMIN_PAGE_ADABAS (HID_DBACCESS_START + 32) -#define HID_DSADMIN_PAGE_TEXT (HID_DBACCESS_START + 33) -#define HID_DSADMIN_TABLE_SUBSCRIPTION (HID_DBACCESS_START + 34) -#define HID_DSADMIN_DSACTIONS_NEWDS (HID_DBACCESS_START + 35) -#define HID_DSADMIN_DSACTIONS_DELETEDS (HID_DBACCESS_START + 36) -#define HID_DSADMIN_DSACTIONS_RESTOREDS (HID_DBACCESS_START + 37) -#define HID_DSADMIN_DSNAME (HID_DBACCESS_START + 38) -#define HID_DSADMIN_DSTYPE (HID_DBACCESS_START + 39) -#define HID_DSADMIN_URL_GENERAL (HID_DBACCESS_START + 40) -#define HID_DSADMIN_BROWSECONN (HID_DBACCESS_START + 41) -#define HID_DSADMIN_LOGINTIMEOUT_NUMBER (HID_DBACCESS_START + 42) -#define HID_DSADMIN_LOGINTIMEOUT_UNIT (HID_DBACCESS_START + 43) -#define HID_DSADMIN_SHOWDELETED (HID_DBACCESS_START + 44) -#define HID_DSADMIN_ALLOWLONG (HID_DBACCESS_START + 45) -#define HID_DSADMIN_DBASE_INDICIES (HID_DBACCESS_START + 46) -#define HID_DSADMIN_DRIVERCLASS (HID_DBACCESS_START + 47) -#define HID_DSADMIN_ODBC_OPTIONS (HID_DBACCESS_START + 48) -#define HID_DSADMIN_TEXT_HEADER (HID_DBACCESS_START + 49) -#define HID_DSADMIN_FIELD_SEPARATOR (HID_DBACCESS_START + 50) -#define HID_DSADMIN_TEXT_SEPARATOR (HID_DBACCESS_START + 51) -#define HID_DSADMIN_DECIMAL_SEPARATOR (HID_DBACCESS_START + 52) -#define HID_DSADMIN_THOUSANDS_SEPARATOR (HID_DBACCESS_START + 53) -#define HID_DSADMIN_EXTENSION (HID_DBACCESS_START + 54) -#define HID_DSADMIN_ALL_TABLES (HID_DBACCESS_START + 55) -#define HID_DSADMIN_NO_TABLES (HID_DBACCESS_START + 56) -#define HID_DSADMIN_SELECT_TABLES (HID_DBACCESS_START + 57) -#define HID_DSADMIN_TABLE_SELECTOR (HID_DBACCESS_START + 58) -#define HID_DSADMIN_SUPPRESS_VERSIONCL (HID_DBACCESS_START + 59) - -#define HID_GENERIC_SQL_ERROR (HID_DBACCESS_START + 60) - -#define HID_BROWSER_COLUMNFORMAT (HID_DBACCESS_START + 61) -#define HID_BROWSER_COLUMNWIDTH (HID_DBACCESS_START + 62) -#define HID_BROWSER_TABLEFORMAT (HID_DBACCESS_START + 63) -#define HID_BROWSER_ROWHEIGHT (HID_DBACCESS_START + 64) -#define HID_BROWSER_EDIT_DATABASE (HID_DBACCESS_START + 65) -#define HID_BROWSER_CLOSECONN (HID_DBACCESS_START + 66) -#define HID_BROWSER_REFRESHCONN (HID_DBACCESS_START + 67) - -#define HID_DLG_ROWHEIGHT (HID_DBACCESS_START + 68) -#define HID_DLG_COLWIDTH (HID_DBACCESS_START + 69) - - -#define HID_TLB_QUERYDESIGN (HID_DBACCESS_START + 70) -#define HID_CTL_QRYSQLEDIT (HID_DBACCESS_START + 71) -#define HID_DSADMIN_SPECIAL_MESSAGE (HID_DBACCESS_START + 72) - -#define HID_BROWSER_QUERY_CREATE_TEXT (HID_DBACCESS_START + 73) - -#define HID_DLG_ERROR (HID_DBACCESS_START + 74) -#define HID_DLG_TEXT (HID_DBACCESS_START + 75) -#define UID_SQLERROR_BUTTONMORE (HID_DBACCESS_START + 76) -#define HID_DLG_SAVE_AS (HID_DBACCESS_START + 77) - -#define HID_BROWSER_QUERY_EDIT (HID_DBACCESS_START + 78) -#define HID_BROWSER_QUERY_DELETE (HID_DBACCESS_START + 79) - -#define HID_DSADMIN_USER_ADO (HID_DBACCESS_START + 80) -#define HID_DSADMIN_PWDREC_ADO (HID_DBACCESS_START + 81) -#define HID_DSADMIN_CONNURL_ADOPAGE (HID_DBACCESS_START + 82) -#define HID_DSADMIN_PAGE_ADO (HID_DBACCESS_START + 83) - - -#define HID_JOINSH_ADDTAB_CLOSE (HID_DBACCESS_START + 84) -#define HID_JOINSH_ADDTAB_TABLELIST (HID_DBACCESS_START + 85) -#define HID_CTL_QRYDGNTAB (HID_DBACCESS_START + 86) -#define HID_DLG_QRY_JOIN (HID_DBACCESS_START + 87) -#define HID_DLG_QRY_JOINTYPE (HID_DBACCESS_START + 88) -#define HID_JOINSH_ADDTAB_QUERYLIST (HID_DBACCESS_START + 89) -#define HID_DLG_QRY_HELPTEXT (HID_DBACCESS_START + 92) - -#define HID_CTL_QRYDGNCRIT (HID_DBACCESS_START + 93) -#define HID_QRYDGN_ROW_VISIBLE (HID_DBACCESS_START + 94) -#define HID_QRYDGN_ROW_TABLE (HID_DBACCESS_START + 95) -#define HID_QRYDGN_ROW_FIELD (HID_DBACCESS_START + 96) -#define HID_QRYDGN_ROW_ORDER (HID_DBACCESS_START + 97) -#define HID_QRYDGN_ROW_FUNCTION (HID_DBACCESS_START + 98) -#define HID_QRYDGN_ROW_ALIAS (HID_DBACCESS_START + 99) -#define HID_QRYDGN_ROW_CRIT (HID_DBACCESS_START + 100) - -#define HID_QUERY_FUNCTION (HID_DBACCESS_START + 101) -#define HID_QUERY_TABLENAME (HID_DBACCESS_START + 102) -#define HID_QUERY_ALIASNAME (HID_DBACCESS_START + 103) -#define HID_QUERY_DISTINCT (HID_DBACCESS_START + 104) - -#define HID_BROWSER_QUERY_CREATE_DESIGN (HID_DBACCESS_START + 105) - -#define HID_DSADMIN_QUERIES (HID_DBACCESS_START + 106) -#define HID_DSADMIN_QUERIES_NEW (HID_DBACCESS_START + 107) -#define HID_DSADMIN_QUERIES_EDIT (HID_DBACCESS_START + 108) -#define HID_DSADMIN_QUERIES_DELETE (HID_DBACCESS_START + 109) -#define HID_DSADMIN_QUERYADMINISTRATION (HID_DBACCESS_START + 110) - - -#define HID_TAB_DESIGN_TABLE_DESC (HID_DBACCESS_START + 111) -#define HID_TAB_DESIGN_FIELDCONTROL (HID_DBACCESS_START + 112) -#define HID_TABLE_DESIGN_HELP_WINDOW (HID_DBACCESS_START + 113) -#define HID_TAB_DESIGN_DESCWIN (HID_DBACCESS_START + 114) -#define HID_TAB_DESIGN_TABLE_PROPS (HID_DBACCESS_START + 115) -#define HID_TABDESIGN_BACKGROUND (HID_DBACCESS_START + 116) -#define HID_CTL_TABLEEDIT (HID_DBACCESS_START + 117) -#define HID_TABDESIGN_NAMECELL (HID_DBACCESS_START + 118) -#define HID_TABDESIGN_TYPECELL (HID_DBACCESS_START + 119) -#define HID_TABDESIGN_COMMENTCELL (HID_DBACCESS_START + 120) -#define SID_TABLEDESIGN_INSERTROWS (HID_DBACCESS_START + 121) -#define SID_TABLEDESIGN_TABED_PRIMARYKEY (HID_DBACCESS_START + 122) -#define HID_TLB_TABLEDESIGN (HID_DBACCESS_START + 123) -#define HID_TAB_DESIGN_HELP_TEXT_FRAME (HID_DBACCESS_START + 124) -#define HID_TABLE_DESIGN_TABPAGE_GENERAL (HID_DBACCESS_START + 125) -#define HID_TAB_ENT_DEFAULT (HID_DBACCESS_START + 126) -#define HID_TAB_ENT_FORMAT_SAMPLE (HID_DBACCESS_START + 127) -#define HID_TAB_ENT_FORMAT (HID_DBACCESS_START + 128) -#define HID_TAB_ENT_BOOL_DEFAULT (HID_DBACCESS_START + 129) -#define HID_TAB_ENT_REQUIRED (HID_DBACCESS_START + 130) -#define HID_TAB_ENT_AUTOINCREMENT (HID_DBACCESS_START + 131) -#define HID_TAB_ENT_TEXT_LEN (HID_DBACCESS_START + 132) -#define HID_TAB_ENT_TYPE (HID_DBACCESS_START + 133) -#define HID_TAB_ENT_COLUMNNAME (HID_DBACCESS_START + 134) -#define HID_TAB_ENT_NUMTYP (HID_DBACCESS_START + 135) -#define HID_TAB_ENT_LEN (HID_DBACCESS_START + 136) -#define HID_TAB_ENT_SCALE (HID_DBACCESS_START + 137) -#define HID_BROWSER_TABLE_CREATE_DESIGN (HID_DBACCESS_START + 138) -#define HID_BROWSER_TABLE_EDIT (HID_DBACCESS_START + 139) -#define HID_BROWSER_TABLE_DELETE (HID_DBACCESS_START + 140) -#define HID_SQLERROR_EXCHAIN_ERRORS (HID_DBACCESS_START + 141) -#define HID_SQLERROR_EXCHAIN_TEXT (HID_DBACCESS_START + 142) -#define HID_TAB_WIZ_COLUMN_SELECT (HID_DBACCESS_START + 146) -#define HID_TAB_WIZ_TYPE_SELECT (HID_DBACCESS_START + 147) -#define HID_TAB_NAMEMATCHING_COLS_AVAIL (HID_DBACCESS_START + 148) -#define HID_TAB_NAMEMATCHING_COLS_ASSIGN (HID_DBACCESS_START + 149) -#define HID_TAB_WIZ_COPYTABLE (HID_DBACCESS_START + 150) -#define HID_TAB_WIZ_TABLENAME_EDIT (HID_DBACCESS_START + 151) -#define HID_CTL_RELATIONTAB (HID_DBACCESS_START + 152) -#define HID_TLB_RELATIONDESIGN (HID_DBACCESS_START + 153) -#define HID_RELATIONDIALOG_LEFTFIELDCELL (HID_DBACCESS_START + 154) -#define HID_RELATIONDIALOG_RIGHTFIELDCELL (HID_DBACCESS_START + 155) -#define HID_RELDLG_KEYFIELDS (HID_DBACCESS_START + 156) -#define HID_BROWSER_RELATION_DESIGN (HID_DBACCESS_START + 157) -#define HID_TABLE_DESIGN_NO_CONNECTION (HID_DBACCESS_START + 158) -#define HID_DSADMIN_CREATEDATABASE (HID_DBACCESS_START + 159) -#define HID_BROWSER_COLUMNINFO (HID_DBACCESS_START + 160) -#define HID_DSADMIN_USECATALOG (HID_DBACCESS_START + 161) -#define HID_BROWSER_VIEW_CREATE_DESIGN (HID_DBACCESS_START + 162) -#define HID_DSADMIN_DOCUMENTS (HID_DBACCESS_START + 166) -#define HID_DSADMIN_DOCUMENTLINKS (HID_DBACCESS_START + 167) -#define HID_DSADMIN_FILTER_EXPLANATION (HID_DBACCESS_START + 168) -#define HID_CONFIRM_DROP_BUTTON_ALL (HID_DBACCESS_START + 169) -#define HID_DSBROWSER_BOOKMARK_SELECTED (HID_DBACCESS_START + 170) -#define HID_DSADMIN_TABLE_TOOLBOX (HID_DBACCESS_START + 171) -#define HID_DSADMIN_QUERY_TOOLBOX (HID_DBACCESS_START + 172) -#define HID_DSADMIN_BOOKMARK_TOOLBOX (HID_DBACCESS_START + 173) -#define HID_DSADMIN_PAGE_LDAP (HID_DBACCESS_START + 174) -#define HID_DSADMIN_LDAP_HOSTNAME (HID_DBACCESS_START + 175) -#define HID_DSADMIN_LDAP_BASEDN (HID_DBACCESS_START + 176) -#define HID_DSADMIN_LDAP_PORTNUMBER (HID_DBACCESS_START + 177) -#define HID_DSBROWSER_BOOKMARKSELECTED (HID_DBACCESS_START + 178) -#define HID_DSBROWSER_DISCONNECTING (HID_DBACCESS_START + 179) -#define HID_TAB_PAGE_USERADMIN (HID_DBACCESS_START + 180) -#define HID_TAB_PAGE_PBUSER (HID_DBACCESS_START + 181) -#define HID_TAB_PAGE_PBCHGPWD (HID_DBACCESS_START + 182) -#define HID_TAB_PAGE_PBUSERDELETE (HID_DBACCESS_START + 183) -#define HID_TAB_PAGE_TBLGRANTS (HID_DBACCESS_START + 184) -#define HID_TAB_PAGE_LBUSER (HID_DBACCESS_START + 185) -#define HID_DSBROWSER_DIRECTSQL (HID_DBACCESS_START + 186) -#define HID_DSADMIN_LDAP_ROWCOUNT (HID_DBACCESS_START + 187) -#define HID_BROWSER_QUERY_EDITSQL (HID_DBACCESS_START + 189) -#define HID_DSADMIN_PAGE_MOZILLA (HID_DBACCESS_START + 190) -#define HID_DSADMIN_MOZILLA_PROFILE_NAME (HID_DBACCESS_START + 191) -#define HID_DSADMIN_THUNDERBIRD_PROFILE_NAME (HID_DBACCESS_START + 192) -#define HID_BROWSER_OPEN_DOCUMENT (HID_DBACCESS_START + 193) -#define HID_BROWSER_EDIT_DOCUMENT (HID_DBACCESS_START + 194) -#define HID_BROWSER_BEW_DOCUMENT (HID_DBACCESS_START + 195) -#define HID_DLG_PASSWORD (HID_DBACCESS_START + 196) - -#define HID_DLGIDX_NEWINDEX (HID_DBACCESS_START + 197) -#define HID_DLGIDX_DROPINDEX (HID_DBACCESS_START + 198) -#define HID_DLGIDX_RENAMEINDEX (HID_DBACCESS_START + 199) -#define HID_DLGIDX_SAVEINDEX (HID_DBACCESS_START + 200) -#define HID_DLGIDX_RESETINDEX (HID_DBACCESS_START + 201) -#define HID_DLGIDX_INDEXLIST (HID_DBACCESS_START + 202) -#define UID_DLGINDEX_INDEXDETAILS_BACK (HID_DBACCESS_START + 203) -#define UID_DLGINDEX_INDEXDETAILS_MAIN (HID_DBACCESS_START + 204) -#define HID_DLGINDEX_INDEXDETAILS_FIELD (HID_DBACCESS_START + 205) -#define HID_DLGINDEX_INDEXDETAILS_SORTORDER (HID_DBACCESS_START + 206) - -#define HID_DOCLINKEDIT_URL (HID_DBACCESS_START + 207) -#define HID_QUERY_SQLMODE (HID_DBACCESS_START + 208) - -#define HID_BROWSER_REFRESH_REBUILDVIEW (HID_DBACCESS_START + 209) -#define HID_BROWSER_RENAME_ENTRY (HID_DBACCESS_START + 210) - -#define HID_QUERY_EDIT_JOINCONNECTION (HID_DBACCESS_START + 211) - -#define HID_DLG_QRY_WINDOW_CONTROL (HID_DBACCESS_START + 212) -#define HID_DLG_QRY_LEFT_TABLE (HID_DBACCESS_START + 213) -#define HID_DLG_QRY_RIGHT_TABLE (HID_DBACCESS_START + 214) - -#define HID_DLG_REL_CASC_DEL (HID_DBACCESS_START + 215) -#define HID_DLG_REL_NO_CASC_DEL (HID_DBACCESS_START + 216) -#define HID_DLG_REL_CASC_DEL_NULL (HID_DBACCESS_START + 217) -#define HID_DLG_REL_CASC_DEL_DEFAULT (HID_DBACCESS_START + 218) - -#define HID_DLG_REL_CASC_UPD (HID_DBACCESS_START + 219) -#define HID_DLG_REL_NO_CASC_UPD (HID_DBACCESS_START + 220) -#define HID_DLG_REL_CASC_UPD_NULL (HID_DBACCESS_START + 221) -#define HID_DLG_REL_CASC_UPD_DEFAULT (HID_DBACCESS_START + 222) -#define HID_BROWSER_SAVE_RECORD (HID_DBACCESS_START + 223) -#define HID_BROWSER_UNDO_RECORD (HID_DBACCESS_START + 224) - -#define HID_DSADMIN_SQL92CHECK (HID_DBACCESS_START + 225) -#define HID_DSADMIN_AUTOINCREMENTVALUE (HID_DBACCESS_START + 226) -#define HID_DOCUMENT_CREATE_REPWIZ (HID_DBACCESS_START + 227) -#define HID_TAB_AUTOINCREMENTVALUE (HID_DBACCESS_START + 228) -#define HID_DSADMIN_RETRIEVE_AUTO (HID_DBACCESS_START + 229) -#define HID_DSADMIN_AUTORETRIEVEENABLED (HID_DBACCESS_START + 230) - -#define HID_DSADMIN_PAGE_MYSQL_ODBC (HID_DBACCESS_START + 231) -#define HID_TAB_PAGE_TABLEPRIVILEGES (HID_DBACCESS_START + 232) - -#define HID_DSADMIN_PAGE_USERDRIVER (HID_DBACCESS_START + 233) -#define HID_DSADMIN_USER_DEFINED (HID_DBACCESS_START + 234) -#define HID_DSADMIN_USERDEF_OPTIONS (HID_DBACCESS_START + 235) -#define HID_DSADMIN_CHARSET_USERDEF (HID_DBACCESS_START + 236) -#define HID_DSADMIN_USER_LDAP (HID_DBACCESS_START + 237) -#define HID_DSADMIN_PWDREC_LDAP (HID_DBACCESS_START + 238) -#define HID_DSADMIN_USESSL_LDAP (HID_DBACCESS_START + 239) -#define HID_BROWSER_QUERY_WIZARD (HID_DBACCESS_START + 237) - -#define HID_DLG_RENAME (HID_DBACCESS_START + 237) - -#define HID_DSADMIN_PAGE_MYSQL_JDBC (HID_DBACCESS_START + 238) - -#define HID_DSADMIN_DBASE_PATH (HID_DBACCESS_START + 239) -#define HID_DSADMIN_MYSQL_DATABASE (HID_DBACCESS_START + 240) -#define HID_DSADMIN_MYSQL_ODBC_DATASOURCE (HID_DBACCESS_START + 241) -#define HID_DSADMIN_ODBC_DATASOURCE (HID_DBACCESS_START + 242) -#define HID_DSADMIN_ADABAS_DATABASE (HID_DBACCESS_START + 243) -#define HID_DSADMIN_MSACCESS_MDB_FILE (HID_DBACCESS_START + 244) -#define HID_DSADMIN_PAGE_MSACCESS (HID_DBACCESS_START + 245) -#define HID_DSADMIN_FLAT_PATH (HID_DBACCESS_START + 246) -#define HID_DSADMIN_CALC_PATH (HID_DBACCESS_START + 247) -#define HID_DSADMIN_ADVANCED (HID_DBACCESS_START + 248) -#define HID_DSADMIN_BOOLEANCOMPARISON (HID_DBACCESS_START + 249) -#define HID_DSADMIN_ORACLE_DATABASE (HID_DBACCESS_START + 250) - -#define UID_APP_VIEW (HID_DBACCESS_START + 251) -#define HID_APP_TABLE_TREE (HID_DBACCESS_START + 252) -#define HID_APP_FORM_TREE (HID_DBACCESS_START + 253) -#define HID_APP_QUERY_TREE (HID_DBACCESS_START + 254) -#define HID_APP_REPORT_TREE (HID_DBACCESS_START + 255) -#define UID_APP_DETAIL_VIEW (HID_DBACCESS_START + 256) -#define UID_APP_VIEW_VERT_SPLIT (HID_DBACCESS_START + 257) -#define UID_APP_VIEW_BORDER_WIN (HID_DBACCESS_START + 258) -#define HID_APP_CREATION_LIST (HID_DBACCESS_START + 259) -#define UID_APP_SWAP_VIEW (HID_DBACCESS_START + 260) -#define UID_DLG_TABLE_FILTER (HID_DBACCESS_START + 261) -#define HID_APP_SWAP_ICONCONTROL (HID_DBACCESS_START + 262) - -#define HID_DSADMIN_APPENDTABLEALIAS (HID_DBACCESS_START + 263) -#define HID_DSADMIN_PARAMETERNAMESUBST (HID_DBACCESS_START + 264) -#define HID_DSADMIN_IGNOREDRIVER_PRIV (HID_DBACCESS_START + 265) -#define HID_DSADMIN_HOSTNAME (HID_DBACCESS_START + 266) -#define HID_DSADMIN_PORTNUMBER (HID_DBACCESS_START + 267) - -#define HID_APP_HELP_TEXT (HID_DBACCESS_START + 268) -#define HID_EXPLORERDLG_COLLECTION (HID_DBACCESS_START + 269) -#define UID_APP_DATABASE_VIEW (HID_DBACCESS_START + 270) -#define UID_APP_TASKS_VIEW (HID_DBACCESS_START + 271) -#define UID_APP_CONTAINER_VIEW (HID_DBACCESS_START + 272) -#define UID_APP_TASKS_WINDOW (HID_DBACCESS_START + 273) -#define HID_APP_DESCRIPTION_TEXT (HID_DBACCESS_START + 274) -#define UID_APP_DETAILPAGE_HELPER (HID_DBACCESS_START + 275) -#define HID_APP_VIEW_PREVIEW_CB (HID_DBACCESS_START + 276) -#define HID_APP_VIEW_PREVIEW_1 (HID_DBACCESS_START + 277) -#define HID_APP_VIEW_PREVIEW_2 (HID_DBACCESS_START + 278) -#define HID_TABDESIGN_HELPTEXT (HID_DBACCESS_START + 279) -#define UID_APP_VIEW_HORZ_SPLIT (HID_DBACCESS_START + 280) -#define UID_APP_VIEW_PREVIEW_1 (HID_DBACCESS_START + 281) -#define HID_APP_VIEW_PREVIEW_3 (HID_DBACCESS_START + 282) - -#define HID_DSADMIN_TYPE_DIALOG (HID_DBACCESS_START + 283) -#define HID_DSADMIN_ENABLEOUTERJOIN (HID_DBACCESS_START + 284) -#define HID_DSADMIN_ADABASADMIN (HID_DBACCESS_START + 285) -#define HID_DSADMIN_USERADMIN (HID_DBACCESS_START + 286) - -#define HID_DBWIZ_PREVIOUS (HID_DBACCESS_START + 287) -#define HID_DBWIZ_NEXT (HID_DBACCESS_START + 288) -#define HID_DBWIZ_CANCEL (HID_DBACCESS_START + 289) -#define HID_DBWIZ_FINISH (HID_DBACCESS_START + 290) -#define UID_DBWIZ_HELP (HID_DBACCESS_START + 291) - -#define HID_DSADMIN_CATALOG (HID_DBACCESS_START + 292) -#define HID_DSADMIN_SCHEMA (HID_DBACCESS_START + 293) -#define HID_DSADMIN_IGNOREINDEXAPPENDIX (HID_DBACCESS_START + 294) -#define HID_DSADMIN_DOSLINEENDS (HID_DBACCESS_START + 295) - -#define HID_BROWSER_ADMINISTRATE (HID_DBACCESS_START + 296) - -#define HID_DSADMIN_AS_BEFORE_CORRELATION_NAME (HID_DBACCESS_START + 297) -#define HID_DSADMIN_CHECK_REQUIRED_FIELDS (HID_DBACCESS_START + 298) -#define HID_DSADMIN_ESCAPE_DATETIME (HID_DBACCESS_START + 299) - -#define HID_PAGE_DBWIZARD_GENERALPAGE (HID_DBACCESS_START + 300) -#define HID_PAGE_DBWIZARD_GENERAL_RB_CREATEDBDATABASE (HID_DBACCESS_START + 301) -#define HID_PAGE_DBWIZARD_GENERAL_RB_GETEXISTINGDATABASE (HID_DBACCESS_START + 302) - -#define HID_PAGE_DBWIZARD_DBASE_ET_DBASELOCATION (HID_DBACCESS_START + 304) -#define HID_PAGE_DBWIZARD_DBASE_PB_DBASELOCATION (HID_DBACCESS_START + 305) - - -#define HID_PAGE_DBWIZARD_TEXT_RB_ACCESSTXTFILES (HID_DBACCESS_START + 307) -#define HID_PAGE_DBWIZARD_TEXT_RB_ACCESSCSVFILES (HID_DBACCESS_START + 308) -#define HID_PAGE_DBWIZARD_TEXT_RB_ACCESSOTHERFILES (HID_DBACCESS_START + 309) -#define HID_PAGE_DBWIZARD_TEXT_ET_OWNEXTENSION (HID_DBACCESS_START + 310) - - -#define HID_PAGE_DBWIZARD_TEXT_ET_LOCATIONTEXTFILE (HID_DBACCESS_START + 311) -#define HID_PAGE_DBWIZARD_TEXT_PB_LOCATIONTEXTFILE (HID_DBACCESS_START + 312) -#define HID_PAGE_DBWIZARD_TEXT_CB_FIELDSEPARATOR (HID_DBACCESS_START + 313) -#define HID_PAGE_DBWIZARD_TEXT_CB_TEXTSEPARATOR (HID_DBACCESS_START + 314) -#define HID_PAGE_DBWIZARD_TEXT_CB_DECIMALSEPARATOR (HID_DBACCESS_START + 315) -#define HID_PAGE_DBWIZARD_TEXT_CB_THOUSANDSSEPARATOR (HID_DBACCESS_START + 316) - -#define HID_PAGE_DBWIZARD_MSACCESS_ET_MSACCESSLOCATION (HID_DBACCESS_START + 317) -#define HID_PAGE_DBWIZARD_MSACCESS_PB_MSACCESSLOCATION (HID_DBACCESS_START + 318) - -#define HID_PAGE_DBWIZARD_LDAP_ET_HOSTSERVER (HID_DBACCESS_START + 319) -#define HID_PAGE_DBWIZARD_LDAP_ET_BASEDN (HID_DBACCESS_START + 320) -#define HID_PAGE_DBWIZARD_LDAP_ET_PORTNUMBER (HID_DBACCESS_START + 321) -#define HID_PAGE_DBWIZARD_LDAP_CB_USESSL (HID_DBACCESS_START + 322) -#define HID_PAGE_DBWIZARD_LDAP_PB_TESTLDAPCONNECTION (HID_DBACCESS_START + 323) - -#define HID_PAGE_DBWIZARD_ADABAS_ET_ADABASNAME (HID_DBACCESS_START + 326) -#define HID_PAGE_DBWIZARD_ADABAS_PB_ADABASNAME (HID_DBACCESS_START + 327) - -#define HID_PAGE_DBWIZARD_MYSQL_RB_CONNECTVIAODBC (HID_DBACCESS_START + 329) -#define HID_PAGE_DBWIZARD_MYSQL_RB_CONNECTVIAJDBC (HID_DBACCESS_START + 330) - -#define HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEDBNAME (HID_DBACCESS_START + 333) -#define HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEHOSTSERVER (HID_DBACCESS_START + 334) -#define HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEPORT (HID_DBACCESS_START + 335) -#define HID_PAGE_DBWIZARD_ORACLE_ET_ORACLECLASS (HID_DBACCESS_START + 336) -#define HID_PAGE_DBWIZARD_ORACLE_PB_TESTORACLECLASS (HID_DBACCESS_START + 337) - -#define HID_PAGE_DBWIZARD_JDBC_ET_JDBCURL (HID_DBACCESS_START + 340) -#define HID_PAGE_DBWIZARD_JDBC_PB_JDBCURL (HID_DBACCESS_START + 341) - -#define HID_PAGE_DBWIZARD_JDBC_ET_JDBCCLASS (HID_DBACCESS_START + 342) -#define HID_PAGE_DBWIZARD_JDBC_PB_TESTJDBCCLASS (HID_DBACCESS_START + 343) - -#define HID_PAGE_DBWIZARD_JDBC_ET_MYSQLDBNAME (HID_DBACCESS_START + 344) -#define HID_PAGE_DBWIZARD_JDBC_ET_MYSQLHOSTSERVER (HID_DBACCESS_START + 345) -#define HID_PAGE_DBWIZARD_JDBC_ET_MYSQLPORT (HID_DBACCESS_START + 346) -#define HID_PAGE_DBWIZARD_JDBC_ET_MYSQLCLASS (HID_DBACCESS_START + 347) -#define HID_PAGE_DBWIZARD_JDBC_PB_TESTMYSQLCLASS (HID_DBACCESS_START + 348) - - -#define HID_PAGE_DBWIZARD_ADO_ET_ADOURL (HID_DBACCESS_START + 349) -#define HID_PAGE_DBWIZARD_ADO_PB_ADOURL (HID_DBACCESS_START + 350) -#define HID_PAGE_DBWIZARD_ADO_PB_TESTADOCONNECTION (HID_DBACCESS_START + 351) - -#define HID_PAGE_DBWIZARD_ODBC_ET_NAMEOFODBCDATASOURCE (HID_DBACCESS_START + 355) -#define HID_PAGE_DBWIZARD_ODBC_PB_NAMEOFODBCDATASOURCE (HID_DBACCESS_START + 356) - -#define HID_PAGE_DBWIZARD_SPREADSHEET_ET_SPREADSHEETPATH (HID_DBACCESS_START + 359) -#define HID_PAGE_DBWIZARD_SPREADSHEET_PB_SPREADSHEETPATH (HID_DBACCESS_START + 360) -#define HID_PAGE_DBWIZARD_SPREADSHEET_CB_SPREADSHEETPASSWORDREQUIRED (HID_DBACCESS_START + 361) - -#define HID_PAGE_DBWIZARD_AUTHENTIFICATION_CB_GENERALPASSWORDREQUIRED (HID_DBACCESS_START + 365) -#define HID_PAGE_DBWIZARD_AUTHENTIFICATION_ET_GENERALUSERNAME (HID_DBACCESS_START + 366) -#define HID_PAGE_DBWIZARD_AUTHENTIFICATION_PB_TESTCONNECTION (HID_DBACCESS_START + 367) +#define HID_DSADMIN_CHARSET "DBACCESS_HID_DSADMIN_CHARSET" + +#define HID_DLG_FILTERCRIT "DBACCESS_HID_DLG_FILTERCRIT" +#define HID_DLG_ORDERCRIT "DBACCESS_HID_DLG_ORDERCRIT" + +#define HID_DATABROWSE_HEADER "DBACCESS_HID_DATABROWSE_HEADER" +#define HID_CTL_TABBROWSER "DBACCESS_HID_CTL_TABBROWSER" +#define UID_DATABROWSE_DATAWINDOW "DBACCESS_UID_DATABROWSE_DATAWINDOW" +#define HID_CTL_TREEVIEW "DBACCESS_HID_CTL_TREEVIEW" +#define UID_CTL_CONTENT "DBACCESS_UID_CTL_CONTENT" +#define HID_TLB_TABBROWSER "DBACCESS_HID_TLB_TABBROWSER" +#define HID_TLB_TREELISTBOX "DBACCESS_HID_TLB_TREELISTBOX" +#define HID_DSADMIN_DIALOG "DBACCESS_HID_DSADMIN_DIALOG" + + +#define HID_DSADMIN_TABCONTROL "DBACCESS_HID_DSADMIN_TABCONTROL" +#define HID_DSADMIN_PAGE_GENERAL "DBACCESS_HID_DSADMIN_PAGE_GENERAL" +#define HID_DSADMIN_PAGE_DBASE "DBACCESS_HID_DSADMIN_PAGE_DBASE" +#define HID_DSADMIN_PAGE_JDBC "DBACCESS_HID_DSADMIN_PAGE_JDBC" +#define HID_DSADMIN_PAGE_ODBC "DBACCESS_HID_DSADMIN_PAGE_ODBC" +#define HID_DSADMIN_PAGE_ADABAS "DBACCESS_HID_DSADMIN_PAGE_ADABAS" +#define HID_DSADMIN_PAGE_TEXT "DBACCESS_HID_DSADMIN_PAGE_TEXT" +#define HID_DSADMIN_TABLE_SUBSCRIPTION "DBACCESS_HID_DSADMIN_TABLE_SUBSCRIPTION" +#define HID_DSADMIN_DSACTIONS_NEWDS "DBACCESS_HID_DSADMIN_DSACTIONS_NEWDS" +#define HID_DSADMIN_DSACTIONS_DELETEDS "DBACCESS_HID_DSADMIN_DSACTIONS_DELETEDS" +#define HID_DSADMIN_DSACTIONS_RESTOREDS "DBACCESS_HID_DSADMIN_DSACTIONS_RESTOREDS" +#define HID_DSADMIN_DSNAME "DBACCESS_HID_DSADMIN_DSNAME" +#define HID_DSADMIN_DSTYPE "DBACCESS_HID_DSADMIN_DSTYPE" +#define HID_DSADMIN_URL_GENERAL "DBACCESS_HID_DSADMIN_URL_GENERAL" +#define HID_DSADMIN_BROWSECONN "DBACCESS_HID_DSADMIN_BROWSECONN" +#define HID_DSADMIN_LOGINTIMEOUT_NUMBER "DBACCESS_HID_DSADMIN_LOGINTIMEOUT_NUMBER" +#define HID_DSADMIN_LOGINTIMEOUT_UNIT "DBACCESS_HID_DSADMIN_LOGINTIMEOUT_UNIT" +#define HID_DSADMIN_SHOWDELETED "DBACCESS_HID_DSADMIN_SHOWDELETED" +#define HID_DSADMIN_ALLOWLONG "DBACCESS_HID_DSADMIN_ALLOWLONG" +#define HID_DSADMIN_DBASE_INDICIES "DBACCESS_HID_DSADMIN_DBASE_INDICIES" +#define HID_DSADMIN_DRIVERCLASS "DBACCESS_HID_DSADMIN_DRIVERCLASS" +#define HID_DSADMIN_ODBC_OPTIONS "DBACCESS_HID_DSADMIN_ODBC_OPTIONS" +#define HID_DSADMIN_TEXT_HEADER "DBACCESS_HID_DSADMIN_TEXT_HEADER" +#define HID_DSADMIN_FIELD_SEPARATOR "DBACCESS_HID_DSADMIN_FIELD_SEPARATOR" +#define HID_DSADMIN_TEXT_SEPARATOR "DBACCESS_HID_DSADMIN_TEXT_SEPARATOR" +#define HID_DSADMIN_DECIMAL_SEPARATOR "DBACCESS_HID_DSADMIN_DECIMAL_SEPARATOR" +#define HID_DSADMIN_THOUSANDS_SEPARATOR "DBACCESS_HID_DSADMIN_THOUSANDS_SEPARATOR" +#define HID_DSADMIN_EXTENSION "DBACCESS_HID_DSADMIN_EXTENSION" +#define HID_DSADMIN_ALL_TABLES "DBACCESS_HID_DSADMIN_ALL_TABLES" +#define HID_DSADMIN_NO_TABLES "DBACCESS_HID_DSADMIN_NO_TABLES" +#define HID_DSADMIN_SELECT_TABLES "DBACCESS_HID_DSADMIN_SELECT_TABLES" +#define HID_DSADMIN_TABLE_SELECTOR "DBACCESS_HID_DSADMIN_TABLE_SELECTOR" +#define HID_DSADMIN_SUPPRESS_VERSIONCL "DBACCESS_HID_DSADMIN_SUPPRESS_VERSIONCL" + +#define HID_GENERIC_SQL_ERROR "DBACCESS_HID_GENERIC_SQL_ERROR" + +#define HID_BROWSER_COLUMNFORMAT "DBACCESS_HID_BROWSER_COLUMNFORMAT" +#define HID_BROWSER_COLUMNWIDTH "DBACCESS_HID_BROWSER_COLUMNWIDTH" +#define HID_BROWSER_TABLEFORMAT "DBACCESS_HID_BROWSER_TABLEFORMAT" +#define HID_BROWSER_ROWHEIGHT "DBACCESS_HID_BROWSER_ROWHEIGHT" +#define HID_BROWSER_EDIT_DATABASE "DBACCESS_HID_BROWSER_EDIT_DATABASE" +#define HID_BROWSER_CLOSECONN "DBACCESS_HID_BROWSER_CLOSECONN" +#define HID_BROWSER_REFRESHCONN "DBACCESS_HID_BROWSER_REFRESHCONN" + +#define HID_DLG_ROWHEIGHT "DBACCESS_HID_DLG_ROWHEIGHT" +#define HID_DLG_COLWIDTH "DBACCESS_HID_DLG_COLWIDTH" + + +#define HID_TLB_QUERYDESIGN "DBACCESS_HID_TLB_QUERYDESIGN" +#define HID_CTL_QRYSQLEDIT "DBACCESS_HID_CTL_QRYSQLEDIT" +#define HID_DSADMIN_SPECIAL_MESSAGE "DBACCESS_HID_DSADMIN_SPECIAL_MESSAGE" + +#define HID_BROWSER_QUERY_CREATE_TEXT "DBACCESS_HID_BROWSER_QUERY_CREATE_TEXT" + +#define HID_DLG_ERROR "DBACCESS_HID_DLG_ERROR" +#define HID_DLG_TEXT "DBACCESS_HID_DLG_TEXT" +#define UID_SQLERROR_BUTTONMORE "DBACCESS_UID_SQLERROR_BUTTONMORE" +#define HID_DLG_SAVE_AS "DBACCESS_HID_DLG_SAVE_AS" + +#define HID_BROWSER_QUERY_EDIT "DBACCESS_HID_BROWSER_QUERY_EDIT" +#define HID_BROWSER_QUERY_DELETE "DBACCESS_HID_BROWSER_QUERY_DELETE" + +#define HID_DSADMIN_USER_ADO "DBACCESS_HID_DSADMIN_USER_ADO" +#define HID_DSADMIN_PWDREC_ADO "DBACCESS_HID_DSADMIN_PWDREC_ADO" +#define HID_DSADMIN_CONNURL_ADOPAGE "DBACCESS_HID_DSADMIN_CONNURL_ADOPAGE" +#define HID_DSADMIN_PAGE_ADO "DBACCESS_HID_DSADMIN_PAGE_ADO" + + +#define HID_JOINSH_ADDTAB_CLOSE "DBACCESS_HID_JOINSH_ADDTAB_CLOSE" +#define HID_JOINSH_ADDTAB_TABLELIST "DBACCESS_HID_JOINSH_ADDTAB_TABLELIST" +#define HID_CTL_QRYDGNTAB "DBACCESS_HID_CTL_QRYDGNTAB" +#define HID_DLG_QRY_JOIN "DBACCESS_HID_DLG_QRY_JOIN" +#define HID_DLG_QRY_JOINTYPE "DBACCESS_HID_DLG_QRY_JOINTYPE" +#define HID_JOINSH_ADDTAB_QUERYLIST "DBACCESS_HID_JOINSH_ADDTAB_QUERYLIST" +#define HID_DLG_QRY_HELPTEXT "DBACCESS_HID_DLG_QRY_HELPTEXT" + +#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_QUERY_FUNCTION "DBACCESS_HID_QUERY_FUNCTION" +#define HID_QUERY_TABLENAME "DBACCESS_HID_QUERY_TABLENAME" +#define HID_QUERY_ALIASNAME "DBACCESS_HID_QUERY_ALIASNAME" +#define HID_QUERY_DISTINCT "DBACCESS_HID_QUERY_DISTINCT" + +#define HID_BROWSER_QUERY_CREATE_DESIGN "DBACCESS_HID_BROWSER_QUERY_CREATE_DESIGN" + +#define HID_DSADMIN_QUERIES "DBACCESS_HID_DSADMIN_QUERIES" +#define HID_DSADMIN_QUERIES_NEW "DBACCESS_HID_DSADMIN_QUERIES_NEW" +#define HID_DSADMIN_QUERIES_EDIT "DBACCESS_HID_DSADMIN_QUERIES_EDIT" +#define HID_DSADMIN_QUERIES_DELETE "DBACCESS_HID_DSADMIN_QUERIES_DELETE" +#define HID_DSADMIN_QUERYADMINISTRATION "DBACCESS_HID_DSADMIN_QUERYADMINISTRATION" + + +#define HID_TAB_DESIGN_TABLE_DESC "DBACCESS_HID_TAB_DESIGN_TABLE_DESC" +#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_TAB_DESIGN_TABLE_PROPS "DBACCESS_HID_TAB_DESIGN_TABLE_PROPS" +#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_TABLEDESIGN_INSERTROWS "DBACCESS_HID_TABLEDESIGN_INSERTROWS" +#define HID_TABLEDESIGN_TABED_PRIMARYKEY "DBACCESS_HID_TABLEDESIGN_TABED_PRIMARYKEY" +#define HID_TLB_TABLEDESIGN "DBACCESS_HID_TLB_TABLEDESIGN" +#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_BROWSER_TABLE_CREATE_DESIGN "DBACCESS_HID_BROWSER_TABLE_CREATE_DESIGN" +#define HID_BROWSER_TABLE_EDIT "DBACCESS_HID_BROWSER_TABLE_EDIT" +#define HID_BROWSER_TABLE_DELETE "DBACCESS_HID_BROWSER_TABLE_DELETE" +#define HID_SQLERROR_EXCHAIN_ERRORS "DBACCESS_HID_SQLERROR_EXCHAIN_ERRORS" +#define HID_SQLERROR_EXCHAIN_TEXT "DBACCESS_HID_SQLERROR_EXCHAIN_TEXT" +#define HID_TAB_WIZ_COLUMN_SELECT "DBACCESS_HID_TAB_WIZ_COLUMN_SELECT" +#define HID_TAB_WIZ_TYPE_SELECT "DBACCESS_HID_TAB_WIZ_TYPE_SELECT" +#define HID_TAB_NAMEMATCHING_COLS_AVAIL "DBACCESS_HID_TAB_NAMEMATCHING_COLS_AVAIL" +#define HID_TAB_NAMEMATCHING_COLS_ASSIGN "DBACCESS_HID_TAB_NAMEMATCHING_COLS_ASSIGN" +#define HID_TAB_WIZ_COPYTABLE "DBACCESS_HID_TAB_WIZ_COPYTABLE" +#define HID_TAB_WIZ_TABLENAME_EDIT "DBACCESS_HID_TAB_WIZ_TABLENAME_EDIT" +#define HID_CTL_RELATIONTAB "DBACCESS_HID_CTL_RELATIONTAB" +#define HID_TLB_RELATIONDESIGN "DBACCESS_HID_TLB_RELATIONDESIGN" +#define HID_RELATIONDIALOG_LEFTFIELDCELL "DBACCESS_HID_RELATIONDIALOG_LEFTFIELDCELL" +#define HID_RELATIONDIALOG_RIGHTFIELDCELL "DBACCESS_HID_RELATIONDIALOG_RIGHTFIELDCELL" +#define HID_RELDLG_KEYFIELDS "DBACCESS_HID_RELDLG_KEYFIELDS" +#define HID_BROWSER_RELATION_DESIGN "DBACCESS_HID_BROWSER_RELATION_DESIGN" +#define HID_TABLE_DESIGN_NO_CONNECTION "DBACCESS_HID_TABLE_DESIGN_NO_CONNECTION" +#define HID_DSADMIN_CREATEDATABASE "DBACCESS_HID_DSADMIN_CREATEDATABASE" +#define HID_BROWSER_COLUMNINFO "DBACCESS_HID_BROWSER_COLUMNINFO" +#define HID_DSADMIN_USECATALOG "DBACCESS_HID_DSADMIN_USECATALOG" +#define HID_BROWSER_VIEW_CREATE_DESIGN "DBACCESS_HID_BROWSER_VIEW_CREATE_DESIGN" +#define HID_DSADMIN_DOCUMENTS "DBACCESS_HID_DSADMIN_DOCUMENTS" +#define HID_DSADMIN_DOCUMENTLINKS "DBACCESS_HID_DSADMIN_DOCUMENTLINKS" +#define HID_DSADMIN_FILTER_EXPLANATION "DBACCESS_HID_DSADMIN_FILTER_EXPLANATION" +#define HID_CONFIRM_DROP_BUTTON_ALL "DBACCESS_HID_CONFIRM_DROP_BUTTON_ALL" +#define HID_DSBROWSER_BOOKMARK_SELECTED "DBACCESS_HID_DSBROWSER_BOOKMARK_SELECTED" +#define HID_DSADMIN_TABLE_TOOLBOX "DBACCESS_HID_DSADMIN_TABLE_TOOLBOX" +#define HID_DSADMIN_QUERY_TOOLBOX "DBACCESS_HID_DSADMIN_QUERY_TOOLBOX" +#define HID_DSADMIN_BOOKMARK_TOOLBOX "DBACCESS_HID_DSADMIN_BOOKMARK_TOOLBOX" +#define HID_DSADMIN_PAGE_LDAP "DBACCESS_HID_DSADMIN_PAGE_LDAP" +#define HID_DSADMIN_LDAP_HOSTNAME "DBACCESS_HID_DSADMIN_LDAP_HOSTNAME" +#define HID_DSADMIN_LDAP_BASEDN "DBACCESS_HID_DSADMIN_LDAP_BASEDN" +#define HID_DSADMIN_LDAP_PORTNUMBER "DBACCESS_HID_DSADMIN_LDAP_PORTNUMBER" +#define HID_DSBROWSER_BOOKMARKSELECTED "DBACCESS_HID_DSBROWSER_BOOKMARKSELECTED" +#define HID_DSBROWSER_DISCONNECTING "DBACCESS_HID_DSBROWSER_DISCONNECTING" +#define HID_TAB_PAGE_USERADMIN "DBACCESS_HID_TAB_PAGE_USERADMIN" +#define HID_TAB_PAGE_PBUSER "DBACCESS_HID_TAB_PAGE_PBUSER" +#define HID_TAB_PAGE_PBCHGPWD "DBACCESS_HID_TAB_PAGE_PBCHGPWD" +#define HID_TAB_PAGE_PBUSERDELETE "DBACCESS_HID_TAB_PAGE_PBUSERDELETE" +#define HID_TAB_PAGE_TBLGRANTS "DBACCESS_HID_TAB_PAGE_TBLGRANTS" +#define HID_TAB_PAGE_LBUSER "DBACCESS_HID_TAB_PAGE_LBUSER" +#define HID_DSBROWSER_DIRECTSQL "DBACCESS_HID_DSBROWSER_DIRECTSQL" +#define HID_DSADMIN_LDAP_ROWCOUNT "DBACCESS_HID_DSADMIN_LDAP_ROWCOUNT" +#define HID_BROWSER_QUERY_EDITSQL "DBACCESS_HID_BROWSER_QUERY_EDITSQL" +#define HID_DSADMIN_PAGE_MOZILLA "DBACCESS_HID_DSADMIN_PAGE_MOZILLA" +#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_BROWSER_OPEN_DOCUMENT "DBACCESS_HID_BROWSER_OPEN_DOCUMENT" +#define HID_BROWSER_EDIT_DOCUMENT "DBACCESS_HID_BROWSER_EDIT_DOCUMENT" +#define HID_BROWSER_BEW_DOCUMENT "DBACCESS_HID_BROWSER_BEW_DOCUMENT" +#define HID_DLG_PASSWORD "DBACCESS_HID_DLG_PASSWORD" + +#define HID_DLGIDX_NEWINDEX "DBACCESS_HID_DLGIDX_NEWINDEX" +#define HID_DLGIDX_DROPINDEX "DBACCESS_HID_DLGIDX_DROPINDEX" +#define HID_DLGIDX_RENAMEINDEX "DBACCESS_HID_DLGIDX_RENAMEINDEX" +#define HID_DLGIDX_SAVEINDEX "DBACCESS_HID_DLGIDX_SAVEINDEX" +#define HID_DLGIDX_RESETINDEX "DBACCESS_HID_DLGIDX_RESETINDEX" +#define HID_DLGIDX_INDEXLIST "DBACCESS_HID_DLGIDX_INDEXLIST" +#define UID_DLGINDEX_INDEXDETAILS_BACK "DBACCESS_UID_DLGINDEX_INDEXDETAILS_BACK" +#define UID_DLGINDEX_INDEXDETAILS_MAIN "DBACCESS_UID_DLGINDEX_INDEXDETAILS_MAIN" +#define HID_DLGINDEX_INDEXDETAILS_FIELD "DBACCESS_HID_DLGINDEX_INDEXDETAILS_FIELD" +#define HID_DLGINDEX_INDEXDETAILS_SORTORDER "DBACCESS_HID_DLGINDEX_INDEXDETAILS_SORTORDER" + +#define HID_DOCLINKEDIT_URL "DBACCESS_HID_DOCLINKEDIT_URL" +#define HID_QUERY_SQLMODE "DBACCESS_HID_QUERY_SQLMODE" + +#define HID_BROWSER_REFRESH_REBUILDVIEW "DBACCESS_HID_BROWSER_REFRESH_REBUILDVIEW" +#define HID_BROWSER_RENAME_ENTRY "DBACCESS_HID_BROWSER_RENAME_ENTRY" + +#define HID_QUERY_EDIT_JOINCONNECTION "DBACCESS_HID_QUERY_EDIT_JOINCONNECTION" + +#define HID_DLG_QRY_WINDOW_CONTROL "DBACCESS_HID_DLG_QRY_WINDOW_CONTROL" +#define HID_DLG_QRY_LEFT_TABLE "DBACCESS_HID_DLG_QRY_LEFT_TABLE" +#define HID_DLG_QRY_RIGHT_TABLE "DBACCESS_HID_DLG_QRY_RIGHT_TABLE" + +#define HID_DLG_REL_CASC_DEL "DBACCESS_HID_DLG_REL_CASC_DEL" +#define HID_DLG_REL_NO_CASC_DEL "DBACCESS_HID_DLG_REL_NO_CASC_DEL" +#define HID_DLG_REL_CASC_DEL_NULL "DBACCESS_HID_DLG_REL_CASC_DEL_NULL" +#define HID_DLG_REL_CASC_DEL_DEFAULT "DBACCESS_HID_DLG_REL_CASC_DEL_DEFAULT" + +#define HID_DLG_REL_CASC_UPD "DBACCESS_HID_DLG_REL_CASC_UPD" +#define HID_DLG_REL_NO_CASC_UPD "DBACCESS_HID_DLG_REL_NO_CASC_UPD" +#define HID_DLG_REL_CASC_UPD_NULL "DBACCESS_HID_DLG_REL_CASC_UPD_NULL" +#define HID_DLG_REL_CASC_UPD_DEFAULT "DBACCESS_HID_DLG_REL_CASC_UPD_DEFAULT" +#define HID_BROWSER_SAVE_RECORD "DBACCESS_HID_BROWSER_SAVE_RECORD" +#define HID_BROWSER_UNDO_RECORD "DBACCESS_HID_BROWSER_UNDO_RECORD" + +#define HID_DSADMIN_SQL92CHECK "DBACCESS_HID_DSADMIN_SQL92CHECK" +#define HID_DSADMIN_AUTOINCREMENTVALUE "DBACCESS_HID_DSADMIN_AUTOINCREMENTVALUE" +#define HID_DOCUMENT_CREATE_REPWIZ "DBACCESS_HID_DOCUMENT_CREATE_REPWIZ" +#define HID_TAB_AUTOINCREMENTVALUE "DBACCESS_HID_TAB_AUTOINCREMENTVALUE" +#define HID_DSADMIN_RETRIEVE_AUTO "DBACCESS_HID_DSADMIN_RETRIEVE_AUTO" +#define HID_DSADMIN_AUTORETRIEVEENABLED "DBACCESS_HID_DSADMIN_AUTORETRIEVEENABLED" + +#define HID_DSADMIN_PAGE_MYSQL_ODBC "DBACCESS_HID_DSADMIN_PAGE_MYSQL_ODBC" +#define HID_TAB_PAGE_TABLEPRIVILEGES "DBACCESS_HID_TAB_PAGE_TABLEPRIVILEGES" + +#define HID_DSADMIN_PAGE_USERDRIVER "DBACCESS_HID_DSADMIN_PAGE_USERDRIVER" +#define HID_DSADMIN_USER_DEFINED "DBACCESS_HID_DSADMIN_USER_DEFINED" +#define HID_DSADMIN_USERDEF_OPTIONS "DBACCESS_HID_DSADMIN_USERDEF_OPTIONS" +#define HID_DSADMIN_CHARSET_USERDEF "DBACCESS_HID_DSADMIN_CHARSET_USERDEF" +#define HID_DSADMIN_USER_LDAP "DBACCESS_HID_DSADMIN_USER_LDAP" +#define HID_DSADMIN_PWDREC_LDAP "DBACCESS_HID_DSADMIN_PWDREC_LDAP" +#define HID_DSADMIN_USESSL_LDAP "DBACCESS_HID_DSADMIN_USESSL_LDAP" +#define HID_BROWSER_QUERY_WIZARD "DBACCESS_HID_BROWSER_QUERY_WIZARD" + +#define HID_DLG_RENAME "DBACCESS_HID_DLG_RENAME" + +#define HID_DSADMIN_PAGE_MYSQL_JDBC "DBACCESS_HID_DSADMIN_PAGE_MYSQL_JDBC" + +#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_ADABAS_DATABASE "DBACCESS_HID_DSADMIN_ADABAS_DATABASE" +#define HID_DSADMIN_MSACCESS_MDB_FILE "DBACCESS_HID_DSADMIN_MSACCESS_MDB_FILE" +#define HID_DSADMIN_PAGE_MSACCESS "DBACCESS_HID_DSADMIN_PAGE_MSACCESS" +#define HID_DSADMIN_FLAT_PATH "DBACCESS_HID_DSADMIN_FLAT_PATH" +#define HID_DSADMIN_CALC_PATH "DBACCESS_HID_DSADMIN_CALC_PATH" +#define HID_DSADMIN_ADVANCED "DBACCESS_HID_DSADMIN_ADVANCED" +#define HID_DSADMIN_BOOLEANCOMPARISON "DBACCESS_HID_DSADMIN_BOOLEANCOMPARISON" +#define HID_DSADMIN_ORACLE_DATABASE "DBACCESS_HID_DSADMIN_ORACLE_DATABASE" +#define HID_DSADMIN_MAXROWSCAN "DBACCESS_HID_DSADMIN_MAXROWSCAN" + +#define UID_APP_VIEW "DBACCESS_UID_APP_VIEW" +#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 UID_APP_DETAIL_VIEW "DBACCESS_UID_APP_DETAIL_VIEW" +#define UID_APP_VIEW_VERT_SPLIT "DBACCESS_UID_APP_VIEW_VERT_SPLIT" +#define UID_APP_VIEW_BORDER_WIN "DBACCESS_UID_APP_VIEW_BORDER_WIN" +#define HID_APP_CREATION_LIST "DBACCESS_HID_APP_CREATION_LIST" +#define UID_APP_SWAP_VIEW "DBACCESS_UID_APP_SWAP_VIEW" +#define HID_APP_SWAP_ICONCONTROL "DBACCESS_HID_APP_SWAP_ICONCONTROL" + +#define HID_DSADMIN_APPENDTABLEALIAS "DBACCESS_HID_DSADMIN_APPENDTABLEALIAS" +#define HID_DSADMIN_PARAMETERNAMESUBST "DBACCESS_HID_DSADMIN_PARAMETERNAMESUBST" +#define HID_DSADMIN_IGNOREDRIVER_PRIV "DBACCESS_HID_DSADMIN_IGNOREDRIVER_PRIV" +#define HID_DSADMIN_HOSTNAME "DBACCESS_HID_DSADMIN_HOSTNAME" +#define HID_DSADMIN_PORTNUMBER "DBACCESS_HID_DSADMIN_PORTNUMBER" + +#define HID_APP_HELP_TEXT "DBACCESS_HID_APP_HELP_TEXT" +#define HID_EXPLORERDLG_COLLECTION "DBACCESS_HID_EXPLORERDLG_COLLECTION" +#define UID_APP_DATABASE_VIEW "DBACCESS_UID_APP_DATABASE_VIEW" +#define UID_APP_TASKS_VIEW "DBACCESS_UID_APP_TASKS_VIEW" +#define UID_APP_CONTAINER_VIEW "DBACCESS_UID_APP_CONTAINER_VIEW" +#define UID_APP_TASKS_WINDOW "DBACCESS_UID_APP_TASKS_WINDOW" +#define HID_APP_DESCRIPTION_TEXT "DBACCESS_HID_APP_DESCRIPTION_TEXT" +#define UID_APP_DETAILPAGE_HELPER "DBACCESS_UID_APP_DETAILPAGE_HELPER" +#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 UID_APP_VIEW_HORZ_SPLIT "DBACCESS_UID_APP_VIEW_HORZ_SPLIT" +#define UID_APP_VIEW_PREVIEW_1 "DBACCESS_UID_APP_VIEW_PREVIEW_1" +#define HID_APP_VIEW_PREVIEW_3 "DBACCESS_HID_APP_VIEW_PREVIEW_3" + +#define HID_DSADMIN_TYPE_DIALOG "DBACCESS_HID_DSADMIN_TYPE_DIALOG" +#define HID_DSADMIN_ENABLEOUTERJOIN "DBACCESS_HID_DSADMIN_ENABLEOUTERJOIN" +#define HID_DSADMIN_ADABASADMIN "DBACCESS_HID_DSADMIN_ADABASADMIN" +#define HID_DSADMIN_USERADMIN "DBACCESS_HID_DSADMIN_USERADMIN" + +#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" +#define UID_DBWIZ_HELP "DBACCESS_UID_DBWIZ_HELP" + +#define HID_DSADMIN_CATALOG "DBACCESS_HID_DSADMIN_CATALOG" +#define HID_DSADMIN_SCHEMA "DBACCESS_HID_DSADMIN_SCHEMA" +#define HID_DSADMIN_IGNOREINDEXAPPENDIX "DBACCESS_HID_DSADMIN_IGNOREINDEXAPPENDIX" +#define HID_DSADMIN_DOSLINEENDS "DBACCESS_HID_DSADMIN_DOSLINEENDS" + +#define HID_BROWSER_ADMINISTRATE "DBACCESS_HID_BROWSER_ADMINISTRATE" + +#define HID_DSADMIN_AS_BEFORE_CORRELATION_NAME "DBACCESS_HID_DSADMIN_AS_BEFORE_CORRELATION_NAME" +#define HID_DSADMIN_CHECK_REQUIRED_FIELDS "DBACCESS_HID_DSADMIN_CHECK_REQUIRED_FIELDS" +#define HID_DSADMIN_ESCAPE_DATETIME "DBACCESS_HID_DSADMIN_ESCAPE_DATETIME" + +#define HID_PAGE_DBWIZARD_GENERALPAGE "DBACCESS_HID_PAGE_DBWIZARD_GENERALPAGE" +#define HID_PAGE_DBWIZARD_GENERAL_RB_CREATEDBDATABASE "DBACCESS_HID_PAGE_DBWIZARD_GENERAL_RB_CREATEDBDATABASE" +#define HID_PAGE_DBWIZARD_GENERAL_RB_GETEXISTINGDATABASE "DBACCESS_HID_PAGE_DBWIZARD_GENERAL_RB_GETEXISTINGDATABASE" + +#define HID_PAGE_DBWIZARD_DBASE_ET_DBASELOCATION "DBACCESS_HID_PAGE_DBWIZARD_DBASE_ET_DBASELOCATION" +#define HID_PAGE_DBWIZARD_DBASE_PB_DBASELOCATION "DBACCESS_HID_PAGE_DBWIZARD_DBASE_PB_DBASELOCATION" + + +#define HID_PAGE_DBWIZARD_TEXT_RB_ACCESSTXTFILES "DBACCESS_HID_PAGE_DBWIZARD_TEXT_RB_ACCESSTXTFILES" +#define HID_PAGE_DBWIZARD_TEXT_RB_ACCESSCSVFILES "DBACCESS_HID_PAGE_DBWIZARD_TEXT_RB_ACCESSCSVFILES" +#define HID_PAGE_DBWIZARD_TEXT_RB_ACCESSOTHERFILES "DBACCESS_HID_PAGE_DBWIZARD_TEXT_RB_ACCESSOTHERFILES" +#define HID_PAGE_DBWIZARD_TEXT_ET_OWNEXTENSION "DBACCESS_HID_PAGE_DBWIZARD_TEXT_ET_OWNEXTENSION" + + +#define HID_PAGE_DBWIZARD_TEXT_ET_LOCATIONTEXTFILE "DBACCESS_HID_PAGE_DBWIZARD_TEXT_ET_LOCATIONTEXTFILE" +#define HID_PAGE_DBWIZARD_TEXT_PB_LOCATIONTEXTFILE "DBACCESS_HID_PAGE_DBWIZARD_TEXT_PB_LOCATIONTEXTFILE" +#define HID_PAGE_DBWIZARD_TEXT_CB_FIELDSEPARATOR "DBACCESS_HID_PAGE_DBWIZARD_TEXT_CB_FIELDSEPARATOR" +#define HID_PAGE_DBWIZARD_TEXT_CB_TEXTSEPARATOR "DBACCESS_HID_PAGE_DBWIZARD_TEXT_CB_TEXTSEPARATOR" +#define HID_PAGE_DBWIZARD_TEXT_CB_DECIMALSEPARATOR "DBACCESS_HID_PAGE_DBWIZARD_TEXT_CB_DECIMALSEPARATOR" +#define HID_PAGE_DBWIZARD_TEXT_CB_THOUSANDSSEPARATOR "DBACCESS_HID_PAGE_DBWIZARD_TEXT_CB_THOUSANDSSEPARATOR" + +#define HID_PAGE_DBWIZARD_MSACCESS_ET_MSACCESSLOCATION "DBACCESS_HID_PAGE_DBWIZARD_MSACCESS_ET_MSACCESSLOCATION" +#define HID_PAGE_DBWIZARD_MSACCESS_PB_MSACCESSLOCATION "DBACCESS_HID_PAGE_DBWIZARD_MSACCESS_PB_MSACCESSLOCATION" + +#define HID_PAGE_DBWIZARD_LDAP_ET_HOSTSERVER "DBACCESS_HID_PAGE_DBWIZARD_LDAP_ET_HOSTSERVER" +#define HID_PAGE_DBWIZARD_LDAP_ET_BASEDN "DBACCESS_HID_PAGE_DBWIZARD_LDAP_ET_BASEDN" +#define HID_PAGE_DBWIZARD_LDAP_ET_PORTNUMBER "DBACCESS_HID_PAGE_DBWIZARD_LDAP_ET_PORTNUMBER" +#define HID_PAGE_DBWIZARD_LDAP_CB_USESSL "DBACCESS_HID_PAGE_DBWIZARD_LDAP_CB_USESSL" +#define HID_PAGE_DBWIZARD_LDAP_PB_TESTLDAPCONNECTION "DBACCESS_HID_PAGE_DBWIZARD_LDAP_PB_TESTLDAPCONNECTION" + +#define HID_PAGE_DBWIZARD_ADABAS_ET_ADABASNAME "DBACCESS_HID_PAGE_DBWIZARD_ADABAS_ET_ADABASNAME" +#define HID_PAGE_DBWIZARD_ADABAS_PB_ADABASNAME "DBACCESS_HID_PAGE_DBWIZARD_ADABAS_PB_ADABASNAME" + +#define HID_PAGE_DBWIZARD_MYSQL_RB_CONNECTVIAODBC "DBACCESS_HID_PAGE_DBWIZARD_MYSQL_RB_CONNECTVIAODBC" +#define HID_PAGE_DBWIZARD_MYSQL_RB_CONNECTVIAJDBC "DBACCESS_HID_PAGE_DBWIZARD_MYSQL_RB_CONNECTVIAJDBC" + +#define HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEDBNAME "DBACCESS_HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEDBNAME" +#define HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEHOSTSERVER "DBACCESS_HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEHOSTSERVER" +#define HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEPORT "DBACCESS_HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEPORT" +#define HID_PAGE_DBWIZARD_ORACLE_ET_ORACLECLASS "DBACCESS_HID_PAGE_DBWIZARD_ORACLE_ET_ORACLECLASS" +#define HID_PAGE_DBWIZARD_ORACLE_PB_TESTORACLECLASS "DBACCESS_HID_PAGE_DBWIZARD_ORACLE_PB_TESTORACLECLASS" + +#define HID_PAGE_DBWIZARD_JDBC_ET_JDBCURL "DBACCESS_HID_PAGE_DBWIZARD_JDBC_ET_JDBCURL" +#define HID_PAGE_DBWIZARD_JDBC_PB_JDBCURL "DBACCESS_HID_PAGE_DBWIZARD_JDBC_PB_JDBCURL" + +#define HID_PAGE_DBWIZARD_JDBC_ET_JDBCCLASS "DBACCESS_HID_PAGE_DBWIZARD_JDBC_ET_JDBCCLASS" +#define HID_PAGE_DBWIZARD_JDBC_PB_TESTJDBCCLASS "DBACCESS_HID_PAGE_DBWIZARD_JDBC_PB_TESTJDBCCLASS" + +#define HID_PAGE_DBWIZARD_JDBC_ET_MYSQLDBNAME "DBACCESS_HID_PAGE_DBWIZARD_JDBC_ET_MYSQLDBNAME" +#define HID_PAGE_DBWIZARD_JDBC_ET_MYSQLHOSTSERVER "DBACCESS_HID_PAGE_DBWIZARD_JDBC_ET_MYSQLHOSTSERVER" +#define HID_PAGE_DBWIZARD_JDBC_ET_MYSQLPORT "DBACCESS_HID_PAGE_DBWIZARD_JDBC_ET_MYSQLPORT" +#define HID_PAGE_DBWIZARD_JDBC_ET_MYSQLCLASS "DBACCESS_HID_PAGE_DBWIZARD_JDBC_ET_MYSQLCLASS" +#define HID_PAGE_DBWIZARD_JDBC_PB_TESTMYSQLCLASS "DBACCESS_HID_PAGE_DBWIZARD_JDBC_PB_TESTMYSQLCLASS" + + +#define HID_PAGE_DBWIZARD_ADO_ET_ADOURL "DBACCESS_HID_PAGE_DBWIZARD_ADO_ET_ADOURL" +#define HID_PAGE_DBWIZARD_ADO_PB_ADOURL "DBACCESS_HID_PAGE_DBWIZARD_ADO_PB_ADOURL" +#define HID_PAGE_DBWIZARD_ADO_PB_TESTADOCONNECTION "DBACCESS_HID_PAGE_DBWIZARD_ADO_PB_TESTADOCONNECTION" + +#define HID_PAGE_DBWIZARD_ODBC_ET_NAMEOFODBCDATASOURCE "DBACCESS_HID_PAGE_DBWIZARD_ODBC_ET_NAMEOFODBCDATASOURCE" +#define HID_PAGE_DBWIZARD_ODBC_PB_NAMEOFODBCDATASOURCE "DBACCESS_HID_PAGE_DBWIZARD_ODBC_PB_NAMEOFODBCDATASOURCE" + +#define HID_PAGE_DBWIZARD_SPREADSHEET_ET_SPREADSHEETPATH "DBACCESS_HID_PAGE_DBWIZARD_SPREADSHEET_ET_SPREADSHEETPATH" +#define HID_PAGE_DBWIZARD_SPREADSHEET_PB_SPREADSHEETPATH "DBACCESS_HID_PAGE_DBWIZARD_SPREADSHEET_PB_SPREADSHEETPATH" +#define HID_PAGE_DBWIZARD_SPREADSHEET_CB_SPREADSHEETPASSWORDREQUIRED "DBACCESS_HID_PAGE_DBWIZARD_SPREADSHEET_CB_SPREADSHEETPASSWORDREQUIRED" + +#define HID_PAGE_DBWIZARD_AUTHENTIFICATION_CB_GENERALPASSWORDREQUIRED "DBACCESS_HID_PAGE_DBWIZARD_AUTHENTIFICATION_CB_GENERALPASSWORDREQUIRED" +#define HID_PAGE_DBWIZARD_AUTHENTIFICATION_ET_GENERALUSERNAME "DBACCESS_HID_PAGE_DBWIZARD_AUTHENTIFICATION_ET_GENERALUSERNAME" +#define HID_PAGE_DBWIZARD_AUTHENTIFICATION_PB_TESTCONNECTION "DBACCESS_HID_PAGE_DBWIZARD_AUTHENTIFICATION_PB_TESTCONNECTION" -#define HID_PAGE_DBWIZARD_FINAL_RB_REGISTERDATASOURCE (HID_DBACCESS_START + 373) -#define HID_PAGE_DBWIZARD_FINAL_RB_DONTREGISTERDATASOURCE (HID_DBACCESS_START + 374) -#define HID_PAGE_DBWIZARD_FINAL_CB_STARTTABLEWIZARD (HID_DBACCESS_START + 375) -#define HID_PAGE_DBWIZARD_FINAL_CB_OPENAFTERWARDS (HID_DBACCESS_START + 376) +#define HID_PAGE_DBWIZARD_FINAL_RB_REGISTERDATASOURCE "DBACCESS_HID_PAGE_DBWIZARD_FINAL_RB_REGISTERDATASOURCE" +#define HID_PAGE_DBWIZARD_FINAL_RB_DONTREGISTERDATASOURCE "DBACCESS_HID_PAGE_DBWIZARD_FINAL_RB_DONTREGISTERDATASOURCE" +#define HID_PAGE_DBWIZARD_FINAL_CB_STARTTABLEWIZARD "DBACCESS_HID_PAGE_DBWIZARD_FINAL_CB_STARTTABLEWIZARD" +#define HID_PAGE_DBWIZARD_FINAL_CB_OPENAFTERWARDS "DBACCESS_HID_PAGE_DBWIZARD_FINAL_CB_OPENAFTERWARDS" -#define HID_PAGE_DBWIZARD_USERDEFINED_ET_BROWSE (HID_DBACCESS_START + 377) -#define HID_PAGE_DBWIZARD_USERDEFINED_BROWSE (HID_DBACCESS_START + 378) -#define HID_INDEX_DIALOG_ACTION_TB (HID_DBACCESS_START + 379) +#define HID_PAGE_DBWIZARD_USERDEFINED_ET_BROWSE "DBACCESS_HID_PAGE_DBWIZARD_USERDEFINED_ET_BROWSE" +#define HID_PAGE_DBWIZARD_USERDEFINED_BROWSE "DBACCESS_HID_PAGE_DBWIZARD_USERDEFINED_BROWSE" +#define HID_INDEX_DIALOG_ACTION_TB "DBACCESS_HID_INDEX_DIALOG_ACTION_TB" -#define HID_DLG_DATABASE_WIZARD (HID_DBACCESS_START + 380) +#define HID_DLG_DATABASE_WIZARD "DBACCESS_HID_DLG_DATABASE_WIZARD" -#define HID_EXTENSION_NOT_PRESENT_DLG ( HID_DBACCESS_START + 381) -#define HID_DLG_QRY_JOIN_CONTROL ( HID_DBACCESS_START + 382) -#define HID_DSADMIN_IGNORECURRENCY ( HID_DBACCESS_START + 383) -#define HID_MACRO_MIGRATION_BACKUP_LOCATION ( HID_DBACCESS_START + 384) -#define HID_DSADMIN_PRIMARY_KEY_SUPPORT ( HID_DBACCESS_START + 385) +#define HID_EXTENSION_NOT_PRESENT_DLG "DBACCESS_HID_EXTENSION_NOT_PRESENT_DLG" +#define HID_DLG_QRY_JOIN_CONTROL "DBACCESS_HID_DLG_QRY_JOIN_CONTROL" +#define HID_DSADMIN_IGNORECURRENCY "DBACCESS_HID_DSADMIN_IGNORECURRENCY" +#define HID_MACRO_MIGRATION_BACKUP_LOCATION "DBACCESS_HID_MACRO_MIGRATION_BACKUP_LOCATION" +#define HID_DSADMIN_PRIMARY_KEY_SUPPORT "DBACCESS_HID_DSADMIN_PRIMARY_KEY_SUPPORT" // this one below have hid in number space HID_SBA_START -#define HID_DLG_ADABAS_NEWDB (HID_SBA_START + 0) -#define HID_DLG_ADABAS_DBNAME (HID_SBA_START + 1) -#define HID_DLG_ADABAS_SYSUSR (HID_SBA_START + 2) -#define HID_DLG_ADABAS_SYSPWD (HID_SBA_START + 3) -#define HID_DLG_ADABAS_CONUSR (HID_SBA_START + 4) -#define HID_DLG_ADABAS_CONPWD (HID_SBA_START + 5) -#define HID_DLG_ADABAS_DATADEVSPACE_SIZE (HID_SBA_START + 6) -#define HID_DLG_ADABAS_CACHE_SIZE (HID_SBA_START + 7) -#define HID_DLG_ADABAS_USR (HID_SBA_START + 8) -#define HID_DLG_ADABAS_DOMAINPWD (HID_SBA_START + 9) -#define HID_DLG_ADABAS_RESTORE (HID_SBA_START + 10) -#define HID_DLG_ADABAS_PBRESTORE (HID_SBA_START + 11) -#define HID_DLG_ADABAS_SYSDEVSPACE (HID_SBA_START + 12) -#define HID_DLG_ADABAS_PBSYSDEVSPACE (HID_SBA_START + 13) -#define HID_DLG_ADABAS_TRANSACTIONLOG (HID_SBA_START + 14) -#define HID_DLG_ADABAS_PBTRANSACTIONLOG (HID_SBA_START + 15) -#define HID_DLG_ADABAS_DATADEVSPACE (HID_SBA_START + 16) -#define HID_DLG_ADABAS_PBDATADEVSPACE (HID_SBA_START + 18) -#define HID_DLG_ADABAS_TRANSACTIONLOG_SIZE (HID_SBA_START + 19) -#define HID_DLG_ADABAS_CON_PWD (HID_SBA_START + 20) -#define HID_DLG_ADABAS_SYS_PWD (HID_SBA_START + 21) -#define HID_DLG_ADABAS_DOMAIN_PWD (HID_SBA_START + 22) -//end of HID_SBA_START - -// don't forget to update the file util/hidother.src - +#define HID_DLG_ADABAS_NEWDB "DBACCESS_HID_DLG_ADABAS_NEWDB" +#define HID_DLG_ADABAS_DBNAME "DBACCESS_HID_DLG_ADABAS_DBNAME" +#define HID_DLG_ADABAS_SYSUSR "DBACCESS_HID_DLG_ADABAS_SYSUSR" +#define HID_DLG_ADABAS_SYSPWD "DBACCESS_HID_DLG_ADABAS_SYSPWD" +#define HID_DLG_ADABAS_CONUSR "DBACCESS_HID_DLG_ADABAS_CONUSR" +#define HID_DLG_ADABAS_CONPWD "DBACCESS_HID_DLG_ADABAS_CONPWD" +#define HID_DLG_ADABAS_DATADEVSPACE_SIZE "DBACCESS_HID_DLG_ADABAS_DATADEVSPACE_SIZE" +#define HID_DLG_ADABAS_CACHE_SIZE "DBACCESS_HID_DLG_ADABAS_CACHE_SIZE" +#define HID_DLG_ADABAS_USR "DBACCESS_HID_DLG_ADABAS_USR" +#define HID_DLG_ADABAS_DOMAINPWD "DBACCESS_HID_DLG_ADABAS_DOMAINPWD" +#define HID_DLG_ADABAS_RESTORE "DBACCESS_HID_DLG_ADABAS_RESTORE" +#define HID_DLG_ADABAS_PBRESTORE "DBACCESS_HID_DLG_ADABAS_PBRESTORE" +#define HID_DLG_ADABAS_SYSDEVSPACE "DBACCESS_HID_DLG_ADABAS_SYSDEVSPACE" +#define HID_DLG_ADABAS_PBSYSDEVSPACE "DBACCESS_HID_DLG_ADABAS_PBSYSDEVSPACE" +#define HID_DLG_ADABAS_TRANSACTIONLOG "DBACCESS_HID_DLG_ADABAS_TRANSACTIONLOG" +#define HID_DLG_ADABAS_PBTRANSACTIONLOG "DBACCESS_HID_DLG_ADABAS_PBTRANSACTIONLOG" +#define HID_DLG_ADABAS_DATADEVSPACE "DBACCESS_HID_DLG_ADABAS_DATADEVSPACE" +#define HID_DLG_ADABAS_PBDATADEVSPACE "DBACCESS_HID_DLG_ADABAS_PBDATADEVSPACE" +#define HID_DLG_ADABAS_TRANSACTIONLOG_SIZE "DBACCESS_HID_DLG_ADABAS_TRANSACTIONLOG_SIZE" +#define HID_DLG_ADABAS_CON_PWD "DBACCESS_HID_DLG_ADABAS_CON_PWD" +#define HID_DLG_ADABAS_SYS_PWD "DBACCESS_HID_DLG_ADABAS_SYS_PWD" +#define HID_DLG_ADABAS_DOMAIN_PWD "DBACCESS_HID_DLG_ADABAS_DOMAIN_PWD" + +#define HID_DLG_JOIN_TABADD "DBACCESS_HID_DLG_JOIN_TABADD" #endif // _DBA_DBACCESS_HELPID_HRC_ diff --git a/dbaccess/inc/dbaccess_slotid.hrc b/dbaccess/inc/dbaccess_slotid.hrc index 6ecd68d05..ed569e232 100644 --- a/dbaccess/inc/dbaccess_slotid.hrc +++ b/dbaccess/inc/dbaccess_slotid.hrc @@ -109,6 +109,9 @@ #define SID_DB_APP_EDIT_SQL_VIEW ( SID_DBACCESS_START + 66 ) +#define SID_TABLEDESIGN_TABED_PRIMARYKEY ( SID_DBACCESS_START + 67 ) +#define SID_TABLEDESIGN_INSERTROWS ( SID_DBACCESS_START + 68 ) + #endif // _DBACCESS_SLOTID_HRC_ diff --git a/dbaccess/inc/dbaundomanager.hxx b/dbaccess/inc/dbaundomanager.hxx new file mode 100755 index 000000000..1b8627f66 --- /dev/null +++ b/dbaccess/inc/dbaundomanager.hxx @@ -0,0 +1,103 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef DBACCESS_DBAUNDOMANAGER_HXX +#define DBACCESS_DBAUNDOMANAGER_HXX + +#include "dbaccessdllapi.h" + +/** === begin UNO includes === **/ +#include <com/sun/star/document/XUndoManager.hpp> +/** === end UNO includes === **/ + +#include <cppuhelper/implbase1.hxx> + +#include <boost/scoped_ptr.hpp> + +class SfxUndoManager; + +//...................................................................................................................... +namespace dbaui +{ +//...................................................................................................................... + + //================================================================================================================== + //= UndoManager + //================================================================================================================== + struct UndoManager_Impl; + typedef ::cppu::ImplHelper1< ::com::sun::star::document::XUndoManager > UndoManager_Base; + class DBACCESS_DLLPUBLIC UndoManager : public UndoManager_Base + { + public: + UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ); + virtual ~UndoManager(); + + SfxUndoManager& GetSfxUndoManager() const; + + // XInterface + virtual void SAL_CALL acquire( ) throw (); + virtual void SAL_CALL release( ) throw (); + + // XComponent equivalents + void disposing(); + + // XUndoManager + virtual void SAL_CALL enterUndoContext( const ::rtl::OUString& i_title ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL enterHiddenUndoContext( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL leaveUndoContext( ) throw (::com::sun::star::util::InvalidStateException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addUndoAction( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoAction >& i_action ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL undo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL redo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isUndoPossible( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isRedoPossible( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getCurrentUndoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getCurrentRedoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllUndoActionTitles( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllRedoActionTitles( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clear( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clearRedo( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL reset( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException); + + // XLockable (base of XUndoManager) + virtual void SAL_CALL lock( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL unlock( ) throw (::com::sun::star::util::NotLockedException, ::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isLocked( ) throw (::com::sun::star::uno::RuntimeException); + + // XChild (base of XUndoManager) + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + + private: + ::boost::scoped_ptr< UndoManager_Impl > m_pImpl; + }; + +//...................................................................................................................... +} // namespace dbaui +//...................................................................................................................... + +#endif // DBACCESS_DBAUNDOMANAGER_HXX diff --git a/dbaccess/inc/singledoccontroller.hxx b/dbaccess/inc/dbsubcomponentcontroller.hxx index 7b61d7fad..98cb76552 100644 --- a/dbaccess/inc/singledoccontroller.hxx +++ b/dbaccess/inc/dbsubcomponentcontroller.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -26,11 +26,10 @@ * ************************************************************************/ -#ifndef DBAUI_SINGLEDOCCONTROLLER_HXX -#define DBAUI_SINGLEDOCCONTROLLER_HXX +#ifndef DBAUI_SUBCOMPONENTCONTROLLER_HXX +#define DBAUI_SUBCOMPONENTCONTROLLER_HXX #include "genericcontroller.hxx" -#include "IEnvironment.hxx" /** === begin UNO includes === **/ #include <com/sun/star/document/XScriptInvocationContext.hpp> @@ -46,7 +45,6 @@ #include <comphelper/propertycontainer.hxx> #include <connectivity/dbmetadata.hxx> #include <cppuhelper/implbase2.hxx> -#include <svl/undo.hxx> #include <memory> @@ -56,25 +54,20 @@ namespace dbaui //........................................................................ //==================================================================== - //= OSingleDocumentController + //= DBSubComponentController //==================================================================== - class OSingleDocumentController; + class DBSubComponentController; typedef ::cppu::ImplInheritanceHelper2 < OGenericUnoController , ::com::sun::star::document::XScriptInvocationContext , ::com::sun::star::util::XModifiable - > OSingleDocumentController_Base; + > DBSubComponentController_Base; - struct OSingleDocumentControllerImpl; - class DBACCESS_DLLPUBLIC OSingleDocumentController - :public OSingleDocumentController_Base - ,public IEnvironment + struct DBSubComponentController_Impl; + class DBACCESS_DLLPUBLIC DBSubComponentController : public DBSubComponentController_Base { private: - ::std::auto_ptr<OSingleDocumentControllerImpl> m_pImpl; - - protected: - SfxUndoManager m_aUndoManager; + ::std::auto_ptr<DBSubComponentController_Impl> m_pImpl; private: /** forces usage of a connection which we do not own @@ -86,9 +79,7 @@ namespace dbaui // OGenericUnoController - initialization virtual void impl_initialize(); - // state of a feature. 'feature' may be the handle of a ::com::sun::star::util::URL somebody requested a dispatch interface for OR a toolbar slot. - virtual FeatureState GetState(sal_uInt16 nId) const; - // execute a feature + // OGenericUnoController virtual void Execute(sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs); virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > getPrivateModel() const; @@ -102,17 +93,9 @@ namespace dbaui sal_Bool isEditable() const; void setEditable(sal_Bool _bEditable); - // need for undo's and redo's - SfxUndoManager* getUndoMgr(); - - /** addUndoActionAndInvalidate adds an undo action to the undoManager, - additionally invalidates the UNDO and REDO slot - @param pAction the undo action to add - */ - void addUndoActionAndInvalidate(SfxUndoAction *pAction); // ---------------------------------------------------------------- // asking for connection-related stuff - + sal_Bool isConnected() const; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > @@ -132,10 +115,9 @@ namespace dbaui */ const ::dbtools::DatabaseMetaData& getSdbMetaData() const; - // IEnvironment /** appends an error in the current environment. */ - virtual void appendError( + void appendError( const ::rtl::OUString& _rErrorMessage, const ::dbtools::StandardSQLState _eSQLState = ::dbtools::SQL_GENERAL_ERROR, const sal_Int32 _nErrorCode = 1000 @@ -143,20 +125,20 @@ namespace dbaui /** clears the error state. */ - virtual void clearError(); + void clearError(); /** @return <TRUE/> when an error was set otherwise <FALSE/> */ - virtual sal_Bool hasError() const; + sal_Bool hasError() const; /** returns the current error */ - virtual const ::dbtools::SQLExceptionInfo& getError() const; + const ::dbtools::SQLExceptionInfo& getError() const; /** displays the current error, or does nothing if there is no current error */ - virtual void displayError(); + void displayError(); /** shows an info box with the string conntection lost. */ @@ -166,7 +148,7 @@ namespace dbaui @return the currently used connection. */ - virtual const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& getConnection() const; /** returns the number formatter @@ -192,8 +174,8 @@ namespace dbaui virtual ::rtl::OUString SAL_CALL getTitle( ) throw (::com::sun::star::uno::RuntimeException); protected: - OSingleDocumentController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxORB); - virtual ~OSingleDocumentController(); + DBSubComponentController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxORB); + virtual ~DBSubComponentController(); virtual void disconnect(); virtual void reconnect( sal_Bool _bUI ); @@ -204,9 +186,6 @@ namespace dbaui */ virtual void losingConnection( ); - // late construction - virtual sal_Bool Construct(Window* pParent); - protected: // XEventListener virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException ); @@ -224,13 +203,13 @@ namespace dbaui sal_Int32 getCurrentStartNumber() const; private: - OSingleDocumentController(); // never implemented + DBSubComponentController(); // never implemented }; //........................................................................ } // namespace dbaui //........................................................................ -#endif // DBAUI_SINGLEDOCCONTROLLER_HXX +#endif // DBAUI_SUBCOMPONENTCONTROLLER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/inc/genericcontroller.hxx b/dbaccess/inc/genericcontroller.hxx index d31229fbc..53407af03 100644 --- a/dbaccess/inc/genericcontroller.hxx +++ b/dbaccess/inc/genericcontroller.hxx @@ -281,7 +281,7 @@ namespace dbaui @param _nHelpId The help id to dispatch. */ - void openHelpAgent(sal_Int32 _nHelpId); + void openHelpAgent( const rtl::OString& _sHelpId ); /** open the help agent for the given help url. @param _pHelpStringURL diff --git a/dbaccess/prj/build.lst b/dbaccess/prj/build.lst index f8b050257..ca2fa7185 100644 --- a/dbaccess/prj/build.lst +++ b/dbaccess/prj/build.lst @@ -1,4 +1,4 @@ -ba dbaccess : l10n BOOST:boost connectivity svx stoc qadevOOo xmlscript NULL +ba dbaccess : L10N:l10n BOOST:boost connectivity svx stoc qadevOOo xmlscript LIBXSLT:libxslt test NULL ba dbaccess usr1 - all ba_mkout NULL ba dbaccess\inc nmake - all ba_inc NULL ba dbaccess\source\ui\inc nmake - all ba_uiinc ba_inc NULL @@ -8,7 +8,6 @@ ba dbaccess\source\core\recovery nmake - all ba_crecovery ba_inc NULL ba dbaccess\source\core\misc nmake - all ba_cmisc ba_inc NULL ba dbaccess\source\core\resource nmake - all ba_cres ba_inc NULL ba dbaccess\source\filter\xml nmake - all ba_ffilter ba_shared ba_util ba_inc NULL -ba dbaccess\source\filter\migration nmake - all ba_fmigration ba_shared ba_inc NULL ba dbaccess\source\shared nmake - all ba_shared ba_cres ba_inc NULL ba dbaccess\source\sdbtools\connection nmake - all ba_conntools ba_inc NULL ba dbaccess\source\sdbtools\misc nmake - all ba_misctools ba_inc NULL @@ -27,5 +26,8 @@ ba dbaccess\source\ui\uno nmake - all ba_uiuno ba_inc NULL ba dbaccess\source\ui\imagelists nmake - all ba_uiimglst ba_inc NULL ba dbaccess\util nmake - all ba_util ba_uiimglst ba_capi ba_cdaccess ba_cmisc ba_crecovery ba_shared ba_uibrowser ba_uiapp ba_uicontrol ba_uidlg ba_uimisc ba_uiquery ba_uitabledesign ba_uirelationdesign ba_uiuno ba_conntools ba_misctools ba_miscres ba_ext_adabasui NULL ba dbaccess\win32\source\odbcconfig nmake - w ba_odbcconfig ba_inc NULL -ba dbaccess\qa\complex\dbaccess nmake - all ba_complex_tests NULL ba dbaccess\qa\unoapi nmake - all ba_q_unoapi NULL + +# complex tests doesn't work +# ba dbaccess\qa\complex\dbaccess nmake - all ba_qa_complex NULL + diff --git a/dbaccess/prj/d.lst b/dbaccess/prj/d.lst index 383cc119c..543714657 100644 --- a/dbaccess/prj/d.lst +++ b/dbaccess/prj/d.lst @@ -51,3 +51,9 @@ touch: ..\%__SRC%\misc\dbaccess.hid %_DEST%\bin%_EXT%\dba.hid ..\inc\*.hxx %_DEST%\inc%_EXT%\dbaccess\*.hxx ..\inc\*.h %_DEST%\inc%_EXT%\dbaccess\*.h +..\%__SRC%\misc\adabasui.component %_DEST%\xml%_EXT%\adabasui.component +..\%__SRC%\misc\dba.component %_DEST%\xml%_EXT%\dba.component +..\%__SRC%\misc\dbaxml.component %_DEST%\xml%_EXT%\dbaxml.component +..\%__SRC%\misc\dbmm.component %_DEST%\xml%_EXT%\dbmm.component +..\%__SRC%\misc\dbu.component %_DEST%\xml%_EXT%\dbu.component +..\%__SRC%\misc\sdbt.component %_DEST%\xml%_EXT%\sdbt.component diff --git a/dbaccess/qa/complex/dbaccess/ApplicationController.java b/dbaccess/qa/complex/dbaccess/ApplicationController.java index 33a62821a..9d7544cd2 100644 --- a/dbaccess/qa/complex/dbaccess/ApplicationController.java +++ b/dbaccess/qa/complex/dbaccess/ApplicationController.java @@ -27,27 +27,30 @@ package complex.dbaccess; import com.sun.star.beans.PropertyValue; -import com.sun.star.beans.XPropertySet; import com.sun.star.container.XNameAccess; import com.sun.star.frame.FrameSearchFlag; import com.sun.star.frame.XComponentLoader; import com.sun.star.frame.XModel; import com.sun.star.frame.XStorable; import com.sun.star.lang.XComponent; -import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.sdb.XOfficeDatabaseDocument; import com.sun.star.sdb.application.XDatabaseDocumentUI; import com.sun.star.sdbcx.XTablesSupplier; import com.sun.star.uno.Exception; import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XComponentContext; import connectivity.tools.HsqlColumnDescriptor; import connectivity.tools.HsqlDatabase; import connectivity.tools.HsqlTableDescriptor; -import helper.URLHelper; -import java.io.File; import java.io.IOException; + +// ---------- junit imports ----------------- +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import static org.junit.Assert.*; +// ------------------------------------------ + /** complex test case for Base's application UI */ public class ApplicationController extends TestCase @@ -63,16 +66,6 @@ public class ApplicationController extends TestCase } // -------------------------------------------------------------------------------------------------------- - - public String[] getTestMethodNames() - { - return new String[] - { - "checkSaveAs" - }; - } - - // -------------------------------------------------------------------------------------------------------- public String getTestObjectName() { return getClass().getName(); @@ -98,16 +91,16 @@ public class ApplicationController extends TestCase // create/load the new database document m_database = (_documentURL == null) - ? new HsqlDatabase(getORB()) - : new HsqlDatabase(getORB(), _documentURL); + ? new HsqlDatabase(getMSF()) + : new HsqlDatabase(getMSF(), _documentURL); m_databaseDocument = m_database.getDatabaseDocument(); // load it into a frame - final Object object = getORB().createInstance("com.sun.star.frame.Desktop"); + final Object object = getMSF().createInstance("com.sun.star.frame.Desktop"); final XComponentLoader xComponentLoader = UnoRuntime.queryInterface(XComponentLoader.class, object); final XComponent loadedComponent = xComponentLoader.loadComponentFromURL(m_database.getDocumentURL(), "_blank", FrameSearchFlag.ALL, new PropertyValue[0]); - assure("too many document instances!", + assertTrue("too many document instances!", UnoRuntime.areSame(loadedComponent, m_databaseDocument)); // get the controller, which provides access to various UI operations @@ -118,6 +111,8 @@ public class ApplicationController extends TestCase } // -------------------------------------------------------------------------------------------------------- + @Before + @Override public void before() throws java.lang.Exception { super.before(); @@ -125,6 +120,8 @@ public class ApplicationController extends TestCase } // -------------------------------------------------------------------------------------------------------- + @After + @Override public void after() throws java.lang.Exception { impl_closeDocument(); @@ -132,6 +129,7 @@ public class ApplicationController extends TestCase } // -------------------------------------------------------------------------------------------------------- + @Test public void checkSaveAs() throws Exception, IOException, java.lang.Exception { // issue 93737 describes the problem that when you save-as a database document, and do changes to it, @@ -146,7 +144,7 @@ public class ApplicationController extends TestCase // connect m_documentUI.connect(); - assure("could not connect to " + m_database.getDocumentURL(), m_documentUI.isConnected()); + assertTrue("could not connect to " + m_database.getDocumentURL(), m_documentUI.isConnected()); // create a table in the database m_database.createTable(new HsqlTableDescriptor("abc", new HsqlColumnDescriptor[] @@ -159,18 +157,18 @@ public class ApplicationController extends TestCase // load the old document, and verify there is *no* table therein impl_switchToDocument(oldDocumentURL); m_documentUI.connect(); - assure("could not connect to " + m_database.getDocumentURL(), m_documentUI.isConnected()); + assertTrue("could not connect to " + m_database.getDocumentURL(), m_documentUI.isConnected()); XTablesSupplier suppTables = UnoRuntime.queryInterface( XTablesSupplier.class, m_documentUI.getActiveConnection() ); XNameAccess tables = suppTables.getTables(); - assure("the table was created in the wrong database", !tables.hasByName("abc")); + assertTrue("the table was created in the wrong database", !tables.hasByName("abc")); // load the new document, and verify there *is* a table therein impl_switchToDocument(newDocumentURL); m_documentUI.connect(); - assure("could not connect to " + m_database.getDocumentURL(), m_documentUI.isConnected()); + assertTrue("could not connect to " + m_database.getDocumentURL(), m_documentUI.isConnected()); suppTables = UnoRuntime.queryInterface( XTablesSupplier.class, m_documentUI.getActiveConnection() ); tables = suppTables.getTables(); - assure("the newly created table has not been written", tables.hasByName("abc")); + assertTrue("the newly created table has not been written", tables.hasByName("abc")); } } diff --git a/dbaccess/qa/complex/dbaccess/Beamer.java b/dbaccess/qa/complex/dbaccess/Beamer.java index ec47e7945..2fb885de0 100644 --- a/dbaccess/qa/complex/dbaccess/Beamer.java +++ b/dbaccess/qa/complex/dbaccess/Beamer.java @@ -28,10 +28,8 @@ package complex.dbaccess; import com.sun.star.beans.PropertyState; import com.sun.star.beans.PropertyValue; -import com.sun.star.beans.XPropertySet; import com.sun.star.container.XEnumeration; import com.sun.star.container.XEnumerationAccess; -import com.sun.star.container.XNameAccess; import com.sun.star.frame.FrameSearchFlag; import com.sun.star.frame.XComponentLoader; import com.sun.star.frame.XController; @@ -39,34 +37,30 @@ import com.sun.star.frame.XDispatch; import com.sun.star.frame.XDispatchProvider; import com.sun.star.frame.XFrame; import com.sun.star.frame.XModel; -import com.sun.star.frame.XStorable; import com.sun.star.lang.XComponent; -import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.sdb.CommandType; -import com.sun.star.sdb.XDocumentDataSource; -import com.sun.star.sdb.XOfficeDatabaseDocument; -import com.sun.star.sdb.application.XDatabaseDocumentUI; -import com.sun.star.sdbcx.XTablesSupplier; import com.sun.star.uno.Exception; import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XComponentContext; -import com.sun.star.uno.XNamingService; import com.sun.star.util.URL; -import com.sun.star.util.XCloseable; import com.sun.star.util.XURLTransformer; import com.sun.star.view.XSelectionSupplier; -import connectivity.tools.DataSource; -import connectivity.tools.HsqlColumnDescriptor; -import connectivity.tools.HsqlDatabase; -import connectivity.tools.HsqlTableDescriptor; -import helper.URLHelper; -import java.io.File; import java.io.IOException; -import util.UITools; + + +// ---------- junit imports ----------------- +import org.junit.After; +// import org.junit.AfterClass; +import org.junit.Before; +// import org.junit.BeforeClass; +import org.junit.Test; +// import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; +// ------------------------------------------ + /** complex test case for Base's application UI */ -public class Beamer extends complexlib.ComplexTestCase +public class Beamer extends TestCase { private XModel docModel; @@ -77,82 +71,44 @@ public class Beamer extends complexlib.ComplexTestCase } // -------------------------------------------------------------------------------------------------------- - protected final XComponentContext getComponentContext() - { - XComponentContext context = null; - try - { - final XPropertySet orbProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, getORB()); - context = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class, - orbProps.getPropertyValue("DefaultContext")); - } - catch (Exception ex) - { - failed("could not retrieve the ComponentContext"); - } - return context; - } - // -------------------------------------------------------------------------------------------------------- - - public String[] getTestMethodNames() - { - return new String[] - { - "testBeamer" - }; - } - - // -------------------------------------------------------------------------------------------------------- - public String getTestObjectName() - { - return getClass().getName(); - } - - // -------------------------------------------------------------------------------------------------------- - protected final XMultiServiceFactory getORB() - { - return (XMultiServiceFactory) param.getMSF(); - } - - // -------------------------------------------------------------------------------------------------------- - private void impl_closeDocument() - { - } - - // -------------------------------------------------------------------------------------------------------- + @Before + @Override public void before() throws Exception, java.lang.Exception { // load it into a frame - final Object object = getORB().createInstance("com.sun.star.frame.Desktop"); - final XComponentLoader xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, object); + final Object object = getMSF().createInstance("com.sun.star.frame.Desktop"); + final XComponentLoader xComponentLoader = UnoRuntime.queryInterface(XComponentLoader.class, object); final XComponent loadedComponent = xComponentLoader.loadComponentFromURL("private:factory/swriter", "_blank", 0, new PropertyValue[0]); // get the controller, which provides access to various UI operations - docModel = (XModel) UnoRuntime.queryInterface(XModel.class, loadedComponent); + docModel = UnoRuntime.queryInterface(XModel.class, loadedComponent); } // -------------------------------------------------------------------------------------------------------- + @After + @Override public void after() { } - // -------------------------------------------------------------------------------------------------------- + // -------------------------------------------------------------------------------------------------------- + @Test public void testBeamer() throws Exception, IOException, java.lang.Exception { final XController controller = docModel.getCurrentController(); final XFrame frame = controller.getFrame(); - final XDispatchProvider dispatchP = (XDispatchProvider) UnoRuntime.queryInterface(XDispatchProvider.class, frame); + final XDispatchProvider dispatchP = UnoRuntime.queryInterface(XDispatchProvider.class, frame); URL command = new URL(); command.Complete = ".uno:ViewDataSourceBrowser"; - Object instance = getORB().createInstance("com.sun.star.util.URLTransformer"); - XURLTransformer atrans = (XURLTransformer) UnoRuntime.queryInterface(XURLTransformer.class, instance); + Object instance = getMSF().createInstance("com.sun.star.util.URLTransformer"); + XURLTransformer atrans = UnoRuntime.queryInterface(XURLTransformer.class, instance); com.sun.star.util.URL[] aURLA = new com.sun.star.util.URL[1]; aURLA[0] = command; atrans.parseStrict(aURLA); command = aURLA[0]; final XDispatch dispatch = dispatchP.queryDispatch(command, "_self", FrameSearchFlag.AUTO); - assure(dispatch != null); + assertNotNull(dispatch); dispatch.dispatch(command, new PropertyValue[0]); final PropertyValue[] props = new PropertyValue[] @@ -163,8 +119,8 @@ public class Beamer extends complexlib.ComplexTestCase }; final XFrame beamer = frame.findFrame("_beamer", 0); - assure(beamer != null); - final XEnumerationAccess evtBc = (XEnumerationAccess) UnoRuntime.queryInterface(XEnumerationAccess.class, getORB().createInstance("com.sun.star.frame.GlobalEventBroadcaster")); + assertNotNull(beamer); + final XEnumerationAccess evtBc = UnoRuntime.queryInterface(XEnumerationAccess.class, getMSF().createInstance("com.sun.star.frame.GlobalEventBroadcaster")); XEnumeration enumeration = evtBc.createEnumeration(); int count = -1; while (enumeration.hasMoreElements()) @@ -172,9 +128,9 @@ public class Beamer extends complexlib.ComplexTestCase enumeration.nextElement(); ++count; } - final XSelectionSupplier selSup = (XSelectionSupplier)UnoRuntime.queryInterface(XSelectionSupplier.class, beamer.getController()); + final XSelectionSupplier selSup = UnoRuntime.queryInterface(XSelectionSupplier.class, beamer.getController()); selSup.select(props); - final com.sun.star.util.XCloseable close = (com.sun.star.util.XCloseable)UnoRuntime.queryInterface(com.sun.star.util.XCloseable.class, frame); + final com.sun.star.util.XCloseable close = UnoRuntime.queryInterface(com.sun.star.util.XCloseable.class, frame); close.close(false); enumeration = evtBc.createEnumeration(); @@ -185,6 +141,6 @@ public class Beamer extends complexlib.ComplexTestCase ++count2; } - assure("count1 = " + count + " count2 = " + count2, count == count2); + assertTrue("count1 = " + count + " count2 = " + count2, count == count2); } } diff --git a/dbaccess/qa/complex/dbaccess/CRMBasedTestCase.java b/dbaccess/qa/complex/dbaccess/CRMBasedTestCase.java index f9f65268f..e803d143f 100644 --- a/dbaccess/qa/complex/dbaccess/CRMBasedTestCase.java +++ b/dbaccess/qa/complex/dbaccess/CRMBasedTestCase.java @@ -26,13 +26,17 @@ ************************************************************************/ package complex.dbaccess; -import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.sdb.XSingleSelectQueryComposer; -import com.sun.star.uno.UnoRuntime; import connectivity.tools.CRMDatabase; import java.util.logging.Level; import java.util.logging.Logger; +// ---------- junit imports ----------------- +import org.junit.After; +import org.junit.Before; +import static org.junit.Assert.*; +// ------------------------------------------ + public abstract class CRMBasedTestCase extends TestCase { protected CRMDatabase m_database; @@ -42,16 +46,17 @@ public abstract class CRMBasedTestCase extends TestCase { try { - m_database = new CRMDatabase( getORB(), false ); + m_database = new CRMDatabase( getMSF(), false ); } catch ( Exception e ) { e.printStackTrace( System.err ); - assure( "caught an exception (" + e.getMessage() + ") while creating the test case", false ); + fail( "caught an exception (" + e.getMessage() + ") while creating the test case"); } } // -------------------------------------------------------------------------------------------------------- + @Before @Override public void before() { @@ -59,13 +64,16 @@ public abstract class CRMBasedTestCase extends TestCase } // -------------------------------------------------------------------------------------------------------- + @After @Override public void after() { try { if ( m_database != null ) + { m_database.saveAndClose(); + } } catch ( Exception ex ) { diff --git a/dbaccess/qa/complex/dbaccess/CopyTableInterActionHandler.java b/dbaccess/qa/complex/dbaccess/CopyTableInterActionHandler.java index 5967086df..25c044ac5 100755 --- a/dbaccess/qa/complex/dbaccess/CopyTableInterActionHandler.java +++ b/dbaccess/qa/complex/dbaccess/CopyTableInterActionHandler.java @@ -30,6 +30,8 @@ import com.sun.star.lib.uno.helper.WeakBase; import com.sun.star.task.XInteractionHandler; import com.sun.star.task.XInteractionRequest; +import static org.junit.Assert.*; + /** * * @author oj93728 @@ -37,14 +39,12 @@ import com.sun.star.task.XInteractionRequest; class CopyTableInterActionHandler extends WeakBase implements XInteractionHandler { - private final CopyTableWizard test; - public CopyTableInterActionHandler(CopyTableWizard testCase) + CopyTableInterActionHandler() { - test = testCase; } public void handle(XInteractionRequest xRequest) { - test.assure(xRequest.toString()); + fail( "interaction handler is not expected to be called" ); } } diff --git a/dbaccess/qa/complex/dbaccess/CopyTableWizard.java b/dbaccess/qa/complex/dbaccess/CopyTableWizard.java index 9bb102e28..85e6a8139 100755 --- a/dbaccess/qa/complex/dbaccess/CopyTableWizard.java +++ b/dbaccess/qa/complex/dbaccess/CopyTableWizard.java @@ -46,6 +46,13 @@ import connectivity.tools.DbaseDatabase; import java.io.IOException; import util.UITools; +// ---------- junit imports ----------------- +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import static org.junit.Assert.*; +// ------------------------------------------ + /** complex test case for Base's application UI */ public class CopyTableWizard extends CRMBasedTestCase @@ -60,23 +67,8 @@ public class CopyTableWizard extends CRMBasedTestCase } // -------------------------------------------------------------------------------------------------------- - public String[] getTestMethodNames() - { - return new String[] - { - "copyTable", "copyTableDbase" - }; - } - - // -------------------------------------------------------------------------------------------------------- - @Override - public String getTestObjectName() - { - return getClass().getName(); - } -// -------------------------------------------------------------------------------------------------------- - // -------------------------------------------------------------------------------------------------------- + @After @Override public void after() { @@ -84,6 +76,7 @@ public class CopyTableWizard extends CRMBasedTestCase super.after(); } + @Before @Override public void before() { @@ -91,23 +84,21 @@ public class CopyTableWizard extends CRMBasedTestCase { createTestCase(); source = new DatabaseApplication(this.m_database.getDatabase()); - dest = new DatabaseApplication(new DbaseDatabase(getORB())); + dest = new DatabaseApplication(new DbaseDatabase(getMSF())); } catch (java.lang.Exception ex) { - assure(false); + fail(""); } } - // -------------------------------------------------------------------------------------------------------- - - + // -------------------------------------------------------------------------------------------------------- class CopyThread implements Runnable { final XCopyTableWizard copyWizard; - public CopyThread(final XCopyTableWizard copyWizard) + CopyThread(final XCopyTableWizard copyWizard) { this.copyWizard = copyWizard; } @@ -123,33 +114,35 @@ public class CopyTableWizard extends CRMBasedTestCase Object toolKit = null; try { - toolKit = getORB().createInstance("com.sun.star.awt.Toolkit"); + toolKit = getMSF().createInstance("com.sun.star.awt.Toolkit"); } catch (com.sun.star.uno.Exception e) { return null; } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(XExtendedToolkit.class, toolKit); + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, toolKit ); Object atw = tk.getActiveTopWindow(); - return (XWindow) UnoRuntime.queryInterface(XWindow.class, atw); + return UnoRuntime.queryInterface( XWindow.class, atw ); } + @Test public void copyTable() throws Exception, IOException, java.lang.Exception { copyTable(source,source); } + @Test public void copyTableDbase() throws Exception, IOException, java.lang.Exception { copyTable(source,dest); } - public void copyTable(final DatabaseApplication sourceDb,final DatabaseApplication destDb) throws Exception, IOException, java.lang.Exception + private void copyTable(final DatabaseApplication sourceDb,final DatabaseApplication destDb) throws Exception, IOException, java.lang.Exception { final XConnection destConnection = destDb.getDocumentUI().getActiveConnection(); final XConnection sourceConnection = sourceDb.getDocumentUI().getActiveConnection(); - final XTablesSupplier suppTables = (XTablesSupplier) UnoRuntime.queryInterface(XTablesSupplier.class, sourceConnection); + final XTablesSupplier suppTables = UnoRuntime.queryInterface(XTablesSupplier.class, sourceConnection); final XNameAccess tables = suppTables.getTables(); final String[] names = tables.getElementNames(); @@ -159,15 +152,10 @@ public class CopyTableWizard extends CRMBasedTestCase } } - public void assure(final String message) - { - assure(message, false); - } - private void copyTable(final String tableName, final XConnection sourceConnection, final XConnection destConnection) throws Exception, IOException, java.lang.Exception { - final XInteractionHandler interAction = new CopyTableInterActionHandler(this); + final XInteractionHandler interAction = new CopyTableInterActionHandler(); final XComponentContext context = getComponentContext(); final XPropertySet sourceDescriptor = DataAccessDescriptorFactory.get(context).createDataAccessDescriptor(); sourceDescriptor.setPropertyValue("CommandType", CommandType.TABLE); @@ -177,7 +165,8 @@ public class CopyTableWizard extends CRMBasedTestCase final XPropertySet destDescriptor = DataAccessDescriptorFactory.get(context).createDataAccessDescriptor(); destDescriptor.setPropertyValue("ActiveConnection", destConnection); - final XCopyTableWizard copyWizard = com.sun.star.sdb.application.CopyTableWizard.createWithInteractionHandler(context, sourceDescriptor, destDescriptor, interAction); + final XCopyTableWizard copyWizard = com.sun.star.sdb.application.CopyTableWizard.createWithInteractionHandler( + context, sourceDescriptor, destDescriptor, interAction); copyWizard.setOperation((short) 0); // com.sun.star.sdb.application.CopyDefinitionAndData Optional<String> auto = new Optional<String>(); @@ -194,7 +183,7 @@ public class CopyTableWizard extends CRMBasedTestCase try { final XWindow dialog = getActiveWindow(); - final UITools uiTools = new UITools(getORB(), dialog); + final UITools uiTools = new UITools(getMSF(), dialog); final XAccessible root = uiTools.getRoot(); final XAccessibleContext accContext = root.getAccessibleContext(); final int count = accContext.getAccessibleChildCount(); @@ -211,7 +200,7 @@ public class CopyTableWizard extends CRMBasedTestCase } catch (java.lang.Exception exception) { - exception.printStackTrace(); + exception.printStackTrace( System.err ); } } catch (com.sun.star.lang.IndexOutOfBoundsException indexOutOfBoundsException) diff --git a/dbaccess/qa/complex/dbaccess/DataSource.java b/dbaccess/qa/complex/dbaccess/DataSource.java index 69a9fdd82..19f89d646 100644 --- a/dbaccess/qa/complex/dbaccess/DataSource.java +++ b/dbaccess/qa/complex/dbaccess/DataSource.java @@ -26,66 +26,49 @@ ************************************************************************/ package complex.dbaccess; -import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.container.XNameAccess; import com.sun.star.uno.Exception; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XNamingService; -import complexlib.ComplexTestCase; import connectivity.tools.CRMDatabase; import connectivity.tools.HsqlDatabase; -import java.util.logging.Level; -import java.util.logging.Logger; -public class DataSource extends ComplexTestCase +// ---------- junit imports ----------------- +import org.junit.Test; +import static org.junit.Assert.*; +// ------------------------------------------ + + +public class DataSource extends TestCase { HsqlDatabase m_database; connectivity.tools.DataSource m_dataSource; // -------------------------------------------------------------------------------------------------------- - public String[] getTestMethodNames() - { - return new String[] - { - "testRegistrationName" - }; - } - - // -------------------------------------------------------------------------------------------------------- - public String getTestObjectName() - { - return "DataSource"; - } - - // -------------------------------------------------------------------------------------------------------- private void createTestCase() { try { if (m_database == null) { - final CRMDatabase database = new CRMDatabase( getFactory(), false ); + final CRMDatabase database = new CRMDatabase( getMSF(), false ); m_database = database.getDatabase(); m_dataSource = m_database.getDataSource(); } } catch (Exception e) { - failed("could not create the test case, error message:\n" + e.getMessage()); + fail("could not create the test case, error message:\n" + e.getMessage()); } catch (java.lang.Exception e) { - failed("could not create the test case, error message:\n" + e.getMessage()); + fail("could not create the test case, error message:\n" + e.getMessage()); } } // -------------------------------------------------------------------------------------------------------- - private XMultiServiceFactory getFactory() - { - return (XMultiServiceFactory) param.getMSF(); - } - - // -------------------------------------------------------------------------------------------------------- + @Test public void testRegistrationName() { try @@ -93,18 +76,22 @@ public class DataSource extends ComplexTestCase createTestCase(); // 1. check the existing "Bibliography" data source whether it has the proper name String dataSourceName = "Bibliography"; - final connectivity.tools.DataSource bibliography = new connectivity.tools.DataSource(getFactory(), dataSourceName); - assureEquals("pre-registered database has a wrong name!", dataSourceName, bibliography.getName()); + final connectivity.tools.DataSource bibliography = new connectivity.tools.DataSource(getMSF(), dataSourceName); + assertEquals("pre-registered database has a wrong name!", dataSourceName, bibliography.getName()); // 2. register a newly created data source, and verify it has the proper name dataSourceName = "someDataSource"; - final XNamingService dataSourceRegistrations = (XNamingService) UnoRuntime.queryInterface( - XNamingService.class, getFactory().createInstance("com.sun.star.sdb.DatabaseContext")); + final XNamingService dataSourceRegistrations = UnoRuntime.queryInterface( + XNamingService.class, getMSF().createInstance( "com.sun.star.sdb.DatabaseContext" ) ); + final XNameAccess existenceCheck = UnoRuntime.queryInterface( XNameAccess.class, dataSourceRegistrations ); + if ( existenceCheck.hasByName( "someDataSource" ) ) + dataSourceRegistrations.revokeObject( "someDataSource" ); dataSourceRegistrations.registerObject("someDataSource", m_dataSource.getXDataSource()); - assureEquals("registration name of a newly registered data source is wrong", dataSourceName, m_dataSource.getName()); + assertEquals("registration name of a newly registered data source is wrong", dataSourceName, m_dataSource.getName()); } catch (Exception ex) { - Logger.getLogger(DataSource.class.getName()).log(Level.SEVERE, null, ex); + // Logger.getLogger(DataSource.class.getName()).log(Level.SEVERE, null, ex); + fail(); } } } diff --git a/dbaccess/qa/complex/dbaccess/DatabaseApplication.java b/dbaccess/qa/complex/dbaccess/DatabaseApplication.java index b9aaac35c..6aefa4582 100755 --- a/dbaccess/qa/complex/dbaccess/DatabaseApplication.java +++ b/dbaccess/qa/complex/dbaccess/DatabaseApplication.java @@ -56,14 +56,12 @@ public class DatabaseApplication // load it into a frame final Object object = db.getORB().createInstance("com.sun.star.frame.Desktop"); - final XComponentLoader xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, object); + final XComponentLoader xComponentLoader = UnoRuntime.queryInterface(XComponentLoader.class, object); final XComponent loadedComponent = xComponentLoader.loadComponentFromURL(db.getDocumentURL(), "_blank", FrameSearchFlag.ALL, new PropertyValue[0]); // get the controller, which provides access to various UI operations - final XModel docModel = (XModel) UnoRuntime.queryInterface(XModel.class, - loadedComponent); - documentUI = (XDatabaseDocumentUI) UnoRuntime.queryInterface(XDatabaseDocumentUI.class, - docModel.getCurrentController()); + final XModel docModel = UnoRuntime.queryInterface(XModel.class, loadedComponent); + documentUI = UnoRuntime.queryInterface(XDatabaseDocumentUI.class, docModel.getCurrentController()); documentUI.connect(); } @@ -87,8 +85,7 @@ public class DatabaseApplication // store the doc in a new location try { - final XStorable storeDoc = (XStorable) UnoRuntime.queryInterface(XStorable.class, - databaseDocument); + final XStorable storeDoc = UnoRuntime.queryInterface(XStorable.class, databaseDocument); if (storeDoc != null) { storeDoc.store(); diff --git a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java index 0a9e615b5..6f7106aab 100644 --- a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java +++ b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java @@ -26,6 +26,8 @@ ************************************************************************/ package complex.dbaccess; +import com.sun.star.lang.NotInitializedException; +import com.sun.star.frame.DoubleInitializationException; import com.sun.star.awt.XTopWindow; import com.sun.star.beans.PropertyState; import com.sun.star.document.DocumentEvent; @@ -33,7 +35,7 @@ import com.sun.star.lang.XEventListener; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.script.XStorageBasedLibraryContainer; import com.sun.star.task.XInteractionRequest; -import com.sun.star.uno.Exception; + import com.sun.star.uno.Type; import com.sun.star.uno.UnoRuntime; import com.sun.star.frame.XStorable; @@ -45,7 +47,6 @@ import com.sun.star.document.XDocumentEventBroadcaster; import com.sun.star.document.XDocumentEventListener; import com.sun.star.document.XEmbeddedScripts; import com.sun.star.document.XEventsSupplier; -import com.sun.star.frame.DoubleInitializationException; import com.sun.star.lang.XComponent; import com.sun.star.frame.XComponentLoader; import com.sun.star.frame.XDispatch; @@ -56,13 +57,12 @@ import com.sun.star.frame.XModel; import com.sun.star.frame.XModel2; import com.sun.star.frame.XTitle; import com.sun.star.lang.EventObject; -import com.sun.star.lang.NotInitializedException; import com.sun.star.lang.XServiceInfo; import com.sun.star.lang.XSingleComponentFactory; import com.sun.star.lang.XTypeProvider; import com.sun.star.script.provider.XScriptProviderSupplier; import com.sun.star.sdb.XDocumentDataSource; -import com.sun.star.sdbc.XDataSource; + import com.sun.star.sdb.XFormDocumentsSupplier; import com.sun.star.sdb.XOfficeDatabaseDocument; import com.sun.star.sdb.XReportDocumentsSupplier; @@ -83,6 +83,13 @@ import java.util.ArrayList; import java.util.logging.Level; import java.util.logging.Logger; +// ---------- junit imports ----------------- +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import static org.junit.Assert.*; +// ------------------------------------------ + public class DatabaseDocument extends TestCase implements com.sun.star.document.XDocumentEventListener { @@ -145,12 +152,12 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. private final ArrayList m_eventListeners = new ArrayList(); - public Object createInstanceWithContext(XComponentContext _context) throws Exception + public Object createInstanceWithContext(XComponentContext _context) throws com.sun.star.uno.Exception { return new CallbackComponent(); } - public Object createInstanceWithArgumentsAndContext(Object[] arg0, XComponentContext _context) throws Exception + public Object createInstanceWithArgumentsAndContext(Object[] arg0, XComponentContext _context) throws com.sun.star.uno.Exception { return createInstanceWithContext(_context); } @@ -209,8 +216,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. { try { - m_defaultHandler = (XInteractionHandler) UnoRuntime.queryInterface(XInteractionHandler.class, - _factory.createInstance("com.sun.star.task.InteractionHandler")); + m_defaultHandler = UnoRuntime.queryInterface(XInteractionHandler.class, _factory.createInstance("com.sun.star.task.InteractionHandler")); } catch (Exception ex) { @@ -227,14 +233,13 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. return; } - assureEquals("interaction handleer called in wrong state", STATE_LOADING_DOC, m_loadDocState); + assertEquals("interaction handleer called in wrong state", STATE_LOADING_DOC, m_loadDocState); // auto-approve final XInteractionContinuation continuations[] = _request.getContinuations(); for (int i = 0; i < continuations.length; ++i) { - final XInteractionApprove approve = (XInteractionApprove) UnoRuntime.queryInterface(XInteractionApprove.class, - continuations[i]); + final XInteractionApprove approve = UnoRuntime.queryInterface(XInteractionApprove.class, continuations[i]); if (approve != null) { approve.select(); @@ -247,24 +252,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. // ======================================================================================================== // -------------------------------------------------------------------------------------------------------- - public String[] getTestMethodNames() - { - return new String[] - { - "testLoadable", - "testDocumentRevenants", - "testDocumentEvents", - "testGlobalEvents" - }; - } - - // -------------------------------------------------------------------------------------------------------- - public String getTestObjectName() - { - return "DatabaseDocument"; - } - - // -------------------------------------------------------------------------------------------------------- + @Before public void before() throws java.lang.Exception { super.before(); @@ -274,25 +262,24 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. // at our service factory, insert a new factory for our CallbackComponent // this will allow the Basic code in our test documents to call back into this test case // here, by just instantiating this service - final XSet globalFactory = (XSet) UnoRuntime.queryInterface( - XSet.class, getORB()); + final XSet globalFactory = UnoRuntime.queryInterface(XSet.class, getMSF()); m_callbackFactory = new CallbackComponentFactory(); globalFactory.insert(m_callbackFactory); // register ourself as listener at the global event broadcaster - final XDocumentEventBroadcaster broadcaster = (XDocumentEventBroadcaster) UnoRuntime.queryInterface( - XDocumentEventBroadcaster.class, getORB().createInstance("com.sun.star.frame.GlobalEventBroadcaster")); + final XDocumentEventBroadcaster broadcaster = UnoRuntime.queryInterface(XDocumentEventBroadcaster.class, getMSF().createInstance("com.sun.star.frame.GlobalEventBroadcaster")); broadcaster.addDocumentEventListener(this); } catch (Exception e) { - log.println("could not create the test case, error message:\n" + e.getMessage()); + System.out.println("could not create the test case, error message:\n" + e.getMessage()); e.printStackTrace(System.err); - failed("failed to create the test case"); + fail("failed to create the test case"); } } // -------------------------------------------------------------------------------------------------------- + @After public void after() throws java.lang.Exception { try @@ -302,15 +289,14 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. m_callbackFactory.dispose(); // revoke ourself as listener at the global event broadcaster - final XDocumentEventBroadcaster broadcaster = (XDocumentEventBroadcaster) UnoRuntime.queryInterface( - XDocumentEventBroadcaster.class, getORB().createInstance("com.sun.star.frame.GlobalEventBroadcaster")); + final XDocumentEventBroadcaster broadcaster = UnoRuntime.queryInterface(XDocumentEventBroadcaster.class, getMSF().createInstance("com.sun.star.frame.GlobalEventBroadcaster")); broadcaster.removeDocumentEventListener(this); } catch (Exception e) { - log.println("could not create the test case, error message:\n" + e.getMessage()); + System.out.println("could not create the test case, error message:\n" + e.getMessage()); e.printStackTrace(System.err); - failed("failed to close the test case"); + fail("failed to close the test case"); } super.after(); @@ -323,7 +309,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. public Class unoInterfaceClass = null; public String methodName = null; - public UnoMethodDescriptor(Class _class, String _method) + UnoMethodDescriptor(Class _class, String _method) { unoInterfaceClass = _class; methodName = _method; @@ -356,8 +342,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. // -------------------------------------------------------------------------------------------------------- private XModel impl_createDocument() throws Exception { - final XModel databaseDoc = (XModel) UnoRuntime.queryInterface(XModel.class, - getORB().createInstance("com.sun.star.sdb.OfficeDatabaseDocument")); + final XModel databaseDoc = UnoRuntime.queryInterface(XModel.class, getMSF().createInstance("com.sun.star.sdb.OfficeDatabaseDocument")); // should not be initialized here - we did neither initNew nor load nor storeAsURL it impl_checkDocumentInitState(databaseDoc, false); @@ -368,17 +353,15 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. // -------------------------------------------------------------------------------------------------------- private void impl_closeDocument(XModel _databaseDoc) throws CloseVetoException, IOException, Exception { - final XCloseable closeDoc = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, - _databaseDoc); + final XCloseable closeDoc = UnoRuntime.queryInterface(XCloseable.class, _databaseDoc); closeDoc.close(true); } // -------------------------------------------------------------------------------------------------------- private XModel impl_createEmptyEmbeddedHSQLDocument() throws Exception, IOException { - final XModel databaseDoc = (XModel) UnoRuntime.queryInterface(XModel.class, - getORB().createInstance("com.sun.star.sdb.OfficeDatabaseDocument")); - final XStorable storeDoc = (XStorable) UnoRuntime.queryInterface(XStorable.class, databaseDoc); + final XModel databaseDoc = UnoRuntime.queryInterface(XModel.class, getMSF().createInstance("com.sun.star.sdb.OfficeDatabaseDocument")); + final XStorable storeDoc = UnoRuntime.queryInterface(XStorable.class, databaseDoc); // verify the document rejects API calls which require it to be initialized impl_checkDocumentInitState(databaseDoc, false); @@ -388,15 +371,13 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. final String url = databaseDoc.getURL(); final PropertyValue[] args = databaseDoc.getArgs(); // they should be all empty at this time - assureEquals("location is expected to be empty here", "", location); - assureEquals("URL is expected to be empty here", "", url); - assureEquals("Args are expected to be empty here", 0, args.length); + assertEquals("location is expected to be empty here", "", location); + assertEquals("URL is expected to be empty here", "", url); + assertEquals("Args are expected to be empty here", 0, args.length); // and, you should be able to set properties at the data source - final XOfficeDatabaseDocument dataSourceAccess = (XOfficeDatabaseDocument) UnoRuntime.queryInterface( - XOfficeDatabaseDocument.class, databaseDoc); - final XPropertySet dsProperties = (XPropertySet) UnoRuntime.queryInterface( - XPropertySet.class, dataSourceAccess.getDataSource()); + final XOfficeDatabaseDocument dataSourceAccess = UnoRuntime.queryInterface(XOfficeDatabaseDocument.class, databaseDoc); + final XPropertySet dsProperties = UnoRuntime.queryInterface(XPropertySet.class, dataSourceAccess.getDataSource()); dsProperties.setPropertyValue("URL", "sdbc:embedded:hsqldb"); final String documentURL = createTempFileURL(); @@ -404,7 +385,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. // now that the document is stored, ... // ... its URL should be correct - assureEquals("wrong URL after storing the document", documentURL, databaseDoc.getURL()); + assertEquals("wrong URL after storing the document", documentURL, databaseDoc.getURL()); // ... it should be initialized impl_checkDocumentInitState(databaseDoc, true); @@ -412,6 +393,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. } // -------------------------------------------------------------------------------------------------------- + @Test public void testLoadable() throws Exception, IOException { XModel databaseDoc = impl_createEmptyEmbeddedHSQLDocument(); @@ -426,18 +408,17 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. // .................................................................... // 2. XLoadable::load - databaseDoc = (XModel) UnoRuntime.queryInterface(XModel.class, - getORB().createInstance("com.sun.star.sdb.OfficeDatabaseDocument")); + databaseDoc = UnoRuntime.queryInterface(XModel.class, getMSF().createInstance("com.sun.star.sdb.OfficeDatabaseDocument")); documentURL = copyToTempFile(documentURL); // load the doc, and verify it's initialized then, and has the proper URL - XLoadable loadDoc = (XLoadable) UnoRuntime.queryInterface(XLoadable.class, databaseDoc); + XLoadable loadDoc = UnoRuntime.queryInterface(XLoadable.class, databaseDoc); loadDoc.load(new PropertyValue[] { new PropertyValue("URL", 0, documentURL, PropertyState.DIRECT_VALUE) }); databaseDoc.attachResource(documentURL, new PropertyValue[0]); - assureEquals("wrong URL after loading the document", documentURL, databaseDoc.getURL()); + assertEquals("wrong URL after loading the document", documentURL, databaseDoc.getURL()); impl_checkDocumentInitState(databaseDoc, true); // and while we are here ... initilizing the same document again should not be possible @@ -450,9 +431,9 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. // 3. XLoadable::initNew impl_closeDocument(databaseDoc); databaseDoc = impl_createDocument(); - loadDoc = (XLoadable) UnoRuntime.queryInterface(XLoadable.class, databaseDoc); + loadDoc = UnoRuntime.queryInterface(XLoadable.class, databaseDoc); loadDoc.initNew(); - assureEquals("wrong URL after initializing the document", "", databaseDoc.getURL()); + assertEquals("wrong URL after initializing the document", "", databaseDoc.getURL()); impl_checkDocumentInitState(databaseDoc, true); // same as above - initializing the document a second time must fail @@ -478,7 +459,9 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. for ( int i=0; i<_args.length; ++i ) { if ( _args[i].Name.equals( "TestCase_Marker" ) && _args[i].Value.equals( "Yes" ) ) + { return true; + } } return false; } @@ -499,28 +482,25 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. { new PropertyValue("PickListEntry", 0, false, PropertyState.DIRECT_VALUE), new PropertyValue("MacroExecutionMode", 0, com.sun.star.document.MacroExecMode.USE_CONFIG, PropertyState.DIRECT_VALUE), - new PropertyValue("InteractionHandler", 0, new MacroExecutionApprove(getORB()), PropertyState.DIRECT_VALUE) + new PropertyValue("InteractionHandler", 0, new MacroExecutionApprove(getMSF()), PropertyState.DIRECT_VALUE) }; } // -------------------------------------------------------------------------------------------------------- private int impl_setMacroSecurityLevel(int _level) throws Exception { - final XMultiServiceFactory configProvider = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, - getORB().createInstance("com.sun.star.configuration.ConfigurationProvider")); + final XMultiServiceFactory configProvider = UnoRuntime.queryInterface(XMultiServiceFactory.class, getMSF().createInstance("com.sun.star.configuration.ConfigurationProvider")); final PropertyValue[] args = new PropertyValue[] { new PropertyValue("nodepath", 0, "/org.openoffice.Office.Common/Security/Scripting", PropertyState.DIRECT_VALUE) }; - final XPropertySet securitySettings = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, - configProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess", args)); + final XPropertySet securitySettings = UnoRuntime.queryInterface(XPropertySet.class, configProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess", args)); final int oldValue = ((Integer) securitySettings.getPropertyValue("MacroSecurityLevel")).intValue(); securitySettings.setPropertyValue("MacroSecurityLevel", Integer.valueOf(_level)); - final XChangesBatch committer = (XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class, - securitySettings); + final XChangesBatch committer = UnoRuntime.queryInterface(XChangesBatch.class, securitySettings); committer.commitChanges(); return oldValue; @@ -529,10 +509,8 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. // -------------------------------------------------------------------------------------------------------- private XModel impl_loadDocument( final String _documentURL, final PropertyValue[] _loadArgs ) throws Exception { - final XComponentLoader loader = (XComponentLoader) UnoRuntime.queryInterface( XComponentLoader.class, - getORB().createInstance("com.sun.star.frame.Desktop") ); - return (XModel) UnoRuntime.queryInterface( XModel.class, - loader.loadComponentFromURL( _documentURL, _BLANK, 0, _loadArgs ) ); + final XComponentLoader loader = UnoRuntime.queryInterface(XComponentLoader.class, getMSF().createInstance("com.sun.star.frame.Desktop")); + return UnoRuntime.queryInterface(XModel.class, loader.loadComponentFromURL(_documentURL, _BLANK, 0, _loadArgs)); } // -------------------------------------------------------------------------------------------------------- @@ -540,8 +518,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. { // store the document final String documentURL = FileHelper.getOOoCompatibleFileURL( _document.getURL() ); - final XStorable storeDoc = (XStorable) UnoRuntime.queryInterface( XStorable.class, - _document ); + final XStorable storeDoc = UnoRuntime.queryInterface(XStorable.class, _document); storeDoc.store(); } @@ -553,8 +530,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. XModel databaseDoc = impl_createEmptyEmbeddedHSQLDocument(); // create Basic library/module therein - final XEmbeddedScripts embeddedScripts = (XEmbeddedScripts) UnoRuntime.queryInterface(XEmbeddedScripts.class, - databaseDoc); + final XEmbeddedScripts embeddedScripts = UnoRuntime.queryInterface(XEmbeddedScripts.class, databaseDoc); final XStorageBasedLibraryContainer basicLibs = embeddedScripts.getBasicLibraries(); final XNameContainer newLib = basicLibs.createLibrary( _libName ); newLib.insertByName( _moduleName, _code ); @@ -579,6 +555,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. * This method here tests some of those aspects of a document which should survive the death of one * instance and re-creation as a revenant. */ + @Test public void testDocumentRevenants() throws Exception, IOException { // create an empty document @@ -592,42 +569,38 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. // at this stage, the marker should not yet be present in the doc's args, else some of the below // tests become meaningless - assure( "A newly created doc should not have the test case marker", !impl_hasMarker( databaseDoc.getArgs() ) ); + assertTrue( "A newly created doc should not have the test case marker", !impl_hasMarker( databaseDoc.getArgs() ) ); // obtain the DataSource associated with the document. Keeping this alive // ensures that the "impl data" of the document is kept alive, too, so when closing // and re-opening it, this "impl data" must be re-used. - XDocumentDataSource dataSource = (XDocumentDataSource)UnoRuntime.queryInterface( XDocumentDataSource.class, - ((XOfficeDatabaseDocument)UnoRuntime.queryInterface( - XOfficeDatabaseDocument.class, databaseDoc )).getDataSource() ); + XDocumentDataSource dataSource = UnoRuntime.queryInterface(XDocumentDataSource.class, (UnoRuntime.queryInterface(XOfficeDatabaseDocument.class, databaseDoc)).getDataSource()); // close and reload the doc impl_closeDocument(databaseDoc); databaseDoc = impl_loadDocument( documentURL, impl_getMarkerLoadArgs() ); // since we just put the marker into the load-call, it should be present at the doc - assure( "The test case marker got lost.", impl_hasMarker( databaseDoc.getArgs() ) ); + assertTrue( "The test case marker got lost.", impl_hasMarker( databaseDoc.getArgs() ) ); // The basic library should have survived - final XEmbeddedScripts embeddedScripts = (XEmbeddedScripts) UnoRuntime.queryInterface(XEmbeddedScripts.class, - databaseDoc); + final XEmbeddedScripts embeddedScripts = UnoRuntime.queryInterface(XEmbeddedScripts.class, databaseDoc); final XStorageBasedLibraryContainer basicLibs = embeddedScripts.getBasicLibraries(); - assure( "Baisc lib did not survive reloading a closed document", basicLibs.hasByName( "Lib" ) ); - final XNameContainer lib = (XNameContainer)UnoRuntime.queryInterface( - XNameContainer.class, basicLibs.getByName( "Lib" ) ); - assure( "Basic module did not survive reloading a closed document", lib.hasByName( "Module" ) ); + assertTrue( "Baisc lib did not survive reloading a closed document", basicLibs.hasByName( "Lib" ) ); + final XNameContainer lib = UnoRuntime.queryInterface(XNameContainer.class, basicLibs.getByName("Lib")); + assertTrue( "Basic module did not survive reloading a closed document", lib.hasByName( "Module" ) ); // now closing the doc, and obtaining it from the data source, should preserve the marker we put into the load // args impl_closeDocument( databaseDoc ); - databaseDoc = (XModel)UnoRuntime.queryInterface( XModel.class, dataSource.getDatabaseDocument() ); - assure( "The test case marker did not survive re-retrieval of the doc from the data source.", + databaseDoc = UnoRuntime.queryInterface(XModel.class, dataSource.getDatabaseDocument()); + assertTrue( "The test case marker did not survive re-retrieval of the doc from the data source.", impl_hasMarker( databaseDoc.getArgs() ) ); // on the other hand, closing and regurlarly re-loading the doc *without* the marker should indeed // lose it impl_closeDocument( databaseDoc ); databaseDoc = impl_loadDocument( documentURL, impl_getDefaultLoadArgs() ); - assure( "Reloading the document kept the old args, instead of the newly supplied ones.", + assertTrue( "Reloading the document kept the old args, instead of the newly supplied ones.", !impl_hasMarker( databaseDoc.getArgs() ) ); // clean up @@ -635,6 +608,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. } // -------------------------------------------------------------------------------------------------------- + @Test public void testDocumentEvents() throws Exception, IOException { // create an empty document @@ -660,8 +634,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. // bind the macro to the OnLoad event final String macroURI = "vnd.sun.star.script:" + libName + "." + moduleName + ".OnLoad?language=Basic&location=document"; - final XEventsSupplier eventsSupplier = (XEventsSupplier) UnoRuntime.queryInterface(XEventsSupplier.class, - databaseDoc); + final XEventsSupplier eventsSupplier = UnoRuntime.queryInterface(XEventsSupplier.class, databaseDoc); eventsSupplier.getEvents().replaceByName("OnLoad", new PropertyValue[] { new PropertyValue("EventType", 0, "Script", PropertyState.DIRECT_VALUE), @@ -694,7 +667,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. "OnLoad" }, context); - assureEquals("our provided interaction handler was not called", STATE_ON_LOAD_RECEIVED, m_loadDocState); + assertEquals("our provided interaction handler was not called", STATE_ON_LOAD_RECEIVED, m_loadDocState); // restore macro security level impl_setMacroSecurityLevel(oldSecurityLevel); @@ -704,11 +677,11 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. } // -------------------------------------------------------------------------------------------------------- + @Test public void testGlobalEvents() throws Exception, IOException { XModel databaseDoc = impl_createEmptyEmbeddedHSQLDocument(); - final XStorable storeDoc = (XStorable) UnoRuntime.queryInterface(XStorable.class, - databaseDoc); + final XStorable storeDoc = UnoRuntime.queryInterface(XStorable.class, databaseDoc); String context, newURL; @@ -717,7 +690,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. context = "store"; impl_startObservingEvents(context); storeDoc.store(); - assureEquals("store is not expected to change the document URL", databaseDoc.getURL(), oldURL); + assertEquals("store is not expected to change the document URL", databaseDoc.getURL(), oldURL); impl_stopObservingEvents(m_globalEvents, new String[] { "OnSave", "OnSaveDone" @@ -727,7 +700,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. context = "storeToURL"; impl_startObservingEvents(context); storeDoc.storeToURL(createTempFileURL(), new PropertyValue[0]); - assureEquals("storetoURL is not expected to change the document URL", databaseDoc.getURL(), oldURL); + assertEquals("storetoURL is not expected to change the document URL", databaseDoc.getURL(), oldURL); impl_stopObservingEvents(m_globalEvents, new String[] { "OnSaveTo", "OnSaveToDone" @@ -738,19 +711,18 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. context = "storeAsURL"; impl_startObservingEvents(context); storeDoc.storeAsURL(newURL, new PropertyValue[0]); - assureEquals("storeAsURL is expected to change the document URL", databaseDoc.getURL(), newURL); + assertEquals("storeAsURL is expected to change the document URL", databaseDoc.getURL(), newURL); impl_stopObservingEvents(m_globalEvents, new String[] { "OnSaveAs", "OnSaveAsDone" }, context); // XModifiable.setModified - final XModifiable modifyDoc = (XModifiable) UnoRuntime.queryInterface(XModifiable.class, - databaseDoc); + final XModifiable modifyDoc = UnoRuntime.queryInterface(XModifiable.class, databaseDoc); context = "setModified"; impl_startObservingEvents(context); modifyDoc.setModified(true); - assureEquals("setModified didn't work", modifyDoc.isModified(), true); + assertEquals("setModified didn't work", modifyDoc.isModified(), true); impl_stopObservingEvents(m_globalEvents, new String[] { "OnModifyChanged" @@ -760,7 +732,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. context = "store (2)"; impl_startObservingEvents(context); storeDoc.store(); - assureEquals("'store' should implicitly reset the modified flag", modifyDoc.isModified(), false); + assertEquals("'store' should implicitly reset the modified flag", modifyDoc.isModified(), false); impl_stopObservingEvents(m_globalEvents, new String[] { "OnSave", "OnSaveDone", "OnModifyChanged" @@ -768,12 +740,10 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. // XComponentLoader.loadComponentFromURL newURL = copyToTempFile(databaseDoc.getURL()); - final XComponentLoader loader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, - getORB().createInstance("com.sun.star.frame.Desktop")); + final XComponentLoader loader = UnoRuntime.queryInterface(XComponentLoader.class, getMSF().createInstance("com.sun.star.frame.Desktop")); context = "loadComponentFromURL"; impl_startObservingEvents(context); - databaseDoc = (XModel) UnoRuntime.queryInterface(XModel.class, - loader.loadComponentFromURL(newURL, _BLANK, 0, impl_getDefaultLoadArgs())); + databaseDoc = UnoRuntime.queryInterface(XModel.class, loader.loadComponentFromURL(newURL, _BLANK, 0, impl_getDefaultLoadArgs())); impl_stopObservingEvents(m_globalEvents, new String[] { @@ -781,8 +751,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. }, context); // closing a document by API - final XCloseable closeDoc = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, - databaseDoc); + final XCloseable closeDoc = UnoRuntime.queryInterface(XCloseable.class, databaseDoc); context = "close (API)"; impl_startObservingEvents(context); closeDoc.close(true); @@ -795,13 +764,11 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. // closing a document via UI context = "close (UI)"; impl_startObservingEvents("prepare for '" + context + "'"); - databaseDoc = (XModel) UnoRuntime.queryInterface(XModel.class, - loader.loadComponentFromURL(newURL, _BLANK, 0, impl_getDefaultLoadArgs())); + databaseDoc = UnoRuntime.queryInterface(XModel.class, loader.loadComponentFromURL(newURL, _BLANK, 0, impl_getDefaultLoadArgs())); impl_waitForEvent(m_globalEvents, "OnLoad", 5000); // wait for all events to arrive - OnLoad should be the last one - final XDispatchProvider dispatchProvider = (XDispatchProvider) UnoRuntime.queryInterface(XDispatchProvider.class, - databaseDoc.getCurrentController().getFrame()); + final XDispatchProvider dispatchProvider = UnoRuntime.queryInterface(XDispatchProvider.class, databaseDoc.getCurrentController().getFrame()); final URL url = impl_getURL(".uno:CloseDoc"); final XDispatch dispatcher = dispatchProvider.queryDispatch(url, "", 0); impl_startObservingEvents(context); @@ -814,8 +781,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. // creating a new document databaseDoc = impl_createDocument(); - final XLoadable loadDoc = (XLoadable) UnoRuntime.queryInterface(XLoadable.class, - databaseDoc); + final XLoadable loadDoc = UnoRuntime.queryInterface(XLoadable.class, databaseDoc); context = "initNew"; impl_startObservingEvents(context); loadDoc.initNew(); @@ -832,13 +798,11 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. context = "activation"; // for this, load a database document ... impl_startObservingEvents("prepare for '" + context + "'"); - databaseDoc = (XModel) UnoRuntime.queryInterface(XModel.class, - loader.loadComponentFromURL(newURL, _BLANK, 0, impl_getDefaultLoadArgs())); + databaseDoc = UnoRuntime.queryInterface(XModel.class, loader.loadComponentFromURL(newURL, _BLANK, 0, impl_getDefaultLoadArgs())); final int previousOnLoadEventPos = impl_waitForEvent(m_globalEvents, "OnLoad", 5000); // ... and another document ... final String otherURL = copyToTempFile(databaseDoc.getURL()); - final XModel otherDoc = (XModel) UnoRuntime.queryInterface(XModel.class, - loader.loadComponentFromURL(otherURL, _BLANK, 0, impl_getDefaultLoadArgs())); + final XModel otherDoc = UnoRuntime.queryInterface(XModel.class, loader.loadComponentFromURL(otherURL, _BLANK, 0, impl_getDefaultLoadArgs())); impl_raise(otherDoc); impl_waitForEvent(m_globalEvents, "OnLoad", 5000, previousOnLoadEventPos + 1); @@ -864,8 +828,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. new URL() }; url[0].Complete = _completeURL; - final XURLTransformer urlTransformer = (XURLTransformer) UnoRuntime.queryInterface(XURLTransformer.class, - getORB().createInstance("com.sun.star.util.URLTransformer")); + final XURLTransformer urlTransformer = UnoRuntime.queryInterface(XURLTransformer.class, getMSF().createInstance("com.sun.star.util.URLTransformer")); urlTransformer.parseStrict(url); return url[0]; } @@ -874,15 +837,14 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. private void impl_raise(XModel _document) { final XFrame frame = _document.getCurrentController().getFrame(); - final XTopWindow topWindow = (XTopWindow) UnoRuntime.queryInterface(XTopWindow.class, - frame.getContainerWindow()); + final XTopWindow topWindow = UnoRuntime.queryInterface(XTopWindow.class, frame.getContainerWindow()); topWindow.toFront(); } // -------------------------------------------------------------------------------------------------------- private void impl_startObservingEvents(String _context) { - log.println(" " + _context + " {"); + System.out.println(" " + _context + " {"); synchronized (m_documentEvents) { m_documentEvents.clear(); @@ -923,19 +885,19 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. actualEventCount = _actualEvents.size(); } - assureEquals("wrong event count for '" + _context + "'", + assertEquals("wrong event count for '" + _context + "'", _expectedEvents.length, _actualEvents.size()); for (int i = 0; i < _expectedEvents.length; ++i) { - assureEquals("wrong event at positon " + (i + 1) + " for '" + _context + "'", + assertEquals("wrong event at positon " + (i + 1) + " for '" + _context + "'", _expectedEvents[i], _actualEvents.get(i)); } } } finally { - log.println(" }"); + System.out.println(" }"); } } @@ -975,7 +937,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. } } - failed("expected event '" + _expectedEvent + "' did not arrive after " + _maxMilliseconds + " milliseconds"); + fail("expected event '" + _expectedEvent + "' did not arrive after " + _maxMilliseconds + " milliseconds"); return -1; } @@ -994,7 +956,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. if ((_Event.EventName.equals("OnLoad")) && (m_loadDocState != STATE_NOT_STARTED)) { - assureEquals("OnLoad event must come *after* invocation of the interaction handler / user!", + assertEquals("OnLoad event must come *after* invocation of the interaction handler / user!", m_loadDocState, STATE_MACRO_EXEC_APPROVED); m_loadDocState = STATE_ON_LOAD_RECEIVED; } @@ -1005,7 +967,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. m_documentEvents.notifyAll(); } - log.println(" document event: " + _Event.EventName); + System.out.println(" document event: " + _Event.EventName); } // -------------------------------------------------------------------------------------------------------- @@ -1023,7 +985,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. m_globalEvents.notifyAll(); } - log.println(" global event: " + _Event.EventName); + System.out.println(" global event: " + _Event.EventName); } // -------------------------------------------------------------------------------------------------------- diff --git a/dbaccess/qa/complex/dbaccess/Parser.java b/dbaccess/qa/complex/dbaccess/Parser.java index 9616a645a..89662f5e9 100644 --- a/dbaccess/qa/complex/dbaccess/Parser.java +++ b/dbaccess/qa/complex/dbaccess/Parser.java @@ -35,25 +35,16 @@ import com.sun.star.sdbc.SQLException; import com.sun.star.uno.Exception; import com.sun.star.uno.UnoRuntime; -public class Parser extends CRMBasedTestCase -{ - // -------------------------------------------------------------------------------------------------------- - public String[] getTestMethodNames() - { - return new String[] { - "checkJoinSyntax", - "checkParameterTypes", - "checkWhere", - }; - } - // -------------------------------------------------------------------------------------------------------- - public String getTestObjectName() - { - return "Parser"; - } +// ---------- junit imports ----------------- +import org.junit.Test; +import static org.junit.Assert.*; +// ------------------------------------------ +public class Parser extends CRMBasedTestCase +{ // -------------------------------------------------------------------------------------------------------- + @Override protected void createTestCase() { try @@ -64,10 +55,12 @@ public class Parser extends CRMBasedTestCase catch ( Exception e ) { e.printStackTrace( System.err ); - assure( "caught an exception (" + e.getMessage() + ") while creating the test case", false ); + fail( "caught an exception (" + e.getMessage() + ") while creating the test case"); } } + // -------------------------------------------------------------------------------------------------------- + @Test public void checkWhere() throws Exception { final XSingleSelectQueryComposer composer = createQueryComposer(); @@ -107,6 +100,7 @@ public class Parser extends CRMBasedTestCase // -------------------------------------------------------------------------------------------------------- /** verifies that aliases for inner queries work as expected */ + @Test public void checkJoinSyntax() throws Exception { final XSingleSelectQueryComposer composer = createQueryComposer(); @@ -144,7 +138,7 @@ public class Parser extends CRMBasedTestCase { caughtExpected = true; } - assure( "pre-condition not met: parser should except on unparseable statements, else the complete" + + assertTrue( "pre-condition not met: parser should except on unparseable statements, else the complete" + "test is bogus!", caughtExpected ); } @@ -154,29 +148,28 @@ public class Parser extends CRMBasedTestCase final XSingleSelectQueryComposer composer = createQueryComposer(); composer.setQuery( _statement ); - assureEquals( "checkParameterTypes: internal error", _expectedParameterNames.length, _expectedParameterTypes.length ); + assertEquals( "checkParameterTypes: internal error", _expectedParameterNames.length, _expectedParameterTypes.length ); - final XParametersSupplier paramSupp = (XParametersSupplier)UnoRuntime.queryInterface( - XParametersSupplier.class, composer ); + final XParametersSupplier paramSupp = UnoRuntime.queryInterface(XParametersSupplier.class, composer); final XIndexAccess parameters = paramSupp.getParameters(); - assureEquals( "(ctx: " + _context + ") unexpected parameter count", _expectedParameterNames.length, parameters.getCount() ); + assertEquals( "(ctx: " + _context + ") unexpected parameter count", _expectedParameterNames.length, parameters.getCount() ); for ( int i=0; i<parameters.getCount(); ++i ) { - final XPropertySet parameter = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, - parameters.getByIndex(i) ); + final XPropertySet parameter = UnoRuntime.queryInterface(XPropertySet.class, parameters.getByIndex(i)); final String name = (String)parameter.getPropertyValue( "Name" ); - assureEquals( "(ctx: " + _context + ") unexpected parameter name for parameter number " + ( i + 1 ), _expectedParameterNames[i], name ); + assertEquals( "(ctx: " + _context + ") unexpected parameter name for parameter number " + ( i + 1 ), _expectedParameterNames[i], name ); final int type = ((Integer)parameter.getPropertyValue( "Type" )).intValue(); - assureEquals( "(ctx: " + _context + ") unexpected data type for parameter number " + ( i + 1 ), _expectedParameterTypes[i], type ); + assertEquals( "(ctx: " + _context + ") unexpected data type for parameter number " + ( i + 1 ), _expectedParameterTypes[i], type ); } } // -------------------------------------------------------------------------------------------------------- /** verifies that the parser properly recognizes the types of parameters */ + @Test public void checkParameterTypes() throws Exception { impl_checkParameters( diff --git a/dbaccess/qa/complex/dbaccess/PropertyBag.java b/dbaccess/qa/complex/dbaccess/PropertyBag.java index 911ac557e..ffcbb3490 100644 --- a/dbaccess/qa/complex/dbaccess/PropertyBag.java +++ b/dbaccess/qa/complex/dbaccess/PropertyBag.java @@ -27,14 +27,26 @@ package complex.dbaccess; -import complexlib.ComplexTestCase; +// import complexlib.ComplexTestCase; +import com.sun.star.beans.NamedValue; +import com.sun.star.beans.PropertyState; +import com.sun.star.beans.PropertyValue; +import com.sun.star.beans.PropertyAttribute; +import com.sun.star.beans.XPropertyAccess; +import com.sun.star.beans.XPropertySet; +import com.sun.star.beans.XPropertyContainer; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface; import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.beans.*; -public class PropertyBag extends ComplexTestCase +// ---------- junit imports ----------------- +import org.junit.Before; +import org.junit.Test; +import static org.junit.Assert.*; +// ------------------------------------------ + +public class PropertyBag extends TestCase { private static final String VALUE = "Value"; private XPropertyContainer m_bag; @@ -42,30 +54,23 @@ public class PropertyBag extends ComplexTestCase private XPropertyAccess m_access; private XMultiServiceFactory m_orb = null; - public String[] getTestMethodNames() - { - return new String[] - { - "checkBasics", - "checkSequenceAccess", - "checkDynamicSet" - }; - } - public String getTestObjectName() { return "PropertyBag"; } + @Before + @Override public void before() { - m_orb = (XMultiServiceFactory)param.getMSF(); + m_orb = getMSF(); } + @Test public void checkBasics() { createEmptyBag(); - log.println("testing the basics"); + System.out.println("testing the basics"); // check whether empty property names are rejected boolean caughtExpected = false; @@ -76,7 +81,9 @@ public class PropertyBag extends ComplexTestCase catch(com.sun.star.lang.IllegalArgumentException e) { caughtExpected = true; } catch(com.sun.star.uno.Exception e) { } if ( !caughtExpected ) - failed( "empty property names are not rejected by XPropertyContainer::addProperty" ); + { + fail("empty property names are not rejected by XPropertyContainer::addProperty"); + } // check whether duplicate insertions are rejected caughtExpected = false; @@ -88,7 +95,9 @@ public class PropertyBag extends ComplexTestCase catch(com.sun.star.beans.PropertyExistException e) { caughtExpected = true; } catch(com.sun.star.uno.Exception e) { } if ( !caughtExpected ) - failed( "insertion of duplicate property names is not rejected" ); + { + fail("insertion of duplicate property names is not rejected"); + } // try removing the property we just added - this should fail, as it does not have // the REMOVEABLE attribute @@ -100,7 +109,9 @@ public class PropertyBag extends ComplexTestCase catch(com.sun.star.beans.NotRemoveableException e) { caughtExpected = true; } catch(com.sun.star.uno.Exception e) { } if ( !caughtExpected ) - failed( "removing non-removeable properties is expected to fail - but it didn't" ); + { + fail("removing non-removeable properties is expected to fail - but it didn't"); + } // try removing a non-existent property caughtExpected = false; @@ -111,7 +122,9 @@ public class PropertyBag extends ComplexTestCase catch(com.sun.star.beans.UnknownPropertyException e) { caughtExpected = true; } catch(com.sun.star.uno.Exception e) { } if ( !caughtExpected ) - failed( "removing non-existent properties is expected to fail - but it didn't" ); + { + fail("removing non-existent properties is expected to fail - but it didn't"); + } // try writing and reading a value for the one property we have so far try @@ -120,11 +133,13 @@ public class PropertyBag extends ComplexTestCase m_set.setPropertyValue( VALUE , testValue); final String currentValue = (String)m_set.getPropertyValue( VALUE); if ( !currentValue.equals( testValue ) ) - failed( "set property is not remembered" ); + { + fail("set property is not remembered"); + } } catch(com.sun.star.uno.Exception e) { - failed( "setting or getting a property value failed" ); + fail( "setting or getting a property value failed" ); } // try setting an illegal value for the property @@ -136,12 +151,15 @@ public class PropertyBag extends ComplexTestCase catch(com.sun.star.lang.IllegalArgumentException e) { caughtExpected = true; } catch(com.sun.star.uno.Exception e) { } if ( !caughtExpected ) - failed( "the bag does not respect the property type we declared for the property" ); + { + fail("the bag does not respect the property type we declared for the property"); + } } + @Test public void checkSequenceAccess() throws com.sun.star.uno.Exception { - log.println( "checking PropertySetAccess via sequences" ); + System.out.println( "checking PropertySetAccess via sequences" ); createStandardBag( false ); // --------------------------------- @@ -160,10 +178,10 @@ public class PropertyBag extends ComplexTestCase final Object value = m_set.getPropertyValue( expectedValues[i].Name ); if ( !value.equals( expectedValues[i].Value ) ) { - log.println( "property name : " + expectedValues[i].Name ); - log.println( "expected value: " + expectedValues[i].Value.toString() ); - log.println( "current value : " + value.toString() ); - failed( "retrieving a previously set property (" + expectedValues[i].Value.getClass().toString() + ") failed" ); + System.out.println( "property name : " + expectedValues[i].Name ); + System.out.println( "expected value: " + expectedValues[i].Value.toString() ); + System.out.println( "current value : " + value.toString() ); + fail( "retrieving a previously set property (" + expectedValues[i].Value.getClass().toString() + ") failed" ); } } @@ -180,23 +198,26 @@ public class PropertyBag extends ComplexTestCase { if ( !expectedValues[j].Value.equals( value ) ) { - log.println( "property name : " + expectedValues[j].Name ); - log.println( "expected value: " + expectedValues[j].Value.toString() ); - log.println( "current value : " + value.toString() ); - failed( "getPropertyValues failed for property '" + name + "' failed" ); + System.out.println( "property name : " + expectedValues[j].Name ); + System.out.println( "expected value: " + expectedValues[j].Value.toString() ); + System.out.println( "current value : " + value.toString() ); + fail( "getPropertyValues failed for property '" + name + "' failed" ); } break; } } if ( !m_set.getPropertyValue( name ).equals( value ) ) - failed( "XPropertyAccess::getPropertyValues() and XPropertyset::getPropertyValue results are inconsistent" ); + { + fail("XPropertyAccess::getPropertyValues() and XPropertyset::getPropertyValue results are inconsistent"); + } } } + @Test public void checkDynamicSet() throws com.sun.star.uno.Exception { - log.println( "checking proper dynamic of the set" ); + System.out.println( "checking proper dynamic of the set" ); createStandardBag( false ); final PropertyValue props[] = @@ -215,7 +236,9 @@ public class PropertyBag extends ComplexTestCase catch( com.sun.star.beans.UnknownPropertyException e ) { caughtExpected = true; } catch( com.sun.star.uno.Exception e ) { } if ( !caughtExpected ) - failed( "the set shouldn't accept unknown property values, if not explicitly told to do so" ); + { + fail("the set shouldn't accept unknown property values, if not explicitly told to do so"); + } // re-create the bag, this time allow it to implicitly add properties createStandardBag( true ); @@ -223,14 +246,18 @@ public class PropertyBag extends ComplexTestCase try { m_access.setPropertyValues( props ); success = true; } catch( com.sun.star.uno.Exception e ) { } if ( !success ) - failed( "property bag failed to implicitly add unknown properties" ); + { + fail("property bag failed to implicitly add unknown properties"); + } // see whether this property was really added, and not just ignored final PropertyValue newlyAdded = props[ props.length - 1 ]; try { if ( !m_set.getPropertyValue( newlyAdded.Name ).equals( newlyAdded.Value ) ) - failed( "the new property was not really added, or not added with the proper value" ); + { + fail("the new property was not really added, or not added with the proper value"); + } } catch( com.sun.star.uno.Exception e ) { } } @@ -241,13 +268,13 @@ public class PropertyBag extends ComplexTestCase { m_bag = null; final String serviceName = "com.sun.star.beans.PropertyBag"; - m_bag = (XPropertyContainer)UnoRuntime.queryInterface( XPropertyContainer.class, - m_orb.createInstance( serviceName ) - ); + m_bag = UnoRuntime.queryInterface(XPropertyContainer.class, m_orb.createInstance(serviceName)); if ( m_bag == null ) - failed( "could not create a " + serviceName + " instance" ); - m_set = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, m_bag ); - m_access = (XPropertyAccess)UnoRuntime.queryInterface( XPropertyAccess.class, m_bag ); + { + fail("could not create a " + serviceName + " instance"); + } + m_set = UnoRuntime.queryInterface(XPropertySet.class, m_bag); + m_access = UnoRuntime.queryInterface(XPropertyAccess.class, m_bag); } catch( com.sun.star.uno.Exception e ) { @@ -263,13 +290,13 @@ public class PropertyBag extends ComplexTestCase final Object initArgs[] = { new NamedValue( "AutomaticAddition", Boolean.valueOf( allowLazyAdding ) ) }; final String serviceName = "com.sun.star.beans.PropertyBag"; - m_bag = (XPropertyContainer)UnoRuntime.queryInterface( XPropertyContainer.class, - m_orb.createInstanceWithArguments( serviceName, initArgs ) - ); + m_bag = UnoRuntime.queryInterface(XPropertyContainer.class, m_orb.createInstanceWithArguments(serviceName, initArgs)); if ( m_bag == null ) - failed( "could not create a " + serviceName + " instance" ); - m_set = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, m_bag ); - m_access = (XPropertyAccess)UnoRuntime.queryInterface( XPropertyAccess.class, m_bag ); + { + fail("could not create a " + serviceName + " instance"); + } + m_set = UnoRuntime.queryInterface(XPropertySet.class, m_bag); + m_access = UnoRuntime.queryInterface(XPropertyAccess.class, m_bag); final Object properties[][] = { diff --git a/dbaccess/qa/complex/dbaccess/Query.java b/dbaccess/qa/complex/dbaccess/Query.java index d93d5c337..c7f4674ee 100644 --- a/dbaccess/qa/complex/dbaccess/Query.java +++ b/dbaccess/qa/complex/dbaccess/Query.java @@ -30,28 +30,19 @@ import com.sun.star.beans.XPropertySet; import com.sun.star.container.XIndexAccess; import com.sun.star.container.XNameAccess; import com.sun.star.container.XNamed; -import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.sdb.XQueriesSupplier; import com.sun.star.sdbcx.XColumnsSupplier; import com.sun.star.uno.UnoRuntime; import connectivity.tools.CRMDatabase; -public class Query extends complexlib.ComplexTestCase { +// ---------- junit imports ----------------- +import org.junit.Test; +import static org.junit.Assert.*; +// ------------------------------------------ - connectivity.tools.HsqlDatabase m_database; - - // -------------------------------------------------------------------------------------------------------- - public String[] getTestMethodNames() { - return new String[] - { - "testQueryColumns" - }; - } +public class Query extends TestCase { - // -------------------------------------------------------------------------------------------------------- - public String getTestObjectName() { - return "Query"; - } + connectivity.tools.HsqlDatabase m_database; // -------------------------------------------------------------------------------------------------------- private void createTestCase() @@ -60,25 +51,26 @@ public class Query extends complexlib.ComplexTestCase { { if ( m_database == null ) { - final CRMDatabase database = new CRMDatabase( getFactory(), false ); + final CRMDatabase database = new CRMDatabase( getMSF(), false ); m_database = database.getDatabase(); } } catch( Exception e ) { - log.println( "could not create the test case, error message:\n" + e.getMessage() ); + System.out.println( "could not create the test case, error message:\n" + e.getMessage() ); e.printStackTrace( System.err ); - assure( "failed to created the test case", false ); + fail( "failed to created the test case"); } } // -------------------------------------------------------------------------------------------------------- - private XMultiServiceFactory getFactory() - { - return (XMultiServiceFactory)param.getMSF(); - } +// private XMultiServiceFactory getFactory() +// { +// return (XMultiServiceFactory)param.getMSF(); +// } // -------------------------------------------------------------------------------------------------------- + @Test public void testQueryColumns() { createTestCase(); @@ -107,20 +99,20 @@ public class Query extends complexlib.ComplexTestCase { XIndexAccess.class, suppCols.getColumns()); // check whether the columns supplied by the query match what we expected - assure( "invalid column count (found " + columns.getCount() + ", expected: " + expectedColumnNames[i].length + ") for query \"" + queryNames[i] + "\"", + assertTrue( "invalid column count (found " + columns.getCount() + ", expected: " + expectedColumnNames[i].length + ") for query \"" + queryNames[i] + "\"", columns.getCount() == expectedColumnNames[i].length ); for ( int col = 0; col < columns.getCount(); ++col ) { final XNamed columnName = UnoRuntime.queryInterface( XNamed.class, columns.getByIndex(col) ); - assure( "column no. " + col + " of query \"" + queryNames[i] + "\" not matching", + assertTrue( "column no. " + col + " of query \"" + queryNames[i] + "\" not matching", columnName.getName().equals( expectedColumnNames[i][col] ) ); } } } catch ( Exception e ) { - assure( "caught an unexpected exception: " + e.getMessage(), false ); + fail( "caught an unexpected exception: " + e.getMessage() ); } } } diff --git a/dbaccess/qa/complex/dbaccess/QueryInQuery.java b/dbaccess/qa/complex/dbaccess/QueryInQuery.java index cd2520934..3a06313c4 100644 --- a/dbaccess/qa/complex/dbaccess/QueryInQuery.java +++ b/dbaccess/qa/complex/dbaccess/QueryInQuery.java @@ -37,28 +37,17 @@ import connectivity.tools.RowSet; import com.sun.star.sdbc.XStatement; import com.sun.star.sdbc.XResultSet; +// ---------- junit imports ----------------- +import org.junit.Test; +import static org.junit.Assert.*; +// ------------------------------------------ + public class QueryInQuery extends CRMBasedTestCase { private static final String QUERY_PRODUCTS = "query products"; - // -------------------------------------------------------------------------------------------------------- - public String[] getTestMethodNames() - { - return new String[] { - "executeSimpleSelect", - "executeAliasedSelect", - "checkNameCollisions", - "checkCyclicReferences", - "checkStatementQiQSupport" - }; - } - - // -------------------------------------------------------------------------------------------------------- - public String getTestObjectName() - { - return "QueryInQuery"; - } // -------------------------------------------------------------------------------------------------------- + @Override protected void createTestCase() { try @@ -69,7 +58,7 @@ public class QueryInQuery extends CRMBasedTestCase catch ( Exception e ) { e.printStackTrace( System.err ); - assure( "caught an exception (" + e.getMessage() + ") while creating the test case", false ); + fail( "caught an exception (" + e.getMessage() + ") while creating the test case" ); } } @@ -84,17 +73,17 @@ public class QueryInQuery extends CRMBasedTestCase outerRowSet.last(); innerRowSet.last(); - assure( "wrong record counts", outerRowSet.getRow() == innerRowSet.getRow() ); + assertTrue( "wrong record counts", outerRowSet.getRow() == innerRowSet.getRow() ); outerRowSet.beforeFirst(); innerRowSet.beforeFirst(); - assure( "wrong column counts", outerRowSet.getColumnCount() == innerRowSet.getColumnCount() ); + assertTrue( "wrong column counts", outerRowSet.getColumnCount() == innerRowSet.getColumnCount() ); while ( outerRowSet.next() && innerRowSet.next() ) { for ( int i=1; i <= outerRowSet.getColumnCount(); ++i ) { - assure( "content of column " + i + " of row " + outerRowSet.getRow() + " not identical", + assertTrue( "content of column " + i + " of row " + outerRowSet.getRow() + " not identical", innerRowSet.getString(i).equals( outerRowSet.getString(i) ) ); } } @@ -103,6 +92,7 @@ public class QueryInQuery extends CRMBasedTestCase // -------------------------------------------------------------------------------------------------------- /** executes a SQL statement simply selecting all columns from a query */ + @Test public void executeSimpleSelect() throws SQLException { verifyEqualRowSetContent( @@ -113,6 +103,7 @@ public class QueryInQuery extends CRMBasedTestCase // -------------------------------------------------------------------------------------------------------- /** verifies that aliases for inner queries work as expected */ + @Test public void executeAliasedSelect() throws SQLException { verifyEqualRowSetContent( @@ -126,6 +117,7 @@ public class QueryInQuery extends CRMBasedTestCase // -------------------------------------------------------------------------------------------------------- /** verifies that aliases for inner queries work as expected */ + @Test public void checkNameCollisions() { // create a query with a name which is used by a table @@ -137,7 +129,7 @@ public class QueryInQuery extends CRMBasedTestCase catch ( WrappedTargetException e ) { caughtExpected = true; } catch ( IllegalArgumentException e ) {} catch ( ElementExistException e ) { caughtExpected = true; } - assure( "creating queries with the name of an existing table should not be possible", + assertTrue( "creating queries with the name of an existing table should not be possible", caughtExpected ); // create a table with a name which is used by a query @@ -153,11 +145,12 @@ public class QueryInQuery extends CRMBasedTestCase } catch ( SQLException e ) { caughtExpected = true; } catch ( ElementExistException ex ) { } - assure( "creating tables with the name of an existing query should not be possible", + assertTrue( "creating tables with the name of an existing query should not be possible", caughtExpected ); } // -------------------------------------------------------------------------------------------------------- + @Test public void checkCyclicReferences() throws ElementExistException, WrappedTargetException, IllegalArgumentException { // some queries which create a cycle in the sub query tree @@ -172,21 +165,22 @@ public class QueryInQuery extends CRMBasedTestCase try { rowSet.execute(); } catch ( SQLException e ) { caughtExpected = ( e.ErrorCode == -com.sun.star.sdb.ErrorCondition.PARSER_CYCLIC_SUB_QUERIES ); } - assure( "executing a query with cyclic nested sub queries should fail!", caughtExpected ); + assertTrue( "executing a query with cyclic nested sub queries should fail!", caughtExpected ); } // -------------------------------------------------------------------------------------------------------- + @Test public void checkStatementQiQSupport() { try { final XStatement statement = m_database.getConnection().createStatement(); final XResultSet resultSet = statement.executeQuery( "SELECT * FROM \"query products\"" ); - assure( "Result Set is null", resultSet != null ); + assertTrue( "Result Set is null", resultSet != null ); } catch( SQLException e ) { - assure( "SDB level statements do not allow for queries in queries", false ); + fail( "SDB level statements do not allow for queries in queries" ); } } } diff --git a/dbaccess/qa/complex/dbaccess/RowSet.java b/dbaccess/qa/complex/dbaccess/RowSet.java index c3e83c9c5..0f6f7940a 100644 --- a/dbaccess/qa/complex/dbaccess/RowSet.java +++ b/dbaccess/qa/complex/dbaccess/RowSet.java @@ -32,7 +32,6 @@ import com.sun.star.beans.XPropertySet; import com.sun.star.container.XIndexAccess; import com.sun.star.lang.WrappedTargetException; import com.sun.star.lang.XComponent; -import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.sdb.CommandType; import com.sun.star.sdb.XParametersSupplier; import com.sun.star.sdb.XResultSetAccess; @@ -49,7 +48,7 @@ import com.sun.star.sdbcx.XColumnsSupplier; import com.sun.star.sdbcx.XDeleteRows; import com.sun.star.sdbcx.XRowLocate; import com.sun.star.uno.UnoRuntime; -import complexlib.ComplexTestCase; + import connectivity.tools.CRMDatabase; import connectivity.tools.DataSource; import connectivity.tools.HsqlDatabase; @@ -57,7 +56,12 @@ import connectivity.tools.sdb.Connection; import java.lang.reflect.Method; import java.util.Random; -public class RowSet extends ComplexTestCase +// ---------- junit imports ----------------- +import org.junit.Test; +import static org.junit.Assert.*; +// ------------------------------------------ + +public class RowSet extends TestCase { static final int MAX_TABLE_ROWS = 100; @@ -82,7 +86,7 @@ public class RowSet extends ComplexTestCase XRow m_row; int m_id; - public ResultSetMovementStress(XResultSet _resultSet, int _id) throws java.lang.Exception + ResultSetMovementStress(XResultSet _resultSet, int _id) throws java.lang.Exception { m_resultSet = _resultSet; m_row = UnoRuntime.queryInterface( XRow.class, m_resultSet ); @@ -99,50 +103,29 @@ public class RowSet extends ComplexTestCase int pos = m_resultSet.getRow(); testPosition(m_resultSet, m_row, i + 1, "clone move(" + m_id + ")"); int pos2 = m_resultSet.getRow(); - assure("ResultSetMovementStress wrong position: " + i + " Pos1: " + pos + " Pos2: " + pos2, pos == pos2); + assertTrue("ResultSetMovementStress wrong position: " + i + " Pos1: " + pos + " Pos2: " + pos2, pos == pos2); } } catch (Exception e) { - assure("ResultSetMovementStress(" + m_id + ") failed: " + e, false); + fail("ResultSetMovementStress(" + m_id + ") failed: " + e); } } } // -------------------------------------------------------------------------------------------------------- - - public String[] getTestMethodNames() - { - return new String[] - { - "testRowSet", - "testRowSetEvents", - "testDeleteBehavior", - "testCloneMovesPlusDeletions", - "testCloneMovesPlusInsertions", - "testParameters" - }; - } - - // -------------------------------------------------------------------------------------------------------- - public String getTestObjectName() - { - return "RowSet"; - } - - // -------------------------------------------------------------------------------------------------------- private void createTestCase(boolean _defaultRowSet) { if (m_database == null) { try { - final CRMDatabase database = new CRMDatabase( getFactory(), false ); + final CRMDatabase database = new CRMDatabase( getMSF(), false ); m_database = database.getDatabase(); m_dataSource = m_database.getDataSource(); } catch (Exception e) { - assure("could not create the embedded HSQL database: " + e.getMessage(), false); + fail("could not create the embedded HSQL database: " + e.getMessage()); } } @@ -152,7 +135,7 @@ public class RowSet extends ComplexTestCase } catch (SQLException e) { - assure("could not connect to the database/table structure, error message:\n" + e.getMessage(), false); + fail("could not connect to the database/table structure, error message:\n" + e.getMessage()); } if (_defaultRowSet) @@ -162,12 +145,6 @@ public class RowSet extends ComplexTestCase } // -------------------------------------------------------------------------------------------------------- - private XMultiServiceFactory getFactory() - { - return (XMultiServiceFactory) param.getMSF(); - } - - // -------------------------------------------------------------------------------------------------------- /** creates a com.sun.star.sdb.RowSet to use during the test * @param command * the command to use for the RowSet @@ -196,7 +173,7 @@ public class RowSet extends ComplexTestCase { try { - m_rowSet = UnoRuntime.queryInterface( XRowSet.class, getFactory().createInstance( "com.sun.star.sdb.RowSet" ) ); + m_rowSet = UnoRuntime.queryInterface( XRowSet.class, getMSF().createInstance( "com.sun.star.sdb.RowSet" ) ); final XPropertySet rowSetProperties = UnoRuntime.queryInterface( XPropertySet.class, m_rowSet ); rowSetProperties.setPropertyValue("Command", command); rowSetProperties.setPropertyValue("CommandType", Integer.valueOf(commandType)); @@ -220,15 +197,16 @@ public class RowSet extends ComplexTestCase } catch (Exception e) { - assure("caught an exception while creating the RowSet. Type:\n" + e.getClass().toString() + "\nMessage:\n" + e.getMessage(), false); + fail("caught an exception while creating the RowSet. Type:\n" + e.getClass().toString() + "\nMessage:\n" + e.getMessage()); } } // -------------------------------------------------------------------------------------------------------- + @Test public void testRowSet() throws java.lang.Exception { - log.println("testing testRowSet"); + System.out.println("testing testRowSet"); createTestCase(true); // sequential postioning @@ -278,8 +256,8 @@ public class RowSet extends ComplexTestCase { final int val = m_row.getInt(1); final int pos = m_resultSet.getRow(); - assure(location + ": value/position do not match: " + pos + " (pos) != " + val + " (val)", val == pos); - assure(location + ": value/position are not as expected: " + val + " (val) != " + expectedValue + " (expected)", val == expectedValue); + assertTrue(location + ": value/position do not match: " + pos + " (pos) != " + val + " (val)", val == pos); + assertTrue(location + ": value/position are not as expected: " + val + " (val) != " + expectedValue + " (expected)", val == expectedValue); } // -------------------------------------------------------------------------------------------------------- @@ -297,7 +275,7 @@ public class RowSet extends ComplexTestCase } catch (Exception e) { - assure("testSequentialPositining failed: " + e, false); + fail("testSequentialPositining failed: " + e); } } @@ -309,13 +287,13 @@ public class RowSet extends ComplexTestCase for (int i = 1; i <= MAX_FETCH_ROWS; ++i) { final int calcPos = (MAX_TABLE_ROWS % i) + 1; - assure("testAbsolutePositioning failed", _resultSet.absolute(calcPos)); + assertTrue("testAbsolutePositioning failed", _resultSet.absolute(calcPos)); testPosition(_resultSet, _row, calcPos, "testAbsolutePositioning"); } } catch (Exception e) { - assure("testAbsolutePositioning failed: " + e, false); + fail("testAbsolutePositioning failed: " + e); } } @@ -339,7 +317,7 @@ public class RowSet extends ComplexTestCase } catch (Exception e) { - assure("test3 failed: " + e, false); + fail("test3 failed: " + e); } } @@ -366,14 +344,14 @@ public class RowSet extends ComplexTestCase } catch (Exception e) { - assure("test4 failed: " + e, false); + fail("test4 failed: " + e); } } // -------------------------------------------------------------------------------------------------------- void testConcurrentAccess(XResultSet _resultSet) { - log.println("testing Thread"); + System.out.println("testing Thread"); try { _resultSet.beforeFirst(); @@ -384,7 +362,7 @@ public class RowSet extends ComplexTestCase for (int i = 0; i < numberOfThreads; ++i) { threads[i] = new Thread(new ResultSetMovementStress(createClone(), i)); - log.println("starting thread " + (i + 1) + " of " + (numberOfThreads)); + System.out.println("starting thread " + (i + 1) + " of " + (numberOfThreads)); threads[i].start(); } @@ -395,14 +373,15 @@ public class RowSet extends ComplexTestCase } catch (Exception e) { - assure("testConcurrentAccess failed: " + e, false); + fail("testConcurrentAccess failed: " + e); } } // -------------------------------------------------------------------------------------------------------- + @Test public void testRowSetEvents() throws java.lang.Exception { - log.println("testing RowSet Events"); + System.out.println("testing RowSet Events"); createTestCase(true); // first we create our RowSet object @@ -547,26 +526,26 @@ public class RowSet extends ComplexTestCase _evt.clearCalling(); _method.invoke(res, args); - log.println("testing events for " + _method.getName()); + System.out.println("testing events for " + _method.getName()); final int calling[] = _evt.getCalling(); int pos = 1; - assure("Callings are not in the correct order for APPROVE_CURSOR_MOVE ", + assertTrue("Callings are not in the correct order for APPROVE_CURSOR_MOVE ", (!_must[RowSetEventListener.APPROVE_CURSOR_MOVE] || calling[RowSetEventListener.APPROVE_CURSOR_MOVE] == -1) || calling[RowSetEventListener.APPROVE_CURSOR_MOVE] == pos++); - assure("Callings are not in the correct order for APPROVE_ROW_CHANGE", + assertTrue("Callings are not in the correct order for APPROVE_ROW_CHANGE", (!_must[RowSetEventListener.APPROVE_ROW_CHANGE] || calling[RowSetEventListener.APPROVE_ROW_CHANGE] == -1) || calling[RowSetEventListener.APPROVE_ROW_CHANGE] == pos++); - assure("Callings are not in the correct order for COLUMN_VALUE", + assertTrue("Callings are not in the correct order for COLUMN_VALUE", (!_must[RowSetEventListener.COLUMN_VALUE] || calling[RowSetEventListener.COLUMN_VALUE] == -1) || calling[RowSetEventListener.COLUMN_VALUE] == pos++); - assure("Callings are not in the correct order for CURSOR_MOVED", + assertTrue("Callings are not in the correct order for CURSOR_MOVED", (!_must[RowSetEventListener.CURSOR_MOVED] || calling[RowSetEventListener.CURSOR_MOVED] == -1) || calling[RowSetEventListener.CURSOR_MOVED] == pos++); - assure("Callings are not in the correct order for ROW_CHANGED", + assertTrue("Callings are not in the correct order for ROW_CHANGED", (!_must[RowSetEventListener.ROW_CHANGED] || calling[RowSetEventListener.ROW_CHANGED] == -1) || calling[RowSetEventListener.ROW_CHANGED] == pos++); - assure("Callings are not in the correct order for IS_MODIFIED", + assertTrue("Callings are not in the correct order for IS_MODIFIED", (!_must[RowSetEventListener.IS_MODIFIED] || calling[RowSetEventListener.IS_MODIFIED] == -1) || calling[RowSetEventListener.IS_MODIFIED] == pos++); - assure("Callings are not in the correct order for IS_NEW", + assertTrue("Callings are not in the correct order for IS_NEW", (!_must[RowSetEventListener.IS_NEW] || calling[RowSetEventListener.IS_NEW] == -1) || calling[RowSetEventListener.IS_NEW] == pos++); - assure("Callings are not in the correct order for ROW_COUNT", + assertTrue("Callings are not in the correct order for ROW_COUNT", (!_must[RowSetEventListener.ROW_COUNT] || calling[RowSetEventListener.ROW_COUNT] == -1) || calling[RowSetEventListener.ROW_COUNT] == pos++); - assure("Callings are not in the correct order for IS_ROW_COUNT_FINAL", + assertTrue("Callings are not in the correct order for IS_ROW_COUNT_FINAL", (!_must[RowSetEventListener.IS_ROW_COUNT_FINAL] || calling[RowSetEventListener.IS_ROW_COUNT_FINAL] == -1) || calling[RowSetEventListener.IS_ROW_COUNT_FINAL] == pos); _evt.clearCalling(); @@ -587,7 +566,7 @@ public class RowSet extends ComplexTestCase private int positionRandom() throws SQLException, UnknownPropertyException, WrappedTargetException { final int position = (new Random()).nextInt(currentRowCount() - 2) + 2; - assure("sub task failed: could not position to row no. " + (Integer.valueOf(position)).toString(), + assertTrue("sub task failed: could not position to row no. " + (Integer.valueOf(position)).toString(), m_resultSet.absolute(position)); return m_resultSet.getRow(); } @@ -609,14 +588,15 @@ public class RowSet extends ComplexTestCase final int positionAfter = m_resultSet.getRow(); final int rowCountAfter = currentRowCount(); - assure("position changed during |deleteRow| (it should not)", positionAfter == positionBefore); - assure("row count changed with a |deleteRow| (it should not)", rowCountBefore == rowCountAfter); - assure("RowSet does not report the current row as deleted after |deleteRow|", m_resultSet.rowDeleted()); + assertTrue("position changed during |deleteRow| (it should not)", positionAfter == positionBefore); + assertTrue("row count changed with a |deleteRow| (it should not)", rowCountBefore == rowCountAfter); + assertTrue("RowSet does not report the current row as deleted after |deleteRow|", m_resultSet.rowDeleted()); return positionBefore; } // -------------------------------------------------------------------------------------------------------- + @Test public void testDeleteBehavior() throws Exception { createTestCase(true); @@ -639,40 +619,40 @@ public class RowSet extends ComplexTestCase { caughtException = true; } - assure("asking for the bookmark of a deleted row should throw an exception", caughtException); + assertTrue("asking for the bookmark of a deleted row should throw an exception", caughtException); // ..................................................................................................... // isXXX methods should return |false| on a deleted row - assure("one of the isFoo failed after |deleteRow|", !m_resultSet.isBeforeFirst() && !m_resultSet.isAfterLast() && !m_resultSet.isFirst() && !m_resultSet.isLast()); + assertTrue("one of the isFoo failed after |deleteRow|", !m_resultSet.isBeforeFirst() && !m_resultSet.isAfterLast() && !m_resultSet.isFirst() && !m_resultSet.isLast()); // note that we can assume that isFirst / isLast also return |false|, since deleteRandom did // not position on the first or last record, but inbetween // ..................................................................................................... // check if moving away from this row in either direction yields the expected results - assure("|previous| after |deleteRow| failed", m_resultSet.previous()); + assertTrue("|previous| after |deleteRow| failed", m_resultSet.previous()); final int positionPrevious = m_resultSet.getRow(); - assure("position after |previous| after |deleteRow| is not as expected", positionPrevious == deletedRow - 1); + assertTrue("position after |previous| after |deleteRow| is not as expected", positionPrevious == deletedRow - 1); deletedRow = deleteRandom(); - assure("|next| after |deleteRow| failed", m_resultSet.next()); + assertTrue("|next| after |deleteRow| failed", m_resultSet.next()); final int positionAfter = m_resultSet.getRow(); - assure("position after |next| after |deleteRow| is not as expected", positionAfter == deletedRow); + assertTrue("position after |next| after |deleteRow| is not as expected", positionAfter == deletedRow); // since the deleted record "vanishs" as soon as the cursor is moved away from it, the absolute position does // not change with a |next| call here // ..................................................................................................... // check if the deleted rows really vanished after moving away from them - assure("row count did not change as expected after two deletions", initialRowCount - 2 == currentRowCount()); + assertTrue("row count did not change as expected after two deletions", initialRowCount - 2 == currentRowCount()); // ..................................................................................................... // check if the deleted row vanishes after moving to the insertion row final int rowCountBefore = currentRowCount(); final int deletedPos = deleteRandom(); m_resultSetUpdate.moveToInsertRow(); - assure("moving to the insertion row immediately after |deleteRow| does not adjust the row count", rowCountBefore == currentRowCount() + 1); + assertTrue("moving to the insertion row immediately after |deleteRow| does not adjust the row count", rowCountBefore == currentRowCount() + 1); m_resultSetUpdate.moveToCurrentRow(); - assure("|moveToCurrentRow| after |deleteRow| + |moveToInsertRow| results in unexpected position", + assertTrue("|moveToCurrentRow| after |deleteRow| + |moveToInsertRow| results in unexpected position", (m_resultSet.getRow() == deletedPos) && !m_resultSet.rowDeleted()); // the same, but this time with deleting the first row (which is not covered by deleteRandom) @@ -680,7 +660,7 @@ public class RowSet extends ComplexTestCase m_resultSetUpdate.deleteRow(); m_resultSetUpdate.moveToInsertRow(); m_resultSetUpdate.moveToCurrentRow(); - assure("|last| + |deleteRow| + |moveToInsertRow| + |moveToCurrentRow| results in wrong state", m_resultSet.isAfterLast()); + assertTrue("|last| + |deleteRow| + |moveToInsertRow| + |moveToCurrentRow| results in wrong state", m_resultSet.isAfterLast()); // ..................................................................................................... // check if deleting a deleted row fails as expected @@ -694,7 +674,7 @@ public class RowSet extends ComplexTestCase { caughtException = true; } - assure("deleting a deleted row succeeded - it shouldn't", caughtException); + assertTrue("deleting a deleted row succeeded - it shouldn't", caughtException); // ..................................................................................................... // check if deleteRows fails if it contains the bookmark of a previously-deleted row @@ -708,7 +688,7 @@ public class RowSet extends ComplexTestCase { firstBookmark, deleteBookmark }); - assure("XDeleteRows::deleteRows with the bookmark of an already-deleted row failed", + assertTrue("XDeleteRows::deleteRows with the bookmark of an already-deleted row failed", (deleteSuccess.length == 2) && (deleteSuccess[0] != 0) && (deleteSuccess[1] == 0)); // ..................................................................................................... @@ -723,12 +703,12 @@ public class RowSet extends ComplexTestCase { caughtException = true; } - assure("refreshing a deleted row succeeded - it shouldn't", caughtException); + assertTrue("refreshing a deleted row succeeded - it shouldn't", caughtException); // ..................................................................................................... // rowUpdated/rowDeleted deleteRandom(); - assure("rowDeleted and/or rowUpdated are wrong on a deleted row", !m_resultSet.rowUpdated() && !m_resultSet.rowInserted()); + assertTrue("rowDeleted and/or rowUpdated are wrong on a deleted row", !m_resultSet.rowUpdated() && !m_resultSet.rowInserted()); // ..................................................................................................... // updating values in a deleted row should fail @@ -743,14 +723,14 @@ public class RowSet extends ComplexTestCase { caughtException = true; } - assure("updating values in a deleted row should not succeed", caughtException); + assertTrue("updating values in a deleted row should not succeed", caughtException); } // -------------------------------------------------------------------------------------------------------- /** checks whether deletions on the main RowSet properly interfere (or don't interfere) with the movement * on a clone of the RowSet */ - @SuppressWarnings("empty-statement") + @Test public void testCloneMovesPlusDeletions() throws SQLException, UnknownPropertyException, WrappedTargetException { createTestCase(true); @@ -768,20 +748,20 @@ public class RowSet extends ComplexTestCase final int clonePosition = clone.getRow(); m_resultSetUpdate.deleteRow(); - assure("clone doesn't know that its current row has been deleted via the RowSet", clone.rowDeleted()); - assure("clone's position changed somehow during deletion", clonePosition == clone.getRow()); + assertTrue("clone doesn't know that its current row has been deleted via the RowSet", clone.rowDeleted()); + assertTrue("clone's position changed somehow during deletion", clonePosition == clone.getRow()); // ..................................................................................................... // move the row set away from the deleted record. This should still not touch the state of the clone m_resultSet.previous(); - assure("clone doesn't know (anymore) that its current row has been deleted via the RowSet", clone.rowDeleted()); - assure("clone's position changed somehow during deletion and RowSet-movement", clonePosition == clone.getRow()); + assertTrue("clone doesn't know (anymore) that its current row has been deleted via the RowSet", clone.rowDeleted()); + assertTrue("clone's position changed somehow during deletion and RowSet-movement", clonePosition == clone.getRow()); // ..................................................................................................... // move the clone away from the deleted record clone.next(); - assure("clone still assumes that its row is deleted - but we already moved it", !clone.rowDeleted()); + assertTrue("clone still assumes that its row is deleted - but we already moved it", !clone.rowDeleted()); // ..................................................................................................... // check whether deleting the extremes (first / last) work @@ -789,36 +769,37 @@ public class RowSet extends ComplexTestCase cloneRowLocate.moveToBookmark(m_rowLocate.getBookmark()); m_resultSetUpdate.deleteRow(); clone.previous(); - assure("deleting the first record left the clone in a strange state (after |previous|)", clone.isBeforeFirst()); + assertTrue("deleting the first record left the clone in a strange state (after |previous|)", clone.isBeforeFirst()); clone.next(); - assure("deleting the first record left the clone in a strange state (after |previous| + |next|)", clone.isFirst()); + assertTrue("deleting the first record left the clone in a strange state (after |previous| + |next|)", clone.isFirst()); m_resultSet.last(); cloneRowLocate.moveToBookmark(m_rowLocate.getBookmark()); m_resultSetUpdate.deleteRow(); clone.next(); - assure("deleting the last record left the clone in a strange state (after |next|)", clone.isAfterLast()); + assertTrue("deleting the last record left the clone in a strange state (after |next|)", clone.isAfterLast()); clone.previous(); - assure("deleting the first record left the clone in a strange state (after |next| + |previous|)", clone.isLast()); + assertTrue("deleting the first record left the clone in a strange state (after |next| + |previous|)", clone.isLast()); // ..................................................................................................... // check whether movements of the clone interfere with movements of the RowSet, if the latter is on a deleted row final int positionBefore = positionRandom(); m_resultSetUpdate.deleteRow(); - assure("|deleteRow|, but no |rowDeleted| (this should have been found much earlier!)", m_resultSet.rowDeleted()); + assertTrue("|deleteRow|, but no |rowDeleted| (this should have been found much earlier!)", m_resultSet.rowDeleted()); clone.beforeFirst(); while (clone.next()); - assure("row set forgot that the current row is deleted", m_resultSet.rowDeleted()); + assertTrue("row set forgot that the current row is deleted", m_resultSet.rowDeleted()); - assure("moving to the next record after |deleteRow| and clone moves failed", m_resultSet.next()); - assure("wrong position after |deleteRow| and clone movement", !m_resultSet.isAfterLast() && !m_resultSet.isBeforeFirst()); - assure("wrong absolute position after |deleteRow| and clone movement", m_resultSet.getRow() == positionBefore); + assertTrue("moving to the next record after |deleteRow| and clone moves failed", m_resultSet.next()); + assertTrue("wrong position after |deleteRow| and clone movement", !m_resultSet.isAfterLast() && !m_resultSet.isBeforeFirst()); + assertTrue("wrong absolute position after |deleteRow| and clone movement", m_resultSet.getRow() == positionBefore); } // -------------------------------------------------------------------------------------------------------- /** checks whether insertions on the main RowSet properly interfere (or don't interfere) with the movement * on a clone of the RowSet */ + @Test public void testCloneMovesPlusInsertions() throws SQLException, UnknownPropertyException, WrappedTargetException, PropertyVetoException, com.sun.star.lang.IllegalArgumentException { createTestCase(true); @@ -839,7 +820,7 @@ public class RowSet extends ComplexTestCase final int rowValue1 = m_row.getInt(1); final int rowPos = m_resultSet.getRow(); final int rowValue2 = m_row.getInt(1); - assure("repeated query for the same column value delivers different values (" + rowValue1 + " and " + rowValue2 + ") on row: " + rowPos, + assertTrue("repeated query for the same column value delivers different values (" + rowValue1 + " and " + rowValue2 + ") on row: " + rowPos, rowValue1 == rowValue2); testPosition(clone, cloneRow, 1, "mixed clone/rowset move: clone check"); @@ -871,7 +852,7 @@ public class RowSet extends ComplexTestCase } catch (Exception e) { - assure("testing the parameters of a table failed" + e.getMessage(), false); + fail("testing the parameters of a table failed" + e.getMessage()); } } // -------------------------------------------------------------------------------------------------------- @@ -888,7 +869,7 @@ public class RowSet extends ComplexTestCase } catch (Exception e) { - assure("testing the parameters of a table failed" + e.getMessage(), false); + fail("testing the parameters of a table failed" + e.getMessage()); } } @@ -899,7 +880,7 @@ public class RowSet extends ComplexTestCase final int expected = _paramNames.length; final int found = params != null ? params.getCount() : 0; - assure("wrong number of parameters (expected: " + expected + ", found: " + found + ") in " + _context, + assertTrue("wrong number of parameters (expected: " + expected + ", found: " + found + ") in " + _context, found == expected); if (found == 0) @@ -913,7 +894,7 @@ public class RowSet extends ComplexTestCase final String expectedName = _paramNames[i]; final String foundName = (String) parameter.getPropertyValue("Name"); - assure("wrong parameter name (expected: " + expectedName + ", found: " + foundName + ") in" + _context, + assertTrue("wrong parameter name (expected: " + expectedName + ", found: " + foundName + ") in" + _context, expectedName.equals(foundName)); } } @@ -934,7 +915,7 @@ public class RowSet extends ComplexTestCase } catch (Exception e) { - assure("testing the parameters of a parametrized query failed" + e.getMessage(), false); + fail("testing the parameters of a parametrized query failed" + e.getMessage()); } } @@ -953,7 +934,7 @@ public class RowSet extends ComplexTestCase XPropertySet firstParam = UnoRuntime.queryInterface( XPropertySet.class, params.getByIndex( 0 ) ); Object firstParamValue = firstParam.getPropertyValue("Value"); - assure("XParameters and the parameters container do not properly interact", + assertTrue("XParameters and the parameters container do not properly interact", "Apples".equals(firstParamValue)); // let's see whether this also survices an execute of the row set @@ -967,12 +948,12 @@ public class RowSet extends ComplexTestCase firstParam = UnoRuntime.queryInterface( XPropertySet.class, params.getByIndex( 0 ) ); } firstParamValue = firstParam.getPropertyValue("Value"); - assure("XParameters and the parameters container do not properly interact, after the row set has been executed", + assertTrue("XParameters and the parameters container do not properly interact, after the row set has been executed", "Oranges".equals(firstParamValue)); } catch (Exception e) { - assure("could not test the relationship between XParameters and XParametersSupplier" + e.getMessage(), false); + fail("could not test the relationship between XParameters and XParametersSupplier" + e.getMessage()); } } @@ -997,13 +978,14 @@ public class RowSet extends ComplexTestCase } catch (Exception e) { - assure("testing the parameters within a WHERE clause failed" + e.getMessage(), false); + fail("testing the parameters within a WHERE clause failed" + e.getMessage()); } } // -------------------------------------------------------------------------------------------------------- /** checks the XParametersSupplier functionality of a RowSet */ + @Test public void testParameters() { createTestCase(false); diff --git a/dbaccess/qa/complex/dbaccess/RowSetEventListener.java b/dbaccess/qa/complex/dbaccess/RowSetEventListener.java index b0901d979..1359653fc 100644 --- a/dbaccess/qa/complex/dbaccess/RowSetEventListener.java +++ b/dbaccess/qa/complex/dbaccess/RowSetEventListener.java @@ -33,7 +33,7 @@ import com.sun.star.sdb.RowChangeEvent; import com.sun.star.lang.EventObject; import com.sun.star.beans.XPropertyChangeListener; -public class RowSetEventListener implements XRowSetApproveListener,XRowSetListener,XPropertyChangeListener +public final class RowSetEventListener implements XRowSetApproveListener,XRowSetListener,XPropertyChangeListener { public static final int APPROVE_CURSOR_MOVE = 0; public static final int APPROVE_ROW_CHANGE = 1; diff --git a/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java b/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java index 6eb0525b9..09a597576 100755 --- a/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java +++ b/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java @@ -26,16 +26,31 @@ ************************************************************************/ package complex.dbaccess; +import com.sun.star.beans.PropertyState; +import com.sun.star.sdb.SQLFilterOperator; +import com.sun.star.beans.PropertyAttribute; +import com.sun.star.beans.XPropertySet; +import com.sun.star.beans.XPropertyContainer; +import com.sun.star.beans.NamedValue; +import com.sun.star.container.XNameAccess; +import com.sun.star.sdbcx.XTablesSupplier; +import com.sun.star.sdb.XParametersSupplier; +import com.sun.star.beans.PropertyValue; +import com.sun.star.sdbcx.XColumnsSupplier; +import com.sun.star.container.XIndexAccess; +import com.sun.star.sdb.CommandType; +import com.sun.star.sdb.XSingleSelectQueryComposer; import com.sun.star.uno.UnoRuntime; -import com.sun.star.beans.*; -import com.sun.star.sdbcx.*; -import com.sun.star.sdb.*; -import com.sun.star.container.*; import com.sun.star.sdbc.DataType; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +// ---------- junit imports ----------------- +import org.junit.Test; +import static org.junit.Assert.*; +// ------------------------------------------ + public class SingleSelectQueryComposer extends CRMBasedTestCase { @@ -48,32 +63,13 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase private final static String INNERPRODUCTSQUERY = "products (inner)"; // -------------------------------------------------------------------------------------------------------- - public String[] getTestMethodNames() - { - return new String[] - { - "testSetCommand", - "testAttributes", - "testSubQueries", - "testParameters", - "testDisjunctiveNormalForm", - "testConditionByColumn" - }; - } - - // -------------------------------------------------------------------------------------------------------- - public String getTestObjectName() - { - return "SingleSelectQueryComposer"; - } - - // -------------------------------------------------------------------------------------------------------- private void createQueries() throws Exception { m_database.getDatabase().getDataSource().createQuery(INNERPRODUCTSQUERY, "SELECT * FROM \"products\""); } // -------------------------------------------------------------------------------------------------------- + @Override protected void createTestCase() { try @@ -87,14 +83,14 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase } catch (Exception e) { - assure("caught an exception (" + e.getMessage() + ") while creating the test case", false); + fail("caught an exception (" + e.getMessage() + ") while creating the test case"); } } // -------------------------------------------------------------------------------------------------------- private void checkAttributeAccess(String _attributeName, String _attributeValue) { - log.println("setting " + _attributeName + " to " + _attributeValue); + System.out.println("setting " + _attributeName + " to " + _attributeValue); String realValue = null; try { @@ -124,53 +120,55 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase catch (InvocationTargetException e) { } - assure("set/get" + _attributeName + " not working as expected (set: " + _attributeValue + ", get: " + (realValue != null ? realValue : "null") + ")", + assertTrue("set/get" + _attributeName + " not working as expected (set: " + _attributeValue + ", get: " + (realValue != null ? realValue : "null") + ")", realValue.equals(_attributeValue)); - log.println(" (results in " + (String) m_composer.getQuery() + ")"); + System.out.println(" (results in " + m_composer.getQuery() + ")"); } /** tests setCommand of the composer */ + @Test public void testSetCommand() { - log.println("testing SingleSelectQueryComposer's setCommand"); + System.out.println("testing SingleSelectQueryComposer's setCommand"); try { final String table = "SELECT * FROM \"customers\""; m_composer.setCommand("customers",CommandType.TABLE); - assure("setCommand/getQuery TABLE inconsistent", m_composer.getQuery().equals(table)); + assertTrue("setCommand/getQuery TABLE inconsistent", m_composer.getQuery().equals(table)); m_database.getDatabase().getDataSource().createQuery("set command test", "SELECT * FROM \"orders for customer\" \"a\", \"customers\" \"b\" WHERE \"a\".\"Product Name\" = \"b\".\"Name\""); m_composer.setCommand("set command test",CommandType.QUERY); - assure("setCommand/getQuery QUERY inconsistent", m_composer.getQuery().equals(m_database.getDatabase().getDataSource().getQueryDefinition("set command test").getCommand())); + assertTrue("setCommand/getQuery QUERY inconsistent", m_composer.getQuery().equals(m_database.getDatabase().getDataSource().getQueryDefinition("set command test").getCommand())); final String sql = "SELECT * FROM \"orders for customer\" WHERE \"Product Name\" = 'test'"; m_composer.setCommand(sql,CommandType.COMMAND); - assure("setCommand/getQuery COMMAND inconsistent", m_composer.getQuery().equals(sql)); + assertTrue("setCommand/getQuery COMMAND inconsistent", m_composer.getQuery().equals(sql)); } catch (Exception e) { - assure("Exception caught: " + e, false); + fail("Exception caught: " + e); } } /** tests accessing attributes of the composer (order, filter, group by, having) */ + @Test public void testAttributes() { - log.println("testing SingleSelectQueryComposer's attributes (order, filter, group by, having)"); + System.out.println("testing SingleSelectQueryComposer's attributes (order, filter, group by, having)"); try { - log.println("check setElementaryQuery"); + System.out.println("check setElementaryQuery"); final String simpleQuery2 = "SELECT * FROM \"customers\" WHERE \"Name\" = 'oranges'"; m_composer.setElementaryQuery(simpleQuery2); - assure("setElementaryQuery/getQuery inconsistent", m_composer.getQuery().equals(simpleQuery2)); + assertTrue("setElementaryQuery/getQuery inconsistent", m_composer.getQuery().equals(simpleQuery2)); - log.println("check setQuery"); + System.out.println("check setQuery"); final String simpleQuery = "SELECT * FROM \"customers\""; m_composer.setQuery(simpleQuery); - assure("set/getQuery inconsistent", m_composer.getQuery().equals(simpleQuery)); + assertTrue("set/getQuery inconsistent", m_composer.getQuery().equals(simpleQuery)); checkAttributeAccess("Filter", "\"Name\" = 'oranges'"); checkAttributeAccess("Group", "\"City\""); @@ -178,16 +176,16 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase checkAttributeAccess("HavingClause", "\"ID\" <> 4"); final XIndexAccess orderColumns = m_composer.getOrderColumns(); - assure("Order columns doesn't exist: \"Address\"", + assertTrue("Order columns doesn't exist: \"Address\"", orderColumns != null && orderColumns.getCount() == 1 && orderColumns.getByIndex(0) != null); final XIndexAccess groupColumns = m_composer.getGroupColumns(); - assure("Group columns doesn't exist: \"City\"", + assertTrue("Group columns doesn't exist: \"City\"", groupColumns != null && groupColumns.getCount() == 1 && groupColumns.getByIndex(0) != null); // XColumnsSupplier - final XColumnsSupplier xSelectColumns = (XColumnsSupplier) UnoRuntime.queryInterface(XColumnsSupplier.class, m_composer); - assure("no select columns, or wrong number of select columns", + final XColumnsSupplier xSelectColumns = UnoRuntime.queryInterface(XColumnsSupplier.class, m_composer); + assertTrue("no select columns, or wrong number of select columns", xSelectColumns != null && xSelectColumns.getColumns() != null && xSelectColumns.getColumns().getElementNames().length == 6); // structured filter @@ -196,40 +194,41 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase final PropertyValue[][] aStructuredFilter = m_composer.getStructuredFilter(); m_composer.setFilter(""); m_composer.setStructuredFilter(aStructuredFilter); - assure("Structured Filter not identical", m_composer.getFilter().equals(COMPLEXFILTER)); + assertTrue("Structured Filter not identical", m_composer.getFilter().equals(COMPLEXFILTER)); // structured having clause m_composer.setHavingClause(COMPLEXFILTER); final PropertyValue[][] aStructuredHaving = m_composer.getStructuredHavingClause(); m_composer.setHavingClause(""); m_composer.setStructuredHavingClause(aStructuredHaving); - assure("Structured Having Clause not identical", m_composer.getHavingClause().equals(COMPLEXFILTER)); + assertTrue("Structured Having Clause not identical", m_composer.getHavingClause().equals(COMPLEXFILTER)); } catch (Exception e) { - assure("Exception caught: " + e, false); + fail("Exception caught: " + e); } } /** test various sub query related features ("queries in queries") */ + @Test public void testSubQueries() throws Exception { m_composer.setQuery("SELECT * from \"" + INNERPRODUCTSQUERY + "\""); - final XTablesSupplier suppTables = (XTablesSupplier) UnoRuntime.queryInterface( - XTablesSupplier.class, m_composer); + final XTablesSupplier suppTables = UnoRuntime.queryInterface(XTablesSupplier.class, m_composer); final XNameAccess tables = suppTables.getTables(); - assure("a simple SELECT * FROM <query> could not be parsed", + assertTrue("a simple SELECT * FROM <query> could not be parsed", tables != null && tables.hasByName(INNERPRODUCTSQUERY)); final String sInnerCommand = m_database.getDatabase().getDataSource().getQueryDefinition(INNERPRODUCTSQUERY).getCommand(); final String sExecutableQuery = m_composer.getQueryWithSubstitution(); - assure("simple query containing a sub query improperly parsed to SDBC level statement: \n1. " + sExecutableQuery + "\n2. " + "SELECT * FROM ( " + sInnerCommand + " ) AS \"" + INNERPRODUCTSQUERY + "\"", + assertTrue("simple query containing a sub query improperly parsed to SDBC level statement: \n1. " + sExecutableQuery + "\n2. " + "SELECT * FROM ( " + sInnerCommand + " ) AS \"" + INNERPRODUCTSQUERY + "\"", sExecutableQuery.equals("SELECT * FROM ( " + sInnerCommand + " ) AS \"" + INNERPRODUCTSQUERY + "\"")); } /** tests the XParametersSupplier functionality */ + @Test public void testParameters() { try @@ -241,8 +240,7 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase m_database.getDatabase().getDataSource().createQuery("orders for customer and product", "SELECT * FROM \"orders for customer\" WHERE \"Product Name\" LIKE ?"); m_composer.setQuery(m_database.getDatabase().getDataSource().getQueryDefinition("orders for customer and product").getCommand()); - final XParametersSupplier suppParams = (XParametersSupplier) UnoRuntime.queryInterface( - XParametersSupplier.class, m_composer); + final XParametersSupplier suppParams = UnoRuntime.queryInterface(XParametersSupplier.class, m_composer); final XIndexAccess parameters = suppParams.getParameters(); final String expectedParamNames[] = @@ -252,25 +250,25 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase }; final int paramCount = parameters.getCount(); - assure("composer did find wrong number of parameters in the nested queries.", + assertTrue("composer did find wrong number of parameters in the nested queries.", paramCount == expectedParamNames.length); for (int i = 0; i < paramCount; ++i) { - final XPropertySet parameter = (XPropertySet) UnoRuntime.queryInterface( - XPropertySet.class, parameters.getByIndex(i)); + final XPropertySet parameter = UnoRuntime.queryInterface(XPropertySet.class, parameters.getByIndex(i)); final String paramName = (String) parameter.getPropertyValue("Name"); - assure("wrong parameter name at position " + (i + 1) + " (expected: " + expectedParamNames[i] + ", found: " + paramName + ")", + assertTrue("wrong parameter name at position " + (i + 1) + " (expected: " + expectedParamNames[i] + ", found: " + paramName + ")", paramName.equals(expectedParamNames[i])); } } catch (Exception e) { - assure("caught an exception: " + e, false); + fail("caught an exception: " + e); } } + @Test public void testConditionByColumn() { try @@ -282,23 +280,22 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase new NamedValue("AutomaticAddition", Boolean.valueOf(true)) }; final String serviceName = "com.sun.star.beans.PropertyBag"; - final XPropertyContainer filter = (XPropertyContainer) UnoRuntime.queryInterface(XPropertyContainer.class, - getORB().createInstanceWithArguments(serviceName, initArgs)); + final XPropertyContainer filter = UnoRuntime.queryInterface(XPropertyContainer.class, getMSF().createInstanceWithArguments(serviceName, initArgs)); filter.addProperty("Name", PropertyAttribute.MAYBEVOID, "Comment"); filter.addProperty("RealName", PropertyAttribute.MAYBEVOID, "Comment"); filter.addProperty("TableName", PropertyAttribute.MAYBEVOID, "customers"); filter.addProperty("Value", PropertyAttribute.MAYBEVOID, "Good one."); filter.addProperty("Type", PropertyAttribute.MAYBEVOID, Integer.valueOf(DataType.LONGVARCHAR)); - final XPropertySet column = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,filter); + final XPropertySet column = UnoRuntime.queryInterface(XPropertySet.class, filter); m_composer.appendFilterByColumn(column, true,SQLFilterOperator.LIKE); - assure("At least one row should exist",m_database.getConnection().createStatement().executeQuery(m_composer.getQuery()).next()); + assertTrue("At least one row should exist",m_database.getConnection().createStatement().executeQuery(m_composer.getQuery()).next()); } catch (Exception e) { // this is an error: the query is expected to be parseable - assure("caught an exception: " + e, false); + fail("caught an exception: " + e); } } @@ -311,18 +308,18 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase catch (Exception e) { // this is an error: the query is expected to be parseable - assure("caught an exception: " + e, false); + fail("caught an exception: " + e); } final PropertyValue[][] disjunctiveNormalForm = m_composer.getStructuredFilter(); - assureEquals("DNF: wrong number of rows", _expectedDNF.length, disjunctiveNormalForm.length); + assertEquals("DNF: wrong number of rows", _expectedDNF.length, disjunctiveNormalForm.length); for (int i = 0; i < _expectedDNF.length; ++i) { - assureEquals("DNF: wrong number of columns in row " + i, _expectedDNF[i].length, disjunctiveNormalForm[i].length); + assertEquals("DNF: wrong number of columns in row " + i, _expectedDNF[i].length, disjunctiveNormalForm[i].length); for (int j = 0; j < _expectedDNF[i].length; ++j) { - assureEquals("DNF: wrong content in column " + j + ", row " + i, + assertEquals("DNF: wrong content in column " + j + ", row " + i, _expectedDNF[i][j].Name, disjunctiveNormalForm[i][j].Name); } } @@ -331,6 +328,7 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase /** tests the disjunctive normal form functionality, aka the structured filter, * of the composer */ + @Test public void testDisjunctiveNormalForm() { // a simple case: WHERE clause simply is a combination of predicates knitted with AND diff --git a/dbaccess/qa/complex/dbaccess/TestCase.java b/dbaccess/qa/complex/dbaccess/TestCase.java index c66efeb0a..d60bc272e 100644 --- a/dbaccess/qa/complex/dbaccess/TestCase.java +++ b/dbaccess/qa/complex/dbaccess/TestCase.java @@ -26,12 +26,14 @@ ************************************************************************/ package complex.dbaccess; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertySet; import com.sun.star.frame.XComponentLoader; import com.sun.star.frame.XModel; import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.Exception; +// import com.sun.star.uno.Exception; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import helper.FileTools; @@ -40,27 +42,29 @@ import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; -public abstract class TestCase extends complexlib.ComplexTestCase -{ - // -------------------------------------------------------------------------------------------------------- - protected final XMultiServiceFactory getORB() - { - return (XMultiServiceFactory)param.getMSF(); - } +// ---------- junit imports ----------------- +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; +// ------------------------------------------ + +public abstract class TestCase +{ // -------------------------------------------------------------------------------------------------------- protected final XComponentContext getComponentContext() { XComponentContext context = null; try { - final XPropertySet orbProps = UnoRuntime.queryInterface( XPropertySet.class, getORB() ); + final XPropertySet orbProps = UnoRuntime.queryInterface( XPropertySet.class, getMSF() ); context = UnoRuntime.queryInterface( XComponentContext.class, orbProps.getPropertyValue( "DefaultContext" ) ); } catch ( Exception ex ) { - failed( "could not retrieve the ComponentContext" ); + fail( "could not retrieve the ComponentContext" ); } return context; } @@ -83,9 +87,11 @@ public abstract class TestCase extends complexlib.ComplexTestCase */ protected final String createTempFileURL() throws IOException { - final File documentFile = java.io.File.createTempFile( getTestObjectName(), ".odb" ).getAbsoluteFile(); + final File documentFile = java.io.File.createTempFile( "dbaccess_test", ".odb" ).getAbsoluteFile(); if ( documentFile.exists() ) + { documentFile.delete(); + } return FileHelper.getOOoCompatibleFileURL( documentFile.toURI().toURL().toString() ); } @@ -111,16 +117,138 @@ public abstract class TestCase extends complexlib.ComplexTestCase protected final XModel loadDocument( final String _docURL ) throws Exception { final XComponentLoader loader = UnoRuntime.queryInterface( XComponentLoader.class, - getORB().createInstance( "com.sun.star.frame.Desktop" ) ); + getMSF().createInstance( "com.sun.star.frame.Desktop" ) ); return UnoRuntime.queryInterface( XModel.class, loader.loadComponentFromURL( _docURL, "_blank", 0, new PropertyValue[] {} ) ); } // -------------------------------------------------------------------------------------------------------- + /** invokes a given method on a given object, and assures a certain exception is caught + * @param _message + * is the message to print when the check fails + * @param _object + * is the object to invoke the method on + * @param _methodName + * is the name of the method to invoke + * @param _methodArgs + * are the arguments to pass to the method. + * @param _argClasses + * are the classes to assume for the arguments of the methods + * @param _expectedExceptionClass + * is the class of the exception to be caught. If this is null, + * it means that <em>no</em> exception must be throw by invoking the method. + */ + protected void assureException( final String _message, final Object _object, final String _methodName, + final Class[] _argClasses, final Object[] _methodArgs, final Class _expectedExceptionClass ) + { + Class objectClass = _object.getClass(); + + boolean noExceptionAllowed = ( _expectedExceptionClass == null ); + + boolean caughtExpected = noExceptionAllowed ? true : false; + try + { + Method method = objectClass.getMethod( _methodName, _argClasses ); + method.invoke(_object, _methodArgs ); + } + catch ( InvocationTargetException e ) + { + caughtExpected = noExceptionAllowed + ? false + : ( e.getTargetException().getClass().equals( _expectedExceptionClass ) ); + } + catch( Exception e ) + { + caughtExpected = false; + } + + assertTrue( _message, caughtExpected ); + } + + /** invokes a given method on a given object, and assures a certain exception is caught + * @param _message is the message to print when the check fails + * @param _object is the object to invoke the method on + * @param _methodName is the name of the method to invoke + * @param _methodArgs are the arguments to pass to the method. Those implicitly define + * the classes of the arguments of the method which is called. + * @param _expectedExceptionClass is the class of the exception to be caught. If this is null, + * it means that <em>no</em> exception must be throw by invoking the method. + */ + protected void assureException( final String _message, final Object _object, final String _methodName, + final Object[] _methodArgs, final Class _expectedExceptionClass ) + { + Class[] argClasses = new Class[ _methodArgs.length ]; + for ( int i=0; i<_methodArgs.length; ++i ) + argClasses[i] = _methodArgs[i].getClass(); + assureException( _message, _object, _methodName, argClasses, _methodArgs, _expectedExceptionClass ); + } + + /** invokes a given method on a given object, and assures a certain exception is caught + * @param _object is the object to invoke the method on + * @param _methodName is the name of the method to invoke + * @param _methodArgs are the arguments to pass to the method. Those implicitly define + * the classes of the arguments of the method which is called. + * @param _expectedExceptionClass is the class of the exception to be caught. If this is null, + * it means that <em>no</em> exception must be throw by invoking the method. + */ + protected void assureException( final Object _object, final String _methodName, final Object[] _methodArgs, + final Class _expectedExceptionClass ) + { + assureException( + "did not catch the expected exception (" + + ( ( _expectedExceptionClass == null ) ? "none" : _expectedExceptionClass.getName() ) + + ") while calling " + _object.getClass().getName() + "." + _methodName, + _object, _methodName, _methodArgs, _expectedExceptionClass ); + } + + /** invokes a given method on a given object, and assures a certain exception is caught + * @param _object is the object to invoke the method on + * @param _methodName is the name of the method to invoke + * @param _methodArgs are the arguments to pass to the method + * @param _argClasses are the classes to assume for the arguments of the methods + * @param _expectedExceptionClass is the class of the exception to be caught. If this is null, + * it means that <em>no</em> exception must be throw by invoking the method. + */ + protected void assureException( final Object _object, final String _methodName, final Class[] _argClasses, + final Object[] _methodArgs, final Class _expectedExceptionClass ) + { + assureException( + "did not catch the expected exception (" + + ( ( _expectedExceptionClass == null ) ? "none" : _expectedExceptionClass.getName() ) + + ") while calling " + _object.getClass().getName() + "." + _methodName, + _object, _methodName, _argClasses, _methodArgs, _expectedExceptionClass ); + } + + // -------------------------------------------------------------------------------------------------------- protected void assureException( Object _object, Class _unoInterfaceClass, String _methodName, Object[] _methodArgs, Class _expectedExceptionClass ) { assureException( UnoRuntime.queryInterface( _unoInterfaceClass, _object ), _methodName, _methodArgs, _expectedExceptionClass ); } + + // -------------------------------------------------------------------------------------------------------- + protected XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // -------------------------------------------------------------------------------------------------------- + // setup and close connections + @BeforeClass + public static void setUpConnection() throws Exception + { + connection.setUp(); + } + + // -------------------------------------------------------------------------------------------------------- + @AfterClass + public static void tearDownConnection() throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + } diff --git a/dbaccess/qa/complex/dbaccess/UISettings.java b/dbaccess/qa/complex/dbaccess/UISettings.java index 6ae8fa5f0..ee0f8b541 100644 --- a/dbaccess/qa/complex/dbaccess/UISettings.java +++ b/dbaccess/qa/complex/dbaccess/UISettings.java @@ -32,37 +32,26 @@ import com.sun.star.beans.XPropertySet; import com.sun.star.container.XNameAccess; import com.sun.star.form.runtime.XFormController; import com.sun.star.frame.XController; -import com.sun.star.frame.XModel; import com.sun.star.sdb.application.DatabaseObject; -import com.sun.star.sdb.application.XDatabaseDocumentUI; import com.sun.star.uno.UnoRuntime; import com.sun.star.util.XCloseable; import connectivity.tools.CRMDatabase; +// ---------- junit imports ----------------- +import org.junit.Test; +import static org.junit.Assert.*; +// ------------------------------------------ + public class UISettings extends TestCase { // -------------------------------------------------------------------------------------------------------- - public String[] getTestMethodNames() - { - return new String[] { - "checkTableFormattingPersistence", - "checkTransparentQueryColumnSettings" - }; - } - - // -------------------------------------------------------------------------------------------------------- - public String getTestObjectName() - { - return "UISettings"; - } - - // -------------------------------------------------------------------------------------------------------- /** verifies that aliases for inner queries work as expected */ + @Test public void checkTableFormattingPersistence() throws java.lang.Exception { // create, load, and connect a DB doc - CRMDatabase database = new CRMDatabase( getORB(), true ); + CRMDatabase database = new CRMDatabase( getMSF(), true ); // display a table XFormController tableViewController = UnoRuntime.queryInterface( XFormController.class, @@ -89,7 +78,7 @@ public class UISettings extends TestCase // stay alive, and subsequent requests to load the doc will just reuse it, without really loading it. docURL = copyToTempFile( docURL ); loadDocument( docURL ); - database = new CRMDatabase( getORB(), docURL ); + database = new CRMDatabase( getMSF(), docURL ); // display the table, again tableViewController = UnoRuntime.queryInterface( XFormController.class, @@ -98,9 +87,9 @@ public class UISettings extends TestCase tableViewController.getCurrentControl().getModel() ); // verify the properties - assureEquals( "wrong font name", "Andale Sans UI", (String)tableControlModel.getPropertyValue( "FontName" ) ); - assureEquals( "wrong font height", (float)20, ((Float)tableControlModel.getPropertyValue( "FontHeight" )).floatValue() ); - assureEquals( "wrong font slant", FontSlant.ITALIC, (FontSlant)tableControlModel.getPropertyValue( "FontSlant" ) ); + assertEquals( "wrong font name", "Andale Sans UI", (String)tableControlModel.getPropertyValue( "FontName" ) ); + assertEquals( "wrong font height", (float)20, ((Float)tableControlModel.getPropertyValue( "FontHeight" )).floatValue(), 0 ); + assertEquals( "wrong font slant", FontSlant.ITALIC, (FontSlant)tableControlModel.getPropertyValue( "FontSlant" ) ); // close the doc database.saveAndClose(); @@ -111,10 +100,11 @@ public class UISettings extends TestCase * settings * @throws java.lang.Exception */ + @Test public void checkTransparentQueryColumnSettings() throws java.lang.Exception { // create, load, and connect a DB doc - CRMDatabase database = new CRMDatabase( getORB(), true ); + CRMDatabase database = new CRMDatabase( getMSF(), true ); // display a table XController tableView = database.loadSubComponent( DatabaseObject.TABLE, "customers" ); @@ -125,7 +115,7 @@ public class UISettings extends TestCase // change the formatting of a table column XPropertySet idColumn = UnoRuntime.queryInterface( XPropertySet.class, tableControlModel.getByName( "ID" ) ); - assure( "precondition not met: column already centered", + assertTrue( "precondition not met: column already centered", ((Short)idColumn.getPropertyValue( "Align" )).shortValue() != TextAlign.CENTER ); idColumn.setPropertyValue( "Align", TextAlign.CENTER ); @@ -143,7 +133,7 @@ public class UISettings extends TestCase queryViewController.getCurrentControl().getModel() ); idColumn = UnoRuntime.queryInterface( XPropertySet.class, tableControlModel.getByName( "ID" ) ); - assure( "table column alignment was not propagated to the query column", + assertTrue( "table column alignment was not propagated to the query column", ((Short)idColumn.getPropertyValue( "Align" )).shortValue() == TextAlign.CENTER ); // save close the database document diff --git a/dbaccess/qa/complex/dbaccess/dbaccess.sce b/dbaccess/qa/complex/dbaccess/dbaccess.sce deleted file mode 100644 index c5fa408ff..000000000 --- a/dbaccess/qa/complex/dbaccess/dbaccess.sce +++ /dev/null @@ -1,12 +0,0 @@ --o complex.dbaccess.SingleSelectQueryComposer --o complex.dbaccess.RowSet --o complex.dbaccess.PropertyBag --o complex.dbaccess.Query --o complex.dbaccess.QueryInQuery --o complex.dbaccess.DatabaseDocument --o complex.dbaccess.DataSource --o complex.dbaccess.Parser --o complex.dbaccess.ApplicationController --o complex.dbaccess.CopyTableWizard --o complex.dbaccess.UISettings --o complex.dbaccess.Beamer diff --git a/dbaccess/qa/complex/dbaccess/makefile.mk b/dbaccess/qa/complex/dbaccess/makefile.mk index 56a24c029..760f94a29 100755 --- a/dbaccess/qa/complex/dbaccess/makefile.mk +++ b/dbaccess/qa/complex/dbaccess/makefile.mk @@ -25,54 +25,78 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = DbaComplexTests -PRJNAME = $(TARGET) -PACKAGE = complex$/dbaccess +.IF "$(OOO_JUNIT_JAR)" == "" +nothing .PHONY: + @echo ----------------------------------------------------- + @echo - JUnit not available, not building anything + @echo ----------------------------------------------------- +.ELSE + +PRJ = ../../.. +PRJNAME = dbaccess +TARGET = qa_complex_dbaccess +PACKAGE = complex/dbaccess # --- Settings ----------------------------------------------------- .INCLUDE: settings.mk -.IF "$(SOLAR_JAVA)" == "" -all: - @echo "Java not available. Build skipped" - -.INCLUDE : target.mk -.ELSE - #----- compile .java files ----------------------------------------- -JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar ConnectivityTools.jar -JAVAFILES := $(shell @$(FIND) ./*.java) -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -#----- make a jar from compiled files ------------------------------ +JARFILES = OOoRunner.jar ridl.jar test.jar juh.jar unoil.jar ConnectivityTools.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -MAXLINELENGTH = 100000 +#----- create a jar from compiled files ---------------------------- -JARCLASSDIRS = $(PACKAGE) JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE -RUNNER_ARGS = -cp "$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar" org.openoffice.Runner -TestBase java_complex - -RUNNER_CALL = $(AUGMENT_LIBRARY_PATH) java +#----- Java files -------------------------------------------------- + +# here store only Files which contain a @Test +JAVATESTFILES = \ + ApplicationController.java \ + Beamer.java \ + DataSource.java \ + DatabaseDocument.java \ + Parser.java \ + PropertyBag.java \ + Query.java \ + QueryInQuery.java \ + RowSet.java \ + SingleSelectQueryComposer.java \ + UISettings.java \ + CopyTableWizard.java \ + +# put here all other files +JAVAFILES = $(JAVATESTFILES) \ + CRMBasedTestCase.java \ + CopyTableInterActionHandler.java \ + DatabaseApplication.java \ + FileHelper.java \ + RowSetEventListener.java \ + TestCase.java \ + + +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y # --- Targets ------------------------------------------------------ -.IF "$(depend)" == "" +.INCLUDE: target.mk + ALL : ALLTAR -.ELSE -ALL: ALLDEP -.ENDIF -.INCLUDE : target.mk +# --- subsequent tests --------------------------------------------- + +.IF "$(OOO_SUBSEQUENT_TESTS)" != "" + +.INCLUDE: installationtest.mk + +ALLTAR : javatest + # Sample how to debug + # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -run: $(CLASSDIR)$/$(JARTARGET) - +$(RUNNER_CALL) $(RUNNER_ARGS) -sce dbaccess.sce +.END # "$(OOO_SUBSEQUENT_TESTS)" == "" -run_%: $(CLASSDIR)$/$(JARTARGET) - +$(RUNNER_CALL) $(RUNNER_ARGS) -o complex.dbaccess.$(@:s/run_//) +.END # ELSE "$(OOO_JUNIT_JAR)" != "" -.ENDIF # "$(SOLAR_JAVA)" == "" diff --git a/dbaccess/source/core/api/BookmarkSet.hxx b/dbaccess/source/core/api/BookmarkSet.hxx index 7e9a199d6..1b7b8052c 100644 --- a/dbaccess/source/core/api/BookmarkSet.hxx +++ b/dbaccess/source/core/api/BookmarkSet.hxx @@ -41,7 +41,7 @@ namespace dbaccess void updateColumn(sal_Int32 nPos,::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowUpdate > _xParameter,const connectivity::ORowSetValue& _rValue); public: - OBookmarkSet() + OBookmarkSet(sal_Int32 i_nMaxRows) : OCacheSet(i_nMaxRows) {} ~OBookmarkSet() { diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx index 6521f944c..b4c348c81 100644 --- a/dbaccess/source/core/api/CacheSet.cxx +++ b/dbaccess/source/core/api/CacheSet.cxx @@ -69,8 +69,9 @@ using namespace ::osl; DBG_NAME(OCacheSet) -OCacheSet::OCacheSet() - :m_bInserted(sal_False) +OCacheSet::OCacheSet(sal_Int32 i_nMaxRows) + :m_nMaxRows(i_nMaxRows) + ,m_bInserted(sal_False) ,m_bUpdated(sal_False) ,m_bDeleted(sal_False) { diff --git a/dbaccess/source/core/api/CacheSet.hxx b/dbaccess/source/core/api/CacheSet.hxx index 078bdb837..5e2138aa6 100644 --- a/dbaccess/source/core/api/CacheSet.hxx +++ b/dbaccess/source/core/api/CacheSet.hxx @@ -62,11 +62,12 @@ namespace dbaccess ::com::sun::star::uno::Sequence<sal_Int32> m_aColumnTypes; ORowSetRow m_aInsertRow; ::rtl::OUString m_aComposedTableName; + sal_Int32 m_nMaxRows; sal_Bool m_bInserted; sal_Bool m_bUpdated; sal_Bool m_bDeleted; - OCacheSet(); + OCacheSet(sal_Int32 i_nMaxRows); virtual ~OCacheSet(); void setParameter(sal_Int32 nPos diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 966ec2280..67613820e 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -104,8 +104,10 @@ OKeySet::OKeySet(const connectivity::OSQLTable& _xTable, const Reference< XIndexAccess>& _xTableKeys, const ::rtl::OUString& _rUpdateTableName, // this can be the alias or the full qualified name const Reference< XSingleSelectQueryAnalyzer >& _xComposer, - const ORowSetValueVector& _aParameterValueForCache) - :m_aParameterValueForCache(_aParameterValueForCache) + const ORowSetValueVector& _aParameterValueForCache, + sal_Int32 i_nMaxRows) + :OCacheSet(i_nMaxRows) + ,m_aParameterValueForCache(_aParameterValueForCache) ,m_pKeyColumnNames(NULL) ,m_pColumnNames(NULL) ,m_pParameterNames(NULL) @@ -142,7 +144,7 @@ OKeySet::~OKeySet() void OKeySet::initColumns() { Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); - bool bCase = (xMeta.is() && xMeta->storesMixedCaseQuotedIdentifiers()) ? true : false; + bool bCase = (xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers()) ? true : false; m_pKeyColumnNames.reset( new SelectColumnsMetaData(bCase) ); m_pColumnNames.reset( new SelectColumnsMetaData(bCase) ); m_pParameterNames.reset( new SelectColumnsMetaData(bCase) ); @@ -929,8 +931,8 @@ void OKeySet::copyRowValue(const ORowSetRow& _rInsertRow,ORowSetRow& _rKeyRow,sa SelectColumnsMetaData::const_iterator aPosEnd = (*m_pKeyColumnNames).end(); for(;aPosIter != aPosEnd;++aPosIter,++aIter) { - *aIter = (_rInsertRow->get())[aPosIter->second.nPosition]; - impl_convertValue_throw(_rKeyRow,aPosIter->second); + impl_convertValue_throw(_rInsertRow,aPosIter->second); + *aIter = (_rInsertRow->get())[aPosIter->second.nPosition]; aIter->setTypeKind(aPosIter->second.nType); } } @@ -1327,7 +1329,7 @@ sal_Bool OKeySet::fetchRow() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::fetchRow" ); // fetch the next row and append on the keyset sal_Bool bRet = sal_False; - if ( !m_bRowCountFinal ) + if ( !m_bRowCountFinal && (!m_nMaxRows || sal_Int32(m_aKeyMap.size()) < m_nMaxRows) ) bRet = m_xDriverSet->next(); if ( bRet ) { diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx index a439fb22e..826ec1ab7 100644 --- a/dbaccess/source/core/api/KeySet.hxx +++ b/dbaccess/source/core/api/KeySet.hxx @@ -150,7 +150,8 @@ namespace dbaccess const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& _xTableKeys, const ::rtl::OUString& _rUpdateTableName, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer >& _xComposer, - const ORowSetValueVector& _aParameterValueForCache); + const ORowSetValueVector& _aParameterValueForCache, + sal_Int32 i_nMaxRows); // late ctor which can throw exceptions virtual void construct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter); diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx index d007cdd77..38dba0ece 100644 --- a/dbaccess/source/core/api/OptimisticSet.cxx +++ b/dbaccess/source/core/api/OptimisticSet.cxx @@ -101,8 +101,9 @@ DBG_NAME(OptimisticSet) OptimisticSet::OptimisticSet(const ::comphelper::ComponentContext& _rContext, const Reference< XConnection>& i_xConnection, const Reference< XSingleSelectQueryAnalyzer >& _xComposer, - const ORowSetValueVector& _aParameterValueForCache) - :OKeySet(NULL,NULL,::rtl::OUString(),_xComposer,_aParameterValueForCache) + const ORowSetValueVector& _aParameterValueForCache, + sal_Int32 i_nMaxRows) + :OKeySet(NULL,NULL,::rtl::OUString(),_xComposer,_aParameterValueForCache,i_nMaxRows) ,m_aSqlParser( _rContext.getLegacyServiceFactory() ) ,m_aSqlIterator( i_xConnection, Reference<XTablesSupplier>(_xComposer,UNO_QUERY)->getTables(), m_aSqlParser, NULL ) ,m_bResultSetChanged(false) @@ -123,7 +124,7 @@ void OptimisticSet::construct(const Reference< XResultSet>& _xDriverSet,const :: initColumns(); Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); - bool bCase = (xMeta.is() && xMeta->storesMixedCaseQuotedIdentifiers()) ? true : false; + bool bCase = (xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers()) ? true : false; Reference<XColumnsSupplier> xQueryColSup(m_xComposer,UNO_QUERY); const Reference<XNameAccess> xQueryColumns = xQueryColSup->getColumns(); const Reference<XTablesSupplier> xTabSup(m_xComposer,UNO_QUERY); diff --git a/dbaccess/source/core/api/OptimisticSet.hxx b/dbaccess/source/core/api/OptimisticSet.hxx index 309a348ac..bcada376a 100644 --- a/dbaccess/source/core/api/OptimisticSet.hxx +++ b/dbaccess/source/core/api/OptimisticSet.hxx @@ -76,7 +76,8 @@ namespace dbaccess OptimisticSet(const ::comphelper::ComponentContext& _rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& i_xConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer >& _xComposer, - const ORowSetValueVector& _aParameterValueForCache); + const ORowSetValueVector& _aParameterValueForCache, + sal_Int32 i_nMaxRows); // late ctor which can throw exceptions virtual void construct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter); diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index e36a9956c..f9a7fbdb0 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -348,7 +348,7 @@ void SAL_CALL ORowSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const case PROPERTY_ID_FETCHSIZE: if(m_pCache) { - m_pCache->setMaxRowSize(m_nFetchSize); + m_pCache->setFetchSize(m_nFetchSize); fireRowcount(); } break; @@ -1067,7 +1067,7 @@ void ORowSet::implCancelRowUpdates( sal_Bool _bNotifyModified ) SAL_THROW( ( SQL positionCache( MOVE_NONE_REFRESH_ONLY ); ORowSetRow aOldValues; - if ( !m_aCurrentRow.isNull() ) + if ( !m_bModified && _bNotifyModified && !m_aCurrentRow.isNull() ) aOldValues = new ORowSetValueVector( *(*m_aCurrentRow) ); m_pCache->cancelRowUpdates(); @@ -1077,11 +1077,13 @@ void ORowSet::implCancelRowUpdates( sal_Bool _bNotifyModified ) SAL_THROW( ( SQL m_aCurrentRow.setBookmark(m_aBookmark); // notification order - // - column values - ORowSetBase::firePropertyChange(aOldValues); // IsModified if( !m_bModified && _bNotifyModified ) + { + // - column values + ORowSetBase::firePropertyChange(aOldValues); fireProperty(PROPERTY_ID_ISMODIFIED,sal_False,sal_True); + } } void SAL_CALL ORowSet::cancelRowUpdates( ) throw(SQLException, RuntimeException) @@ -1643,6 +1645,8 @@ Reference< XResultSet > ORowSet::impl_prepareAndExecute_throw() try { xStatementProps->setPropertyValue( PROPERTY_USEBOOKMARKS, makeAny( sal_True ) ); + xStatementProps->setPropertyValue( PROPERTY_MAXROWS, makeAny( m_nMaxRows ) ); + setStatementResultSetType( xStatementProps, m_nResultSetType, m_nResultSetConcurrency ); } catch ( const Exception& ) @@ -1797,13 +1801,13 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "frank.schoenheit@sun.com", "ORowSet::execute_NoApprove_NoNewConn: creating cache" ); - m_pCache = new ORowSetCache( xResultSet, m_xComposer.get(), m_aContext, aComposedUpdateTableName, m_bModified, m_bNew,m_aParameterValueForCache,m_aFilter ); + m_pCache = new ORowSetCache( xResultSet, m_xComposer.get(), m_aContext, aComposedUpdateTableName, m_bModified, m_bNew,m_aParameterValueForCache,m_aFilter,m_nMaxRows ); if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY ) { m_nPrivileges = Privilege::SELECT; m_pCache->m_nPrivileges = Privilege::SELECT; } - m_pCache->setMaxRowSize(m_nFetchSize); + m_pCache->setFetchSize(m_nFetchSize); m_aCurrentRow = m_pCache->createIterator(this); m_aOldRow = m_pCache->registerOldRow(); } @@ -2213,7 +2217,7 @@ Reference< XNameAccess > ORowSet::impl_getTables_throw() try { Reference<XDatabaseMetaData> xMeta = m_xActiveConnection->getMetaData(); - bCase = xMeta.is() && xMeta->storesMixedCaseQuotedIdentifiers(); + bCase = xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers(); } catch(SQLException&) { @@ -2700,9 +2704,9 @@ void SAL_CALL ORowSet::refreshRow( ) throw(SQLException, RuntimeException) // notification order: if ( m_bModified && m_pCache ) - // - column values implCancelRowUpdates( sal_False ); // do _not_ notify the IsModify - will do this ourself below + // - column values ORowSetBase::refreshRow(); // - IsModified diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx index 5cea24600..d3cc99edd 100644 --- a/dbaccess/source/core/api/RowSetBase.cxx +++ b/dbaccess/source/core/api/RowSetBase.cxx @@ -1190,8 +1190,11 @@ void SAL_CALL ORowSetBase::refreshRow( ) throw(SQLException, RuntimeException) if(!(m_bBeforeFirst || m_bAfterLast)) { + sal_Bool bWasNew = m_pCache->m_bNew || impl_rowDeleted(); + ORowSetRow aOldValues = getOldRow(bWasNew); positionCache( MOVE_NONE_REFRESH_ONLY ); m_pCache->refreshRow(); + firePropertyChange(aOldValues); } } diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index a7b6460c6..9bc32680d 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -90,7 +90,8 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, sal_Bool& _bModified, sal_Bool& _bNew, const ORowSetValueVector& _aParameterValueForCache, - const ::rtl::OUString& i_sRowSetFilter) + const ::rtl::OUString& i_sRowSetFilter, + sal_Int32 i_nMaxRows) :m_xSet(_xRs) ,m_xMetaData(Reference< XResultSetMetaDataSupplier >(_xRs,UNO_QUERY)->getMetaData()) ,m_aContext( _rContext ) @@ -127,7 +128,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, xUp->cancelRowUpdates(); _xRs->beforeFirst(); m_nPrivileges = Privilege::SELECT|Privilege::DELETE|Privilege::INSERT|Privilege::UPDATE; - m_pCacheSet = new WrappedResultSet(); + m_pCacheSet = new WrappedResultSet(i_nMaxRows); m_xCacheSet = m_pCacheSet; m_pCacheSet->construct(_xRs,i_sRowSetFilter); return; @@ -174,7 +175,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, if ( aTableNames.getLength() > 1 && !_rUpdateTableName.getLength() && bNeedKeySet ) {// here we have a join or union and nobody told us which table to update, so we update them all m_nPrivileges = Privilege::SELECT|Privilege::DELETE|Privilege::INSERT|Privilege::UPDATE; - OptimisticSet* pCursor = new OptimisticSet(m_aContext,xConnection,_xAnalyzer,_aParameterValueForCache); + OptimisticSet* pCursor = new OptimisticSet(m_aContext,xConnection,_xAnalyzer,_aParameterValueForCache,i_nMaxRows); m_pCacheSet = pCursor; m_xCacheSet = m_pCacheSet; try @@ -235,7 +236,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, { try { - m_pCacheSet = new OBookmarkSet(); + m_pCacheSet = new OBookmarkSet(i_nMaxRows); m_xCacheSet = m_pCacheSet; m_pCacheSet->construct(_xRs,i_sRowSetFilter); @@ -266,7 +267,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, if(!bAllKeysFound ) { - m_pCacheSet = new OStaticSet(); + m_pCacheSet = new OStaticSet(i_nMaxRows); m_xCacheSet = m_pCacheSet; m_pCacheSet->construct(_xRs,i_sRowSetFilter); m_nPrivileges = Privilege::SELECT; @@ -303,7 +304,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, } } - OKeySet* pKeySet = new OKeySet(m_aUpdateTable,xUpdateTableKeys,aUpdateTableName ,_xAnalyzer,_aParameterValueForCache); + OKeySet* pKeySet = new OKeySet(m_aUpdateTable,xUpdateTableKeys,aUpdateTableName ,_xAnalyzer,_aParameterValueForCache,i_nMaxRows); try { m_pCacheSet = pKeySet; @@ -330,7 +331,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, if ( m_pCacheSet ) m_pCacheSet = NULL; m_xCacheSet = NULL; - m_pCacheSet = new OStaticSet(); + m_pCacheSet = new OStaticSet(i_nMaxRows); m_xCacheSet = m_pCacheSet; m_pCacheSet->construct(_xRs,i_sRowSetFilter); m_nPrivileges = Privilege::SELECT; @@ -366,7 +367,7 @@ ORowSetCache::~ORowSetCache() DBG_DTOR(ORowSetCache,NULL); } -void ORowSetCache::setMaxRowSize(sal_Int32 _nSize) +void ORowSetCache::setFetchSize(sal_Int32 _nSize) { if(_nSize == m_nFetchSize) return; diff --git a/dbaccess/source/core/api/RowSetCache.hxx b/dbaccess/source/core/api/RowSetCache.hxx index f7ae7fc30..0ce22af54 100644 --- a/dbaccess/source/core/api/RowSetCache.hxx +++ b/dbaccess/source/core/api/RowSetCache.hxx @@ -154,7 +154,8 @@ namespace dbaccess sal_Bool& _bModified, sal_Bool& _bNew, const ORowSetValueVector& _aParameterValueForCache, - const ::rtl::OUString& i_sRowSetFilter); + const ::rtl::OUString& i_sRowSetFilter, + sal_Int32 i_nMaxRows); ~ORowSetCache(); @@ -163,7 +164,7 @@ namespace dbaccess ORowSetCacheIterator createIterator(ORowSetBase* _pRowSet); void deleteIterator(const ORowSetBase* _pRowSet); // sets the size of the matrix - void setMaxRowSize(sal_Int32 _nSize); + void setFetchSize(sal_Int32 _nSize); TORowSetOldRowHelperRef registerOldRow(); void deregisterOldRow(const TORowSetOldRowHelperRef& _rRow); diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index cba433d3f..93393198a 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -1061,7 +1061,7 @@ sal_Bool OSingleSelectQueryComposer::setANDCriteria( OSQLParseNode * pCondition, } else if (SQL_ISRULE(pCondition,test_for_null)) { - if (SQL_ISTOKEN(pCondition->getChild(1)->getChild(2),NOT) ) + if (SQL_ISTOKEN(pCondition->getChild(1)->getChild(1),NOT) ) aItem.Handle = SQLFilterOperator::NOT_SQLNULL; else aItem.Handle = SQLFilterOperator::SQLNULL; diff --git a/dbaccess/source/core/api/StaticSet.cxx b/dbaccess/source/core/api/StaticSet.cxx index e5037a69d..6668db8f5 100644 --- a/dbaccess/source/core/api/StaticSet.cxx +++ b/dbaccess/source/core/api/StaticSet.cxx @@ -102,7 +102,7 @@ sal_Bool OStaticSet::fetchRow() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::fetchRow" ); sal_Bool bRet = sal_False; - if ( !m_bEnd ) + if ( !m_bEnd && (!m_nMaxRows || sal_Int32(m_aSet.size()) < m_nMaxRows) ) bRet = m_xDriverSet->next(); if ( bRet ) { @@ -121,9 +121,10 @@ void OStaticSet::fillAllRows() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::fillAllRows" ); if(!m_bEnd) { + sal_Int32 nColumnCount = m_xSetMetaData->getColumnCount(); while(m_xDriverSet->next()) { - ORowSetRow pRow = new connectivity::ORowVector< connectivity::ORowSetValue >(m_xSetMetaData->getColumnCount()); + ORowSetRow pRow = new connectivity::ORowVector< connectivity::ORowSetValue >(nColumnCount); m_aSet.push_back(pRow); m_aSetIter = m_aSet.end() - 1; (pRow->get())[0] = getRow(); diff --git a/dbaccess/source/core/api/StaticSet.hxx b/dbaccess/source/core/api/StaticSet.hxx index 8b8950159..e5cf8a092 100644 --- a/dbaccess/source/core/api/StaticSet.hxx +++ b/dbaccess/source/core/api/StaticSet.hxx @@ -43,8 +43,8 @@ namespace dbaccess sal_Bool fetchRow(); void fillAllRows(); public: - OStaticSet() - : m_aSetIter(m_aSet.end()) + OStaticSet(sal_Int32 i_nMaxRows) : OCacheSet(i_nMaxRows) + , m_aSetIter(m_aSet.end()) , m_bEnd(sal_False) { m_aSet.push_back(NULL); // this is the beforefirst record diff --git a/dbaccess/source/core/api/WrappedResultSet.hxx b/dbaccess/source/core/api/WrappedResultSet.hxx index 21f6169f7..8765a183a 100644 --- a/dbaccess/source/core/api/WrappedResultSet.hxx +++ b/dbaccess/source/core/api/WrappedResultSet.hxx @@ -44,7 +44,7 @@ namespace dbaccess void updateColumn(sal_Int32 nPos,::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowUpdate > _xParameter,const connectivity::ORowSetValue& _rValue); public: - WrappedResultSet() + WrappedResultSet(sal_Int32 i_nMaxRows) : OCacheSet(i_nMaxRows) {} ~WrappedResultSet() { diff --git a/dbaccess/source/core/api/query.cxx b/dbaccess/source/core/api/query.cxx index c7a65caa1..2f5e74eb4 100644 --- a/dbaccess/source/core/api/query.cxx +++ b/dbaccess/source/core/api/query.cxx @@ -181,7 +181,7 @@ void OQuery::rebuildColumns() ::rtl::Reference< OSQLColumns > aParseColumns( ::connectivity::parse::OParseColumn::createColumnsForResultSet( xResultSetMeta, xDBMeta,xColumnDefinitions ) ); xColumns = OPrivateColumns::createWithIntrinsicNames( - aParseColumns, xDBMeta->storesMixedCaseQuotedIdentifiers(), *this, m_aMutex ); + aParseColumns, xDBMeta->supportsMixedCaseQuotedIdentifiers(), *this, m_aMutex ); if ( !xColumns.is() ) throw RuntimeException(); } diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx index c159edb71..e6f035ded 100644 --- a/dbaccess/source/core/misc/dsntypes.cxx +++ b/dbaccess/source/core/misc/dsntypes.cxx @@ -445,7 +445,7 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(const String& _rDsn) const for ( size_t i=0; i < SAL_N_ELEMENTS( aKnowPrefixes ); ++i ) { - USHORT nMatchLen = aKnowPrefixes[i].bMatchComplete ? sDsn.Len() : (USHORT)rtl_str_getLength( aKnowPrefixes[i].pAsciiPrefix ); + sal_uInt16 nMatchLen = aKnowPrefixes[i].bMatchComplete ? sDsn.Len() : (sal_uInt16)rtl_str_getLength( aKnowPrefixes[i].pAsciiPrefix ); if ( sDsn.EqualsIgnoreCaseAscii( aKnowPrefixes[i].pAsciiPrefix, 0, nMatchLen ) ) return aKnowPrefixes[i].eType; } diff --git a/dbaccess/source/core/misc/services.cxx b/dbaccess/source/core/misc/services.cxx index d22684395..7b33c2a0a 100644 --- a/dbaccess/source/core/misc/services.cxx +++ b/dbaccess/source/core/misc/services.cxx @@ -95,28 +95,6 @@ extern "C" OOO_DLLPUBLIC_DBA void SAL_CALL component_getImplementationEnvironmen } //--------------------------------------------------------------------------------------- -extern "C" OOO_DLLPUBLIC_DBA sal_Bool SAL_CALL component_writeInfo( - void* pServiceManager, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - return ::dba::DbaModule::getInstance().writeComponentInfos( - static_cast< XMultiServiceFactory* >( pServiceManager ), - static_cast< XRegistryKey* >( pRegistryKey ) ) - && cppu::component_writeInfoHelper(pServiceManager, pRegistryKey, dba::entries); - } - catch (InvalidRegistryException& ) - { - OSL_ENSURE( false, "DBA::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !" ); - } - - return sal_False; -} - -//--------------------------------------------------------------------------------------- extern "C" OOO_DLLPUBLIC_DBA void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, diff --git a/dbaccess/source/core/resource/strings.src b/dbaccess/source/core/resource/strings.src index c431f2cd2..1a572c8a1 100644 --- a/dbaccess/source/core/resource/strings.src +++ b/dbaccess/source/core/resource/strings.src @@ -305,7 +305,7 @@ String RID_STR_ROW_ALREADY_DELETED String RID_STR_UPDATE_FAILED { - Text [ en-US ] = "Current row could be updated."; + Text [ en-US ] = "Current row could not be updated."; }; //------------------------------------------------------------------------- diff --git a/dbaccess/source/ext/adabas/Acomponentmodule.cxx b/dbaccess/source/ext/adabas/Acomponentmodule.cxx index f35aad3f7..25f52efbd 100644 --- a/dbaccess/source/ext/adabas/Acomponentmodule.cxx +++ b/dbaccess/source/ext/adabas/Acomponentmodule.cxx @@ -239,54 +239,6 @@ namespace COMPMOD_NAMESPACE } //-------------------------------------------------------------------------- - sal_Bool OModule::writeComponentInfos( - const Reference< XMultiServiceFactory >& /*_rxServiceManager*/, - const Reference< XRegistryKey >& _rxRootKey) - { - OSL_ENSURE(_rxRootKey.is(), "OModule::writeComponentInfos : invalid argument !"); - - if (!s_pImplementationNames) - { - OSL_FAIL("OModule::writeComponentInfos : have no class infos ! Are you sure called this method at the right time ?"); - return sal_True; - } - OSL_ENSURE(s_pImplementationNames && s_pSupportedServices && s_pCreationFunctionPointers && s_pFactoryFunctionPointers, - "OModule::writeComponentInfos : inconsistent state (the pointers) !"); - OSL_ENSURE( (s_pImplementationNames->getLength() == s_pSupportedServices->getLength()) - && (s_pImplementationNames->getLength() == s_pCreationFunctionPointers->getLength()) - && (s_pImplementationNames->getLength() == s_pFactoryFunctionPointers->getLength()), - "OModule::writeComponentInfos : inconsistent state !"); - - sal_Int32 nLen = s_pImplementationNames->getLength(); - const ::rtl::OUString* pImplName = s_pImplementationNames->getConstArray(); - const Sequence< ::rtl::OUString >* pServices = s_pSupportedServices->getConstArray(); - - ::rtl::OUString sRootKey("/", 1, RTL_TEXTENCODING_ASCII_US); - for (sal_Int32 i=0; i<nLen; ++i, ++pImplName, ++pServices) - { - ::rtl::OUString aMainKeyName(sRootKey); - aMainKeyName += *pImplName; - aMainKeyName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - - try - { - Reference< XRegistryKey > xNewKey( _rxRootKey->createKey(aMainKeyName) ); - - const ::rtl::OUString* pService = pServices->getConstArray(); - for (sal_Int32 j=0; j<pServices->getLength(); ++j, ++pService) - xNewKey->createKey(*pService); - } - catch(Exception&) - { - OSL_FAIL("OModule::writeComponentInfos : something went wrong while creating the keys !"); - return sal_False; - } - } - - return sal_True; - } - - //-------------------------------------------------------------------------- Reference< XInterface > OModule::getComponentFactory( const ::rtl::OUString& _rImplementationName, const Reference< XMultiServiceFactory >& _rxServiceManager) diff --git a/dbaccess/source/ext/adabas/Acomponentmodule.hxx b/dbaccess/source/ext/adabas/Acomponentmodule.hxx index d0c93c5b0..6834f3c55 100644 --- a/dbaccess/source/ext/adabas/Acomponentmodule.hxx +++ b/dbaccess/source/ext/adabas/Acomponentmodule.hxx @@ -122,21 +122,6 @@ typedef ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleService static void revokeComponent( const ::rtl::OUString& _rImplementationName); - /** write the registration information of all known components - <p>writes the registration information of all components which are currently registered into the - specified registry.<p/> - <p>Usually used from within component_writeInfo.<p/> - @param _rxServiceManager - the service manager - @param _rRootKey - the registry key under which the information will be stored - @return - sal_True if the registration of all implementations was successfull, sal_False otherwise - */ - static sal_Bool writeComponentInfos( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceManager, - const ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey >& _rRootKey); - /** creates a Factory for the component with the given implementation name. <p>Usually used from within component_getFactory.<p/> @param _rxServiceManager @@ -184,7 +169,7 @@ typedef ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleService class ModuleRes : public ::ResId { public: - ModuleRes(USHORT _nId) : ResId(_nId, *OModule::getResManager()) { } + ModuleRes(sal_uInt16 _nId) : ResId(_nId, *OModule::getResManager()) { } }; //========================================================================== diff --git a/dbaccess/source/ext/adabas/AdabasNewDb.cxx b/dbaccess/source/ext/adabas/AdabasNewDb.cxx index 03ac72270..8171200eb 100644 --- a/dbaccess/source/ext/adabas/AdabasNewDb.cxx +++ b/dbaccess/source/ext/adabas/AdabasNewDb.cxx @@ -120,7 +120,7 @@ DBG_NAME( OAdabasNewDbDlg ) OAdabasNewDbDlg::OAdabasNewDbDlg( Window* pParent, const Reference<XCreateCatalog>& _rxCreateCatalog, const Reference< XMultiServiceFactory >& _rxORB, - BOOL _bRestore) + sal_Bool _bRestore) :ModalDialog( pParent, ModuleRes( DLG_ADABAS_NEWDB )) ,m_FT_DATABASENAME( this, ModuleRes( FT_DATABASENAME ) ) ,m_ET_DATABASENAME( this, ModuleRes( ET_DATABASENAME ) ) @@ -213,7 +213,7 @@ OAdabasNewDbDlg::OAdabasNewDbDlg( Window* pParent, m_ET_SYSUSR.SetModifyHdl( LINK(this,OAdabasNewDbDlg,LoseFocusHdl)); m_ET_CONUSR.SetModifyHdl( LINK(this,OAdabasNewDbDlg,LoseFocusHdl)); - m_ET_DOMAIN_USR.Enable(FALSE); + m_ET_DOMAIN_USR.Enable(sal_False); } @@ -341,7 +341,7 @@ OAdabasNewDbDlg::OAdabasNewDbDlg( Window* pParent, m_ET_CONUSR.SetText(String::CreateFromAscii("CONTROL")); m_PB_OK.SetClickHdl(LINK(this,OAdabasNewDbDlg,ImplOKHdl)); - m_PB_OK.Enable(FALSE); + m_PB_OK.Enable(sal_False); m_ET_DATABASENAME.SetModifyHdl( LINK(this,OAdabasNewDbDlg,LoseFocusHdl)); @@ -427,7 +427,7 @@ IMPL_LINK( OAdabasNewDbDlg, ImplOKHdl, OKButton*, /*EMPTYARG*/ ) } - BOOL bOk = FALSE; + sal_Bool bOk = sal_False; { // we need url @@ -451,13 +451,13 @@ IMPL_LINK( OAdabasNewDbDlg, ImplOKHdl, OKButton*, /*EMPTYARG*/ ) else if(m_ET_SYSUSR.GetText() == m_ET_CONUSR.GetText()) aErrorMessage = String(ModuleRes(STR_NO_SAME_USER)); else - bOk = TRUE; + bOk = sal_True; if (!bOk) { ErrorBox(this, WB_OK, aErrorMessage).Execute(); - return FALSE; + return sal_False; } sal_Int32 nPos = 0; @@ -502,7 +502,7 @@ IMPL_LINK( OAdabasNewDbDlg, ImplOKHdl, OKButton*, /*EMPTYARG*/ ) m_aCreatorThread->setTerminateHandler(LINK(this,OAdabasNewDbDlg,TerminateHdl)); m_aCreatorThread->create(); - return TRUE; + return sal_True; } //------------------------------------------------------------------------- IMPL_LINK( OAdabasNewDbDlg, TerminateHdl, void*, /*NOTUSABLE*/ ) @@ -689,7 +689,7 @@ IMPL_LINK( OAdabasNewDbDlg, PwdClickHdl, Button *, pButton ) //------------------------------------------------------------------------ void OAdabasNewDbDlg::CheckBitmaps() { - INT16 i=0; + sal_Int16 i=0; if(m_ConPwd.Len() && m_ET_CONUSR.GetText().Len()) i++,m_BMP_CON.SetImage(ModuleRes(((m_nSetBitmap & 2) == 2) ? DEFAULT_BLUE : CHECK_GREEN)); else diff --git a/dbaccess/source/ext/adabas/AdabasNewDb.hxx b/dbaccess/source/ext/adabas/AdabasNewDb.hxx index a271c438d..93de2546e 100644 --- a/dbaccess/source/ext/adabas/AdabasNewDb.hxx +++ b/dbaccess/source/ext/adabas/AdabasNewDb.hxx @@ -111,8 +111,8 @@ namespace adabasui String m_sDbConfig; ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XCreateCatalog> m_xCreateCatalog; com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xORB; - BOOL m_bRestore; - INT8 m_nSetBitmap; + sal_Bool m_bRestore; + sal_Int8 m_nSetBitmap; ::std::auto_ptr<WaitObject> m_aCreatorWait; ::std::auto_ptr<ODatabaseCreator> m_aCreatorThread; @@ -135,7 +135,7 @@ namespace adabasui OAdabasNewDbDlg(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XCreateCatalog>& _rxCreateCatalog, const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& _rxORB, - BOOL _bRestore=FALSE); + sal_Bool _bRestore=sal_False); virtual ~OAdabasNewDbDlg(); ::rtl::OUString GetDatabaseName() const { return m_ET_DATABASENAME.GetText(); } diff --git a/dbaccess/source/ext/adabas/Aservices.cxx b/dbaccess/source/ext/adabas/Aservices.cxx index 953b04717..09ed34f6e 100644 --- a/dbaccess/source/ext/adabas/Aservices.cxx +++ b/dbaccess/source/ext/adabas/Aservices.cxx @@ -69,27 +69,6 @@ component_getImplementationEnvironment( } //--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void* pServiceManager, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - return OModule::writeComponentInfos( - static_cast<XMultiServiceFactory*>(pServiceManager), - static_cast<XRegistryKey*>(pRegistryKey)); - } - catch (InvalidRegistryException& ) - { - OSL_FAIL("DBA::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - -//--------------------------------------------------------------------------------------- extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, diff --git a/dbaccess/source/ext/adabas/adabasui.component b/dbaccess/source/ext/adabas/adabasui.component new file mode 100644 index 000000000..e547a0cff --- /dev/null +++ b/dbaccess/source/ext/adabas/adabasui.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="org.openoffice.comp.adabasui.AdabasCreateDialog"> + <service name="com.sun.star.sdb.AdabasCreationDialog"/> + </implementation> +</component> diff --git a/dbaccess/source/ext/adabas/adabasui.dxp b/dbaccess/source/ext/adabas/adabasui.dxp index db9c0a52f..926e49f5f 100644 --- a/dbaccess/source/ext/adabas/adabasui.dxp +++ b/dbaccess/source/ext/adabas/adabasui.dxp @@ -1,4 +1,3 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/dbaccess/source/ext/adabas/exports.dxp b/dbaccess/source/ext/adabas/exports.dxp index 9630d7e06..f0e1c6993 100644 --- a/dbaccess/source/ext/adabas/exports.dxp +++ b/dbaccess/source/ext/adabas/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/dbaccess/source/ext/adabas/makefile.mk b/dbaccess/source/ext/adabas/makefile.mk index e23310ac9..8dbbe7abc 100644 --- a/dbaccess/source/ext/adabas/makefile.mk +++ b/dbaccess/source/ext/adabas/makefile.mk @@ -91,3 +91,10 @@ RESLIB1SRSFILES=$(RES1FILELIST) .INCLUDE : target.mk +ALLTAR : $(MISC)/adabasui.component + +$(MISC)/adabasui.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + adabasui.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt adabasui.component diff --git a/dbaccess/source/ext/macromigration/dbmm.component b/dbaccess/source/ext/macromigration/dbmm.component new file mode 100644 index 000000000..a74e94510 --- /dev/null +++ b/dbaccess/source/ext/macromigration/dbmm.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.dbaccess.macromigration.MacroMigrationDialogService"> + <service name="com.sun.star.sdb.application.MacroMigrationWizard"/> + </implementation> +</component> diff --git a/dbaccess/source/ext/macromigration/dbmm_types.cxx b/dbaccess/source/ext/macromigration/dbmm_types.cxx index 988c4591b..eb27b118b 100644 --- a/dbaccess/source/ext/macromigration/dbmm_types.cxx +++ b/dbaccess/source/ext/macromigration/dbmm_types.cxx @@ -44,7 +44,7 @@ namespace dbmm //-------------------------------------------------------------------- String getScriptTypeDisplayName( const ScriptType _eType ) { - USHORT nResId( 0 ); + sal_uInt16 nResId( 0 ); switch ( _eType ) { diff --git a/dbaccess/source/ext/macromigration/macromigration.src b/dbaccess/source/ext/macromigration/macromigration.src index b00ce0392..5d1d9db39 100644 --- a/dbaccess/source/ext/macromigration/macromigration.src +++ b/dbaccess/source/ext/macromigration/macromigration.src @@ -31,6 +31,7 @@ // ----------------------------------------------------------------------------- ModalDialog DLG_MACRO_MIGRATION { + HelpID = "dbaccess:ModalDialog:DLG_MACRO_MIGRATION"; OutputSize = TRUE ; Moveable = TRUE; Closeable = TRUE ; @@ -65,6 +66,7 @@ ModalDialog DLG_MACRO_MIGRATION TabPage TP_PREPARE { + HelpID = "dbaccess:TabPage:TP_PREPARE"; Pos = MAP_APPFONT( 40, 130 ); Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ); @@ -115,6 +117,7 @@ TabPage TP_PREPARE TabPage TP_SAVE_DBDOC_AS { + HelpID = "dbaccess:TabPage:TP_SAVE_DBDOC_AS"; Pos = MAP_APPFONT( 40, 130 ); Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ); @@ -152,6 +155,7 @@ TabPage TP_SAVE_DBDOC_AS ComboBox ED_SAVE_AS_LOCATION { + HelpID = "dbaccess:ComboBox:TP_SAVE_DBDOC_AS:ED_SAVE_AS_LOCATION"; Pos = MAP_APPFONT( TAB_PAGE_CONTENT_MARGIN + 60 + SPACING_RELATED, CONTENT_POS_X + 5 * FIXED_TEXT_HEIGHT + SPACING_UNRELATED ); Size = MAP_APPFONT( TAB_PAGE_WIDTH - ( TAB_PAGE_CONTENT_MARGIN + 60 + SPACING_RELATED ) - TAB_PAGE_CONTENT_MARGIN, @@ -163,6 +167,7 @@ TabPage TP_SAVE_DBDOC_AS PushButton PB_BROWSE_SAVE_AS_LOCATION { + HelpID = "dbaccess:PushButton:TP_SAVE_DBDOC_AS:PB_BROWSE_SAVE_AS_LOCATION"; Pos = MAP_APPFONT( TAB_PAGE_WIDTH - BUTTON_WIDTH - TAB_PAGE_CONTENT_MARGIN, CONTENT_POS_X + 5 * FIXED_TEXT_HEIGHT + SPACING_UNRELATED + INPUT_HEIGHT + SPACING_RELATED ); Size = MAP_APPFONT( BUTTON_WIDTH, BUTTON_HEIGHT ); @@ -189,6 +194,7 @@ TabPage TP_SAVE_DBDOC_AS TabPage TP_MIGRATE { + HelpID = "dbaccess:TabPage:TP_MIGRATE"; Pos = MAP_APPFONT( 40, 130 ); Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ); @@ -302,6 +308,7 @@ TabPage TP_MIGRATE TabPage TP_SUMMARY { + HelpID = "dbaccess:TabPage:TP_SUMMARY"; Pos = MAP_APPFONT( 40, 130 ); Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ); @@ -325,6 +332,7 @@ TabPage TP_SUMMARY MultiLineEdit ED_CHANGES { + HelpID = "dbaccess:MultiLineEdit:TP_SUMMARY:ED_CHANGES"; Pos = MAP_APPFONT( TAB_PAGE_CONTENT_MARGIN, CONTENT_POS_X + FIXED_TEXT_HEIGHT + SPACING_RELATED ); Size = MAP_APPFONT( TAB_PAGE_WIDTH - 2 * TAB_PAGE_CONTENT_MARGIN, TAB_PAGE_HEIGHT - ( CONTENT_POS_X + FIXED_TEXT_HEIGHT + SPACING_RELATED ) - TAB_PAGE_CONTENT_MARGIN ); @@ -447,7 +455,7 @@ String STR_INVALID_NUMBER_ARGS String STR_NO_DATABASE { - Text [ en-US ] = "No database document found in the initializatin arguments."; + Text [ en-US ] = "No database document found in the initialization arguments."; }; String STR_NOT_READONLY diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx index 7070414cb..201ad2622 100644 --- a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx @@ -214,10 +214,10 @@ namespace dbmm } //-------------------------------------------------------------------- - BOOL MacroMigrationDialog::Close() + sal_Bool MacroMigrationDialog::Close() { if ( m_pData->bMigrationIsRunning ) - return FALSE; + return sal_False; return MacroMigrationDialog_Base::Close(); } diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.hxx b/dbaccess/source/ext/macromigration/macromigrationdialog.hxx index 156f52c1e..d3cdb3ece 100644 --- a/dbaccess/source/ext/macromigration/macromigrationdialog.hxx +++ b/dbaccess/source/ext/macromigration/macromigrationdialog.hxx @@ -72,7 +72,7 @@ namespace dbmm virtual sal_Bool onFinish(); // Dialog overridables - virtual BOOL Close(); + virtual sal_Bool Close(); virtual short Execute(); private: diff --git a/dbaccess/source/ext/macromigration/makefile.mk b/dbaccess/source/ext/macromigration/makefile.mk index 41898091c..b71330f17 100644 --- a/dbaccess/source/ext/macromigration/makefile.mk +++ b/dbaccess/source/ext/macromigration/makefile.mk @@ -99,3 +99,11 @@ RESLIB1SRSFILES=$(RES1FILELIST) .INCLUDE : target.mk + +ALLTAR : $(MISC)/dbmm.component + +$(MISC)/dbmm.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + dbmm.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt dbmm.component diff --git a/dbaccess/source/ext/macromigration/migrationlog.cxx b/dbaccess/source/ext/macromigration/migrationlog.cxx index c9e917dbf..7ff831a58 100644 --- a/dbaccess/source/ext/macromigration/migrationlog.cxx +++ b/dbaccess/source/ext/macromigration/migrationlog.cxx @@ -373,7 +373,7 @@ namespace dbmm break; case ERR_NEW_STYLE_REPORT: - pAsciiErrorDescription = "#doc# could not be processed, since you don't have the Sun Report Builder (TM) extension installed."; + pAsciiErrorDescription = "#doc# could not be processed, since you don't have the Oracle Report Builder (TM) extension installed."; aAsciiParameterNames.push_back( "#doc#" ); break; @@ -398,7 +398,7 @@ namespace dbmm } //---------------------------------------------------------------- - void lcl_describeErrors( ::rtl::OUStringBuffer& _rBuffer, const ErrorLog& _rErrors, const USHORT _nHeadingResId ) + void lcl_describeErrors( ::rtl::OUStringBuffer& _rBuffer, const ErrorLog& _rErrors, const sal_uInt16 _nHeadingResId ) { _rBuffer.appendAscii( "=== " ); _rBuffer.append ( String( MacroMigrationResId( _nHeadingResId ) ) ); diff --git a/dbaccess/source/ext/macromigration/rangeprogressbar.hxx b/dbaccess/source/ext/macromigration/rangeprogressbar.hxx index cbf432500..f4d1c840e 100644 --- a/dbaccess/source/ext/macromigration/rangeprogressbar.hxx +++ b/dbaccess/source/ext/macromigration/rangeprogressbar.hxx @@ -88,7 +88,7 @@ namespace dbmm //-------------------------------------------------------------------- inline void RangeProgressBar::SetValue( sal_uInt32 _nValue ) { - ProgressBar::SetValue( (USHORT)( 100.0 * _nValue / m_nRange ) ); + ProgressBar::SetValue( (sal_uInt16)( 100.0 * _nValue / m_nRange ) ); } //-------------------------------------------------------------------- diff --git a/dbaccess/source/filter/migration/cfgimport.cxx b/dbaccess/source/filter/migration/cfgimport.cxx deleted file mode 100644 index ed84756f1..000000000 --- a/dbaccess/source/filter/migration/cfgimport.cxx +++ /dev/null @@ -1,1180 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - /************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_dbaccess.hxx" - -#include "cfgimport.hxx" - -#include "cfg_reghelper.hxx" -#include <vcl/svapp.hxx> -#include <com/sun/star/uno/XNamingService.hpp> -#include <com/sun/star/sdb/XQueryDefinitionsSupplier.hpp> -#include <com/sun/star/sdbcx/XTablesSupplier.hpp> -#include <com/sun/star/sdbcx/XColumnsSupplier.hpp> -#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp> -#include <com/sun/star/frame/XModel.hpp> -#include <com/sun/star/beans/XMultiPropertySet.hpp> -#include <com/sun/star/sdbcx/XAppend.hpp> -#include <com/sun/star/frame/XStorable.hpp> -#include <com/sun/star/sdbc/XDataSource.hpp> -#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> -#include <com/sun/star/sdb/XDocumentDataSource.hpp> -#include <tools/urlobj.hxx> -#include <unotools/pathoptions.hxx> -#include <com/sun/star/frame/XComponentLoader.hpp> -#include "cfgstrings.hrc" -#include <unotools/ucbhelper.hxx> -#include <comphelper/types.hxx> -#include <com/sun/star/container/XNameContainer.hpp> -#include <com/sun/star/container/XNameAccess.hpp> -#include <sfx2/docfilt.hxx> -#include <comphelper/streamsection.hxx> -#include <com/sun/star/io/XActiveDataSink.hpp> -#include <com/sun/star/io/XObjectInputStream.hpp> -#include <comphelper/basicio.hxx> -#include <comphelper/seqstream.hxx> -#include <com/sun/star/sdb/XReportDocumentsSupplier.hpp> -#include <com/sun/star/sdb/XFormDocumentsSupplier.hpp> -#include <com/sun/star/configuration/backend/XLayer.hpp> -#include <com/sun/star/frame/XLoadable.hpp> -#include <com/sun/star/document/XTypeDetection.hpp> -#include <com/sun/star/document/XEventsSupplier.hpp> -#include <com/sun/star/util/XCloseable.hpp> -#include <com/sun/star/container/XNameReplace.hpp> -#include <com/sun/star/form/FormComponentType.hpp> -#include <com/sun/star/drawing/XDrawPageSupplier.hpp> -#include <com/sun/star/form/XFormsSupplier.hpp> -#include <tools/debug.hxx> - - -extern "C" void SAL_CALL createRegistryInfo_OCfgImport( ) -{ - static ::dbacfg::OMultiInstanceAutoRegistration< ::dbacfg::OCfgImport > aAutoRegistration; -} - -#define DATASOURCES 1 -#define DATASOURCE 2 -#define DATASOURCESETTINGS 3 -#define TABLES 4 -#define QUERIES 5 -#define BOOKMARKS 6 -#define DATASOURCESETTING 7 -#define BOOKMARK 8 -#define QUERY 9 -#define TABLE 10 -#define DATASETTINGS 11 -#define COLUMNS 12 -#define COLUMN 13 -#define NO_PROP 14 -#define LOGINTIMEOUT 15 - -//-------------------------------------------------------------------------- -using namespace dbacfg; -// { - using namespace ::com::sun::star::util; - using namespace ::com::sun::star::sdb; - using namespace ::com::sun::star::sdbcx; - using namespace ::com::sun::star::frame; - using namespace ::com::sun::star::document; - using namespace ::com::sun::star::io; - using namespace ::com::sun::star::form; - using namespace ::com::sun::star::drawing; - using namespace ::com::sun::star::container; - using namespace ::com::sun::star::beans; - using namespace ::com::sun::star::task; - using namespace ::com::sun::star::configuration::backend; - using namespace ::utl; - using namespace ::comphelper; - - void LoadTableWindows(const Reference< XObjectInputStream>& _rxIn,Sequence<PropertyValue>& _rViewProps); - void LoadTableWindowData(const Reference<XObjectInputStream>& _rxIn,PropertyValue* _pValue); - void LoadTableFields(const Reference< XObjectInputStream>& _rxIn,Sequence<PropertyValue>& _rViewProps); - void LoadTableFieldDesc(const Reference< XObjectInputStream>& _rxIn,PropertyValue& _rProperty); - sal_Bool isDocumentReport(const Reference< XMultiServiceFactory >& _xORB,const ::rtl::OUString& _sDocumentLocation); -// ------------- -// - OCfgImport - -// ------------- -DBG_NAME(OCfgImport) - -OCfgImport::OCfgImport( const Reference< XMultiServiceFactory >& _rxMSF ) - :m_xORB( _rxMSF ) - ,m_bPropertyMayBeVoid(sal_True) -{ - DBG_CTOR(OCfgImport,NULL); - -} - -// ----------------------------------------------------------------------------- - -OCfgImport::~OCfgImport() throw() -{ - - DBG_DTOR(OCfgImport,NULL); -} -// ----------------------------------------------------------------------------- -IMPLEMENT_SERVICE_INFO1_STATIC( OCfgImport, "com.sun.star.comp.sdb.DataSourceMigration", "com.sun.star.sdb.DataSourceMigration") -// ----------------------------------------------------------------------------- -// XInitialization -void SAL_CALL OCfgImport::initialize( const Sequence< Any >& _aArguments ) throw(Exception, RuntimeException) -{ - const Any* pIter = _aArguments.getConstArray(); - const Any* pEnd = pIter + _aArguments.getLength(); - Sequence<NamedValue> aOldConfigValues; - NamedValue aValue; - for(;pIter != pEnd;++pIter) - { - *pIter >>= aValue; - if ( aValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("OldConfiguration")) && (aValue.Value >>= aOldConfigValues) ) - { - const NamedValue* configValues = aOldConfigValues.getConstArray(); - const NamedValue* configValuesEnd = configValues + aOldConfigValues.getLength(); - for(;configValues != configValuesEnd;++configValues) - { - if ( configValues->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("org.openoffice.Office.DataAccess")) ) - { - configValues->Value >>= m_xLayer; - break; - } - } - break; - } - } -} -// ----------------------------------------------------------------------------- - -void LoadTableWindows(const Reference< XObjectInputStream>& _rxIn,Sequence<PropertyValue>& _rViewProps) -{ - try - { - OStreamSection aSection(_rxIn.get()); - - sal_Int32 nCount = 0; - _rxIn >> nCount; - if ( nCount > 0 ) - { - PropertyValue *pViewIter = _rViewProps.getArray(); - PropertyValue *pEnd = pViewIter + _rViewProps.getLength(); - const static ::rtl::OUString s_sTables(RTL_CONSTASCII_USTRINGPARAM("Tables")); - for (; pViewIter != pEnd && pViewIter->Name != s_sTables; ++pViewIter) - ; - - if ( pViewIter == pEnd ) - { - sal_Int32 nLen = _rViewProps.getLength(); - _rViewProps.realloc( nLen + 1 ); - pViewIter = _rViewProps.getArray() + nLen; - pViewIter->Name = s_sTables; - } - - Sequence<PropertyValue> aTables(nCount); - PropertyValue *pIter = aTables.getArray(); - - - for(sal_Int32 i=0;i<nCount;++i,++pIter) - { - pIter->Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Table")) + ::rtl::OUString::valueOf(i+1); - LoadTableWindowData(_rxIn,pIter); - } - } - } - catch(Exception&) - { - } -} -// ----------------------------------------------------------------------------- -void LoadTableWindowData(const Reference<XObjectInputStream>& _rxIn,PropertyValue* _pValue) -{ - ::rtl::OUString sComposedName,aTableName,aWinName; - sal_Int32 nX,nY,nWidth,nHeight; - sal_Bool bShowAll; - - OStreamSection aSection(_rxIn.get()); - _rxIn >> sComposedName; - _rxIn >> aTableName; - _rxIn >> aWinName; - _rxIn >> nX; - _rxIn >> nY; - _rxIn >> nWidth; - _rxIn >> nHeight; - _rxIn >> bShowAll; - - Sequence<PropertyValue> aWindow(8); - sal_Int32 nPos = 0; - aWindow[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ComposedName")); - aWindow[nPos++].Value <<= sComposedName; - aWindow[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TableName")); - aWindow[nPos++].Value <<= aTableName; - aWindow[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WindowName")); - aWindow[nPos++].Value <<= aWinName; - aWindow[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WindowTop")); - aWindow[nPos++].Value <<= nY; - aWindow[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WindowLeft")); - aWindow[nPos++].Value <<= nX; - aWindow[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WindowWidth")); - aWindow[nPos++].Value <<= nWidth; - aWindow[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WindowHeight")); - aWindow[nPos++].Value <<= nHeight; - aWindow[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowAll")); - aWindow[nPos++].Value <<= bShowAll; - - _pValue->Value <<= aWindow; -} -// ----------------------------------------------------------------------------- -void LoadTableFields(const Reference< XObjectInputStream>& _rxIn,Sequence<PropertyValue>& _rViewProps) -{ - LoadTableWindows(_rxIn,_rViewProps); - OStreamSection aSection(_rxIn.get()); - PropertyValue *pIter = NULL; - try - { - sal_Int32 nSplitPos,nVisibleRows; - // some data - _rxIn >> nSplitPos; - _rxIn >> nVisibleRows; - - sal_Int32 nCount = 0; - _rxIn >> nCount; - - sal_Int32 nLen = _rViewProps.getLength(); - _rViewProps.realloc( nLen + 2 + (nCount != 0 ? 1 : 0) ); - pIter = _rViewProps.getArray() + nLen; - - if ( nCount != 0 ) - { - pIter->Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Fields")); - - Sequence<PropertyValue> aFields(nCount); - PropertyValue *pFieldsIter = aFields.getArray(); - // the fielddata - for(sal_Int32 j=0;j<nCount;++j) - { - if ( aSection.available() ) - { - pFieldsIter->Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Field")) + ::rtl::OUString::valueOf(j+1); - LoadTableFieldDesc(_rxIn,*pFieldsIter++); - } - } - pIter->Value <<= aFields; - ++pIter; - } - - pIter->Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SplitterPosition")); - pIter->Value <<= nSplitPos; - ++pIter; - pIter->Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleRows")); - pIter->Value <<= nVisibleRows; - } - catch(Exception&) - { - } -} -// ----------------------------------------------------------------------------- -void LoadTableFieldDesc(const Reference< XObjectInputStream>& _rxIn,PropertyValue& _rProperty) -{ - ::rtl::OUString aTableName; - ::rtl::OUString aAliasName; // table range - ::rtl::OUString aFieldName; // column - ::rtl::OUString aFieldAlias; // column alias - ::rtl::OUString aDatabaseName; // qualifier or catalog - ::rtl::OUString aFunctionName; // contains the function name if eFunctionType != FKT_NONE - - sal_Int32 eDataType; - sal_Int32 eFunctionType; - sal_Int32 eFieldType; - sal_Int32 eOrderDir; - sal_Int32 nColWidth; - sal_Bool bGroupBy; - sal_Bool bVisible; - - OStreamSection aSection(_rxIn.get()); - _rxIn >> aTableName; - _rxIn >> aAliasName; - _rxIn >> aFieldName; - _rxIn >> aFieldAlias; - _rxIn >> aDatabaseName; - _rxIn >> aFunctionName; - _rxIn >> eDataType; - _rxIn >> eFunctionType; - _rxIn >> eFieldType; - _rxIn >> eOrderDir; - _rxIn >> nColWidth; - _rxIn >> bGroupBy; - _rxIn >> bVisible; - - Sequence<PropertyValue> aFieldDesc(13); - sal_Int32 nPos = 0; - aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AliasName")); - aFieldDesc[nPos++].Value <<= aAliasName; - aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TableName")); - aFieldDesc[nPos++].Value <<= aTableName; - aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FieldName")); - aFieldDesc[nPos++].Value <<= aFieldName; - aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FieldAlias")); - aFieldDesc[nPos++].Value <<= aFieldAlias; - aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DatabaseName")); - aFieldDesc[nPos++].Value <<= aDatabaseName; - aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FunctionName")); - aFieldDesc[nPos++].Value <<= aFunctionName; - aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataType")); - aFieldDesc[nPos++].Value <<= eDataType; - aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FunctionType")); - aFieldDesc[nPos++].Value <<= (sal_Int32)eFunctionType; - aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FieldType")); - aFieldDesc[nPos++].Value <<= (sal_Int32)eFieldType; - aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OrderDir")); - aFieldDesc[nPos++].Value <<= (sal_Int32)eOrderDir; - aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ColWidth")); - aFieldDesc[nPos++].Value <<= nColWidth; - aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GroupBy")); - aFieldDesc[nPos++].Value <<= bGroupBy; - aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Visible")); - aFieldDesc[nPos++].Value <<= bVisible; - - _rProperty.Value <<= aFieldDesc; -} -// ----------------------------------------------------------------------------- -void closeDocument(const Reference< XModel >& _xDocument) -{ - Reference< XCloseable > xCloseable( _xDocument, UNO_QUERY ); - if ( xCloseable.is() ) - { - try - { - xCloseable->close( sal_True ); - } - catch( Exception& ) - { - } - } -} -// ----------------------------------------------------------------------------- -sal_Bool isDocumentReport(const Reference< XMultiServiceFactory >& _xORB,const ::rtl::OUString& _sDocumentLocation) -{ - sal_Bool bReport = sal_False; - try - { - Reference< XModel > xDocument(_xORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument"))),UNO_QUERY); - if ( xDocument.is() ) - { - Reference< XLoadable > xLoadable( xDocument, UNO_QUERY ); - if ( xLoadable.is() ) - { - Sequence< PropertyValue > aMedDescr(4); - sal_Int32 nPos = 0; - aMedDescr[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AsTemplate")); - aMedDescr[nPos++].Value <<= sal_False; - aMedDescr[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hidden")); - aMedDescr[nPos++].Value <<= sal_False; - aMedDescr[nPos].Name = PROPERTY_URL; - aMedDescr[nPos++].Value <<= _sDocumentLocation; - aMedDescr[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly")); - aMedDescr[nPos++].Value <<= sal_True; - Reference< XTypeDetection > xTypeDetection(_xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection")) ),UNO_QUERY ); - - if ( !xTypeDetection.is() ) - throw RuntimeException(); // TODO - - // get TypeName - ::rtl::OUString aTypeName = xTypeDetection->queryTypeByDescriptor( aMedDescr, sal_True ); - const PropertyValue* pIter = aMedDescr.getConstArray(); - const PropertyValue* pEnd = pIter + aMedDescr.getLength(); - for( ; pIter != pEnd && !pIter->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FilterName" ) ); ++pIter) - ; - if ( aTypeName.getLength() && pIter == pEnd ) - { - Reference<XNameAccess> xNameAccess( xTypeDetection, UNO_QUERY ); - if ( xNameAccess.is() && xNameAccess->hasByName( aTypeName ) ) - { - Sequence<PropertyValue> aTypes; - xNameAccess->getByName(aTypeName) >>= aTypes; - const PropertyValue* types = aTypes.getConstArray(); - const PropertyValue* typesEnd = types + aTypes.getLength(); - for( ; types != typesEnd && !types->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PreferredFilter" ) ) ; ++types) - ; - if ( types != typesEnd ) - { - sal_Int32 nLen = aMedDescr.getLength(); - aMedDescr.realloc(nLen+1); - aMedDescr[nLen].Value = types->Value; - aMedDescr[nLen].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName")); - } - } - } - try - { - xLoadable->load(aMedDescr); - - Reference< XEventsSupplier> xEventsSup(xDocument,UNO_QUERY); - Reference< XNameReplace> xEvents = xEventsSup.is() ? xEventsSup->getEvents() : Reference< XNameReplace>(); - static const ::rtl::OUString s_sOnNew = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnNew")); - if ( xEvents.is() && xEvents->hasByName(s_sOnNew) ) - { - Sequence<PropertyValue> aEventDesc; - if ( (xEvents->getByName(s_sOnNew) >>= aEventDesc ) && aEventDesc.getLength() ) - { - ::rtl::OUString sScript; - const PropertyValue* events = aEventDesc.getConstArray(); - const PropertyValue* eventsEnd = events + aEventDesc.getLength(); - for( ; events != eventsEnd && !events->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Script" ) ) ; ++events) - ; - if ( events != eventsEnd && (events->Value >>= sScript) ) - bReport = sScript.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("service:com.sun.star.wizards.report.CallReportWizard?fill")); - } - } - if ( !bReport ) - { - sal_Bool bForm = sal_False; - Reference< XDrawPageSupplier> xDrawPageSup(xDocument,UNO_QUERY); - Reference< XFormsSupplier> xFormsSup(xDrawPageSup.is() ? xDrawPageSup->getDrawPage() : Reference< XDrawPage>(),UNO_QUERY); - Reference< XNameContainer> xForms(xFormsSup.is() ? xFormsSup->getForms() : Reference< XNameContainer>(),UNO_QUERY); - Sequence< ::rtl::OUString> aSeq = xForms.is() ? xForms->getElementNames() : Sequence< ::rtl::OUString>(); - const ::rtl::OUString* elementNames = aSeq.getConstArray(); - const ::rtl::OUString* elementNamesEnd = elementNames + aSeq.getLength(); - for(;elementNames != elementNamesEnd && !bForm;++elementNames) - { - Reference< XNameContainer> xControls(xForms->getByName(*elementNames),UNO_QUERY); - Sequence< ::rtl::OUString> aControlSeq = xControls.is() ? xControls->getElementNames() : Sequence< ::rtl::OUString>(); - const ::rtl::OUString* pControlIter = aControlSeq.getConstArray(); - const ::rtl::OUString* pControlEnd = pControlIter + aControlSeq.getLength(); - for(;pControlIter != pControlEnd && !bForm;++pControlIter) - { - Reference<XPropertySet> xProp(xControls->getByName(*pControlIter),UNO_QUERY); - sal_Int16 nClassId = 0; - const static ::rtl::OUString s_sClassId = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ClassId")); - if ( xProp.is() - && xProp->getPropertySetInfo().is() - && xProp->getPropertySetInfo()->hasPropertyByName(s_sClassId) - && (xProp->getPropertyValue(s_sClassId) >>= nClassId) ) - { - bForm = nClassId != FormComponentType::HIDDENCONTROL; - } - } - } - bReport = !bForm; - } - } - catch( Exception& ) - { - closeDocument(xDocument); - } - } - closeDocument(xDocument); - } - } - catch(Exception) - { - OSL_ENSURE(0,"isDocumentReport: catched exception!"); - } - return bReport; -} -// ----------------------------------------------------------------------------- -void OCfgImport::createDataSource(const ::rtl::OUString& _sName) -{ - SvtPathOptions aPathOptions; - const String& rsWorkPath = aPathOptions.GetWorkPath(); - - ::rtl::OUString sExtension; - static const String s_sDatabaseType = String::CreateFromAscii("StarOffice XML (Base)"); - const SfxFilter* pFilter = SfxFilter::GetFilterByName( s_sDatabaseType); - OSL_ENSURE(pFilter,"Filter: StarOffice XML (Base) could not be found!"); - if ( pFilter ) - { - String aRet = pFilter->GetDefaultExtension(); - while( aRet.SearchAndReplaceAscii( "*.", String() ) != STRING_NOTFOUND ) ; - sExtension = aRet; - } - // then look for which of the settings are stored in the configuration - ::rtl::OUString sFileName; - try - { - m_xModel.set(m_xORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.OfficeDatabaseDocument"))),UNO_QUERY); - - if ( !m_xModel.is() ) - return; - - Reference<XOfficeDatabaseDocument> xOfficeDoc(m_xModel,UNO_QUERY); - if ( xOfficeDoc.is() ) - m_xCurrentDS.set(xOfficeDoc->getDataSource(),UNO_QUERY); - - - INetURLObject aURL(rsWorkPath,INetURLObject::WAS_ENCODED); - aURL.insertName(_sName,false,INetURLObject::LAST_SEGMENT,true,INetURLObject::ENCODE_ALL); - aURL.setExtension(sExtension); - - sFileName = aURL.GetMainURL(INetURLObject::NO_DECODE); - - sal_Int32 i = 0; - // create unique name - while ( UCBContentHelper::IsDocument(sFileName) ) - { - sFileName = _sName + ::rtl::OUString::valueOf(++i); - aURL.setName(sFileName,INetURLObject::LAST_SEGMENT,true,INetURLObject::ENCODE_ALL); - aURL.setExtension(sExtension); - sFileName = aURL.GetMainURL(INetURLObject::NO_DECODE); - } - - Sequence< PropertyValue > aArgs(1); - aArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FileName" ) ); - aArgs[0].Value <<= sFileName; - - Reference< XLoadable > xLoad( m_xModel, UNO_QUERY_THROW ); - xLoad->load( aArgs ); - m_xModel->attachResource( sFileName, Sequence< PropertyValue >() ); - } - catch(Exception&) - { - OSL_ENSURE(0,"Exception: convert"); - UCBContentHelper::Kill(sFileName); - } -} -// ----------------------------------------------------------------------------- -void OCfgImport::createObject(sal_Bool _bQuery ,const ::rtl::OUString& _sName) -{ - if ( !m_xCurrentObject.is() ) - { - Sequence< Any > aArguments(1); - PropertyValue aValue; - // set as folder - aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")); - aValue.Value <<= _sName; - aArguments[0] <<= aValue; - m_xCurrentObject.set(m_xORB->createInstanceWithArguments(_bQuery ? SERVICE_SDB_COMMAND_DEFINITION : SERVICE_SDB_TABLEDEFINITION ,aArguments ),UNO_QUERY); - } -} -// ----------------------------------------------------------------------------- -void OCfgImport::setProperties(sal_Int16 _eType) -{ - if ( m_aValues[_eType].getLength() ) - { - OSL_ENSURE(m_aProperties[_eType].getLength() == m_aValues[_eType].getLength(),"Count is not equal!"); - try - { - Reference< XMultiPropertySet > xFormMultiSet; - if ( _eType == COLUMN ) - xFormMultiSet.set(m_xCurrentColumn,UNO_QUERY); - else if ( _eType == TABLE || _eType == QUERY ) - xFormMultiSet.set(m_xCurrentObject,UNO_QUERY); - else if ( _eType == DATASOURCE ) - xFormMultiSet.set(m_xCurrentDS,UNO_QUERY); - - if ( xFormMultiSet.is() ) - xFormMultiSet->setPropertyValues(m_aProperties[_eType], m_aValues[_eType]); - } - catch(const Exception& e) - { - throw WrappedTargetException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property could not be set.")),*this,makeAny(e)); - } - m_aValues[_eType] = Sequence< Any>(); - m_aProperties[_eType] = Sequence< ::rtl::OUString>(); - } -} -// ----------------------------------------------------------------------------- -Any SAL_CALL OCfgImport::execute( const Sequence< NamedValue >& /*Arguments*/ ) throw (IllegalArgumentException, Exception, RuntimeException) -{ - m_xLayer->readData(this); - return Any(); -} -// ----------------------------------------------------------------------------- -// XLayerHandler -void SAL_CALL OCfgImport::startLayer() - throw(WrappedTargetException) -{ -} -// ----------------------------------------------------------------------------- - -void SAL_CALL OCfgImport::endLayer() - throw( - MalformedDataException, - WrappedTargetException ) -{ -} -// ----------------------------------------------------------------------------- - -void SAL_CALL OCfgImport::overrideNode( - const ::rtl::OUString& aName, - sal_Int16 aAttributes, - sal_Bool /*bClear*/) - throw( - MalformedDataException, - WrappedTargetException ) -{ - addOrReplaceNode(aName,aAttributes); -} -// ----------------------------------------------------------------------------- - -void SAL_CALL OCfgImport::addOrReplaceNode( - const ::rtl::OUString& aName, - sal_Int16 /*aAttributes*/) - throw( - MalformedDataException, - WrappedTargetException ) -{ - if ( !m_aStack.empty() ) - { - switch(m_aStack.top().second) - { - case DATASOURCES: - m_sCurrentDataSourceName = aName; - if ( m_sCurrentDataSourceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Bibliography")) ) - { - Reference< XNameAccess > xDatabaseContext(m_xORB->createInstance(SERVICE_SDB_DATABASECONTEXT), UNO_QUERY); - if ( xDatabaseContext.is() && xDatabaseContext->hasByName(m_sCurrentDataSourceName) ) - { - m_xCurrentDS.set(xDatabaseContext->getByName(m_sCurrentDataSourceName),UNO_QUERY); - Reference<XDocumentDataSource> xDocumentDataSource(m_xCurrentDS,UNO_QUERY); - if ( xDocumentDataSource.is() ) - m_xModel.set(xDocumentDataSource->getDatabaseDocument(),UNO_QUERY); - } - } - if ( !m_xCurrentDS.is() ) - createDataSource(m_sCurrentDataSourceName); - - m_aStack.push(TElementStack::value_type(aName,DATASOURCE)); - break; - case DATASOURCESETTINGS: - { - PropertyValue aValue; - aValue.Name = aName; - m_aDataSourceSettings.push_back(aValue); - m_aStack.push(TElementStack::value_type(aName,DATASOURCESETTING)); - } - break; - case TABLES: - m_aStack.push(TElementStack::value_type(aName,TABLE)); - createObject(sal_False,aName); - break; - case QUERIES: - m_aStack.push(TElementStack::value_type(aName,QUERY)); - createObject(sal_True,aName); - break; - case COLUMNS: - if ( !m_xCurrentColumn.is() ) - { - Reference<XColumnsSupplier> xSupplier(m_xCurrentObject,UNO_QUERY); - if ( xSupplier.is() ) - { - Reference<XDataDescriptorFactory> xFact(xSupplier->getColumns(),UNO_QUERY); - - m_xCurrentColumn = ( xFact.is() ? xFact->createDataDescriptor() : Reference<XPropertySet>()); - if ( m_xCurrentColumn.is() ) - m_xCurrentColumn->setPropertyValue(PROPERTY_NAME,makeAny(aName)); - } - } - m_aStack.push(TElementStack::value_type(aName,COLUMN)); - break; - case BOOKMARKS: - m_aStack.push(TElementStack::value_type(aName,BOOKMARK)); - break; - } - } - if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DataSources")) ) - m_aStack.push(TElementStack::value_type(aName,DATASOURCES)); - else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DataSourceSettings")) ) - m_aStack.push(TElementStack::value_type(aName,DATASOURCESETTINGS)); - else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Tables")) ) - m_aStack.push(TElementStack::value_type(aName,TABLES)); - else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Queries")) ) - m_aStack.push(TElementStack::value_type(aName,QUERIES)); - else if ( aName == CONFIGKEY_DBLINK_BOOKMARKS ) - m_aStack.push(TElementStack::value_type(aName,BOOKMARKS)); - else if ( aName == CONFIGKEY_SETTINGS ) - m_aStack.push(TElementStack::value_type(aName,DATASETTINGS)); - else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Font")) ) - m_aStack.push(TElementStack::value_type(aName,DATASETTINGS)); - else if ( aName == CONFIGKEY_QRYDESCR_COLUMNS ) - m_aStack.push(TElementStack::value_type(aName,COLUMNS)); - else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Font")) ) - m_aStack.push(TElementStack::value_type(aName,DATASETTINGS)); -} -// ----------------------------------------------------------------------------- - -void SAL_CALL OCfgImport::addOrReplaceNodeFromTemplate( - const ::rtl::OUString& /*aName*/, - const TemplateIdentifier& /*aTemplate*/, - sal_Int16 /*aAttributes*/ ) - throw( - MalformedDataException, - WrappedTargetException ) -{ -} -// ----------------------------------------------------------------------------- - -void SAL_CALL OCfgImport::endNode() - throw( - MalformedDataException, - WrappedTargetException ) -{ - if ( !m_aStack.empty() ) - { - sal_Int16 nElementType = m_aStack.top().second; - ::rtl::OUString sName = m_aStack.top().first; - m_aStack.pop(); - - switch(nElementType) - { - case DATASOURCE: - { - setProperties(nElementType); - Reference<XStorable> xStr(m_xModel,UNO_QUERY); - if ( xStr.is() ) - { - xStr->store(); - xStr = NULL; - } - // register the new datbase document - - if ( !m_sCurrentDataSourceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Bibliography")) ) - { - // create unique name - Reference< XNameAccess > xDatabaseContext(m_xORB->createInstance(SERVICE_SDB_DATABASECONTEXT), UNO_QUERY); - if ( xDatabaseContext.is() ) - { - sal_Int32 i = 0; - ::rtl::OUString sDataSourceName = m_sCurrentDataSourceName; - while ( xDatabaseContext->hasByName( sDataSourceName ) ) - { - sDataSourceName = m_sCurrentDataSourceName + ::rtl::OUString::valueOf(++i); - } - Reference< XNamingService>(xDatabaseContext,UNO_QUERY)->registerObject(sDataSourceName,m_xCurrentDS); - } - } - ::comphelper::disposeComponent(m_xModel); - m_xCurrentDS = NULL; - } - break; - case DATASOURCESETTINGS: - OSL_ENSURE(m_xCurrentDS.is(),"Data Source is NULL!"); - { - PropertyValue* pSettings = m_aDataSourceSettings.empty() ? NULL : &m_aDataSourceSettings[0]; - m_xCurrentDS->setPropertyValue(PROPERTY_INFO,makeAny(Sequence< PropertyValue >(pSettings, m_aDataSourceSettings.size()))); - } - break; - case TABLE: - { - setProperties(nElementType); - Reference<XTablesSupplier> xSupplier(m_xCurrentDS,UNO_QUERY); - Reference<XNameContainer> xTables(xSupplier->getTables(),UNO_QUERY); - ::rtl::OUString sTableName; - m_xCurrentObject->getPropertyValue(PROPERTY_NAME) >>= sTableName; - if ( !xTables->hasByName( sTableName ) ) - xTables->insertByName( sTableName, makeAny( m_xCurrentObject ) ); - m_xCurrentObject = NULL; - } - break; - case QUERY: - { - setProperties(nElementType); - Reference<XQueryDefinitionsSupplier> xQueriesSupplier(m_xCurrentDS,UNO_QUERY); - Reference<XNameContainer> xQueries(xQueriesSupplier->getQueryDefinitions(),UNO_QUERY); - xQueries->insertByName(sName,makeAny(m_xCurrentObject)); - m_xCurrentObject = NULL; - } - break; - case BOOKMARK: - try - { - if ( !UCBContentHelper::IsDocument(m_sDocumentLocation) ) - break; - - sal_Bool bForm = sal_True; - bForm = !isDocumentReport(m_xORB,m_sDocumentLocation); - Reference<XNameAccess> xNames; - if ( bForm ) - { - Reference<XFormDocumentsSupplier> xSup(m_xModel,UNO_QUERY); - if ( xSup.is() ) - xNames = xSup->getFormDocuments(); - } - else - { - Reference<XReportDocumentsSupplier> xSup(m_xModel,UNO_QUERY); - if ( xSup.is() ) - xNames = xSup->getReportDocuments(); - } - - if ( xNames.is() && m_sBookmarkName.getLength() ) - { - ::rtl::OUString sServiceName(SERVICE_SDB_DOCUMENTDEFINITION); - Sequence< Any > aArguments(3); - PropertyValue aValue; - // set as folder - aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")); - aValue.Value <<= m_sBookmarkName; - aArguments[0] <<= aValue; - //parent - aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Parent")); - aValue.Value <<= xNames; - aArguments[1] <<= aValue; - - aValue.Name = PROPERTY_URL; - aValue.Value <<= m_sDocumentLocation; - aArguments[2] <<= aValue; - - Reference<XMultiServiceFactory> xORB(xNames,UNO_QUERY); - if ( xORB.is() ) - { - Reference<XInterface> xComponent = xORB->createInstanceWithArguments(SERVICE_SDB_DOCUMENTDEFINITION,aArguments); - Reference<XNameContainer> xNameContainer(xNames,UNO_QUERY); - if ( xNameContainer.is() ) - xNameContainer->insertByName(m_sBookmarkName,makeAny(xComponent)); - } - } - } - catch(Exception&) - { - OSL_ENSURE(0,"convertLinks: Exception catched!"); - } - m_sBookmarkName = ::rtl::OUString(); - m_sDocumentLocation = ::rtl::OUString(); - break; - case COLUMN: - if ( m_xCurrentColumn.is() ) - { - setProperties(nElementType); - Reference<XColumnsSupplier> xSupplier(m_xCurrentObject,UNO_QUERY); - Reference<XAppend> xAppend(xSupplier->getColumns(),UNO_QUERY); - if ( xAppend.is() ) - xAppend->appendByDescriptor(m_xCurrentColumn); - m_xCurrentColumn = NULL; - } - break; - } - } -} -// ----------------------------------------------------------------------------- - -void SAL_CALL OCfgImport::dropNode( - const ::rtl::OUString& /*aName*/ ) - throw( - MalformedDataException, - WrappedTargetException ) -{ -} -// ----------------------------------------------------------------------------- - -void SAL_CALL OCfgImport::overrideProperty( - const ::rtl::OUString& aName, - sal_Int16 /*aAttributes*/, - const Type& /*aType*/, - sal_Bool /*bClear*/ ) - throw( - MalformedDataException, - WrappedTargetException ) -{ - m_bPropertyMayBeVoid = sal_True; - if ( !m_aStack.empty() ) - { - switch(m_aStack.top().second) - { - case DATASOURCE: - { - m_bPropertyMayBeVoid = sal_False; - ::rtl::OUString sProp; - if ( aName == CONFIGKEY_DBLINK_CONNECTURL ) - sProp = PROPERTY_URL; - else if ( aName == CONFIGKEY_DBLINK_USER ) - sProp = PROPERTY_USER; - else if ( aName == CONFIGKEY_DBLINK_TABLEFILTER ) - sProp = PROPERTY_TABLEFILTER; - else if ( aName == CONFIGKEY_DBLINK_TABLETYEFILTER ) - sProp = PROPERTY_TABLETYPEFILTER; - else if ( aName == CONFIGKEY_DBLINK_PASSWORDREQUIRED ) - sProp = PROPERTY_ISPASSWORDREQUIRED; - else if ( aName == CONFIGKEY_DBLINK_SUPPRESSVERSIONCL ) - sProp = PROPERTY_SUPPRESSVERSIONCL; - else if ( aName == CONFIGKEY_LAYOUTINFORMATION ) - sProp = PROPERTY_LAYOUTINFORMATION; - - if ( sProp.getLength() ) - { - if ( m_aProperties.find(m_aStack.top().second) == m_aProperties.end() ) - m_aProperties.insert(::std::map< sal_Int16 ,Sequence< ::rtl::OUString> >::value_type(m_aStack.top().second,Sequence< ::rtl::OUString>())); - sal_Int32 nPos = m_aProperties[m_aStack.top().second].getLength(); - m_aProperties[m_aStack.top().second].realloc(nPos+1); - m_aProperties[m_aStack.top().second][nPos] = sProp; - } - else if ( aName == CONFIGKEY_DBLINK_LOGINTIMEOUT ) - m_aStack.push(TElementStack::value_type(aName,LOGINTIMEOUT)); - else - m_aStack.push(TElementStack::value_type(aName,NO_PROP)); - } - break; - case QUERY: - { - m_bPropertyMayBeVoid = sal_False; - ::rtl::OUString sProp; - if ( aName == CONFIGKEY_QRYDESCR_COMMAND ) - sProp = PROPERTY_COMMAND; - else if ( aName == CONFIGKEY_QRYDESCR_ESCAPE_PROCESSING ) - sProp = PROPERTY_ESCAPE_PROCESSING; - else if ( aName == CONFIGKEY_QRYDESCR_UPDATE_TABLENAME ) - sProp = PROPERTY_UPDATE_TABLENAME; - else if ( aName == CONFIGKEY_QRYDESCR_UPDATE_SCHEMANAME ) - sProp = PROPERTY_UPDATE_SCHEMANAME; - else if ( aName == CONFIGKEY_QRYDESCR_UPDATE_CATALOGNAME ) - sProp = PROPERTY_UPDATE_CATALOGNAME; - else if ( aName == CONFIGKEY_LAYOUTINFORMATION ) - sProp = PROPERTY_LAYOUTINFORMATION; - - if ( sProp.getLength() ) - { - if ( m_aProperties.find(m_aStack.top().second) == m_aProperties.end() ) - m_aProperties.insert(::std::map< sal_Int16 ,Sequence< ::rtl::OUString> >::value_type(m_aStack.top().second,Sequence< ::rtl::OUString>())); - sal_Int32 nPos = m_aProperties[m_aStack.top().second].getLength(); - m_aProperties[m_aStack.top().second].realloc(nPos+1); - m_aProperties[m_aStack.top().second][nPos] = sProp; - } - else - m_aStack.push(TElementStack::value_type(aName,NO_PROP)); - } - break; - case DATASETTINGS: - { - m_bPropertyMayBeVoid = sal_False; - ::rtl::OUString sProp; - if ( aName == CONFIGKEY_DEFSET_FILTER ) sProp = PROPERTY_FILTER; - else if ( aName == CONFIGKEY_DEFSET_FONT_NAME ) sProp = PROPERTY_FONTNAME; - else if ( aName == CONFIGKEY_DEFSET_ORDER ) sProp = PROPERTY_ORDER; - else if ( aName == CONFIGKEY_DEFSET_APPLYFILTER ) sProp = PROPERTY_APPLYFILTER; - else if ( aName == CONFIGKEY_DEFSET_ROW_HEIGHT ) { m_bPropertyMayBeVoid = true; sProp = PROPERTY_ROW_HEIGHT; } - else if ( aName == CONFIGKEY_DEFSET_TEXTCOLOR ) { m_bPropertyMayBeVoid = true; sProp = PROPERTY_TEXTCOLOR; } - else if ( aName == CONFIGKEY_DEFSET_FONT_UNDERLINECOLOR ) { m_bPropertyMayBeVoid = true; sProp = PROPERTY_TEXTLINECOLOR; } - else if ( aName == CONFIGKEY_DEFSET_FONT_CHARACTEREMPHASIS ) sProp = PROPERTY_TEXTEMPHASIS; - else if ( aName == CONFIGKEY_DEFSET_FONT_CHARACTERRELIEF ) sProp = PROPERTY_TEXTRELIEF; - // font - else if ( aName == CONFIGKEY_DEFSET_FONT_HEIGHT ) sProp = PROPERTY_FONTHEIGHT; - else if ( aName == CONFIGKEY_DEFSET_FONT_WIDTH ) sProp = PROPERTY_FONTWIDTH; - else if ( aName == CONFIGKEY_DEFSET_FONT_STYLENAME ) sProp = PROPERTY_FONTSTYLENAME; - else if ( aName == CONFIGKEY_DEFSET_FONT_FAMILY ) sProp = PROPERTY_FONTFAMILY; - else if ( aName == CONFIGKEY_DEFSET_FONT_CHARSET ) sProp = PROPERTY_FONTCHARSET; - else if ( aName == CONFIGKEY_DEFSET_FONT_PITCH ) sProp = PROPERTY_FONTPITCH; - else if ( aName == CONFIGKEY_DEFSET_FONT_CHARACTERWIDTH ) sProp = PROPERTY_FONTCHARWIDTH; - else if ( aName == CONFIGKEY_DEFSET_FONT_WEIGHT ) sProp = PROPERTY_FONTWEIGHT; - else if ( aName == CONFIGKEY_DEFSET_FONT_UNDERLINE ) sProp = PROPERTY_FONTUNDERLINE; - else if ( aName == CONFIGKEY_DEFSET_FONT_STRIKEOUT ) sProp = PROPERTY_FONTSTRIKEOUT; - else if ( aName == CONFIGKEY_DEFSET_FONT_ORIENTATION ) sProp = PROPERTY_FONTORIENTATION; - else if ( aName == CONFIGKEY_DEFSET_FONT_KERNING ) sProp = PROPERTY_FONTKERNING; - else if ( aName == CONFIGKEY_DEFSET_FONT_WORDLINEMODE ) sProp = PROPERTY_FONTWORDLINEMODE; - else if ( aName == CONFIGKEY_DEFSET_FONT_TYPE ) sProp = PROPERTY_FONTTYPE; - else if ( aName == CONFIGKEY_DEFSET_FONT_SLANT ) sProp = PROPERTY_FONTSLANT; - - if ( sProp.getLength() ) - { - if ( m_aProperties.find(m_aStack.top().second) == m_aProperties.end() ) - m_aProperties.insert(::std::map< sal_Int16 ,Sequence< ::rtl::OUString> >::value_type(m_aStack.top().second,Sequence< ::rtl::OUString>())); - sal_Int32 nPos = m_aProperties[m_aStack.top().second].getLength(); - m_aProperties[m_aStack.top().second].realloc(nPos+1); - m_aProperties[m_aStack.top().second][nPos] = sProp; - } - else - m_aStack.push(TElementStack::value_type(aName,NO_PROP)); - } - break; - case COLUMN: - { - ::rtl::OUString sProp; - m_bPropertyMayBeVoid = sal_False; - if ( aName == CONFIGKEY_COLUMN_ALIGNMENT ) { - m_bPropertyMayBeVoid = true; - sProp = PROPERTY_ALIGN; - } else if ( aName == CONFIGKEY_COLUMN_WIDTH ) { - m_bPropertyMayBeVoid = true; - sProp = PROPERTY_WIDTH; - } else if ( aName == CONFIGKEY_COLUMN_RELPOSITION ) { - m_bPropertyMayBeVoid = true; - sProp = PROPERTY_RELATIVEPOSITION; - } else if ( aName == CONFIGKEY_COLUMN_HIDDEN ) { - sProp = PROPERTY_HIDDEN; - } else if ( aName == CONFIGKEY_COLUMN_HELPTEXT ) { - m_bPropertyMayBeVoid = true; - sProp = PROPERTY_HELPTEXT; - } else if ( aName == CONFIGKEY_COLUMN_CONTROLDEFAULT ) { - m_bPropertyMayBeVoid = true; - sProp = PROPERTY_CONTROLDEFAULT; - } else if ( aName == CONFIGKEY_COLUMN_NUMBERFORMAT ) { - m_bPropertyMayBeVoid = true; - sProp = PROPERTY_NUMBERFORMAT; - } - - - if ( sProp.getLength() ) - { - if ( m_aProperties.find(m_aStack.top().second) == m_aProperties.end() ) - m_aProperties.insert(::std::map< sal_Int16 ,Sequence< ::rtl::OUString> >::value_type(m_aStack.top().second,Sequence< ::rtl::OUString>())); - sal_Int32 nPos = m_aProperties[m_aStack.top().second].getLength(); - m_aProperties[m_aStack.top().second].realloc(nPos+1); - m_aProperties[m_aStack.top().second][nPos] = sProp; - } - else - m_aStack.push(TElementStack::value_type(aName,NO_PROP)); - } - break; - case BOOKMARK: - break; - } - } -} -// ----------------------------------------------------------------------------- - -void SAL_CALL OCfgImport::setPropertyValue( - const Any& aValue ) - throw( - MalformedDataException, - WrappedTargetException ) -{ - if ( !m_aStack.empty() ) - { - switch(m_aStack.top().second) - { - case LOGINTIMEOUT: - { - Reference< ::com::sun::star::sdbc::XDataSource> xDataSource(m_xCurrentDS,UNO_QUERY); - sal_Int32 nTimeOut = 0; - aValue >>= nTimeOut; - if ( xDataSource.is() && nTimeOut >= 0 ) - xDataSource->setLoginTimeout(nTimeOut); - m_aStack.pop(); - } - break; - case DATASOURCESETTING: - OSL_ENSURE(!m_aDataSourceSettings.empty(),"Settings are emtpy!"); - if ( aValue.hasValue() ) - m_aDataSourceSettings.rbegin()->Value = aValue; - else - m_aDataSourceSettings.pop_back(); - break; - case BOOKMARK: - aValue >>= m_sDocumentLocation; - break; - case NO_PROP: - m_aStack.pop(); - break; - default: - OSL_ENSURE(m_aProperties[m_aStack.top().second].getLength(),"Properties are zero!"); - if ( m_aProperties[m_aStack.top().second].getLength() ) - { - if ( m_aProperties[m_aStack.top().second][m_aProperties[m_aStack.top().second].getLength()-1] != PROPERTY_LAYOUTINFORMATION ) - { - if ( !m_bPropertyMayBeVoid && !aValue.hasValue() ) - { - m_aProperties[m_aStack.top().second].realloc(m_aProperties[m_aStack.top().second].getLength()-1); - } - else - { - if ( m_aValues.find(m_aStack.top().second) == m_aValues.end() ) - m_aValues.insert(::std::map< sal_Int16 ,Sequence< Any> >::value_type(m_aStack.top().second,Sequence< Any>())); - sal_Int32 nPos = m_aValues[m_aStack.top().second].getLength(); - m_aValues[m_aStack.top().second].realloc(nPos+1); - m_aValues[m_aStack.top().second][nPos] = aValue; - } - } - else - { - try - { - Sequence< sal_Int8 > aInputSequence; - aValue >>= aInputSequence; - if ( m_aValues.find(m_aStack.top().second) == m_aValues.end() ) - m_aValues.insert(::std::map< sal_Int16 ,Sequence< Any> >::value_type(m_aStack.top().second,Sequence< Any>())); - sal_Int32 nPos = m_aValues[m_aStack.top().second].getLength(); - m_aValues[m_aStack.top().second].realloc(nPos+1); - Sequence< PropertyValue > aLayout; - if ( aInputSequence.getLength() ) - { - Reference< XInputStream> xInStreamHelper = new SequenceInputStream(aInputSequence);; // used for wrapping sequence to xinput - Reference< XObjectInputStream> xInStream = Reference< XObjectInputStream >(m_xORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.ObjectInputStream"))),UNO_QUERY); - Reference< XInputStream> xMarkInStream = Reference< XInputStream >(m_xORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.MarkableInputStream"))),UNO_QUERY); - Reference< XActiveDataSink >(xMarkInStream,UNO_QUERY)->setInputStream(xInStreamHelper); - Reference< XActiveDataSink > xInDataSource(xInStream, UNO_QUERY); - OSL_ENSURE(xInDataSource.is(),"Couldn't create com.sun.star.io.ObjectInputStream!"); - xInDataSource->setInputStream(xMarkInStream); - - if ( DATASOURCE == m_aStack.top().second ) - LoadTableWindows(xInStream,aLayout); - else if ( QUERY == m_aStack.top().second ) - LoadTableFields(xInStream,aLayout); - } - m_aValues[m_aStack.top().second][nPos] <<= aLayout; - } - catch(const Exception& e) - { - throw WrappedTargetException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property could not be set.")),*this,makeAny(e)); - } - } - } - break; - } - } -} -// ----------------------------------------------------------------------------- - -void SAL_CALL OCfgImport::setPropertyValueForLocale( - const Any& /*aValue*/, - const ::rtl::OUString& /*aLocale*/ ) - throw( - MalformedDataException, - WrappedTargetException ) -{ -} -// ----------------------------------------------------------------------------- - -void SAL_CALL OCfgImport::endProperty() - throw( - MalformedDataException, - WrappedTargetException ) -{ -} -// ----------------------------------------------------------------------------- - -void SAL_CALL OCfgImport::addProperty( - const rtl::OUString& /*aName*/, - sal_Int16 /*aAttributes*/, - const Type& /*aType*/ ) - throw( - MalformedDataException, - WrappedTargetException ) -{ -} -// ----------------------------------------------------------------------------- - -void SAL_CALL OCfgImport::addPropertyWithValue( - const rtl::OUString& /*aName*/, - sal_Int16 /*aAttributes*/, - const Any& /*aValue*/ ) - throw( - MalformedDataException, - WrappedTargetException ) -{ -} -// ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- -// }// dbacfg -// ----------------------------------------------------------------------------- - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/filter/migration/cfgimport.hxx b/dbaccess/source/filter/migration/cfgimport.hxx deleted file mode 100644 index dc558731e..000000000 --- a/dbaccess/source/filter/migration/cfgimport.hxx +++ /dev/null @@ -1,202 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef CFG_CFGIMPORT_HXX -#define CFG_CFGIMPORT_HXX - -#include <com/sun/star/lang/XInitialization.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/frame/XModel.hpp> -#include <com/sun/star/task/XJob.hpp> -#include <osl/diagnose.h> -#include "apitools.hxx" -#include <comphelper/stl_types.hxx> -#include <cppuhelper/implbase4.hxx> -#include <com/sun/star/configuration/backend/XLayerHandler.hpp> -#include <com/sun/star/configuration/backend/XLayer.hpp> - -#include <memory> -#include <stack> - -namespace dbacfg -{ -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::frame; - -typedef ::cppu::WeakImplHelper4 < ::com::sun::star::lang::XServiceInfo - , ::com::sun::star::lang::XInitialization - , ::com::sun::star::task::XJob - , ::com::sun::star::configuration::backend::XLayerHandler - > OCfgImport_COMPBASE; -// ------------- -// - OCfgImport - -// ------------- -class OCfgImport : public OCfgImport_COMPBASE -{ -private: - typedef ::std::pair< ::rtl::OUString, sal_Int16> TElementType; - typedef ::std::stack< TElementType > TElementStack; - typedef ::std::vector< PropertyValue > TDataSourceSettings; - - Reference< XMultiServiceFactory > m_xORB; - Reference< XMultiServiceFactory > m_xOldORB; - Reference< ::com::sun::star::configuration::backend::XLayer> m_xLayer; - Reference<XPropertySet> m_xCurrentDS; - Reference<XModel> m_xModel; - Reference<XPropertySet> m_xCurrentObject; /// can either be a query or a table - Reference<XPropertySet> m_xCurrentColumn; - ::std::map< sal_Int16 ,Sequence< ::rtl::OUString> > m_aProperties; - ::std::map< sal_Int16 ,Sequence< Any> > m_aValues; - ::rtl::OUString m_sCurrentDataSourceName; - ::rtl::OUString m_sBookmarkName; - ::rtl::OUString m_sDocumentLocation; - - TElementStack m_aStack; - TDataSourceSettings m_aDataSourceSettings; - sal_Bool m_bPropertyMayBeVoid; - - /** convert the old configuration settings into new database documents. - */ - void convert(); - void createDataSource(const ::rtl::OUString& _sName); - void createObject(sal_Bool _bQuery ,const ::rtl::OUString& _sName); - void setProperties(sal_Int16 _eType); - -protected: - virtual ~OCfgImport() throw(); -public: - - OCfgImport( const Reference< XMultiServiceFactory >& _rxMSF ); - - - // XServiceInfo - DECLARE_SERVICE_INFO_STATIC( ); - - inline Reference< XMultiServiceFactory > getORB() const { return m_xORB; } - - // lang::XInitialization - virtual void SAL_CALL initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException); - // task::XJob - virtual ::com::sun::star::uno::Any SAL_CALL execute( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Arguments ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); - - // XLayerHandler - virtual void SAL_CALL startLayer() - throw(::com::sun::star::lang::WrappedTargetException); - - virtual void SAL_CALL endLayer() - throw( - ::com::sun::star::configuration::backend::MalformedDataException, - ::com::sun::star::lang::WrappedTargetException ); - - virtual void SAL_CALL overrideNode( - const rtl::OUString& aName, - sal_Int16 aAttributes, - sal_Bool bClear) - throw( - ::com::sun::star::configuration::backend::MalformedDataException, - ::com::sun::star::lang::WrappedTargetException ); - - virtual void SAL_CALL addOrReplaceNode( - const rtl::OUString& aName, - sal_Int16 aAttributes) - throw( - ::com::sun::star::configuration::backend::MalformedDataException, - ::com::sun::star::lang::WrappedTargetException ); - - virtual void SAL_CALL addOrReplaceNodeFromTemplate( - const rtl::OUString& aName, - const ::com::sun::star::configuration::backend::TemplateIdentifier& aTemplate, - sal_Int16 aAttributes ) - throw( - ::com::sun::star::configuration::backend::MalformedDataException, - ::com::sun::star::lang::WrappedTargetException ); - - virtual void SAL_CALL endNode() - throw( - ::com::sun::star::configuration::backend::MalformedDataException, - ::com::sun::star::lang::WrappedTargetException ); - - virtual void SAL_CALL dropNode( - const rtl::OUString& aName ) - throw( - ::com::sun::star::configuration::backend::MalformedDataException, - ::com::sun::star::lang::WrappedTargetException ); - - virtual void SAL_CALL overrideProperty( - const rtl::OUString& aName, - sal_Int16 aAttributes, - const Type& aType, - sal_Bool bClear ) - throw( - ::com::sun::star::configuration::backend::MalformedDataException, - ::com::sun::star::lang::WrappedTargetException ); - - virtual void SAL_CALL setPropertyValue( - const Any& aValue ) - throw( - ::com::sun::star::configuration::backend::MalformedDataException, - ::com::sun::star::lang::WrappedTargetException ); - - virtual void SAL_CALL setPropertyValueForLocale( - const Any& aValue, - const rtl::OUString& aLocale ) - throw( - ::com::sun::star::configuration::backend::MalformedDataException, - ::com::sun::star::lang::WrappedTargetException ); - - virtual void SAL_CALL endProperty() - throw( - ::com::sun::star::configuration::backend::MalformedDataException, - ::com::sun::star::lang::WrappedTargetException ); - - virtual void SAL_CALL addProperty( - const rtl::OUString& aName, - sal_Int16 aAttributes, - const Type& aType ) - throw( - ::com::sun::star::configuration::backend::MalformedDataException, - ::com::sun::star::lang::WrappedTargetException ); - - virtual void SAL_CALL addPropertyWithValue( - const rtl::OUString& aName, - sal_Int16 aAttributes, - const Any& aValue ) - throw( - ::com::sun::star::configuration::backend::MalformedDataException, - ::com::sun::star::lang::WrappedTargetException ); -}; -// ----------------------------------------------------------------------------- -} // dbacfg -// ----------------------------------------------------------------------------- -#endif // CFG_CFGIMPORT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/filter/migration/cfgservices.cxx b/dbaccess/source/filter/migration/cfgservices.cxx deleted file mode 100644 index a2591ff70..000000000 --- a/dbaccess/source/filter/migration/cfgservices.cxx +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_dbaccess.hxx" - -#include <cppuhelper/factory.hxx> -#include <osl/diagnose.h> -#include "cfg_reghelper.hxx" - - -/********************************************************************************************/ - -using namespace ::dbacfg; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::registry; - -//*************************************************************************************** -// -// registry functions -extern "C" void SAL_CALL createRegistryInfo_OCfgImport(); - -//*************************************************************************************** -extern "C" void SAL_CALL createRegistryInfo_dbacfg() -{ - static sal_Bool bInit = sal_False; - if (!bInit) - { - createRegistryInfo_OCfgImport(); - bInit = sal_True; - } -} - -//--------------------------------------------------------------------------------------- - -extern "C" void SAL_CALL component_getImplementationEnvironment( - const sal_Char **ppEnvTypeName, - uno_Environment ** - ) -{ - createRegistryInfo_dbacfg(); - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -//--------------------------------------------------------------------------------------- -extern "C" sal_Bool SAL_CALL component_writeInfo( - void* pServiceManager, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - return ::dbacfg::OModuleRegistration::writeComponentInfos( - static_cast<XMultiServiceFactory*>(pServiceManager), - static_cast<XRegistryKey*>(pRegistryKey)); - } - catch (InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "DBA::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - -//--------------------------------------------------------------------------------------- -extern "C" void* SAL_CALL component_getFactory( - const sal_Char* pImplementationName, - void* pServiceManager, - void* /*pRegistryKey*/) -{ - Reference< XInterface > xRet; - if (pServiceManager && pImplementationName) - { - xRet = ::dbacfg::OModuleRegistration::getComponentFactory( - ::rtl::OUString::createFromAscii(pImplementationName), - static_cast< XMultiServiceFactory* >(pServiceManager)); - } - - if (xRet.is()) - xRet->acquire(); - return xRet.get(); -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/filter/migration/makefile.mk b/dbaccess/source/filter/migration/makefile.mk deleted file mode 100644 index 9d4b95035..000000000 --- a/dbaccess/source/filter/migration/makefile.mk +++ /dev/null @@ -1,73 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/..$/.. -PRJINC=$(PRJ)$/source -PRJNAME=dbaccess -TARGET=dbacfg - -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ---------------------------------- - -.INCLUDE : settings.mk - -# --- Files ------------------------------------- - -SLOFILES= $(SLO)$/cfgimport.obj \ - $(SLO)$/cfgservices.obj - -# --- Library ----------------------------------- -LIB1TARGET=$(SLB)$/dba_cfg.lib -LIB1FILES=\ - $(SLB)$/cfgshared.lib \ - $(SLB)$/$(TARGET).lib - -SHL1TARGET=$(TARGET)$(DLLPOSTFIX) - -SHL1STDLIBS=\ - $(UNOTOOLSLIB) \ - $(TOOLSLIB) \ - $(COMPHELPERLIB) \ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ - $(SFXLIB) \ - $(SVLLIB) \ - $(SALLIB) - - -SHL1DEPN= -SHL1LIBS=$(LIB1TARGET) -SHL1IMPLIB= i$(SHL1TARGET) -SHL1VERSIONMAP=$(SOLARENV)/src/component.map -SHL1DEF= $(MISC)$/$(SHL1TARGET).def - -DEF1NAME=$(SHL1TARGET) - -# --- Targets ---------------------------------- - -.INCLUDE : target.mk diff --git a/dbaccess/source/filter/xml/dbaxml.component b/dbaccess/source/filter/xml/dbaxml.component new file mode 100644 index 000000000..23b3a5c1a --- /dev/null +++ b/dbaccess/source/filter/xml/dbaxml.component @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.sdb.DBExportFilter"> + <service name="com.sun.star.document.ExportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.sdb.DBFilter"> + <service name="com.sun.star.document.ImportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.sdb.XMLFullExporter"> + <service name="com.sun.star.document.ExportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.sdb.XMLSettingsExporter"> + <service name="com.sun.star.document.ExportFilter"/> + </implementation> + <implementation name="org.openoffice.comp.dbflt.DBContentLoader2"> + <service name="com.sun.star.frame.FrameLoader"/> + </implementation> + <implementation name="org.openoffice.comp.dbflt.DBTypeDetection"> + <service name="com.sun.star.document.ExtendedTypeDetection"/> + </implementation> +</component> diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx index 7d1d2b0f1..9c7452d53 100644 --- a/dbaccess/source/filter/xml/dbloader2.cxx +++ b/dbaccess/source/filter/xml/dbloader2.cxx @@ -247,7 +247,7 @@ private: ::comphelper::ComponentContext m_aContext; Reference< XFrameLoader > m_xMySelf; ::rtl::OUString m_sCurrentURL; - ULONG m_nStartWizard; + sal_uLong m_nStartWizard; DECL_LINK( OnStartTableWizard, void* ); public: diff --git a/dbaccess/source/filter/xml/makefile.mk b/dbaccess/source/filter/xml/makefile.mk index 3f3b02195..33ff074b8 100644 --- a/dbaccess/source/filter/xml/makefile.mk +++ b/dbaccess/source/filter/xml/makefile.mk @@ -111,3 +111,11 @@ DEF1NAME=$(SHL1TARGET) # --- Targets ---------------------------------- .INCLUDE : target.mk + +ALLTAR : $(MISC)/dbaxml.component + +$(MISC)/dbaxml.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + dbaxml.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt dbaxml.component diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index c43b5a1b4..8f5dce5ed 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -1284,7 +1284,7 @@ void ODBExport::_ExportAutoStyles() } } // ----------------------------------------------------------------------------- -void ODBExport::_ExportStyles(BOOL bUsed) +void ODBExport::_ExportStyles(sal_Bool bUsed) { SvXMLExport::_ExportStyles(bUsed); } diff --git a/dbaccess/source/filter/xml/xmlExport.hxx b/dbaccess/source/filter/xml/xmlExport.hxx index 279ebc345..ae27e2349 100644 --- a/dbaccess/source/filter/xml/xmlExport.hxx +++ b/dbaccess/source/filter/xml/xmlExport.hxx @@ -169,7 +169,7 @@ private: ODBExport(); protected: - virtual void _ExportStyles( BOOL bUsed ); + virtual void _ExportStyles( sal_Bool bUsed ); virtual void _ExportAutoStyles(); virtual void _ExportContent(); virtual void _ExportMasterStyles(); diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index 3c0c66d33..cff4e1a99 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -451,7 +451,7 @@ sal_Bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) uno::Reference<XComponent> xCom(GetModel(),UNO_QUERY); SfxMediumRef pMedium = new SfxMedium( - sFileName, ( STREAM_READ | STREAM_NOCREATE ), FALSE, 0 ); + sFileName, ( STREAM_READ | STREAM_NOCREATE ), sal_False, 0 ); uno::Reference< embed::XStorage > xStorage; try { diff --git a/dbaccess/source/filter/xml/xmlservices.cxx b/dbaccess/source/filter/xml/xmlservices.cxx index 8836532b9..76ddf139e 100644 --- a/dbaccess/source/filter/xml/xmlservices.cxx +++ b/dbaccess/source/filter/xml/xmlservices.cxx @@ -79,28 +79,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( } //--------------------------------------------------------------------------------------- -extern "C" sal_Bool SAL_CALL component_writeInfo( - void* pServiceManager, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - writeDBLoaderInfo2(pRegistryKey); - return ::dbaxml::OModuleRegistration::writeComponentInfos( - static_cast<XMultiServiceFactory*>(pServiceManager), - static_cast<XRegistryKey*>(pRegistryKey)); - } - catch (InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "DBA::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - -//--------------------------------------------------------------------------------------- extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, diff --git a/dbaccess/source/inc/cfg_reghelper.hxx b/dbaccess/source/inc/cfg_reghelper.hxx deleted file mode 100644 index 51fef4ea2..000000000 --- a/dbaccess/source/inc/cfg_reghelper.hxx +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef CFG_REGHELPER_HXX -#define CFG_REGHELPER_HXX - -#include <com/sun/star/uno/Sequence.hxx> -#include <com/sun/star/registry/XRegistryKey.hpp> -#include <com/sun/star/lang/XSingleServiceFactory.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <rtl/ustring.hxx> -#include <cppuhelper/factory.hxx> - -namespace dbacfg -{ - - #define _REGISTRATIONHELPER_INCLUDED_INDIRECTLY_ - #include "registrationhelper.hxx" - #undef _REGISTRATIONHELPER_INCLUDED_INDIRECTLY_ - -} - -#endif // CFG_REGHELPER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/inc/cfgstrings.hrc b/dbaccess/source/inc/cfgstrings.hrc deleted file mode 100644 index 5364dca5a..000000000 --- a/dbaccess/source/inc/cfgstrings.hrc +++ /dev/null @@ -1,99 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef DBACCESS_SHARED_CFGSTRINGS_HRC -#define DBACCESS_SHARED_CFGSTRINGS_HRC - -#ifndef _RTL_USTRING_HXX_ -#include <rtl/ustring.hxx> -#endif - -namespace dbacfg -{ -#define STRINGCONSTANTS_INCLUDED_INDIRECT -#include "stringconstants.hrc" -#undef STRINGCONSTANTS_INCLUDED_INDIRECT - - //============================================================ - //= configuration key names - //============================================================ - // (we could use PROPERTY_* strings for this, but this would mean that - // our configuration scheme would change if a property name changes for - // any reason) - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_CONNECTURL); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_USER); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_TABLEFILTER); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_TABLETYEFILTER); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_LOGINTIMEOUT); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_PASSWORDREQUIRED); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_SUPPRESSVERSIONCL); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_BOOKMARKS); - - DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_COMMAND); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_ESCAPE_PROCESSING); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_TABLENAME); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_SCHEMANAME); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_CATALOGNAME); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_COLUMNS); - - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FILTER); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_APPLYFILTER); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_ORDER); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_ROW_HEIGHT); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_TEXTCOLOR); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_NAME); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_HEIGHT); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WIDTH); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_STYLENAME); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_FAMILY); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARSET); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_PITCH); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARACTERWIDTH); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WEIGHT); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_SLANT); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_UNDERLINE); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_STRIKEOUT); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_ORIENTATION); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_KERNING); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WORDLINEMODE); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_TYPE); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_UNDERLINECOLOR); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARACTEREMPHASIS); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARACTERRELIEF); - - DECLARE_CONSTASCII_USTRING(CONFIGKEY_SETTINGS); - - DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_ALIGNMENT); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_WIDTH); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_NUMBERFORMAT); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_RELPOSITION); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_HIDDEN); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_LAYOUTINFORMATION); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_HELPTEXT); - DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_CONTROLDEFAULT); -} - -#endif // DBACCESS_SHARED_CFGSTRINGS_HRC diff --git a/dbaccess/source/inc/registrationhelper.hxx b/dbaccess/source/inc/registrationhelper.hxx index f53e7da95..343e0ef71 100644 --- a/dbaccess/source/inc/registrationhelper.hxx +++ b/dbaccess/source/inc/registrationhelper.hxx @@ -74,16 +74,6 @@ public: static void revokeComponent( const ::rtl::OUString& _rImplementationName); - /** writes the registration information of all components which are currently registered into the specified registry. - Usually used from within component_writeInfo. - @param _rxServiceManager the service manager - @param _rRootKey the registry key under which the information will be stored - @return sal_True if the registration of all implementations was successfull, sal_False otherwise - */ - static sal_Bool writeComponentInfos( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceManager, - const ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey >& _rRootKey); - /** creates a Factory for the component with the given implementation name. Usually used from within component_getFactory. @param _rxServiceManager a pointer to an XMultiServiceFactory interface as got in component_getFactory @param _pImplementationName the implementation name of the component diff --git a/dbaccess/source/sdbtools/misc/sdbt_services.cxx b/dbaccess/source/sdbtools/misc/sdbt_services.cxx index f5f6651e9..9767bd190 100644 --- a/dbaccess/source/sdbtools/misc/sdbt_services.cxx +++ b/dbaccess/source/sdbtools/misc/sdbt_services.cxx @@ -65,27 +65,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( } //--------------------------------------------------------------------------------------- -extern "C" sal_Bool SAL_CALL component_writeInfo( - void* pServiceManager, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - return ::sdbtools::SdbtModule::getInstance().writeComponentInfos( - static_cast<XMultiServiceFactory*>(pServiceManager), - static_cast<XRegistryKey*>(pRegistryKey)); - } - catch (const InvalidRegistryException& ) - { - OSL_FAIL("sdbt::component_writeInfo: could not create a registry key (InvalidRegistryException) !"); - } - - return sal_False; -} - -//--------------------------------------------------------------------------------------- extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, diff --git a/dbaccess/source/shared/cfg_reghelper.cxx b/dbaccess/source/shared/cfg_reghelper.cxx deleted file mode 100644 index 5d88ab515..000000000 --- a/dbaccess/source/shared/cfg_reghelper.cxx +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_dbaccess.hxx" - -#include "cfg_reghelper.hxx" - -#include <osl/diagnose.h> -#include <comphelper/sequence.hxx> - -namespace dbacfg -{ - - #define _REGISTRATIONHELPER_CXX_INCLUDED_INDIRECTLY_ - #include "registrationhelper.cxx" - #undef _REGISTRATIONHELPER_CXX_INCLUDED_INDIRECTLY_ - -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/shared/cfgstrings.cxx b/dbaccess/source/shared/cfgstrings.cxx deleted file mode 100644 index b13623ed3..000000000 --- a/dbaccess/source/shared/cfgstrings.cxx +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_dbaccess.hxx" -#include "cfgstrings.hrc" - -namespace dbacfg -{ -#include "stringconstants.inc" - - //============================================================ - //= configuration key names - //============================================================ - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_CONNECTURL, "URL"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_USER, "User"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_TABLEFILTER, "TableFilter"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_TABLETYEFILTER, "TableTypeFilter"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_LOGINTIMEOUT, "LoginTimeout"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_PASSWORDREQUIRED, "IsPasswordRequired"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_SUPPRESSVERSIONCL, "SuppressVersionColumns"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_BOOKMARKS, "Bookmarks"); - - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_COMMAND, "Command"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_ESCAPE_PROCESSING, "EscapeProcessing"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_TABLENAME, "UpdateTableName"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_SCHEMANAME, "UpdateSchemaName"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_CATALOGNAME, "UpdateCatalogName"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_COLUMNS, "Columns"); - - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_SETTINGS, "Settings"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FILTER, "Filter"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_APPLYFILTER, "ApplyFilter"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_ORDER, "Order"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_ROW_HEIGHT, "RowHeight"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_LAYOUTINFORMATION, "LayoutInformation"); - - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_TEXTCOLOR, "TextColor"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_NAME, "Font/Name"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_HEIGHT, "Font/Height"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WIDTH, "Font/Width"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_STYLENAME, "Font/StyleName"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_FAMILY, "Font/Family"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARSET, "Font/CharSet"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_PITCH, "Font/Pitch"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARACTERWIDTH, "Font/CharacterWidth"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WEIGHT, "Font/Weight"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_SLANT, "Font/Slant"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_UNDERLINE, "Font/UnderLine"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_STRIKEOUT, "Font/Strikeout"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_ORIENTATION, "Font/Orientation"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_KERNING, "Font/Kerning"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WORDLINEMODE, "Font/WordLineMode"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_TYPE, "Font/Type"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_UNDERLINECOLOR, "TextLineColor"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARACTEREMPHASIS, "CharacterEmphasis"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARACTERRELIEF, "CharacterRelief"); - - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_ALIGNMENT, "Align"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_WIDTH, "Width"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_NUMBERFORMAT, "FormatKey"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_RELPOSITION, "Position"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_HIDDEN, "Hidden"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_HELPTEXT, "HelpText"); - IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_CONTROLDEFAULT, "ControlDefault"); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/shared/makefile.mk b/dbaccess/source/shared/makefile.mk index ff40184d8..7906623eb 100644 --- a/dbaccess/source/shared/makefile.mk +++ b/dbaccess/source/shared/makefile.mk @@ -32,7 +32,6 @@ LIBTARGET=NO TARGET=shared LIB1TARGET=$(SLB)$/dbushared.lib LIB2TARGET=$(SLB)$/fltshared.lib -LIB3TARGET=$(SLB)$/cfgshared.lib LIB4TARGET=$(SLB)$/sdbtshared.lib # --- Settings ---------------------------------- @@ -44,12 +43,10 @@ LIB4TARGET=$(SLB)$/sdbtshared.lib # --- Files ------------------------------------- EXCEPTIONSFILES= \ $(SLO)$/dbu_reghelper.obj \ - $(SLO)$/cfg_reghelper.obj \ $(SLO)$/flt_reghelper.obj SLOFILES= \ $(EXCEPTIONSFILES) \ - $(SLO)$/cfgstrings.obj \ $(SLO)$/xmlstrings.obj \ $(SLO)$/dbustrings.obj @@ -61,10 +58,6 @@ LIB2OBJFILES= \ $(SLO)$/flt_reghelper.obj \ $(SLO)$/xmlstrings.obj -LIB3OBJFILES= \ - $(SLO)$/cfg_reghelper.obj \ - $(SLO)$/cfgstrings.obj - LIB4OBJFILES= \ $(SLO)$/sdbtstrings.obj diff --git a/dbaccess/source/shared/registrationhelper.cxx b/dbaccess/source/shared/registrationhelper.cxx index 67717440c..289ea3b55 100644 --- a/dbaccess/source/shared/registrationhelper.cxx +++ b/dbaccess/source/shared/registrationhelper.cxx @@ -117,54 +117,6 @@ void OModuleRegistration::revokeComponent(const ::rtl::OUString& _rImplementatio } //-------------------------------------------------------------------------- -sal_Bool OModuleRegistration::writeComponentInfos( - const uno::Reference< lang::XMultiServiceFactory >& /*_rxServiceManager*/, - const uno::Reference< registry::XRegistryKey >& _rxRootKey) -{ - OSL_ENSURE(_rxRootKey.is(), "OModuleRegistration::writeComponentInfos : invalid argument !"); - - if (!s_pImplementationNames) - { - OSL_ENSURE(sal_False, "OModuleRegistration::writeComponentInfos : have no class infos ! Are you sure called this method at the right time ?"); - return sal_True; - } - OSL_ENSURE(s_pImplementationNames && s_pSupportedServices && s_pCreationFunctionPointers && s_pFactoryFunctionPointers, - "OModuleRegistration::writeComponentInfos : 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::writeComponentInfos : inconsistent state !"); - - sal_Int32 nLen = s_pImplementationNames->getLength(); - const ::rtl::OUString* pImplName = s_pImplementationNames->getConstArray(); - const uno::Sequence< ::rtl::OUString >* pServices = s_pSupportedServices->getConstArray(); - - ::rtl::OUString sRootKey("/", 1, RTL_TEXTENCODING_ASCII_US); - for (sal_Int32 i=0; i<nLen; ++i, ++pImplName, ++pServices) - { - ::rtl::OUString aMainKeyName(sRootKey); - aMainKeyName += *pImplName; - aMainKeyName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - - try - { - uno::Reference< registry::XRegistryKey > xNewKey( _rxRootKey->createKey(aMainKeyName) ); - - const ::rtl::OUString* pService = pServices->getConstArray(); - for (sal_Int32 j=0; j<pServices->getLength(); ++j, ++pService) - xNewKey->createKey(*pService); - } - catch(uno::Exception const&) - { - OSL_ENSURE(sal_False, "OModuleRegistration::writeComponentInfos : something went wrong while creating the keys !"); - return sal_False; - } - } - - return sal_True; -} - -//-------------------------------------------------------------------------- uno::Reference< uno::XInterface > OModuleRegistration::getComponentFactory( const ::rtl::OUString& _rImplementationName, const uno::Reference< lang::XMultiServiceFactory >& _rxServiceManager) diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 98434e0f2..f5819a232 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -483,10 +483,6 @@ sal_Bool OApplicationController::Construct(Window* _pParent) return sal_False; } - OSL_ENSURE( getView(), "OApplicationController::Construct: have no view!" ); - if ( getView() ) - getView()->enableSeparator( ); - // now that we have a view we can create the clipboard listener m_aSystemClipboard = TransferableDataHelper::CreateFromSystemClipboard( getView() ); m_aSystemClipboard.StartClipboardListening( ); diff --git a/dbaccess/source/ui/app/AppController.hxx b/dbaccess/source/ui/app/AppController.hxx index a56989731..a29213f6a 100644 --- a/dbaccess/source/ui/app/AppController.hxx +++ b/dbaccess/source/ui/app/AppController.hxx @@ -128,7 +128,7 @@ namespace dbaui OTableCopyHelper m_aTableCopyHelper; TransferableClipboardListener* m_pClipbordNotifier; // notifier for changes in the clipboard - ULONG m_nAsyncDrop; + sal_uLong m_nAsyncDrop; OAsyncronousLink m_aControllerConnectedEvent; OAsyncronousLink m_aSelectContainerEvent; PreviewMode m_ePreviewMode; // the mode of the preview diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index 317647da2..83ca8572e 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -751,8 +751,8 @@ void OApplicationController::onLoadedMenu(const Reference< ::com::sun::star::fra MenuBar* pMenu = pSystemWindow ? pSystemWindow->GetMenuBar() : NULL; if ( pMenu ) { - USHORT nMenuItems = pMenu->GetItemCount(); - for ( USHORT i = 0; i < nMenuItems; ++i ) + sal_uInt16 nMenuItems = pMenu->GetItemCount(); + for ( sal_uInt16 i = 0; i < nMenuItems; ++i ) aMnemonicGenerator.RegisterMnemonic( pMenu->GetItemText( pMenu->GetItemId( i ) ) ); } // - the icons should use automatic ones diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 4cfce1d3a..1644305e2 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -139,7 +139,7 @@ namespace class OTablePreviewWindow : public Window { DECL_LINK(OnDisableInput, void*); - void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); protected: virtual void DataChanged(const DataChangedEvent& rDCEvt); public: @@ -162,7 +162,7 @@ namespace // ----------------------------------------------------------------------------- IMPL_LINK(OTablePreviewWindow, OnDisableInput, void*, EMPTYARG) { - EnableInput(FALSE); + EnableInput(sal_False); return 0L; } // ----------------------------------------------------------------------------- @@ -225,7 +225,7 @@ OAppDetailPageHelper::OAppDetailPageHelper(Window* _pParent,OAppBorderWindow& _r m_aTBPreview.SetHelpId(HID_APP_VIEW_PREVIEW_CB); m_aTBPreview.SetDropdownClickHdl( LINK( this, OAppDetailPageHelper, OnDropdownClickHdl ) ); m_aTBPreview.EnableMenuStrings(); - m_aTBPreview.Enable(TRUE); + m_aTBPreview.Enable(sal_True); m_aBorder.SetUniqueId(UID_APP_VIEW_PREVIEW_1); @@ -289,7 +289,7 @@ void OAppDetailPageHelper::selectAll() int nPos = getVisibleControlIndex(); if ( nPos < E_ELEMENT_TYPE_COUNT ) { - m_pLists[nPos]->SelectAll(TRUE); + m_pLists[nPos]->SelectAll(sal_True); } } // ----------------------------------------------------------------------------- @@ -453,7 +453,7 @@ void OAppDetailPageHelper::selectElements(const Sequence< ::rtl::OUString>& _aNa if ( nPos < E_ELEMENT_TYPE_COUNT ) { DBTreeListBox& rTree = *m_pLists[nPos]; - rTree.SelectAll(FALSE); + rTree.SelectAll(sal_False); const ::rtl::OUString* pIter = _aNames.getConstArray(); const ::rtl::OUString* pEnd = pIter + _aNames.getLength(); for(;pIter != pEnd;++pIter) @@ -602,7 +602,7 @@ SvLBoxEntry* OAppDetailPageHelper::getEntry( const Point& _aPosPixel) const SvLBoxEntry* pReturn = NULL; int nPos = getVisibleControlIndex(); if ( nPos < E_ELEMENT_TYPE_COUNT ) - pReturn = m_pLists[nPos]->GetEntry( _aPosPixel,TRUE ); + pReturn = m_pLists[nPos]->GetEntry( _aPosPixel,sal_True ); return pReturn; } // ----------------------------------------------------------------------------- @@ -634,14 +634,14 @@ void OAppDetailPageHelper::createTablesPage(const Reference< XConnection>& _xCon SvLBoxEntry* pEntry = m_pLists[E_TABLE]->First(); if ( pEntry ) m_pLists[E_TABLE]->Expand(pEntry); - m_pLists[E_TABLE]->SelectAll(FALSE); + m_pLists[E_TABLE]->SelectAll(sal_False); } setDetailPage(m_pLists[E_TABLE]); } // ----------------------------------------------------------------------------- -void OAppDetailPageHelper::getElementIcons( ElementType _eType, USHORT& _rImageId ) +void OAppDetailPageHelper::getElementIcons( ElementType _eType, sal_uInt16& _rImageId) { ImageProvider aImageProvider; _rImageId = 0; @@ -664,21 +664,22 @@ void OAppDetailPageHelper::createPage(ElementType _eType,const Reference< XNameA { OSL_ENSURE(E_TABLE != _eType,"E_TABLE isn't allowed."); - USHORT nHelpId = 0, nImageId = 0; + sal_uInt16 nImageId = 0; + rtl::OString sHelpId; ImageProvider aImageProvider; Image aFolderImage; switch( _eType ) { case E_FORM: - nHelpId = HID_APP_FORM_TREE; + sHelpId = HID_APP_FORM_TREE; aFolderImage = aImageProvider.getFolderImage( DatabaseObject::FORM ); break; case E_REPORT: - nHelpId = HID_APP_REPORT_TREE; + sHelpId = HID_APP_REPORT_TREE; aFolderImage = aImageProvider.getFolderImage( DatabaseObject::REPORT ); break; case E_QUERY: - nHelpId = HID_APP_QUERY_TREE; + sHelpId = HID_APP_QUERY_TREE; aFolderImage = aImageProvider.getFolderImage( DatabaseObject::QUERY ); break; default: @@ -688,7 +689,7 @@ void OAppDetailPageHelper::createPage(ElementType _eType,const Reference< XNameA if ( !m_pLists[_eType] ) { - m_pLists[_eType] = createSimpleTree( nHelpId, aFolderImage ); + m_pLists[_eType] = createSimpleTree( sHelpId, aFolderImage ); } if ( m_pLists[_eType] ) @@ -697,7 +698,7 @@ void OAppDetailPageHelper::createPage(ElementType _eType,const Reference< XNameA { fillNames( _xContainer, _eType, nImageId, NULL ); - m_pLists[_eType]->SelectAll(FALSE); + m_pLists[_eType]->SelectAll(sal_False); } setDetailPage(m_pLists[_eType]); } @@ -711,7 +712,7 @@ void OAppDetailPageHelper::setDetailPage(Window* _pWindow) pCurrent->Hide(); showPreview(NULL); - BOOL bHasFocus = FALSE; + sal_Bool bHasFocus = sal_False; m_aFL.Show(); { bHasFocus = pCurrent->HasChildPathFocus(); @@ -719,7 +720,7 @@ void OAppDetailPageHelper::setDetailPage(Window* _pWindow) } m_aTBPreview.Show(); m_aBorder.Show(); - switchPreview(m_ePreviewMode,TRUE); + switchPreview(m_ePreviewMode,sal_True); if ( bHasFocus ) _pWindow->GrabFocus(); @@ -743,7 +744,7 @@ namespace // ----------------------------------------------------------------------------- void OAppDetailPageHelper::fillNames( const Reference< XNameAccess >& _xContainer, const ElementType _eType, - const USHORT _nImageId, SvLBoxEntry* _pParent ) + const sal_uInt16 _nImageId, SvLBoxEntry* _pParent ) { OSL_ENSURE(_xContainer.is(),"Data source is NULL! -> GPF"); OSL_ENSURE( ( _eType >= E_TABLE ) && ( _eType < E_ELEMENT_TYPE_COUNT ), "OAppDetailPageHelper::fillNames: invalid type!" ); @@ -766,7 +767,7 @@ void OAppDetailPageHelper::fillNames( const Reference< XNameAccess >& _xContaine Reference<XNameAccess> xSubElements(_xContainer->getByName(*pIter),UNO_QUERY); if ( xSubElements.is() ) { - pEntry = pList->InsertEntry( *pIter, _pParent, FALSE, LIST_APPEND, reinterpret_cast< void* >( nFolderIndicator ) ); + pEntry = pList->InsertEntry( *pIter, _pParent, sal_False, LIST_APPEND, reinterpret_cast< void* >( nFolderIndicator ) ); getBorderWin().getView()->getAppController().containerFound( Reference< XContainer >( xSubElements, UNO_QUERY ) ); fillNames( xSubElements, _eType, _nImageId, pEntry ); } @@ -782,10 +783,10 @@ void OAppDetailPageHelper::fillNames( const Reference< XNameAccess >& _xContaine } } // ----------------------------------------------------------------------------- -DBTreeListBox* OAppDetailPageHelper::createSimpleTree( ULONG _nHelpId, const Image& _rImage ) +DBTreeListBox* OAppDetailPageHelper::createSimpleTree( const rtl::OString& _sHelpId, const Image& _rImage) { DBTreeListBox* pTreeView = new DBTreeListBox(this,getBorderWin().getView()->getORB(),WB_HASLINES | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT | WB_TABSTOP); - pTreeView->SetHelpId(_nHelpId); + pTreeView->SetHelpId( _sHelpId ); return createTree( pTreeView, _rImage ); } @@ -794,7 +795,7 @@ DBTreeListBox* OAppDetailPageHelper::createTree( DBTreeListBox* _pTreeView, cons { WaitObject aWaitCursor(this); - _pTreeView->SetWindowBits(WB_HASLINES | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT | WB_TABSTOP); + _pTreeView->SetStyle(_pTreeView->GetStyle() | WB_HASLINES | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT | WB_TABSTOP); _pTreeView->GetModel()->SetSortMode(SortAscending); _pTreeView->EnableCheckButton( NULL ); // do not show any buttons _pTreeView->SetSelectionMode(MULTIPLE_SELECTION); @@ -892,13 +893,13 @@ SvLBoxEntry* OAppDetailPageHelper::elementAdded(ElementType _eType,const ::rtl:: } } - USHORT nImageId = 0; + sal_uInt16 nImageId = 0; getElementIcons( _eType, nImageId ); Reference<XNameAccess> xContainer(_rObject,UNO_QUERY); if ( xContainer.is() ) { const sal_Int32 nFolderIndicator = lcl_getFolderIndicatorForType( _eType ); - pRet = pTreeView->InsertEntry( _rName, pEntry, FALSE, LIST_APPEND, reinterpret_cast< void* >( nFolderIndicator ) ); + pRet = pTreeView->InsertEntry( _rName, pEntry, sal_False, LIST_APPEND, reinterpret_cast< void* >( nFolderIndicator ) ); fillNames( xContainer, _eType, nImageId, pRet ); } else @@ -1029,7 +1030,7 @@ sal_Bool OAppDetailPageHelper::isPreviewEnabled() return m_ePreviewMode != E_PREVIEWNONE; } // ----------------------------------------------------------------------------- -void OAppDetailPageHelper::switchPreview(PreviewMode _eMode,BOOL _bForce) +void OAppDetailPageHelper::switchPreview(PreviewMode _eMode,sal_Bool _bForce) { if ( m_ePreviewMode != _eMode || _bForce ) { @@ -1254,7 +1255,7 @@ void OAppDetailPageHelper::KeyInput( const KeyEvent& rKEvt ) OSL_PRECOND( pCurrentView, "OAppDetailPageHelper::KeyInput: how this?" ); KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction(); (void)eFunc; - USHORT nCode = rKEvt.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); if ( ( KEY_RETURN == nCode ) && pCurrentView ) { @@ -1317,11 +1318,11 @@ OPreviewWindow::OPreviewWindow(Window* _pParent) ImplInitSettings( sal_True, sal_True, sal_True ); } // ----------------------------------------------------------------------------- -BOOL OPreviewWindow::ImplGetGraphicCenterRect( const Graphic& rGraphic, Rectangle& rResultRect ) const +sal_Bool OPreviewWindow::ImplGetGraphicCenterRect( const Graphic& rGraphic, Rectangle& rResultRect ) const { const Size aWinSize( GetOutputSizePixel() ); Size aNewSize( LogicToPixel( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode() ) ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( aNewSize.Width() && aNewSize.Height() ) { @@ -1344,7 +1345,7 @@ BOOL OPreviewWindow::ImplGetGraphicCenterRect( const Graphic& rGraphic, Rectangl ( aWinSize.Height() - aNewSize.Height() ) >> 1 ); rResultRect = Rectangle( aNewPos, aNewSize ); - bRet = TRUE; + bRet = sal_True; } return bRet; diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx index f52dc7b10..67c426cde 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx @@ -70,8 +70,8 @@ namespace dbaui @return <TRUE/> when successfull */ - BOOL ImplGetGraphicCenterRect( const Graphic& rGraphic, Rectangle& rResultRect ) const; - void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); + sal_Bool ImplGetGraphicCenterRect( const Graphic& rGraphic, Rectangle& rResultRect ) const; + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); protected: virtual void DataChanged(const DataChangedEvent& rDCEvt); public: @@ -119,7 +119,7 @@ namespace dbaui /** retrieves the resource ids of the images representing elements of the given type */ - void getElementIcons( ElementType _eType, USHORT& _rImageId ); + void getElementIcons( ElementType _eType, sal_uInt16& _rImageId); /** fills the names in the listbox @param _xContainer @@ -133,7 +133,7 @@ namespace dbaui */ void fillNames( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _xContainer, const ElementType _eType, - const USHORT _nImageId, + const sal_uInt16 _nImageId, SvLBoxEntry* _pParent ); /** sets the detail page @@ -160,7 +160,7 @@ namespace dbaui @return The new tree. */ - DBTreeListBox* createSimpleTree( ULONG _nHelpId, const Image& _rImage ); + DBTreeListBox* createSimpleTree( const rtl::OString& _sHelpId, const Image& _rImage); DECL_LINK( OnEntryDoubleClick, SvTreeListBox* ); DECL_LINK( OnEntrySelChange, void* ); @@ -344,7 +344,7 @@ namespace dbaui @param _bForce Force the preview to be resetted */ - void switchPreview(PreviewMode _eMode,BOOL _bForce = FALSE); + void switchPreview(PreviewMode _eMode,sal_Bool _bForce = sal_False); /** shows the Preview of the content when it is enabled. @param _xContent diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index c4becf529..2b222c046 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -71,7 +71,7 @@ using ::com::sun::star::sdb::application::NamedDatabaseObject; #define SPACEBETWEENENTRIES 4 // ----------------------------------------------------------------------------- -TaskEntry::TaskEntry( const sal_Char* _pAsciiUNOCommand, USHORT _nHelpID, USHORT _nTitleResourceID, bool _bHideWhenDisabled ) +TaskEntry::TaskEntry( const sal_Char* _pAsciiUNOCommand, sal_uInt16 _nHelpID, sal_uInt16 _nTitleResourceID, bool _bHideWhenDisabled ) :sUNOCommand( ::rtl::OUString::createFromAscii( _pAsciiUNOCommand ) ) ,nHelpID( _nHelpID ) ,sTitle( ModuleRes( _nTitleResourceID ) ) @@ -86,7 +86,7 @@ OCreationList::OCreationList( OTasksWindow& _rParent ) ,m_pMouseDownEntry( NULL ) ,m_pLastActiveEntry( NULL ) { - USHORT nSize = SPACEBETWEENENTRIES; + sal_uInt16 nSize = SPACEBETWEENENTRIES; SetSpaceBetweenEntries(nSize); SetSelectionMode( NO_SELECTION ); SetExtendedWinBits( EWB_NO_AUTO_CURENTRY ); @@ -116,7 +116,7 @@ void OCreationList::PreparePaint( SvLBoxEntry* _pEntry ) { // draw a selection background bool bIsMouseDownEntry = ( _pEntry == m_pMouseDownEntry ); - DrawSelectionBackground( GetBoundingRect( _pEntry ), bIsMouseDownEntry ? 1 : 2, FALSE, TRUE, FALSE ); + DrawSelectionBackground( GetBoundingRect( _pEntry ), bIsMouseDownEntry ? 1 : 2, sal_False, sal_True, sal_False ); if ( bIsMouseDownEntry ) { @@ -148,7 +148,7 @@ void OCreationList::SelectSearchEntry( const void* _pEntry ) } // ----------------------------------------------------------------------------- -void OCreationList::ExecuteSearchEntry( const void* _pEntry ) +void OCreationList::ExecuteSearchEntry( const void* _pEntry ) const { SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) ); OSL_ENSURE( pEntry, "OCreationList::ExecuteSearchEntry: invalid entry!" ); @@ -307,7 +307,7 @@ bool OCreationList::setCurrentEntryInvalidate( SvLBoxEntry* _pEntry ) // ----------------------------------------------------------------------------- void OCreationList::updateHelpText() { - USHORT nHelpTextId = 0; + sal_uInt16 nHelpTextId = 0; if ( GetCurEntry() ) nHelpTextId = reinterpret_cast< TaskEntry* >( GetCurEntry()->GetUserData() )->nHelpID; m_rTaskWindow.setHelpText( nHelpTextId ); @@ -424,7 +424,7 @@ void OTasksWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_B m_aDescription.SetControlFont(aFont); } // ----------------------------------------------------------------------------- -void OTasksWindow::setHelpText(USHORT _nId) +void OTasksWindow::setHelpText(sal_uInt16 _nId) { DBG_CHKTHIS(OTasksWindow,NULL); if ( _nId ) @@ -518,7 +518,7 @@ void OTasksWindow::fillTaskEntryList( const TaskEntryList& _rList ) } m_aCreation.Show(); - m_aCreation.SelectAll(FALSE); + m_aCreation.SelectAll(sal_False); m_aHelpText.Show(); m_aDescription.Show(); m_aFL.Show(); diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx index fd984c86f..3e682287b 100644 --- a/dbaccess/source/ui/app/AppDetailView.hxx +++ b/dbaccess/source/ui/app/AppDetailView.hxx @@ -86,7 +86,7 @@ namespace dbaui // IMnemonicEntryList virtual void SelectSearchEntry( const void* _pEntry ); - virtual void ExecuteSearchEntry( const void* _pEntry ); + virtual void ExecuteSearchEntry( const void* _pEntry ) const; private: void onSelected( SvLBoxEntry* _pEntry ) const; @@ -99,14 +99,14 @@ namespace dbaui struct TaskEntry { ::rtl::OUString sUNOCommand; - USHORT nHelpID; + sal_uInt16 nHelpID; String 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 sal_Char* _pAsciiUNOCommand, USHORT _nHelpID, USHORT _nTitleResourceID, bool _bHideWhenDisabled = false ); + TaskEntry( const sal_Char* _pAsciiUNOCommand, sal_uInt16 _nHelpID, sal_uInt16 _nTitleResourceID, bool _bHideWhenDisabled = false ); }; typedef ::std::vector< TaskEntry > TaskEntryList; @@ -115,7 +115,7 @@ namespace dbaui /// the tasks available in the pane TaskEntryList aTasks; /// the resource ID for the title of the pane - USHORT nTitleId; + sal_uInt16 nTitleId; }; class OTasksWindow : public Window @@ -127,7 +127,7 @@ namespace dbaui OApplicationDetailView* m_pDetailView; DECL_LINK( OnEntrySelectHdl, SvTreeListBox* ); - void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); protected: virtual void DataChanged(const DataChangedEvent& rDCEvt); public: @@ -148,7 +148,7 @@ namespace dbaui } void Clear(); - void setHelpText(USHORT _nId); + void setHelpText(sal_uInt16 _nId); }; //================================================================== class OApplicationDetailView : public OSplitterView @@ -162,7 +162,7 @@ namespace dbaui ::std::vector< TaskPaneData > m_aTaskPaneData; MnemonicGenerator m_aExternalMnemonics; - void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); protected: virtual void DataChanged(const DataChangedEvent& rDCEvt); diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx index 293d65ff3..3c3689fb9 100644 --- a/dbaccess/source/ui/app/AppIconControl.cxx +++ b/dbaccess/source/ui/app/AppIconControl.cxx @@ -53,9 +53,9 @@ OApplicationIconControl::OApplicationIconControl(Window* _pParent) struct CategoryDescriptor { - USHORT nLabelResId; + sal_uInt16 nLabelResId; ElementType eType; - USHORT nImageResId; + sal_uInt16 nImageResId; } aCategories[] = { { RID_STR_TABLES_CONTAINER, E_TABLE, IMG_TABLEFOLDER_TREE_L }, { RID_STR_QUERIES_CONTAINER, E_QUERY, IMG_QUERYFOLDER_TREE_L }, @@ -71,14 +71,14 @@ OApplicationIconControl::OApplicationIconControl(Window* _pParent) pEntry->SetUserData( new ElementType( aCategories[i].eType ) ); } - SetChoiceWithCursor( TRUE ); + SetChoiceWithCursor( sal_True ); SetSelectionMode(SINGLE_SELECTION); } // ----------------------------------------------------------------------------- OApplicationIconControl::~OApplicationIconControl() { - ULONG nCount = GetEntryCount(); - for ( ULONG i = 0; i < nCount; ++i ) + sal_uLong nCount = GetEntryCount(); + for ( sal_uLong i = 0; i < nCount; ++i ) { SvxIconChoiceCtrlEntry* pEntry = GetEntry( i ); if ( pEntry ) diff --git a/dbaccess/source/ui/app/AppSwapWindow.cxx b/dbaccess/source/ui/app/AppSwapWindow.cxx index 0d1be9800..164fa5f87 100644 --- a/dbaccess/source/ui/app/AppSwapWindow.cxx +++ b/dbaccess/source/ui/app/AppSwapWindow.cxx @@ -124,7 +124,7 @@ void OApplicationSwapWindow::DataChanged( const DataChangedEvent& rDCEvt ) void OApplicationSwapWindow::clearSelection() { m_aIconControl.SetNoSelection(); - ULONG nPos = 0; + sal_uLong nPos = 0; SvxIconChoiceCtrlEntry* pEntry = m_aIconControl.GetSelectedEntry(nPos); if ( pEntry ) m_aIconControl.InvalidateEntry(pEntry); @@ -151,7 +151,7 @@ bool OApplicationSwapWindow::interceptKeyInput( const KeyEvent& _rEvent ) // ----------------------------------------------------------------------------- ElementType OApplicationSwapWindow::getElementType() const { - ULONG nPos = 0; + sal_uLong nPos = 0; SvxIconChoiceCtrlEntry* pEntry = m_aIconControl.GetSelectedEntry(nPos); return ( pEntry ) ? *static_cast<ElementType*>(pEntry->GetUserData()) : E_NONE; } @@ -176,7 +176,7 @@ bool OApplicationSwapWindow::onContainerSelected( ElementType _eType ) // ----------------------------------------------------------------------------- IMPL_LINK(OApplicationSwapWindow, OnContainerSelectHdl, SvtIconChoiceCtrl*, _pControl) { - ULONG nPos = 0; + sal_uLong nPos = 0; SvxIconChoiceCtrlEntry* pEntry = _pControl->GetSelectedEntry( nPos ); ElementType eType = E_NONE; if ( pEntry ) @@ -196,9 +196,9 @@ IMPL_LINK(OApplicationSwapWindow, ChangeToLastSelected, void*, EMPTYARG) // ----------------------------------------------------------------------------- void OApplicationSwapWindow::selectContainer(ElementType _eType) { - ULONG nCount = m_aIconControl.GetEntryCount(); + sal_uLong nCount = m_aIconControl.GetEntryCount(); SvxIconChoiceCtrlEntry* pEntry = NULL; - for (ULONG i=0; i < nCount; ++i) + for (sal_uLong i=0; i < nCount; ++i) { pEntry = m_aIconControl.GetEntry(i); if ( pEntry && *static_cast<ElementType*>(pEntry->GetUserData()) == _eType ) diff --git a/dbaccess/source/ui/app/AppSwapWindow.hxx b/dbaccess/source/ui/app/AppSwapWindow.hxx index 2ef77e73a..4a6783ccd 100644 --- a/dbaccess/source/ui/app/AppSwapWindow.hxx +++ b/dbaccess/source/ui/app/AppSwapWindow.hxx @@ -44,7 +44,7 @@ namespace dbaui ElementType m_eLastType; OAppBorderWindow& m_rBorderWin; - void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); DECL_LINK( OnContainerSelectHdl, SvtIconChoiceCtrl* ); DECL_LINK( ChangeToLastSelected, void* ); @@ -65,8 +65,8 @@ namespace dbaui inline void cut() { } inline void paste() { } - inline ULONG GetEntryCount() const { return m_aIconControl.GetEntryCount(); } - inline SvxIconChoiceCtrlEntry* GetEntry( ULONG nPos ) const { return m_aIconControl.GetEntry(nPos); } + inline sal_uLong GetEntryCount() const { return m_aIconControl.GetEntryCount(); } + inline SvxIconChoiceCtrlEntry* GetEntry( sal_uLong nPos ) const { return m_aIconControl.GetEntry(nPos); } inline Rectangle GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const { return m_aIconControl.GetBoundingBox(pEntry); } /** automatically creates mnemonics for the icon/texts in our left hand side panel diff --git a/dbaccess/source/ui/app/AppTitleWindow.cxx b/dbaccess/source/ui/app/AppTitleWindow.cxx index 817d8ce41..81099275a 100644 --- a/dbaccess/source/ui/app/AppTitleWindow.cxx +++ b/dbaccess/source/ui/app/AppTitleWindow.cxx @@ -38,7 +38,7 @@ namespace dbaui { DBG_NAME(OTitleWindow) -OTitleWindow::OTitleWindow(Window* _pParent,USHORT _nTitleId,WinBits _nBits,BOOL _bShift) +OTitleWindow::OTitleWindow(Window* _pParent,sal_uInt16 _nTitleId,WinBits _nBits,sal_Bool _bShift) : Window(_pParent,_nBits | WB_DIALOGCONTROL) , m_aSpace1(this) , m_aSpace2(this) @@ -100,7 +100,7 @@ void OTitleWindow::Resize() } } // ----------------------------------------------------------------------------- -void OTitleWindow::setTitle(USHORT _nTitleId) +void OTitleWindow::setTitle(sal_uInt16 _nTitleId) { if ( _nTitleId != 0 ) { diff --git a/dbaccess/source/ui/app/AppTitleWindow.hxx b/dbaccess/source/ui/app/AppTitleWindow.hxx index 306ed9649..42ab6794f 100644 --- a/dbaccess/source/ui/app/AppTitleWindow.hxx +++ b/dbaccess/source/ui/app/AppTitleWindow.hxx @@ -38,12 +38,12 @@ namespace dbaui FixedText m_aSpace2; FixedText m_aTitle; Window* m_pChild; - BOOL m_bShift; - void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); + sal_Bool m_bShift; + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); protected: virtual void DataChanged(const DataChangedEvent& rDCEvt); public: - OTitleWindow(Window* _pParent,USHORT _nTitleId,WinBits _nBits,BOOL _bShift = TRUE); + OTitleWindow(Window* _pParent,sal_uInt16 _nTitleId,WinBits _nBits,sal_Bool _bShift = sal_True); virtual ~OTitleWindow(); // window overloads @@ -67,7 +67,7 @@ namespace dbaui @param _nTitleId The resource id of the title text. */ - void setTitle(USHORT _nTitleId); + void setTitle(sal_uInt16 _nTitleId); /** Gets the min Width in Pixel which is needed to display the whole diff --git a/dbaccess/source/ui/app/AppView.cxx b/dbaccess/source/ui/app/AppView.cxx index c58c18ee4..50001c2a0 100644 --- a/dbaccess/source/ui/app/AppView.cxx +++ b/dbaccess/source/ui/app/AppView.cxx @@ -83,7 +83,7 @@ OAppBorderWindow::OAppBorderWindow(OApplicationView* _pParent,PreviewMode _ePrev SetBorderStyle(WINDOW_BORDER_MONO); - m_pPanel = new OTitleWindow(this,STR_DATABASE,WB_BORDER | WB_DIALOGCONTROL ,FALSE); + m_pPanel = new OTitleWindow(this,STR_DATABASE,WB_BORDER | WB_DIALOGCONTROL ,sal_False); m_pPanel->SetBorderStyle(WINDOW_BORDER_MONO); OApplicationSwapWindow* pSwap = new OApplicationSwapWindow( m_pPanel, *this ); pSwap->Show(); diff --git a/dbaccess/source/ui/app/app.src b/dbaccess/source/ui/app/app.src index 7480e22b2..4c3ffc25f 100644 --- a/dbaccess/source/ui/app/app.src +++ b/dbaccess/source/ui/app/app.src @@ -111,14 +111,12 @@ Menu RID_MENU_APP_NEW MenuItem { Identifier = SID_APP_NEW_FORM; - HelpId = SID_APP_NEW_FORM; Command = ".uno:DBNewForm"; Text [ en-US ] = "Form..." ; }; MenuItem { Identifier = SID_APP_NEW_REPORT; - HelpId = SID_APP_NEW_REPORT; Command = ".uno:DBNewReport"; Text [ en-US ] = "Report..." ; }; @@ -154,7 +152,6 @@ Menu RID_MENU_APP_NEW MenuItem { Identifier = SID_DB_NEW_VIEW_SQL; - HelpId = SID_DB_NEW_VIEW_SQL; Command = ".uno:DBNewViewSQL"; Text [ en-US ] = "View (Simple)..." ; }; @@ -177,7 +174,6 @@ Menu RID_MENU_APP_EDIT MenuItem { Identifier = SID_DB_APP_PASTE_SPECIAL; - HelpID = SID_DB_APP_PASTE_SPECIAL ; Text[ en-US ] = "Paste Special..."; Command = ".uno:PasteSpecial"; }; @@ -188,42 +184,36 @@ Menu RID_MENU_APP_EDIT MenuItem { Identifier = SID_DB_APP_DELETE; - HelpID = SID_DB_APP_DELETE ; Text[ en-US ] = "Delete"; Command = ".uno:DBDelete"; }; MenuItem { Identifier = SID_DB_APP_RENAME; - HelpID = SID_DB_APP_RENAME ; Text[ en-US ] = "Rename"; Command = ".uno:DBRename"; }; MenuItem { Identifier = SID_DB_APP_EDIT; - HelpID = SID_DB_APP_EDIT ; Text[ en-US ] = "Edit"; Command = ".uno:DBEdit"; }; MenuItem { Identifier = SID_DB_APP_EDIT_SQL_VIEW; - HelpID = SID_DB_APP_EDIT_SQL_VIEW ; Text [ en-US ] = "Edit in SQL View..."; Command = ".uno:DBEditSqlView"; }; MenuItem { Identifier = SID_DB_APP_OPEN; - HelpID = SID_DB_APP_OPEN ; Text[ en-US ] = "Open"; Command = ".uno:DBOpen"; }; MenuItem { Identifier = SID_DB_APP_CONVERTTOVIEW; - HelpID = SID_DB_APP_CONVERTTOVIEW ; Text[ en-US ] = "Create as View"; Command = ".uno:DBConvertToView"; }; @@ -236,14 +226,12 @@ Menu RID_MENU_APP_EDIT MenuItem { Identifier = SID_APP_NEW_REPORT_PRE_SEL; - HelpId = SID_APP_NEW_REPORT_PRE_SEL; Command = ".uno:DBNewReportWithPreSelection"; Text [ en-US ] = "Report..." ; }; MenuItem { Identifier = SID_REPORT_CREATE_REPWIZ_PRE_SEL ; - HelpID = HID_DOCUMENT_CREATE_REPWIZ ; Text[ en-US ] = "Report Wizard..."; Command = ".uno:DBNewReportAutoPilotWithPreSelection"; @@ -255,7 +243,6 @@ Menu RID_MENU_APP_EDIT MenuItem { Identifier = SID_SELECTALL; - HelpID = SID_SELECTALL ; Text[ en-US ] = "Select All"; Command = ".uno:SelectAll"; }; @@ -274,21 +261,18 @@ Menu RID_MENU_APP_EDIT MenuItem { Identifier = SID_DB_APP_DSPROPS; - HelpID = SID_DB_APP_DSPROPS ; Text[ en-US ] = "Properties"; Command = ".uno:DBDSProperties"; }; MenuItem { Identifier = SID_DB_APP_DSCONNECTION_TYPE; - HelpID = SID_DB_APP_DSCONNECTION_TYPE ; Text[ en-US ] = "Connection Type"; Command = ".uno:DBDSConnectionType"; }; MenuItem { Identifier = SID_DB_APP_DSADVANCED_SETTINGS; - HelpID = SID_DB_APP_DSADVANCED_SETTINGS ; Text[ en-US ] = "Advanced Settings"; Command = ".uno:DBDSAdvancedSettings"; }; @@ -410,7 +394,6 @@ Menu RID_MENU_APP_PREVIEW MenuItem { Identifier = SID_DB_APP_DISABLE_PREVIEW; - HelpId = SID_DB_APP_DISABLE_PREVIEW; Text[ en-US ] = "None"; Command = ".uno:DBDisablePreview"; Checkable = TRUE; @@ -420,7 +403,6 @@ Menu RID_MENU_APP_PREVIEW MenuItem { Identifier = SID_DB_APP_VIEW_DOCINFO_PREVIEW; - HelpId = SID_DB_APP_VIEW_DOCINFO_PREVIEW; Text[ en-US ] = "Document Information"; Command = ".uno:DBShowDocInfoPreview"; Checkable = TRUE; @@ -430,7 +412,6 @@ Menu RID_MENU_APP_PREVIEW MenuItem { Identifier = SID_DB_APP_VIEW_DOC_PREVIEW; - HelpId = SID_DB_APP_VIEW_DOC_PREVIEW; Text[ en-US ] = "Document"; Command = ".uno:DBShowDocPreview"; Checkable = TRUE; diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index f7ed72fff..b4beba5de 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -739,6 +739,26 @@ sal_Bool SbaXDataBrowserController::reloadForm( const Reference< XLoadable >& _r if (::comphelper::getBOOL(xFormSet->getPropertyValue(PROPERTY_ESCAPE_PROCESSING))) xFormSet->getPropertyValue(PROPERTY_SINGLESELECTQUERYCOMPOSER) >>= m_xParser; + { + const Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY ); + const Reference< XSingleSelectQueryAnalyzer > xAnalyzer( xRowSetProps->getPropertyValue( PROPERTY_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY ); + if ( xAnalyzer.is() ) + { + const Reference< XIndexAccess > xOrderColumns( xAnalyzer->getOrderColumns(), UNO_SET_THROW ); + const sal_Int32 nOrderColumns( xOrderColumns->getCount() ); + for ( sal_Int32 c=0; c<nOrderColumns; ++c ) + { + const Reference< XPropertySet > xOrderColumn( xOrderColumns->getByIndex(c), UNO_QUERY_THROW ); + ::rtl::OUString sColumnName; + OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_NAME ) >>= sColumnName); + ::rtl::OUString sTableName; + OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_TABLENAME ) >>= sTableName); + (void)sColumnName; + (void)sTableName; + } + } + } + Reference< XWarningsSupplier > xWarnings( _rxLoadable, UNO_QUERY ); if ( xWarnings.is() ) { @@ -809,7 +829,8 @@ sal_Bool SbaXDataBrowserController::Construct(Window* pParent) m_xColumnsSupplier.set(m_xRowSet,UNO_QUERY); m_xLoadable.set(m_xRowSet,UNO_QUERY); - if (!InitializeForm(m_xRowSet)) + Reference< XPropertySet > xFormProperties( m_xRowSet, UNO_QUERY ); + if ( !InitializeForm( xFormProperties ) ) return sal_False; m_xGridModel = CreateGridModel(); @@ -1207,11 +1228,7 @@ void SbaXDataBrowserController::propertyChange(const PropertyChangeEvent& evt) t } - // the filter or the sort criterias have changed ? -> update our parser - if (evt.PropertyName.equals(PROPERTY_ACTIVECOMMAND)) - { - } - else if (evt.PropertyName.equals(PROPERTY_FILTER)) + if (evt.PropertyName.equals(PROPERTY_FILTER)) { InvalidateFeature(ID_BROWSER_REMOVEFILTER); } @@ -1851,25 +1868,50 @@ void SbaXDataBrowserController::applyParserFilter(const ::rtl::OUString& _rOldFi setCurrentColumnPosition(nPos); } + //------------------------------------------------------------------------------ Reference< XSingleSelectQueryComposer > SbaXDataBrowserController::createParser_nothrow() { - Reference< XSingleSelectQueryComposer > xRet; + Reference< XSingleSelectQueryComposer > xComposer; try { - Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY_THROW); - const Reference<XMultiServiceFactory> xFactory(::dbtools::getConnection(getRowSet()),UNO_QUERY_THROW); - xRet.set(xFactory->createInstance(SERVICE_NAME_SINGLESELECTQUERYCOMPOSER),UNO_QUERY_THROW); - xRet->setElementaryQuery(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_ACTIVECOMMAND))); - xRet->setFilter(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_FILTER))); - xRet->setHavingClause(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_HAVING_CLAUSE))); - xRet->setOrder(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_ORDER))); + const Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW ); + const Reference< XMultiServiceFactory > xFactory( + xRowSetProps->getPropertyValue( PROPERTY_ACTIVE_CONNECTION ), UNO_QUERY_THROW ); + xComposer.set( xFactory->createInstance( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY_THROW ); + + ::rtl::OUString sActiveCommand; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ACTIVECOMMAND ) >>= sActiveCommand ); + if ( sActiveCommand.getLength() > 0 ) + { + xComposer->setElementaryQuery( sActiveCommand ); + } + else + { + ::rtl::OUString sCommand; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMAND ) >>= sCommand ); + sal_Int32 nCommandType = CommandType::COMMAND; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMAND_TYPE ) >>= nCommandType ); + xComposer->setCommand( sCommand, nCommandType ); + } + + ::rtl::OUString sFilter; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_FILTER ) >>= sFilter ); + xComposer->setFilter( sFilter ); + + ::rtl::OUString sHavingClause; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_HAVING_CLAUSE ) >>= sHavingClause ); + xComposer->setHavingClause( sHavingClause ); + + ::rtl::OUString sOrder; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ORDER ) >>= sOrder ); + xComposer->setOrder( sOrder ); } - catch(Exception&) + catch ( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } - return xRet; + return xComposer; } //------------------------------------------------------------------------------ void SbaXDataBrowserController::ExecuteFilterSortCrit(sal_Bool bFilter) @@ -1891,10 +1933,8 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(sal_Bool bFilter) { DlgFilterCrit aDlg( getBrowserView(), getORB(), xCon, xParser, xSup->getColumns() ); String aFilter; - if(!aDlg.Execute()) - { - return; // if so we don't need to actualize the grid - } + if ( !aDlg.Execute() ) + return; // if so we don't need to update the grid aDlg.BuildWherePart(); } else @@ -2683,7 +2723,6 @@ void SbaXDataBrowserController::initializeParser() const { // (only if the statement isn't native) // (it is allowed to use the PROPERTY_ISPASSTHROUGH : _after_ loading a form it is valid) xFormSet->getPropertyValue(PROPERTY_SINGLESELECTQUERYCOMPOSER) >>= m_xParser; - } } catch(Exception&) { diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx index 88b7d8781..3da8303c6 100644 --- a/dbaccess/source/ui/browser/brwview.cxx +++ b/dbaccess/source/ui/browser/brwview.cxx @@ -334,8 +334,8 @@ long UnoDataBrowserView::PreNotify( NotifyEvent& rNEvt ) { const KeyEvent* pKeyEvt = rNEvt.GetKeyEvent(); const KeyCode& rKeyCode = pKeyEvt->GetKeyCode(); - if ( ( rKeyCode == KeyCode( KEY_E, TRUE, TRUE, FALSE, FALSE ) ) - || ( rKeyCode == KeyCode( KEY_TAB, TRUE, FALSE, FALSE, FALSE ) ) + if ( ( rKeyCode == KeyCode( KEY_E, sal_True, sal_True, sal_False, sal_False ) ) + || ( rKeyCode == KeyCode( KEY_TAB, sal_True, sal_False, sal_False, sal_False ) ) ) { if ( m_pTreeView && m_pVclControl && m_pTreeView->HasChildPathFocus() ) diff --git a/dbaccess/source/ui/browser/dataview.cxx b/dbaccess/source/ui/browser/dataview.cxx index 71d7e95a1..7be5d5864 100644 --- a/dbaccess/source/ui/browser/dataview.cxx +++ b/dbaccess/source/ui/browser/dataview.cxx @@ -35,7 +35,6 @@ #include <comphelper/namedvaluecollection.hxx> #include <sfx2/app.hxx> #include <sfx2/imgmgr.hxx> -#include <vcl/fixed.hxx> #include "IController.hxx" #include "UITools.hxx" #include <sfx2/sfx.hrc> @@ -84,11 +83,12 @@ namespace dbaui :Window(pParent,nStyle) ,m_xServiceFactory(_rFactory) ,m_rController( _rController ) - ,m_pSeparator( NULL ) + ,m_aSeparator( this ) { DBG_CTOR(ODataView,NULL); m_rController.acquire(); m_pAccel.reset(::svt::AcceleratorExecute::createAcceleratorHelper()); + m_aSeparator.Show(); } // ------------------------------------------------------------------------- @@ -101,30 +101,10 @@ namespace dbaui { DBG_DTOR(ODataView,NULL); - enableSeparator( sal_False ); m_rController.release(); } // ------------------------------------------------------------------------- - void ODataView::enableSeparator( const sal_Bool _bEnable ) - { - if ( _bEnable == isSeparatorEnabled() ) - // nothing to do - return; - - if ( _bEnable ) - { - m_pSeparator = new FixedLine( this ); - m_pSeparator->Show( ); - } - else - { - ::std::auto_ptr<FixedLine> aTemp(m_pSeparator); - m_pSeparator = NULL; - } - Resize(); - } - // ------------------------------------------------------------------------- void ODataView::resizeDocumentView( Rectangle& /*_rPlayground*/ ) { } @@ -148,15 +128,10 @@ namespace dbaui { Rectangle aPlayground( _rPlayground ); - // position thew separator - if ( m_pSeparator ) - { - Size aSeparatorSize = Size( aPlayground.GetWidth(), 2 ); - - m_pSeparator->SetPosSizePixel( aPlayground.TopLeft(), aSeparatorSize ); - - aPlayground.Top() += aSeparatorSize.Height() + 1; - } + // position the separator + const Size aSeparatorSize = Size( aPlayground.GetWidth(), 2 ); + m_aSeparator.SetPosSizePixel( aPlayground.TopLeft(), aSeparatorSize ); + aPlayground.Top() += aSeparatorSize.Height() + 1; // position the controls of the document's view resizeDocumentView( aPlayground ); diff --git a/dbaccess/source/ui/browser/dbexchange.cxx b/dbaccess/source/ui/browser/dbexchange.cxx index fb834691c..c15fb91fe 100644 --- a/dbaccess/source/ui/browser/dbexchange.cxx +++ b/dbaccess/source/ui/browser/dbexchange.cxx @@ -180,7 +180,7 @@ namespace dbaui // ----------------------------------------------------------------------------- sal_Bool ODataClipboard::GetData( const DataFlavor& rFlavor ) { - const ULONG nFormat = SotExchange::GetFormat(rFlavor); + const sal_uLong nFormat = SotExchange::GetFormat(rFlavor); switch (nFormat) { case SOT_FORMAT_RTF: diff --git a/dbaccess/source/ui/browser/dbtreemodel.hxx b/dbaccess/source/ui/browser/dbtreemodel.hxx index c28e5aa6f..a2cec18e4 100644 --- a/dbaccess/source/ui/browser/dbtreemodel.hxx +++ b/dbaccess/source/ui/browser/dbtreemodel.hxx @@ -42,8 +42,8 @@ // tables holds the nameaccess for the tables // table holds the table -#define CONTAINER_QUERIES ULONG( 0 ) -#define CONTAINER_TABLES ULONG( 1 ) +#define CONTAINER_QUERIES sal_uLong( 0 ) +#define CONTAINER_TABLES sal_uLong( 1 ) namespace com { namespace sun { namespace star { namespace lang { class XMultiServiceFactory; } } } } diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx index e13d66029..4d5dd7bdc 100644 --- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx +++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx @@ -243,8 +243,8 @@ void SbaTableQueryBrowser::notifyHiContrastChanged() } // find the proper item, and set its icons - USHORT nCount = pEntryLoop->ItemCount(); - for (USHORT i=0;i<nCount;++i) + sal_uInt16 nCount = pEntryLoop->ItemCount(); + for (sal_uInt16 i=0;i<nCount;++i) { SvLBoxItem* pItem = pEntryLoop->GetItem(i); if ( !pItem || ( pItem->IsA() != SV_ITEM_ID_LBOXCONTEXTBMP ) ) diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx index c27a17eed..d1064bf5e 100644 --- a/dbaccess/source/ui/browser/exsrcbrw.cxx +++ b/dbaccess/source/ui/browser/exsrcbrw.cxx @@ -124,7 +124,7 @@ Reference< XRowSet > SbaExternalSourceBrowser::CreateForm() } //------------------------------------------------------------------------------ -sal_Bool SbaExternalSourceBrowser::InitializeForm(const Reference< XRowSet > & /*xForm*/) +sal_Bool SbaExternalSourceBrowser::InitializeForm(const Reference< XPropertySet > & /*i_formProperties*/) { return sal_True; } diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index 26142fa93..562eae7e4 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -336,7 +336,7 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen throw RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unable to create a view")), *this ); if ( m_bReadOnly || m_bPreview ) - pView->EnableInput( FALSE ); + pView->EnableInput( sal_False ); impl_initialize(); } @@ -635,6 +635,18 @@ void OGenericUnoController::InvalidateFeature_Impl() // ----------------------------------------------------------------------- void OGenericUnoController::ImplInvalidateFeature( sal_Int32 _nId, const Reference< XStatusListener >& _xListener, sal_Bool _bForceBroadcast ) { +#if OSL_DEBUG_LEVEL > 0 + if ( _nId != -1 ) + { + SupportedFeatures::iterator aFeaturePos = ::std::find_if( + m_aSupportedFeatures.begin(), + m_aSupportedFeatures.end(), + ::std::bind2nd( CompareFeatureById(), _nId ) + ); + OSL_ENSURE( aFeaturePos != m_aSupportedFeatures.end(), "OGenericUnoController::ImplInvalidateFeature: invalidating an unsupported feature is suspicious, at least!" ); + } +#endif + FeatureListener aListener; aListener.nId = _nId; aListener.xListener = _xListener; @@ -1318,9 +1330,9 @@ void OGenericUnoController::openHelpAgent(rtl::OUString const& _suHelpStringURL openHelpAgent( aURL ); } -void OGenericUnoController::openHelpAgent(sal_Int32 _nHelpId) +void OGenericUnoController::openHelpAgent(const rtl::OString& _sHelpId) { - openHelpAgent( createHelpAgentURL( lcl_getModuleHelpModuleName( getFrame() ), _nHelpId ) ); + openHelpAgent( createHelpAgentURL( lcl_getModuleHelpModuleName( getFrame() ), _sHelpId ) ); } void OGenericUnoController::openHelpAgent( const URL& _rURL ) diff --git a/dbaccess/source/ui/browser/sbabrw.src b/dbaccess/source/ui/browser/sbabrw.src index 87f2f954d..49d61fccc 100644 --- a/dbaccess/source/ui/browser/sbabrw.src +++ b/dbaccess/source/ui/browser/sbabrw.src @@ -188,14 +188,12 @@ Menu RID_MENU_REFRESH_DATA MenuItem { MID_SBA_QRY_REFRESH - HelpId = SID_FM_REFRESH ; Command = ".uno:Refresh"; }; MenuItem { Identifier = ID_BROWSER_REFRESH_REBUILD; Command = ".uno:DBRebuildData"; - HelpId = HID_BROWSER_REFRESH_REBUILDVIEW; Text [ en-US ] = "Rebuild"; }; }; diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 408c56ad0..4c48ed14b 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -811,7 +811,7 @@ SbaGridControl::SbaGridControl(Reference< XMultiServiceFactory > _rM, :FmGridControl(_rM,pParent, _pPeer, nBits) ,m_pMasterListener(NULL) ,m_nAsyncDropEvent(0) - ,m_nCurrentActionColId((USHORT)-1) + ,m_nCurrentActionColId((sal_uInt16)-1) ,m_bActivatingForDrop(sal_False) { DBG_CTOR(SbaGridControl ,NULL); diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 86549708e..cbe12b7e8 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -68,6 +68,7 @@ #include <com/sun/star/form/XForm.hpp> #include <com/sun/star/form/XGridColumnFactory.hpp> #include <com/sun/star/form/XLoadable.hpp> +#include <com/sun/star/form/XReset.hpp> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/lang/DisposedException.hpp> @@ -420,8 +421,146 @@ sal_Bool SbaTableQueryBrowser::Construct(Window* pParent) return sal_True; } -// ------------------------------------------------------------------------- -sal_Bool SbaTableQueryBrowser::InitializeForm(const Reference< ::com::sun::star::sdbc::XRowSet > & _rxForm) +// --------------------------------------------------------------------------------------------------------------------- +namespace +{ + // ----------------------------------------------------------------------------------------------------------------- + struct SelectValueByName : public ::std::unary_function< ::rtl::OUString, Any > + { + const Any& operator()( ::rtl::OUString const& i_name ) const + { + return m_rCollection.get( i_name ); + } + + SelectValueByName( ::comphelper::NamedValueCollection const& i_collection ) + :m_rCollection( i_collection ) + { + } + + ::comphelper::NamedValueCollection const& m_rCollection; + }; +} + +// --------------------------------------------------------------------------------------------------------------------- +void SbaTableQueryBrowser::impl_sanitizeRowSetClauses_nothrow() +{ + try + { + Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW ); + sal_Bool bEscapeProcessing = sal_False; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ESCAPE_PROCESSING ) >>= bEscapeProcessing ); + if ( !bEscapeProcessing ) + // don't touch or interpret anything if escape processing is disabled + return; + + Reference< XSingleSelectQueryComposer > xComposer( createParser_nothrow() ); + if ( !xComposer.is() ) + // can't do anything. Already reported via assertion in createParser_nothrow. + return; + + // the tables participating in the statement + const Reference< XTablesSupplier > xSuppTables( xComposer, UNO_QUERY_THROW ); + const Reference< XNameAccess > xTableNames( xSuppTables->getTables(), UNO_QUERY_THROW ); + + // the columns participating in the statement + const Reference< XColumnsSupplier > xSuppColumns( xComposer, UNO_QUERY_THROW ); + const Reference< XNameAccess > xColumnNames( xSuppColumns->getColumns(), UNO_QUERY_THROW ); + + // ............................................................................................................. + // check if the order columns apply to tables which really exist in the statement + const Reference< XIndexAccess > xOrderColumns( xComposer->getOrderColumns(), UNO_SET_THROW ); + const sal_Int32 nOrderColumns( xOrderColumns->getCount() ); + bool invalidColumn = false; + for ( sal_Int32 c=0; ( c < nOrderColumns ) && !invalidColumn; ++c ) + { + const Reference< XPropertySet > xOrderColumn( xOrderColumns->getByIndex(c), UNO_QUERY_THROW ); + ::rtl::OUString sTableName; + OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_TABLENAME ) >>= sTableName ); + ::rtl::OUString sColumnName; + OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_NAME ) >>= sColumnName ); + + if ( sTableName.getLength() == 0 ) + { + if ( !xColumnNames->hasByName( sColumnName ) ) + { + invalidColumn = true; + break; + } + } + else + { + if ( !xTableNames->hasByName( sTableName ) ) + { + invalidColumn = true; + break; + } + + const Reference< XColumnsSupplier > xSuppTableColumns( xTableNames->getByName( sTableName ), UNO_QUERY_THROW ); + const Reference< XNameAccess > xTableColumnNames( xSuppTableColumns->getColumns(), UNO_QUERY_THROW ); + if ( !xTableColumnNames->hasByName( sColumnName ) ) + { + invalidColumn = true; + break; + } + } + } + + if ( invalidColumn ) + { + // reset the complete order statement at both the row set and the parser + const ::rtl::OUString sEmptyOrder; + xRowSetProps->setPropertyValue( PROPERTY_ORDER, makeAny( sEmptyOrder ) ); + xComposer->setOrder( sEmptyOrder ); + } + + // ............................................................................................................. + // check if the columns participating in the filter refer to existing tables + // TODO: there's no API at all for this. The method which comes nearest to what we need is + // "getStructuredFilter", but it returns pure column names only. That is, for a statement like + // "SELECT * FROM <table> WHERE <other_table>.<column> = <value>", it will return "<column>". But + // there's no API at all to retrieve the information about "<other_table>" - which is what would + // be needed here. + // That'd be a chance to replace getStructuredFilter with something more reasonable. This method + // has at least one other problem: For a clause like "<column> != <value>", it will return "<column>" + // as column name, "NOT_EQUAL" as operator, and "!= <value>" as value, effectively duplicating the + // information about the operator, and beding all clients to manually remove the "!=" from the value + // string. + // So, what really would be handy, is some + // XNormalizedFilter getNormalizedFilter(); + // with + // interface XDisjunctiveFilterExpression + // { + // XConjunctiveFilterTerm getTerm( int index ); + // } + // interface XConjunctiveFilterTerm + // { + // ComparisonPredicate getPredicate( int index ); + // } + // struct ComparisonPredicate + // { + // XComparisonOperand Lhs; + // SQLFilterOperator Operator; + // XComparisonOperand Rhs; + // } + // interface XComparisonOperand + // { + // SQLFilterOperand Type; + // XPropertySet getColumn(); + // string getLiteral(); + // ... + // } + // enum SQLFilterOperand { Column, Literal, ... } + // + // ... or something like this .... + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + +// --------------------------------------------------------------------------------------------------------------------- +sal_Bool SbaTableQueryBrowser::InitializeForm( const Reference< XPropertySet > & i_formProperties ) { if(!m_pCurrentlyDisplayed) return sal_True; @@ -429,50 +568,46 @@ sal_Bool SbaTableQueryBrowser::InitializeForm(const Reference< ::com::sun::star: // this method set all format settings from the orignal table or query try { - // we send all properties at once, maybe the implementation is clever enough to handle one big PropertiesChanged - // more effective than many small PropertyChanged ;) - Sequence< ::rtl::OUString> aProperties(3); - Sequence< Any> aValues(3); - DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(m_pCurrentlyDisplayed->GetUserData()); - OSL_ENSURE( pData, "SbaTableQueryBrowser::InitializeForm: No user data set at the currently displayed entry!" ); - OSL_ENSURE( pData->xObjectProperties.is(), "SbaTableQueryBrowser::InitializeForm: No table available!" ); + 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!" ); + + Reference< XPropertySetInfo > xPSI( pData->xObjectProperties->getPropertySetInfo(), UNO_SET_THROW ); + + ::comphelper::NamedValueCollection aPropertyValues; - if ( pData->xObjectProperties.is() ) + const ::rtl::OUString aTransferProperties[] = { - sal_Int32 nPos = 0; - // is the filter intially applied ? - aProperties.getArray()[nPos] = PROPERTY_APPLYFILTER; - aValues.getArray()[nPos++] = pData->xObjectProperties->getPropertyValue(PROPERTY_APPLYFILTER); + PROPERTY_APPLYFILTER, + PROPERTY_FILTER, + PROPERTY_HAVING_CLAUSE, + PROPERTY_ORDER + }; + for ( size_t i=0; i < sizeof( aTransferProperties ) / sizeof( aTransferProperties[0] ); ++i ) + { + if ( !xPSI->hasPropertyByName( aTransferProperties[i] ) ) + continue; + aPropertyValues.put( aTransferProperties[i], pData->xObjectProperties->getPropertyValue( aTransferProperties[i] ) ); + } - // the initial filter - aProperties.getArray()[nPos] = PROPERTY_FILTER; - aValues.getArray()[nPos++] = pData->xObjectProperties->getPropertyValue(PROPERTY_FILTER); + const ::std::vector< ::rtl::OUString > aNames( aPropertyValues.getNames() ); + Sequence< ::rtl::OUString > aPropNames( aNames.size() ); + ::std::copy( aNames.begin(), aNames.end(), aPropNames.getArray() ); - if ( pData->xObjectProperties->getPropertySetInfo()->hasPropertyByName(PROPERTY_HAVING_CLAUSE) ) - { - aProperties.realloc(aProperties.getLength()+1); - aValues.realloc(aValues.getLength()+1); - // the initial having clause - aProperties.getArray()[nPos] = PROPERTY_HAVING_CLAUSE; - aValues.getArray()[nPos++] = pData->xObjectProperties->getPropertyValue(PROPERTY_HAVING_CLAUSE); - } + Sequence< Any > aPropValues( aNames.size() ); + ::std::transform( aNames.begin(), aNames.end(), aPropValues.getArray(), SelectValueByName( aPropertyValues ) ); - // the initial ordering - aProperties.getArray()[nPos] = PROPERTY_ORDER; - aValues.getArray()[nPos++] = pData->xObjectProperties->getPropertyValue(PROPERTY_ORDER); + Reference< XMultiPropertySet > xFormMultiSet( i_formProperties, UNO_QUERY_THROW ); + xFormMultiSet->setPropertyValues( aPropNames, aPropValues ); - Reference< XMultiPropertySet > xFormMultiSet(_rxForm, UNO_QUERY); - xFormMultiSet->setPropertyValues(aProperties, aValues); - } + impl_sanitizeRowSetClauses_nothrow(); } - catch(Exception&) + catch ( const Exception& ) { - OSL_FAIL("SbaTableQueryBrowser::InitializeForm : something went wrong !"); + DBG_UNHANDLED_EXCEPTION(); return sal_False; } - return sal_True; } @@ -481,8 +616,8 @@ void SbaTableQueryBrowser::initializePreviewMode() { if ( getBrowserView() && getBrowserView()->getVclControl() ) { - getBrowserView()->getVclControl()->AlwaysEnableInput( FALSE ); - getBrowserView()->getVclControl()->EnableInput( FALSE ); + getBrowserView()->getVclControl()->AlwaysEnableInput( sal_False ); + getBrowserView()->getVclControl()->EnableInput( sal_False ); getBrowserView()->getVclControl()->ForceHideScrollbars( sal_True ); } Reference< XPropertySet > xDataSourceSet(getRowSet(), UNO_QUERY); @@ -602,6 +737,7 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: ::std::vector< NamedValue > aInitialValues; ::std::vector< ::rtl::OUString > aCopyProperties; + Any aDefault; switch(nType) { @@ -618,6 +754,8 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TriState" ) ), makeAny( sal_Bool( ColumnValue::NO_NULLS != nNullable ) ) ) ); + if ( ColumnValue::NO_NULLS == nNullable ) + aDefault <<= (sal_Int16)STATE_NOCHECK; } break; @@ -659,18 +797,17 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: Reference< XPropertySetInfo > xGridColPSI( xGridCol->getPropertySetInfo(), UNO_SET_THROW ); // calculate the default - Any aDefault; if ( xGridColPSI->hasPropertyByName( PROPERTY_CONTROLDEFAULT ) ) - aDefault = xColumn->getPropertyValue( PROPERTY_CONTROLDEFAULT ); - - // default value - if ( nType == DataType::BIT || nType == DataType::BOOLEAN ) { - if ( aDefault.hasValue() ) - aDefault <<= (comphelper::getString(aDefault).toInt32() == 0) ? (sal_Int16)STATE_NOCHECK : (sal_Int16)STATE_CHECK; - else - aDefault <<= ((sal_Int16)STATE_DONTKNOW); - + aDefault = xColumn->getPropertyValue( PROPERTY_CONTROLDEFAULT ); + // default value + if ( nType == DataType::BIT || nType == DataType::BOOLEAN ) + { + if ( aDefault.hasValue() ) + aDefault <<= (comphelper::getString(aDefault).toInt32() == 0) ? (sal_Int16)STATE_NOCHECK : (sal_Int16)STATE_CHECK; + else + aDefault <<= ((sal_Int16)STATE_DONTKNOW); + } } if ( aDefault.hasValue() ) @@ -2004,7 +2141,7 @@ void SbaTableQueryBrowser::implAddDatasource(const String& _rDbName, Image& _rDb m_pTreeView->getListBox().InsertEntry( _rQueryName, _rQueryImage, _rQueryImage, pDatasourceEntry, - TRUE /*ChildsOnDemand*/, LIST_APPEND, pQueriesData ); + sal_True /*ChildsOnDemand*/, LIST_APPEND, pQueriesData ); } // the child for the tables container @@ -2014,7 +2151,7 @@ void SbaTableQueryBrowser::implAddDatasource(const String& _rDbName, Image& _rDb m_pTreeView->getListBox().InsertEntry( _rTableName, _rTableImage, _rTableImage, pDatasourceEntry, - TRUE /*ChildsOnDemand*/, LIST_APPEND, pTablesData ); + sal_True /*ChildsOnDemand*/, LIST_APPEND, pTablesData ); } } @@ -2289,77 +2426,82 @@ sal_Bool SbaTableQueryBrowser::implSelect(const ::svx::ODataAccessDescriptor& _r sal_Bool SbaTableQueryBrowser::implLoadAnything(const ::rtl::OUString& _rDataSourceName, const ::rtl::OUString& _rCommand, const sal_Int32 _nCommandType, const sal_Bool _bEscapeProcessing, const SharedConnection& _rxConnection) { - Reference<XPropertySet> xProp(getRowSet(),UNO_QUERY); - if(xProp.is()) + try { - Reference< ::com::sun::star::form::XLoadable > xLoadable(xProp,UNO_QUERY); - try + 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)); + if(_rxConnection.is()) + xProp->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( _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, ::cppu::bool2any(_bEscapeProcessing)); + if ( m_bPreview ) { - // the values allowing the RowSet to re-execute - xProp->setPropertyValue(PROPERTY_DATASOURCENAME, makeAny(_rDataSourceName)); - if(_rxConnection.is()) - xProp->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( _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, ::cppu::bool2any(_bEscapeProcessing)); - if ( m_bPreview ) - { - xProp->setPropertyValue(PROPERTY_FETCHDIRECTION, makeAny(FetchDirection::FORWARD)); - } + xProp->setPropertyValue(PROPERTY_FETCHDIRECTION, makeAny(FetchDirection::FORWARD)); + } - // the formatter depends on the data source we're working on, so rebuild it here ... - initFormatter(); + // the formatter depends on the data source we're working on, so rebuild it here ... + initFormatter(); - // switch the grid to design mode while loading - getBrowserView()->getGridControl()->setDesignMode(sal_True); - InitializeForm(getRowSet()); + // switch the grid to design mode while loading + getBrowserView()->getGridControl()->setDesignMode(sal_True); + InitializeForm( xProp ); - sal_Bool bSuccess = sal_True; + sal_Bool bSuccess = sal_True; + { { - { - Reference< XNameContainer > xColContainer(getFormComponent(), UNO_QUERY); - // first we have to clear the grid - clearGridColumns(xColContainer); - } - FormErrorHelper aHelper(this); - // load the form - bSuccess = reloadForm(xLoadable); - - // initialize the model - InitializeGridModel(getFormComponent()); - - if ( m_bPreview ) - initializePreviewMode(); - - LoadFinished(sal_True); + Reference< XNameContainer > xColContainer(getFormComponent(), UNO_QUERY); + // first we have to clear the grid + clearGridColumns(xColContainer); } + FormErrorHelper aHelper(this); + // load the form + bSuccess = reloadForm(xLoadable); - InvalidateAll(); - return bSuccess; - } - catch( const SQLException& e ) - { - Any aException( ::cppu::getCaughtException() ); - showError( SQLExceptionInfo( aException ) ); - } - catch( const WrappedTargetException& e ) - { - SQLException aSql; - if ( e.TargetException.isExtractableTo( ::cppu::UnoType< SQLException >::get() ) ) - showError( SQLExceptionInfo( e.TargetException ) ); - else + // initialize the model + InitializeGridModel(getFormComponent()); + + Any aVal = xProp->getPropertyValue(PROPERTY_ISNEW); + if (aVal.hasValue() && ::comphelper::getBOOL(aVal)) { - DBG_UNHANDLED_EXCEPTION(); + // then set the default values and the parameters given from the parent + Reference< XReset> xReset(xProp, UNO_QUERY); + xReset->reset(); } + + if ( m_bPreview ) + initializePreviewMode(); + + LoadFinished(sal_True); } - catch(Exception&) + + InvalidateAll(); + return bSuccess; + } + catch( const SQLException& e ) + { + Any aException( ::cppu::getCaughtException() ); + showError( SQLExceptionInfo( aException ) ); + } + catch( const WrappedTargetException& e ) + { + SQLException aSql; + if ( e.TargetException.isExtractableTo( ::cppu::UnoType< SQLException >::get() ) ) + showError( SQLExceptionInfo( e.TargetException ) ); + else { DBG_UNHANDLED_EXCEPTION(); } } + catch(Exception&) + { + DBG_UNHANDLED_EXCEPTION(); + } InvalidateAll(); return sal_False; diff --git a/dbaccess/source/ui/control/ColumnControlWindow.cxx b/dbaccess/source/ui/control/ColumnControlWindow.cxx index 5786aa26f..14024f949 100644 --- a/dbaccess/source/ui/control/ColumnControlWindow.cxx +++ b/dbaccess/source/ui/control/ColumnControlWindow.cxx @@ -93,7 +93,7 @@ void OColumnControlWindow::DeactivateAggregate( EControlType eType ) } } // ----------------------------------------------------------------------------- -void OColumnControlWindow::CellModified(long /*nRow*/, USHORT /*nColId*/ ) +void OColumnControlWindow::CellModified(long /*nRow*/, sal_uInt16 /*nColId*/ ) { saveCurrentFieldDescData(); } diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 69143f3a6..1d6d400e6 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -814,7 +814,7 @@ void OFieldDescControl::ArrangeAggregates() { Control* pctrlInputControl; // das eigentliche Control zur Eingabe Control* pctrlTextControl; // das Label dazu - USHORT nPosSizeArgument; // das zweite Argument fuer SetPosSize + sal_uInt16 nPosSizeArgument; // das zweite Argument fuer SetPosSize }; AGGREGATE_DESCRIPTION adAggregates[] = { { m_pColumnName, m_pColumnNameText, 1}, @@ -1068,9 +1068,9 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) } } // ----------------------------------------------------------------------------- -void OFieldDescControl::InitializeControl(Control* _pControl,ULONG _nHelpId,bool _bAddChangeHandler) +void OFieldDescControl::InitializeControl(Control* _pControl,const ::rtl::OString& _sHelpId,bool _bAddChangeHandler) { - _pControl->SetHelpId(_nHelpId); + _pControl->SetHelpId(_sHelpId); if ( _bAddChangeHandler ) ((OPropListBoxCtrl*)_pControl)->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl)); @@ -1079,7 +1079,7 @@ void OFieldDescControl::InitializeControl(Control* _pControl,ULONG _nHelpId,bool _pControl->EnableClipSiblings(); } // ----------------------------------------------------------------------------- -FixedText* OFieldDescControl::CreateText(USHORT _nTextRes) +FixedText* OFieldDescControl::CreateText(sal_uInt16 _nTextRes) { FixedText* pFixedText = new FixedText( this ); pFixedText->SetText( ModuleRes(_nTextRes) ); @@ -1087,15 +1087,15 @@ FixedText* OFieldDescControl::CreateText(USHORT _nTextRes) return pFixedText; } // ----------------------------------------------------------------------------- -OPropNumericEditCtrl* OFieldDescControl::CreateNumericControl(USHORT _nHelpStr,short _nProperty,ULONG _nHelpId) +OPropNumericEditCtrl* OFieldDescControl::CreateNumericControl(sal_uInt16 _nHelpStr,short _nProperty,const rtl::OString& _sHelpId) { OPropNumericEditCtrl* pControl = new OPropNumericEditCtrl( this, _nHelpStr, _nProperty, WB_BORDER ); pControl->SetDecimalDigits(0); pControl->SetMin(0); pControl->SetMax(0x7FFFFFFF); // soll draussen geaendert werden, wenn noetig - pControl->SetStrictFormat(TRUE); + pControl->SetStrictFormat(sal_True); - InitializeControl(pControl,_nHelpId,false); + InitializeControl(pControl,_sHelpId,false); return pControl; } @@ -1535,7 +1535,7 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) if(m_pType) { - USHORT nPos = pFieldType.get() ? m_pType->GetEntryPos(String(pFieldDescr->getTypeInfo()->aUIName)) : LISTBOX_ENTRY_NOTFOUND; + sal_uInt16 nPos = pFieldType.get() ? m_pType->GetEntryPos(String(pFieldDescr->getTypeInfo()->aUIName)) : LISTBOX_ENTRY_NOTFOUND; if(nPos == LISTBOX_ENTRY_NOTFOUND) { const OTypeInfoMap* pMap = getTypeInfo(); diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index 1fa2371da..e18bc79c6 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -74,14 +74,14 @@ namespace dbaui Reference< XPropertySet> m_xDestDef; - void fillListBox(const Reference< XPropertySet>& _xDest,long nRow,USHORT nColumnId); + void fillListBox(const Reference< XPropertySet>& _xDest,long nRow,sal_uInt16 nColumnId); /** returns the column id for the editbrowsebox @param _nColId the column id SOURCE_COLUMN or DEST_COLUMN @return the current column id eihter SOURCE_COLUMN or DEST_COLUMN depends on the connection data */ - USHORT getColumnIdent( USHORT _nColId ) const; + sal_uInt16 getColumnIdent( sal_uInt16 _nColId ) const; public: ORelationControl( OTableListBoxControl* pParent,const OJoinTableView::OTableWindowMap* _pTableMap ); virtual ~ORelationControl(); @@ -107,16 +107,16 @@ namespace dbaui virtual long PreNotify(NotifyEvent& rNEvt ); - virtual BOOL IsTabAllowed(BOOL bForward) const; + virtual sal_Bool IsTabAllowed(sal_Bool bForward) const; virtual void Init(const TTableConnectionData::value_type& _pConnData); virtual void Init() { ORelationControl_Base::Init(); } - virtual void InitController( ::svt::CellControllerRef& rController, long nRow, USHORT nCol ); - virtual ::svt::CellController* GetController( long nRow, USHORT nCol ); - virtual void PaintCell( OutputDevice& rDev, const Rectangle& rRect, USHORT nColId ) const; - virtual BOOL SeekRow( long nRow ); - virtual BOOL SaveModified(); - virtual String GetCellText( long nRow, USHORT nColId ) const; + virtual void InitController( ::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol ); + virtual ::svt::CellController* GetController( long nRow, sal_uInt16 nCol ); + virtual void PaintCell( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColId ) const; + virtual sal_Bool SeekRow( long nRow ); + virtual sal_Bool SaveModified(); + virtual String GetCellText( long nRow, sal_uInt16 nColId ) const; virtual void CellModified(); @@ -188,7 +188,7 @@ namespace dbaui // not the first call RowRemoved(0, GetRowCount()); - RowInserted(0, m_pConnData->GetConnLineDataList()->size() + 1, TRUE); // add one extra row + RowInserted(0, m_pConnData->GetConnLineDataList()->size() + 1, sal_True); // add one extra row } //------------------------------------------------------------------------------ void ORelationControl::Resize() @@ -227,20 +227,20 @@ namespace dbaui } //------------------------------------------------------------------------------ - BOOL ORelationControl::IsTabAllowed(BOOL bForward) const + sal_Bool ORelationControl::IsTabAllowed(sal_Bool bForward) const { DBG_CHKTHIS(ORelationControl,NULL); long nRow = GetCurRow(); - USHORT nCol = GetCurColumnId(); + sal_uInt16 nCol = GetCurColumnId(); - BOOL bRet = !(( ( bForward && (nCol == DEST_COLUMN) && (nRow == GetRowCount() - 1))) + sal_Bool bRet = !(( ( bForward && (nCol == DEST_COLUMN) && (nRow == GetRowCount() - 1))) || (!bForward && (nCol == SOURCE_COLUMN) && (nRow == 0))); return bRet && EditBrowseBox::IsTabAllowed(bForward); } //------------------------------------------------------------------------------ - BOOL ORelationControl::SaveModified() + sal_Bool ORelationControl::SaveModified() { DBG_CHKTHIS(ORelationControl,NULL); sal_Int32 nRow = GetCurRow(); @@ -267,19 +267,19 @@ namespace dbaui } } - return TRUE; + return sal_True; } //------------------------------------------------------------------------------ - USHORT ORelationControl::getColumnIdent( USHORT _nColId ) const + sal_uInt16 ORelationControl::getColumnIdent( sal_uInt16 _nColId ) const { - USHORT nId = _nColId; + sal_uInt16 nId = _nColId; if ( m_pConnData->getReferencingTable() != m_pBoxControl->getReferencingTable() ) nId = ( _nColId == SOURCE_COLUMN) ? DEST_COLUMN : SOURCE_COLUMN; return nId; } //------------------------------------------------------------------------------ - String ORelationControl::GetCellText( long nRow, USHORT nColId ) const + String ORelationControl::GetCellText( long nRow, sal_uInt16 nColId ) const { DBG_CHKTHIS(ORelationControl,NULL); String sText; @@ -300,22 +300,22 @@ namespace dbaui } //------------------------------------------------------------------------------ - void ORelationControl::InitController( CellControllerRef& /*rController*/, long nRow, USHORT nColumnId ) + void ORelationControl::InitController( CellControllerRef& /*rController*/, long nRow, sal_uInt16 nColumnId ) { DBG_CHKTHIS(ORelationControl,NULL); - ULONG nHelpId = HID_RELATIONDIALOG_LEFTFIELDCELL; + rtl::OString sHelpId( HID_RELATIONDIALOG_LEFTFIELDCELL ); Reference< XPropertySet> xDef; switch ( getColumnIdent(nColumnId) ) { case SOURCE_COLUMN: xDef = m_xSourceDef; - nHelpId = HID_RELATIONDIALOG_LEFTFIELDCELL; + sHelpId = HID_RELATIONDIALOG_LEFTFIELDCELL; break; case DEST_COLUMN: xDef = m_xDestDef; - nHelpId = HID_RELATIONDIALOG_RIGHTFIELDCELL; + sHelpId = HID_RELATIONDIALOG_RIGHTFIELDCELL; break; default: // ????????? @@ -333,27 +333,27 @@ namespace dbaui m_pListCell->SelectEntry( sName ); } - m_pListCell->SetHelpId(nHelpId); + m_pListCell->SetHelpId(sHelpId); } } //------------------------------------------------------------------------------ - CellController* ORelationControl::GetController( long /*nRow*/, USHORT /*nColumnId*/ ) + CellController* ORelationControl::GetController( long /*nRow*/, sal_uInt16 /*nColumnId*/ ) { DBG_CHKTHIS(ORelationControl,NULL); return new ListBoxCellController( m_pListCell.get() ); } //------------------------------------------------------------------------------ - BOOL ORelationControl::SeekRow( long nRow ) + sal_Bool ORelationControl::SeekRow( long nRow ) { DBG_CHKTHIS(ORelationControl,NULL); m_nDataPos = nRow; - return TRUE; + return sal_True; } //------------------------------------------------------------------------------ - void ORelationControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, USHORT nColumnId ) const + void ORelationControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId ) const { DBG_CHKTHIS(ORelationControl,NULL); String aText =const_cast< ORelationControl*>(this)->GetCellText( m_nDataPos, nColumnId ); @@ -371,7 +371,7 @@ namespace dbaui rDev.SetClipRegion(); } // ----------------------------------------------------------------------------- - void ORelationControl::fillListBox(const Reference< XPropertySet>& _xDest,long /*_nRow*/,USHORT /*nColumnId*/) + void ORelationControl::fillListBox(const Reference< XPropertySet>& _xDest,long /*_nRow*/,sal_uInt16 /*nColumnId*/) { m_pListCell->Clear(); try @@ -400,7 +400,7 @@ namespace dbaui void ORelationControl::setWindowTables(const OTableWindow* _pSource,const OTableWindow* _pDest) { // wenn ich hier gerade editiere, ausblenden - BOOL bWasEditing = IsEditing(); + sal_Bool bWasEditing = IsEditing(); if ( bWasEditing ) DeactivateCell(); @@ -636,7 +636,7 @@ OTableListBoxControl::OTableListBoxControl( Window* _pParent if ( pLines->size() >= static_cast<sal_uInt32>(m_pRC_Tables->GetRowCount()) ) { m_pRC_Tables->DeactivateCell(); - m_pRC_Tables->RowInserted(m_pRC_Tables->GetRowCount(), pLines->size() - static_cast<sal_uInt32>(m_pRC_Tables->GetRowCount()) + 1, TRUE); + m_pRC_Tables->RowInserted(m_pRC_Tables->GetRowCount(), pLines->size() - static_cast<sal_uInt32>(m_pRC_Tables->GetRowCount()) + 1, sal_True); m_pRC_Tables->ActivateCell(); } } @@ -691,9 +691,9 @@ OTableListBoxControl::OTableListBoxControl( Window* _pParent m_pRC_Tables->lateInit(); } // ----------------------------------------------------------------------------- - BOOL OTableListBoxControl::SaveModified() + sal_Bool OTableListBoxControl::SaveModified() { - BOOL bRet = m_pRC_Tables->SaveModified(); + sal_Bool bRet = m_pRC_Tables->SaveModified(); m_pRC_Tables->getData()->normalizeLines(); return bRet; } diff --git a/dbaccess/source/ui/control/TableGrantCtrl.cxx b/dbaccess/source/ui/control/TableGrantCtrl.cxx index 57ea25f50..8be7e573a 100644 --- a/dbaccess/source/ui/control/TableGrantCtrl.cxx +++ b/dbaccess/source/ui/control/TableGrantCtrl.cxx @@ -46,14 +46,14 @@ using namespace ::com::sun::star::uno; using namespace ::dbaui; using namespace ::svt; -const USHORT COL_TABLE_NAME = 1; -const USHORT COL_SELECT = 2; -const USHORT COL_INSERT = 3; -const USHORT COL_DELETE = 4; -const USHORT COL_UPDATE = 5; -const USHORT COL_ALTER = 6; -const USHORT COL_REF = 7; -const USHORT COL_DROP = 8; +const sal_uInt16 COL_TABLE_NAME = 1; +const sal_uInt16 COL_SELECT = 2; +const sal_uInt16 COL_INSERT = 3; +const sal_uInt16 COL_DELETE = 4; +const sal_uInt16 COL_UPDATE = 5; +const sal_uInt16 COL_ALTER = 6; +const sal_uInt16 COL_REF = 7; +const sal_uInt16 COL_DROP = 8; DBG_NAME(OTableGrantControl) @@ -65,13 +65,13 @@ OTableGrantControl::OTableGrantControl( Window* pParent,const ResId& _RsId) ,m_pCheckCell( NULL ) ,m_pEdit( NULL ) ,m_nDataPos( 0 ) - ,m_bEnable(TRUE) + ,m_bEnable(sal_True) ,m_nDeactivateEvent(0) { DBG_CTOR(OTableGrantControl,NULL); ////////////////////////////////////////////////////////////////////// // Spalten einfuegen - USHORT i=1; + sal_uInt16 i=1; InsertDataColumn( i, String(ModuleRes(STR_TABLE_PRIV_NAME) ), 75); FreezeColumn(i++); InsertDataColumn( i++, String(ModuleRes(STR_TABLE_PRIV_SELECT)), 75); @@ -144,11 +144,11 @@ void OTableGrantControl::Init() if(!m_pCheckCell) { m_pCheckCell = new CheckBoxControl( &GetDataWindow() ); - m_pCheckCell->GetBox().EnableTriState(FALSE); + m_pCheckCell->GetBox().EnableTriState(sal_False); m_pEdit = new Edit( &GetDataWindow() ); m_pEdit->SetReadOnly(); - m_pEdit->Enable(FALSE); + m_pEdit->Enable(sal_False); } UpdateTables(); @@ -204,17 +204,17 @@ IMPL_LINK(OTableGrantControl, AsynchDeactivate, void*, EMPTYARG) } //------------------------------------------------------------------------------ -BOOL OTableGrantControl::IsTabAllowed(BOOL bForward) const +sal_Bool OTableGrantControl::IsTabAllowed(sal_Bool bForward) const { DBG_CHKTHIS(OTableGrantControl,NULL); long nRow = GetCurRow(); - USHORT nCol = GetCurColumnId(); + sal_uInt16 nCol = GetCurColumnId(); if (bForward && (nCol == 2) && (nRow == GetRowCount() - 1)) - return FALSE; + return sal_False; if (!bForward && (nCol == 1) && (nRow == 0)) - return FALSE; + return sal_False; return EditBrowseBox::IsTabAllowed(bForward); } @@ -226,16 +226,16 @@ BOOL OTableGrantControl::IsTabAllowed(BOOL bForward) const xAuth->revokePrivileges(sTableName,PrivilegeObject::TABLE,what) //------------------------------------------------------------------------------ -BOOL OTableGrantControl::SaveModified() +sal_Bool OTableGrantControl::SaveModified() { DBG_CHKTHIS(OTableGrantControl,NULL); sal_Int32 nRow = GetCurRow(); if(nRow == -1 || nRow >= m_aTableNames.getLength()) - return FALSE; + return sal_False; ::rtl::OUString sTableName = m_aTableNames[nRow]; - BOOL bErg = TRUE; + sal_Bool bErg = sal_True; try { @@ -274,7 +274,7 @@ BOOL OTableGrantControl::SaveModified() } catch(SQLException& e) { - bErg = FALSE; + bErg = sal_False; ::dbaui::showError(::dbtools::SQLExceptionInfo(e),GetParent(),m_xORB); } if(bErg && Controller().Is()) @@ -286,7 +286,7 @@ BOOL OTableGrantControl::SaveModified() } //------------------------------------------------------------------------------ -String OTableGrantControl::GetCellText( long nRow, USHORT nColId ) const +String OTableGrantControl::GetCellText( long nRow, sal_uInt16 nColId ) const { DBG_CHKTHIS(OTableGrantControl,NULL); if(COL_TABLE_NAME == nColId) @@ -301,7 +301,7 @@ String OTableGrantControl::GetCellText( long nRow, USHORT nColId ) const } //------------------------------------------------------------------------------ -void OTableGrantControl::InitController( CellControllerRef& /*rController*/, long nRow, USHORT nColumnId ) +void OTableGrantControl::InitController( CellControllerRef& /*rController*/, long nRow, sal_uInt16 nColumnId ) { DBG_CHKTHIS(OTableGrantControl,NULL); String sTablename = m_aTableNames[nRow]; @@ -312,7 +312,7 @@ void OTableGrantControl::InitController( CellControllerRef& /*rController*/, lon { // get the privileges from the user TTablePrivilegeMap::const_iterator aFind = findPrivilege(nRow); - m_pCheckCell->GetBox().Check(aFind != m_aPrivMap.end() ? isAllowed(nColumnId,aFind->second.nRights) : FALSE); + m_pCheckCell->GetBox().Check(aFind != m_aPrivMap.end() ? isAllowed(nColumnId,aFind->second.nRights) : sal_False); } } // ----------------------------------------------------------------------------- @@ -347,7 +347,7 @@ void OTableGrantControl::fillPrivilege(sal_Int32 _nRow) const } } // ----------------------------------------------------------------------------- -sal_Bool OTableGrantControl::isAllowed(USHORT _nColumnId,sal_Int32 _nPrivilege) const +sal_Bool OTableGrantControl::isAllowed(sal_uInt16 _nColumnId,sal_Int32 _nPrivilege) const { sal_Bool bAllowed = sal_False; switch (_nColumnId) @@ -389,7 +389,7 @@ void OTableGrantControl::setGrantUser(const Reference< XAuthorizable>& _xGrantUs m_xGrantUser = _xGrantUser; } //------------------------------------------------------------------------------ -CellController* OTableGrantControl::GetController( long nRow, USHORT nColumnId ) +CellController* OTableGrantControl::GetController( long nRow, sal_uInt16 nColumnId ) { DBG_CHKTHIS(OTableGrantControl,NULL); @@ -417,7 +417,7 @@ CellController* OTableGrantControl::GetController( long nRow, USHORT nColumnId ) return pController; } //------------------------------------------------------------------------------ -BOOL OTableGrantControl::SeekRow( long nRow ) +sal_Bool OTableGrantControl::SeekRow( long nRow ) { DBG_CHKTHIS(OTableGrantControl,NULL); m_nDataPos = nRow; @@ -426,7 +426,7 @@ BOOL OTableGrantControl::SeekRow( long nRow ) } //------------------------------------------------------------------------------ -void OTableGrantControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, USHORT nColumnId ) const +void OTableGrantControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId ) const { DBG_CHKTHIS(OTableGrantControl,NULL); @@ -436,7 +436,7 @@ void OTableGrantControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, if(aFind != m_aPrivMap.end()) PaintTristate(rDev, rRect, isAllowed(nColumnId,aFind->second.nRights) ? STATE_CHECK : STATE_NOCHECK,isAllowed(nColumnId,aFind->second.nWithGrant)); else - PaintTristate(rDev, rRect, STATE_NOCHECK,FALSE); + PaintTristate(rDev, rRect, STATE_NOCHECK,sal_False); } else { @@ -477,11 +477,11 @@ OTableGrantControl::TTablePrivilegeMap::const_iterator OTableGrantControl::findP // ----------------------------------------------------------------------------- Reference< XAccessible > OTableGrantControl::CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) { - USHORT nColumnId = GetColumnId( _nColumnPos ); + sal_uInt16 nColumnId = GetColumnId( _nColumnPos ); if(nColumnId != COL_TABLE_NAME) { TriState eState = STATE_NOCHECK; - BOOL bEnable = FALSE; + sal_Bool bEnable = sal_False; TTablePrivilegeMap::const_iterator aFind = findPrivilege(_nRow); if(aFind != m_aPrivMap.end()) { diff --git a/dbaccess/source/ui/control/charsetlistbox.cxx b/dbaccess/source/ui/control/charsetlistbox.cxx index 02628e3f1..e420bb191 100644 --- a/dbaccess/source/ui/control/charsetlistbox.cxx +++ b/dbaccess/source/ui/control/charsetlistbox.cxx @@ -99,7 +99,7 @@ namespace dbaui } //-------------------------------------------------------------------- - bool CharSetListBox::StoreSelectedCharSet( SfxItemSet& _rSet, const USHORT _nItemId ) + bool CharSetListBox::StoreSelectedCharSet( SfxItemSet& _rSet, const sal_uInt16 _nItemId ) { bool bChangedSomething = false; if ( GetSelectEntryPos() != GetSavedValue() ) diff --git a/dbaccess/source/ui/control/curledit.cxx b/dbaccess/source/ui/control/curledit.cxx index 0e0b1a687..49f585081 100644 --- a/dbaccess/source/ui/control/curledit.cxx +++ b/dbaccess/source/ui/control/curledit.cxx @@ -41,7 +41,7 @@ namespace dbaui //========================================================================= //= OConnectionURLEdit //========================================================================= -OConnectionURLEdit::OConnectionURLEdit(Window* _pParent, const ResId& _rResId,BOOL _bShowPrefix) +OConnectionURLEdit::OConnectionURLEdit(Window* _pParent, const ResId& _rResId,sal_Bool _bShowPrefix) :Edit(_pParent, _rResId) ,m_pTypeCollection(NULL) ,m_pForcedPrefix(NULL) @@ -144,7 +144,7 @@ String OConnectionURLEdit::GetText() const return Edit::GetText(); } // ----------------------------------------------------------------------------- -void OConnectionURLEdit::ShowPrefix(BOOL _bShowPrefix) +void OConnectionURLEdit::ShowPrefix(sal_Bool _bShowPrefix) { m_bShowPrefix = _bShowPrefix; if ( m_pForcedPrefix ) diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index b25d34b41..72c15c3f8 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -97,7 +97,7 @@ DBTreeListBox::DBTreeListBox( Window* pParent, const Reference< XMultiServiceFac // ----------------------------------------------------------------------------- void DBTreeListBox::init() { - USHORT nSize = SPACEBETWEENENTRIES; + sal_uInt16 nSize = SPACEBETWEENENTRIES; SetSpaceBetweenEntries(nSize); m_aTimer.SetTimeout(900); @@ -109,6 +109,8 @@ void DBTreeListBox::init() SetNodeDefaultImages( ); EnableContextMenuHandling(); + + SetStyle( GetStyle() | WB_QUICK_SEARCH ); } //------------------------------------------------------------------------ DBTreeListBox::~DBTreeListBox() @@ -124,8 +126,8 @@ SvLBoxEntry* DBTreeListBox::GetEntryPosByName( const String& aName, SvLBoxEntry* SvLBoxEntry* pEntry = NULL; if ( pChilds ) { - ULONG nCount = pChilds->Count(); - for (ULONG i=0; i < nCount; ++i) + sal_uLong nCount = pChilds->Count(); + for (sal_uLong i=0; i < nCount; ++i) { pEntry = static_cast<SvLBoxEntry*>(pChilds->GetObject(i)); SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); @@ -349,7 +351,7 @@ void DBTreeListBox::RequestHelp( const HelpEvent& rHEvt ) void DBTreeListBox::KeyInput( const KeyEvent& rKEvt ) { KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction(); - USHORT nCode = rKEvt.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); sal_Bool bHandled = sal_False; if(eFunc != KEYFUNC_DONTKNOW) @@ -409,12 +411,12 @@ void DBTreeListBox::KeyInput( const KeyEvent& rKEvt ) SvTreeListBox::KeyInput(rKEvt); } // ----------------------------------------------------------------------------- -BOOL DBTreeListBox::EditingEntry( SvLBoxEntry* pEntry, Selection& /*_aSelection*/) +sal_Bool DBTreeListBox::EditingEntry( SvLBoxEntry* pEntry, Selection& /*_aSelection*/) { return m_aEditingHandler.Call(pEntry) != 0; } // ----------------------------------------------------------------------------- -BOOL DBTreeListBox::EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ) +sal_Bool DBTreeListBox::EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ) { DBTreeEditedEntry aEntry; aEntry.pEntry = pEntry; @@ -426,11 +428,11 @@ BOOL DBTreeListBox::EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText } SetEntryText(pEntry,aEntry.aNewText); - return FALSE; // we never want that the base change our text + return sal_False; // we never want that the base change our text } // ----------------------------------------------------------------------------- -BOOL DBTreeListBox::DoubleClickHdl() +sal_Bool DBTreeListBox::DoubleClickHdl() { long nResult = aDoubleClickHdl.Call( this ); // continue default processing if the DoubleClickHandler didn't handle it @@ -467,12 +469,12 @@ namespace if ( !_pPopup ) return; - USHORT nCount = _pPopup->GetItemCount(); - for (USHORT i=0; i < nCount; ++i) + sal_uInt16 nCount = _pPopup->GetItemCount(); + for (sal_uInt16 i=0; i < nCount; ++i) { if ( _pPopup->GetItemType(i) != MENUITEM_SEPARATOR ) { - USHORT nId = _pPopup->GetItemId(i); + sal_uInt16 nId = _pPopup->GetItemId(i); PopupMenu* pSubPopUp = _pPopup->GetPopupMenu(nId); if ( pSubPopUp ) { @@ -499,14 +501,14 @@ namespace { void lcl_adjustMenuItemIDs( Menu& _rMenu, IController& _rCommandController ) { - USHORT nCount = _rMenu.GetItemCount(); - for ( USHORT pos = 0; pos < nCount; ++pos ) + sal_uInt16 nCount = _rMenu.GetItemCount(); + for ( sal_uInt16 pos = 0; pos < nCount; ++pos ) { // do not adjust separators if ( _rMenu.GetItemType( pos ) == MENUITEM_SEPARATOR ) continue; - USHORT nId = _rMenu.GetItemId(pos); + sal_uInt16 nId = _rMenu.GetItemId(pos); String aCommand = _rMenu.GetItemCommand( nId ); PopupMenu* pPopup = _rMenu.GetPopupMenu( nId ); if ( pPopup ) @@ -515,7 +517,7 @@ namespace continue; } - const USHORT nCommandId = _rCommandController.registerCommandURL( aCommand ); + const sal_uInt16 nCommandId = _rCommandController.registerCommandURL( aCommand ); _rMenu.InsertItem( nCommandId, _rMenu.GetItemText( nId ), _rMenu.GetItemImage( nId ), _rMenu.GetItemBits( nId ), pos ); @@ -535,14 +537,14 @@ namespace uno::Reference< frame::XFrame> xFrame; if ( xController.is() ) xFrame = xController->getFrame(); - USHORT nCount = _rMenu.GetItemCount(); - for ( USHORT pos = 0; pos < nCount; ++pos ) + sal_uInt16 nCount = _rMenu.GetItemCount(); + for ( sal_uInt16 pos = 0; pos < nCount; ++pos ) { // do not adjust separators if ( _rMenu.GetItemType( pos ) == MENUITEM_SEPARATOR ) continue; - USHORT nId = _rMenu.GetItemId(pos); + sal_uInt16 nId = _rMenu.GetItemId(pos); String aCommand = _rMenu.GetItemCommand( nId ); PopupMenu* pPopup = _rMenu.GetPopupMenu( nId ); if ( pPopup ) @@ -552,7 +554,7 @@ namespace } if ( xFrame.is() ) - _rMenu.SetItemImage(nId,framework::GetImageFromURL(xFrame,aCommand,FALSE)); + _rMenu.SetItemImage(nId,framework::GetImageFromURL(xFrame,aCommand,sal_False)); } } // ========================================================================= @@ -696,7 +698,7 @@ PopupMenu* DBTreeListBox::CreateContextMenu( void ) } // ----------------------------------------------------------------------------- -void DBTreeListBox::ExcecuteContextMenuAction( USHORT _nSelectedPopupEntry ) +void DBTreeListBox::ExcecuteContextMenuAction( sal_uInt16 _nSelectedPopupEntry ) { if ( m_pContextMenuProvider && _nSelectedPopupEntry ) m_pContextMenuProvider->getCommandController().executeChecked( _nSelectedPopupEntry, Sequence< PropertyValue >() ); diff --git a/dbaccess/source/ui/control/listviewitems.cxx b/dbaccess/source/ui/control/listviewitems.cxx index 7de4fc35b..ab37eae15 100644 --- a/dbaccess/source/ui/control/listviewitems.cxx +++ b/dbaccess/source/ui/control/listviewitems.cxx @@ -55,7 +55,7 @@ namespace dbaui } //------------------------------------------------------------------------ - USHORT OBoldListboxString::IsA() + sal_uInt16 OBoldListboxString::IsA() { return SV_ITEM_ID_BOLDLBSTRING; } diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx index c95a48c84..e02b7c000 100644 --- a/dbaccess/source/ui/control/opendoccontrols.cxx +++ b/dbaccess/source/ui/control/opendoccontrols.cxx @@ -197,8 +197,8 @@ namespace dbaui // Place icon left of text and both centered in the button. SetModeImage( GetCommandIcon( ".uno:Open", m_sModule ) ); - EnableImageDisplay( TRUE ); - EnableTextDisplay( TRUE ); + EnableImageDisplay( sal_True ); + EnableTextDisplay( sal_True ); SetImageAlign( IMAGEALIGN_LEFT ); SetStyle( GetStyle() | WB_CENTER ); } @@ -257,7 +257,7 @@ namespace dbaui String sDecodedURL = aURL.GetMainURL( INetURLObject::NO_DECODE ); - USHORT nPos = InsertEntry( sTitle ); + sal_uInt16 nPos = InsertEntry( sTitle ); m_aURLs.insert( MapIndexToStringPair::value_type( nPos, StringPair( sDecodedURL, sFilter ) ) ); } } @@ -272,7 +272,7 @@ namespace dbaui String OpenDocumentListBox::GetSelectedDocumentURL() const { String sURL; - USHORT nSelected = GetSelectEntryPos(); + sal_uInt16 nSelected = GetSelectEntryPos(); if ( LISTBOX_ENTRY_NOTFOUND != GetSelectEntryPos() ) sURL = impl_getDocumentAtIndex( nSelected ).first; return sURL; @@ -282,14 +282,14 @@ namespace dbaui String OpenDocumentListBox::GetSelectedDocumentFilter() const { String sFilter; - USHORT nSelected = GetSelectEntryPos(); + sal_uInt16 nSelected = GetSelectEntryPos(); if ( LISTBOX_ENTRY_NOTFOUND != GetSelectEntryPos() ) sFilter = impl_getDocumentAtIndex( nSelected ).second; return sFilter; } //-------------------------------------------------------------------- - OpenDocumentListBox::StringPair OpenDocumentListBox::impl_getDocumentAtIndex( USHORT _nListIndex, bool _bSystemNotation ) const + OpenDocumentListBox::StringPair OpenDocumentListBox::impl_getDocumentAtIndex( sal_uInt16 _nListIndex, bool _bSystemNotation ) const { MapIndexToStringPair::const_iterator pos = m_aURLs.find( _nListIndex ); OSL_ENSURE( pos != m_aURLs.end(), "OpenDocumentListBox::impl_getDocumentAtIndex: invalid index!" ); @@ -316,7 +316,7 @@ namespace dbaui return; Point aRequestPos( ScreenToOutputPixel( _rHEvt.GetMousePosPixel() ) ); - USHORT nItemIndex = LISTBOX_ENTRY_NOTFOUND; + sal_uInt16 nItemIndex = LISTBOX_ENTRY_NOTFOUND; if ( GetIndexForPoint( aRequestPos, nItemIndex ) != -1 ) { Rectangle aItemRect( GetBoundingRectangle( nItemIndex ) ); diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx index 066085de7..ab4cf4e3b 100644 --- a/dbaccess/source/ui/control/sqledit.cxx +++ b/dbaccess/source/ui/control/sqledit.cxx @@ -69,7 +69,7 @@ OSqlEdit::OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle ) : m_ColorConfig.AddListener(this); //#i97044# - EnableFocusSelectionHide( FALSE ); + EnableFocusSelectionHide( sal_False ); } //------------------------------------------------------------------------------ @@ -127,11 +127,11 @@ IMPL_LINK(OSqlEdit, OnUndoActionTimer, void*, EMPTYARG) if(aText != m_strOrigText) { OJoinController& rController = m_pView->getContainerWindow()->getDesignView()->getController(); - SfxUndoManager* pUndoMgr = rController.getUndoMgr(); + SfxUndoManager& rUndoMgr = rController.GetUndoManager(); OSqlEditUndoAct* pUndoAct = new OSqlEditUndoAct( this ); pUndoAct->SetOriginalText( m_strOrigText ); - pUndoMgr->AddUndoAction( pUndoAct ); + rUndoMgr.AddUndoAction( pUndoAct ); rController.InvalidateFeature(SID_UNDO); rController.InvalidateFeature(SID_REDO); diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index 3c78e436f..c32b2b1bf 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -131,8 +131,8 @@ void OTableTreeListBox::notifyHiContrastChanged() SvLBoxEntry* pEntryLoop = First(); while (pEntryLoop) { - USHORT nCount = pEntryLoop->ItemCount(); - for (USHORT i=0;i<nCount;++i) + sal_uInt16 nCount = pEntryLoop->ItemCount(); + for (sal_uInt16 i=0;i<nCount;++i) { SvLBoxItem* pItem = pEntryLoop->GetItem(i); if ( pItem && pItem->IsA() == SV_ITEM_ID_LBOXCONTEXTBMP) @@ -298,7 +298,7 @@ void OTableTreeListBox::UpdateTableList( const Reference< XConnection >& _rxConn sRootEntryText = String(ModuleRes(STR_ALL_VIEWS)); else sRootEntryText = String(ModuleRes(STR_ALL_TABLES_AND_VIEWS)); - InsertEntry( sRootEntryText, NULL, FALSE, LIST_APPEND, reinterpret_cast< void* >( DatabaseObjectContainer::TABLES ) ); + InsertEntry( sRootEntryText, NULL, sal_False, LIST_APPEND, reinterpret_cast< void* >( DatabaseObjectContainer::TABLES ) ); } if ( _rTables.empty() ) @@ -344,7 +344,7 @@ void OTableTreeListBox::UpdateTableList( const Reference< XConnection >& _rxConn { SvLBoxEntry* pFolder = GetEntryPosByName( *folder, pRootEntry ); if ( !pFolder ) - pFolder = InsertEntry( *folder, pRootEntry, FALSE, LIST_APPEND, reinterpret_cast< void* >( nFolderType ) ); + pFolder = InsertEntry( *folder, pRootEntry, sal_False, LIST_APPEND, reinterpret_cast< void* >( nFolderType ) ); } } } @@ -481,7 +481,7 @@ SvLBoxEntry* OTableTreeListBox::implAddEntry( { SvLBoxEntry* pFolder = GetEntryPosByName( rFirstName, pParentEntry ); if ( !pFolder ) - pFolder = InsertEntry( rFirstName, pParentEntry, FALSE, LIST_APPEND, reinterpret_cast< void* >( nFirstFolderType ) ); + pFolder = InsertEntry( rFirstName, pParentEntry, sal_False, LIST_APPEND, reinterpret_cast< void* >( nFirstFolderType ) ); pParentEntry = pFolder; } @@ -489,14 +489,14 @@ SvLBoxEntry* OTableTreeListBox::implAddEntry( { SvLBoxEntry* pFolder = GetEntryPosByName( rSecondName, pParentEntry ); if ( !pFolder ) - pFolder = InsertEntry( rSecondName, pParentEntry, FALSE, LIST_APPEND, reinterpret_cast< void* >( nSecondFolderType ) ); + pFolder = InsertEntry( rSecondName, pParentEntry, sal_False, LIST_APPEND, reinterpret_cast< void* >( nSecondFolderType ) ); pParentEntry = pFolder; } SvLBoxEntry* pRet = NULL; if ( !_bCheckName || !GetEntryPosByName( sName, pParentEntry ) ) { - pRet = InsertEntry( sName, pParentEntry, FALSE, LIST_APPEND ); + pRet = InsertEntry( sName, pParentEntry, sal_False, LIST_APPEND ); Image aImage; m_pImageProvider->getImages( _rTableName, DatabaseObject::TABLE, aImage ); diff --git a/dbaccess/source/ui/control/toolboxcontroller.cxx b/dbaccess/source/ui/control/toolboxcontroller.cxx index 685faf364..180e318aa 100644 --- a/dbaccess/source/ui/control/toolboxcontroller.cxx +++ b/dbaccess/source/ui/control/toolboxcontroller.cxx @@ -67,7 +67,7 @@ namespace dbaui namespace { - void lcl_copy(Menu* _pMenu,USHORT _nMenuId,USHORT _nMenuPos,ToolBox* _pToolBox,USHORT _nToolId,const ::rtl::OUString& _sCommand) + void lcl_copy(Menu* _pMenu,sal_uInt16 _nMenuId,sal_uInt16 _nMenuPos,ToolBox* _pToolBox,sal_uInt16 _nToolId,const ::rtl::OUString& _sCommand) { if ( _pMenu->GetItemType(_nMenuPos) != MENUITEM_STRING ) _pToolBox->SetItemImage(_nToolId, _pMenu->GetItemImage(_nMenuId)); @@ -140,10 +140,10 @@ namespace dbaui ToolBox* pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent())); if ( pToolBox ) { - USHORT nCount = pToolBox->GetItemCount(); - for (USHORT nPos = 0; nPos < nCount; ++nPos) + sal_uInt16 nCount = pToolBox->GetItemCount(); + for (sal_uInt16 nPos = 0; nPos < nCount; ++nPos) { - USHORT nItemId = pToolBox->GetItemId(nPos); + sal_uInt16 nItemId = pToolBox->GetItemId(nPos); if ( pToolBox->GetItemCommand(nItemId) == String(m_aCommandURL) ) { m_nToolBoxId = nItemId; @@ -167,10 +167,10 @@ namespace dbaui if ( m_aCommandURL == aFind->first && !Event.IsEnabled ) { ::std::auto_ptr<PopupMenu> pMenu = getMenu(); - USHORT nCount = pMenu->GetItemCount(); - for (USHORT i = 0; i < nCount; ++i) + sal_uInt16 nCount = pMenu->GetItemCount(); + for (sal_uInt16 i = 0; i < nCount; ++i) { - USHORT nItemId = pMenu->GetItemId(i); + sal_uInt16 nItemId = pMenu->GetItemId(i); aFind = m_aStates.find(pMenu->GetItemCommand(nItemId)); if ( aFind != m_aStates.end() && aFind->second ) { @@ -202,13 +202,13 @@ namespace dbaui short nImageType = hasBigImages() ? ImageType::SIZE_LARGE : ImageType::SIZE_DEFAULT; Sequence< ::rtl::OUString> aSeq(1); - USHORT nCount = pMenu->GetItemCount(); - for (USHORT nPos = 0; nPos < nCount; ++nPos) + sal_uInt16 nCount = pMenu->GetItemCount(); + for (sal_uInt16 nPos = 0; nPos < nCount; ++nPos) { if ( pMenu->GetItemType( nPos ) == MENUITEM_SEPARATOR ) continue; - USHORT nItemId = pMenu->GetItemId(nPos); + sal_uInt16 nItemId = pMenu->GetItemId(nPos); aSeq[0] = pMenu->GetItemCommand(nItemId); Sequence< Reference<XGraphic> > aImages = xImageMgr->getImages(nImageType,aSeq); @@ -242,7 +242,7 @@ namespace dbaui ToolBox* pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent())); ::std::auto_ptr<PopupMenu> pMenu = getMenu(); - USHORT nSelected = pMenu->Execute(pToolBox, pToolBox->GetItemRect( m_nToolBoxId ),POPUPMENU_EXECUTE_DOWN); + sal_uInt16 nSelected = pMenu->Execute(pToolBox, pToolBox->GetItemRect( m_nToolBoxId ),POPUPMENU_EXECUTE_DOWN); // "cleanup" the toolbox state Point aPoint = pToolBox->GetItemRect( m_nToolBoxId ).TopLeft(); MouseEvent aLeave( aPoint, 0, MOUSE_LEAVEWINDOW | MOUSE_SYNTHETIC ); diff --git a/dbaccess/source/ui/dlg/AdabasStat.cxx b/dbaccess/source/ui/dlg/AdabasStat.cxx index 52624564d..af03c78d5 100644 --- a/dbaccess/source/ui/dlg/AdabasStat.cxx +++ b/dbaccess/source/ui/dlg/AdabasStat.cxx @@ -119,8 +119,8 @@ OAdabasStatistics::OAdabasStatistics( Window* pParent, double nUsedPages = xRow->getInt(1) / 256; double nFreePages = xRow->getInt(2) / 256; - m_ET_SIZE.SetText(::rtl::OUString::valueOf((INT32)nUsedPages)); - m_ET_FREESIZE.SetText(::rtl::OUString::valueOf((INT32)nFreePages)); + m_ET_SIZE.SetText(::rtl::OUString::valueOf((sal_Int32)nUsedPages)); + m_ET_FREESIZE.SetText(::rtl::OUString::valueOf((sal_Int32)nFreePages)); m_ET_MEMORYUSING.SetValue(static_cast<sal_Int32>(((nUsedPages-nFreePages)/nUsedPages)*100)); } else diff --git a/dbaccess/source/ui/dlg/AdabasStat.src b/dbaccess/source/ui/dlg/AdabasStat.src index 939b736e9..bb083ade5 100644 --- a/dbaccess/source/ui/dlg/AdabasStat.src +++ b/dbaccess/source/ui/dlg/AdabasStat.src @@ -37,6 +37,7 @@ ModalDialog DLG_ADABASSTAT { + HelpID = "dbaccess:ModalDialog:DLG_ADABASSTAT"; OutputSize = TRUE ; Moveable = TRUE ; Closeable = TRUE ; @@ -59,6 +60,7 @@ ModalDialog DLG_ADABASSTAT Edit ET_SYSDEVSPACE { + HelpID = "dbaccess:Edit:DLG_ADABASSTAT:ET_SYSDEVSPACE"; Border = TRUE ; Pos = MAP_APPFONT ( 120 , 14 ) ; Size = MAP_APPFONT ( 128 , 12 ) ; @@ -75,6 +77,7 @@ ModalDialog DLG_ADABASSTAT Edit ET_TRANSACTIONLOG { + HelpID = "dbaccess:Edit:DLG_ADABASSTAT:ET_TRANSACTIONLOG"; Border = TRUE ; Pos = MAP_APPFONT ( 120 , 31 ) ; Size = MAP_APPFONT ( 128 , 12 ) ; @@ -91,6 +94,7 @@ ModalDialog DLG_ADABASSTAT ListBox LB_DATADEVS { + HelpID = "dbaccess:ListBox:DLG_ADABASSTAT:LB_DATADEVS"; Border = TRUE ; Pos = MAP_APPFONT ( 120 , 48 ) ; Size = MAP_APPFONT ( 128 , 42 ) ; @@ -115,6 +119,7 @@ ModalDialog DLG_ADABASSTAT Edit ET_SIZE { + HelpID = "dbaccess:Edit:DLG_ADABASSTAT:ET_SIZE"; Border = TRUE ; Pos = MAP_APPFONT ( 120 , 109 ) ; Size = MAP_APPFONT ( 60 , 12 ) ; @@ -131,6 +136,7 @@ ModalDialog DLG_ADABASSTAT Edit ET_FREESIZE { + HelpID = "dbaccess:Edit:DLG_ADABASSTAT:ET_FREESIZE"; Border = TRUE ; Pos = MAP_APPFONT ( 120 , 126 ) ; Size = MAP_APPFONT ( 60 , 12 ) ; @@ -147,6 +153,7 @@ ModalDialog DLG_ADABASSTAT NumericField ET_MEMORYUSING { + HelpID = "dbaccess:NumericField:DLG_ADABASSTAT:ET_MEMORYUSING"; Border = TRUE ; Pos = MAP_APPFONT ( 120 , 144 ) ; Size = MAP_APPFONT ( 60 , 12 ) ; diff --git a/dbaccess/source/ui/dlg/AutoControls_tmpl.hrc b/dbaccess/source/ui/dlg/AutoControls_tmpl.hrc index 5ec09c3ae..3d837e2e4 100644 --- a/dbaccess/source/ui/dlg/AutoControls_tmpl.hrc +++ b/dbaccess/source/ui/dlg/AutoControls_tmpl.hrc @@ -126,7 +126,7 @@ // ------------------------------------------------------------------------------------------------- -#define AUTO_BROWSECONTROLGROUP( AUTO_X, AUTO_Y, AUTOPAGE_X, AUTO_HID) \ +#define AUTO_BROWSECONTROLGROUP( AUTO_X, AUTO_Y, AUTOPAGE_X, AUTO_HID, AUTO_HID2) \ FixedText FT_AUTOBROWSEURL { \ Pos = MAP_APPFONT ( AUTO_X , AUTO_Y ) ; \ Size = MAP_APPFONT ( AUTOPAGE_X - AUTO_X - 6 , FIXEDTEXT_HEIGHT ) ; \ @@ -147,7 +147,7 @@ { \ Pos = MAP_APPFONT ( AUTOPAGE_X - BUTTON_WIDTH - 6 , AUTO_Y + FIXEDTEXT_HEIGHT + 2 ) ; \ Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; \ - HelpId = (AUTO_HID + 1); \ + HelpId = AUTO_HID2; \ TabStop = TRUE ; \ Text[ en-US ] = "Browse"; \ }; @@ -214,7 +214,9 @@ // -------------------------------------------------------------------------------------------------- - +// MBA: the HID set in the FixText can't make any sense; in case this macro was called from within the +// AUTOHELP_JDBCCONTROLGROUP, the FixText would have got the same HID as an EditField from the +// also called AUTO_JDBCDRIVERCLASSGROUP macro; thus I conclude that we can remove the HID from the FixedText #define AUTO_PORTCONTROLGROUP(AUTO_Y, AUTO_HID) \ FixedText FT_AUTOPORTNUMBER \ { \ @@ -235,7 +237,6 @@ \ FixedText FT_AUTOPORTNUMBERDEFAULT \ { \ - HelpId = AUTO_HID + 1 ; \ Pos = MAP_APPFONT (EDIT_X + 22 + UNRELATED_CONTROLS, AUTO_Y +2) ; \ Size = MAP_APPFONT ( WIZARD_PAGE_X - EDIT_X - 22 - UNRELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ; \ Text[ en-US ] = "" ; \ @@ -445,9 +446,9 @@ // -------------------------------------------------------------------------------------------------- -#define AUTO_HELP_BROWSECONTROLGROUP(AUTO_LINECOUNT, AUTO_HID) \ +#define AUTO_HELP_BROWSECONTROLGROUP(AUTO_LINECOUNT, AUTO_HID, AUTO_HID2) \ AUTO_WIZARDHELPTEXT(AUTO_LINECOUNT) \ - AUTO_BROWSECONTROLGROUP(START_X, INIT_Y + AUTO_LINECOUNT * FIXEDTEXT_HEIGHT + 2, WIZARD_PAGE_X, AUTO_HID) + AUTO_BROWSECONTROLGROUP(START_X, INIT_Y + AUTO_LINECOUNT * FIXEDTEXT_HEIGHT + 2, WIZARD_PAGE_X, AUTO_HID, AUTO_HID2) // -------------------------------------------------------------------------------------------------- @@ -455,7 +456,7 @@ // -------------------------------------------------------------------------------------------------- -#define AUTO_JDBCDRIVERCLASSGROUP(AUTO_Y, AUTO_HID) \ +#define AUTO_JDBCDRIVERCLASSGROUP(AUTO_Y, AUTO_HID, AUTO_HID2) \ \ FixedText FT_AUTOJDBCDRIVERCLASS \ { \ @@ -479,7 +480,7 @@ Pos = MAP_APPFONT ( WIZARD_PAGE_X - BUTTON_WIDTH - UNRELATED_CONTROLS , AUTO_Y + FIXEDTEXT_HEIGHT + 2) ; \ Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; \ Size = MAP_APPFONT (50, 14); \ - HelpId = AUTO_HID + 1; \ + HelpId = AUTO_HID2; \ Text[ en-US ] = "Test class" ; \ }; @@ -502,13 +503,13 @@ }; -#define AUTOHELP_JDBCCONTROLGROUP( AUTO_HID ) \ +#define AUTOHELP_JDBCCONTROLGROUP( AUTO_HID, AUTO_HID2, AUTO_HID3, AUTO_HID4, AUTO_HID5 ) \ AUTO_WIZARDHELPTEXT( 6 ) \ AUTO_NAMECONTROLGROUP( INIT_Y + 6 * FIXEDTEXT_HEIGHT + 2, AUTO_HID ) \ - AUTO_HOSTCONTROLGROUP(96, AUTO_HID + 1) \ - AUTO_PORTCONTROLGROUP(113, AUTO_HID + 2 ) \ + AUTO_HOSTCONTROLGROUP(96, AUTO_HID2) \ + AUTO_PORTCONTROLGROUP(113, AUTO_HID3 ) \ AUTO_SOCKETCONTROLGROUP(129) \ - AUTO_JDBCDRIVERCLASSGROUP(146, AUTO_HID + 3) + AUTO_JDBCDRIVERCLASSGROUP(146, AUTO_HID4, AUTO_HID5) // -------------------------------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx index 2b8ab81e8..e10396c72 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -213,7 +213,7 @@ IMPL_LINK( OCollectionView, Save_Click, PushButton*, EMPTYARG ) return 0; } m_aName.SetText(sName); - EndDialog( TRUE ); + EndDialog( sal_True ); } } catch( const Exception& ) @@ -300,7 +300,7 @@ IMPL_LINK( OCollectionView, Dbl_Click_FileView, SvtFileView*, EMPTYARG ) // ----------------------------------------------------------------------------- void OCollectionView::initCurrentPath() { - BOOL bEnable = FALSE; + sal_Bool bEnable = sal_False; try { if ( m_xContent.is() ) diff --git a/dbaccess/source/ui/dlg/CollectionView.src b/dbaccess/source/ui/dlg/CollectionView.src index fb9d9c68d..bdb50859a 100644 --- a/dbaccess/source/ui/dlg/CollectionView.src +++ b/dbaccess/source/ui/dlg/CollectionView.src @@ -62,6 +62,7 @@ ModalDialog DLG_COLLECTION_VIEW }; ImageButton BTN_EXPLORERFILE_NEWFOLDER { + HelpID = "dbaccess:ImageButton:DLG_COLLECTION_VIEW:BTN_EXPLORERFILE_NEWFOLDER"; TabStop = FALSE ; Pos = MAP_APPFONT ( WIN_X - UNRELATED_CONTROLS - RELATED_CONTROLS - 2*IMG_SIZE, UNRELATED_CONTROLS ) ; Size = MAP_APPFONT ( IMG_SIZE , IMG_SIZE ) ; @@ -69,6 +70,7 @@ ModalDialog DLG_COLLECTION_VIEW }; ImageButton BTN_EXPLORERFILE_UP { + HelpID = "dbaccess:ImageButton:DLG_COLLECTION_VIEW:BTN_EXPLORERFILE_UP"; TabStop = TRUE ; Pos = MAP_APPFONT ( WIN_X - UNRELATED_CONTROLS - IMG_SIZE, UNRELATED_CONTROLS ) ; Size = MAP_APPFONT ( IMG_SIZE , IMG_SIZE ) ; @@ -91,6 +93,7 @@ ModalDialog DLG_COLLECTION_VIEW }; Edit ED_EXPLORERFILE_FILENAME { + HelpID = "dbaccess:Edit:DLG_COLLECTION_VIEW:ED_EXPLORERFILE_FILENAME"; Pos = MAP_APPFONT ( RELATED_CONTROLS + UNRELATED_CONTROLS + 50 , WIN_Y - 3*UNRELATED_CONTROLS - BUTTON_HEIGHT - FIXEDLINE_HEIGHT - EDIT_HEIGHT) ; Size = MAP_APPFONT ( WIN_X - RELATED_CONTROLS - 2*UNRELATED_CONTROLS - 50 , EDIT_HEIGHT ) ; Border = TRUE ; @@ -105,6 +108,7 @@ ModalDialog DLG_COLLECTION_VIEW PushButton BTN_EXPLORERFILE_SAVE { + HelpID = "dbaccess:PushButton:DLG_COLLECTION_VIEW:BTN_EXPLORERFILE_SAVE"; Pos = MAP_APPFONT ( WIN_X - 2*UNRELATED_CONTROLS - RELATED_CONTROLS - 150, WIN_Y - UNRELATED_CONTROLS - BUTTON_HEIGHT ) ; Size = MAP_APPFONT ( 50 , BUTTON_HEIGHT ) ; DefButton = TRUE ; diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 961a2759c..99f1f3fd1 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -70,7 +70,7 @@ #include <tools/urlobj.hxx> #include <tools/diagnose_ex.h> #include <sfx2/docfilt.hxx> -#if !defined(WINDOWS_VISTA_PSDK) && (defined(WIN) || defined(WNT)) +#if !defined(WINDOWS_VISTA_PSDK) && defined(WNT) #define _ADO_DATALINK_BROWSE_ #endif @@ -142,7 +142,7 @@ DBG_NAME(OConnectionHelper) m_aConnectionURL.Show(); m_aConnectionURL.ShowPrefix( ::dbaccess::DST_JDBC == m_pCollection->determineType(m_eType) ); - BOOL bEnableBrowseButton = m_pCollection->supportsBrowsing( m_eType ); + sal_Bool bEnableBrowseButton = m_pCollection->supportsBrowsing( m_eType ); m_aPB_Connection.Show( bEnableBrowseButton ); SFX_ITEMSET_GET(_rSet, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True); diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index 2ee76e973..908bd57de 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -71,7 +71,7 @@ #include <tools/urlobj.hxx> #include <sfx2/docfilt.hxx> #include "dsnItem.hxx" -#if defined(WIN) || defined(WNT) +#if defined(WNT) #define _ADO_DATALINK_BROWSE_ #endif @@ -133,6 +133,8 @@ namespace dbaui m_aTestJavaDriver.SetClickHdl(LINK(this,OConnectionTabPage,OnTestJavaClickHdl)); FreeResource(); + + LayoutHelper::fitSizeRightAligned( m_aTestConnection ); } // ----------------------------------------------------------------------- @@ -257,7 +259,7 @@ namespace dbaui String sUrl = pUrlItem->GetValue(); setURL( sUrl ); - const BOOL bEnableJDBC = m_pCollection->determineType(m_eType) == ::dbaccess::DST_JDBC; + const sal_Bool bEnableJDBC = m_pCollection->determineType(m_eType) == ::dbaccess::DST_JDBC; if ( !pJdbcDrvItem->GetValue().Len() ) { String sDefaultJdbcDriverName = m_pCollection->getJavaDriverClass(m_eType); @@ -347,7 +349,7 @@ namespace dbaui { } - USHORT nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; + sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; OSQLMessageBox aMsg( this, String( ModuleRes( nMessage ) ), String() ); aMsg.Execute(); return 0L; @@ -356,7 +358,7 @@ namespace dbaui bool OConnectionTabPage::checkTestConnection() { OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF"); - BOOL bEnableTestConnection = !m_aConnectionURL.IsVisible() || (m_aConnectionURL.GetTextNoPrefix().Len() != 0); + sal_Bool bEnableTestConnection = !m_aConnectionURL.IsVisible() || (m_aConnectionURL.GetTextNoPrefix().Len() != 0); if ( m_pCollection->determineType(m_eType) == ::dbaccess::DST_JDBC ) bEnableTestConnection = bEnableTestConnection && (m_aJavaDriver.GetText().Len() != 0); m_aTestConnection.Enable(bEnableTestConnection); diff --git a/dbaccess/source/ui/dlg/ConnectionPage.hxx b/dbaccess/source/ui/dlg/ConnectionPage.hxx index ff50f7d71..b0c29ca3f 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.hxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.hxx @@ -74,7 +74,7 @@ namespace dbaui public: static SfxTabPage* Create( Window* pParent, const SfxItemSet& _rAttrSet ); - virtual BOOL FillItemSet (SfxItemSet& _rCoreAttrs); + virtual sal_Bool FillItemSet (SfxItemSet& _rCoreAttrs); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); diff --git a/dbaccess/source/ui/dlg/ConnectionPage.src b/dbaccess/source/ui/dlg/ConnectionPage.src index 61515a258..63c400b0a 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.src +++ b/dbaccess/source/ui/dlg/ConnectionPage.src @@ -42,6 +42,7 @@ //......................................................................... TabPage PAGE_CONNECTION { + HelpID = "dbaccess:TabPage:PAGE_CONNECTION"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( PAGE_X , PAGE_Y ) ; @@ -54,7 +55,7 @@ TabPage PAGE_CONNECTION Text[ en-US ] = "General"; }; - AUTO_BROWSECONTROLGROUP( 6, UNRELATED_CONTROLS + FIXEDTEXT_HEIGHT + RELATED_CONTROLS, PAGE_X, HID_DSADMIN_URL_GENERAL) + AUTO_BROWSECONTROLGROUP( 6, UNRELATED_CONTROLS + FIXEDTEXT_HEIGHT + RELATED_CONTROLS, PAGE_X, HID_DSADMIN_URL_GENERAL, HID_DSADMIN_BROWSECONN) FixedText FT_NO_ADDITIONAL_SETTINGS { @@ -88,6 +89,7 @@ TabPage PAGE_CONNECTION Edit ET_USERNAME { + HelpID = "dbaccess:Edit:PAGE_CONNECTION:ET_USERNAME"; Border = TRUE ; Pos = MAP_APPFONT ( 90 , 3*UNRELATED_CONTROLS + 4*FIXEDTEXT_HEIGHT + 2*RELATED_CONTROLS -1 ) ; Size = MAP_APPFONT ( 105 , EDIT_HEIGHT ) ; @@ -96,6 +98,7 @@ TabPage PAGE_CONNECTION CheckBox CB_PASSWORD_REQUIRED { + HelpID = "dbaccess:CheckBox:PAGE_CONNECTION:CB_PASSWORD_REQUIRED"; Pos = MAP_APPFONT ( 90 , 4*UNRELATED_CONTROLS + 5*FIXEDTEXT_HEIGHT + 2*RELATED_CONTROLS ) ; Size = MAP_APPFONT ( 105 , CHECKBOX_HEIGHT ) ; Text [ en-US ] = "Password required"; @@ -128,6 +131,7 @@ TabPage PAGE_CONNECTION PushButton PB_TESTDRIVERCLASS { + HelpID = "dbaccess:PushButton:PAGE_CONNECTION:PB_TESTDRIVERCLASS"; TabStop = TRUE ; Pos = MAP_APPFONT ( PAGE_X - BUTTON_WIDTH - UNRELATED_CONTROLS , 5*UNRELATED_CONTROLS + 6*FIXEDTEXT_HEIGHT + 3*RELATED_CONTROLS + CHECKBOX_HEIGHT -2 ) ; Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; @@ -136,6 +140,7 @@ TabPage PAGE_CONNECTION PushButton PB_TESTCONNECTION { + HelpID = "dbaccess:PushButton:PAGE_CONNECTION:PB_TESTCONNECTION"; Pos = MAP_APPFONT ( PAGE_X - 75 - UNRELATED_CONTROLS, PAGE_Y - BUTTON_HEIGHT - UNRELATED_CONTROLS) ; Size = MAP_APPFONT ( 75 , BUTTON_HEIGHT ) ; TabStop = TRUE ; diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx index ea4e8ddee..bbba4a4b9 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx @@ -133,7 +133,7 @@ namespace dbaui //= OConnectionTabPageSetup //======================================================================== DBG_NAME(OConnectionTabPageSetup) - OConnectionTabPageSetup::OConnectionTabPageSetup(Window* pParent, USHORT _rId, const SfxItemSet& _rCoreAttrs, USHORT _nHelpTextResId, USHORT _nHeaderResId, USHORT _nUrlResId) + OConnectionTabPageSetup::OConnectionTabPageSetup(Window* pParent, sal_uInt16 _rId, const SfxItemSet& _rCoreAttrs, sal_uInt16 _nHelpTextResId, sal_uInt16 _nHeaderResId, sal_uInt16 _nUrlResId) :OConnectionHelper(pParent, ModuleRes(_rId), _rCoreAttrs) ,m_bUserGrabFocus(sal_True) ,m_aFT_HelpText(this, ModuleRes(FT_AUTOWIZARDHELPTEXT)) diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx index 68541da58..2cb23923a 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx @@ -69,7 +69,7 @@ namespace dbaui static OGenericAdministrationPage* CreateUserDefinedTabPage( Window* pParent, const SfxItemSet& _rAttrSet ); - virtual BOOL FillItemSet (SfxItemSet& _rCoreAttrs); + virtual sal_Bool FillItemSet (SfxItemSet& _rCoreAttrs); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); @@ -87,7 +87,7 @@ namespace dbaui protected: - OConnectionTabPageSetup(Window* pParent, USHORT _rId, const SfxItemSet& _rCoreAttrs, USHORT _nHelpTextResId, USHORT _nHeaderResId, USHORT _nUrlResId); + OConnectionTabPageSetup(Window* pParent, sal_uInt16 _rId, const SfxItemSet& _rCoreAttrs, sal_uInt16 _nHelpTextResId, sal_uInt16 _nHeaderResId, sal_uInt16 _nUrlResId); virtual bool checkTestConnection(); // nControlFlags ist eine Kombination der CBTP_xxx-Konstanten virtual ~OConnectionTabPageSetup(); diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index 7dcaf3fcd..933e4d689 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -333,7 +333,7 @@ DBG_NAME(OMySQLIntroPageSetup) // ----------------------------------------------------------------------- - BOOL OMySQLIntroPageSetup::FillItemSet(SfxItemSet& /*_rSet*/) + sal_Bool OMySQLIntroPageSetup::FillItemSet(SfxItemSet& /*_rSet*/) { OSL_ENSURE(sal_False,"Who called me?! Please ask oj for more information."); return sal_True; @@ -421,7 +421,7 @@ DBG_NAME(OMySQLIntroPageSetup) //======================================================================== //= OMySQLJDBCConnectionPageSetup //======================================================================== - OGeneralSpecialJDBCConnectionPageSetup::OGeneralSpecialJDBCConnectionPageSetup( Window* pParent,USHORT _nResId, const SfxItemSet& _rCoreAttrs ,USHORT _nPortId, USHORT _nDefaultPortResId, USHORT _nHelpTextResId, USHORT _nHeaderTextResId, USHORT _nDriverClassId) + OGeneralSpecialJDBCConnectionPageSetup::OGeneralSpecialJDBCConnectionPageSetup( Window* pParent,sal_uInt16 _nResId, const SfxItemSet& _rCoreAttrs ,sal_uInt16 _nPortId, sal_uInt16 _nDefaultPortResId, sal_uInt16 _nHelpTextResId, sal_uInt16 _nHeaderTextResId, sal_uInt16 _nDriverClassId) :OGenericAdministrationPage(pParent, ModuleRes(_nResId), _rCoreAttrs) ,m_aFTHelpText (this, ModuleRes(FT_AUTOWIZARDHELPTEXT)) ,m_aFTDatabasename (this, ModuleRes(FT_AUTODATABASENAME)) @@ -579,7 +579,7 @@ DBG_NAME(OMySQLIntroPageSetup) { } - USHORT nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; + sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; OSQLMessageBox aMsg( this, String( ModuleRes( nMessage ) ), String() ); aMsg.Execute(); return 0L; @@ -674,7 +674,7 @@ DBG_NAME(OMySQLIntroPageSetup) bool OJDBCConnectionPageSetup::checkTestConnection() { OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF"); - BOOL bEnableTestConnection = !m_aConnectionURL.IsVisible() || (m_aConnectionURL.GetTextNoPrefix().Len() != 0); + sal_Bool bEnableTestConnection = !m_aConnectionURL.IsVisible() || (m_aConnectionURL.GetTextNoPrefix().Len() != 0); bEnableTestConnection = bEnableTestConnection && (m_aETDriverClass.GetText().Len() != 0); return bEnableTestConnection; } @@ -698,7 +698,7 @@ DBG_NAME(OMySQLIntroPageSetup) { } - USHORT nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; + sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; OSQLMessageBox aMsg( this, String( ModuleRes( nMessage ) ), String() ); aMsg.Execute(); return 0L; @@ -791,6 +791,8 @@ DBG_NAME(OAuthentificationPageSetup) m_aCBPasswordRequired.SetClickHdl(getControlModifiedLink()); m_aPBTestConnection.SetClickHdl(LINK(this,OGenericAdministrationPage,OnTestConnectionClickHdl)); FreeResource(); + + LayoutHelper::fitSizeRightAligned( m_aPBTestConnection ); } diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx index d2efae3e6..f758015ed 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx @@ -56,7 +56,7 @@ namespace dbaui class OSpreadSheetConnectionPageSetup : public OConnectionTabPageSetup { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); static OGenericAdministrationPage* CreateSpreadSheetTabPage( Window* pParent, const SfxItemSet& _rAttrSet ); OSpreadSheetConnectionPageSetup(Window* pParent, const SfxItemSet& _rCoreAttrs); @@ -77,7 +77,7 @@ namespace dbaui class OTextConnectionPageSetup : public OConnectionTabPageSetup { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); static OGenericAdministrationPage* CreateTextTabPage( Window* pParent, const SfxItemSet& _rAttrSet ); OTextConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs ); OTextConnectionHelper* m_pTextConnectionHelper; @@ -101,7 +101,7 @@ namespace dbaui class OLDAPConnectionPageSetup : public OGenericAdministrationPage { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); static OGenericAdministrationPage* CreateLDAPTabPage( Window* pParent, const SfxItemSet& _rAttrSet ); OLDAPConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs ); virtual Link getControlModifiedLink() { return LINK(this, OLDAPConnectionPageSetup, OnEditModified); } @@ -144,7 +144,7 @@ namespace dbaui virtual void fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList ); virtual void fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList ); - virtual BOOL FillItemSet( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet( SfxItemSet& _rCoreAttrs ); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); virtual Link getControlModifiedLink(); @@ -160,18 +160,18 @@ namespace dbaui { public: OGeneralSpecialJDBCConnectionPageSetup( Window* pParent - , USHORT _nResId + , sal_uInt16 _nResId , const SfxItemSet& _rCoreAttrs - , USHORT _nPortId - , USHORT _nDefaultPortResId - , USHORT _nHelpTextResId - , USHORT _nHeaderTextResId - , USHORT _nDriverClassId ); + , sal_uInt16 _nPortId + , sal_uInt16 _nDefaultPortResId + , sal_uInt16 _nHelpTextResId + , sal_uInt16 _nHeaderTextResId + , sal_uInt16 _nDriverClassId ); static OGenericAdministrationPage* CreateMySQLJDBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet ); static OGenericAdministrationPage* CreateOracleJDBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet ); protected: - virtual BOOL FillItemSet( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet( SfxItemSet& _rCoreAttrs ); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList); virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList); @@ -194,7 +194,7 @@ namespace dbaui PushButton m_aPBTestJavaDriver; String m_sDefaultJdbcDriverName; - USHORT m_nPortId; + sal_uInt16 m_nPortId; }; @@ -210,7 +210,7 @@ namespace dbaui protected: virtual bool checkTestConnection(); - virtual BOOL FillItemSet( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet( SfxItemSet& _rCoreAttrs ); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList); virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList); @@ -250,7 +250,7 @@ namespace dbaui protected: - virtual BOOL FillItemSet(SfxItemSet& _rSet); + virtual sal_Bool FillItemSet(SfxItemSet& _rSet); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList); virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList); @@ -277,7 +277,7 @@ namespace dbaui class OAuthentificationPageSetup : public OGenericAdministrationPage { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); static OGenericAdministrationPage* CreateAuthentificationTabPage( Window* pParent, const SfxItemSet& _rAttrSet ); OAuthentificationPageSetup(Window* pParent, const SfxItemSet& _rCoreAttrs); @@ -304,7 +304,7 @@ namespace dbaui class OFinalDBPageSetup : public OGenericAdministrationPage { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); static OGenericAdministrationPage* CreateFinalDBTabPageSetup( Window* pParent, const SfxItemSet& _rAttrSet); FixedText m_aFTFinalHeader; diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index c8e13602b..0144e5e99 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -108,7 +108,7 @@ using namespace com::sun::star::frame; //------------------------------------------------------------------------- namespace { - sal_Bool implCheckItemType( SfxItemSet& _rSet, const USHORT _nId, const TypeId _nExpectedItemType ) + sal_Bool implCheckItemType( SfxItemSet& _rSet, const sal_uInt16 _nId, const TypeId _nExpectedItemType ) { sal_Bool bCorrectType = sal_False; @@ -726,7 +726,7 @@ void ODbDataSourceAdministrationHelper::translateProperties(const SfxItemSet& _r ++aDirect ) { - const SfxPoolItem* pCurrentItem = _rSource.GetItem((USHORT)aDirect->first); + const SfxPoolItem* pCurrentItem = _rSource.GetItem((sal_uInt16)aDirect->first); if (pCurrentItem) { sal_Int16 nAttributes = PropertyAttribute::READONLY; @@ -785,7 +785,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS ::std::vector< sal_Int32>::iterator aDetailsEnd = aDetailIds.end(); for (::std::vector< sal_Int32>::iterator aIter = aDetailIds.begin();aIter != aDetailsEnd ; ++aIter) { - const SfxPoolItem* pCurrent = _rSource.GetItem((USHORT)*aIter); + const SfxPoolItem* pCurrent = _rSource.GetItem((sal_uInt16)*aIter); aTranslation = m_aIndirectPropTranslator.find(*aIter); if ( pCurrent && (m_aIndirectPropTranslator.end() != aTranslation) ) { @@ -1118,7 +1118,7 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest) ::dbaccess::ODsnTypeCollection* pCollection = pTypeCollection->getCollection(); OSL_ENSURE(pCollection, "ODbAdminDialog::getDatasourceType: invalid type collection!"); - USHORT nPortNumberId = 0; + sal_uInt16 nPortNumberId = 0; sal_Int32 nPortNumber = -1; String sNewHostName; String sUrlPart; diff --git a/dbaccess/source/ui/dlg/DriverSettings.cxx b/dbaccess/source/ui/dlg/DriverSettings.cxx index e531109c4..82e8cd7ac 100644 --- a/dbaccess/source/ui/dlg/DriverSettings.cxx +++ b/dbaccess/source/ui/dlg/DriverSettings.cxx @@ -78,7 +78,7 @@ void ODriversSettings::getSupportedIndirectSettings( const ::rtl::OUString& _sUR } } #endif - typedef ::std::pair<USHORT, ::rtl::OUString> TProperties; + typedef ::std::pair<sal_uInt16, ::rtl::OUString> TProperties; TProperties aProps[] = { TProperties(DSID_SHOWDELETEDROWS,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowDeleted"))) ,TProperties(DSID_CHARSET,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharSet"))) ,TProperties(DSID_FIELDDELIMITER,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FieldDelimiter"))) diff --git a/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx b/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx deleted file mode 100644 index 9f5c989d6..000000000 --- a/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx +++ /dev/null @@ -1,208 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "precompiled_dbaccess.hxx" - -#include "dbaccess_helpid.hrc" -#include "dbu_resource.hrc" -#include "ExtensionNotPresent.hrc" -#include "ExtensionNotPresent.hxx" -#include "moduledbu.hxx" -#include "UITools.hxx" - -/** === begin UNO includes === **/ -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/lang/XMultiComponentFactory.hpp> -#include <com/sun/star/system/SystemShellExecuteFlags.hpp> -#include <com/sun/star/uno/XComponentContext.hpp> -/** === end UNO includes === **/ - -#include <connectivity/dbconversion.hxx> -#include <unotools/syslocale.hxx> -#include <svx/globlmn.hrc> -#include <svx/svxids.hrc> -#include <svtools/langhelp.hxx> -#include <tools/debug.hxx> -#include <tools/diagnose_ex.h> -#include <unotools/confignode.hxx> -#include <vcl/msgbox.hxx> - - -namespace dbaui -{ -using namespace ::com::sun::star; -using namespace ::comphelper; - -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - -DBG_NAME( dbu_OExtensionNotPresentDialog ) -//======================================================================== -// class OExtensionNotPresentDialog -//======================================================================== - OExtensionNotPresentDialog::OExtensionNotPresentDialog( Window* _pParent, uno::Reference< lang::XMultiServiceFactory > _xORB) - : ModalDialog( _pParent, ModuleRes(RID_EXTENSION_NOT_PRESENT_DLG) ) - ,m_aFI_WARNING(this, ModuleRes(FI_WARNING)) - ,m_aFT_TEXT(this, ModuleRes(FT_TEXT ) ) - ,m_aPB_DOWNLOAD(this, ModuleRes(PB_DOWNLOAD)) - ,m_aPB_CANCEL(this, ModuleRes(PB_CANCEL)) - ,m_xMultiServiceFactory(_xORB) -{ - DBG_CTOR( dbu_OExtensionNotPresentDialog, NULL); - - try - { - SvtSysLocale aSysLocale; - m_nLocale = aSysLocale.GetLocaleData().getLocale(); - } - catch(uno::Exception&) - { - } - - // set a ClickHandler for the 'Download' button - m_aPB_DOWNLOAD.SetClickHdl( LINK( this, OExtensionNotPresentDialog, Download_Click ) ); - - // get message string out of the resource - String sText = String( ModuleRes( RID_STR_EXTENSION_NOT_PRESENT ) ); - String sExtensionName = getFromConfigurationExtension("Name"); - sText.SearchAndReplaceAscii("%RPT_EXTENSION_NAME", sExtensionName); - - m_aFT_TEXT.SetText(sText); - - // calulate the size of the text field - Rectangle aPrimaryRect( Point(0,0), m_aFT_TEXT.GetSizePixel() ); - Rectangle aSuggestedRect( GetTextRect( aPrimaryRect, sText, TEXT_DRAW_MULTILINE | TEXT_DRAW_LEFT ) ); - - Size aTempSize = LogicToPixel( Size(LEFT_PADDING + RIGHT_PADDING, 1), MAP_APPFONT); // real pixel size of LEFT and RIGHT_PADDING - sal_Int32 nWidthWithoutFixedText = aTempSize.getWidth() ; - sal_Int32 nHeightWithoutFixedText = GetSizePixel().getHeight() - m_aFT_TEXT.GetSizePixel().getHeight(); - - Size aNewSize = aSuggestedRect.GetSize(); - m_aFT_TEXT.SetSizePixel( aNewSize ); - sal_Int32 nNewWidth = nWidthWithoutFixedText + aSuggestedRect.GetWidth(); - sal_Int32 nNewHeight = nHeightWithoutFixedText + aSuggestedRect.GetHeight(); - - // set new window width & height - Size aDialogWindowSize = GetSizePixel(); - aDialogWindowSize.setWidth( nNewWidth ); - aDialogWindowSize.setHeight( nNewHeight ); - SetSizePixel(aDialogWindowSize); - - // move Action items - sal_Int32 nWindowWidth = GetSizePixel().getWidth(); - sal_Int32 nWindowHeight = GetSizePixel().getHeight(); - - Size aButtonSize = LogicToPixel( Size(BUTTON_WIDTH, BUTTON_HEIGHT), MAP_APPFONT); // real pixel size of a button - - Point aNewPos = m_aPB_DOWNLOAD.GetPosPixel(); - aNewPos.setX(nWindowWidth / 2 - m_aPB_DOWNLOAD.GetSizePixel().getWidth() - 8); - aNewPos.setY(nWindowHeight - aButtonSize.getHeight() - 5); - m_aPB_DOWNLOAD.SetPosPixel(aNewPos ); - - aNewPos = m_aPB_CANCEL.GetPosPixel(); - aNewPos.setX(nWindowWidth / 2 + 8); - aNewPos.setY(nWindowHeight - aButtonSize.getHeight() - 5); - m_aPB_CANCEL.SetPosPixel(aNewPos ); - - m_aFI_WARNING.SetImage(WarningBox::GetStandardImage()); - - Resize(); - FreeResource(); -} - -//------------------------------------------------------------------------ -OExtensionNotPresentDialog::~OExtensionNotPresentDialog() -{ - DBG_DTOR( dbu_OExtensionNotPresentDialog, NULL); -} -// ----------------------------------------------------------------------------- -short OExtensionNotPresentDialog::Execute() -{ - DBG_CHKTHIS( dbu_OExtensionNotPresentDialog,NULL); - short nRet = ModalDialog::Execute(); - // RET_OK - // RET_NO - return nRet; -} - -//------------------------------------------------------------------------------ - -uno::Reference< com::sun::star::system::XSystemShellExecute > OExtensionNotPresentDialog::getShellExecuter() const -{ - uno::Reference<com::sun::star::system::XSystemShellExecute> xExecuter( m_xMultiServiceFactory->createInstance( UNISTRING( "com.sun.star.system.SystemShellExecute" )), uno::UNO_QUERY_THROW); - return xExecuter; -} -// ----------------------------------------------------------------------------- -rtl::OUString OExtensionNotPresentDialog::getFromConfigurationExtension(rtl::OUString const& _sPropertyName) const -{ - // get the URL to open in a browser from Configuration - static const ::rtl::OUString sConfigName( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.ReportDesign/Extension" ) ); - - ::utl::OConfigurationTreeRoot aConfiguration( ::utl::OConfigurationTreeRoot::createWithServiceFactory( m_xMultiServiceFactory, sConfigName ) ); - - rtl::OUString aValue; - aConfiguration.getNodeValue( _sPropertyName ) >>= aValue; - return aValue; -} - -// ----------------------------------------------------------------------------- -rtl::OUString OExtensionNotPresentDialog::getFromConfigurationExtension(rtl::OString const& _sPropertyName) const -{ - return getFromConfigurationExtension(rtl::OStringToOUString( _sPropertyName, RTL_TEXTENCODING_UTF8) ); -} - -// ----------------------------------------------------------------------------- -// handle the click on the download button -IMPL_LINK( OExtensionNotPresentDialog, Download_Click, PushButton*, EMPTYARG ) -{ - try - { - EndDialog( TRUE ); - - rtl::OUString suDownloadURL = getFromConfigurationExtension("DownloadURL"); - if (suDownloadURL.getLength() == 0) - { - // fallback - suDownloadURL = UNISTRING("http://extensions.libreoffice.org"); - } - - // open such URL in a browser - localizeWebserviceURI(suDownloadURL); - uno::Reference< com::sun::star::system::XSystemShellExecute > xShellExecute( getShellExecuter() ); - xShellExecute->execute( suDownloadURL, ::rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS ); - } - catch( const uno::Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - return 0; -} - -// ============================================================================= -} // rptui -// ============================================================================= - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/dlg/ExtensionNotPresent.hrc b/dbaccess/source/ui/dlg/ExtensionNotPresent.hrc deleted file mode 100644 index 17b4d148f..000000000 --- a/dbaccess/source/ui/dlg/ExtensionNotPresent.hrc +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef DBU_EXTENSIONNOTPRESENT_HRC -#define DBU_EXTENSIONNOTPRESENT_HRC - -#define FT_TEXT (1) -#define FI_WARNING (2) -#define PB_DOWNLOAD (10) -#define PB_CANCEL (11) - -#define FIXEDTEXT_HEIGHT 8 -#define CELL_PADDING 8 -#define BUTTON_HEIGHT 14 -#define BUTTON_WIDTH 55 -#define BROWSER_HEIGHT 75 -#define LEFT_PADDING 32 /* size for the icon */ -#define RIGHT_PADDING 16 -#define DLG_WIDTH ( 250 ) -#define ACTION_LINE_START (CELL_PADDING + ( 3 * FIXEDTEXT_HEIGHT ) + 2 * CELL_PADDING + 1 ) -#define DLG_HEIGHT (ACTION_LINE_START + BUTTON_HEIGHT + CELL_PADDING) - - -#endif /* DBU_EXTENSIONNOTPRESENT_HRC */ diff --git a/dbaccess/source/ui/dlg/ExtensionNotPresent.src b/dbaccess/source/ui/dlg/ExtensionNotPresent.src deleted file mode 100644 index 3cc090c81..000000000 --- a/dbaccess/source/ui/dlg/ExtensionNotPresent.src +++ /dev/null @@ -1,81 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "ExtensionNotPresent.hrc" -#include "dbaccess_helpid.hrc" -#include "dbu_resource.hrc" -#include <svx/globlmn.hrc> -#include <svx/svxids.hrc> - - -String RID_STR_EXTENSION_NOT_PRESENT -{ - // #i96130# use hard coded name - Text [ en-US ] = "To open a report you require the extension Sunâ„¢ Report Builder.\n\nClick 'Download...' to download and install the extension."; -}; - -ModalDialog RID_EXTENSION_NOT_PRESENT_DLG -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( DLG_WIDTH , DLG_HEIGHT ) ; - Text [ en-US ] = "%PRODUCTNAME %PRODUCTVERSION" ; - HelpId = HID_EXTENSION_NOT_PRESENT_DLG; - Moveable = TRUE ; - Closeable = TRUE ; - - // most of the calulated values here are overridden by the ExtensionNotPresent ctor itself. - FixedImage FI_WARNING - { - Pos = MAP_APPFONT (CELL_PADDING / 2, CELL_PADDING) ; - Size = (32, 32); - Fixed=BMP_EXCEPTION_WARNING; - }; - - - FixedText FT_TEXT - { - Pos = MAP_APPFONT ( 32 , CELL_PADDING ) ; - Size = MAP_APPFONT ( DLG_WIDTH - LEFT_PADDING - RIGHT_PADDING , 3 * (FIXEDTEXT_HEIGHT + 2) ) ; - // Text will set outside from RID_STR_EXTENSION_NOT_PRESENT - }; - - PushButton PB_DOWNLOAD - { - Pos = MAP_APPFONT ( DLG_WIDTH / 2 - (CELL_PADDING/2) - BUTTON_WIDTH, ACTION_LINE_START ) ; - Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; - DefButton = TRUE ; - TabStop = TRUE ; - Text [ en-US ] = "~Download..." ; - }; - - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( DLG_WIDTH / 2 + (CELL_PADDING/2), ACTION_LINE_START) ; - Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; - TabStop = TRUE ; - }; -}; diff --git a/dbaccess/source/ui/dlg/RelationDlg.cxx b/dbaccess/source/ui/dlg/RelationDlg.cxx index e574d4051..35d3fb331 100644 --- a/dbaccess/source/ui/dlg/RelationDlg.cxx +++ b/dbaccess/source/ui/dlg/RelationDlg.cxx @@ -63,7 +63,7 @@ DBG_NAME(ORelationDialog) //======================================================================== ORelationDialog::ORelationDialog( OJoinTableView* pParent, const TTableConnectionData::value_type& pConnectionData, - BOOL bAllowTableSelect ) + sal_Bool bAllowTableSelect ) :ModalDialog( pParent, ModuleRes(DLG_REL_PROPERTIES) ) ,m_pTableMap(pParent->GetTabWinMap()) @@ -83,7 +83,7 @@ ORelationDialog::ORelationDialog( OJoinTableView* pParent, ,aPB_HELP( this, ModuleRes( PB_HELP ) ) ,m_pOrigConnData( pConnectionData ) - ,m_bTriedOneUpdate(FALSE) + ,m_bTriedOneUpdate(sal_False) { DBG_CTOR(ORelationDialog,NULL); @@ -121,18 +121,18 @@ void ORelationDialog::Init(const TTableConnectionData::value_type& _pConnectionD { case KeyRule::NO_ACTION: case KeyRule::RESTRICT: - aRB_NoCascUpd.Check( TRUE ); + aRB_NoCascUpd.Check( sal_True ); break; case KeyRule::CASCADE: - aRB_CascUpd.Check( TRUE ); + aRB_CascUpd.Check( sal_True ); break; case KeyRule::SET_NULL: - aRB_CascUpdNull.Check( TRUE ); + aRB_CascUpdNull.Check( sal_True ); break; case KeyRule::SET_DEFAULT: - aRB_CascUpdDefault.Check( TRUE ); + aRB_CascUpdDefault.Check( sal_True ); break; } @@ -141,18 +141,18 @@ void ORelationDialog::Init(const TTableConnectionData::value_type& _pConnectionD { case KeyRule::NO_ACTION: case KeyRule::RESTRICT: - aRB_NoCascDel.Check( TRUE ); + aRB_NoCascDel.Check( sal_True ); break; case KeyRule::CASCADE: - aRB_CascDel.Check( TRUE ); + aRB_CascDel.Check( sal_True ); break; case KeyRule::SET_NULL: - aRB_CascDelNull.Check( TRUE ); + aRB_CascDelNull.Check( sal_True ); break; case KeyRule::SET_DEFAULT: - aRB_CascDelDefault.Check( TRUE ); + aRB_CascDelDefault.Check( sal_True ); break; } } @@ -171,7 +171,7 @@ IMPL_LINK( ORelationDialog, OKClickHdl, Button*, /*pButton*/ ) { ////////////////////////////////////////////////////////////////////// // RadioButtons auslesen - UINT16 nAttrib = 0; + sal_uInt16 nAttrib = 0; // Delete Rules if( aRB_NoCascDel.IsChecked() ) @@ -200,7 +200,7 @@ IMPL_LINK( ORelationDialog, OKClickHdl, Button*, /*pButton*/ ) m_pTableControl->SaveModified(); - //// wenn die ComboBoxen fuer die Tabellenauswahl enabled sind (Constructor mit bAllowTableSelect==TRUE), dann muss ich in die + //// wenn die ComboBoxen fuer die Tabellenauswahl enabled sind (Constructor mit bAllowTableSelect==sal_True), dann muss ich in die //// Connection auch die Tabellennamen stecken //m_pConnData->SetSourceWinName(m_pTableControl->getSourceWinName()); //m_pConnData->SetDestWinName(m_pTableControl->getDestWinName()); @@ -227,7 +227,7 @@ IMPL_LINK( ORelationDialog, OKClickHdl, Button*, /*pButton*/ ) DBG_UNHANDLED_EXCEPTION(); } - m_bTriedOneUpdate = TRUE; + m_bTriedOneUpdate = sal_True; // this means that the original connection may be lost (if m_pConnData was not a newly created but an // existent conn to be modified), which we reflect by returning RET_NO (see ::Execute) diff --git a/dbaccess/source/ui/dlg/RelationDlg.src b/dbaccess/source/ui/dlg/RelationDlg.src index 908cbab62..90602e37c 100644 --- a/dbaccess/source/ui/dlg/RelationDlg.src +++ b/dbaccess/source/ui/dlg/RelationDlg.src @@ -35,6 +35,7 @@ ModalDialog DLG_REL_PROPERTIES { + HelpID = "dbaccess:ModalDialog:DLG_REL_PROPERTIES"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 186 , 205 ) ; diff --git a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx index ebdc2519b..4726c9de2 100644 --- a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx +++ b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx @@ -31,13 +31,14 @@ #include "TablesSingleDlg.hxx" #include "DbAdminImpl.hxx" -#include "dbaccess_helpid.hrc" #include "tablespage.hxx" #include <vcl/msgbox.hxx> #include "dsitems.hxx" #include "propertysetitem.hxx" +#include "dbu_dlg.hrc" + //......................................................................... namespace dbaui { @@ -56,7 +57,7 @@ OTableSubscriptionDialog::OTableSubscriptionDialog(Window* pParent ,SfxItemSet* _pItems ,const Reference< XMultiServiceFactory >& _rxORB ,const ::com::sun::star::uno::Any& _aDataSourceName) - :SfxSingleTabDialog(pParent,UID_DLG_TABLE_FILTER,_pItems) + :SfxSingleTabDialog(pParent,DLG_TABLE_FILTER,_pItems) ,m_pImpl( new ODbDataSourceAdministrationHelper( _rxORB, pParent, this ) ) ,m_bStopExecution(sal_False) ,m_pOutSet(_pItems) diff --git a/dbaccess/source/ui/dlg/UserAdmin.src b/dbaccess/source/ui/dlg/UserAdmin.src index a92a894ee..cd7364e34 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.src +++ b/dbaccess/source/ui/dlg/UserAdmin.src @@ -157,6 +157,7 @@ ModalDialog DLG_PASSWORD }; Edit ED_OLDPASSWORD { + HelpID = "dbaccess:Edit:DLG_PASSWORD:ED_OLDPASSWORD"; Border = TRUE ; Pos = MAP_APPFONT ( 12 + FT_SIZE_X , 16 ) ; Size = MAP_APPFONT ( EDIT_SIZE_X , 12 ) ; @@ -171,6 +172,7 @@ ModalDialog DLG_PASSWORD }; Edit ED_PASSWORD { + HelpID = "dbaccess:Edit:DLG_PASSWORD:ED_PASSWORD"; Border = TRUE ; Pos = MAP_APPFONT ( 12 + FT_SIZE_X , 34 ) ; Size = MAP_APPFONT ( EDIT_SIZE_X , 12 ) ; @@ -184,6 +186,7 @@ ModalDialog DLG_PASSWORD }; Edit ED_PASSWORD_REPEAT { + HelpID = "dbaccess:Edit:DLG_PASSWORD:ED_PASSWORD_REPEAT"; Border = TRUE ; Pos = MAP_APPFONT ( 12 + FT_SIZE_X , 51 ) ; Size = MAP_APPFONT ( EDIT_SIZE_X , 12 ) ; diff --git a/dbaccess/source/ui/dlg/UserAdminDlg.cxx b/dbaccess/source/ui/dlg/UserAdminDlg.cxx index 3f731cade..089f6dfac 100644 --- a/dbaccess/source/ui/dlg/UserAdminDlg.cxx +++ b/dbaccess/source/ui/dlg/UserAdminDlg.cxx @@ -134,7 +134,7 @@ DBG_NAME(OUserAdminDlg) return nRet; } //------------------------------------------------------------------------- - void OUserAdminDlg::PageCreated(USHORT _nId, SfxTabPage& _rPage) + void OUserAdminDlg::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage) { // register ourself as modified listener static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory(m_pImpl->getORB()); diff --git a/dbaccess/source/ui/dlg/UserAdminDlg.src b/dbaccess/source/ui/dlg/UserAdminDlg.src index 5509820d1..5b07b4309 100644 --- a/dbaccess/source/ui/dlg/UserAdminDlg.src +++ b/dbaccess/source/ui/dlg/UserAdminDlg.src @@ -48,7 +48,6 @@ TabDialog DLG_DATABASE_USERADMIN { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; String STR_PAGETITLE_USERADMIN { diff --git a/dbaccess/source/ui/dlg/admincontrols.cxx b/dbaccess/source/ui/dlg/admincontrols.cxx index 5213bda4c..fb8a79203 100644 --- a/dbaccess/source/ui/dlg/admincontrols.cxx +++ b/dbaccess/source/ui/dlg/admincontrols.cxx @@ -79,7 +79,7 @@ namespace dbaui private: const String m_sDisabledText; String m_sUserText; - BOOL m_bLastKnownEnabledState; + sal_Bool m_bLastKnownEnabledState; }; //-------------------------------------------------------------------- @@ -151,7 +151,7 @@ namespace dbaui //==================================================================== //-------------------------------------------------------------------- MySQLNativeSettings::MySQLNativeSettings( Window& _rParent, const Link& _rControlModificationLink ) - :Control( &_rParent, ModuleRes( RID_MYSQL_NATIVE_SETTINGS ).SetAutoRelease( FALSE ) ) + :Control( &_rParent, ModuleRes( RID_MYSQL_NATIVE_SETTINGS ).SetAutoRelease( sal_False ) ) ,m_aDatabaseNameLabel ( this, ModuleRes( FT_MYSQL_DATABASE_NAME ) ) ,m_aDatabaseName ( this, ModuleRes( ED_MYSQL_DATABASE_NAME ) ) ,m_aHostPortRadio ( this, ModuleRes( RB_MYSQL_HOST_PORT ) ) @@ -219,7 +219,7 @@ namespace dbaui } //-------------------------------------------------------------------- - BOOL MySQLNativeSettings::FillItemSet( SfxItemSet& _rSet ) + sal_Bool MySQLNativeSettings::FillItemSet( SfxItemSet& _rSet ) { sal_Bool bChangedSomething = sal_False; diff --git a/dbaccess/source/ui/dlg/admincontrols.hxx b/dbaccess/source/ui/dlg/admincontrols.hxx index 4caa61be5..b6402f00a 100644 --- a/dbaccess/source/ui/dlg/admincontrols.hxx +++ b/dbaccess/source/ui/dlg/admincontrols.hxx @@ -70,7 +70,7 @@ namespace dbaui void fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList ); void fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList ); - BOOL FillItemSet( SfxItemSet& _rCoreAttrs ); + sal_Bool FillItemSet( SfxItemSet& _rCoreAttrs ); void implInitControls( const SfxItemSet& _rSet ); bool canAdvance() const; diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx index 83484c92d..14ef2cdd8 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -215,7 +215,7 @@ namespace dbaui return true; } // ----------------------------------------------------------------------- - void OGenericAdministrationPage::fillBool( SfxItemSet& _rSet, CheckBox* _pCheckBox, USHORT _nID, sal_Bool& _bChangedSomething, bool _bRevertValue ) + void OGenericAdministrationPage::fillBool( SfxItemSet& _rSet, CheckBox* _pCheckBox, sal_uInt16 _nID, sal_Bool& _bChangedSomething, bool _bRevertValue ) { if ( (_pCheckBox != NULL ) && ( _pCheckBox->GetState() != _pCheckBox->GetSavedValue() ) ) { @@ -237,16 +237,16 @@ namespace dbaui } } // ----------------------------------------------------------------------- - void OGenericAdministrationPage::fillInt32(SfxItemSet& _rSet,NumericField* _pEdit,USHORT _nID,sal_Bool& _bChangedSomething) + void OGenericAdministrationPage::fillInt32(SfxItemSet& _rSet,NumericField* _pEdit,sal_uInt16 _nID,sal_Bool& _bChangedSomething) { if( (_pEdit != NULL) && (_pEdit->GetValue() != _pEdit->GetSavedValue().ToInt32()) ) { - _rSet.Put(SfxInt32Item(_nID, static_cast<INT32>(_pEdit->GetValue()))); + _rSet.Put(SfxInt32Item(_nID, static_cast<sal_Int32>(_pEdit->GetValue()))); _bChangedSomething = sal_True; } } // ----------------------------------------------------------------------- - void OGenericAdministrationPage::fillString(SfxItemSet& _rSet,Edit* _pEdit,USHORT _nID,sal_Bool& _bChangedSomething) + void OGenericAdministrationPage::fillString(SfxItemSet& _rSet,Edit* _pEdit,sal_uInt16 _nID,sal_Bool& _bChangedSomething) { if( (_pEdit != NULL) && (_pEdit->GetText() != _pEdit->GetSavedValue()) ) { @@ -305,7 +305,7 @@ namespace dbaui return 0L; } - void OGenericAdministrationPage::SetHeaderText( USHORT _nFTResId, USHORT _StringResId) + void OGenericAdministrationPage::SetHeaderText( sal_uInt16 _nFTResId, sal_uInt16 _StringResId) { delete(m_pFT_HeaderText); m_pFT_HeaderText = new FixedText(this, ModuleRes(_nFTResId)); @@ -314,7 +314,6 @@ namespace dbaui SetControlFontWeight(m_pFT_HeaderText); } - //========================================================================= //= LayoutHelper //========================================================================= @@ -332,6 +331,24 @@ namespace dbaui _rControl.SetPosPixel( aControlPos ); } + //------------------------------------------------------------------------- + void LayoutHelper::fitSizeRightAligned( PushButton& io_button ) + { + const Point aOldPos = io_button.GetPosPixel(); + const Size aOldSize = io_button.GetSizePixel(); + const Size aMinSize( io_button.CalcMinimumSize() ); + if ( aMinSize.Width() > aOldSize.Width() ) + { + io_button.SetPosSizePixel( + aOldPos.X() + aOldSize.Width() - aMinSize.Width(), + 0, + aMinSize.Width(), + 0, + WINDOW_POSSIZE_X | WINDOW_POSSIZE_WIDTH + ); + } + } + //......................................................................... } // namespace dbaui //......................................................................... diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx index 32cfc4d94..5353791d2 100644 --- a/dbaccess/source/ui/dlg/adminpages.hxx +++ b/dbaccess/source/ui/dlg/adminpages.hxx @@ -216,7 +216,7 @@ namespace dbaui @param _bRevertValue set to <TRUE/> if the display value should be reverted before putting it into the set */ - static void fillBool( SfxItemSet& _rSet, CheckBox* _pCheckBox, USHORT _nID, sal_Bool& _bChangedSomething, bool _bRevertValue = false); + static void fillBool( SfxItemSet& _rSet, CheckBox* _pCheckBox, sal_uInt16 _nID, sal_Bool& _bChangedSomething, bool _bRevertValue = false); /** fills the int value into the item set when the value changed. @param _rSet @@ -228,7 +228,7 @@ namespace dbaui @param _bChangedSomething <TRUE/> if something changed otherwise <FALSE/> */ - static void fillInt32(SfxItemSet& _rSet,NumericField* _pEdit,USHORT _nID,sal_Bool& _bChangedSomething); + static void fillInt32(SfxItemSet& _rSet,NumericField* _pEdit,sal_uInt16 _nID,sal_Bool& _bChangedSomething); /** fills the String value into the item set when the value changed. @param _rSet @@ -240,12 +240,12 @@ namespace dbaui @param _bChangedSomething <TRUE/> if something changed otherwise <FALSE/> */ - static void fillString(SfxItemSet& _rSet,Edit* _pEdit,USHORT _nID,sal_Bool& _bChangedSomething); + static void fillString(SfxItemSet& _rSet,Edit* _pEdit,sal_uInt16 _nID,sal_Bool& _bChangedSomething); protected: // used to set the right Pane header of a wizard to bold void SetControlFontWeight(Window* _pWindow, FontWeight _eWeight = WEIGHT_BOLD); - void SetHeaderText( USHORT _nFTResId, USHORT _StringResId); + void SetHeaderText( sal_uInt16 _nFTResId, sal_uInt16 _StringResId); /** This link be used for controls where the tabpage does not need to take any special action when the control is modified. The implementation just calls callModifiedHdl. @@ -277,6 +277,10 @@ namespace dbaui const ControlRelation _eRelation, const long _nIndentAppFont ); + /** fits the button size to be large enough to contain the buttons text + */ + static void fitSizeRightAligned( PushButton& io_button ); + // why is CalcMinimumSize not a virtual method of ::Window? }; //......................................................................... diff --git a/dbaccess/source/ui/dlg/adodatalinks.cxx b/dbaccess/source/ui/dlg/adodatalinks.cxx index 21f806db6..f03a37a00 100644 --- a/dbaccess/source/ui/dlg/adodatalinks.cxx +++ b/dbaccess/source/ui/dlg/adodatalinks.cxx @@ -30,7 +30,7 @@ #include "precompiled_dbaccess.hxx" -#if defined(WIN) || defined(WNT) +#if defined(WNT) #if defined _MSC_VER #pragma warning(push, 1) #pragma warning(disable: 4917) @@ -174,7 +174,7 @@ BSTR PromptEdit(long hWnd,BSTR connstr) // Prompt for connection information. hr = dlPrompt->PromptEdit((IDispatch **)&piTmpConnection,&pbSuccess); - if( SUCCEEDED( hr ) && FALSE == pbSuccess ) //if user press cancel then FALSE == pbSuccess + if( SUCCEEDED( hr ) && sal_False == pbSuccess ) //if user press cancel then sal_False == pbSuccess { piTmpConnection->Release( ); dlPrompt->Release( ); diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx index 08616e60e..2834abf9b 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -374,15 +374,15 @@ OAddTableDlg::OAddTableDlg( Window* pParent, IAddTableDialogContext& _rContext ) m_aQueryList.SetSelectHdl( LINK( this, OAddTableDlg, TableListSelectHdl ) ); ////////////////////////////////////////////////////////////////////// - m_aTableList.EnableInplaceEditing( FALSE ); - m_aTableList.SetWindowBits(WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HASLINESATROOT | WB_SORT | WB_HSCROLL ); + m_aTableList.EnableInplaceEditing( sal_False ); + m_aTableList.SetStyle(m_aTableList.GetStyle() | WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HASLINESATROOT | WB_SORT | WB_HSCROLL ); m_aTableList.EnableCheckButton( NULL ); // do not show any buttons m_aTableList.SetSelectionMode( SINGLE_SELECTION ); m_aTableList.notifyHiContrastChanged(); m_aTableList.suppressEmptyFolders(); ////////////////////////////////////////////////////////////////////// - m_aQueryList.EnableInplaceEditing( FALSE ); + m_aQueryList.EnableInplaceEditing( sal_False ); m_aQueryList.SetSelectionMode( SINGLE_SELECTION ); ////////////////////////////////////////////////////////////////////// @@ -419,15 +419,15 @@ void OAddTableDlg::impl_switchTo( ObjectList _eList ) switch ( _eList ) { case Tables: - m_aTableList.Show( TRUE ); m_aCaseTables.Check( TRUE ); - m_aQueryList.Show( FALSE ); m_aCaseQueries.Check( FALSE ); + m_aTableList.Show( sal_True ); m_aCaseTables.Check( sal_True ); + m_aQueryList.Show( sal_False ); m_aCaseQueries.Check( sal_False ); m_pCurrentList.reset( new TableListFacade( m_aTableList, m_rContext.getConnection() ) ); m_aTableList.GrabFocus(); break; case Queries: - m_aTableList.Show( FALSE ); m_aCaseTables.Check( FALSE ); - m_aQueryList.Show( TRUE ); m_aCaseQueries.Check( TRUE ); + m_aTableList.Show( sal_False ); m_aCaseTables.Check( sal_False ); + m_aQueryList.Show( sal_True ); m_aCaseQueries.Check( sal_True ); m_pCurrentList.reset( new QueryListFacade( m_aQueryList, m_rContext.getConnection() ) ); m_aQueryList.GrabFocus(); break; @@ -501,7 +501,7 @@ IMPL_LINK( OAddTableDlg, OnTypeSelected, void*, /*EMPTY_ARG*/ ) } //------------------------------------------------------------------------------ -BOOL OAddTableDlg::Close() +sal_Bool OAddTableDlg::Close() { m_rContext.onWindowClosing( this ); return ModelessDialog::Close(); diff --git a/dbaccess/source/ui/dlg/adtabdlg.src b/dbaccess/source/ui/dlg/adtabdlg.src index ecff324d7..deb914dd8 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.src +++ b/dbaccess/source/ui/dlg/adtabdlg.src @@ -38,7 +38,7 @@ ModelessDialog DLG_JOIN_TABADD { OutputSize = TRUE ; SVLook = TRUE ; - HelpID = DLG_JOIN_TABADD ; + HelpID = HID_DLG_JOIN_TABADD ; Size = MAP_APPFONT ( 178 , 147 ) ; Moveable = TRUE ; Closeable = TRUE ; @@ -46,6 +46,7 @@ ModelessDialog DLG_JOIN_TABADD RadioButton RB_CASE_TABLES { + HelpID = "dbaccess:RadioButton:DLG_JOIN_TABADD:RB_CASE_TABLES"; Pos = MAP_APPFONT( 6, 6 ); Size = MAP_APPFONT( 50, 8 ); Text [ en-US ] = "Tables"; @@ -53,6 +54,7 @@ ModelessDialog DLG_JOIN_TABADD RadioButton RB_CASE_QUERIES { + HelpID = "dbaccess:RadioButton:DLG_JOIN_TABADD:RB_CASE_QUERIES"; Pos = MAP_APPFONT( 62, 6 ); Size = MAP_APPFONT( 50, 8 ); Text [ en-US ] = "Queries"; @@ -70,6 +72,7 @@ ModelessDialog DLG_JOIN_TABADD PushButton PB_ADDTABLE { + HelpID = "dbaccess:PushButton:DLG_JOIN_TABADD:PB_ADDTABLE"; Pos = MAP_APPFONT ( 123 , 6 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Add" ; diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index a50283ed4..1bb172e00 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.cxx +++ b/dbaccess/source/ui/dlg/advancedsettings.cxx @@ -70,9 +70,9 @@ namespace dbaui struct BooleanSettingDesc { CheckBox** ppControl; // the dialog's control which displays this setting - USHORT nControlResId; // the resource ID to load the control from - USHORT 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 FALSE, and vice versa + sal_uInt16 nControlResId; // the resource ID to load the control from + 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 }; //======================================================================== @@ -98,9 +98,12 @@ namespace dbaui ,m_pPrimaryKeySupport(NULL) ,m_pBooleanComparisonModeLabel( NULL ) ,m_pBooleanComparisonMode( NULL ) + ,m_pMaxRowScanLabel( NULL ) + ,m_pMaxRowScan( NULL ) ,m_aControlDependencies() ,m_aBooleanSettings() ,m_bHasBooleanComparisonMode( _rDSMeta.getFeatureSet().has( DSID_BOOLEANCOMPARISON ) ) + ,m_bHasMaxRowScan( _rDSMeta.getFeatureSet().has( DSID_MAX_ROW_SCAN ) ) { impl_initBooleanSettings(); @@ -111,17 +114,17 @@ namespace dbaui ++setting ) { - USHORT nItemId = setting->nItemId; + sal_uInt16 nItemId = setting->nItemId; if ( rFeatures.has( nItemId ) ) { - USHORT nResourceId = setting->nControlResId; + sal_uInt16 nResourceId = setting->nControlResId; (*setting->ppControl) = new CheckBox( this, ModuleRes( nResourceId ) ); (*setting->ppControl)->SetClickHdl( getControlModifiedLink() ); // check whether this must be a tristate check box const SfxPoolItem& rItem = _rCoreAttrs.Get( nItemId ); if ( rItem.ISA( OptionalBoolItem ) ) - (*setting->ppControl)->EnableTriState( TRUE ); + (*setting->ppControl)->EnableTriState( sal_True ); } } @@ -165,6 +168,21 @@ namespace dbaui m_pBooleanComparisonModeLabel->SetPosPixel( Point( aLabelPos.X(), aLabelPos.Y() - nMoveUp ) ); m_pBooleanComparisonMode->SetPosPixel( Point( aControlPos.X(), aControlPos.Y() - nMoveUp ) ); } + // create the controls for the max row scan + if ( m_bHasMaxRowScan ) + { + m_pMaxRowScanLabel = new FixedText( this, ModuleRes( FT_MAXROWSCAN ) ); + m_pMaxRowScan = new NumericField( this, ModuleRes( NF_MAXROWSCAN ) ); + m_pMaxRowScan->SetModifyHdl(getControlModifiedLink()); + m_pMaxRowScan->SetUseThousandSep(sal_False); + + Point aLabelPos( m_pMaxRowScanLabel->GetPosPixel() ); + Point aControlPos( m_pMaxRowScan->GetPosPixel() ); + long nMoveUp = aControlPos.Y() - aPos.Y(); + + m_pMaxRowScanLabel->SetPosPixel( Point( aLabelPos.X(), aLabelPos.Y() - nMoveUp ) ); + m_pMaxRowScan->SetPosPixel( Point( aControlPos.X(), aControlPos.Y() - nMoveUp ) ); + } FreeResource(); } @@ -191,6 +209,8 @@ namespace dbaui DELETEZ( m_pPrimaryKeySupport ); DELETEZ( m_pBooleanComparisonModeLabel ); DELETEZ( m_pBooleanComparisonMode ); + DELETEZ( m_pMaxRowScanLabel ); + DELETEZ( m_pMaxRowScan ); } // ----------------------------------------------------------------------- @@ -231,6 +251,10 @@ namespace dbaui { _rControlList.push_back( new ODisableWrapper< FixedText >( m_pBooleanComparisonModeLabel ) ); } + if ( m_bHasMaxRowScan ) + { + _rControlList.push_back( new ODisableWrapper< FixedText >( m_pMaxRowScanLabel ) ); + } } // ----------------------------------------------------------------------- @@ -249,6 +273,8 @@ namespace dbaui if ( m_bHasBooleanComparisonMode ) _rControlList.push_back( new OSaveValueWrapper< ListBox >( m_pBooleanComparisonMode ) ); + if ( m_bHasMaxRowScan ) + _rControlList.push_back(new OSaveValueWrapper<NumericField>(m_pMaxRowScan)); } // ----------------------------------------------------------------------- @@ -293,7 +319,7 @@ namespace dbaui } else { - BOOL bValue = *aValue; + sal_Bool bValue = *aValue; if ( setting->bInvertedDisplay ) bValue = !bValue; (*setting->ppControl)->Check( bValue ); @@ -304,7 +330,13 @@ namespace dbaui if ( m_bHasBooleanComparisonMode ) { SFX_ITEMSET_GET( _rSet, pBooleanComparison, SfxInt32Item, DSID_BOOLEANCOMPARISON, sal_True ); - m_pBooleanComparisonMode->SelectEntryPos( static_cast< USHORT >( pBooleanComparison->GetValue() ) ); + m_pBooleanComparisonMode->SelectEntryPos( static_cast< sal_uInt16 >( pBooleanComparison->GetValue() ) ); + } + + if ( m_bHasMaxRowScan ) + { + SFX_ITEMSET_GET(_rSet, pMaxRowScan, SfxInt32Item, DSID_MAX_ROW_SCAN, sal_True); + m_pMaxRowScan->SetValue(pMaxRowScan->GetValue()); } OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue); @@ -335,6 +367,10 @@ namespace dbaui bChangedSomething = sal_True; } } + if ( m_bHasMaxRowScan ) + { + fillInt32(_rSet,m_pMaxRowScan,DSID_MAX_ROW_SCAN,bChangedSomething); + } return bChangedSomething; } @@ -487,7 +523,7 @@ namespace dbaui } //------------------------------------------------------------------------- - void AdvancedSettingsDialog::PageCreated(USHORT _nId, SfxTabPage& _rPage) + void AdvancedSettingsDialog::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage) { // register ourself as modified listener static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory(m_pImpl->getORB()); diff --git a/dbaccess/source/ui/dlg/advancedsettings.hrc b/dbaccess/source/ui/dlg/advancedsettings.hrc index 8a09c0adc..320683897 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.hrc +++ b/dbaccess/source/ui/dlg/advancedsettings.hrc @@ -69,7 +69,9 @@ #define FT_AUTOINCREMENTVALUE 1 #define FT_RETRIEVE_AUTO 2 #define FT_BOOLEANCOMPARISON 3 +#define FT_MAXROWSCAN 4 #define LB_BOOLEANCOMPARISON 1 +#define NF_MAXROWSCAN 1 #endif // DBAUI_ADVANCEDSETTINGS_HRC diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx index b13043ca7..342247ecb 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.hxx +++ b/dbaccess/source/ui/dlg/advancedsettings.hxx @@ -38,6 +38,7 @@ #include <svtools/dialogcontrolling.hxx> #include <vcl/lstbox.hxx> +#include <vcl/field.hxx> #include <vector> @@ -77,15 +78,19 @@ namespace dbaui FixedText* m_pBooleanComparisonModeLabel; ListBox* m_pBooleanComparisonMode; + FixedText* m_pMaxRowScanLabel; + NumericField* m_pMaxRowScan; + ::svt::ControlDependencyManager m_aControlDependencies; BooleanSettingDescs m_aBooleanSettings; bool m_bHasBooleanComparisonMode; + bool m_bHasMaxRowScan; public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); SpecialSettingsPage(Window* pParent, const SfxItemSet& _rCoreAttrs, const DataSourceMetaData& _rDSMeta ); @@ -123,7 +128,7 @@ namespace dbaui m_aControlDependencies; public: - virtual BOOL FillItemSet (SfxItemSet& _rCoreAttrs); + virtual sal_Bool FillItemSet (SfxItemSet& _rCoreAttrs); GeneratedValuesPage( Window* pParent, const SfxItemSet& _rCoreAttrs ); protected: diff --git a/dbaccess/source/ui/dlg/advancedsettings.src b/dbaccess/source/ui/dlg/advancedsettings.src index a4eb47133..afff07fc7 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.src +++ b/dbaccess/source/ui/dlg/advancedsettings.src @@ -249,10 +249,29 @@ WORKAROUND \ }; \ +#define AUTO_MAXROWSCAN(AUTO_Y) \ + FixedText FT_MAXROWSCAN \ + { \ + Pos = MAP_APPFONT ( START_X , AUTO_Y + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) ; \ + Size = MAP_APPFONT ( 100 , CHECKBOX_HEIGHT ); \ + Text [ en-US ] = "Rows to scan column types"; \ + }; \ + NumericField NF_MAXROWSCAN \ + { \ + Pos = MAP_APPFONT ( START_X + 100, AUTO_Y ) ; \ + Size = MAP_APPFONT ( 60 , EDIT_HEIGHT ) ; \ + TabStop = TRUE ; \ + NoThousandSep = TRUE; \ + Border = TRUE; \ + HelpId = HID_DSADMIN_MAXROWSCAN; \ + }; \ + + //------------------------------------------------------------------------- TabPage PAGE_GENERATED_VALUES { + HelpID = "dbaccess:TabPage:PAGE_GENERATED_VALUES"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( ADVANCED_PAGE_X , ADVANCED_PAGE_Y ) ; @@ -311,6 +330,7 @@ TabPage PAGE_GENERATED_VALUES TabPage PAGE_ADVANCED_SETTINGS_SPECIAL { + HelpID = "dbaccess:TabPage:PAGE_ADVANCED_SETTINGS_SPECIAL"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( ADVANCED_PAGE_X , ADVANCED_PAGE_Y ) ; @@ -332,6 +352,7 @@ TabPage PAGE_ADVANCED_SETTINGS_SPECIAL AUTO_ESCAPE_DATETIME( 14*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS ) AUTO_PRIMARY_KEY_SUPPORT( 15*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 15*CHECKBOX_HEIGHT + RELATED_CONTROLS ) AUTO_BOOLEANCOMPARISON( 16*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) + AUTO_MAXROWSCAN( 17*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) }; //------------------------------------------------------------------------- @@ -349,7 +370,6 @@ TabDialog DLG_DATABASE_ADVANCED { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; String STR_GENERATED_VALUE diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx index 0c1ecabda..90d679328 100644 --- a/dbaccess/source/ui/dlg/dbadmin.cxx +++ b/dbaccess/source/ui/dlg/dbadmin.cxx @@ -109,7 +109,7 @@ short ODbAdminDialog::Ok() } //------------------------------------------------------------------------- -void ODbAdminDialog::PageCreated(USHORT _nId, SfxTabPage& _rPage) +void ODbAdminDialog::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage) { // register ourself as modified listener static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory(m_pImpl->getORB()); @@ -124,7 +124,7 @@ void ODbAdminDialog::PageCreated(USHORT _nId, SfxTabPage& _rPage) } // ----------------------------------------------------------------------------- -void ODbAdminDialog::addDetailPage(USHORT _nPageId, USHORT _nTextId, CreateTabPage _pCreateFunc) +void ODbAdminDialog::addDetailPage(sal_uInt16 _nPageId, sal_uInt16 _nTextId, CreateTabPage _pCreateFunc) { // open our own resource block, as the page titles are strings local to this block LocalResourceAccess aDummy(DLG_DATABASE_ADMINISTRATION, RSC_TABDIALOG); @@ -409,6 +409,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp *pCounter++ = new SfxBoolItem(DSID_ESCAPE_DATETIME, sal_True); *pCounter++ = new SfxStringItem(DSID_NAMED_PIPE, String()); *pCounter++ = new OptionalBoolItem( DSID_PRIMARY_KEY_SUPPORT ); + *pCounter++ = new SfxInt32Item(DSID_MAX_ROW_SCAN, 100); // create the pool static SfxItemInfo const aItemInfos[DSID_LAST_ITEM_ID - DSID_FIRST_ITEM_ID + 1] = @@ -471,6 +472,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp {0,0}, {0,0}, {0,0}, + {0,0}, {0,0} }; diff --git a/dbaccess/source/ui/dlg/dbadmin.src b/dbaccess/source/ui/dlg/dbadmin.src index 5a956eb27..0cadd0578 100644 --- a/dbaccess/source/ui/dlg/dbadmin.src +++ b/dbaccess/source/ui/dlg/dbadmin.src @@ -112,7 +112,6 @@ TabDialog DLG_DATABASE_ADMINISTRATION { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; //......................................................................... @@ -146,7 +145,6 @@ ModalDialog DLG_DATABASE_TYPE_CHANGE { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; Text [ en-US ] = "Database properties" ; }; @@ -195,6 +193,7 @@ TabPage PAGE_GENERAL RadioButton RB_OPENEXISTINGDOC { + HelpID = "dbaccess:RadioButton:PAGE_GENERAL:RB_OPENEXISTINGDOC"; Pos = MAP_APPFONT (START_X + 6 , 97 ); Size = MAP_APPFONT ( 206 , 8 ) ; Text [ en-US ] = "Open an existing database ~file" ; @@ -209,6 +208,7 @@ TabPage PAGE_GENERAL ListBox LB_DOCUMENTLIST { + HelpID = "dbaccess:ListBox:PAGE_GENERAL:LB_DOCUMENTLIST"; Pos = MAP_APPFONT( START_X + INDENTED_X + INDENT_BELOW_RADIO, 121 ); Size = MAP_APPFONT( 120, 14 ); DropDown = TRUE; @@ -217,6 +217,7 @@ TabPage PAGE_GENERAL PushButton PB_OPENDOCUMENT { + HelpID = "dbaccess:PushButton:PAGE_GENERAL:PB_OPENDOCUMENT"; Pos = MAP_APPFONT( START_X + INDENTED_X + INDENT_BELOW_RADIO, 139 ); Size = MAP_APPFONT( 50, 16 ); OutputSize = TRUE; @@ -418,6 +419,7 @@ TabPage PAGE_ADABAS }; Edit ET_HOSTNAME { + HelpID = "dbaccess:Edit:PAGE_ADABAS:ET_HOSTNAME"; TabStop = TRUE ; Border = TRUE ; @@ -433,6 +435,7 @@ TabPage PAGE_ADABAS }; NumericField NF_CACHE_SIZE { + HelpID = "dbaccess:NumericField:PAGE_ADABAS:NF_CACHE_SIZE"; Pos = MAP_APPFONT ( EDIT_X , 2*UNRELATED_CONTROLS + RELATED_CONTROLS + 2*FIXEDTEXT_HEIGHT -1 ) ; Size = MAP_APPFONT ( 40 , EDIT_HEIGHT ) ; Border = TRUE ; @@ -450,6 +453,7 @@ TabPage PAGE_ADABAS }; NumericField NF_DATA_INCREMENT { + HelpID = "dbaccess:NumericField:PAGE_ADABAS:NF_DATA_INCREMENT"; Pos = MAP_APPFONT ( EDIT_X , 3*UNRELATED_CONTROLS + RELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT -1 ) ; Size = MAP_APPFONT ( 40 , EDIT_HEIGHT ) ; Border = TRUE ; @@ -472,6 +476,7 @@ TabPage PAGE_ADABAS }; Edit ET_CTRLUSERNAME { + HelpID = "dbaccess:Edit:PAGE_ADABAS:ET_CTRLUSERNAME"; Border = TRUE ; Pos = MAP_APPFONT ( EDIT_X , 4*UNRELATED_CONTROLS + 2*RELATED_CONTROLS + 5*FIXEDTEXT_HEIGHT-1 ) ; Size = MAP_APPFONT ( 105 , EDIT_HEIGHT ) ; @@ -485,6 +490,7 @@ TabPage PAGE_ADABAS }; Edit ET_CTRLPASSWORD { + HelpID = "dbaccess:Edit:PAGE_ADABAS:ET_CTRLPASSWORD"; Border = TRUE ; Pos = MAP_APPFONT ( EDIT_X , 5*UNRELATED_CONTROLS + 2*RELATED_CONTROLS + 6*FIXEDTEXT_HEIGHT-1 ) ; Size = MAP_APPFONT ( 105 , EDIT_HEIGHT) ; @@ -494,6 +500,7 @@ TabPage PAGE_ADABAS CheckBox CB_SHUTDB { + HelpID = "dbaccess:CheckBox:PAGE_ADABAS:CB_SHUTDB"; Pos = MAP_APPFONT ( 6 , 6*UNRELATED_CONTROLS + 2*RELATED_CONTROLS + 7*FIXEDTEXT_HEIGHT ) ; Size = MAP_APPFONT ( 248 , CHECKBOX_HEIGHT ) ; Text[ en-US ] = "~Shut down service when closing %PRODUCTNAME"; @@ -501,6 +508,7 @@ TabPage PAGE_ADABAS PushButton PB_STAT { + HelpID = "dbaccess:PushButton:PAGE_ADABAS:PB_STAT"; Pos = MAP_APPFONT ( PAGE_X - BUTTON_WIDTH - UNRELATED_CONTROLS, PAGE_Y - BUTTON_HEIGHT - UNRELATED_CONTROLS ) ; Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; Text[ en-US ] = "E~xtended..."; @@ -516,6 +524,7 @@ TabPage PAGE_ADABAS TabPage PAGE_MYSQL_ODBC { + HelpID = "dbaccess:TabPage:PAGE_MYSQL_ODBC"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( PAGE_X , PAGE_Y ) ; @@ -526,6 +535,7 @@ TabPage PAGE_MYSQL_ODBC TabPage PAGE_MYSQL_JDBC { + HelpID = "dbaccess:TabPage:PAGE_MYSQL_JDBC"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( PAGE_X , PAGE_Y ) ; @@ -544,6 +554,7 @@ TabPage PAGE_MYSQL_JDBC }; Edit ET_JDBCDRIVERCLASS { + HelpID = "dbaccess:Edit:PAGE_MYSQL_JDBC:ET_JDBCDRIVERCLASS"; Pos = MAP_APPFONT ( EDIT_X, 4*UNRELATED_CONTROLS + RELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT -1 + EDIT_HEIGHT) ; Size = MAP_APPFONT ( 97 , EDIT_HEIGHT ) ; @@ -552,6 +563,7 @@ TabPage PAGE_MYSQL_JDBC }; PushButton PB_TESTDRIVERCLASS { + HelpID = "dbaccess:PushButton:PAGE_MYSQL_JDBC:PB_TESTDRIVERCLASS"; TabStop = TRUE ; Pos = MAP_APPFONT ( PAGE_X - BUTTON_WIDTH - UNRELATED_CONTROLS , 4*UNRELATED_CONTROLS + RELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT -2 + EDIT_HEIGHT) ; Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; @@ -563,6 +575,7 @@ TabPage PAGE_MYSQL_JDBC TabPage PAGE_MYSQL_NATIVE { + HelpID = "dbaccess:TabPage:PAGE_MYSQL_NATIVE"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( PAGE_X , PAGE_Y ) ; @@ -584,6 +597,7 @@ TabPage PAGE_MYSQL_NATIVE }; Edit ET_USERNAME { + HelpID = "dbaccess:Edit:PAGE_MYSQL_NATIVE:ET_USERNAME"; Border = TRUE ; Pos = MAP_APPFONT ( EDIT_X, 4*UNRELATED_CONTROLS + 4*RELATED_CONTROLS + 4*FIXEDTEXT_HEIGHT + 3*EDIT_HEIGHT - 1 ) ; Size = MAP_APPFONT ( 105 , EDIT_HEIGHT ) ; @@ -591,6 +605,7 @@ TabPage PAGE_MYSQL_NATIVE }; CheckBox CB_PASSWORD_REQUIRED { + HelpID = "dbaccess:CheckBox:PAGE_MYSQL_NATIVE:CB_PASSWORD_REQUIRED"; Pos = MAP_APPFONT ( EDIT_X, 4*UNRELATED_CONTROLS + 5*RELATED_CONTROLS + 4*FIXEDTEXT_HEIGHT + 4*EDIT_HEIGHT ) ; Size = MAP_APPFONT ( 105, CHECKBOX_HEIGHT ) ; Text [ en-US ] = "Password required"; @@ -601,6 +616,7 @@ TabPage PAGE_MYSQL_NATIVE TabPage PAGE_ORACLE_JDBC { + HelpID = "dbaccess:TabPage:PAGE_ORACLE_JDBC"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( PAGE_X , PAGE_Y ) ; @@ -620,6 +636,7 @@ TabPage PAGE_ORACLE_JDBC }; Edit ET_JDBCDRIVERCLASS { + HelpID = "dbaccess:Edit:PAGE_ORACLE_JDBC:ET_JDBCDRIVERCLASS"; Pos = MAP_APPFONT ( EDIT_X, 4*UNRELATED_CONTROLS + RELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT + EDIT_HEIGHT + ( FIXEDTEXT_HEIGHT - EDIT_HEIGHT ) / 2 ) ; Size = MAP_APPFONT ( 97 , EDIT_HEIGHT ) ; @@ -628,6 +645,7 @@ TabPage PAGE_ORACLE_JDBC }; PushButton PB_TESTDRIVERCLASS { + HelpID = "dbaccess:PushButton:PAGE_ORACLE_JDBC:PB_TESTDRIVERCLASS"; TabStop = TRUE ; Pos = MAP_APPFONT ( PAGE_X - BUTTON_WIDTH - UNRELATED_CONTROLS, 4*UNRELATED_CONTROLS + RELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT + EDIT_HEIGHT + ( FIXEDTEXT_HEIGHT - BUTTON_HEIGHT ) / 2 ) ; @@ -743,6 +761,7 @@ TabPage PAGE_USERDRIVER }; Edit ET_HOSTNAME { + HelpID = "dbaccess:Edit:PAGE_USERDRIVER:ET_HOSTNAME"; TabStop = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( EDIT_X , UNRELATED_CONTROLS -1 ) ; @@ -758,6 +777,7 @@ TabPage PAGE_USERDRIVER NumericField NF_PORTNUMBER { + HelpID = "dbaccess:NumericField:PAGE_USERDRIVER:NF_PORTNUMBER"; TabStop = TRUE ; Border = TRUE ; NoThousandSep = TRUE; @@ -774,6 +794,7 @@ TabPage PAGE_USERDRIVER }; Edit ET_OPTIONS { + HelpID = "dbaccess:Edit:PAGE_USERDRIVER:ET_OPTIONS"; Border = TRUE ; TabStop = TRUE ; }; diff --git a/dbaccess/source/ui/dlg/dbadmin2.src b/dbaccess/source/ui/dlg/dbadmin2.src index 5d6ce5494..c7afa2119 100644 --- a/dbaccess/source/ui/dlg/dbadmin2.src +++ b/dbaccess/source/ui/dlg/dbadmin2.src @@ -52,11 +52,6 @@ String STR_ENTER_CONNECTION_PASSWORD Text [ en-US ] = "A password is needed to connect to the data source \"$name$\"."; }; -String STR_QUERY_DROP_ALL -{ - Text[ en-US ] = "Do you want to delete all selected items?"; -}; - String STR_ASK_FOR_DIRECTORY_CREATION { Text [ en-US ] = "The directory\n\n$path$\n\ndoes not exist. Should it be created?"; @@ -67,45 +62,10 @@ String STR_COULD_NOT_CREATE_DIRECTORY Text [ en-US ] = "The directory $name$ could not be created."; }; -String STR_ADDRESSBOOK_SYSTEM -{ - Text[ en-US ] = "Windows address book"; -}; - -String STR_ADDRESSBOOK_OUTLOOK -{ - Text[ en-US ] = "MS Outlook"; -}; - -String STR_ADDRESSBOOK_MOZILLA -{ - Text[ en-US ] = "Mozilla address book"; -}; - -String STR_ADDRESSBOOK_THUNDERBIRD -{ - Text[ en-US ] = "Thunderbird address book"; -}; -String STR_ADDRESSBOOK_EVOLUTION -{ - Text[ en-US ] = "Evolution address book"; -}; -String STR_ADDRESSBOOK_LDAP -{ - Text[ en-US ] = "LDAP address book"; -}; -String STR_HINT_READONLY_CONNECTION -{ - Text [ en-US ] = "(Connection is read-only)"; -}; -String STR_HINT_CONNECTION_NOT_CAPABLE -{ - Text [ en-US ] = "(Not supported by this connection)"; -}; #define EDIT_SIZE_X 50 #define FT_SIZE_X 90 @@ -114,6 +74,7 @@ String STR_HINT_CONNECTION_NOT_CAPABLE ModalDialog DLG_DOMAINPASSWORD { + HelpID = "dbaccess:ModalDialog:DLG_DOMAINPASSWORD"; Border = TRUE ; Moveable = TRUE ; OutputSize = TRUE ; @@ -130,6 +91,7 @@ ModalDialog DLG_DOMAINPASSWORD Edit ET_PASSWORD { + HelpID = "dbaccess:Edit:DLG_DOMAINPASSWORD:ET_PASSWORD"; Border = TRUE ; Pos = MAP_APPFONT ( 12 + FT_SIZE_X , 16 ) ; Size = MAP_APPFONT ( EDIT_SIZE_X , 12 ) ; diff --git a/dbaccess/source/ui/dlg/dbadminsetup.src b/dbaccess/source/ui/dlg/dbadminsetup.src index f1351216d..f8f8dac62 100644 --- a/dbaccess/source/ui/dlg/dbadminsetup.src +++ b/dbaccess/source/ui/dlg/dbadminsetup.src @@ -56,7 +56,6 @@ ModalDialog DLG_DATABASE_WIZARD { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; String STR_DBWIZARDTITLE @@ -150,6 +149,7 @@ String STR_DATABASEDEFAULTNAME TabPage PAGE_DBWIZARD_MYSQL_INTRO { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_MYSQL_INTRO"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -195,6 +195,7 @@ TabPage PAGE_DBWIZARD_MYSQL_INTRO }; RadioButton RB_CONNECTVIANATIVE { + HelpID = "dbaccess:RadioButton:PAGE_DBWIZARD_MYSQL_INTRO:RB_CONNECTVIANATIVE"; Pos = MAP_APPFONT (START_X + 6 , 115 ) ; Size = MAP_APPFONT ( 205 , 9 ) ; Text[ en-US ] = "Connect directly" ; @@ -206,6 +207,7 @@ TabPage PAGE_DBWIZARD_MYSQL_INTRO TabPage PAGE_DBWIZARD_AUTHENTIFICATION { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_AUTHENTIFICATION"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -262,6 +264,7 @@ TabPage PAGE_DBWIZARD_AUTHENTIFICATION TabPage PAGE_DBWIZARD_FINAL { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_FINAL"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -335,6 +338,7 @@ TabPage PAGE_DBWIZARD_FINAL TabPage PAGE_DBWIZARD_MYSQL_JDBC { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_MYSQL_JDBC"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -361,11 +365,12 @@ TabPage PAGE_DBWIZARD_MYSQL_JDBC Text[ en-US ] = "Default: 3306"; }; - AUTOHELP_JDBCCONTROLGROUP(HID_PAGE_DBWIZARD_JDBC_ET_MYSQLDBNAME) + AUTOHELP_JDBCCONTROLGROUP(HID_PAGE_DBWIZARD_JDBC_ET_MYSQLDBNAME,HID_PAGE_DBWIZARD_JDBC_ET_MYSQLHOSTSERVER,HID_PAGE_DBWIZARD_JDBC_ET_MYSQLPORT,HID_PAGE_DBWIZARD_JDBC_ET_MYSQLCLASS,HID_PAGE_DBWIZARD_JDBC_PB_TESTMYSQLCLASS) }; TabPage PAGE_DBWIZARD_MYSQL_NATIVE { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_MYSQL_NATIVE"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0, 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -391,6 +396,7 @@ TabPage PAGE_DBWIZARD_MYSQL_NATIVE TabPage PAGE_DBWIZARD_DBASE { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_DBASE"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -406,11 +412,12 @@ TabPage PAGE_DBWIZARD_DBASE Text[ en-US ] = "Select the folder where the dBASE files are stored." ; }; - AUTO_HELP_BROWSECONTROLGROUP( 3, HID_PAGE_DBWIZARD_DBASE_ET_DBASELOCATION) + AUTO_HELP_BROWSECONTROLGROUP( 3, HID_PAGE_DBWIZARD_DBASE_ET_DBASELOCATION,HID_PAGE_DBWIZARD_DBASE_PB_DBASELOCATION) }; TabPage PAGE_DBWIZARD_TEXT { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_TEXT"; String STR_TEXT_HEADERTEXT { Text[ en-US ] = "Set up a connection to text files" ; @@ -425,12 +432,13 @@ TabPage PAGE_DBWIZARD_TEXT Text[ en-US ] = "Path to text files"; }; - AUTO_HELP_BROWSECONTROLGROUP(3, HID_PAGE_DBWIZARD_TEXT_ET_LOCATIONTEXTFILE) + AUTO_HELP_BROWSECONTROLGROUP(3, HID_PAGE_DBWIZARD_TEXT_ET_LOCATIONTEXTFILE,HID_PAGE_DBWIZARD_TEXT_PB_LOCATIONTEXTFILE) AUTO_SEPARATORCONTROLGROUP(82, WIZARD_PAGE_X) }; TabPage PAGE_DBWIZARD_MSACCESS { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_MSACCESS"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -446,11 +454,12 @@ TabPage PAGE_DBWIZARD_MSACCESS Text[ en-US ] = "Please select the Microsoft Access file you want to access."; }; - AUTO_HELP_BROWSECONTROLGROUP(3, HID_PAGE_DBWIZARD_MSACCESS_ET_MSACCESSLOCATION) + AUTO_HELP_BROWSECONTROLGROUP(3, HID_PAGE_DBWIZARD_MSACCESS_ET_MSACCESSLOCATION, HID_PAGE_DBWIZARD_MSACCESS_PB_MSACCESSLOCATION) }; TabPage PAGE_DBWIZARD_LDAP { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_LDAP"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -490,6 +499,7 @@ TabPage PAGE_DBWIZARD_LDAP TabPage PAGE_DBWIZARD_ADABAS { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_ADABAS"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -504,11 +514,12 @@ TabPage PAGE_DBWIZARD_ADABAS Text[ en-US ] = "Enter the name of the Adabas D database you want to connect to.\nClick 'Browse...' to select an Adabas D database that is already registered in %PRODUCTNAME." ; }; - AUTO_HELP_BROWSECONTROLGROUP(4, HID_PAGE_DBWIZARD_ADABAS_ET_ADABASNAME) + AUTO_HELP_BROWSECONTROLGROUP(4, HID_PAGE_DBWIZARD_ADABAS_ET_ADABASNAME, HID_PAGE_DBWIZARD_ADABAS_PB_ADABASNAME) }; TabPage PAGE_DBWIZARD_ADO { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_ADO"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -523,12 +534,13 @@ TabPage PAGE_DBWIZARD_ADO Text[ en-US ] = "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." ; }; - AUTO_HELP_BROWSECONTROLGROUP(5, HID_PAGE_DBWIZARD_ADO_ET_ADOURL) + AUTO_HELP_BROWSECONTROLGROUP(5, HID_PAGE_DBWIZARD_ADO_ET_ADOURL, HID_PAGE_DBWIZARD_ADO_PB_ADOURL) }; TabPage PAGE_DBWIZARD_ODBC { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_ODBC"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -543,21 +555,23 @@ TabPage PAGE_DBWIZARD_ODBC Text[ en-US ] = "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." ; }; - AUTO_HELP_BROWSECONTROLGROUP(6, HID_PAGE_DBWIZARD_ODBC_ET_NAMEOFODBCDATASOURCE) + AUTO_HELP_BROWSECONTROLGROUP(6, HID_PAGE_DBWIZARD_ODBC_ET_NAMEOFODBCDATASOURCE, HID_PAGE_DBWIZARD_ODBC_PB_NAMEOFODBCDATASOURCE) }; TabPage PAGE_DBWIZARD_USERDEFINED { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_USERDEFINED"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; Hide = TRUE ; - AUTO_HELP_BROWSECONTROLGROUP(6, HID_PAGE_DBWIZARD_USERDEFINED_ET_BROWSE) + AUTO_HELP_BROWSECONTROLGROUP(6, HID_PAGE_DBWIZARD_USERDEFINED_ET_BROWSE, HID_PAGE_DBWIZARD_USERDEFINED_BROWSE) }; TabPage PAGE_DBWIZARD_JDBC { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_JDBC"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -572,14 +586,15 @@ TabPage PAGE_DBWIZARD_JDBC Text[ en-US ] = "Please enter the required information to connect to a JDBC database.\nPlease contact your system administrator if you are unsure about the following settings." ; }; - AUTO_HELP_BROWSECONTROLGROUP(4, HID_PAGE_DBWIZARD_JDBC_ET_JDBCURL) - AUTO_JDBCDRIVERCLASSGROUP(119, HID_PAGE_DBWIZARD_JDBC_ET_JDBCCLASS) + AUTO_HELP_BROWSECONTROLGROUP(4, HID_PAGE_DBWIZARD_JDBC_ET_JDBCURL, HID_PAGE_DBWIZARD_JDBC_PB_JDBCURL) + AUTO_JDBCDRIVERCLASSGROUP(119, HID_PAGE_DBWIZARD_JDBC_ET_JDBCCLASS, HID_PAGE_DBWIZARD_JDBC_PB_TESTJDBCCLASS) }; TabPage PAGE_DBWIZARD_ORACLE { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_ORACLE"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -603,12 +618,13 @@ TabPage PAGE_DBWIZARD_ORACLE Text[ en-US ] = "Please enter the required information to connect to an Oracle database.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." ; }; - AUTOHELP_JDBCCONTROLGROUP(HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEDBNAME) + AUTOHELP_JDBCCONTROLGROUP(HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEDBNAME,HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEHOSTSERVER,HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEPORT,HID_PAGE_DBWIZARD_ORACLE_ET_ORACLECLASS,HID_PAGE_DBWIZARD_ORACLE_PB_TESTORACLECLASS) }; TabPage PAGE_DBWIZARD_SPREADSHEET { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_SPREADSHEET"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -623,7 +639,7 @@ TabPage PAGE_DBWIZARD_SPREADSHEET Text[ en-US ] = "Click 'Browse...' to select a %PRODUCTNAME spreadsheet or Microsoft Excel workbook.\n%PRODUCTNAME will open this file in read-only mode." ; }; - AUTO_HELP_BROWSECONTROLGROUP(3, HID_PAGE_DBWIZARD_SPREADSHEET_ET_SPREADSHEETPATH ) + AUTO_HELP_BROWSECONTROLGROUP(3, HID_PAGE_DBWIZARD_SPREADSHEET_ET_SPREADSHEETPATH,HID_PAGE_DBWIZARD_SPREADSHEET_PB_SPREADSHEETPATH ) String STR_SPREADSHEETPATH{ Text[ en-US ] = "~Location and file name" ; diff --git a/dbaccess/source/ui/dlg/dbfindex.hxx b/dbaccess/source/ui/dlg/dbfindex.hxx index 583188005..d65397e76 100644 --- a/dbaccess/source/ui/dlg/dbfindex.hxx +++ b/dbaccess/source/ui/dlg/dbfindex.hxx @@ -126,7 +126,7 @@ protected: String m_aDSN; TableInfoList m_aTableInfoList; TableIndexList m_aFreeIndexList; - BOOL m_bCaseSensitiv; + sal_Bool m_bCaseSensitiv; void Init(); void SetCtrls(); diff --git a/dbaccess/source/ui/dlg/dbfindex.src b/dbaccess/source/ui/dlg/dbfindex.src index 47c72d114..c6a03ff9b 100644 --- a/dbaccess/source/ui/dlg/dbfindex.src +++ b/dbaccess/source/ui/dlg/dbfindex.src @@ -37,6 +37,7 @@ ModalDialog DLG_DBASE_INDEXES { + HelpID = "dbaccess:ModalDialog:DLG_DBASE_INDEXES"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( WIN_X , WIN_Y ) ; @@ -69,6 +70,7 @@ ModalDialog DLG_DBASE_INDEXES }; ComboBox CB_TABLES { + HelpID = "dbaccess:ComboBox:DLG_DBASE_INDEXES:CB_TABLES"; Border = TRUE ; SVLook = TRUE ; Pos = MAP_APPFONT ( 62 , 5 ) ; @@ -90,6 +92,7 @@ ModalDialog DLG_DBASE_INDEXES }; ListBox LB_TABLEINDEXES { + HelpID = "dbaccess:ListBox:DLG_DBASE_INDEXES:LB_TABLEINDEXES"; Border = TRUE ; SVLook = TRUE ; Pos = MAP_APPFONT ( 12 , 44 ) ; @@ -104,6 +107,7 @@ ModalDialog DLG_DBASE_INDEXES }; ListBox LB_FREEINDEXES { + HelpID = "dbaccess:ListBox:DLG_DBASE_INDEXES:LB_FREEINDEXES"; Border = TRUE ; SVLook = TRUE ; Pos = MAP_APPFONT ( 120 , 44 ) ; @@ -112,6 +116,7 @@ ModalDialog DLG_DBASE_INDEXES }; ImageButton IB_ADD { + HelpID = "dbaccess:ImageButton:DLG_DBASE_INDEXES:IB_ADD"; Pos = MAP_APPFONT ( 94 , 60 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; @@ -131,6 +136,7 @@ ModalDialog DLG_DBASE_INDEXES }; ImageButton IB_ADDALL { + HelpID = "dbaccess:ImageButton:DLG_DBASE_INDEXES:IB_ADDALL"; Pos = MAP_APPFONT ( 94 , 77 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; @@ -150,6 +156,7 @@ ModalDialog DLG_DBASE_INDEXES }; ImageButton IB_REMOVE { + HelpID = "dbaccess:ImageButton:DLG_DBASE_INDEXES:IB_REMOVE"; Pos = MAP_APPFONT ( 94 , 98 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; @@ -169,6 +176,7 @@ ModalDialog DLG_DBASE_INDEXES }; ImageButton IB_REMOVEALL { + HelpID = "dbaccess:ImageButton:DLG_DBASE_INDEXES:IB_REMOVEALL"; Pos = MAP_APPFONT ( 94, 114 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx index 1b836cbf6..654f32517 100644 --- a/dbaccess/source/ui/dlg/dbwiz.cxx +++ b/dbaccess/source/ui/dlg/dbwiz.cxx @@ -258,7 +258,7 @@ void ODbTypeWizDialog::clearPassword() // ----------------------------------------------------------------------------- TabPage* ODbTypeWizDialog::createPage(WizardState _nState) { - USHORT nStringId = STR_PAGETITLE_ADVANCED; + sal_uInt16 nStringId = STR_PAGETITLE_ADVANCED; TabPage* pPage = NULL; switch(_nState) { diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 6e53e81d0..7d7d24c79 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -76,7 +76,7 @@ namespace dbaui //======================================================================== DBG_NAME(OCommonBehaviourTabPage) //------------------------------------------------------------------------ - OCommonBehaviourTabPage::OCommonBehaviourTabPage(Window* pParent, USHORT nResId, const SfxItemSet& _rCoreAttrs, + OCommonBehaviourTabPage::OCommonBehaviourTabPage(Window* pParent, sal_uInt16 nResId, const SfxItemSet& _rCoreAttrs, sal_uInt32 nControlFlags,bool _bFreeResource) :OGenericAdministrationPage(pParent, ModuleRes(nResId), _rCoreAttrs) @@ -500,7 +500,7 @@ namespace dbaui //======================================================================== //= OMySQLJDBCDetailsPage //======================================================================== - OGeneralSpecialJDBCDetailsPage::OGeneralSpecialJDBCDetailsPage( Window* pParent,USHORT _nResId, const SfxItemSet& _rCoreAttrs ,USHORT _nPortId) + OGeneralSpecialJDBCDetailsPage::OGeneralSpecialJDBCDetailsPage( Window* pParent,sal_uInt16 _nResId, const SfxItemSet& _rCoreAttrs ,sal_uInt16 _nPortId) :OCommonBehaviourTabPage(pParent, _nResId, _rCoreAttrs, CBTP_USE_CHARSET ,false) ,m_aFL_1 (this, ModuleRes( FL_SEPARATOR1) ) ,m_aFTHostname (this, ModuleRes(FT_HOSTNAME)) @@ -531,9 +531,9 @@ namespace dbaui else { m_bUseClass = false; - m_aFTDriverClass.Show(FALSE); - m_aEDDriverClass.Show(FALSE); - m_aTestJavaDriver.Show(FALSE); + m_aFTDriverClass.Show(sal_False); + m_aEDDriverClass.Show(sal_False); + m_aTestJavaDriver.Show(sal_False); } m_aFTSocket.Show(PAGE_MYSQL_JDBC == _nResId && !m_bUseClass); @@ -648,7 +648,7 @@ namespace dbaui { } - USHORT nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; + sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; OSQLMessageBox aMsg( this, String( ModuleRes( nMessage ) ), String() ); aMsg.Execute(); return 0L; @@ -900,7 +900,7 @@ namespace dbaui IMPL_LINK( OAdabasDetailsPage, AttributesChangedHdl, void *, EMPTYARG ) { m_CB_SHUTDB.Enable(m_ET_CTRLUSERNAME.GetText().Len() && m_ET_CTRLPASSWORD.GetText().Len()); - bAttrsChanged = TRUE; + bAttrsChanged = sal_True; callModifiedHdl(); return 0; } diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx index f2a4cfbc5..a6615445d 100644 --- a/dbaccess/source/ui/dlg/detailpages.hxx +++ b/dbaccess/source/ui/dlg/detailpages.hxx @@ -81,9 +81,9 @@ namespace dbaui sal_uInt32 m_nControlFlags; public: - virtual BOOL FillItemSet (SfxItemSet& _rCoreAttrs); + virtual sal_Bool FillItemSet (SfxItemSet& _rCoreAttrs); - OCommonBehaviourTabPage(Window* pParent, USHORT nResId, const SfxItemSet& _rCoreAttrs, sal_uInt32 nControlFlags,bool _bFreeResource = true); + OCommonBehaviourTabPage(Window* pParent, sal_uInt16 nResId, const SfxItemSet& _rCoreAttrs, sal_uInt32 nControlFlags,bool _bFreeResource = true); protected: // nControlFlags ist eine Kombination der CBTP_xxx-Konstanten @@ -105,7 +105,7 @@ namespace dbaui class ODbaseDetailsPage : public OCommonBehaviourTabPage { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); ODbaseDetailsPage(Window* pParent, const SfxItemSet& _rCoreAttrs); private: @@ -148,7 +148,7 @@ namespace dbaui class OOdbcDetailsPage : public OCommonBehaviourTabPage { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); OOdbcDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ); protected: @@ -167,7 +167,7 @@ namespace dbaui class OUserDriverDetailsPage : public OCommonBehaviourTabPage { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); OUserDriverDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ); protected: @@ -198,15 +198,15 @@ namespace dbaui { public: OGeneralSpecialJDBCDetailsPage( Window* pParent - , USHORT _nResId + , sal_uInt16 _nResId , const SfxItemSet& _rCoreAttrs - , USHORT _nPortId + , sal_uInt16 _nPortId ); protected: - virtual BOOL FillItemSet( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet( SfxItemSet& _rCoreAttrs ); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList); virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList); @@ -227,7 +227,7 @@ namespace dbaui PushButton m_aTestJavaDriver; String m_sDefaultJdbcDriverName; - USHORT m_nPortId; + sal_uInt16 m_nPortId; bool m_bUseClass; }; @@ -250,7 +250,7 @@ namespace dbaui CheckBox m_aPasswordRequired; protected: - virtual BOOL FillItemSet( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet( SfxItemSet& _rCoreAttrs ); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList); virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList); @@ -262,7 +262,7 @@ namespace dbaui class OAdabasDetailsPage : public OCommonBehaviourTabPage { public: - virtual BOOL FillItemSet (SfxItemSet& _rCoreAttrs); + virtual sal_Bool FillItemSet (SfxItemSet& _rCoreAttrs); OAdabasDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ); protected: @@ -289,7 +289,7 @@ namespace dbaui CheckBox m_CB_SHUTDB; PushButton m_PB_STAT; String m_sUser; - BOOL bAttrsChanged; + sal_Bool bAttrsChanged; DECL_LINK( AttributesChangedHdl, void * ); DECL_LINK( UserSettingsHdl, void * ); @@ -303,7 +303,7 @@ namespace dbaui class OLDAPDetailsPage : public OCommonBehaviourTabPage { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); OLDAPDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ); protected: @@ -343,7 +343,7 @@ namespace dbaui class OTextDetailsPage : public OCommonBehaviourTabPage { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); OTextDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ); OTextConnectionHelper* m_pTextConnectionHelper; diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx index 90390d488..a2d3ffe1e 100644 --- a/dbaccess/source/ui/dlg/directsql.cxx +++ b/dbaccess/source/ui/dlg/directsql.cxx @@ -171,7 +171,7 @@ DBG_NAME(DirectSQLDialog) { m_aStatementHistory.pop_front(); m_aNormalizedHistory.pop_front(); - m_pSQLHistory->RemoveEntry((USHORT)0); + m_pSQLHistory->RemoveEntry((sal_uInt16)0); } } @@ -299,7 +299,7 @@ DBG_NAME(DirectSQLDialog) if (_bUpdateListBox) { // selecte the normalized statement in the list box - m_pSQLHistory->SelectEntryPos((USHORT)_nHistoryPos); + m_pSQLHistory->SelectEntryPos((sal_uInt16)_nHistoryPos); OSL_ENSURE(m_pSQLHistory->GetSelectEntry() == m_aNormalizedHistory[_nHistoryPos], "DirectSQLDialog::switchToHistory: inconsistent listbox entries!"); } diff --git a/dbaccess/source/ui/dlg/directsql.src b/dbaccess/source/ui/dlg/directsql.src index f81201c41..c5beb0a0c 100644 --- a/dbaccess/source/ui/dlg/directsql.src +++ b/dbaccess/source/ui/dlg/directsql.src @@ -40,6 +40,7 @@ ModalDialog DLG_DIRECTSQL { + HelpID = "dbaccess:ModalDialog:DLG_DIRECTSQL"; OutputSize = TRUE ; Moveable = TRUE ; Closeable = TRUE ; @@ -60,6 +61,7 @@ ModalDialog DLG_DIRECTSQL }; MultiLineEdit ME_SQL { + HelpID = "dbaccess:MultiLineEdit:DLG_DIRECTSQL:ME_SQL"; Pos = MAP_APPFONT( 7, 26 ); Size = MAP_APPFONT( WINDOW_SIZE_X - 14, 80 ); SVLook = TRUE; @@ -69,6 +71,7 @@ ModalDialog DLG_DIRECTSQL }; PushButton PB_EXECUTE { + HelpID = "dbaccess:PushButton:DLG_DIRECTSQL:PB_EXECUTE"; Pos = MAP_APPFONT( WINDOW_SIZE_X - BUTTON_SIZE_X - 7, 109 ); Size = MAP_APPFONT( BUTTON_SIZE_X, BUTTON_SIZE_Y ); Text [ en-US ] = "Execute"; @@ -82,6 +85,7 @@ ModalDialog DLG_DIRECTSQL }; ListBox LB_HISTORY { + HelpID = "dbaccess:ListBox:DLG_DIRECTSQL:LB_HISTORY"; Pos = MAP_APPFONT( 7, 121 + BUTTON_SIZE_Y + 3 ); Size = MAP_APPFONT( WINDOW_SIZE_X - 14, 14 ); SvLook = TRUE; @@ -96,6 +100,7 @@ ModalDialog DLG_DIRECTSQL }; MultiLineEdit ME_STATUS { + HelpID = "dbaccess:MultiLineEdit:DLG_DIRECTSQL:ME_STATUS"; Pos = MAP_APPFONT( 7, 153 + BUTTON_SIZE_Y ); Size = MAP_APPFONT( WINDOW_SIZE_X - 14, 41 ); Border = TRUE; @@ -114,6 +119,7 @@ ModalDialog DLG_DIRECTSQL }; PushButton PB_CLOSE { + HelpID = "dbaccess:PushButton:DLG_DIRECTSQL:PB_CLOSE"; Pos = MAP_APPFONT( WINDOW_SIZE_X - 7 - BUTTON_SIZE_X, 207 + BUTTON_SIZE_Y ); Size = MAP_APPFONT( BUTTON_SIZE_X, BUTTON_SIZE_Y ); Text [ en-US ] = "Close"; diff --git a/dbaccess/source/ui/dlg/dlgattr.cxx b/dbaccess/source/ui/dlg/dlgattr.cxx index 7537283b4..a95b4ef3e 100644 --- a/dbaccess/source/ui/dlg/dlgattr.cxx +++ b/dbaccess/source/ui/dlg/dlgattr.cxx @@ -51,7 +51,7 @@ using namespace dbaui; DBG_NAME(SbaSbAttrDlg) //================================================================== -SbaSbAttrDlg::SbaSbAttrDlg(Window* pParent, const SfxItemSet* pCellAttrs, SvNumberFormatter* pFormatter, USHORT nFlags, BOOL bRow) +SbaSbAttrDlg::SbaSbAttrDlg(Window* pParent, const SfxItemSet* pCellAttrs, SvNumberFormatter* pFormatter, sal_uInt16 nFlags, sal_Bool bRow) : SfxTabDialog(pParent, ModuleRes( DLG_ATTR ), pCellAttrs ) ,aTitle(ModuleRes(ST_ROW)) { @@ -88,7 +88,7 @@ void SbaSbAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) { case RID_SVXPAGE_NUMBERFORMAT: { - aSet.Put (SvxNumberInfoItem( pNumberInfoItem->GetNumberFormatter(), (const USHORT)SID_ATTR_NUMBERFORMAT_INFO)); + aSet.Put (SvxNumberInfoItem( pNumberInfoItem->GetNumberFormatter(), (const sal_uInt16)SID_ATTR_NUMBERFORMAT_INFO)); rTabPage.PageCreated(aSet); } break; diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx b/dbaccess/source/ui/dlg/dlgsave.cxx index 67719b64d..bdfe03d4d 100644 --- a/dbaccess/source/ui/dlg/dlgsave.cxx +++ b/dbaccess/source/ui/dlg/dlgsave.cxx @@ -185,7 +185,7 @@ namespace _rList.InsertEntry( sValue ); } - USHORT nPos = _rList.GetEntryPos( String( _rCurrent ) ); + sal_uInt16 nPos = _rList.GetEntryPos( String( _rCurrent ) ); if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) _rList.SelectEntryPos( nPos ); else @@ -269,7 +269,7 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent, sTable, ::dbtools::eInDataManipulation); - USHORT nPos = m_pImpl->m_aCatalog.GetEntryPos(String(sCatalog)); + sal_uInt16 nPos = m_pImpl->m_aCatalog.GetEntryPos(String(sCatalog)); if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) m_pImpl->m_aCatalog.SelectEntryPos(nPos); @@ -289,7 +289,7 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent, m_pImpl->m_aPB_CANCEL.SetPosPixel(Point(m_pImpl->m_aPB_CANCEL.GetPosPixel().X(),aPos.Y())); m_pImpl->m_aPB_HELP.SetPosPixel(Point(m_pImpl->m_aPB_HELP.GetPosPixel().X(),aPos.Y())); - USHORT nLength = m_pImpl->m_xMetaData.is() ? static_cast<USHORT>(m_pImpl->m_xMetaData->getMaxTableNameLength()) : 0; + sal_uInt16 nLength = m_pImpl->m_xMetaData.is() ? static_cast<sal_uInt16>(m_pImpl->m_xMetaData->getMaxTableNameLength()) : 0; nLength = nLength ? nLength : EDIT_NOLIMIT; m_pImpl->m_aTitle.SetMaxTextLen(nLength); diff --git a/dbaccess/source/ui/dlg/dlgsave.src b/dbaccess/source/ui/dlg/dlgsave.src index 20688a784..6276093df 100644 --- a/dbaccess/source/ui/dlg/dlgsave.src +++ b/dbaccess/source/ui/dlg/dlgsave.src @@ -61,6 +61,7 @@ ModalDialog DLG_SAVE_AS }; ComboBox ET_CATALOG { + HelpID = "dbaccess:ComboBox:DLG_SAVE_AS:ET_CATALOG"; Border = TRUE ; Pos = MAP_APPFONT ( 77 , 25 ) ; Size = MAP_APPFONT ( 89 , 12 ) ; @@ -77,6 +78,7 @@ ModalDialog DLG_SAVE_AS }; ComboBox ET_SCHEMA { + HelpID = "dbaccess:ComboBox:DLG_SAVE_AS:ET_SCHEMA"; Border = TRUE ; Pos = MAP_APPFONT ( 77 , 42 ) ; Size = MAP_APPFONT ( 89 , 12 ) ; @@ -92,6 +94,7 @@ ModalDialog DLG_SAVE_AS }; Edit ET_TITLE { + HelpID = "dbaccess:Edit:DLG_SAVE_AS:ET_TITLE"; Border = TRUE ; Pos = MAP_APPFONT ( 77 , 59 ) ; Size = MAP_APPFONT ( 89 , 12 ) ; diff --git a/dbaccess/source/ui/dlg/dlgsize.src b/dbaccess/source/ui/dlg/dlgsize.src index 875ee79b9..556c53974 100644 --- a/dbaccess/source/ui/dlg/dlgsize.src +++ b/dbaccess/source/ui/dlg/dlgsize.src @@ -24,11 +24,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - //--------------------------------------------------------------------------- - // - // (c) Copyright 1996 - 2000 by Star Division GmbH, Hamburg, Germany - // - //--------------------------------------------------------------------------- #ifndef DBAUI_DLGSIZE_HRC #include "dlgsize.hrc" @@ -56,6 +51,7 @@ ModalDialog DLG_ROWHEIGHT }; MetricField MF_VALUE { + HelpID = "dbaccess:MetricField:DLG_ROWHEIGHT:MF_VALUE"; Border = TRUE ; Pos = MAP_APPFONT ( 36 , 6 ) ; Size = MAP_APPFONT ( 63 , 12 ) ; @@ -69,6 +65,7 @@ ModalDialog DLG_ROWHEIGHT }; CheckBox CB_STANDARD { + HelpID = "dbaccess:CheckBox:DLG_ROWHEIGHT:CB_STANDARD"; Pos = MAP_APPFONT ( 36 , 25 ) ; Size = MAP_APPFONT ( 62 , 12 ) ; TabStop = TRUE ; @@ -111,6 +108,7 @@ ModalDialog DLG_COLWIDTH }; MetricField MF_VALUE { + HelpID = "dbaccess:MetricField:DLG_COLWIDTH:MF_VALUE"; Border = TRUE ; Pos = MAP_APPFONT ( 36 , 6 ) ; Size = MAP_APPFONT ( 63 , 12 ) ; @@ -124,6 +122,7 @@ ModalDialog DLG_COLWIDTH }; CheckBox CB_STANDARD { + HelpID = "dbaccess:CheckBox:DLG_COLWIDTH:CB_STANDARD"; Pos = MAP_APPFONT ( 36 , 25 ) ; Size = MAP_APPFONT ( 62 , 12 ) ; TabStop = TRUE ; diff --git a/dbaccess/source/ui/dlg/dsselect.cxx b/dbaccess/source/ui/dlg/dsselect.cxx index 4992466ee..d8967b058 100644 --- a/dbaccess/source/ui/dlg/dsselect.cxx +++ b/dbaccess/source/ui/dlg/dsselect.cxx @@ -182,7 +182,7 @@ IMPL_LINK( ODatasourceSelectDialog, CreateDBClickHdl, PushButton*, /*pButton*/ ) if ( xPropInfo->hasPropertyByName(PROPERTY_PASSWORD) ) { m_pOutputSet->Put(SfxStringItem(DSID_PASSWORD, ::comphelper::getString(xProp->getPropertyValue(PROPERTY_PASSWORD)))); - m_pOutputSet->Put(SfxBoolItem(DSID_PASSWORDREQUIRED, TRUE)); + m_pOutputSet->Put(SfxBoolItem(DSID_PASSWORDREQUIRED, sal_True)); } if ( xPropInfo->hasPropertyByName(PROPERTY_CACHESIZE) ) m_pOutputSet->Put(SfxInt32Item(DSID_CONN_CACHESIZE, ::comphelper::getINT32(xProp->getPropertyValue(PROPERTY_CACHESIZE)))); @@ -197,11 +197,11 @@ IMPL_LINK( ODatasourceSelectDialog, CreateDBClickHdl, PushButton*, /*pButton*/ ) } // ----------------------------------------------------------------------- -BOOL ODatasourceSelectDialog::Close() +sal_Bool ODatasourceSelectDialog::Close() { #ifdef HAVE_ODBC_ADMINISTRATION if ( m_pODBCManagement.get() && m_pODBCManagement->isRunning() ) - return FALSE; + return sal_False; #endif return ModalDialog::Close(); diff --git a/dbaccess/source/ui/dlg/dsselect.hxx b/dbaccess/source/ui/dlg/dsselect.hxx index 2ab0f86db..face8a6c8 100644 --- a/dbaccess/source/ui/dlg/dsselect.hxx +++ b/dbaccess/source/ui/dlg/dsselect.hxx @@ -76,7 +76,7 @@ public: inline String GetSelected() const { return m_aDatasource.GetSelectEntry();} void Select( const String& _rEntry ) { m_aDatasource.SelectEntry(_rEntry); } - virtual BOOL Close(); + virtual sal_Bool Close(); protected: DECL_LINK( ListDblClickHdl, ListBox * ); diff --git a/dbaccess/source/ui/dlg/dsselect.src b/dbaccess/source/ui/dlg/dsselect.src index 8c59a26d1..d6a885555 100644 --- a/dbaccess/source/ui/dlg/dsselect.src +++ b/dbaccess/source/ui/dlg/dsselect.src @@ -35,6 +35,7 @@ ModalDialog DLG_DATASOURCE_SELECTION { + HelpID = "dbaccess:ModalDialog:DLG_DATASOURCE_SELECTION"; OutputSize = TRUE ; Moveable = TRUE ; Closeable = TRUE ; @@ -50,6 +51,7 @@ ModalDialog DLG_DATASOURCE_SELECTION }; ListBox LB_DATASOURCE { + HelpID = "dbaccess:ListBox:DLG_DATASOURCE_SELECTION:LB_DATASOURCE"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 19 ) ; Size = MAP_APPFONT ( 154 , 94 ) ; @@ -79,6 +81,7 @@ ModalDialog DLG_DATASOURCE_SELECTION }; PushButton PB_MANAGE { + HelpID = "dbaccess:PushButton:DLG_DATASOURCE_SELECTION:PB_MANAGE"; Pos = MAP_APPFONT ( 166 , 99 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -88,6 +91,7 @@ ModalDialog DLG_DATASOURCE_SELECTION }; PushButton PB_CREATE { + HelpID = "dbaccess:PushButton:DLG_DATASOURCE_SELECTION:PB_CREATE"; Pos = MAP_APPFONT ( 166 , 99 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index d03a568b4..626019e9d 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -505,7 +505,7 @@ namespace dbaui } //------------------------------------------------------------------------- - BOOL OGeneralPage::FillItemSet(SfxItemSet& _rCoreAttrs) + sal_Bool OGeneralPage::FillItemSet(SfxItemSet& _rCoreAttrs) { sal_Bool bChangedSomething = sal_False; @@ -530,7 +530,7 @@ namespace dbaui if ( bCommitTypeSelection ) { - USHORT nEntry = m_pDatasourceType->GetSelectEntryPos(); + sal_uInt16 nEntry = m_pDatasourceType->GetSelectEntryPos(); ::rtl::OUString sURLPrefix = m_aURLPrefixes[nEntry]; if (m_DBWizardMode) { diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index d67aabc96..21b1f6837 100644 --- a/dbaccess/source/ui/dlg/generalpage.hxx +++ b/dbaccess/source/ui/dlg/generalpage.hxx @@ -132,7 +132,7 @@ namespace dbaui protected: // SfxTabPage overridables - virtual BOOL FillItemSet(SfxItemSet& _rCoreAttrs); + virtual sal_Bool FillItemSet(SfxItemSet& _rCoreAttrs); virtual void Reset(const SfxItemSet& _rCoreAttrs); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); diff --git a/dbaccess/source/ui/dlg/indexdialog.src b/dbaccess/source/ui/dlg/indexdialog.src index 0d8aa0884..d77706f5e 100644 --- a/dbaccess/source/ui/dlg/indexdialog.src +++ b/dbaccess/source/ui/dlg/indexdialog.src @@ -47,6 +47,7 @@ ModalDialog DLG_INDEXDESIGN { + HelpID = "dbaccess:ModalDialog:DLG_INDEXDESIGN"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( DIALOG_SIZE_X , DIALOG_SIZE_Y ) ; @@ -131,6 +132,7 @@ ModalDialog DLG_INDEXDESIGN }; CheckBox CB_UNIQUE { + HelpID = "dbaccess:CheckBox:DLG_INDEXDESIGN:CB_UNIQUE"; Pos = MAP_APPFONT ( LIST_WIDTH + 16, 34 ) ; Size = MAP_APPFONT ( DIALOG_SIZE_X - LIST_WIDTH - 22, 8 ) ; SVLook = TRUE; @@ -153,6 +155,7 @@ ModalDialog DLG_INDEXDESIGN }; PushButton PB_CLOSE { + HelpID = "dbaccess:PushButton:DLG_INDEXDESIGN:PB_CLOSE"; Pos = MAP_APPFONT ( DIALOG_SIZE_X - BUTTON_SIZE_X - 6 - BUTTON_SIZE_X - 6, DIALOG_SIZE_Y - BUTTON_SIZE_Y - 6 ) ; Size = MAP_APPFONT ( BUTTON_SIZE_X, BUTTON_SIZE_Y ); SVLook = TRUE; diff --git a/dbaccess/source/ui/dlg/makefile.mk b/dbaccess/source/ui/dlg/makefile.mk index 0a7ddefb1..8fa615d28 100644 --- a/dbaccess/source/ui/dlg/makefile.mk +++ b/dbaccess/source/ui/dlg/makefile.mk @@ -137,7 +137,6 @@ SLOFILES+= $(SLO)$/adodatalinks.obj .ENDIF # --- Targets ---------------------------------- - .INCLUDE : target.mk $(SLO)$/ConnectionHelper.obj : $(LOCALIZE_ME_DEST) diff --git a/dbaccess/source/ui/dlg/odbcconfig.cxx b/dbaccess/source/ui/dlg/odbcconfig.cxx index b4115cac3..e6a86588b 100644 --- a/dbaccess/source/ui/dlg/odbcconfig.cxx +++ b/dbaccess/source/ui/dlg/odbcconfig.cxx @@ -55,7 +55,7 @@ #ifdef HAVE_ODBC_SUPPORT -#if defined(WIN) || defined(OS2) +#if defined(OS2) #define ODBC_LIBRARY "ODBC.DLL" #define ODBC_UI_LIBRARY "ODBCINST.DLL" #endif @@ -77,7 +77,7 @@ // just to go with calling convention of windows // so don't touch this -#if defined(WIN) || defined(WNT) +#if defined(WNT) #define SQL_API __stdcall // At least under some circumstances, the below #include <odbc/sqlext.h> re- // defines SQL_API to an empty string, leading to a compiler warning on MSC; to @@ -87,7 +87,7 @@ #pragma warning(push) #pragma warning(disable: 4005) #endif -#endif // defined(WIN) || defined(WNT) +#endif // defined(WNT) #if defined(OS2) #define ALLREADY_HAVE_OS2_TYPES @@ -100,13 +100,13 @@ #include <odbc/sqlext.h> #endif -#if defined(WIN) || defined(WNT) +#if defined(WNT) #if defined _MSC_VER #pragma warning(pop) #endif #undef SQL_API #define SQL_API __stdcall -#endif // defined(WIN) || defined(WNT) +#endif // defined(WNT) // from here on you can do what you want to #if defined(OS2) diff --git a/dbaccess/source/ui/dlg/odbcconfig.hxx b/dbaccess/source/ui/dlg/odbcconfig.hxx index e66e0bf21..624338ea1 100644 --- a/dbaccess/source/ui/dlg/odbcconfig.hxx +++ b/dbaccess/source/ui/dlg/odbcconfig.hxx @@ -31,11 +31,11 @@ #include "commontypes.hxx" -#if defined(WIN) || defined(WNT) || defined (UNX) || defined (OS2) +#if defined(WNT) || defined (UNX) || defined (OS2) #define HAVE_ODBC_SUPPORT #endif -#if ( defined(WIN) || defined(WNT) || defined (OS2) ) && defined(HAVE_ODBC_SUPPORT) +#if ( defined(WNT) || defined (OS2) ) && defined(HAVE_ODBC_SUPPORT) #define HAVE_ODBC_ADMINISTRATION #endif diff --git a/dbaccess/source/ui/dlg/paramdialog.src b/dbaccess/source/ui/dlg/paramdialog.src index 10affc622..5840ae57b 100644 --- a/dbaccess/source/ui/dlg/paramdialog.src +++ b/dbaccess/source/ui/dlg/paramdialog.src @@ -37,6 +37,7 @@ ModalDialog DLG_PARAMETERS { + HelpID = "dbaccess:ModalDialog:DLG_PARAMETERS"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 6 + LIST_WIDTH + 3 + 6 + BUTTON_WIDTH + 6, 98 ) ; @@ -51,6 +52,7 @@ ModalDialog DLG_PARAMETERS }; ListBox LB_ALLPARAMS { + HelpID = "dbaccess:ListBox:DLG_PARAMETERS:LB_ALLPARAMS"; Pos = MAP_APPFONT ( 7 , 12 ) ; Size = MAP_APPFONT ( LIST_WIDTH , LIST_HEIGHT ) ; Border = TRUE; @@ -64,6 +66,7 @@ ModalDialog DLG_PARAMETERS }; Edit ET_PARAM { + HelpID = "dbaccess:Edit:DLG_PARAMETERS:ET_PARAM"; Border = TRUE ; Pos = MAP_APPFONT ( 7 , 12 + LIST_HEIGHT + 4 + 8 + 3 ) ; Size = MAP_APPFONT ( LIST_WIDTH , 12 ) ; @@ -71,6 +74,7 @@ ModalDialog DLG_PARAMETERS }; PushButton BT_TRAVELNEXT { + HelpID = "dbaccess:PushButton:DLG_PARAMETERS:BT_TRAVELNEXT"; Pos = MAP_APPFONT ( 4 + 3 + LIST_WIDTH + 3 + 6 , 12 + LIST_HEIGHT + 4 + 8 + 3 + ( 12 - BUTTON_HEIGHT ) / 2) ; Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; TabStop = TRUE ; diff --git a/dbaccess/source/ui/dlg/queryfilter.src b/dbaccess/source/ui/dlg/queryfilter.src index f93fe24b8..6d273b5c5 100644 --- a/dbaccess/source/ui/dlg/queryfilter.src +++ b/dbaccess/source/ui/dlg/queryfilter.src @@ -44,6 +44,7 @@ ModalDialog DLG_FILTERCRIT HelpId = HID_DLG_FILTERCRIT ; ListBox LB_WHEREFIELD1 { + HelpID = "dbaccess:ListBox:DLG_FILTERCRIT:LB_WHEREFIELD1"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 25 ) ; Size = MAP_APPFONT ( 60 , 90 ) ; @@ -52,6 +53,7 @@ ModalDialog DLG_FILTERCRIT }; ListBox LB_WHERECOMP1 { + HelpID = "dbaccess:ListBox:DLG_FILTERCRIT:LB_WHERECOMP1"; Border = TRUE ; Pos = MAP_APPFONT ( 124 , 25 ) ; Size = MAP_APPFONT ( 49 , 72 ) ; @@ -62,6 +64,7 @@ ModalDialog DLG_FILTERCRIT }; Edit ET_WHEREVALUE1 { + HelpID = "dbaccess:Edit:DLG_FILTERCRIT:ET_WHEREVALUE1"; Border = TRUE ; Pos = MAP_APPFONT ( 177 , 25 ) ; Size = MAP_APPFONT ( 60 , 12 ) ; @@ -69,6 +72,7 @@ ModalDialog DLG_FILTERCRIT }; ListBox LB_WHERECOND2 { + HelpID = "dbaccess:ListBox:DLG_FILTERCRIT:LB_WHERECOND2"; Border = TRUE ; Pos = MAP_APPFONT ( 15 , 41 ) ; Size = MAP_APPFONT ( 41 , 36 ) ; @@ -83,6 +87,7 @@ ModalDialog DLG_FILTERCRIT }; ListBox LB_WHEREFIELD2 { + HelpID = "dbaccess:ListBox:DLG_FILTERCRIT:LB_WHEREFIELD2"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 41 ) ; Size = MAP_APPFONT ( 60 , 90 ) ; @@ -91,6 +96,7 @@ ModalDialog DLG_FILTERCRIT }; ListBox LB_WHERECOMP2 { + HelpID = "dbaccess:ListBox:DLG_FILTERCRIT:LB_WHERECOMP2"; Border = TRUE ; Pos = MAP_APPFONT ( 124 , 41 ) ; Size = MAP_APPFONT ( 49 , 72 ) ; @@ -101,6 +107,7 @@ ModalDialog DLG_FILTERCRIT }; Edit ET_WHEREVALUE2 { + HelpID = "dbaccess:Edit:DLG_FILTERCRIT:ET_WHEREVALUE2"; Border = TRUE ; Pos = MAP_APPFONT ( 177 , 41 ) ; Size = MAP_APPFONT ( 60 , 12 ) ; @@ -108,6 +115,7 @@ ModalDialog DLG_FILTERCRIT }; ListBox LB_WHERECOND3 { + HelpID = "dbaccess:ListBox:DLG_FILTERCRIT:LB_WHERECOND3"; Border = TRUE ; Pos = MAP_APPFONT ( 15 , 57 ) ; Size = MAP_APPFONT ( 41 , 36 ) ; @@ -122,6 +130,7 @@ ModalDialog DLG_FILTERCRIT }; ListBox LB_WHEREFIELD3 { + HelpID = "dbaccess:ListBox:DLG_FILTERCRIT:LB_WHEREFIELD3"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 57 ) ; Size = MAP_APPFONT ( 60 , 90 ) ; @@ -130,6 +139,7 @@ ModalDialog DLG_FILTERCRIT }; ListBox LB_WHERECOMP3 { + HelpID = "dbaccess:ListBox:DLG_FILTERCRIT:LB_WHERECOMP3"; Border = TRUE ; Pos = MAP_APPFONT ( 124 , 57 ) ; Size = MAP_APPFONT ( 49 , 72 ) ; @@ -140,6 +150,7 @@ ModalDialog DLG_FILTERCRIT }; Edit ET_WHEREVALUE3 { + HelpID = "dbaccess:Edit:DLG_FILTERCRIT:ET_WHEREVALUE3"; Border = TRUE ; Pos = MAP_APPFONT ( 177 , 57 ) ; Size = MAP_APPFONT ( 60 , 12 ) ; diff --git a/dbaccess/source/ui/dlg/queryorder.cxx b/dbaccess/source/ui/dlg/queryorder.cxx index da51f0d3e..4cbc85f5a 100644 --- a/dbaccess/source/ui/dlg/queryorder.cxx +++ b/dbaccess/source/ui/dlg/queryorder.cxx @@ -89,7 +89,7 @@ DlgOrderCrit::DlgOrderCrit( Window * pParent, AllSettings aSettings( GetSettings() ); StyleSettings aStyle( aSettings.GetStyleSettings() ); - aStyle.SetAutoMnemonic( FALSE ); + aStyle.SetAutoMnemonic( sal_False ); aSettings.SetStyleSettings( aStyle ); SetSettings( aSettings ); diff --git a/dbaccess/source/ui/dlg/queryorder.src b/dbaccess/source/ui/dlg/queryorder.src index 318df3045..7c349dda0 100644 --- a/dbaccess/source/ui/dlg/queryorder.src +++ b/dbaccess/source/ui/dlg/queryorder.src @@ -42,6 +42,7 @@ ModalDialog DLG_ORDERCRIT Closeable = TRUE ; ListBox LB_ORDERFIELD1 { + HelpID = "dbaccess:ListBox:DLG_ORDERCRIT:LB_ORDERFIELD1"; Border = TRUE ; Pos = MAP_APPFONT ( 59 , 25 ) ; Size = MAP_APPFONT ( 60 , 72 ) ; @@ -51,6 +52,7 @@ ModalDialog DLG_ORDERCRIT }; ListBox LB_ORDERVALUE1 { + HelpID = "dbaccess:ListBox:DLG_ORDERCRIT:LB_ORDERVALUE1"; Border = TRUE ; Pos = MAP_APPFONT ( 123 , 25 ) ; Size = MAP_APPFONT ( 60 , 36 ) ; @@ -65,6 +67,7 @@ ModalDialog DLG_ORDERCRIT }; ListBox LB_ORDERFIELD2 { + HelpID = "dbaccess:ListBox:DLG_ORDERCRIT:LB_ORDERFIELD2"; Border = TRUE ; Pos = MAP_APPFONT ( 59 , 41 ) ; Size = MAP_APPFONT ( 60 , 72 ) ; @@ -74,6 +77,7 @@ ModalDialog DLG_ORDERCRIT }; ListBox LB_ORDERVALUE2 { + HelpID = "dbaccess:ListBox:DLG_ORDERCRIT:LB_ORDERVALUE2"; Border = TRUE ; Pos = MAP_APPFONT ( 123 , 41 ) ; Size = MAP_APPFONT ( 60 , 36 ) ; @@ -88,6 +92,7 @@ ModalDialog DLG_ORDERCRIT }; ListBox LB_ORDERFIELD3 { + HelpID = "dbaccess:ListBox:DLG_ORDERCRIT:LB_ORDERFIELD3"; Border = TRUE ; Pos = MAP_APPFONT ( 59 , 57 ) ; Size = MAP_APPFONT ( 60 , 72 ) ; @@ -97,6 +102,7 @@ ModalDialog DLG_ORDERCRIT }; ListBox LB_ORDERVALUE3 { + HelpID = "dbaccess:ListBox:DLG_ORDERCRIT:LB_ORDERVALUE3"; Border = TRUE ; Pos = MAP_APPFONT ( 123 , 57 ) ; Size = MAP_APPFONT ( 60 , 36 ) ; diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index 24eb67be0..4658d0e84 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -47,6 +47,8 @@ #include "UITools.hxx" #include "moduledbu.hxx" +#include <tools/urlobj.hxx> + #define BUTTONID_MORE BUTTONID_RETRY + 1 #define DIALOG_WIDTH 220 @@ -89,12 +91,12 @@ namespace class ImageProvider : public IImageProvider { private: - USHORT m_defaultImageID; + sal_uInt16 m_defaultImageID; mutable Image m_defaultImage; public: - ImageProvider( USHORT _defaultImageID ) + ImageProvider( sal_uInt16 _defaultImageID ) :m_defaultImageID( _defaultImageID ) { } @@ -113,7 +115,7 @@ namespace private: String m_label; public: - LabelProvider( USHORT _labelResourceID ) + LabelProvider( sal_uInt16 _labelResourceID ) :m_label( ModuleRes( _labelResourceID ) ) { } @@ -143,7 +145,7 @@ namespace ::boost::shared_ptr< IImageProvider > getImageProvider( SQLExceptionInfo::TYPE _eType ) const { ::boost::shared_ptr< IImageProvider >* ppProvider( &m_pErrorImage ); - USHORT nNormalImageID( BMP_EXCEPTION_ERROR ); + sal_uInt16 nNormalImageID( BMP_EXCEPTION_ERROR ); switch ( _eType ) { @@ -169,7 +171,7 @@ namespace ::boost::shared_ptr< ILabelProvider > getLabelProvider( SQLExceptionInfo::TYPE _eType, bool _bSubLabel ) const { ::boost::shared_ptr< ILabelProvider >* ppProvider( &m_pErrorLabel ); - USHORT nLabelID( STR_EXCEPTION_ERROR ); + sal_uInt16 nLabelID( STR_EXCEPTION_ERROR ); switch ( _eType ) { @@ -356,7 +358,7 @@ OExceptionChainDialog::OExceptionChainDialog( Window* pParent, const ExceptionDi m_aExceptionList.SetSelectionMode(SINGLE_SELECTION); m_aExceptionList.SetDragDropMode(0); m_aExceptionList.EnableInplaceEditing(sal_False); - m_aExceptionList.SetWindowBits(WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL); + m_aExceptionList.SetStyle(m_aExceptionList.GetStyle() | WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL); m_aExceptionList.SetSelectHdl(LINK(this, OExceptionChainDialog, OnExceptionSelected)); m_aExceptionList.SetNodeDefaultImages( ); @@ -470,7 +472,7 @@ namespace void lcl_addButton( ButtonDialog& _rDialog, StandardButtonType _eType, bool _bDefault ) { - USHORT nButtonID = 0; + sal_uInt16 nButtonID = 0; switch ( _eType ) { case BUTTON_YES: nButtonID = BUTTONID_YES; break; @@ -645,11 +647,14 @@ void OSQLMessageBox::impl_createStandardButtons( WinBits _nStyle ) { lcl_addButton( *this, BUTTON_HELP, false ); - SmartId aHelpId( m_sHelpURL ); - if ( m_sHelpURL.indexOfAsciiL( "HID:", 4 ) == 0 ) - aHelpId = SmartId( m_sHelpURL.copy( 4 ).toInt32() ); + rtl::OUString aTmp; + INetURLObject aHID( m_sHelpURL ); + if ( aHID.GetProtocol() == INET_PROT_HID ) + aTmp = aHID.GetURLPath(); + else + aTmp = m_sHelpURL; - SetSmartHelpId( aHelpId ); + SetHelpId( rtl::OUStringToOString( aTmp, RTL_TEXTENCODING_UTF8 ) ); } } diff --git a/dbaccess/source/ui/dlg/sqlmessage.src b/dbaccess/source/ui/dlg/sqlmessage.src index 979fdd370..94b2e394d 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.src +++ b/dbaccess/source/ui/dlg/sqlmessage.src @@ -56,6 +56,7 @@ Image BMP_EXCEPTION_INFO ModalDialog DLG_SQLEXCEPTIONCHAIN { + HelpID = "dbaccess:ModalDialog:DLG_SQLEXCEPTIONCHAIN"; Moveable = TRUE ; Closeable = TRUE ; OutputSize = TRUE ; diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index f1f1dffa1..9c52d9391 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -102,7 +102,7 @@ DBG_NAME(OTableSubscriptionPage) m_aTablesList.SetSelectionMode( MULTIPLE_SELECTION ); m_aTablesList.SetDragDropMode( 0 ); m_aTablesList.EnableInplaceEditing( sal_False ); - m_aTablesList.SetWindowBits(WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT); + m_aTablesList.SetStyle(m_aTablesList.GetStyle() | WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT); m_aTablesList.Clear(); @@ -583,7 +583,7 @@ DBG_NAME(OTableSubscriptionPage) } //------------------------------------------------------------------------ - BOOL OTableSubscriptionPage::FillItemSet( SfxItemSet& _rCoreAttrs ) + sal_Bool OTableSubscriptionPage::FillItemSet( SfxItemSet& _rCoreAttrs ) { sal_Bool bValid, bReadonly; getFlags(_rCoreAttrs, bValid, bReadonly); diff --git a/dbaccess/source/ui/dlg/tablespage.hxx b/dbaccess/source/ui/dlg/tablespage.hxx index 97d343d6b..3861822aa 100644 --- a/dbaccess/source/ui/dlg/tablespage.hxx +++ b/dbaccess/source/ui/dlg/tablespage.hxx @@ -68,7 +68,7 @@ namespace dbaui OTableSubscriptionDialog* m_pTablesDlg; public: - virtual BOOL FillItemSet(SfxItemSet& _rCoreAttrs); + virtual sal_Bool FillItemSet(SfxItemSet& _rCoreAttrs); virtual int DeactivatePage(SfxItemSet* _pSet); using OGenericAdministrationPage::DeactivatePage; @@ -105,7 +105,7 @@ namespace dbaui ::com::sun::star::uno::Sequence< ::rtl::OUString > collectDetailedSelection() const; /// (un)check all entries - void CheckAll( BOOL bCheck = sal_True ); + void CheckAll( sal_Bool bCheck = sal_True ); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); diff --git a/dbaccess/source/ui/dlg/textconnectionsettings.src b/dbaccess/source/ui/dlg/textconnectionsettings.src index cca76e7f6..b34a05607 100644 --- a/dbaccess/source/ui/dlg/textconnectionsettings.src +++ b/dbaccess/source/ui/dlg/textconnectionsettings.src @@ -34,6 +34,7 @@ ModalDialog DLG_TEXT_CONNECTION_SETTINGS { + HelpID = "dbaccess:ModalDialog:DLG_TEXT_CONNECTION_SETTINGS"; Size = MAP_APPFONT( DIALOG_WIDTH, DIALOG_HEIGHT ); OutputSize = TRUE ; diff --git a/dbaccess/source/ui/inc/ColumnControlWindow.hxx b/dbaccess/source/ui/inc/ColumnControlWindow.hxx index d0a7357d6..5c6d268a4 100644 --- a/dbaccess/source/ui/inc/ColumnControlWindow.hxx +++ b/dbaccess/source/ui/inc/ColumnControlWindow.hxx @@ -63,7 +63,7 @@ namespace dbaui virtual TOTypeInfoSP getTypeInfo(sal_Int32 _nPos); virtual sal_Bool isAutoIncrementValueEnabled() const; virtual ::rtl::OUString getAutoIncrementValue() const; - virtual void CellModified(long nRow, USHORT nColId ); + virtual void CellModified(long nRow, sal_uInt16 nColId ); public: OColumnControlWindow(Window* pParent diff --git a/dbaccess/source/ui/inc/ConnectionLine.hxx b/dbaccess/source/ui/inc/ConnectionLine.hxx index 1fdbc04b1..4d75f3f86 100644 --- a/dbaccess/source/ui/inc/ConnectionLine.hxx +++ b/dbaccess/source/ui/inc/ConnectionLine.hxx @@ -67,13 +67,13 @@ namespace dbaui virtual OConnectionLine& operator=( const OConnectionLine& rLine ); Rectangle GetBoundingRect(); - BOOL RecalcLine(); + sal_Bool RecalcLine(); void Draw( OutputDevice* pOutDev ); bool CheckHit( const Point& rMousePos ) const; String GetSourceFieldName() const { return m_pData->GetSourceFieldName(); } String GetDestFieldName() const { return m_pData->GetDestFieldName(); } - BOOL IsValid() const; + sal_Bool IsValid() const; Rectangle GetSourceTextPos() const; Rectangle GetDestTextPos() const; diff --git a/dbaccess/source/ui/inc/ExtensionNotPresent.hxx b/dbaccess/source/ui/inc/ExtensionNotPresent.hxx deleted file mode 100644 index c4915e9f0..000000000 --- a/dbaccess/source/ui/inc/ExtensionNotPresent.hxx +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef DBU_EXTENSIONNOTPRESENT_HXX -#define DBU_EXTENSIONNOTPRESENT_HXX - -#include <vcl/dialog.hxx> -#include <vcl/fixed.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/field.hxx> -#include <vcl/button.hxx> -#include <com/sun/star/report/XReportDefinition.hpp> -#include <com/sun/star/lang/Locale.hpp> - -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/system/XSystemShellExecute.hpp> - -namespace dbaui -{ - -/************************************************************************* -|* -|* Groups and Sorting dialog -|* -\************************************************************************/ -class OExtensionNotPresentDialog : public ModalDialog -{ - FixedImage m_aFI_WARNING; - FixedText m_aFT_TEXT; - - PushButton m_aPB_DOWNLOAD; - CancelButton m_aPB_CANCEL; - - ::com::sun::star::lang::Locale m_nLocale; - com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xMultiServiceFactory; - - DECL_LINK(Download_Click,PushButton*); - - // not CopyCTOR, no self assignment - OExtensionNotPresentDialog(const OExtensionNotPresentDialog&); - void operator =(const OExtensionNotPresentDialog&); - - // get some values out of the configuration - rtl::OUString getFromConfigurationExtension(rtl::OUString const& _sPropertyName) const; - rtl::OUString getFromConfigurationExtension(rtl::OString const& _sPropertyName) const; // syntactic sugar - - ::com::sun::star::uno::Reference< ::com::sun::star::system::XSystemShellExecute > getShellExecuter() const; - -public: - OExtensionNotPresentDialog( Window* pParent, com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > ); - virtual ~OExtensionNotPresentDialog(); - virtual short Execute(); - - inline String getText() const { return m_aFT_TEXT.GetText(); } -}; -// ============================================================================= -} // namespace rptui -// ============================================================================= -#endif // DBU_EXTENSIONNOTPRESENT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/FieldControls.hxx b/dbaccess/source/ui/inc/FieldControls.hxx index 3a9133dc1..51fb6ca33 100644 --- a/dbaccess/source/ui/inc/FieldControls.hxx +++ b/dbaccess/source/ui/inc/FieldControls.hxx @@ -39,7 +39,7 @@ namespace dbaui { namespace { - void lcl_setSpecialReadOnly( BOOL _bReadOnly, Window* _pWin ) + void lcl_setSpecialReadOnly( sal_Bool _bReadOnly, Window* _pWin ) { StyleSettings aSystemStyle = Application::GetSettings().GetStyleSettings(); const Color& rNewColor = _bReadOnly ? aSystemStyle.GetDialogColor() : aSystemStyle.GetFieldColor(); @@ -55,14 +55,14 @@ namespace dbaui short m_nPos; String m_strHelpText; public: - inline OPropColumnEditCtrl(Window* pParent, ::rtl::OUString& _rAllowedChars, USHORT nHelpId, short nPosition = -1, WinBits nWinStyle = 0); + inline OPropColumnEditCtrl(Window* pParent, ::rtl::OUString& _rAllowedChars, sal_uInt16 nHelpId, short nPosition = -1, WinBits nWinStyle = 0); - inline BOOL IsModified() const { return GetText() != GetSavedValue(); } + inline sal_Bool IsModified() const { return GetText() != GetSavedValue(); } short GetPos() const { return m_nPos; } String GetHelp() const { return m_strHelpText; } - virtual void SetSpecialReadOnly(BOOL _bReadOnly) + virtual void SetSpecialReadOnly(sal_Bool _bReadOnly) { SetReadOnly(_bReadOnly); lcl_setSpecialReadOnly(_bReadOnly,this); @@ -70,7 +70,7 @@ namespace dbaui }; inline OPropColumnEditCtrl::OPropColumnEditCtrl(Window* pParent, ::rtl::OUString& _rAllowedChars, - USHORT nHelpId, + sal_uInt16 nHelpId, short nPosition, WinBits nWinStyle) :OSQLNameEdit(pParent, _rAllowedChars,nWinStyle) @@ -86,28 +86,28 @@ namespace dbaui String m_strHelpText; public: - inline OPropEditCtrl(Window* pParent, USHORT nHelpId, short nPosition = -1, WinBits nWinStyle = 0); - inline OPropEditCtrl(Window* pParent, USHORT nHelpId, const ResId& _rRes,short nPosition = -1); + inline OPropEditCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition = -1, WinBits nWinStyle = 0); + inline OPropEditCtrl(Window* pParent, sal_uInt16 nHelpId, const ResId& _rRes,short nPosition = -1); - inline BOOL IsModified() const { return GetText() != GetSavedValue(); } + inline sal_Bool IsModified() const { return GetText() != GetSavedValue(); } short GetPos() const { return m_nPos; } String GetHelp() const { return m_strHelpText; } - virtual void SetSpecialReadOnly(BOOL _bReadOnly) + virtual void SetSpecialReadOnly(sal_Bool _bReadOnly) { SetReadOnly(_bReadOnly); lcl_setSpecialReadOnly(_bReadOnly,this); } }; - inline OPropEditCtrl::OPropEditCtrl(Window* pParent, USHORT nHelpId, short nPosition, WinBits nWinStyle) + inline OPropEditCtrl::OPropEditCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition, WinBits nWinStyle) :Edit(pParent, nWinStyle) ,m_nPos(nPosition) { m_strHelpText =String(ModuleRes(nHelpId)); } - inline OPropEditCtrl::OPropEditCtrl(Window* pParent, USHORT nHelpId, const ResId& _rRes,short nPosition) + inline OPropEditCtrl::OPropEditCtrl(Window* pParent, sal_uInt16 nHelpId, const ResId& _rRes,short nPosition) :Edit(pParent, _rRes) ,m_nPos(nPosition) { @@ -121,28 +121,28 @@ namespace dbaui String m_strHelpText; public: - inline OPropNumericEditCtrl(Window* pParent, USHORT nHelpId, short nPosition = -1, WinBits nWinStyle = 0); - inline OPropNumericEditCtrl(Window* pParent, USHORT nHelpId, const ResId& _rRes,short nPosition = -1); + inline OPropNumericEditCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition = -1, WinBits nWinStyle = 0); + inline OPropNumericEditCtrl(Window* pParent, sal_uInt16 nHelpId, const ResId& _rRes,short nPosition = -1); - inline BOOL IsModified() const { return GetText() != GetSavedValue(); } + inline sal_Bool IsModified() const { return GetText() != GetSavedValue(); } short GetPos() const { return m_nPos; } String GetHelp() const { return m_strHelpText; } - virtual void SetSpecialReadOnly(BOOL _bReadOnly) + virtual void SetSpecialReadOnly(sal_Bool _bReadOnly) { SetReadOnly(_bReadOnly); lcl_setSpecialReadOnly(_bReadOnly,this); } }; - inline OPropNumericEditCtrl::OPropNumericEditCtrl(Window* pParent, USHORT nHelpId, short nPosition, WinBits nWinStyle) + inline OPropNumericEditCtrl::OPropNumericEditCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition, WinBits nWinStyle) :NumericField(pParent, nWinStyle) ,m_nPos(nPosition) { m_strHelpText =String(ModuleRes(nHelpId)); } - inline OPropNumericEditCtrl::OPropNumericEditCtrl(Window* pParent, USHORT nHelpId, const ResId& _rRes,short nPosition) + inline OPropNumericEditCtrl::OPropNumericEditCtrl(Window* pParent, sal_uInt16 nHelpId, const ResId& _rRes,short nPosition) :NumericField(pParent, _rRes) ,m_nPos(nPosition) { @@ -156,28 +156,28 @@ namespace dbaui String m_strHelpText; public: - inline OPropListBoxCtrl(Window* pParent, USHORT nHelpId, short nPosition = -1, WinBits nWinStyle = 0); - inline OPropListBoxCtrl(Window* pParent, USHORT nHelpId, const ResId& _rRes,short nPosition = -1); + inline OPropListBoxCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition = -1, WinBits nWinStyle = 0); + inline OPropListBoxCtrl(Window* pParent, sal_uInt16 nHelpId, const ResId& _rRes,short nPosition = -1); - inline BOOL IsModified() const { return GetSelectEntryPos() != GetSavedValue(); } + inline sal_Bool IsModified() const { return GetSelectEntryPos() != GetSavedValue(); } short GetPos() const { return m_nPos; } String GetHelp() const { return m_strHelpText; } - virtual void SetSpecialReadOnly(BOOL _bReadOnly) + virtual void SetSpecialReadOnly(sal_Bool _bReadOnly) { SetReadOnly(_bReadOnly); lcl_setSpecialReadOnly(_bReadOnly,this); } }; - inline OPropListBoxCtrl::OPropListBoxCtrl(Window* pParent, USHORT nHelpId, short nPosition, WinBits nWinStyle) + inline OPropListBoxCtrl::OPropListBoxCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition, WinBits nWinStyle) :ListBox(pParent, nWinStyle) ,m_nPos(nPosition) { m_strHelpText =String(ModuleRes(nHelpId)); } - inline OPropListBoxCtrl::OPropListBoxCtrl(Window* pParent, USHORT nHelpId, const ResId& _rRes,short nPosition) + inline OPropListBoxCtrl::OPropListBoxCtrl(Window* pParent, sal_uInt16 nHelpId, const ResId& _rRes,short nPosition) :ListBox(pParent, _rRes) ,m_nPos(nPosition) { diff --git a/dbaccess/source/ui/inc/FieldDescControl.hxx b/dbaccess/source/ui/inc/FieldDescControl.hxx index d6677b141..7f9547774 100644 --- a/dbaccess/source/ui/inc/FieldDescControl.hxx +++ b/dbaccess/source/ui/inc/FieldDescControl.hxx @@ -115,7 +115,7 @@ namespace dbaui ScrollBar* m_pHorzScroll; TOTypeInfoSP m_pPreviousType; - USHORT nCurChildId; + sal_uInt16 nCurChildId; short m_nPos; XubString aYes; XubString aNo; @@ -124,7 +124,7 @@ namespace dbaui long m_nOldHThumb; sal_Int32 m_nWidth; - ULONG nDelayedGrabFocusEvent; + sal_uLong nDelayedGrabFocusEvent; sal_Bool m_bAdded; bool m_bRightAligned; @@ -143,16 +143,16 @@ namespace dbaui void UpdateFormatSample(OFieldDescription* pFieldDescr); void ArrangeAggregates(); - void SetPosSize( Control** ppControl, long nRow, USHORT nCol ); + void SetPosSize( Control** ppControl, long nRow, sal_uInt16 nCol ); void ScrollAggregate(Control* pText, Control* pInput, Control* pButton, long nDeltaX, long nDeltaY); void ScrollAllAggregates(); sal_Bool isTextFormat(const OFieldDescription* _pFieldDescr,sal_uInt32& _nFormatKey) const; void Contruct(); - OPropNumericEditCtrl* CreateNumericControl(USHORT _nHelpStr,short _nProperty,ULONG _nHelpId); - FixedText* CreateText(USHORT _nTextRes); - void InitializeControl(Control* _pControl,ULONG _nHelpId,bool _bAddChangeHandler); + OPropNumericEditCtrl* CreateNumericControl(sal_uInt16 _nHelpStr,short _nProperty,const rtl::OString& _sHelpId); + FixedText* CreateText(sal_uInt16 _nTextRes); + void InitializeControl(Control* _pControl,const rtl::OString& _sHelpId,bool _bAddChangeHandler); protected: inline void setRightAligned() { m_bRightAligned = true; } @@ -167,15 +167,15 @@ namespace dbaui virtual void ActivateAggregate( EControlType eType ); virtual void DeactivateAggregate( EControlType eType ); - virtual BOOL IsReadOnly() { return FALSE; }; + virtual sal_Bool IsReadOnly() { return sal_False; }; // Sind von den abgeleiteten Klassen zu impl. virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > GetFormatter() const = 0; virtual ::com::sun::star::lang::Locale GetLocale() const = 0; - virtual void CellModified(long nRow, USHORT nColId ) = 0; - virtual void SetModified(BOOL bModified); // base implementation is empty + virtual void CellModified(long nRow, sal_uInt16 nColId ) = 0; + virtual void SetModified(sal_Bool bModified); // base implementation is empty virtual TOTypeInfoSP getTypeInfo(sal_Int32 _nPos) = 0; virtual const OTypeInfoMap* getTypeInfo() const = 0; @@ -199,9 +199,9 @@ namespace dbaui void SaveData( OFieldDescription* pFieldDescr ); // void SaveData( OColumn* pColumn); - void SetControlText( USHORT nControlId, const String& rText ); - String GetControlText( USHORT nControlId ); - void SetReadOnly( BOOL bReadOnly ); + void SetControlText( sal_uInt16 nControlId, const String& rText ); + String GetControlText( sal_uInt16 nControlId ); + void SetReadOnly( sal_Bool bReadOnly ); // Resize aufegrufen void CheckScrollBars(); diff --git a/dbaccess/source/ui/inc/GeneralUndo.hxx b/dbaccess/source/ui/inc/GeneralUndo.hxx index 727ffb091..0785ab08b 100644 --- a/dbaccess/source/ui/inc/GeneralUndo.hxx +++ b/dbaccess/source/ui/inc/GeneralUndo.hxx @@ -46,7 +46,7 @@ namespace dbaui public: TYPEINFO(); - OCommentUndoAction(USHORT nCommentID) { m_strComment = String(ModuleRes(nCommentID)); } + OCommentUndoAction(sal_uInt16 nCommentID) { m_strComment = String(ModuleRes(nCommentID)); } virtual UniString GetComment() const { return m_strComment; } }; diff --git a/dbaccess/source/ui/inc/JoinController.hxx b/dbaccess/source/ui/inc/JoinController.hxx index e5195b23a..d75d7026c 100644 --- a/dbaccess/source/ui/inc/JoinController.hxx +++ b/dbaccess/source/ui/inc/JoinController.hxx @@ -35,9 +35,7 @@ #include "JoinDesignView.hxx" #include "TableConnectionData.hxx" #include "TableWindowData.hxx" -#ifndef _MEMORY_ #include <memory> -#endif #include <boost/shared_ptr.hpp> namespace comphelper diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx index a2fa86925..074e25f20 100644 --- a/dbaccess/source/ui/inc/JoinTableView.hxx +++ b/dbaccess/source/ui/inc/JoinTableView.hxx @@ -103,7 +103,7 @@ namespace dbaui OTableConnection* m_pSelectedConn; - BOOL m_bTrackingInitiallyMoved; + sal_Bool m_bTrackingInitiallyMoved; DECL_LINK(OnDragScrollTimer, void*); @@ -137,7 +137,7 @@ namespace dbaui void NotifyTitleClicked( OTableWindow* pTabWin, const Point rMousePos ); - virtual void AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, BOOL bNewTable = FALSE); + virtual void AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, sal_Bool bNewTable = sal_False); virtual void RemoveTabWin( OTableWindow* pTabWin ); // alle TabWins verstecken (NICHT loeschen, sie werden in eine Undo-Action gepackt) @@ -165,8 +165,8 @@ namespace dbaui */ void addConnection(OTableConnection* _pConnection,sal_Bool _bAddData = sal_True); - BOOL ScrollPane( long nDelta, BOOL bHoriz, BOOL bPaintScrollBars ); - ULONG GetTabWinCount(); + sal_Bool ScrollPane( long nDelta, sal_Bool bHoriz, sal_Bool bPaintScrollBars ); + sal_uLong GetTabWinCount(); Point GetScrollOffset() const { return m_aScrollOffset; } OJoinDesignView* getDesignView() const { return m_pView; } @@ -184,7 +184,7 @@ namespace dbaui const ::std::vector<OTableConnection*>* getTableConnections() const { return &m_vTableConnection; } - BOOL ExistsAConn(const OTableWindow* pFromWin) const; + sal_Bool ExistsAConn(const OTableWindow* pFromWin) const; /** getTableConnections searchs for all connections of a table @param _pFromWin the table for which connections should be found @@ -216,7 +216,7 @@ namespace dbaui virtual void ClearAll(); // wird vom AddTabDlg benutzt, um festzustellen, ob noch Tabellen hinzugefuegt werden duerfen - virtual BOOL IsAddAllowed(); + virtual sal_Bool IsAddAllowed(); virtual long PreNotify(NotifyEvent& rNEvt); // DnD stuff @@ -250,7 +250,7 @@ namespace dbaui <TRUE/> if the area is visible otherwise <FALSE/> */ - BOOL isMovementAllowed(const Point& _rPoint,const Size& _rSize); + sal_Bool isMovementAllowed(const Point& _rPoint,const Size& _rSize); Size getRealOutputSize() const { return m_aOutputSize; } @@ -303,7 +303,7 @@ namespace dbaui private: void InitColors(); - BOOL ScrollWhileDragging(); + sal_Bool ScrollWhileDragging(); /** executePopup opens the context menu to delate a connection @param _aPos the position where the popup menu should appear diff --git a/dbaccess/source/ui/inc/QueryTableView.hxx b/dbaccess/source/ui/inc/QueryTableView.hxx index 590ef4a42..156b232c8 100644 --- a/dbaccess/source/ui/inc/QueryTableView.hxx +++ b/dbaccess/source/ui/inc/QueryTableView.hxx @@ -72,14 +72,14 @@ namespace dbaui // Basisklasse ueberschrieben : Fenster kreieren und loeschen // (eigentlich nicht wirklich LOESCHEN, es geht in die Verantwortung einer UNDO-Action ueber) - virtual void AddTabWin( const ::rtl::OUString& _rTableName, const ::rtl::OUString& _rAliasName, BOOL bNewTable = FALSE ); + virtual void AddTabWin( const ::rtl::OUString& _rTableName, const ::rtl::OUString& _rAliasName, sal_Bool bNewTable = sal_False ); virtual void RemoveTabWin(OTableWindow* pTabWin); // und ein AddTabWin, das einen Alias vorgibt - void AddTabWin(const ::rtl::OUString& strDatabase, const ::rtl::OUString& strTableName, const ::rtl::OUString& strAlias, BOOL bNewTable = FALSE); + void AddTabWin(const ::rtl::OUString& strDatabase, const ::rtl::OUString& strTableName, const ::rtl::OUString& strAlias, sal_Bool bNewTable = sal_False); // TabWin suchen OQueryTableWindow* FindTable(const String& rAliasName); - BOOL FindTableFromField(const String& rFieldName, OTableFieldDescRef& rInfo, USHORT& rCnt); + sal_Bool FindTableFromField(const String& rFieldName, OTableFieldDescRef& rInfo, sal_uInt16& rCnt); // Basisklasse ueberschrieben : Connections kreieren und loeschen virtual void AddConnection(const OJoinExchangeData& jxdSource, const OJoinExchangeData& jxdDest); @@ -96,7 +96,7 @@ namespace dbaui // natuerlich alle Connections an diesen Fenstern und alle Abfrage-Spalten, die auf diesen Tabellen basierten. // TabWin anzeigen oder verstecken (NICHT kreieren oder loeschen) - BOOL ShowTabWin(OQueryTableWindow* pTabWin, OQueryTabWinUndoAct* pUndoAction,sal_Bool _bAppend); + sal_Bool ShowTabWin(OQueryTableWindow* pTabWin, OQueryTabWinUndoAct* pUndoAction,sal_Bool _bAppend); void HideTabWin(OQueryTableWindow* pTabWin, OQueryTabWinUndoAct* pUndoAction); // Sichbarkeit eines TabWins sicherstellen (+ Invalidieren der Connections) @@ -114,15 +114,15 @@ namespace dbaui virtual void ClearAll(); // wird vom AddTabDlg benutzt, um festzustellen, ob noch Tabellen hinzugefuegt werden duerfen - //virtual BOOL IsAddAllowed(); + //virtual sal_Bool IsAddAllowed(); // eine neu Connection bekanntgeben und einfuegen lassen, wenn nicht schon existent - void NotifyTabConnection(const OQueryTableConnection& rNewConn, BOOL _bCreateUndoAction = TRUE); + void NotifyTabConnection(const OQueryTableConnection& rNewConn, sal_Bool _bCreateUndoAction = sal_True); Link SetTabWinsChangeHandler(const Link& lnk) { Link lnkRet = m_lnkTabWinsChangeHandler; m_lnkTabWinsChangeHandler = lnk; return lnkRet; } // der Handler bekommt einen Zeiger auf eine TabWinsChangeNotification-Struktur - BOOL ExistsAVisitedConn(const OQueryTableWindow* pFrom) const; + sal_Bool ExistsAVisitedConn(const OQueryTableWindow* pFrom) const; virtual OTableWindowData* CreateImpl(const ::rtl::OUString& _rComposedName ,const ::rtl::OUString& _sTableName diff --git a/dbaccess/source/ui/inc/RTableConnectionData.hxx b/dbaccess/source/ui/inc/RTableConnectionData.hxx index 19d4f8013..c17d365a5 100644 --- a/dbaccess/source/ui/inc/RTableConnectionData.hxx +++ b/dbaccess/source/ui/inc/RTableConnectionData.hxx @@ -35,10 +35,10 @@ namespace dbaui { - const UINT16 CARDINAL_UNDEFINED = 0x0000; - const UINT16 CARDINAL_ONE_MANY = 0x0001; - const UINT16 CARDINAL_MANY_ONE = 0x0002; - const UINT16 CARDINAL_ONE_ONE = 0x0004; + const sal_uInt16 CARDINAL_UNDEFINED = 0x0000; + const sal_uInt16 CARDINAL_ONE_MANY = 0x0001; + const sal_uInt16 CARDINAL_MANY_ONE = 0x0002; + const sal_uInt16 CARDINAL_ONE_ONE = 0x0004; class OConnectionLineData; //================================================================== @@ -54,9 +54,9 @@ namespace dbaui sal_Int32 m_nDeleteRules; sal_Int32 m_nCardinality; - BOOL checkPrimaryKey(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& i_xTable,EConnectionSide _eEConnectionSide) const; - BOOL IsSourcePrimKey() const { return checkPrimaryKey(getReferencingTable()->getTable(),JTCS_FROM); } - BOOL IsDestPrimKey() const { return checkPrimaryKey(getReferencedTable()->getTable(),JTCS_TO); } + sal_Bool checkPrimaryKey(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& i_xTable,EConnectionSide _eEConnectionSide) const; + sal_Bool IsSourcePrimKey() const { return checkPrimaryKey(getReferencingTable()->getTable(),JTCS_FROM); } + sal_Bool IsDestPrimKey() const { return checkPrimaryKey(getReferencedTable()->getTable(),JTCS_TO); } protected: virtual OConnectionLineDataRef CreateLineDataObj(); @@ -78,7 +78,7 @@ namespace dbaui @return true if successful */ - virtual BOOL Update(); + virtual sal_Bool Update(); void SetCardinality(); @@ -89,9 +89,9 @@ namespace dbaui inline sal_Int32 GetDeleteRules() const { return m_nDeleteRules; } inline sal_Int32 GetCardinality() const { return m_nCardinality; } - BOOL IsConnectionPossible(); + sal_Bool IsConnectionPossible(); void ChangeOrientation(); - BOOL DropRelation(); + sal_Bool DropRelation(); }; } diff --git a/dbaccess/source/ui/inc/RelationControl.hxx b/dbaccess/source/ui/inc/RelationControl.hxx index ec5108d28..f41a64103 100644 --- a/dbaccess/source/ui/inc/RelationControl.hxx +++ b/dbaccess/source/ui/inc/RelationControl.hxx @@ -74,7 +74,7 @@ namespace dbaui /** enables the relation control * - * \param _bEnable when TRUE enables it, otherwise disable it. + * \param _bEnable when sal_True enables it, otherwise disable it. */ void enableRelation(bool _bEnable); @@ -90,7 +90,7 @@ namespace dbaui void lateUIInit(Window* _pTableSeparator = NULL); void lateInit(); - BOOL SaveModified(); + sal_Bool SaveModified(); TTableWindowData::value_type getReferencingTable() const; diff --git a/dbaccess/source/ui/inc/RelationController.hxx b/dbaccess/source/ui/inc/RelationController.hxx index e16dfa935..4d689ebc5 100644 --- a/dbaccess/source/ui/inc/RelationController.hxx +++ b/dbaccess/source/ui/inc/RelationController.hxx @@ -44,7 +44,7 @@ namespace dbaui { ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xTables; ::std::auto_ptr<WaitObject> m_pWaitObject; - ULONG m_nThreadEvent; + sal_uLong m_nThreadEvent; sal_Bool m_bRelationsPossible; protected: // all the features which should be handled by this class diff --git a/dbaccess/source/ui/inc/RelationDlg.hxx b/dbaccess/source/ui/inc/RelationDlg.hxx index 044eaa418..ece9e48a8 100644 --- a/dbaccess/source/ui/inc/RelationDlg.hxx +++ b/dbaccess/source/ui/inc/RelationDlg.hxx @@ -71,12 +71,12 @@ namespace dbaui TTableConnectionData::value_type m_pOrigConnData; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection; - BOOL m_bTriedOneUpdate; + sal_Bool m_bTriedOneUpdate; public: ORelationDialog(OJoinTableView* pParent, const TTableConnectionData::value_type& pConnectionData, - BOOL bAllowTableSelect = FALSE ); + sal_Bool bAllowTableSelect = sal_False ); virtual ~ORelationDialog(); virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getConnection(){ return m_xConnection; } diff --git a/dbaccess/source/ui/inc/RelationTableView.hxx b/dbaccess/source/ui/inc/RelationTableView.hxx index ab0533164..a4509d4d1 100644 --- a/dbaccess/source/ui/inc/RelationTableView.hxx +++ b/dbaccess/source/ui/inc/RelationTableView.hxx @@ -47,7 +47,7 @@ namespace dbaui bool m_bInRemove; virtual void ConnDoubleClicked( OTableConnection* pConnection ); - virtual void AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, BOOL bNewTable = FALSE); + virtual void AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, sal_Bool bNewTable = sal_False); virtual OTableWindow* createWindow(const TTableWindowData::value_type& _pData); @@ -73,7 +73,7 @@ namespace dbaui void AddNewRelation(); // reisst den Dialog fuer eine voellig neue Relation hoch // wird vom AddTabDlg benutzt, um festzustellen, ob noch Tabellen hinzugefuegt werden duerfen - virtual BOOL IsAddAllowed(); + virtual sal_Bool IsAddAllowed(); virtual void lookForUiActivities(); }; diff --git a/dbaccess/source/ui/inc/TableConnection.hxx b/dbaccess/source/ui/inc/TableConnection.hxx index 02519af26..ff6c04352 100644 --- a/dbaccess/source/ui/inc/TableConnection.hxx +++ b/dbaccess/source/ui/inc/TableConnection.hxx @@ -53,7 +53,7 @@ namespace dbaui m_pData; OJoinTableView* m_pParent; - BOOL m_bSelected; + sal_Bool m_bSelected; void Init(); /** clearLineData loops through the vector and deletes all lines @@ -77,8 +77,8 @@ namespace dbaui void Select(); void Deselect(); - BOOL IsSelected() const { return m_bSelected; } - BOOL CheckHit( const Point& rMousePos ) const; + sal_Bool IsSelected() const { return m_bSelected; } + sal_Bool CheckHit( const Point& rMousePos ) const; bool InvalidateConnection(); void UpdateLineList(); diff --git a/dbaccess/source/ui/inc/TableConnectionData.hxx b/dbaccess/source/ui/inc/TableConnectionData.hxx index bd993b31f..f6c705ff0 100644 --- a/dbaccess/source/ui/inc/TableConnectionData.hxx +++ b/dbaccess/source/ui/inc/TableConnectionData.hxx @@ -78,14 +78,14 @@ namespace dbaui virtual OTableConnectionData* NewInstance() const; // (von OTableConnectionData abgeleitete Klasse muessen entsprechend eine Instanz ihrer Klasse liefern) - BOOL SetConnLine( USHORT nIndex, const String& rSourceFieldName, const String& rDestFieldName ); - BOOL AppendConnLine( const ::rtl::OUString& rSourceFieldName, const ::rtl::OUString& rDestFieldName ); - void ResetConnLines( BOOL bUseDefaults = TRUE ); + sal_Bool SetConnLine( sal_uInt16 nIndex, const String& rSourceFieldName, const String& rDestFieldName ); + sal_Bool AppendConnLine( const ::rtl::OUString& rSourceFieldName, const ::rtl::OUString& rDestFieldName ); + void ResetConnLines( sal_Bool bUseDefaults = sal_True ); /** normalizeLines moves the empty lines to the back */ void normalizeLines(); - // loescht die Liste der ConnLines, bei bUseDefaults == TRUE werden danach MAX_CONN_COUNT neue Dummy-Linien eingefuegt + // loescht die Liste der ConnLines, bei bUseDefaults == sal_True werden danach MAX_CONN_COUNT neue Dummy-Linien eingefuegt OConnectionLineDataVec* GetConnLineDataList(){ return &m_vConnLineData; } @@ -102,7 +102,7 @@ namespace dbaui @return true if successful */ - virtual BOOL Update(){ return TRUE; } + virtual sal_Bool Update(){ return sal_True; } }; typedef ::std::vector< ::boost::shared_ptr<OTableConnectionData> > TTableConnectionData; diff --git a/dbaccess/source/ui/inc/TableController.hxx b/dbaccess/source/ui/inc/TableController.hxx index 0b07cccd5..19766b27b 100644 --- a/dbaccess/source/ui/inc/TableController.hxx +++ b/dbaccess/source/ui/inc/TableController.hxx @@ -110,9 +110,6 @@ namespace dbaui virtual void impl_onModifyChanged(); - // const ::connectivity::OSQLParseNode* getParseTree() const { return m_aSqlIterator.getParseTree();} - // need for undo's and redo's - SfxUndoManager* getUndoMgr(); inline ::std::vector< ::boost::shared_ptr<OTableRow> >* getRows() { return &m_vRowList; } /// returns the postion of the the first empty row diff --git a/dbaccess/source/ui/inc/TableDesignControl.hxx b/dbaccess/source/ui/inc/TableDesignControl.hxx index c9468a15b..ea50a78e1 100644 --- a/dbaccess/source/ui/inc/TableDesignControl.hxx +++ b/dbaccess/source/ui/inc/TableDesignControl.hxx @@ -49,25 +49,25 @@ namespace dbaui long m_nDataPos; // derzeit benoetigte Zeile long m_nCurrentPos; // Aktuelle Position der ausgewaehlten Column private: - USHORT m_nCurUndoActId; + sal_uInt16 m_nCurUndoActId; protected: - BOOL m_bCurrentModified; - BOOL m_bUpdatable; - BOOL m_bClipboardFilled; + sal_Bool m_bCurrentModified; + sal_Bool m_bUpdatable; + sal_Bool m_bClipboardFilled; public: OTableRowView(Window* pParent); virtual ~OTableRowView(); - virtual void SetCellData( long nRow, USHORT nColId, const TOTypeInfoSP& _pTypeInfo ) = 0; - virtual void SetCellData( long nRow, USHORT nColId, const ::com::sun::star::uno::Any& _rNewData ) = 0; - virtual ::com::sun::star::uno::Any GetCellData( long nRow, USHORT nColId ) = 0; - virtual void SetControlText( long nRow, USHORT nColId, const String& rText ) = 0; - virtual String GetControlText( long nRow, USHORT nColId ) = 0; + virtual void SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) = 0; + virtual void SetCellData( long nRow, sal_uInt16 nColId, const ::com::sun::star::uno::Any& _rNewData ) = 0; + virtual ::com::sun::star::uno::Any GetCellData( long nRow, sal_uInt16 nColId ) = 0; + virtual void SetControlText( long nRow, sal_uInt16 nColId, const String& rText ) = 0; + virtual String GetControlText( long nRow, sal_uInt16 nColId ) = 0; virtual OTableDesignView* GetView() const = 0; - USHORT GetCurUndoActId(){ return m_nCurUndoActId; } + sal_uInt16 GetCurUndoActId(){ return m_nCurUndoActId; } // IClipboardTest virtual void cut(); @@ -86,8 +86,8 @@ namespace dbaui virtual sal_Bool IsInsertNewAllowed( long nRow ) = 0; virtual sal_Bool IsDeleteAllowed( long nRow ) = 0; - virtual BOOL IsUpdatable() const {return m_bUpdatable;} - virtual void SetUpdatable( BOOL bUpdate=TRUE ); + virtual sal_Bool IsUpdatable() const {return m_bUpdatable;} + virtual void SetUpdatable( sal_Bool bUpdate=sal_True ); virtual RowStatus GetRowStatus(long nRow) const; virtual void KeyInput(const KeyEvent& rEvt); diff --git a/dbaccess/source/ui/inc/TableDesignHelpBar.hxx b/dbaccess/source/ui/inc/TableDesignHelpBar.hxx index 3eed627ae..8182f1eca 100644 --- a/dbaccess/source/ui/inc/TableDesignHelpBar.hxx +++ b/dbaccess/source/ui/inc/TableDesignHelpBar.hxx @@ -45,7 +45,7 @@ namespace dbaui private: String m_sHelpText; MultiLineEdit* m_pTextWin; - USHORT m_nDummy; + sal_uInt16 m_nDummy; protected: virtual void Resize(); diff --git a/dbaccess/source/ui/inc/TableDesignView.hxx b/dbaccess/source/ui/inc/TableDesignView.hxx index 4608010af..8b7cbc050 100644 --- a/dbaccess/source/ui/inc/TableDesignView.hxx +++ b/dbaccess/source/ui/inc/TableDesignView.hxx @@ -46,7 +46,7 @@ namespace dbaui OTableFieldDescWin* m_pFieldDescWin; OTableEditorCtrl* m_pEditorCtrl; - void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); void ArrangeChilds( long nSplitPos ,Rectangle& rRect); DECL_LINK( SplitHdl, Splitter* ); protected: diff --git a/dbaccess/source/ui/inc/TableGrantCtrl.hxx b/dbaccess/source/ui/inc/TableGrantCtrl.hxx index 247966ff8..f2505f34c 100644 --- a/dbaccess/source/ui/inc/TableGrantCtrl.hxx +++ b/dbaccess/source/ui/inc/TableGrantCtrl.hxx @@ -62,8 +62,8 @@ class OTableGrantControl : public ::svt::EditBrowseBox ::svt::CheckBoxControl* m_pCheckCell; Edit* m_pEdit; long m_nDataPos; - BOOL m_bEnable; - ULONG m_nDeactivateEvent; + sal_Bool m_bEnable; + sal_uLong m_nDeactivateEvent; public: OTableGrantControl( Window* pParent,const ResId& _RsId); @@ -91,13 +91,13 @@ protected: virtual long PreNotify(NotifyEvent& rNEvt ); - virtual BOOL IsTabAllowed(BOOL bForward) const; - virtual void InitController( ::svt::CellControllerRef& rController, long nRow, USHORT nCol ); - virtual ::svt::CellController* GetController( long nRow, USHORT nCol ); - virtual void PaintCell( OutputDevice& rDev, const Rectangle& rRect, USHORT nColId ) const; - virtual BOOL SeekRow( long nRow ); - virtual BOOL SaveModified(); - virtual String GetCellText( long nRow, USHORT nColId ) const; + virtual sal_Bool IsTabAllowed(sal_Bool bForward) const; + virtual void InitController( ::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol ); + virtual ::svt::CellController* GetController( long nRow, sal_uInt16 nCol ); + virtual void PaintCell( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColId ) const; + virtual sal_Bool SeekRow( long nRow ); + virtual sal_Bool SaveModified(); + virtual String GetCellText( long nRow, sal_uInt16 nColId ) const; virtual void CellModified(); @@ -105,7 +105,7 @@ private: DECL_LINK( AsynchActivate, void* ); DECL_LINK( AsynchDeactivate, void* ); - sal_Bool isAllowed(USHORT _nColumnId,sal_Int32 _nPrivilege) const; + sal_Bool isAllowed(sal_uInt16 _nColumnId,sal_Int32 _nPrivilege) const; void fillPrivilege(sal_Int32 _nRow) const; TTablePrivilegeMap::const_iterator findPrivilege(sal_Int32 _nRow) const; }; diff --git a/dbaccess/source/ui/inc/TableRow.hxx b/dbaccess/source/ui/inc/TableRow.hxx index ace9eca5c..d206014d6 100644 --- a/dbaccess/source/ui/inc/TableRow.hxx +++ b/dbaccess/source/ui/inc/TableRow.hxx @@ -59,8 +59,8 @@ namespace dbaui void SetFieldType( const TOTypeInfoSP& _pType, sal_Bool _bForce = sal_False ); - void SetPrimaryKey( BOOL bSet ); - BOOL IsPrimaryKey() const; + void SetPrimaryKey( sal_Bool bSet ); + sal_Bool IsPrimaryKey() const; /** returns the current position in the table. @return diff --git a/dbaccess/source/ui/inc/TableWindow.hxx b/dbaccess/source/ui/inc/TableWindow.hxx index 3f2bb9bfd..eeaa896f1 100644 --- a/dbaccess/source/ui/inc/TableWindow.hxx +++ b/dbaccess/source/ui/inc/TableWindow.hxx @@ -45,11 +45,11 @@ namespace dbaui { ////////////////////////////////////////////////////////////////////////// // Flags fuer die Groessenanpassung der SbaJoinTabWins - const UINT16 SIZING_NONE = 0x0000; - const UINT16 SIZING_TOP = 0x0001; - const UINT16 SIZING_BOTTOM = 0x0002; - const UINT16 SIZING_LEFT = 0x0004; - const UINT16 SIZING_RIGHT = 0x0008; + const sal_uInt16 SIZING_NONE = 0x0000; + const sal_uInt16 SIZING_TOP = 0x0001; + const sal_uInt16 SIZING_BOTTOM = 0x0002; + const sal_uInt16 SIZING_LEFT = 0x0004; + const sal_uInt16 SIZING_RIGHT = 0x0008; class OTableWindowListBox; class OJoinDesignView; @@ -76,8 +76,8 @@ namespace dbaui m_pContainerListener; sal_Int32 m_nMoveCount; // how often the arrow keys was pressed sal_Int32 m_nMoveIncrement; // how many pixel we should move - UINT16 m_nSizingFlags; - BOOL m_bActive; + sal_uInt16 m_nSizingFlags; + sal_Bool m_bActive; void Draw3DBorder( const Rectangle& rRect ); // OContainerListener @@ -94,7 +94,7 @@ namespace dbaui virtual OTableWindowListBox* CreateListBox(); // wird im ERSTEN Init aufgerufen - BOOL FillListBox(); + sal_Bool FillListBox(); // wird in JEDEM Init aufgerufen virtual void OnEntryDoubleClicked(SvLBoxEntry* /*pEntry*/) { } @@ -106,7 +106,7 @@ namespace dbaui @return <TRUE/> when the table could handle the keyevent. */ - BOOL HandleKeyInput( const KeyEvent& rEvt ); + sal_Bool HandleKeyInput( const KeyEvent& rEvt ); /** delete the user data with the equal type as created within createUserData @param _pUserData @@ -137,7 +137,7 @@ namespace dbaui virtual ~OTableWindow(); // spaeter Constructor, siehe auch CreateListbox und FillListbox - virtual BOOL Init(); + virtual sal_Bool Init(); OJoinTableView* getTableView(); const OJoinTableView* getTableView() const; @@ -147,11 +147,11 @@ namespace dbaui void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize ); String getTitle() const; - void SetBoldTitle( BOOL bBold ); + void SetBoldTitle( sal_Bool bBold ); void setActive(sal_Bool _bActive = sal_True); void Remove(); - BOOL IsActiveWindow(){ return m_bActive; } + sal_Bool IsActiveWindow(){ return m_bActive; } ::rtl::OUString GetTableName() const { return m_pData->GetTableName(); } ::rtl::OUString GetWinName() const { return m_pData->GetWinName(); } @@ -169,7 +169,7 @@ namespace dbaui inline ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > GetOriginalColumns() const { return m_pData->getColumns(); } inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > GetTable() const { return m_pData->getTable(); } - UINT16 GetSizingFlags() const { return m_nSizingFlags; } + sal_uInt16 GetSizingFlags() const { return m_nSizingFlags; } /** set the sizing flag to the direction @param _rPos The EndPosition after resizing. @@ -193,7 +193,7 @@ namespace dbaui virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); // habe ich Connections nach aussen ? - BOOL ExistsAConn() const; + sal_Bool ExistsAConn() const; void EnumValidFields(::std::vector< ::rtl::OUString>& arrstrFields); diff --git a/dbaccess/source/ui/inc/TableWindowData.hxx b/dbaccess/source/ui/inc/TableWindowData.hxx index 5aaad03a4..79bfcb478 100644 --- a/dbaccess/source/ui/inc/TableWindowData.hxx +++ b/dbaccess/source/ui/inc/TableWindowData.hxx @@ -80,16 +80,16 @@ namespace dbaui inline ::rtl::OUString GetWinName() const { return m_aWinName; } inline Point GetPosition() const { return m_aPosition; } inline Size GetSize() const { return m_aSize; } - inline BOOL IsShowAll() const { return m_bShowAll; } + inline sal_Bool IsShowAll() const { return m_bShowAll; } inline bool isQuery() const { return m_bIsQuery; } inline bool isValid() const { return m_bIsValid; } // it is either a table or query but it is known - BOOL HasPosition() const; - BOOL HasSize() const; + sal_Bool HasPosition() const; + sal_Bool HasSize() const; inline void SetWinName( const ::rtl::OUString& rWinName ) { m_aWinName = rWinName; } inline void SetPosition( const Point& rPos ) { m_aPosition=rPos; } inline void SetSize( const Size& rSize ) { m_aSize = rSize; } - inline void ShowAll( BOOL bAll ) { m_bShowAll = bAll; } + inline void ShowAll( sal_Bool bAll ) { m_bShowAll = bAll; } inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getTable() const { ::osl::MutexGuard aGuard( m_aMutex ); return m_xTable; } inline ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess> getKeys() const { ::osl::MutexGuard aGuard( m_aMutex ); return m_xKeys; } diff --git a/dbaccess/source/ui/inc/TableWindowListBox.hxx b/dbaccess/source/ui/inc/TableWindowListBox.hxx index d5b9c250d..b193bae04 100644 --- a/dbaccess/source/ui/inc/TableWindowListBox.hxx +++ b/dbaccess/source/ui/inc/TableWindowListBox.hxx @@ -66,12 +66,12 @@ namespace dbaui Point m_aMousePos; OTableWindow* m_pTabWin; - ULONG m_nDropEvent; - ULONG m_nUiEvent; + sal_uLong m_nDropEvent; + sal_uLong m_nUiEvent; OJoinDropData m_aDropInfo; - BOOL m_bReallyScrolled : 1; - BOOL m_bDragSource : 1; + sal_Bool m_bReallyScrolled : 1; + sal_Bool m_bDragSource : 1; protected: virtual void LoseFocus(); diff --git a/dbaccess/source/ui/inc/TokenWriter.hxx b/dbaccess/source/ui/inc/TokenWriter.hxx index 5001f73a9..523cf828f 100644 --- a/dbaccess/source/ui/inc/TokenWriter.hxx +++ b/dbaccess/source/ui/inc/TokenWriter.hxx @@ -124,8 +124,8 @@ namespace dbaui //for set the tablename void setSTableName(const ::rtl::OUString &_sTableName){ m_sDefaultTableName = _sTableName; } - virtual BOOL Write(); // Export - virtual BOOL Read(); // Import + virtual sal_Bool Write(); // Export + virtual sal_Bool Read(); // Import void initialize(const ::svx::ODataAccessDescriptor& _aDataDescriptor); void dispose(); @@ -161,8 +161,8 @@ namespace dbaui : ODatabaseImportExport(_rxConnection,_rxNumberF,_rM) {} - virtual BOOL Write(); - virtual BOOL Read(); + virtual sal_Bool Write(); + virtual sal_Bool Read(); }; // ========================================================================= // HTML Im- und Export @@ -180,7 +180,7 @@ namespace dbaui char sIndent[nIndentMax+1]; sal_Int16 m_nIndent; #if OSL_DEBUG_LEVEL > 0 - BOOL m_bCheckFont; + sal_Bool m_bCheckFont; #endif void WriteHeader(); @@ -205,8 +205,8 @@ namespace dbaui : ODatabaseImportExport(_rxConnection,_rxNumberF,_rM) {} - virtual BOOL Write(); - virtual BOOL Read(); + virtual sal_Bool Write(); + virtual sal_Bool Read(); }; // ========================================================================= @@ -242,8 +242,8 @@ namespace dbaui : ODatabaseImportExport(_rxConnection,NULL,_rM) {} - virtual BOOL Write(); - virtual BOOL Read(); + virtual sal_Bool Write(); + virtual sal_Bool Read(); private: using ODatabaseImportExport::initialize; diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx index 3b573f1f8..c7f540ad8 100644 --- a/dbaccess/source/ui/inc/UITools.hxx +++ b/dbaccess/source/ui/inc/UITools.hxx @@ -292,7 +292,7 @@ namespace dbaui @param _xDatasource Asked for the properties. @param _rAutoIncrementValueEnabled - <OUT/> Set to TRUE when the property was set in the datasource. + <OUT/> Set to sal_True when the property was set in the datasource. @param _rsAutoIncrementValue <OUT/> Set to the value when the property was set in the datasource. */ @@ -304,7 +304,7 @@ namespace dbaui @param _xConnection Used to get the datasource as parent from the connection. @param _rAutoIncrementValueEnabled - <OUT/> Set to TRUE when the property was set in the datasource. + <OUT/> Set to sal_True when the property was set in the datasource. @param _rsAutoIncrementValue <OUT/> Set to the value when the property was set in the datasource. */ @@ -318,7 +318,7 @@ namespace dbaui @return The URL for the help agent to dispatch. */ - ::com::sun::star::util::URL createHelpAgentURL(const ::rtl::OUString& _sModuleName,const sal_Int32 _nHelpId); + ::com::sun::star::util::URL createHelpAgentURL(const ::rtl::OUString& _sModuleName,const rtl::OString& _rHelpId); /** set the evaluation flag at the number formatter @param _rxFormatter @@ -363,7 +363,7 @@ namespace dbaui @return RET_YES, RET_NO, RET_ALL */ - sal_Int32 askForUserAction(Window* _pParent,USHORT _nTitle,USHORT _nText,sal_Bool _bAll,const ::rtl::OUString& _sName); + sal_Int32 askForUserAction(Window* _pParent,sal_uInt16 _nTitle,sal_uInt16 _nText,sal_Bool _bAll,const ::rtl::OUString& _sName); /** creates a new view from a query or table @param _sName diff --git a/dbaccess/source/ui/inc/UserAdminDlg.hxx b/dbaccess/source/ui/inc/UserAdminDlg.hxx index 96df23c0a..747b7d4b5 100644 --- a/dbaccess/source/ui/inc/UserAdminDlg.hxx +++ b/dbaccess/source/ui/inc/UserAdminDlg.hxx @@ -59,7 +59,7 @@ namespace dbaui ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection; sal_Bool m_bOwnConnection; protected: - virtual void PageCreated(USHORT _nId, SfxTabPage& _rPage); + virtual void PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage); public: OUserAdminDlg( Window* _pParent ,SfxItemSet* _pItems diff --git a/dbaccess/source/ui/inc/VertSplitView.hxx b/dbaccess/source/ui/inc/VertSplitView.hxx index 3d484f6c9..c1acc80e4 100644 --- a/dbaccess/source/ui/inc/VertSplitView.hxx +++ b/dbaccess/source/ui/inc/VertSplitView.hxx @@ -40,7 +40,7 @@ namespace dbaui Window* m_pRight; sal_Bool m_bVertical; - void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); DECL_LINK( SplitHdl, Splitter* ); protected: virtual void DataChanged(const DataChangedEvent& rDCEvt); diff --git a/dbaccess/source/ui/inc/WCPage.hxx b/dbaccess/source/ui/inc/WCPage.hxx index 10d9ed49b..34e7cc7de 100644 --- a/dbaccess/source/ui/inc/WCPage.hxx +++ b/dbaccess/source/ui/inc/WCPage.hxx @@ -61,8 +61,8 @@ namespace dbaui OWizColumnSelect* m_pPage2; OWizNormalExtend* m_pPage3; - BOOL m_bPKeyAllowed; - BOOL m_bUseHeaderAllowed; + sal_Bool m_bPKeyAllowed; + sal_Bool m_bUseHeaderAllowed; DECL_LINK( AppendDataClickHdl, Button* ); @@ -75,17 +75,17 @@ namespace dbaui public: virtual void Reset(); virtual void ActivatePage(); - virtual BOOL LeavePage(); + virtual sal_Bool LeavePage(); virtual String GetTitle() const ; OCopyTable( Window * pParent ); virtual ~OCopyTable(); - inline BOOL IsOptionDefData() const { return m_aRB_DefData.IsChecked(); } - inline BOOL IsOptionDef() const { return m_aRB_Def.IsChecked(); } - inline BOOL IsOptionAppendData() const { return m_aRB_AppendData.IsChecked(); } - inline BOOL IsOptionView() const { return m_aRB_View.IsChecked(); } - inline BOOL UseHeaderLine() const { return m_aCB_UseHeaderLine.IsChecked(); } + inline sal_Bool IsOptionDefData() const { return m_aRB_DefData.IsChecked(); } + inline sal_Bool IsOptionDef() const { return m_aRB_Def.IsChecked(); } + inline sal_Bool IsOptionAppendData() const { return m_aRB_AppendData.IsChecked(); } + inline sal_Bool IsOptionView() const { return m_aRB_View.IsChecked(); } + inline sal_Bool UseHeaderLine() const { return m_aCB_UseHeaderLine.IsChecked(); } String GetKeyName() const { return m_edKeyName.GetText(); } void setCreateStyleAction(); @@ -95,7 +95,7 @@ namespace dbaui } inline void disallowUseHeaderLine() { - m_bUseHeaderAllowed = FALSE; + m_bUseHeaderAllowed = sal_False; m_aCB_UseHeaderLine.Disable(); } diff --git a/dbaccess/source/ui/inc/WColumnSelect.hxx b/dbaccess/source/ui/inc/WColumnSelect.hxx index 6dd66a547..eb0a5be57 100644 --- a/dbaccess/source/ui/inc/WColumnSelect.hxx +++ b/dbaccess/source/ui/inc/WColumnSelect.hxx @@ -83,7 +83,7 @@ namespace dbaui void enableButtons(); - USHORT adjustColumnPosition(ListBox* _pLeft, + sal_uInt16 adjustColumnPosition(ListBox* _pLeft, const ::rtl::OUString& _sColumnName, ODatabaseExport::TColumnVector::size_type nCurrentPos, const ::comphelper::TStringMixEqualFunctor& _aCase); diff --git a/dbaccess/source/ui/inc/adtabdlg.hxx b/dbaccess/source/ui/inc/adtabdlg.hxx index b1627f8f8..7ffe59ede 100644 --- a/dbaccess/source/ui/inc/adtabdlg.hxx +++ b/dbaccess/source/ui/inc/adtabdlg.hxx @@ -109,7 +109,7 @@ namespace dbaui IAddTableDialogContext& _rContext ); private: - virtual BOOL Close(); + virtual sal_Bool Close(); bool impl_isAddAllowed(); void impl_addTable(); diff --git a/dbaccess/source/ui/inc/advancedsettingsdlg.hxx b/dbaccess/source/ui/inc/advancedsettingsdlg.hxx index c4f5a81d0..12abaf2ac 100644 --- a/dbaccess/source/ui/inc/advancedsettingsdlg.hxx +++ b/dbaccess/source/ui/inc/advancedsettingsdlg.hxx @@ -59,7 +59,7 @@ namespace dbaui SfxItemSet* m_pItemSet; protected: - virtual void PageCreated(USHORT _nId, SfxTabPage& _rPage); + virtual void PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage); public: AdvancedSettingsDialog( Window* _pParent diff --git a/dbaccess/source/ui/inc/brwctrlr.hxx b/dbaccess/source/ui/inc/brwctrlr.hxx index 9f2fe801d..29d21fffc 100644 --- a/dbaccess/source/ui/inc/brwctrlr.hxx +++ b/dbaccess/source/ui/inc/brwctrlr.hxx @@ -123,7 +123,7 @@ namespace dbaui // members for asynchronous load operations FormControllerImpl* m_pFormControllerImpl; // implementing the XFormController - ULONG m_nPendingLoadFinished; // the event used to tell ourself that the load is finished + sal_uLong m_nPendingLoadFinished; // the event used to tell ourself that the load is finished sal_uInt16 m_nFormActionNestingLevel; // see enter-/leaveFormAction sal_Bool m_bLoadCanceled : 1; // the load was canceled somehow @@ -255,7 +255,8 @@ namespace dbaui // (probably this needs not to be overloaded, but you may return anything you want as long as it // supports the ::com::sun::star::form::DatabaseForm service. For instance you may want to create an adapter here which // is synchronized with a foreign ::com::sun::star::form::DatabaseForm you got elsewhere) - virtual sal_Bool InitializeForm(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > & xForm) = 0; + virtual sal_Bool InitializeForm( + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_formProperties ) = 0; // called immediately after a successfull CreateForm // do any initialization (data source etc.) here. the form should be fully functional after that. // return sal_False if you didn't succeed (don't throw exceptions, they won't be caught) @@ -326,8 +327,11 @@ namespace dbaui /// loads or reloads the form virtual sal_Bool reloadForm(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable >& _rxLoadable); - virtual sal_Bool preReloadForm(){ return sal_False; } - virtual void postReloadForm(){} + virtual sal_Bool preReloadForm(){ return sal_False; } + virtual void postReloadForm(){} + + ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer > + createParser_nothrow(); private: void setCurrentModified( sal_Bool _bSet ); @@ -347,7 +351,6 @@ namespace dbaui void addColumnListeners(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > & _xGridControlModel); void impl_checkForCannotSelectUnfiltered( const ::dbtools::SQLExceptionInfo& _rError ); - ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer > createParser_nothrow(); // time to check the CUT/COPY/PASTE-slot-states DECL_LINK( OnInvalidateClipboard, AutoTimer* ); diff --git a/dbaccess/source/ui/inc/charsetlistbox.hxx b/dbaccess/source/ui/inc/charsetlistbox.hxx index e566e8b8a..2c14821a5 100644 --- a/dbaccess/source/ui/inc/charsetlistbox.hxx +++ b/dbaccess/source/ui/inc/charsetlistbox.hxx @@ -53,7 +53,7 @@ namespace dbaui ~CharSetListBox(); void SelectEntryByIanaName( const String& _rIanaName ); - bool StoreSelectedCharSet( SfxItemSet& _rSet, const USHORT _nItemId ); + bool StoreSelectedCharSet( SfxItemSet& _rSet, const sal_uInt16 _nItemId ); private: OCharsetDisplay m_aCharSets; diff --git a/dbaccess/source/ui/inc/curledit.hxx b/dbaccess/source/ui/inc/curledit.hxx index 3bff8de08..33f8ca446 100644 --- a/dbaccess/source/ui/inc/curledit.hxx +++ b/dbaccess/source/ui/inc/curledit.hxx @@ -52,10 +52,10 @@ class OConnectionURLEdit : public Edit m_pTypeCollection; FixedText* m_pForcedPrefix; String m_sSaveValueNoPrefix; - BOOL m_bShowPrefix; // when <TRUE> the prefix will be visible, otherwise not + sal_Bool m_bShowPrefix; // when <TRUE> the prefix will be visible, otherwise not public: - OConnectionURLEdit(Window* pParent, const ResId& rResId,BOOL _bShowPrefix = FALSE); + OConnectionURLEdit(Window* pParent, const ResId& rResId,sal_Bool _bShowPrefix = sal_False); ~OConnectionURLEdit(); public: @@ -69,7 +69,7 @@ public: @param _bShowPrefix If <TRUE/> than the prefix will be visible, otherwise not. */ - void ShowPrefix(BOOL _bShowPrefix); + void ShowPrefix(sal_Bool _bShowPrefix); /// get the currently set text, excluding the prefix indicating the type virtual String GetTextNoPrefix() const; /// set a new text, leave the current prefix unchanged diff --git a/dbaccess/source/ui/inc/dbadmin.hxx b/dbaccess/source/ui/inc/dbadmin.hxx index 7dbb2c5cd..277dce8e4 100644 --- a/dbaccess/source/ui/inc/dbadmin.hxx +++ b/dbaccess/source/ui/inc/dbadmin.hxx @@ -62,7 +62,7 @@ private: sal_Bool m_bApplied : 1; /// sal_True if any changes have been applied while the dialog was executing sal_Bool m_bUIEnabled : 1; /// <TRUE/> if the UI is enabled, false otherwise. Cannot be switched back to <TRUE/>, once it is <FALSE/> - USHORT m_nMainPageID; + sal_uInt16 m_nMainPageID; public: /** ctor. The itemset given should have been created by <method>createItemSet</method> and should be destroyed @@ -104,9 +104,9 @@ public: protected: // adds a new detail page and remove all the old ones - void addDetailPage(USHORT _nPageId,USHORT _nTextId,CreateTabPage pCreateFunc); + void addDetailPage(sal_uInt16 _nPageId,sal_uInt16 _nTextId,CreateTabPage pCreateFunc); - virtual void PageCreated(USHORT _nId, SfxTabPage& _rPage); + virtual void PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage); virtual short Ok(); protected: diff --git a/dbaccess/source/ui/inc/dbtreelistbox.hxx b/dbaccess/source/ui/inc/dbtreelistbox.hxx index cb3f00cda..7ad8cbd54 100644 --- a/dbaccess/source/ui/inc/dbtreelistbox.hxx +++ b/dbaccess/source/ui/inc/dbtreelistbox.hxx @@ -132,13 +132,13 @@ namespace dbaui virtual void InitEntry( SvLBoxEntry* pEntry, const XubString& aStr, const Image& aCollEntryBmp, const Image& aExpEntryBmp, SvLBoxButtonKind eButtonKind); // enable editing for tables/views and queries - virtual BOOL EditingEntry( SvLBoxEntry* pEntry, Selection& ); - virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ); + virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& ); + virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ); - virtual BOOL DoubleClickHdl(); + virtual sal_Bool DoubleClickHdl(); virtual PopupMenu* CreateContextMenu( void ); - virtual void ExcecuteContextMenuAction( USHORT nSelectedPopupEntry ); + virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ); void SetEnterKeyHdl(const Link& rNewHdl) {m_aEnterKeyHdl = rNewHdl;} diff --git a/dbaccess/source/ui/inc/dbu_dlg.hrc b/dbaccess/source/ui/inc/dbu_dlg.hrc index f403caafd..1335a6c10 100644 --- a/dbaccess/source/ui/inc/dbu_dlg.hrc +++ b/dbaccess/source/ui/inc/dbu_dlg.hrc @@ -64,24 +64,24 @@ #define STR_ADABAS_ERROR_SYSTEMTABLES RID_STR_DLG_START + 6 #define STR_ERROR_PASSWORDS_NOT_IDENTICAL RID_STR_DLG_START + 7 #define STR_INDEXDESIGN_DOUBLE_COLUMN_NAME RID_STR_DLG_START + 8 -#define STR_DATASOURCE_DEFAULTNAME RID_STR_DLG_START + 9 -#define STR_ERR_EMPTY_DSN_NAME RID_STR_DLG_START + 10 + // FREE + // FREE #define STR_ERR_USE_CONNECT_TO RID_STR_DLG_START + 11 #define STR_ALREADYEXISTOVERWRITE RID_STR_DLG_START + 12 -#define STR_QUERY_DROP_ALL RID_STR_DLG_START + 13 + // FREE #define STR_INDEX_NAME_ALREADY_USED RID_STR_DLG_START + 14 #define STR_ASK_FOR_DIRECTORY_CREATION RID_STR_DLG_START + 15 #define STR_COULD_NOT_CREATE_DIRECTORY RID_STR_DLG_START + 16 -#define STR_ADDRESSBOOK_SYSTEM RID_STR_DLG_START + 17 -#define STR_ADDRESSBOOK_MOZILLA RID_STR_DLG_START + 18 -#define STR_ADDRESSBOOK_EVOLUTION RID_STR_DLG_START + 19 // FREE -#define STR_ADDRESSBOOK_LDAP RID_STR_DLG_START + 21 -#define STR_ADDRESSBOOK_OUTLOOK RID_STR_DLG_START + 22 + // FREE + // FREE + // FREE + // FREE + // FREE #define STR_COMMAND_EXECUTED_SUCCESSFULLY RID_STR_DLG_START + 23 #define STR_DIRECTSQL_CONNECTIONLOST RID_STR_DLG_START + 24 -#define STR_HINT_READONLY_CONNECTION RID_STR_DLG_START + 25 -#define STR_HINT_CONNECTION_NOT_CAPABLE RID_STR_DLG_START + 26 + // FREE + // FREE #define STR_USERADMIN_NOT_AVAILABLE RID_STR_DLG_START + 27 #define STR_TAB_INDEX_SORTORDER RID_STR_DLG_START + 28 #define STR_TAB_INDEX_FIELD RID_STR_DLG_START + 29 @@ -110,7 +110,7 @@ #define STR_NO_ADABASE_DATASOURCES RID_STR_DLG_START + 55 #define STR_NO_ADDITIONAL_SETTINGS RID_STR_DLG_START + 56 #define STR_HOSTNAME RID_STR_DLG_START + 57 -#define STR_ADDRESSBOOK_THUNDERBIRD RID_STR_DLG_START + 58 + // FREE #define STR_MOZILLA_PROFILE_NAME RID_STR_DLG_START + 59 #define STR_THUNDERBIRD_PROFILE_NAME RID_STR_DLG_START + 60 #define STR_EXPLAN_STRINGCONVERSION_ERROR RID_STR_DLG_START + 61 diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc index b1b542c03..5881a4f29 100644 --- a/dbaccess/source/ui/inc/dbu_resource.hrc +++ b/dbaccess/source/ui/inc/dbu_resource.hrc @@ -118,7 +118,7 @@ #define DLG_DATABASE_WIZARD RID_DIALOG_START + 29 #define RID_EXTENSION_NOT_PRESENT_DLG RID_DIALOG_START + 30 #define DLG_TEXT_CONNECTION_SETTINGS RID_DIALOG_START + 31 - +#define DLG_TABLE_FILTER RID_DIALOG_START + 32 //======================================================================== // tab pages diff --git a/dbaccess/source/ui/inc/dlgattr.hxx b/dbaccess/source/ui/inc/dlgattr.hxx index 119136041..007af9137 100644 --- a/dbaccess/source/ui/inc/dlgattr.hxx +++ b/dbaccess/source/ui/inc/dlgattr.hxx @@ -50,10 +50,10 @@ namespace dbaui SvxNumberInfoItem* pNumberInfoItem; public: - SbaSbAttrDlg( Window * pParent, const SfxItemSet*, SvNumberFormatter*, USHORT nFlags = TP_ATTR_CHAR , BOOL bRow = FALSE); + SbaSbAttrDlg( Window * pParent, const SfxItemSet*, SvNumberFormatter*, sal_uInt16 nFlags = TP_ATTR_CHAR , sal_Bool bRow = sal_False); ~SbaSbAttrDlg(); - virtual void PageCreated( USHORT nPageId, SfxTabPage& rTabPage ); + virtual void PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ); }; //......................................................................... } // namespace dbaui diff --git a/dbaccess/source/ui/inc/dlgsize.hxx b/dbaccess/source/ui/inc/dlgsize.hxx index 30b581b83..5e7e87773 100644 --- a/dbaccess/source/ui/inc/dlgsize.hxx +++ b/dbaccess/source/ui/inc/dlgsize.hxx @@ -58,7 +58,7 @@ namespace dbaui HelpButton aPB_HELP; public: - DlgSize( Window * pParent, sal_Int32 nVal, BOOL bRow, sal_Int32 _nAlternativeStandard = -1 ); + DlgSize( Window * pParent, sal_Int32 nVal, sal_Bool bRow, sal_Int32 _nAlternativeStandard = -1 ); ~DlgSize(); sal_Int32 GetValue(); diff --git a/dbaccess/source/ui/inc/dsitems.hxx b/dbaccess/source/ui/inc/dsitems.hxx index 40595ac71..99cc689a2 100644 --- a/dbaccess/source/ui/inc/dsitems.hxx +++ b/dbaccess/source/ui/inc/dsitems.hxx @@ -93,6 +93,7 @@ typedef sal_Int32 ItemID; #define DSID_ESCAPE_DATETIME 57 #define DSID_NAMED_PIPE 58 #define DSID_PRIMARY_KEY_SUPPORT 59 +#define DSID_MAX_ROW_SCAN 60 // don't forget to adjust DSID_LAST_ITEM_ID below! @@ -100,7 +101,7 @@ typedef sal_Int32 ItemID; //= item range. Adjust this if you introduce new items above #define DSID_FIRST_ITEM_ID DSID_NAME -#define DSID_LAST_ITEM_ID DSID_PRIMARY_KEY_SUPPORT +#define DSID_LAST_ITEM_ID DSID_MAX_ROW_SCAN #endif // _DBAUI_DATASOURCEITEMS_HXX_ diff --git a/dbaccess/source/ui/inc/dsmeta.hxx b/dbaccess/source/ui/inc/dsmeta.hxx index f354126b8..67c17ff68 100644 --- a/dbaccess/source/ui/inc/dsmeta.hxx +++ b/dbaccess/source/ui/inc/dsmeta.hxx @@ -133,6 +133,7 @@ namespace dbaui || has( DSID_IGNORECURRENCY ) || has( DSID_ESCAPE_DATETIME ) || has( DSID_PRIMARY_KEY_SUPPORT ) + || has( DSID_MAX_ROW_SCAN ) ; } diff --git a/dbaccess/source/ui/inc/exsrcbrw.hxx b/dbaccess/source/ui/inc/exsrcbrw.hxx index 531e7e382..2669037fd 100644 --- a/dbaccess/source/ui/inc/exsrcbrw.hxx +++ b/dbaccess/source/ui/inc/exsrcbrw.hxx @@ -97,7 +97,7 @@ namespace dbaui ~SbaExternalSourceBrowser(); virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > CreateForm(); - virtual sal_Bool InitializeForm(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > & xForm); + virtual sal_Bool InitializeForm( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_formProperties ); virtual sal_Bool LoadForm(); diff --git a/dbaccess/source/ui/inc/imageprovider.hxx b/dbaccess/source/ui/inc/imageprovider.hxx index 3e452394c..d4f6135ac 100644 --- a/dbaccess/source/ui/inc/imageprovider.hxx +++ b/dbaccess/source/ui/inc/imageprovider.hxx @@ -125,7 +125,7 @@ namespace dbaui the resource ID image to be used for the object type. Must be fed into a ModuleRes instance to actually load the image. */ - USHORT getDefaultImageResourceID( + sal_uInt16 getDefaultImageResourceID( sal_Int32 _nDatabaseObjectType ); diff --git a/dbaccess/source/ui/inc/listviewitems.hxx b/dbaccess/source/ui/inc/listviewitems.hxx index 05d5492f9..02f109600 100644 --- a/dbaccess/source/ui/inc/listviewitems.hxx +++ b/dbaccess/source/ui/inc/listviewitems.hxx @@ -52,7 +52,7 @@ namespace dbaui { } - virtual USHORT IsA(); + virtual sal_uInt16 IsA(); virtual void Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry); virtual void InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* _pViewData); diff --git a/dbaccess/source/ui/inc/moduledbu.hxx b/dbaccess/source/ui/inc/moduledbu.hxx index 2b915f6fb..b66caaddb 100644 --- a/dbaccess/source/ui/inc/moduledbu.hxx +++ b/dbaccess/source/ui/inc/moduledbu.hxx @@ -94,7 +94,7 @@ public: class ModuleRes : public ::ResId { public: - ModuleRes(USHORT _nId) : ResId(_nId, *OModule::getResManager()) { } + ModuleRes(sal_uInt16 _nId) : ResId(_nId, *OModule::getResManager()) { } }; //......................................................................... diff --git a/dbaccess/source/ui/inc/opendoccontrols.hxx b/dbaccess/source/ui/inc/opendoccontrols.hxx index 72900b49c..c00860bce 100644 --- a/dbaccess/source/ui/inc/opendoccontrols.hxx +++ b/dbaccess/source/ui/inc/opendoccontrols.hxx @@ -66,7 +66,7 @@ namespace dbaui { private: typedef ::std::pair< String, String > StringPair; - typedef ::std::map< USHORT, StringPair > MapIndexToStringPair; + typedef ::std::map< sal_uInt16, StringPair > MapIndexToStringPair; ::rtl::OUString m_sModule; MapIndexToStringPair m_aURLs; @@ -80,7 +80,7 @@ namespace dbaui protected: virtual void RequestHelp( const HelpEvent& _rHEvt ); - StringPair impl_getDocumentAtIndex( USHORT _nListIndex, bool _bSystemNotation = false ) const; + StringPair impl_getDocumentAtIndex( sal_uInt16 _nListIndex, bool _bSystemNotation = false ) const; private: void impl_init( const sal_Char* _pAsciiModuleName ); diff --git a/dbaccess/source/ui/inc/propertystorage.hxx b/dbaccess/source/ui/inc/propertystorage.hxx index ec2d6122b..5a00ed219 100644 --- a/dbaccess/source/ui/inc/propertystorage.hxx +++ b/dbaccess/source/ui/inc/propertystorage.hxx @@ -63,7 +63,7 @@ namespace dbaui //==================================================================== //= SetItemPropertyStorage //==================================================================== - typedef USHORT ItemId; + typedef sal_uInt16 ItemId; /** a PropertyStorage implementation which stores the value in an item set */ diff --git a/dbaccess/source/ui/inc/querycontroller.hxx b/dbaccess/source/ui/inc/querycontroller.hxx index 522dd44cf..73f3ebb15 100644 --- a/dbaccess/source/ui/inc/querycontroller.hxx +++ b/dbaccess/source/ui/inc/querycontroller.hxx @@ -100,7 +100,7 @@ namespace dbaui sal_Int32 m_nVisibleRows; // which rows the selection browse should show sal_Int32 m_nSplitPos; // the position of the splitter sal_Int32 m_nCommandType; // the type of the object we're designing - sal_Bool m_bGraphicalDesign; // are we in the graphical design mode (TRUE) or in the text design (FALSE)? + sal_Bool m_bGraphicalDesign; // are we in the graphical design mode (sal_True) or in the text design (sal_False)? sal_Bool m_bDistinct; // true when you want "select distinct" otherwise false sal_Bool m_bViewAlias; // show the alias row in the design view sal_Bool m_bViewTable; // show the table row in the design view diff --git a/dbaccess/source/ui/inc/queryfilter.hxx b/dbaccess/source/ui/inc/queryfilter.hxx index 0a72392ae..4c764cfa3 100644 --- a/dbaccess/source/ui/inc/queryfilter.hxx +++ b/dbaccess/source/ui/inc/queryfilter.hxx @@ -115,10 +115,10 @@ namespace dbaui DECL_LINK( ListSelectHdl, ListBox * ); DECL_LINK( ListSelectCompHdl, ListBox * ); - void SetLine( USHORT nIdx,const ::com::sun::star::beans::PropertyValue& _rItem,sal_Bool _bOr ); + void SetLine( sal_uInt16 nIdx,const ::com::sun::star::beans::PropertyValue& _rItem,sal_Bool _bOr ); void EnableLines(); sal_Int32 GetOSQLPredicateType( const String& _rSelectedPredicate ) const; - USHORT GetSelectionPos(sal_Int32 eType,const ListBox& rListBox) const; + sal_uInt16 GetSelectionPos(sal_Int32 eType,const ListBox& rListBox) const; sal_Bool getCondition(const ListBox& _rField,const ListBox& _rComp,const Edit& _rValue,::com::sun::star::beans::PropertyValue& _rFilter) const; void fillLines(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& _aValues); diff --git a/dbaccess/source/ui/inc/sbagrid.hxx b/dbaccess/source/ui/inc/sbagrid.hxx index 7718bf200..06e27c49a 100644 --- a/dbaccess/source/ui/inc/sbagrid.hxx +++ b/dbaccess/source/ui/inc/sbagrid.hxx @@ -240,7 +240,7 @@ namespace dbaui sal_Int32 m_nAsyncDropEvent; - USHORT m_nCurrentActionColId; + sal_uInt16 m_nCurrentActionColId; // ui actions (e.g. a context menu) may be performed on columns which aren't the current one // and aren't selected, so we have to track this column id diff --git a/dbaccess/source/ui/inc/singledoccontroller.hxx b/dbaccess/source/ui/inc/singledoccontroller.hxx new file mode 100755 index 000000000..4734dad80 --- /dev/null +++ b/dbaccess/source/ui/inc/singledoccontroller.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef DBAUI_SINGLEDOCCONTROLLER_HXX +#define DBAUI_SINGLEDOCCONTROLLER_HXX + +#include "dbsubcomponentcontroller.hxx" + +/** === begin UNO includes === **/ +#include <com/sun/star/document/XUndoManagerSupplier.hpp> +/** === end UNO includes === **/ + +#include <cppuhelper/implbase1.hxx> + +class SfxUndoAction; +class SfxUndoManager; + +//...................................................................................................................... +namespace dbaui +{ +//...................................................................................................................... + + //================================================================================================================== + //= OSingleDocumentController + //================================================================================================================== + struct OSingleDocumentController_Data; + typedef ::cppu::ImplInheritanceHelper1 < DBSubComponentController + , ::com::sun::star::document::XUndoManagerSupplier + > OSingleDocumentController_Base; + class OSingleDocumentController : public OSingleDocumentController_Base + { + protected: + OSingleDocumentController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxORB ); + virtual ~OSingleDocumentController(); + + // OComponentHelper + virtual void SAL_CALL disposing(); + + public: + /// need for undo's and redo's + SfxUndoManager& GetUndoManager() const; + + /// complete clears the Undo/Redo stacks + void ClearUndoManager(); + + /** addUndoActionAndInvalidate adds an undo action to the undoManager, + additionally invalidates the UNDO and REDO slot + @param pAction the undo action to add + */ + void addUndoActionAndInvalidate( SfxUndoAction* pAction ); + + // OGenericUnoController + virtual FeatureState GetState( sal_uInt16 nId ) const; + virtual void Execute( sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs ); + + // XUndoManagerSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > SAL_CALL getUndoManager( ) throw (::com::sun::star::uno::RuntimeException); + + // XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException ); + + private: + ::std::auto_ptr< OSingleDocumentController_Data > m_pData; + }; + +//...................................................................................................................... +} // namespace dbaui +//...................................................................................................................... + +#endif // DBAUI_SINGLEDOCCONTROLLER_HXX diff --git a/dbaccess/source/ui/inc/sqledit.hxx b/dbaccess/source/ui/inc/sqledit.hxx index 99ac2dbf1..b2461a5ed 100644 --- a/dbaccess/source/ui/inc/sqledit.hxx +++ b/dbaccess/source/ui/inc/sqledit.hxx @@ -44,8 +44,8 @@ namespace dbaui Link m_lnkTextModifyHdl; String m_strOrigText; // wird beim Undo wiederhergestellt OQueryTextView* m_pView; - BOOL m_bAccelAction; // Wird bei Cut, Copy, Paste gesetzt - BOOL m_bStopTimer; + sal_Bool m_bAccelAction; // Wird bei Cut, Copy, Paste gesetzt + sal_Bool m_bStopTimer; utl::SourceViewConfig m_SourceViewConfig; svtools::ColorConfig m_ColorConfig; @@ -70,7 +70,7 @@ namespace dbaui using MultiLineEditSyntaxHighlight::SetText; // own functionality - BOOL IsInAccelAct(); + sal_Bool IsInAccelAct(); void SetTextModifyHdl(const Link& lnk) { m_lnkTextModifyHdl = lnk; } // bitte nicht SetModifyHdl benutzen, den brauche ich selber, der hier wird von dem damit gesetzten Handler diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx index 5fdaf2fd6..4081bf1e5 100644 --- a/dbaccess/source/ui/inc/unodatbr.hxx +++ b/dbaccess/source/ui/inc/unodatbr.hxx @@ -120,12 +120,12 @@ namespace dbaui Splitter* m_pSplitter; SvLBoxTreeList* m_pTreeModel; // contains the datasources of the registry SvLBoxEntry* m_pCurrentlyDisplayed; - ULONG m_nAsyncDrop; + sal_uLong m_nAsyncDrop; - sal_Int16 m_nBorder; // TRUE when border should be shown + sal_Int16 m_nBorder; // sal_True when border should be shown sal_Bool m_bQueryEscapeProcessing : 1; // the escape processing flag of the query currently loaded (if any) - sal_Bool m_bShowMenu; // if TRUE the menu should be visible otherwise not + sal_Bool m_bShowMenu; // if sal_True the menu should be visible otherwise not sal_Bool m_bInSuspend; sal_Bool m_bEnableBrowser; ::boost::optional< bool > @@ -222,7 +222,7 @@ namespace dbaui protected: // SbaXDataBrowserController overridables - virtual sal_Bool InitializeForm(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > & xForm); + virtual sal_Bool InitializeForm( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_formProperties ); virtual sal_Bool InitializeGridModel(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent > & xGrid); virtual sal_Bool preReloadForm(); @@ -485,6 +485,10 @@ namespace dbaui of the load process */ void initializePreviewMode(); + + /** checks whether the Order/Filter clauses set at our row set are valid, removes them if not so + */ + void impl_sanitizeRowSetClauses_nothrow(); }; // ......................................................................... diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index f8b3cb54a..d4b655594 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -116,10 +116,10 @@ ODatabaseExport::ODatabaseExport(sal_Int32 nRows, ,m_nRows(1) ,m_nRowCount(0) ,m_nDefToken( gsl_getSystemTextEncoding() ) - ,m_bError(FALSE) - ,m_bInTbl(FALSE) - ,m_bHead(TRUE) - ,m_bDontAskAgain(FALSE) + ,m_bError(sal_False) + ,m_bInTbl(sal_False) + ,m_bHead(sal_True) + ,m_bDontAskAgain(sal_False) ,m_bIsAutoIncrement(_bAutoIncrementEnabled) ,m_bFoundTable(sal_False) ,m_bCheckOnly(sal_False) @@ -175,7 +175,7 @@ ODatabaseExport::ODatabaseExport(const SharedConnection& _rxConnection, ,m_nDefToken( gsl_getSystemTextEncoding() ) ,m_bError(sal_False) ,m_bInTbl(sal_False) - ,m_bHead(TRUE) + ,m_bHead(sal_True) ,m_bDontAskAgain(sal_False) ,m_bIsAutoIncrement(sal_False) ,m_bFoundTable(sal_False) @@ -785,9 +785,9 @@ void ODatabaseExport::showErrorDialog(const ::com::sun::star::sdbc::SQLException OSQLWarningBox aBox( NULL, aMsg, WB_YES_NO | WB_DEF_NO ); if (aBox.Execute() == RET_YES) - m_bDontAskAgain = TRUE; + m_bDontAskAgain = sal_True; else - m_bError = TRUE; + m_bError = sal_True; } } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx index 2f49094fe..782eb61f6 100644 --- a/dbaccess/source/ui/misc/HtmlReader.cxx +++ b/dbaccess/source/ui/misc/HtmlReader.cxx @@ -111,7 +111,7 @@ OHTMLReader::OHTMLReader(SvStream& rIn,const SharedConnection& _rxConnection, DBG_CTOR(OHTMLReader,NULL); SetSrcEncoding( GetExtendedCompatibilityTextEncoding( RTL_TEXTENCODING_ISO_8859_1 ) ); // If the file starts with a BOM, switch to UCS2. - SetSwitchToUCS2( TRUE ); + SetSwitchToUCS2( sal_True ); } // --------------------------------------------------------------------------- OHTMLReader::OHTMLReader(SvStream& rIn, @@ -133,7 +133,7 @@ OHTMLReader::OHTMLReader(SvStream& rIn, DBG_CTOR(OHTMLReader,NULL); SetSrcEncoding( GetExtendedCompatibilityTextEncoding( RTL_TEXTENCODING_ISO_8859_1 ) ); // If the file starts with a BOM, switch to UCS2. - SetSwitchToUCS2( TRUE ); + SetSwitchToUCS2( sal_True ); } // --------------------------------------------------------------------------- OHTMLReader::~OHTMLReader() @@ -186,7 +186,7 @@ void OHTMLReader::NextToken( int nToken ) case HTML_THEAD_ON: case HTML_TBODY_ON: { - sal_uInt32 nTell = rInput.Tell(); // verändert vielleicht die Position des Streams + sal_uInt32 nTell = rInput.Tell(); // ver�ndert vielleicht die Position des Streams if ( !m_xTable.is() ) {// erste Zeile als Header verwenden m_bError = !CreateTable(nToken); @@ -326,7 +326,7 @@ void OHTMLReader::NextToken( int nToken ) void OHTMLReader::fetchOptions() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLReader::fetchOptions" ); - m_bInTbl = TRUE; + m_bInTbl = sal_True; const HTMLOptions* options = GetOptions(); sal_Int16 nArrLen = options->Count(); for ( sal_Int16 i = 0; i < nArrLen; i++ ) @@ -488,7 +488,7 @@ sal_Bool OHTMLReader::CreateTable(int nToken) case HTML_TABLEDATA_ON: case HTML_TABLEHEADER_ON: TableDataOn(eVal); - bTableHeader = TRUE; + bTableHeader = sal_True; break; case HTML_TABLEDATA_OFF: case HTML_TABLEHEADER_OFF: @@ -513,7 +513,7 @@ sal_Bool OHTMLReader::CreateTable(int nToken) case HTML_TITLE_ON: case HTML_CAPTION_ON: - bCaption = TRUE; + bCaption = sal_True; break; case HTML_TITLE_OFF: case HTML_CAPTION_OFF: diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx index f1d72889e..cdfd78a1e 100644 --- a/dbaccess/source/ui/misc/RowSetDrop.cxx +++ b/dbaccess/source/ui/misc/RowSetDrop.cxx @@ -107,19 +107,19 @@ void ORowSetImportExport::initialize() } } // ----------------------------------------------------------------------------- -BOOL ORowSetImportExport::Write() +sal_Bool ORowSetImportExport::Write() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "ORowSetImportExport::Write" ); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- -BOOL ORowSetImportExport::Read() +sal_Bool ORowSetImportExport::Read() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "ORowSetImportExport::Read" ); // check if there is any column to copy if(::std::find_if(m_aColumnMapping.begin(),m_aColumnMapping.end(), ::std::bind2nd(::std::greater<sal_Int32>(),0)) == m_aColumnMapping.end()) - return FALSE; + return sal_False; sal_Bool bContinue = sal_True; if(m_aSelection.getLength()) { @@ -165,7 +165,7 @@ BOOL ORowSetImportExport::Read() } } } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- sal_Bool ORowSetImportExport::insertNewRow() diff --git a/dbaccess/source/ui/misc/RtfReader.cxx b/dbaccess/source/ui/misc/RtfReader.cxx index f810b1859..f07a27e5a 100644 --- a/dbaccess/source/ui/misc/RtfReader.cxx +++ b/dbaccess/source/ui/misc/RtfReader.cxx @@ -162,7 +162,7 @@ void ORTFReader::NextToken( int nToken ) bool bInsertRow = true; if ( !m_xTable.is() ) // erste Zeile als Header verwenden { - sal_uInt32 nTell = rInput.Tell(); // verändert vielleicht die Position des Streams + sal_uInt32 nTell = rInput.Tell(); // ver�ndert vielleicht die Position des Streams m_bError = !CreateTable(nToken); bInsertRow = m_bAppendFirstLine; @@ -192,7 +192,7 @@ void ORTFReader::NextToken( int nToken ) eraseTokens(); } - m_bInTbl = TRUE; // jetzt befinden wir uns in einer Tabellenbeschreibung + m_bInTbl = sal_True; // jetzt befinden wir uns in einer Tabellenbeschreibung break; case RTF_TEXTTOKEN: case RTF_SINGLECHAR: @@ -215,7 +215,7 @@ void ORTFReader::NextToken( int nToken ) } break; case RTF_ROW: - // es kann vorkommen, daß die letzte Celle nicht mit \cell abgeschlossen ist + // es kann vorkommen, da� die letzte Celle nicht mit \cell abgeschlossen ist try { insertValueIntoColumn(); @@ -249,7 +249,7 @@ void ORTFReader::NextToken( int nToken ) } break; case RTF_INTBL: - m_bInTbl = TRUE; + m_bInTbl = sal_True; break; case RTF_TEXTTOKEN: case RTF_SINGLECHAR: @@ -294,7 +294,7 @@ sal_Bool ORTFReader::CreateTable(int nToken) if(m_bInTbl) aColumnName.Erase(); - m_bInTbl = TRUE; + m_bInTbl = sal_True; break; case RTF_TEXTTOKEN: case RTF_SINGLECHAR: diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index ed1c3eac5..4b132e5a6 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -362,24 +362,24 @@ void ODatabaseImportExport::initialize() m_bInInitialize = sal_False; } // ----------------------------------------------------------------------------- -BOOL ODatabaseImportExport::Write() +sal_Bool ODatabaseImportExport::Write() { if ( m_bNeedToReInitialize ) { if ( !m_bInInitialize ) initialize(); } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- -BOOL ODatabaseImportExport::Read() +sal_Bool ODatabaseImportExport::Read() { if ( m_bNeedToReInitialize ) { if ( !m_bInInitialize ) initialize(); } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- void ODatabaseImportExport::impl_initializeRowMember_throw() @@ -395,7 +395,7 @@ void ODatabaseImportExport::impl_initializeRowMember_throw() } } //====================================================================== -BOOL ORTFImportExport::Write() +sal_Bool ORTFImportExport::Write() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "ORTFImportExport::Write" ); ODatabaseImportExport::Write(); @@ -403,10 +403,10 @@ BOOL ORTFImportExport::Write() (*m_pStream) << OOO_STRING_SVTOOLS_RTF_ANSI << ODatabaseImportExport::sNewLine; rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252; - BOOL bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); - BOOL bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); - BOOL bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); - BOOL bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); + sal_Bool bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); + sal_Bool bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); + sal_Bool bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); + sal_Bool bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); sal_Int32 nColor = 0; if(m_xObject.is()) @@ -570,7 +570,7 @@ BOOL ORTFImportExport::Write() } (*m_pStream) << '}' << ODatabaseImportExport::sNewLine; - (*m_pStream) << (BYTE) 0; + (*m_pStream) << (sal_uInt8) 0; return ((*m_pStream).GetError() == SVSTREAM_OK); } // ----------------------------------------------------------------------------- @@ -593,10 +593,10 @@ void ORTFImportExport::appendRow(::rtl::OString* pHorzChar,sal_Int32 _nColumnCou (*m_pStream) << ODatabaseImportExport::sNewLine; } - const BOOL bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); - const BOOL bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); - const BOOL bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); - const BOOL bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); + const sal_Bool bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); + const sal_Bool bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); + const sal_Bool bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); + const sal_Bool bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); static const ::rtl::OString aFS2("\\fs20\\f1\\cf0\\cb1"); ::comphelper::ComponentContext aContext(m_xFactory); Reference< XRowSet > xRowSet(m_xRow,UNO_QUERY); @@ -641,7 +641,7 @@ void ORTFImportExport::appendRow(::rtl::OString* pHorzChar,sal_Int32 _nColumnCou ++k; } //------------------------------------------------------------------- -BOOL ORTFImportExport::Read() +sal_Bool ORTFImportExport::Read() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "ORTFImportExport::Read" ); ODatabaseImportExport::Read(); @@ -677,7 +677,7 @@ const char OHTMLImportExport::sIndentSource[nIndentMax+1] = "\t\t\t\t\t\t\t\t\t\ //======================================================================== #define OUT_PROLOGUE() ((*m_pStream) << sHTML30_Prologue << ODatabaseImportExport::sNewLine << ODatabaseImportExport::sNewLine) #define TAG_ON( tag ) HTMLOutFuncs::Out_AsciiTag( (*m_pStream), tag ) -#define TAG_OFF( tag ) HTMLOutFuncs::Out_AsciiTag( (*m_pStream), tag, FALSE ) +#define TAG_OFF( tag ) HTMLOutFuncs::Out_AsciiTag( (*m_pStream), tag, sal_False ) #define OUT_STR( str ) HTMLOutFuncs::Out_String( (*m_pStream), str ) #define OUT_LF() (*m_pStream) << ODatabaseImportExport::sNewLine << GetIndentStr() #define lcl_OUT_LF() (*m_pStream) << ODatabaseImportExport::sNewLine @@ -695,7 +695,7 @@ OHTMLImportExport::OHTMLImportExport(const ::svx::ODataAccessDescriptor& _aDataD : ODatabaseImportExport(_aDataDescriptor,_rM,_rxNumberF,rExchange) ,m_nIndent(0) #if OSL_DEBUG_LEVEL > 0 - ,m_bCheckFont(FALSE) + ,m_bCheckFont(sal_False) #endif { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::OHTMLImportExport" ); @@ -706,7 +706,7 @@ OHTMLImportExport::OHTMLImportExport(const ::svx::ODataAccessDescriptor& _aDataD sIndent[0] = 0; } //------------------------------------------------------------------- -BOOL OHTMLImportExport::Write() +sal_Bool OHTMLImportExport::Write() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::Write" ); ODatabaseImportExport::Write(); @@ -725,7 +725,7 @@ BOOL OHTMLImportExport::Write() return sal_False; } //------------------------------------------------------------------- -BOOL OHTMLImportExport::Read() +sal_Bool OHTMLImportExport::Read() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::Read" ); ODatabaseImportExport::Read(); @@ -1015,12 +1015,12 @@ void OHTMLImportExport::WriteCell( sal_Int32 nFormat,sal_Int32 nWidthPixel,sal_I { fVal = m_xFormatter->convertStringToNumber(nFormat,rValue); ByteString aTmpString(aStrTD); - HTMLOutFuncs::CreateTableDataOptionsValNum( aTmpString, FALSE, fVal,nFormat, *pFormatter ); + HTMLOutFuncs::CreateTableDataOptionsValNum( aTmpString, sal_False, fVal,nFormat, *pFormatter ); } catch(Exception&) { ByteString aTmpString(aStrTD); - HTMLOutFuncs::CreateTableDataOptionsValNum( aTmpString, FALSE, fVal,nFormat, *pFormatter ); + HTMLOutFuncs::CreateTableDataOptionsValNum( aTmpString, sal_False, fVal,nFormat, *pFormatter ); } } @@ -1028,10 +1028,10 @@ void OHTMLImportExport::WriteCell( sal_Int32 nFormat,sal_Int32 nWidthPixel,sal_I FontOn(); - BOOL bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); - BOOL bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); - BOOL bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); - BOOL bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); + sal_Bool bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); + sal_Bool bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); + sal_Bool bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); + sal_Bool bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); if ( bBold ) TAG_ON( OOO_STRING_SVTOOLS_HTML_bold ); if ( bItalic ) TAG_ON( OOO_STRING_SVTOOLS_HTML_italic ); @@ -1058,7 +1058,7 @@ void OHTMLImportExport::FontOn() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::FontOn" ); #if OSL_DEBUG_LEVEL > 0 - m_bCheckFont = TRUE; + m_bCheckFont = sal_True; #endif // <FONT FACE="xxx"> @@ -1091,7 +1091,7 @@ inline void OHTMLImportExport::FontOff() OSL_ENSURE(m_bCheckFont,"Kein FontOn() gerufen"); TAG_OFF( OOO_STRING_SVTOOLS_HTML_font ); #if OSL_DEBUG_LEVEL > 0 - m_bCheckFont = FALSE; + m_bCheckFont = sal_False; #endif } //----------------------------------------------------------------------- diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index d58751330..5f971a4b4 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -1306,13 +1306,13 @@ namespace } // annonymous // ......................................................................... // ----------------------------------------------------------------------------- -::com::sun::star::util::URL createHelpAgentURL(const ::rtl::OUString& _sModuleName,const sal_Int32 _nHelpId) +::com::sun::star::util::URL createHelpAgentURL(const ::rtl::OUString& _sModuleName, const rtl::OString& sHelpId) { ::com::sun::star::util::URL aURL; aURL.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.help://" ) ); aURL.Complete += _sModuleName; aURL.Complete += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); - aURL.Complete += ::rtl::OUString::valueOf(_nHelpId); + aURL.Complete += ::rtl::OUString(sHelpId, sHelpId.getLength(), RTL_TEXTENCODING_UTF8); ::rtl::OUString sAnchor; ::rtl::OUString sTempURL = aURL.Complete; @@ -1451,7 +1451,7 @@ TOTypeInfoSP queryTypeInfoByType(sal_Int32 _nDataType,const OTypeInfoMap& _rType return pTypeInfo; } // ----------------------------------------------------------------------------- -sal_Int32 askForUserAction(Window* _pParent,USHORT _nTitle,USHORT _nText,sal_Bool _bAll,const ::rtl::OUString& _sName) +sal_Int32 askForUserAction(Window* _pParent,sal_uInt16 _nTitle,sal_uInt16 _nText,sal_Bool _bAll,const ::rtl::OUString& _sName) { SolarMutexGuard aGuard; String aMsg = String(ModuleRes(_nText)); diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx index 2fe4da761..1b02f94c6 100644 --- a/dbaccess/source/ui/misc/WCPage.cxx +++ b/dbaccess/source/ui/misc/WCPage.cxx @@ -82,7 +82,7 @@ OCopyTable::OCopyTable( Window * pParent ) ,m_edKeyName( this, ModuleRes( ET_KEYNAME ) ) ,m_pPage2(NULL) ,m_pPage3(NULL) - ,m_bUseHeaderAllowed(TRUE) + ,m_bUseHeaderAllowed(sal_True) { DBG_CTOR(OCopyTable,NULL); @@ -93,7 +93,7 @@ OCopyTable::OCopyTable( Window * pParent ) if ( !m_pParent->supportsViews() ) m_aRB_View.Disable(); - m_aCB_UseHeaderLine.Check(TRUE); + m_aCB_UseHeaderLine.Check(sal_True); m_bPKeyAllowed = m_pParent->supportsPrimaryKey(); m_aCB_PrimaryColumn.Enable(m_bPKeyAllowed); @@ -263,7 +263,7 @@ sal_Bool OCopyTable::LeavePage() void OCopyTable::ActivatePage() { DBG_CHKTHIS(OCopyTable,NULL); - m_pParent->GetOKButton().Enable( TRUE ); + m_pParent->GetOKButton().Enable( sal_True ); m_nOldOperation = m_pParent->getOperation(); m_edTableName.GrabFocus(); m_aCB_UseHeaderLine.Check(m_pParent->UseHeaderLine()); diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx index 44d2d8b52..bf3fd4d6c 100644 --- a/dbaccess/source/ui/misc/WColumnSelect.cxx +++ b/dbaccess/source/ui/misc/WColumnSelect.cxx @@ -147,7 +147,7 @@ void OWizColumnSelect::ActivatePage( ) ODatabaseExport::TColumnVector::const_iterator aEnd = pDestColumns->end(); for(;aIter != aEnd;++aIter) { - USHORT nPos = m_lbNewColumnNames.InsertEntry((*aIter)->first); + sal_uInt16 nPos = m_lbNewColumnNames.InsertEntry((*aIter)->first); m_lbNewColumnNames.SetEntryData(nPos,new OFieldDescription(*((*aIter)->second))); m_lbOrgColumnNames.RemoveEntry((*aIter)->first); } @@ -355,7 +355,7 @@ void OWizColumnSelect::moveColumn( ListBox* _pRight, OSL_ENSURE( aPos != pSrcVector->end(),"Invalid position for the iterator here!"); ODatabaseExport::TColumnVector::size_type nPos = (aPos - pSrcVector->begin()) - adjustColumnPosition(_pLeft, _sColumnName, (aPos - pSrcVector->begin()), _aCase); - _pRight->SetEntryData( _pRight->InsertEntry( (*aIter).first, sal::static_int_cast< USHORT >(nPos)),aSrcIter->second ); + _pRight->SetEntryData( _pRight->InsertEntry( (*aIter).first, sal::static_int_cast< sal_uInt16 >(nPos)),aSrcIter->second ); _rRightColumns.push_back((*aIter).first); m_pParent->removeColumnNameFromNameMap(_sColumnName); } @@ -366,12 +366,12 @@ void OWizColumnSelect::moveColumn( ListBox* _pRight, // not enough. We need to take into acccount what fields have // been removed earlier and adjust accordingly. Based on the // algorithm employed in moveColumn(). -USHORT OWizColumnSelect::adjustColumnPosition( ListBox* _pLeft, +sal_uInt16 OWizColumnSelect::adjustColumnPosition( ListBox* _pLeft, const ::rtl::OUString& _sColumnName, ODatabaseExport::TColumnVector::size_type nCurrentPos, const ::comphelper::TStringMixEqualFunctor& _aCase) { - USHORT nAdjustedPos = 0; + sal_uInt16 nAdjustedPos = 0; // if returning all entries to their original position, // then there is no need to adjust the positions. diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 67c218849..d10d3a419 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -73,8 +73,8 @@ OWizNameMatching::OWizNameMatching( Window* pParent) m_CTRL_RIGHT.SetSelectHdl(LINK(this,OWizNameMatching,TableListRightSelectHdl)); m_CTRL_RIGHT.EnableCheckButton( NULL ); - m_CTRL_LEFT.SetWindowBits( WB_FORCE_MAKEVISIBLE ); - m_CTRL_RIGHT.SetWindowBits( WB_FORCE_MAKEVISIBLE ); + m_CTRL_LEFT.SetStyle( m_CTRL_LEFT.GetStyle() | WB_FORCE_MAKEVISIBLE ); + m_CTRL_RIGHT.SetStyle( m_CTRL_RIGHT.GetStyle() | WB_FORCE_MAKEVISIBLE ); m_sSourceText = m_FT_TABLE_LEFT.GetText(); m_sSourceText.AppendAscii("\n"); @@ -258,7 +258,7 @@ IMPL_LINK( OWizNameMatching, TableListClickHdl, void*, /*NOTINTERESTEDIN*/ ) SvLBoxEntry* pEntry = m_CTRL_LEFT.FirstSelected(); if(pEntry) { - ULONG nPos = m_CTRL_LEFT.GetModel()->GetAbsPos(pEntry); + sal_uLong nPos = m_CTRL_LEFT.GetModel()->GetAbsPos(pEntry); SvLBoxEntry* pOldEntry = m_CTRL_RIGHT.FirstSelected(); if(pOldEntry && nPos != m_CTRL_RIGHT.GetModel()->GetAbsPos(pOldEntry)) { @@ -267,7 +267,7 @@ IMPL_LINK( OWizNameMatching, TableListClickHdl, void*, /*NOTINTERESTEDIN*/ ) pOldEntry = m_CTRL_RIGHT.GetEntry(nPos); if(pOldEntry) { - ULONG nNewPos = m_CTRL_LEFT.GetModel()->GetAbsPos(m_CTRL_LEFT.GetFirstEntryInView()); + sal_uLong nNewPos = m_CTRL_LEFT.GetModel()->GetAbsPos(m_CTRL_LEFT.GetFirstEntryInView()); if ( nNewPos - nPos == 1 ) --nNewPos; m_CTRL_RIGHT.MakeVisible(m_CTRL_RIGHT.GetEntry(nNewPos),sal_True); @@ -292,7 +292,7 @@ IMPL_LINK( OWizNameMatching, TableListRightSelectHdl, void*, /*NOTINTERESTEDIN*/ SvLBoxEntry* pEntry = m_CTRL_RIGHT.FirstSelected(); if(pEntry) { - ULONG nPos = m_CTRL_RIGHT.GetModel()->GetAbsPos(pEntry); + sal_uLong nPos = m_CTRL_RIGHT.GetModel()->GetAbsPos(pEntry); SvLBoxEntry* pOldEntry = m_CTRL_LEFT.FirstSelected(); if(pOldEntry && nPos != m_CTRL_LEFT.GetModel()->GetAbsPos(pOldEntry)) { @@ -301,7 +301,7 @@ IMPL_LINK( OWizNameMatching, TableListRightSelectHdl, void*, /*NOTINTERESTEDIN*/ pOldEntry = m_CTRL_LEFT.GetEntry(nPos); if(pOldEntry) { - ULONG nNewPos = m_CTRL_RIGHT.GetModel()->GetAbsPos(m_CTRL_RIGHT.GetFirstEntryInView()); + sal_uLong nNewPos = m_CTRL_RIGHT.GetModel()->GetAbsPos(m_CTRL_RIGHT.GetFirstEntryInView()); if ( nNewPos - nPos == 1 ) nNewPos--; m_CTRL_LEFT.MakeVisible(m_CTRL_LEFT.GetEntry(nNewPos),sal_True); @@ -366,7 +366,7 @@ OColumnTreeBox::OColumnTreeBox( Window* pParent, const ResId& rResId ) { SetDragDropMode( 0 ); EnableInplaceEditing( sal_False ); - SetWindowBits(WB_BORDER | WB_HASBUTTONS | WB_HSCROLL); + SetStyle(GetStyle() | WB_BORDER | WB_HASBUTTONS | WB_HSCROLL); SetSelectionMode( SINGLE_SELECTION ); } //------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index bf719b52d..c58942d7c 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -43,6 +43,8 @@ #include "sqlmessage.hxx" #include "FieldControls.hxx" +#include "dbaccess_slotid.hrc" + using namespace ::dbaui; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -128,8 +130,8 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId ) if ( getMetaData().is() && !getMetaData()->supportsMixedCaseQuotedIdentifiers() ) { bCase = sal_False; - USHORT nCount = aListBox.GetEntryCount(); - for (USHORT i=0 ; !bDoubleName && i < nCount ; ++i) + sal_uInt16 nCount = aListBox.GetEntryCount(); + for (sal_uInt16 i=0 ; !bDoubleName && i < nCount ; ++i) { ::rtl::OUString sEntry(aListBox.GetEntry(i)); bDoubleName = sNewName.equalsIgnoreAsciiCase(sEntry); @@ -330,7 +332,7 @@ void OWizTypeSelect::ActivatePage( ) Reset(); m_bFirstTime = bOldFirstTime; - m_lbColumnNames.SelectEntryPos(static_cast<USHORT>(m_nDisplayRow)); + m_lbColumnNames.SelectEntryPos(static_cast<sal_uInt16>(m_nDisplayRow)); m_nDisplayRow = 0; m_lbColumnNames.GetSelectHdl().Call(&m_lbColumnNames); } diff --git a/dbaccess/source/ui/misc/WizardPages.src b/dbaccess/source/ui/misc/WizardPages.src index 39e7fbe06..9910a99d9 100644 --- a/dbaccess/source/ui/misc/WizardPages.src +++ b/dbaccess/source/ui/misc/WizardPages.src @@ -35,6 +35,7 @@ #include "dbaccess_helpid.hrc" #endif +#include "dbaccess_slotid.hrc" #define WINDOW_SIZE_X 276 #define WINDOW_SIZE_Y 185 @@ -67,6 +68,7 @@ String STR_WIZ_NAME_MATCHING_TITEL ModalDialog WIZ_RTFCOPYTABLE { + HelpID = "dbaccess:ModalDialog:WIZ_RTFCOPYTABLE"; Text [ en-US ] = "Copy RTF Table" ; @@ -90,12 +92,14 @@ ModalDialog WIZ_RTFCOPYTABLE }; PushButton PB_PREV { + HelpID = "dbaccess:PushButton:WIZ_RTFCOPYTABLE:PB_PREV"; TabStop = TRUE ; Size = MAP_APPFONT ( BUTTON_SIZE_X , BUTTON_SIZE_Y ) ; Text [ en-US ] = "< ~Back"; }; PushButton PB_NEXT { + HelpID = "dbaccess:PushButton:WIZ_RTFCOPYTABLE:PB_NEXT"; TabStop = TRUE ; Size = MAP_APPFONT ( BUTTON_SIZE_X , BUTTON_SIZE_Y ) ; Text [ en-US ] = "~Next>"; @@ -128,6 +132,7 @@ TabPage TAB_WIZ_COLUMN_SELECT }; MultiListBox LB_ORG_COLUMN_NAMES { + HelpID = "dbaccess:MultiListBox:TAB_WIZ_COLUMN_SELECT:LB_ORG_COLUMN_NAMES"; Border = TRUE ; Pos = MAP_APPFONT ( WINDOW_BORDER_X , WINDOW_BORDER_Y ) ; Size = MAP_APPFONT ( 95 , WINDOW_SIZE_Y - 23 ) ; @@ -140,6 +145,7 @@ TabPage TAB_WIZ_COLUMN_SELECT }; ImageButton IB_COLUMN_RH { + HelpID = "dbaccess:ImageButton:TAB_WIZ_COLUMN_SELECT:IB_COLUMN_RH"; Pos = MAP_APPFONT ( WINDOW_BORDER_X + 116 , WINDOW_BORDER_Y + 25 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; @@ -159,6 +165,7 @@ TabPage TAB_WIZ_COLUMN_SELECT }; ImageButton IB_COLUMNS_RH { + HelpID = "dbaccess:ImageButton:TAB_WIZ_COLUMN_SELECT:IB_COLUMNS_RH"; Pos = MAP_APPFONT ( WINDOW_BORDER_X + 116 , WINDOW_BORDER_Y + 45 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE; @@ -179,6 +186,7 @@ TabPage TAB_WIZ_COLUMN_SELECT }; ImageButton IB_COLUMN_LH { + HelpID = "dbaccess:ImageButton:TAB_WIZ_COLUMN_SELECT:IB_COLUMN_LH"; Pos = MAP_APPFONT ( WINDOW_BORDER_X + 116 , WINDOW_BORDER_Y + 65) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; @@ -198,6 +206,7 @@ TabPage TAB_WIZ_COLUMN_SELECT }; ImageButton IB_COLUMNS_LH { + HelpID = "dbaccess:ImageButton:TAB_WIZ_COLUMN_SELECT:IB_COLUMNS_LH"; Pos = MAP_APPFONT ( WINDOW_BORDER_X + 116 , WINDOW_BORDER_Y + 85) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; @@ -218,6 +227,7 @@ TabPage TAB_WIZ_COLUMN_SELECT MultiListBox LB_NEW_COLUMN_NAMES { + HelpID = "dbaccess:MultiListBox:TAB_WIZ_COLUMN_SELECT:LB_NEW_COLUMN_NAMES"; Border = TRUE ; Pos = MAP_APPFONT ( WINDOW_BORDER_X + 157, WINDOW_BORDER_Y) ; Size = MAP_APPFONT ( 95 , WINDOW_SIZE_Y - 23 ) ; @@ -243,6 +253,7 @@ TabPage TAB_WIZ_TYPE_SELECT MultiListBox LB_NEW_COLUMN_NAMES { + HelpID = "dbaccess:MultiListBox:TAB_WIZ_TYPE_SELECT:LB_NEW_COLUMN_NAMES"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 87 , WINDOW_SIZE_Y - 12 ) ; @@ -262,6 +273,7 @@ TabPage TAB_WIZ_TYPE_SELECT TabPage CONTROL_CONTAINER { + HelpID = "dbaccess:TabPage:CONTROL_CONTAINER"; Pos = MAP_APPFONT ( 102 , WINDOW_BORDER_Y ) ; Size = MAP_APPFONT ( WINDOW_SIZE_X - 111, WINDOW_SIZE_Y - WINDOW_BORDER_Y - 67 ); SVLook = TRUE; @@ -284,6 +296,7 @@ TabPage TAB_WIZ_TYPE_SELECT NumericField ET_AUTO { + HelpID = "dbaccess:NumericField:TAB_WIZ_TYPE_SELECT:ET_AUTO"; Border = TRUE ; Pos = MAP_APPFONT ( 151 , WINDOW_SIZE_Y - WINDOW_BORDER_Y - 29) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -292,6 +305,7 @@ TabPage TAB_WIZ_TYPE_SELECT PushButton PB_AUTO { + HelpID = "dbaccess:PushButton:TAB_WIZ_TYPE_SELECT:PB_AUTO"; Pos = MAP_APPFONT ( WINDOW_SIZE_X - 62 , WINDOW_SIZE_Y - WINDOW_BORDER_Y - 30 ) ; Size = MAP_APPFONT ( BUTTON_SIZE_X , BUTTON_SIZE_Y ) ; TabStop = TRUE ; @@ -306,7 +320,7 @@ Menu RID_SBA_RTF_PKEYPOPUP MenuItem { Identifier = SID_TABLEDESIGN_TABED_PRIMARYKEY ; - HelpID = SID_TABLEDESIGN_TABED_PRIMARYKEY ; + HelpID = HID_TABLEDESIGN_TABED_PRIMARYKEY ; Checkable = TRUE ; Text [ en-US ] = "Primary Key" ; }; @@ -318,6 +332,7 @@ Menu RID_SBA_RTF_PKEYPOPUP //================================================================== TabPage TAB_WIZ_NAME_MATCHING { + HelpID = "dbaccess:TabPage:TAB_WIZ_NAME_MATCHING"; SVLook = TRUE ; Size = MAP_APPFONT ( WINDOW_SIZE_X , WINDOW_SIZE_Y ) ; @@ -359,6 +374,7 @@ TabPage TAB_WIZ_NAME_MATCHING ImageButton IB_COLUMN_UP { + HelpID = "dbaccess:ImageButton:TAB_WIZ_NAME_MATCHING:IB_COLUMN_UP"; Pos = MAP_APPFONT ( 19 , 45 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE; @@ -379,6 +395,7 @@ TabPage TAB_WIZ_NAME_MATCHING }; ImageButton IB_COLUMN_DOWN { + HelpID = "dbaccess:ImageButton:TAB_WIZ_NAME_MATCHING:IB_COLUMN_DOWN"; Pos = MAP_APPFONT ( 19 , 63 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE; @@ -398,6 +415,7 @@ TabPage TAB_WIZ_NAME_MATCHING }; ImageButton IB_COLUMN_UP_RIGHT { + HelpID = "dbaccess:ImageButton:TAB_WIZ_NAME_MATCHING:IB_COLUMN_UP_RIGHT"; Pos = MAP_APPFONT ( WINDOW_SIZE_X - 33, 45 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE; @@ -418,6 +436,7 @@ TabPage TAB_WIZ_NAME_MATCHING }; ImageButton IB_COLUMN_DOWN_RIGHT { + HelpID = "dbaccess:ImageButton:TAB_WIZ_NAME_MATCHING:IB_COLUMN_DOWN_RIGHT"; Pos = MAP_APPFONT ( WINDOW_SIZE_X - 33, 63) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE ; @@ -438,6 +457,7 @@ TabPage TAB_WIZ_NAME_MATCHING PushButton PB_ALL { + HelpID = "dbaccess:PushButton:TAB_WIZ_NAME_MATCHING:PB_ALL"; Pos = MAP_APPFONT ( 6, 83) ; Size = MAP_APPFONT ( 40 , 14 ) ; TabStop = TRUE ; @@ -446,6 +466,7 @@ TabPage TAB_WIZ_NAME_MATCHING PushButton PB_NONE { + HelpID = "dbaccess:PushButton:TAB_WIZ_NAME_MATCHING:PB_NONE"; Pos = MAP_APPFONT ( 6, 103) ; Size = MAP_APPFONT ( 40 , 14 ) ; TabStop = TRUE ; @@ -485,12 +506,14 @@ TabPage TAB_WIZ_COPYTABLE }; RadioButton RB_DEFDATA { + HelpID = "dbaccess:RadioButton:TAB_WIZ_COPYTABLE:RB_DEFDATA"; Pos = MAP_APPFONT ( 12 , 35 ) ; Size = MAP_APPFONT ( 73 , 10 ) ; Text [ en-US ] = "De~finition and data" ; }; RadioButton RB_DEF { + HelpID = "dbaccess:RadioButton:TAB_WIZ_COPYTABLE:RB_DEF"; Pos = MAP_APPFONT ( 12, 49 ) ; Size = MAP_APPFONT ( 73 , 10 ) ; Text [ en-US ] = "Def~inition" ; @@ -498,6 +521,7 @@ TabPage TAB_WIZ_COPYTABLE RadioButton RB_VIEW { + HelpID = "dbaccess:RadioButton:TAB_WIZ_COPYTABLE:RB_VIEW"; Pos = MAP_APPFONT ( 12, 63 ) ; Size = MAP_APPFONT ( 73 , 10 ) ; Text [ en-US ] = "A~s table view"; @@ -505,6 +529,7 @@ TabPage TAB_WIZ_COPYTABLE RadioButton RB_APPENDDATA { + HelpID = "dbaccess:RadioButton:TAB_WIZ_COPYTABLE:RB_APPENDDATA"; Pos = MAP_APPFONT ( 12, 77 ) ; Size = MAP_APPFONT ( 73 , 10 ) ; Text [ en-US ] = "Append ~data" ; @@ -512,6 +537,7 @@ TabPage TAB_WIZ_COPYTABLE CheckBox CB_USEHEADERLINE { + HelpID = "dbaccess:CheckBox:TAB_WIZ_COPYTABLE:CB_USEHEADERLINE"; Pos = MAP_APPFONT ( 12, 93 ) ; Size = MAP_APPFONT ( WINDOW_SIZE_X - 18, 10 ) ; Text [ en-US ] = "Use first ~line as column names" ; @@ -519,6 +545,7 @@ TabPage TAB_WIZ_COPYTABLE CheckBox CB_PRIMARY_COLUMN { + HelpID = "dbaccess:CheckBox:TAB_WIZ_COPYTABLE:CB_PRIMARY_COLUMN"; Pos = MAP_APPFONT ( 12, 107 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; Text [ en-US ] = "Crea~te primary key"; @@ -532,6 +559,7 @@ TabPage TAB_WIZ_COPYTABLE Edit ET_KEYNAME { + HelpID = "dbaccess:Edit:TAB_WIZ_COPYTABLE:ET_KEYNAME"; Pos = MAP_APPFONT ( 80, 120 ) ; Size = MAP_APPFONT ( 65 , 12 ) ; TabStop = TRUE ; diff --git a/dbaccess/source/ui/misc/dbaundomanager.cxx b/dbaccess/source/ui/misc/dbaundomanager.cxx new file mode 100755 index 000000000..a6a820fd8 --- /dev/null +++ b/dbaccess/source/ui/misc/dbaundomanager.cxx @@ -0,0 +1,395 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_dbaccess.hxx" + +#include "dbaundomanager.hxx" + +/** === begin UNO includes === **/ +#include <com/sun/star/lang/DisposedException.hpp> +/** === end UNO includes === **/ + +#include <svl/undo.hxx> +#include <vcl/svapp.hxx> +#include <vos/mutex.hxx> +#include <framework/undomanagerhelper.hxx> + +//...................................................................................................................... +namespace dbaui +{ +//...................................................................................................................... + + /** === begin UNO using === **/ + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + 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::uno::makeAny; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Type; + using ::com::sun::star::document::XUndoManager; + using ::com::sun::star::lang::DisposedException; + using ::com::sun::star::document::UndoContextNotClosedException; + using ::com::sun::star::document::UndoFailedException; + using ::com::sun::star::document::EmptyUndoStackException; + using ::com::sun::star::util::InvalidStateException; + using ::com::sun::star::document::XUndoAction; + using ::com::sun::star::lang::IllegalArgumentException; + using ::com::sun::star::document::XUndoManagerListener; + using ::com::sun::star::util::NotLockedException; + using ::com::sun::star::lang::NoSupportException; + /** === end UNO using === **/ + + //================================================================================================================== + //= UndoManager_Impl + //================================================================================================================== + struct UndoManager_Impl : public ::framework::IUndoManagerImplementation + { + UndoManager_Impl( UndoManager& i_antiImpl, ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ) + :rAntiImpl( i_antiImpl ) + ,rParent( i_parent ) + ,rMutex( i_mutex ) + ,bDisposed( false ) + ,aUndoManager() + ,aUndoHelper( *this ) + { + } + + virtual ~UndoManager_Impl() + { + } + + UndoManager& rAntiImpl; + ::cppu::OWeakObject& rParent; + ::osl::Mutex& rMutex; + bool bDisposed; + SfxUndoManager aUndoManager; + ::framework::UndoManagerHelper aUndoHelper; + + // IUndoManagerImplementation + virtual ::svl::IUndoManager& getImplUndoManager(); + virtual Reference< XUndoManager > getThis(); + }; + + //------------------------------------------------------------------------------------------------------------------ + ::svl::IUndoManager& UndoManager_Impl::getImplUndoManager() + { + return aUndoManager; + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XUndoManager > UndoManager_Impl::getThis() + { + return static_cast< XUndoManager* >( &rAntiImpl ); + } + + //============================================================================================================== + //= OslMutexFacade + //============================================================================================================== + class OslMutexFacade : public ::framework::IMutex + { + public: + OslMutexFacade( ::osl::Mutex& i_mutex ) + :m_rMutex( i_mutex ) + { + } + + virtual void acquire(); + virtual void release(); + + private: + ::osl::Mutex& m_rMutex; + }; + + //-------------------------------------------------------------------------------------------------------------- + void OslMutexFacade::acquire() + { + m_rMutex.acquire(); + } + + //-------------------------------------------------------------------------------------------------------------- + void OslMutexFacade::release() + { + m_rMutex.release(); + } + + //============================================================================================================== + //= UndoManagerMethodGuard + //============================================================================================================== + /** guard for public UNO methods of the UndoManager + */ + class UndoManagerMethodGuard : public ::framework::IMutexGuard + { + public: + UndoManagerMethodGuard( UndoManager_Impl& i_impl ) + :m_aGuard( i_impl.rMutex ) + ,m_aMutexFacade( i_impl.rMutex ) + { + // throw if the instance is already disposed + if ( i_impl.bDisposed ) + throw DisposedException( ::rtl::OUString(), i_impl.getThis() ); + } + virtual ~UndoManagerMethodGuard() + { + } + + // IMutexGuard + virtual ::framework::IMutex& getGuardedMutex(); + + // IGuard + virtual void clear(); + virtual void reset(); + + private: + ::osl::ResettableMutexGuard m_aGuard; + OslMutexFacade m_aMutexFacade; + }; + + //-------------------------------------------------------------------------------------------------------------- + ::framework::IMutex& UndoManagerMethodGuard::getGuardedMutex() + { + return m_aMutexFacade; + } + + //-------------------------------------------------------------------------------------------------------------- + void UndoManagerMethodGuard::clear() + { + m_aGuard.clear(); + } + + //-------------------------------------------------------------------------------------------------------------- + void UndoManagerMethodGuard::reset() + { + m_aGuard.reset(); + } + + //================================================================================================================== + //= UndoManager + //================================================================================================================== + //------------------------------------------------------------------------------------------------------------------ + UndoManager::UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ) + :m_pImpl( new UndoManager_Impl( *this, i_parent, i_mutex ) ) + { + } + + //------------------------------------------------------------------------------------------------------------------ + UndoManager::~UndoManager() + { + } + + //------------------------------------------------------------------------------------------------------------------ + SfxUndoManager& UndoManager::GetSfxUndoManager() const + { + return m_pImpl->aUndoManager; + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::acquire( ) throw () + { + m_pImpl->rParent.acquire(); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::release( ) throw () + { + m_pImpl->rParent.release(); + } + + //------------------------------------------------------------------------------------------------------------------ + void UndoManager::disposing() + { + { + ::osl::MutexGuard aGuard( m_pImpl->rMutex ); + m_pImpl->bDisposed = true; + } + m_pImpl->aUndoHelper.disposing(); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::enterUndoContext( const ::rtl::OUString& i_title ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.enterUndoContext( i_title, aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::enterHiddenUndoContext( ) throw (EmptyUndoStackException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.enterHiddenUndoContext( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::leaveUndoContext( ) throw (InvalidStateException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.leaveUndoContext( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::addUndoAction( const Reference< XUndoAction >& i_action ) throw (IllegalArgumentException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.addUndoAction( i_action, aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::undo( ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException) + { + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + // (all our UndoActions work directly on VCL code, usually, so ...) + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.undo( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::redo( ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException) + { + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + // (all our UndoActions work directly on VCL code, usually, so ...) + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.redo( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Bool SAL_CALL UndoManager::isUndoPossible( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.isUndoPossible(); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Bool SAL_CALL UndoManager::isRedoPossible( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.isRedoPossible(); + } + + //------------------------------------------------------------------------------------------------------------------ + ::rtl::OUString SAL_CALL UndoManager::getCurrentUndoActionTitle( ) throw (EmptyUndoStackException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.getCurrentUndoActionTitle(); + } + + //------------------------------------------------------------------------------------------------------------------ + ::rtl::OUString SAL_CALL UndoManager::getCurrentRedoActionTitle( ) throw (EmptyUndoStackException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.getCurrentRedoActionTitle(); + } + + //------------------------------------------------------------------------------------------------------------------ + Sequence< ::rtl::OUString > SAL_CALL UndoManager::getAllUndoActionTitles( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.getAllUndoActionTitles(); + } + + //------------------------------------------------------------------------------------------------------------------ + Sequence< ::rtl::OUString > SAL_CALL UndoManager::getAllRedoActionTitles( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.getAllRedoActionTitles(); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::clear( ) throw (UndoContextNotClosedException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.clear( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::clearRedo( ) throw (UndoContextNotClosedException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.clearRedo( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::reset( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.reset( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::addUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.addUndoManagerListener( i_listener ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::removeUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.removeUndoManagerListener( i_listener ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::lock( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.lock(); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::unlock( ) throw (NotLockedException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.unlock(); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Bool SAL_CALL UndoManager::isLocked( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.isLocked(); + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XInterface > SAL_CALL UndoManager::getParent( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return *&m_pImpl->rParent; + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::setParent( const Reference< XInterface >& i_parent ) throw (NoSupportException, RuntimeException) + { + (void)i_parent; + throw NoSupportException( ::rtl::OUString(), m_pImpl->getThis() ); + } + +//...................................................................................................................... +} // namespace dbaui +//...................................................................................................................... diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx new file mode 100644 index 000000000..546ae737d --- /dev/null +++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx @@ -0,0 +1,672 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_dbaccess.hxx" + +#include "browserids.hxx" +#include "commontypes.hxx" +#include "dataview.hxx" +#include "dbu_misc.hrc" +#include "dbustrings.hrc" +#include "moduledbu.hxx" +#include "dbsubcomponentcontroller.hxx" + +/** === begin UNO includes === **/ +#include <com/sun/star/frame/XUntitledNumbers.hpp> +#include <com/sun/star/beans/PropertyAttribute.hpp> +#include <com/sun/star/container/XChild.hpp> +#include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/sdb/XDocumentDataSource.hpp> +#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> +#include <com/sun/star/sdbc/XDataSource.hpp> +#include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <com/sun/star/frame/XUntitledNumbers.hpp> +/** === end UNO includes === **/ + +#include <comphelper/sequence.hxx> +#include <comphelper/types.hxx> +#include <connectivity/dbexception.hxx> +#include <connectivity/dbtools.hxx> +#include <cppuhelper/typeprovider.hxx> +#include <rtl/ustrbuf.hxx> +#include <toolkit/unohlp.hxx> +#include <tools/debug.hxx> +#include <tools/diagnose_ex.h> +#include <vcl/msgbox.hxx> + +//........................................................................ +namespace dbaui +{ +//........................................................................ + + /** === begin UNO using === **/ + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::Reference; + using ::com::sun::star::beans::XPropertySet; + using ::com::sun::star::util::XNumberFormatter; + using ::com::sun::star::lang::XMultiServiceFactory; + using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Type; + using ::com::sun::star::sdbc::XConnection; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::container::XChild; + using ::com::sun::star::sdbc::XDataSource; + using ::com::sun::star::util::XNumberFormatter; + using ::com::sun::star::util::XNumberFormatsSupplier; + using ::com::sun::star::frame::XFrame; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::sdbc::SQLException; + using ::com::sun::star::lang::EventObject; + using ::com::sun::star::beans::PropertyValue; + using ::com::sun::star::frame::XModel; + using ::com::sun::star::sdb::XOfficeDatabaseDocument; + using ::com::sun::star::awt::XWindow; + using ::com::sun::star::sdbc::XDatabaseMetaData; + using ::com::sun::star::sdb::XDocumentDataSource; + using ::com::sun::star::document::XEmbeddedScripts; + using ::com::sun::star::lang::IllegalArgumentException; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::frame::XUntitledNumbers; + using ::com::sun::star::beans::PropertyVetoException; + /** === end UNO using === **/ + + class DataSourceHolder + { + public: + DataSourceHolder() + { + } + + DataSourceHolder( const Reference< XDataSource >& _rxDataSource ) + { + m_xDataSource = _rxDataSource; + Reference< XDocumentDataSource > xDocDS( m_xDataSource, UNO_QUERY ); + if ( xDocDS.is() ) + m_xDocument = xDocDS->getDatabaseDocument(); + + m_xDataSourceProps.set( m_xDataSource, UNO_QUERY ); + } + + const Reference< XDataSource >& getDataSource() const { return m_xDataSource; } + const Reference< XPropertySet >& getDataSourceProps() const { return m_xDataSourceProps; } + const Reference< XOfficeDatabaseDocument > getDatabaseDocument() const { return m_xDocument; } + + bool is() const { return m_xDataSource.is(); } + + void clear() + { + m_xDataSource.clear(); + m_xDocument.clear(); + } + + private: + Reference< XDataSource > m_xDataSource; + Reference< XPropertySet > m_xDataSourceProps; + Reference< XOfficeDatabaseDocument > m_xDocument; + }; + + struct DBSubComponentController_Impl + { + private: + ::boost::optional< bool > m_aDocScriptSupport; + + public: + OModuleClient m_aModuleClient; + ::dbtools::SQLExceptionInfo m_aCurrentError; + + ::cppu::OInterfaceContainerHelper + m_aModifyListeners; + + // <properties> + SharedConnection m_xConnection; + ::dbtools::DatabaseMetaData m_aSdbMetaData; + // </properties> + ::rtl::OUString m_sDataSourceName; // the data source we're working for + DataSourceHolder m_aDataSource; + Reference< XModel > m_xDocument; + Reference< XNumberFormatter > m_xFormatter; // a number formatter working with the connection's NumberFormatsSupplier + sal_Int32 m_nDocStartNumber; + sal_Bool m_bSuspended; // is true when the controller was already suspended + sal_Bool m_bEditable; // is the control readonly or not + sal_Bool m_bModified; // is the data modified + bool m_bNotAttached; + + DBSubComponentController_Impl( ::osl::Mutex& i_rMutex ) + :m_aDocScriptSupport() + ,m_aModifyListeners( i_rMutex ) + ,m_nDocStartNumber(0) + ,m_bSuspended( sal_False ) + ,m_bEditable(sal_True) + ,m_bModified(sal_False) + ,m_bNotAttached(true) + { + } + + bool documentHasScriptSupport() const + { + OSL_PRECOND( !!m_aDocScriptSupport, + "DBSubComponentController_Impl::documentHasScriptSupport: not completely initialized, yet - don't know!?" ); + return !!m_aDocScriptSupport && *m_aDocScriptSupport; + } + + void setDocumentScriptSupport( const bool _bSupport ) + { + OSL_PRECOND( !m_aDocScriptSupport, + "DBSubComponentController_Impl::setDocumentScriptSupport: already initialized!" ); + m_aDocScriptSupport = ::boost::optional< bool >( _bSupport ); + } + }; + + //==================================================================== + //= DBSubComponentController + //==================================================================== + //-------------------------------------------------------------------- + DBSubComponentController::DBSubComponentController(const Reference< XMultiServiceFactory >& _rxORB) + :DBSubComponentController_Base( _rxORB ) + ,m_pImpl( new DBSubComponentController_Impl( getMutex() ) ) + { + } + + //-------------------------------------------------------------------- + DBSubComponentController::~DBSubComponentController() + { + } + + //-------------------------------------------------------------------- + void DBSubComponentController::impl_initialize() + { + OGenericUnoController::impl_initialize(); + + const ::comphelper::NamedValueCollection& rArguments( getInitParams() ); + + Reference< XConnection > xConnection; + xConnection = rArguments.getOrDefault( (::rtl::OUString)PROPERTY_ACTIVE_CONNECTION, xConnection ); + + if ( !xConnection.is() ) + ::dbtools::isEmbeddedInDatabase( getModel(), xConnection ); + + if ( xConnection.is() ) + initializeConnection( xConnection ); + + bool bShowError = true; + if ( !isConnected() ) + { + reconnect( sal_False ); + bShowError = false; + } + if ( !isConnected() ) + { + if ( bShowError ) + connectionLostMessage(); + throw IllegalArgumentException(); + } + } + + //-------------------------------------------------------------------- + Any SAL_CALL DBSubComponentController::queryInterface(const Type& _rType) throw (RuntimeException) + { + if ( _rType.equals( XScriptInvocationContext::static_type() ) ) + { + if ( m_pImpl->documentHasScriptSupport() ) + return makeAny( Reference< XScriptInvocationContext >( this ) ); + return Any(); + } + + return DBSubComponentController_Base::queryInterface( _rType ); + } + + //-------------------------------------------------------------------- + Sequence< Type > SAL_CALL DBSubComponentController::getTypes( ) throw (RuntimeException) + { + Sequence< Type > aTypes( DBSubComponentController_Base::getTypes() ); + if ( !m_pImpl->documentHasScriptSupport() ) + { + Sequence< Type > aStrippedTypes( aTypes.getLength() - 1 ); + ::std::remove_copy_if( + aTypes.getConstArray(), + aTypes.getConstArray() + aTypes.getLength(), + aStrippedTypes.getArray(), + ::std::bind2nd( ::std::equal_to< Type >(), XScriptInvocationContext::static_type() ) + ); + aTypes = aStrippedTypes; + } + return aTypes; + } + + //-------------------------------------------------------------------- + void DBSubComponentController::initializeConnection( const Reference< XConnection >& _rxForeignConn ) + { + DBG_ASSERT( !isConnected(), "DBSubComponentController::initializeConnection: not to be called when already connected!" ); + // usually this gets called from within initialize of derived classes ... + if ( isConnected() ) + disconnect(); + + m_pImpl->m_xConnection.reset( _rxForeignConn, SharedConnection::NoTakeOwnership ); + m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection ); + startConnectionListening( m_pImpl->m_xConnection ); + + // get the data source the connection belongs to + try + { + // determine our data source + OSL_PRECOND( !m_pImpl->m_aDataSource.is(), "DBSubComponentController::initializeConnection: already a data source in this phase?" ); + { + Reference< XChild > xConnAsChild( m_pImpl->m_xConnection, UNO_QUERY ); + Reference< XDataSource > xDS; + if ( xConnAsChild.is() ) + xDS = Reference< XDataSource >( xConnAsChild->getParent(), UNO_QUERY ); + + // (take the indirection through XDataSource to ensure we have a correct object ....) + m_pImpl->m_aDataSource = xDS; + } + OSL_POSTCOND( m_pImpl->m_aDataSource.is(), "DBSubComponentController::initializeConnection: unable to obtain the data source object!" ); + + if ( m_pImpl->m_bNotAttached ) + { + Reference< XUntitledNumbers > xUntitledProvider( getDatabaseDocument(), UNO_QUERY ); + m_pImpl->m_nDocStartNumber = 1; + if ( xUntitledProvider.is() ) + m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) ); + } + + // determine the availability of script support in our document. Our own XScriptInvocationContext + // interface depends on this + m_pImpl->setDocumentScriptSupport( Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY ).is() ); + + // get a number formatter + Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps(), UNO_SET_THROW ); + xDataSourceProps->getPropertyValue( PROPERTY_NAME ) >>= m_pImpl->m_sDataSourceName; + DBG_ASSERT( m_pImpl->m_sDataSourceName.getLength(), "DBSubComponentController::initializeConnection: invalid data source name!" ); + Reference< XNumberFormatsSupplier> xSupplier = ::dbtools::getNumberFormats(m_pImpl->m_xConnection); + if(xSupplier.is()) + { + m_pImpl->m_xFormatter = Reference< XNumberFormatter >(getORB() + ->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatter")), UNO_QUERY); + m_pImpl->m_xFormatter->attachNumberFormatsSupplier(xSupplier); + } + OSL_ENSURE(m_pImpl->m_xFormatter.is(),"No NumberFormatter!"); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + + //-------------------------------------------------------------------- + void DBSubComponentController::reconnect( sal_Bool _bUI ) + { + OSL_ENSURE(!m_pImpl->m_bSuspended, "Cannot reconnect while suspended!"); + + stopConnectionListening( m_pImpl->m_xConnection ); + m_pImpl->m_aSdbMetaData.reset( NULL ); + m_pImpl->m_xConnection.clear(); + + // reconnect + sal_Bool bReConnect = sal_True; + if ( _bUI ) + { + QueryBox aQuery( getView(), ModuleRes(QUERY_CONNECTION_LOST) ); + bReConnect = ( RET_YES == aQuery.Execute() ); + } + + // now really reconnect ... + if ( bReConnect ) + { + m_pImpl->m_xConnection.reset( connect( m_pImpl->m_aDataSource.getDataSource(), NULL ), SharedConnection::TakeOwnership ); + m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection ); + } + + // invalidate all slots + InvalidateAll(); + } + + //-------------------------------------------------------------------- + void DBSubComponentController::disconnect() + { + stopConnectionListening(m_pImpl->m_xConnection); + m_pImpl->m_aSdbMetaData.reset( NULL ); + m_pImpl->m_xConnection.clear(); + + InvalidateAll(); + } + + //-------------------------------------------------------------------- + void DBSubComponentController::losingConnection() + { + // our connection was disposed so we need a new one + reconnect( sal_True ); + InvalidateAll(); + } + + //-------------------------------------------------------------------- + void SAL_CALL DBSubComponentController::disposing() + { + DBSubComponentController_Base::disposing(); + + disconnect(); + + attachFrame( Reference < XFrame >() ); + + m_pImpl->m_aDataSource.clear(); + } + + //-------------------------------------------------------------------- + void SAL_CALL DBSubComponentController::disposing(const EventObject& _rSource) throw( RuntimeException ) + { + if ( _rSource.Source == getConnection() ) + { + if ( !m_pImpl->m_bSuspended // when already suspended then we don't have to reconnect + && !getBroadcastHelper().bInDispose + && !getBroadcastHelper().bDisposed + && isConnected() + ) + { + losingConnection(); + } + else + { + m_pImpl->m_xConnection.reset( m_pImpl->m_xConnection, SharedConnection::NoTakeOwnership ); + // this prevents the "disposeComponent" call in disconnect + disconnect(); + } + } + else + DBSubComponentController_Base::disposing( _rSource ); + } + + //-------------------------------------------------------------------- + void DBSubComponentController::appendError( const ::rtl::OUString& _rErrorMessage, const ::dbtools::StandardSQLState _eSQLState, + const sal_Int32 _nErrorCode ) + { + m_pImpl->m_aCurrentError.append( ::dbtools::SQLExceptionInfo::SQL_EXCEPTION, _rErrorMessage, getStandardSQLStateAscii( _eSQLState ), + _nErrorCode ); + } + //-------------------------------------------------------------------- + void DBSubComponentController::clearError() + { + m_pImpl->m_aCurrentError = ::dbtools::SQLExceptionInfo(); + } + + //-------------------------------------------------------------------- + sal_Bool DBSubComponentController::hasError() const + { + return m_pImpl->m_aCurrentError.isValid(); + } + + //-------------------------------------------------------------------- + const ::dbtools::SQLExceptionInfo& DBSubComponentController::getError() const + { + return m_pImpl->m_aCurrentError; + } + + //-------------------------------------------------------------------- + void DBSubComponentController::displayError() + { + showError( m_pImpl->m_aCurrentError ); + } + + //-------------------------------------------------------------------- + sal_Bool SAL_CALL DBSubComponentController::suspend(sal_Bool bSuspend) throw( RuntimeException ) + { + m_pImpl->m_bSuspended = bSuspend; + if ( !bSuspend && !isConnected() ) + reconnect(sal_True); + + + return sal_True; + } + + // ----------------------------------------------------------------------------- + sal_Bool SAL_CALL DBSubComponentController::attachModel( const Reference< XModel > & _rxModel) throw( RuntimeException ) + { + if ( !_rxModel.is() ) + return sal_False; + if ( !DBSubComponentController_Base::attachModel( _rxModel ) ) + return sal_False; + + m_pImpl->m_bNotAttached = false; + if ( m_pImpl->m_nDocStartNumber == 1 ) + releaseNumberForComponent(); + + Reference< XUntitledNumbers > xUntitledProvider( _rxModel, UNO_QUERY ); + m_pImpl->m_nDocStartNumber = 1; + if ( xUntitledProvider.is() ) + m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) ); + + return sal_True; + } + + // ----------------------------------------------------------------------------- + void DBSubComponentController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& _rArgs) + { + if ( _nId == ID_BROWSER_CLOSE ) + { + closeTask(); + return; + } + + DBSubComponentController_Base::Execute( _nId, _rArgs ); + InvalidateFeature( _nId ); + } + + // ----------------------------------------------------------------------------- + ::rtl::OUString DBSubComponentController::getDataSourceName() const + { + ::rtl::OUString sName; + Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps() ); + if ( xDataSourceProps.is() ) + xDataSourceProps->getPropertyValue(PROPERTY_NAME) >>= sName; + return sName; + } + // ----------------------------------------------------------------------------- + void DBSubComponentController::connectionLostMessage() const + { + String aMessage(ModuleRes(RID_STR_CONNECTION_LOST)); + Reference< XWindow > xWindow = getTopMostContainerWindow(); + Window* pWin = NULL; + if ( xWindow.is() ) + pWin = VCLUnoHelper::GetWindow(xWindow); + if ( !pWin ) + pWin = getView()->Window::GetParent(); + + InfoBox(pWin, aMessage).Execute(); + } + // ----------------------------------------------------------------------------- + const Reference< XConnection >& DBSubComponentController::getConnection() const + { + return m_pImpl->m_xConnection; + } + + // ----------------------------------------------------------------------------- + sal_Bool DBSubComponentController::isReadOnly() const + { + return !m_pImpl->m_bEditable; + } + + // ----------------------------------------------------------------------------- + sal_Bool DBSubComponentController::isEditable() const + { + return m_pImpl->m_bEditable; + } + + // ----------------------------------------------------------------------------- + void DBSubComponentController::setEditable(sal_Bool _bEditable) + { + m_pImpl->m_bEditable = _bEditable; + } + + // ----------------------------------------------------------------------------- + const ::dbtools::DatabaseMetaData& DBSubComponentController::getSdbMetaData() const + { + return m_pImpl->m_aSdbMetaData; + } + + // ----------------------------------------------------------------------------- + sal_Bool DBSubComponentController::isConnected() const + { + return m_pImpl->m_xConnection.is(); + } + + // ----------------------------------------------------------------------------- + Reference< XDatabaseMetaData > DBSubComponentController::getMetaData( ) const + { + Reference< XDatabaseMetaData > xMeta; + try + { + if ( isConnected() ) + xMeta.set( m_pImpl->m_xConnection->getMetaData(), UNO_SET_THROW ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return xMeta; + } + + // ----------------------------------------------------------------------------- + const Reference< XPropertySet >& DBSubComponentController::getDataSource() const + { + return m_pImpl->m_aDataSource.getDataSourceProps(); + } + + // ----------------------------------------------------------------------------- + sal_Bool DBSubComponentController::haveDataSource() const + { + return m_pImpl->m_aDataSource.is(); + } + + // ----------------------------------------------------------------------------- + Reference< XModel > DBSubComponentController::getDatabaseDocument() const + { + return Reference< XModel >( m_pImpl->m_aDataSource.getDatabaseDocument(), UNO_QUERY ); + } + + // ----------------------------------------------------------------------------- + Reference< XNumberFormatter > DBSubComponentController::getNumberFormatter() const + { + return m_pImpl->m_xFormatter; + } + + // ----------------------------------------------------------------------------- + Reference< XModel > DBSubComponentController::getPrivateModel() const + { + return getDatabaseDocument(); + } + // ----------------------------------------------------------------------------- + // XTitle + ::rtl::OUString SAL_CALL DBSubComponentController::getTitle() + throw (RuntimeException) + { + ::osl::MutexGuard aGuard( getMutex() ); + if ( m_bExternalTitle ) + return impl_getTitleHelper_throw()->getTitle (); + + ::rtl::OUStringBuffer sTitle; + Reference< XTitle > xTitle(getPrivateModel(),UNO_QUERY); + if ( xTitle.is() ) + { + sTitle.append( xTitle->getTitle() ); + sTitle.appendAscii(" : "); + } + sTitle.append( getPrivateTitle() ); + return sTitle.makeStringAndClear(); + } + + // ----------------------------------------------------------------------------- + sal_Int32 DBSubComponentController::getCurrentStartNumber() const + { + return m_pImpl->m_nDocStartNumber; + } + + // ----------------------------------------------------------------------------- + Reference< XEmbeddedScripts > SAL_CALL DBSubComponentController::getScriptContainer() throw (RuntimeException) + { + ::osl::MutexGuard aGuard( getMutex() ); + if ( !m_pImpl->documentHasScriptSupport() ) + return NULL; + + return Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY_THROW ); + } + + // ----------------------------------------------------------------------------- + void SAL_CALL DBSubComponentController::addModifyListener( const Reference< XModifyListener >& i_Listener ) throw (RuntimeException) + { + ::osl::MutexGuard aGuard( getMutex() ); + m_pImpl->m_aModifyListeners.addInterface( i_Listener ); + } + + // ----------------------------------------------------------------------------- + void SAL_CALL DBSubComponentController::removeModifyListener( const Reference< XModifyListener >& i_Listener ) throw (RuntimeException) + { + ::osl::MutexGuard aGuard( getMutex() ); + m_pImpl->m_aModifyListeners.removeInterface( i_Listener ); + } + + // ----------------------------------------------------------------------------- + ::sal_Bool SAL_CALL DBSubComponentController::isModified( ) throw (RuntimeException) + { + ::osl::MutexGuard aGuard( getMutex() ); + return impl_isModified(); + } + + // ----------------------------------------------------------------------------- + void SAL_CALL DBSubComponentController::setModified( ::sal_Bool i_bModified ) throw (PropertyVetoException, RuntimeException) + { + ::osl::ClearableMutexGuard aGuard( getMutex() ); + + if ( m_pImpl->m_bModified == i_bModified ) + return; + + m_pImpl->m_bModified = i_bModified; + impl_onModifyChanged(); + + EventObject aEvent( *this ); + aGuard.clear(); + m_pImpl->m_aModifyListeners.notifyEach( &XModifyListener::modified, aEvent ); + } + + // ----------------------------------------------------------------------------- + sal_Bool DBSubComponentController::impl_isModified() const + { + return m_pImpl->m_bModified; + } + + // ----------------------------------------------------------------------------- + void DBSubComponentController::impl_onModifyChanged() + { + InvalidateFeature( ID_BROWSER_SAVEDOC ); + if ( isFeatureSupported( ID_BROWSER_SAVEASDOC ) ) + InvalidateFeature( ID_BROWSER_SAVEASDOC ); + } + +//........................................................................ +} // namespace dbaui +//........................................................................ + diff --git a/dbaccess/source/ui/misc/dbumiscres.src b/dbaccess/source/ui/misc/dbumiscres.src index ae5979c0a..974b36e68 100644 --- a/dbaccess/source/ui/misc/dbumiscres.src +++ b/dbaccess/source/ui/misc/dbumiscres.src @@ -96,5 +96,5 @@ String STR_NAMED_OBJECT_ALREADY_EXISTS String RID_STR_EXTENSION_NOT_PRESENT { // #i96130# use hard coded name - Text [ en-US ] = "The report, \"$file$\", requires the extension Sun Report Builder."; + Text [ en-US ] = "The report, \"$file$\", requires the extension Oracle Report Builder."; }; diff --git a/dbaccess/source/ui/misc/dsmeta.cxx b/dbaccess/source/ui/misc/dsmeta.cxx index a7c3defd7..35f68b0e0 100644 --- a/dbaccess/source/ui/misc/dsmeta.cxx +++ b/dbaccess/source/ui/misc/dsmeta.cxx @@ -94,6 +94,7 @@ namespace dbaui { DSID_IGNORECURRENCY, "IgnoreCurrency" }, { DSID_ESCAPE_DATETIME, "EscapeDateTime" }, { DSID_PRIMARY_KEY_SUPPORT, "PrimaryKeySupport" }, + { DSID_MAX_ROW_SCAN, "MaxRowScan" }, { 0, NULL } }; return s_aMappings; diff --git a/dbaccess/source/ui/misc/imageprovider.cxx b/dbaccess/source/ui/misc/imageprovider.cxx index b49c2541b..fb5f42ba6 100644 --- a/dbaccess/source/ui/misc/imageprovider.cxx +++ b/dbaccess/source/ui/misc/imageprovider.cxx @@ -97,7 +97,7 @@ namespace dbaui //................................................................ static void lcl_getTableImageResourceID_nothrow( const ImageProvider_Data& _rData, const ::rtl::OUString& _rName, - USHORT& _out_rResourceID ) + sal_uInt16& _out_rResourceID) { _out_rResourceID = 0; try @@ -165,7 +165,7 @@ namespace dbaui if ( !_out_rImage ) { // no -> determine by type - USHORT nImageResourceID = 0; + sal_uInt16 nImageResourceID = 0; lcl_getTableImageResourceID_nothrow( *m_pData, _rName, nImageResourceID ); if ( nImageResourceID && !_out_rImage ) @@ -178,16 +178,16 @@ namespace dbaui Image ImageProvider::getDefaultImage( sal_Int32 _nDatabaseObjectType ) { Image aObjectImage; - USHORT nImageResourceID( getDefaultImageResourceID( _nDatabaseObjectType ) ); + sal_uInt16 nImageResourceID( getDefaultImageResourceID( _nDatabaseObjectType) ); if ( nImageResourceID ) aObjectImage = Image( ModuleRes( nImageResourceID ) ); return aObjectImage; } //-------------------------------------------------------------------- - USHORT ImageProvider::getDefaultImageResourceID( sal_Int32 _nDatabaseObjectType ) + sal_uInt16 ImageProvider::getDefaultImageResourceID( sal_Int32 _nDatabaseObjectType) { - USHORT nImageResourceID( 0 ); + sal_uInt16 nImageResourceID( 0 ); switch ( _nDatabaseObjectType ) { case DatabaseObject::QUERY: @@ -212,7 +212,7 @@ namespace dbaui //-------------------------------------------------------------------- Image ImageProvider::getFolderImage( sal_Int32 _nDatabaseObjectType ) { - USHORT nImageResourceID( 0 ); + sal_uInt16 nImageResourceID( 0 ); switch ( _nDatabaseObjectType ) { case DatabaseObject::QUERY: diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx index e28c4d828..49b88c4c0 100644 --- a/dbaccess/source/ui/misc/linkeddocuments.cxx +++ b/dbaccess/source/ui/misc/linkeddocuments.cxx @@ -46,7 +46,7 @@ #include <com/sun/star/ucb/OpenCommandArgument.hpp> #include <com/sun/star/ucb/OpenMode.hpp> #include <com/sun/star/task/XJobExecutor.hpp> -#include <cppuhelper/extract.hxx> +#include <comphelper/extract.hxx> #include <comphelper/types.hxx> #include <vcl/msgbox.hxx> #include <ucbhelper/content.hxx> @@ -60,7 +60,6 @@ #include <sfx2/app.hxx> #include <basic/sbx.hxx> #include <basic/sbuno.hxx> -#include <sfx2/macrconf.hxx> #include <svtools/ehdl.hxx> #include <svx/dataaccessdescriptor.hxx> #include <com/sun/star/container/XHierarchicalNameContainer.hpp> diff --git a/dbaccess/source/ui/misc/makefile.mk b/dbaccess/source/ui/misc/makefile.mk index 7f9bbed56..534d90e39 100644 --- a/dbaccess/source/ui/misc/makefile.mk +++ b/dbaccess/source/ui/misc/makefile.mk @@ -25,8 +25,8 @@ # #************************************************************************* -PRJ=..$/..$/.. -PRJINC=$(PRJ)$/source +PRJ=../../.. +PRJINC=$(PRJ)/source PRJNAME=dbaccess TARGET=uimisc @@ -35,50 +35,53 @@ ENABLE_EXCEPTIONS=TRUE # --- Settings ---------------------------------- .INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk +.INCLUDE : $(PRJ)/util/makefile.pmk # --- Files ------------------------------------- # ... resource files ............................ SRS1NAME=$(TARGET) -SRC1FILES = \ - dbumiscres.src \ +SRC1FILES = \ + dbumiscres.src \ WizardPages.src # ... object files ............................ -SLOFILES= \ - $(SLO)$/asyncmodaldialog.obj \ - $(SLO)$/imageprovider.obj \ - $(SLO)$/singledoccontroller.obj \ - $(SLO)$/datasourceconnector.obj \ - $(SLO)$/linkeddocuments.obj \ - $(SLO)$/indexcollection.obj \ - $(SLO)$/UITools.obj \ - $(SLO)$/WCPage.obj \ - $(SLO)$/WCopyTable.obj \ - $(SLO)$/WTypeSelect.obj \ - $(SLO)$/TokenWriter.obj \ - $(SLO)$/HtmlReader.obj \ - $(SLO)$/RtfReader.obj \ - $(SLO)$/propertysetitem.obj \ - $(SLO)$/databaseobjectview.obj \ - $(SLO)$/DExport.obj \ - $(SLO)$/uiservices.obj \ - $(SLO)$/RowSetDrop.obj \ - $(SLO)$/TableCopyHelper.obj \ - $(SLO)$/moduledbu.obj \ - $(SLO)$/WColumnSelect.obj \ - $(SLO)$/WExtendPages.obj \ - $(SLO)$/WNameMatch.obj \ - $(SLO)$/ToolBoxHelper.obj \ - $(SLO)$/stringlistitem.obj \ - $(SLO)$/charsets.obj \ - $(SLO)$/defaultobjectnamecheck.obj \ - $(SLO)$/dsmeta.obj \ - $(SLO)$/controllerframe.obj \ - $(SLO)$/propertystorage.obj +SLOFILES= \ + $(SLO)/asyncmodaldialog.obj \ + $(SLO)/imageprovider.obj \ + $(SLO)/singledoccontroller.obj \ + $(SLO)/dbsubcomponentcontroller.obj \ + $(SLO)/datasourceconnector.obj \ + $(SLO)/linkeddocuments.obj \ + $(SLO)/indexcollection.obj \ + $(SLO)/UITools.obj \ + $(SLO)/WCPage.obj \ + $(SLO)/WCopyTable.obj \ + $(SLO)/WTypeSelect.obj \ + $(SLO)/TokenWriter.obj \ + $(SLO)/HtmlReader.obj \ + $(SLO)/RtfReader.obj \ + $(SLO)/propertysetitem.obj \ + $(SLO)/databaseobjectview.obj \ + $(SLO)/DExport.obj \ + $(SLO)/uiservices.obj \ + $(SLO)/RowSetDrop.obj \ + $(SLO)/TableCopyHelper.obj \ + $(SLO)/moduledbu.obj \ + $(SLO)/WColumnSelect.obj \ + $(SLO)/WExtendPages.obj \ + $(SLO)/WNameMatch.obj \ + $(SLO)/ToolBoxHelper.obj \ + $(SLO)/stringlistitem.obj \ + $(SLO)/charsets.obj \ + $(SLO)/defaultobjectnamecheck.obj \ + $(SLO)/dsmeta.obj \ + $(SLO)/controllerframe.obj \ + $(SLO)/propertystorage.obj \ + $(SLO)/dbaundomanager.obj \ + # --- Targets ---------------------------------- .INCLUDE : target.mk diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx index 4561219eb..4f6d7b909 100644..100755 --- a/dbaccess/source/ui/misc/singledoccontroller.cxx +++ b/dbaccess/source/ui/misc/singledoccontroller.cxx @@ -1,8 +1,7 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* - * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -26,719 +25,180 @@ * ************************************************************************/ -// MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" +#include "dbaundomanager.hxx" +#include "singledoccontroller.hxx" #include "browserids.hxx" -#include "commontypes.hxx" -#include "dataview.hxx" #include "dbu_misc.hrc" #include "dbustrings.hrc" #include "moduledbu.hxx" -#include "singledoccontroller.hxx" -#include <com/sun/star/frame/XUntitledNumbers.hpp> /** === begin UNO includes === **/ -#include <com/sun/star/beans/PropertyAttribute.hpp> -#include <com/sun/star/container/XChild.hpp> -#include <com/sun/star/container/XNameAccess.hpp> -#include <com/sun/star/sdb/XDocumentDataSource.hpp> -#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> -#include <com/sun/star/sdbc/XDataSource.hpp> -#include <com/sun/star/lang/IllegalArgumentException.hpp> -#include <com/sun/star/frame/XUntitledNumbers.hpp> /** === end UNO includes === **/ -#include <comphelper/sequence.hxx> -#include <comphelper/types.hxx> -#include <connectivity/dbexception.hxx> -#include <connectivity/dbtools.hxx> -#include <cppuhelper/typeprovider.hxx> -#include <rtl/ustrbuf.hxx> -#include <toolkit/unohlp.hxx> -#include <tools/diagnose_ex.h> +#include <svl/undo.hxx> #include <osl/diagnose.h> -#include <vcl/msgbox.hxx> -//........................................................................ +#include <boost/scoped_ptr.hpp> + +//...................................................................................................................... namespace dbaui { -//........................................................................ +//...................................................................................................................... /** === begin UNO using === **/ - using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Reference; - using ::com::sun::star::beans::XPropertySet; - using ::com::sun::star::util::XNumberFormatter; - using ::com::sun::star::lang::XMultiServiceFactory; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + 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::uno::makeAny; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Type; - using ::com::sun::star::sdbc::XConnection; - using ::com::sun::star::uno::UNO_QUERY; - using ::com::sun::star::container::XChild; - using ::com::sun::star::sdbc::XDataSource; - using ::com::sun::star::util::XNumberFormatter; - using ::com::sun::star::util::XNumberFormatsSupplier; - using ::com::sun::star::frame::XFrame; - using ::com::sun::star::uno::Exception; - using ::com::sun::star::sdbc::SQLException; - using ::com::sun::star::lang::EventObject; + using ::com::sun::star::document::XUndoManager; + using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::beans::PropertyValue; - using ::com::sun::star::frame::XModel; - using ::com::sun::star::sdb::XOfficeDatabaseDocument; - using ::com::sun::star::awt::XWindow; - using ::com::sun::star::sdbc::XDatabaseMetaData; - using ::com::sun::star::sdb::XDocumentDataSource; - using ::com::sun::star::document::XEmbeddedScripts; - using ::com::sun::star::lang::IllegalArgumentException; - using ::com::sun::star::uno::UNO_SET_THROW; - using ::com::sun::star::uno::UNO_QUERY_THROW; - using ::com::sun::star::frame::XUntitledNumbers; - using ::com::sun::star::beans::PropertyVetoException; + using ::com::sun::star::lang::EventObject; /** === end UNO using === **/ - class DataSourceHolder + //================================================================================================================== + //= OSingleDocumentController_Data + //================================================================================================================== + struct OSingleDocumentController_Data { - public: - DataSourceHolder() - { - } + ::boost::scoped_ptr< UndoManager > m_pUndoManager; - DataSourceHolder( const Reference< XDataSource >& _rxDataSource ) + OSingleDocumentController_Data( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ) + :m_pUndoManager( new UndoManager( i_parent, i_mutex ) ) { - m_xDataSource = _rxDataSource; - Reference< XDocumentDataSource > xDocDS( m_xDataSource, UNO_QUERY ); - if ( xDocDS.is() ) - m_xDocument = xDocDS->getDatabaseDocument(); - - m_xDataSourceProps.set( m_xDataSource, UNO_QUERY ); } - - const Reference< XDataSource >& getDataSource() const { return m_xDataSource; } - const Reference< XPropertySet >& getDataSourceProps() const { return m_xDataSourceProps; } - const Reference< XOfficeDatabaseDocument > getDatabaseDocument() const { return m_xDocument; } - - bool is() const { return m_xDataSource.is(); } - - void clear() - { - m_xDataSource.clear(); - m_xDocument.clear(); - } - - private: - Reference< XDataSource > m_xDataSource; - Reference< XPropertySet > m_xDataSourceProps; - Reference< XOfficeDatabaseDocument > m_xDocument; }; - struct OSingleDocumentControllerImpl - { - private: - ::boost::optional< bool > m_aDocScriptSupport; - - public: - OModuleClient m_aModuleClient; - ::dbtools::SQLExceptionInfo m_aCurrentError; // contains the current error which can be set through IEnvironment - - ::cppu::OInterfaceContainerHelper - m_aModifyListeners; - - // <properties> - SharedConnection m_xConnection; - ::dbtools::DatabaseMetaData m_aSdbMetaData; - // </properties> - ::rtl::OUString m_sDataSourceName; // the data source we're working for - DataSourceHolder m_aDataSource; - Reference< XModel > m_xDocument; - Reference< XNumberFormatter > m_xFormatter; // a number formatter working with the connection's NumberFormatsSupplier - sal_Int32 m_nDocStartNumber; - sal_Bool m_bSuspended; // is true when the controller was already suspended - sal_Bool m_bEditable; // is the control readonly or not - sal_Bool m_bModified; // is the data modified - bool m_bNotAttached; - - OSingleDocumentControllerImpl( ::osl::Mutex& i_rMutex ) - :m_aDocScriptSupport() - ,m_aModifyListeners( i_rMutex ) - ,m_nDocStartNumber(0) - ,m_bSuspended( sal_False ) - ,m_bEditable(sal_True) - ,m_bModified(sal_False) - ,m_bNotAttached(true) - { - } - - bool documentHasScriptSupport() const - { - OSL_PRECOND( !!m_aDocScriptSupport, - "OSingleDocumentControllerImpl::documentHasScriptSupport: not completely initialized, yet - don't know!?" ); - return !!m_aDocScriptSupport && *m_aDocScriptSupport; - } - - void setDocumentScriptSupport( const bool _bSupport ) - { - OSL_PRECOND( !m_aDocScriptSupport, - "OSingleDocumentControllerImpl::setDocumentScriptSupport: already initialized!" ); - m_aDocScriptSupport = ::boost::optional< bool >( _bSupport ); - } - }; - - //==================================================================== + //================================================================================================================== //= OSingleDocumentController - //==================================================================== - //-------------------------------------------------------------------- - OSingleDocumentController::OSingleDocumentController(const Reference< XMultiServiceFactory >& _rxORB) + //================================================================================================================== + //------------------------------------------------------------------------------------------------------------------ + OSingleDocumentController::OSingleDocumentController( const Reference< XMultiServiceFactory >& _rxORB ) :OSingleDocumentController_Base( _rxORB ) - ,m_pImpl( new OSingleDocumentControllerImpl( getMutex() ) ) + ,m_pData( new OSingleDocumentController_Data( *this, getMutex() ) ) { } - //-------------------------------------------------------------------- + //------------------------------------------------------------------------------------------------------------------ OSingleDocumentController::~OSingleDocumentController() { } - //-------------------------------------------------------------------- - void OSingleDocumentController::impl_initialize() - { - OGenericUnoController::impl_initialize(); - - const ::comphelper::NamedValueCollection& rArguments( getInitParams() ); - - Reference< XConnection > xConnection; - xConnection = rArguments.getOrDefault( (::rtl::OUString)PROPERTY_ACTIVE_CONNECTION, xConnection ); - - if ( !xConnection.is() ) - ::dbtools::isEmbeddedInDatabase( getModel(), xConnection ); - - if ( xConnection.is() ) - initializeConnection( xConnection ); - - bool bShowError = true; - if ( !isConnected() ) - { - reconnect( sal_False ); - bShowError = false; - } - if ( !isConnected() ) - { - if ( bShowError ) - connectionLostMessage(); - throw IllegalArgumentException(); - } - } - - //-------------------------------------------------------------------- - Any SAL_CALL OSingleDocumentController::queryInterface(const Type& _rType) throw (RuntimeException) - { - if ( _rType.equals( XScriptInvocationContext::static_type() ) ) - { - if ( m_pImpl->documentHasScriptSupport() ) - return makeAny( Reference< XScriptInvocationContext >( this ) ); - return Any(); - } - - return OSingleDocumentController_Base::queryInterface( _rType ); - } - - //-------------------------------------------------------------------- - Sequence< Type > SAL_CALL OSingleDocumentController::getTypes( ) throw (RuntimeException) - { - Sequence< Type > aTypes( OSingleDocumentController_Base::getTypes() ); - if ( !m_pImpl->documentHasScriptSupport() ) - { - Sequence< Type > aStrippedTypes( aTypes.getLength() - 1 ); - ::std::remove_copy_if( - aTypes.getConstArray(), - aTypes.getConstArray() + aTypes.getLength(), - aStrippedTypes.getArray(), - ::std::bind2nd( ::std::equal_to< Type >(), XScriptInvocationContext::static_type() ) - ); - aTypes = aStrippedTypes; - } - return aTypes; - } - - //-------------------------------------------------------------------- - void OSingleDocumentController::initializeConnection( const Reference< XConnection >& _rxForeignConn ) - { - OSL_ENSURE( !isConnected(), "OSingleDocumentController::initializeConnection: not to be called when already connected!" ); - // usually this gets called from within initialize of derived classes ... - if ( isConnected() ) - disconnect(); - - m_pImpl->m_xConnection.reset( _rxForeignConn, SharedConnection::NoTakeOwnership ); - m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection ); - startConnectionListening( m_pImpl->m_xConnection ); - - // get the data source the connection belongs to - try - { - // determine our data source - OSL_PRECOND( !m_pImpl->m_aDataSource.is(), "OSingleDocumentController::initializeConnection: already a data source in this phase?" ); - { - Reference< XChild > xConnAsChild( m_pImpl->m_xConnection, UNO_QUERY ); - Reference< XDataSource > xDS; - if ( xConnAsChild.is() ) - xDS = Reference< XDataSource >( xConnAsChild->getParent(), UNO_QUERY ); - - // (take the indirection through XDataSource to ensure we have a correct object ....) - m_pImpl->m_aDataSource = xDS; - } - OSL_POSTCOND( m_pImpl->m_aDataSource.is(), "OSingleDocumentController::initializeConnection: unable to obtain the data source object!" ); - - if ( m_pImpl->m_bNotAttached ) - { - Reference< XUntitledNumbers > xUntitledProvider( getDatabaseDocument(), UNO_QUERY ); - m_pImpl->m_nDocStartNumber = 1; - if ( xUntitledProvider.is() ) - m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) ); - } - - // determine the availability of script support in our document. Our own XScriptInvocationContext - // interface depends on this - m_pImpl->setDocumentScriptSupport( Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY ).is() ); - - // get a number formatter - Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps(), UNO_SET_THROW ); - xDataSourceProps->getPropertyValue( PROPERTY_NAME ) >>= m_pImpl->m_sDataSourceName; - OSL_ENSURE( m_pImpl->m_sDataSourceName.getLength(), "OSingleDocumentController::initializeConnection: invalid data source name!" ); - Reference< XNumberFormatsSupplier> xSupplier = ::dbtools::getNumberFormats(m_pImpl->m_xConnection); - if(xSupplier.is()) - { - m_pImpl->m_xFormatter = Reference< XNumberFormatter >(getORB() - ->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatter"))), UNO_QUERY); - m_pImpl->m_xFormatter->attachNumberFormatsSupplier(xSupplier); - } - OSL_ENSURE(m_pImpl->m_xFormatter.is(),"No NumberFormatter!"); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - } - - //-------------------------------------------------------------------- - void OSingleDocumentController::reconnect( sal_Bool _bUI ) - { - OSL_ENSURE(!m_pImpl->m_bSuspended, "Cannot reconnect while suspended!"); - - stopConnectionListening( m_pImpl->m_xConnection ); - m_pImpl->m_aSdbMetaData.reset( NULL ); - m_pImpl->m_xConnection.clear(); - - // reconnect - sal_Bool bReConnect = sal_True; - if ( _bUI ) - { - QueryBox aQuery( getView(), ModuleRes(QUERY_CONNECTION_LOST) ); - bReConnect = ( RET_YES == aQuery.Execute() ); - } - - // now really reconnect ... - if ( bReConnect ) - { - m_pImpl->m_xConnection.reset( connect( m_pImpl->m_aDataSource.getDataSource(), NULL ), SharedConnection::TakeOwnership ); - m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection ); - } - - // invalidate all slots - InvalidateAll(); - } - - //-------------------------------------------------------------------- - void OSingleDocumentController::disconnect() - { - stopConnectionListening(m_pImpl->m_xConnection); - m_pImpl->m_aSdbMetaData.reset( NULL ); - m_pImpl->m_xConnection.clear(); - - InvalidateAll(); - } - - //-------------------------------------------------------------------- - void OSingleDocumentController::losingConnection() - { - // our connection was disposed so we need a new one - reconnect( sal_True ); - } - - //-------------------------------------------------------------------- + // ----------------------------------------------------------------------------- void SAL_CALL OSingleDocumentController::disposing() { OSingleDocumentController_Base::disposing(); - m_aUndoManager.Clear(); - - disconnect(); - - attachFrame( Reference < XFrame >() ); - - m_pImpl->m_aDataSource.clear(); + ClearUndoManager(); + m_pData->m_pUndoManager->disposing(); } - //-------------------------------------------------------------------- - sal_Bool OSingleDocumentController::Construct(Window* _pParent) - { - OSL_ENSURE( getView(), "OSingleDocumentController::Construct: have no view!" ); - if ( getView() ) - getView()->enableSeparator( ); - - return OSingleDocumentController_Base::Construct( _pParent ); - } - - //-------------------------------------------------------------------- - void SAL_CALL OSingleDocumentController::disposing(const EventObject& _rSource) throw( RuntimeException ) - { - if ( _rSource.Source == getConnection() ) - { - if ( !m_pImpl->m_bSuspended // when already suspended then we don't have to reconnect - && !getBroadcastHelper().bInDispose - && !getBroadcastHelper().bDisposed - && isConnected() - ) - { - losingConnection(); - } - else - { - m_pImpl->m_xConnection.reset( m_pImpl->m_xConnection, SharedConnection::NoTakeOwnership ); - // this prevents the "disposeComponent" call in disconnect - disconnect(); - } - } - else - OSingleDocumentController_Base::disposing( _rSource ); - } - - //-------------------------------------------------------------------- - void OSingleDocumentController::appendError( const ::rtl::OUString& _rErrorMessage, const ::dbtools::StandardSQLState _eSQLState, - const sal_Int32 _nErrorCode ) - { - m_pImpl->m_aCurrentError.append( ::dbtools::SQLExceptionInfo::SQL_EXCEPTION, _rErrorMessage, getStandardSQLStateAscii( _eSQLState ), - _nErrorCode ); - } - //-------------------------------------------------------------------- - void OSingleDocumentController::clearError() + // ----------------------------------------------------------------------------- + void SAL_CALL OSingleDocumentController::disposing( const EventObject& i_event ) throw( RuntimeException ) { - m_pImpl->m_aCurrentError = ::dbtools::SQLExceptionInfo(); + // simply disambiguate + OSingleDocumentController_Base::disposing( i_event ); } - //-------------------------------------------------------------------- - sal_Bool OSingleDocumentController::hasError() const + // ----------------------------------------------------------------------------- + void OSingleDocumentController::ClearUndoManager() { - return m_pImpl->m_aCurrentError.isValid(); + GetUndoManager().Clear(); } - //-------------------------------------------------------------------- - const ::dbtools::SQLExceptionInfo& OSingleDocumentController::getError() const + // ----------------------------------------------------------------------------- + SfxUndoManager& OSingleDocumentController::GetUndoManager() const { - return m_pImpl->m_aCurrentError; + return m_pData->m_pUndoManager->GetSfxUndoManager(); } - //-------------------------------------------------------------------- - void OSingleDocumentController::displayError() + // ----------------------------------------------------------------------------- + void OSingleDocumentController::addUndoActionAndInvalidate(SfxUndoAction *_pAction) { - showError( m_pImpl->m_aCurrentError ); - } + // add undo action + GetUndoManager().AddUndoAction( _pAction ); - //-------------------------------------------------------------------- - sal_Bool SAL_CALL OSingleDocumentController::suspend(sal_Bool bSuspend) throw( RuntimeException ) - { - m_pImpl->m_bSuspended = bSuspend; - if ( !bSuspend && !isConnected() ) - reconnect(sal_True); + // when we add an undo action the controller was modified + setModified( sal_True ); - - return sal_True; + // now inform me that or states changed + InvalidateFeature( ID_BROWSER_UNDO ); + InvalidateFeature( ID_BROWSER_REDO ); } // ----------------------------------------------------------------------------- - sal_Bool SAL_CALL OSingleDocumentController::attachModel( const Reference< XModel > & _rxModel) throw( RuntimeException ) + Reference< XUndoManager > SAL_CALL OSingleDocumentController::getUndoManager( ) throw (RuntimeException) { - if ( !_rxModel.is() ) - return sal_False; - if ( !OSingleDocumentController_Base::attachModel( _rxModel ) ) - return sal_False; - - m_pImpl->m_bNotAttached = false; - if ( m_pImpl->m_nDocStartNumber == 1 ) - releaseNumberForComponent(); - - Reference< XUntitledNumbers > xUntitledProvider( _rxModel, UNO_QUERY ); - m_pImpl->m_nDocStartNumber = 1; - if ( xUntitledProvider.is() ) - m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) ); - - return sal_True; + return m_pData->m_pUndoManager.get(); } // ----------------------------------------------------------------------------- FeatureState OSingleDocumentController::GetState(sal_uInt16 _nId) const { FeatureState aReturn; - // (disabled automatically) - aReturn.bEnabled = sal_True; - - switch (_nId) + switch ( _nId ) { case ID_BROWSER_UNDO: - aReturn.bEnabled = m_pImpl->m_bEditable && m_aUndoManager.GetUndoActionCount() != 0; + aReturn.bEnabled = isEditable() && GetUndoManager().GetUndoActionCount() != 0; if ( aReturn.bEnabled ) { String sUndo(ModuleRes(STR_UNDO_COLON)); sUndo += String(RTL_CONSTASCII_USTRINGPARAM(" ")); - sUndo += m_aUndoManager.GetUndoActionComment(); + sUndo += GetUndoManager().GetUndoActionComment(); aReturn.sTitle = sUndo; } break; + case ID_BROWSER_REDO: - aReturn.bEnabled = m_pImpl->m_bEditable && m_aUndoManager.GetRedoActionCount() != 0; + aReturn.bEnabled = isEditable() && GetUndoManager().GetRedoActionCount() != 0; if ( aReturn.bEnabled ) { String sRedo(ModuleRes(STR_REDO_COLON)); sRedo += String(RTL_CONSTASCII_USTRINGPARAM(" ")); - sRedo += m_aUndoManager.GetRedoActionComment(); + sRedo += GetUndoManager().GetRedoActionComment(); aReturn.sTitle = sRedo; } break; + default: aReturn = OSingleDocumentController_Base::GetState(_nId); } return aReturn; } // ----------------------------------------------------------------------------- - void OSingleDocumentController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& _rArgs) + void OSingleDocumentController::Execute( sal_uInt16 _nId, const Sequence< PropertyValue >& _rArgs ) { - switch(_nId) + switch ( _nId ) { - case ID_BROWSER_CLOSE: - closeTask(); - return; case ID_BROWSER_UNDO: - m_aUndoManager.Undo(); - InvalidateFeature(ID_BROWSER_REDO); + GetUndoManager().Undo(); + InvalidateFeature( ID_BROWSER_UNDO ); + InvalidateFeature( ID_BROWSER_REDO ); break; + case ID_BROWSER_REDO: - m_aUndoManager.Redo(); - InvalidateFeature(ID_BROWSER_UNDO); + GetUndoManager().Redo(); + InvalidateFeature( ID_BROWSER_UNDO ); + InvalidateFeature( ID_BROWSER_REDO ); break; + default: OSingleDocumentController_Base::Execute( _nId, _rArgs ); break; } InvalidateFeature(_nId); } - // ----------------------------------------------------------------------------- - SfxUndoManager* OSingleDocumentController::getUndoMgr() - { - return &m_aUndoManager; - } - // ----------------------------------------------------------------------------- - void OSingleDocumentController::addUndoActionAndInvalidate(SfxUndoAction *_pAction) - { - // add undo action - m_aUndoManager.AddUndoAction(_pAction); - // when we add an undo action the controller was modified - setModified(sal_True); - // now inform me that or states changed - InvalidateFeature(ID_BROWSER_UNDO); - InvalidateFeature(ID_BROWSER_REDO); - } - - // ----------------------------------------------------------------------------- - ::rtl::OUString OSingleDocumentController::getDataSourceName() const - { - ::rtl::OUString sName; - Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps() ); - if ( xDataSourceProps.is() ) - xDataSourceProps->getPropertyValue(PROPERTY_NAME) >>= sName; - return sName; - } - // ----------------------------------------------------------------------------- - void OSingleDocumentController::connectionLostMessage() const - { - String aMessage(ModuleRes(RID_STR_CONNECTION_LOST)); - Reference< XWindow > xWindow = getTopMostContainerWindow(); - Window* pWin = NULL; - if ( xWindow.is() ) - pWin = VCLUnoHelper::GetWindow(xWindow); - if ( !pWin ) - pWin = getView()->Window::GetParent(); - - InfoBox(pWin, aMessage).Execute(); - } - // ----------------------------------------------------------------------------- - const Reference< XConnection >& OSingleDocumentController::getConnection() const - { - return m_pImpl->m_xConnection; - } - - // ----------------------------------------------------------------------------- - sal_Bool OSingleDocumentController::isReadOnly() const - { - return !m_pImpl->m_bEditable; - } - - // ----------------------------------------------------------------------------- - sal_Bool OSingleDocumentController::isEditable() const - { - return m_pImpl->m_bEditable; - } - - // ----------------------------------------------------------------------------- - void OSingleDocumentController::setEditable(sal_Bool _bEditable) - { - m_pImpl->m_bEditable = _bEditable; - } - - // ----------------------------------------------------------------------------- - const ::dbtools::DatabaseMetaData& OSingleDocumentController::getSdbMetaData() const - { - return m_pImpl->m_aSdbMetaData; - } - - // ----------------------------------------------------------------------------- - sal_Bool OSingleDocumentController::isConnected() const - { - return m_pImpl->m_xConnection.is(); - } - - // ----------------------------------------------------------------------------- - Reference< XDatabaseMetaData > OSingleDocumentController::getMetaData( ) const - { - Reference< XDatabaseMetaData > xMeta; - try - { - if ( isConnected() ) - xMeta.set( m_pImpl->m_xConnection->getMetaData(), UNO_SET_THROW ); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - return xMeta; - } - - // ----------------------------------------------------------------------------- - const Reference< XPropertySet >& OSingleDocumentController::getDataSource() const - { - return m_pImpl->m_aDataSource.getDataSourceProps(); - } - - // ----------------------------------------------------------------------------- - sal_Bool OSingleDocumentController::haveDataSource() const - { - return m_pImpl->m_aDataSource.is(); - } - - // ----------------------------------------------------------------------------- - Reference< XModel > OSingleDocumentController::getDatabaseDocument() const - { - return Reference< XModel >( m_pImpl->m_aDataSource.getDatabaseDocument(), UNO_QUERY ); - } - - // ----------------------------------------------------------------------------- - Reference< XNumberFormatter > OSingleDocumentController::getNumberFormatter() const - { - return m_pImpl->m_xFormatter; - } - - // ----------------------------------------------------------------------------- - Reference< XModel > OSingleDocumentController::getPrivateModel() const - { - return getDatabaseDocument(); - } - // ----------------------------------------------------------------------------- - // XTitle - ::rtl::OUString SAL_CALL OSingleDocumentController::getTitle() - throw (RuntimeException) - { - ::osl::MutexGuard aGuard( getMutex() ); - if ( m_bExternalTitle ) - return impl_getTitleHelper_throw()->getTitle (); - - ::rtl::OUStringBuffer sTitle; - Reference< XTitle > xTitle(getPrivateModel(),UNO_QUERY); - if ( xTitle.is() ) - { - sTitle.append( xTitle->getTitle() ); - sTitle.appendAscii(" : "); - } - sTitle.append( getPrivateTitle() ); - - return sTitle.makeStringAndClear(); - } - // ----------------------------------------------------------------------------- - sal_Int32 OSingleDocumentController::getCurrentStartNumber() const - { - return m_pImpl->m_nDocStartNumber; - } - - // ----------------------------------------------------------------------------- - Reference< XEmbeddedScripts > SAL_CALL OSingleDocumentController::getScriptContainer() throw (RuntimeException) - { - ::osl::MutexGuard aGuard( getMutex() ); - if ( !m_pImpl->documentHasScriptSupport() ) - return NULL; - - return Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY_THROW ); - } - - // ----------------------------------------------------------------------------- - void SAL_CALL OSingleDocumentController::addModifyListener( const Reference< XModifyListener >& i_Listener ) throw (RuntimeException) - { - ::osl::MutexGuard aGuard( getMutex() ); - m_pImpl->m_aModifyListeners.addInterface( i_Listener ); - } - - // ----------------------------------------------------------------------------- - void SAL_CALL OSingleDocumentController::removeModifyListener( const Reference< XModifyListener >& i_Listener ) throw (RuntimeException) - { - ::osl::MutexGuard aGuard( getMutex() ); - m_pImpl->m_aModifyListeners.removeInterface( i_Listener ); - } - - // ----------------------------------------------------------------------------- - ::sal_Bool SAL_CALL OSingleDocumentController::isModified( ) throw (RuntimeException) - { - ::osl::MutexGuard aGuard( getMutex() ); - return impl_isModified(); - } - - // ----------------------------------------------------------------------------- - void SAL_CALL OSingleDocumentController::setModified( ::sal_Bool i_bModified ) throw (PropertyVetoException, RuntimeException) - { - ::osl::ClearableMutexGuard aGuard( getMutex() ); - - if ( m_pImpl->m_bModified == i_bModified ) - return; - - m_pImpl->m_bModified = i_bModified; - impl_onModifyChanged(); - - EventObject aEvent( *this ); - aGuard.clear(); - m_pImpl->m_aModifyListeners.notifyEach( &XModifyListener::modified, aEvent ); - } - - // ----------------------------------------------------------------------------- - sal_Bool OSingleDocumentController::impl_isModified() const - { - return m_pImpl->m_bModified; - } - - // ----------------------------------------------------------------------------- - void OSingleDocumentController::impl_onModifyChanged() - { - InvalidateFeature( ID_BROWSER_SAVEDOC ); - if ( isFeatureSupported( ID_BROWSER_SAVEASDOC ) ) - InvalidateFeature( ID_BROWSER_SAVEASDOC ); - } -//........................................................................ -} // namespace dbaui -//........................................................................ +//...................................................................................................................... +} // namespace dbaui +//...................................................................................................................... -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/dbaccess/source/ui/misc/uiservices.cxx b/dbaccess/source/ui/misc/uiservices.cxx index e014d6e8e..dfba568a1 100644 --- a/dbaccess/source/ui/misc/uiservices.cxx +++ b/dbaccess/source/ui/misc/uiservices.cxx @@ -118,28 +118,6 @@ extern "C" DBACCESS_DLLPUBLIC void SAL_CALL component_getImplementationEnvironme } //--------------------------------------------------------------------------------------- -extern "C" DBACCESS_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( - void* pServiceManager, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - writeDBLoaderInfo(pRegistryKey); - return ::dbaui::OModuleRegistration::writeComponentInfos( - static_cast<XMultiServiceFactory*>(pServiceManager), - static_cast<XRegistryKey*>(pRegistryKey)); - } - catch (InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "DBA::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - -//--------------------------------------------------------------------------------------- extern "C" DBACCESS_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx b/dbaccess/source/ui/querydesign/ConnectionLine.cxx index 004cf40d0..1664b8bc6 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx @@ -233,7 +233,7 @@ void calcPointX2(const OTableWindow* _pWin,Point& _rNewConPos,Point& _rNewDescrP _rNewConPos.X() -= DESCRIPT_LINE_WIDTH; } //------------------------------------------------------------------------ -BOOL OConnectionLine::RecalcLine() +sal_Bool OConnectionLine::RecalcLine() { ////////////////////////////////////////////////////////////////////// // Fenster und Entries muessen gesetzt sein @@ -241,7 +241,7 @@ BOOL OConnectionLine::RecalcLine() const OTableWindow* pDestWin = m_pTabConn->GetDestWin(); if( !pSourceWin || !pDestWin ) - return FALSE; + return sal_False; SvLBoxEntry* pSourceEntry = pSourceWin->GetListBox()->GetEntryFromText( GetData()->GetSourceFieldName() ); SvLBoxEntry* pDestEntry = pDestWin->GetListBox()->GetEntryFromText( GetData()->GetDestFieldName() ); @@ -284,14 +284,14 @@ BOOL OConnectionLine::RecalcLine() // aDestConnPosY bestimmen calcPointsYValue(pDestWin,pDestEntry,m_aDestConnPos,m_aDestDescrLinePos); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- //------------------------------------------------------------------------ void OConnectionLine::Draw( OutputDevice* pOutDev ) { - const UINT16 nRectSize = 3; + const sal_uInt16 nRectSize = 3; ////////////////////////////////////////////////////////////////////// // Neue Dimensionen berechnen @@ -324,7 +324,7 @@ void OConnectionLine::Draw( OutputDevice* pOutDev ) pOutDev->DrawRect( calcRect( m_aDestDescrLinePos,aVector) ); } // ----------------------------------------------------------------------------- -BOOL OConnectionLine::IsValid() const +sal_Bool OConnectionLine::IsValid() const { return m_pData.is(); } diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx index eb938fad2..d9bfb76ca 100644 --- a/dbaccess/source/ui/querydesign/JoinController.cxx +++ b/dbaccess/source/ui/querydesign/JoinController.cxx @@ -142,7 +142,7 @@ bool AddTableDialogContext::allowAddition() const // ----------------------------------------------------------------------------- void AddTableDialogContext::addTableWindow( const String& _rQualifiedTableName, const String& _rAliasName ) { - getTableView()->AddTabWin( _rQualifiedTableName, _rAliasName, TRUE ); + getTableView()->AddTabWin( _rQualifiedTableName, _rAliasName, sal_True ); } // ----------------------------------------------------------------------------- @@ -308,7 +308,7 @@ void OJoinController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& if ( m_pAddTableDialog->IsVisible() ) { - m_pAddTableDialog->Show( FALSE ); + m_pAddTableDialog->Show( sal_False ); getView()->GrabFocus(); } else @@ -317,7 +317,7 @@ void OJoinController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& WaitObject aWaitCursor( getView() ); m_pAddTableDialog->Update(); } - m_pAddTableDialog->Show( TRUE ); + m_pAddTableDialog->Show( sal_True ); ::dbaui::notifySystemWindow(getView(),m_pAddTableDialog,::comphelper::mem_fun(&TaskPaneList::AddWindow)); } break; diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index b4a95c197..9569fc1c5 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -181,7 +181,7 @@ OJoinTableView::OJoinTableView( Window* pParent, OJoinDesignView* pView ) ,m_pDragWin( NULL ) ,m_pSizingWin( NULL ) ,m_pSelectedConn( NULL ) - ,m_bTrackingInitiallyMoved(FALSE) + ,m_bTrackingInitiallyMoved(sal_False) ,m_pLastFocusTabWin(NULL) ,m_pView( pView ) ,m_pAccessible(NULL) @@ -212,7 +212,7 @@ IMPL_LINK( OJoinTableView, ScrollHdl, ScrollBar*, pScrollBar ) { ////////////////////////////////////////////////////////////////////// // Alle Fenster verschieben - ScrollPane( pScrollBar->GetDelta(), (pScrollBar == GetHScrollBar()), FALSE ); + ScrollPane( pScrollBar->GetDelta(), (pScrollBar == GetHScrollBar()), sal_False ); return 0; } @@ -250,7 +250,7 @@ void OJoinTableView::Resize() } } //------------------------------------------------------------------------------ -ULONG OJoinTableView::GetTabWinCount() +sal_uLong OJoinTableView::GetTabWinCount() { DBG_CHKTHIS(OJoinTableView,NULL); return m_aTableMap.size(); @@ -333,7 +333,7 @@ OTableWindowData* OJoinTableView::CreateImpl(const ::rtl::OUString& _rComposedNa return new OTableWindowData( NULL,_rComposedName,_sTableName, _rWinName ); } //------------------------------------------------------------------------------ -void OJoinTableView::AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, BOOL /*bNewTable*/) +void OJoinTableView::AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, sal_Bool /*bNewTable*/) { DBG_CHKTHIS(OJoinTableView,NULL); OSL_ENSURE(_rComposedName.getLength(),"There must be a table name supplied!"); @@ -430,7 +430,7 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin ) namespace { // ----------------------------------------------------------------------------- - BOOL isScrollAllowed( OJoinTableView* _pView,long nDelta, BOOL bHoriz) + sal_Bool isScrollAllowed( OJoinTableView* _pView,long nDelta, sal_Bool bHoriz) { ////////////////////////////////////////////////////////////////////// // adjust ScrollBar-Positions @@ -448,15 +448,15 @@ namespace if ( bHoriz ) { if( nNewThumbPos == _pView->GetScrollOffset().X() ) - return FALSE; + return sal_False; } else if ( nNewThumbPos == _pView->GetScrollOffset().Y() ) - return FALSE; + return sal_False; return TRUE; } // ----------------------------------------------------------------------------- - BOOL getMovementImpl(OJoinTableView* _pView,const Point& _rPoint,const Size& _rSize,long& _nScrollX,long& _nScrollY) + sal_Bool getMovementImpl(OJoinTableView* _pView,const Point& _rPoint,const Size& _rSize,long& _nScrollX,long& _nScrollY) { _nScrollY = _nScrollX = 0; // data about the tab win @@ -468,9 +468,9 @@ namespace // data about ourself Size aSize = _pView->getRealOutputSize(); //GetOutputSizePixel(); - BOOL bVisbile = TRUE; - BOOL bFitsHor = (aUpperLeft.X() >= 0) && (aLowerRight.X() <= aSize.Width()); - BOOL bFitsVert= (aUpperLeft.Y() >= 0) && (aLowerRight.Y() <= aSize.Height()); + sal_Bool bVisbile = sal_True; + sal_Bool bFitsHor = (aUpperLeft.X() >= 0) && (aLowerRight.X() <= aSize.Width()); + sal_Bool bFitsVert= (aUpperLeft.Y() >= 0) && (aLowerRight.Y() <= aSize.Height()); if (!bFitsHor || !bFitsVert) { if (!bFitsHor) @@ -495,10 +495,10 @@ namespace } if ( _nScrollX ) // aSize.Width() > _rSize.Width() && - bVisbile = isScrollAllowed(_pView,_nScrollX, TRUE); + bVisbile = isScrollAllowed(_pView,_nScrollX, sal_True); if ( _nScrollY ) // aSize.Height() > _rSize.Height() && - bVisbile = bVisbile && isScrollAllowed(_pView,_nScrollY, FALSE); + bVisbile = bVisbile && isScrollAllowed(_pView,_nScrollY, sal_False); if ( bVisbile ) { @@ -506,9 +506,9 @@ namespace sal_Int32 nVRangeMax = _pView->GetVScrollBar()->GetRangeMax(); if ( aSize.Width() + _pView->GetHScrollBar()->GetThumbPos() + _nScrollX > nHRangeMax ) - bVisbile = FALSE; + bVisbile = sal_False; if ( bVisbile && aSize.Height() + _pView->GetVScrollBar()->GetThumbPos() + _nScrollY > nVRangeMax ) - bVisbile = FALSE; + bVisbile = sal_False; } } @@ -517,7 +517,7 @@ namespace } } // end of ano namespace // ----------------------------------------------------------------------------- -BOOL OJoinTableView::isMovementAllowed(const Point& _rPoint,const Size& _rSize) +sal_Bool OJoinTableView::isMovementAllowed(const Point& _rPoint,const Size& _rSize) { long nX,nY; return getMovementImpl(this,_rPoint,_rSize,nX,nY); @@ -537,12 +537,12 @@ void OJoinTableView::EnsureVisible(const Point& _rPoint,const Size& _rSize) if ( getMovementImpl(this,_rPoint,_rSize,nScrollX,nScrollY) ) { - BOOL bVisbile = TRUE; + sal_Bool bVisbile = sal_True; if (nScrollX) - bVisbile = ScrollPane(nScrollX, TRUE, TRUE); + bVisbile = ScrollPane(nScrollX, sal_True, sal_True); if (nScrollY) - bVisbile = bVisbile && ScrollPane(nScrollY, FALSE, TRUE); + bVisbile = bVisbile && ScrollPane(nScrollY, sal_False, sal_True); } } @@ -557,8 +557,8 @@ void OJoinTableView::SetDefaultTabWinPosSize( OTableWindow* pTabWin ) // Wenn kein Platz ist, wird die naechste Zeile ueberprueft. Size aOutSize = GetSizePixel(); Point aNewPos( 0,0 ); - USHORT nRow = 0; - BOOL bEnd = FALSE; + sal_uInt16 nRow = 0; + sal_Bool bEnd = sal_False; while( !bEnd ) { ////////////////////////////////////////////////////////////////// @@ -599,7 +599,7 @@ void OJoinTableView::SetDefaultTabWinPosSize( OTableWindow* pTabWin ) if( (aNewPos.X()+TABWIN_WIDTH_STD)<aRowRect.Right() ) { aNewPos.Y() = aRowRect.Top() + TABWIN_SPACING_Y; - bEnd = TRUE; + bEnd = sal_True; } else { @@ -609,7 +609,7 @@ void OJoinTableView::SetDefaultTabWinPosSize( OTableWindow* pTabWin ) sal_Int32 nCount = m_aTableMap.size() % (nRow+1); ++nCount; aNewPos.Y() = nCount * TABWIN_SPACING_Y + (nCount-1)*CalcZoom(TABWIN_HEIGHT_STD); - bEnd = TRUE; + bEnd = sal_True; } else nRow++; @@ -671,7 +671,7 @@ void OJoinTableView::BeginChildMove( OTableWindow* pTabWin, const Point& rMouseP Point aMousePos = ScreenToOutputPixel( rMousePos ); m_aDragOffset = aMousePos - pTabWin->GetPosPixel(); m_pDragWin->SetZOrder(NULL, WINDOW_ZORDER_FIRST); - m_bTrackingInitiallyMoved = FALSE; + m_bTrackingInitiallyMoved = sal_False; StartTracking(); } @@ -696,10 +696,10 @@ void OJoinTableView::BeginChildSizing( OTableWindow* pTabWin, const Pointer& rPo } //------------------------------------------------------------------------------ -BOOL OJoinTableView::ScrollPane( long nDelta, BOOL bHoriz, BOOL bPaintScrollBars ) +sal_Bool OJoinTableView::ScrollPane( long nDelta, sal_Bool bHoriz, sal_Bool bPaintScrollBars ) { DBG_CHKTHIS(OJoinTableView,NULL); - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; ////////////////////////////////////////////////////////////////////// // ScrollBar-Positionen anpassen @@ -712,12 +712,12 @@ BOOL OJoinTableView::ScrollPane( long nDelta, BOOL bHoriz, BOOL bPaintScrollBars if( nNewThumbPos < 0 ) { nNewThumbPos = 0; - bRet = FALSE; + bRet = sal_False; } if( nNewThumbPos > GetHScrollBar()->GetRange().Max() ) { nNewThumbPos = GetHScrollBar()->GetRange().Max(); - bRet = FALSE; + bRet = sal_False; } GetHScrollBar()->SetThumbPos( nNewThumbPos ); nDelta = GetHScrollBar()->GetThumbPos() - nOldThumbPos; @@ -729,12 +729,12 @@ BOOL OJoinTableView::ScrollPane( long nDelta, BOOL bHoriz, BOOL bPaintScrollBars if( nNewThumbPos < 0 ) { nNewThumbPos = 0; - bRet = FALSE; + bRet = sal_False; } if( nNewThumbPos > GetVScrollBar()->GetRange().Max() ) { nNewThumbPos = GetVScrollBar()->GetRange().Max(); - bRet = FALSE; + bRet = sal_False; } GetVScrollBar()->SetThumbPos( nNewThumbPos ); nDelta = GetVScrollBar()->GetThumbPos() - nOldThumbPos; @@ -745,7 +745,7 @@ BOOL OJoinTableView::ScrollPane( long nDelta, BOOL bHoriz, BOOL bPaintScrollBars // Wenn ScrollOffset bereits an den Grenzen liegt, kein Neuzeichnen if( (GetHScrollBar()->GetThumbPos()==m_aScrollOffset.X()) && (GetVScrollBar()->GetThumbPos()==m_aScrollOffset.Y()) ) - return FALSE; + return sal_False; ////////////////////////////////////////////////////////////////////// // ScrollOffset neu setzen @@ -922,9 +922,9 @@ void OJoinTableView::MouseButtonUp( const MouseEvent& rEvt ) void OJoinTableView::KeyInput( const KeyEvent& rEvt ) { DBG_CHKTHIS(OJoinTableView,NULL); - USHORT nCode = rEvt.GetKeyCode().GetCode(); - BOOL bShift = rEvt.GetKeyCode().IsShift(); - BOOL bCtrl = rEvt.GetKeyCode().IsMod1(); + sal_uInt16 nCode = rEvt.GetKeyCode().GetCode(); + sal_Bool bShift = rEvt.GetKeyCode().IsShift(); + sal_Bool bCtrl = rEvt.GetKeyCode().IsMod1(); if( !bCtrl && !bShift && (nCode==KEY_DELETE) ) { @@ -945,11 +945,11 @@ void OJoinTableView::DeselectConn(OTableConnection* pConn) // die zugehoerigen Eitnraege in der ListBox des Tabellenfenster deselektieren OTableWindow* pWin = pConn->GetSourceWin(); if (pWin && pWin->GetListBox()) - pWin->GetListBox()->SelectAll(FALSE); + pWin->GetListBox()->SelectAll(sal_False); pWin = pConn->GetDestWin(); if (pWin && pWin->GetListBox()) - pWin->GetListBox()->SelectAll(FALSE); + pWin->GetListBox()->SelectAll(sal_False); pConn->Deselect(); m_pSelectedConn = NULL; @@ -974,8 +974,8 @@ void OJoinTableView::SelectConn(OTableConnection* pConn) OTableWindowListBox* pDestBox = pConnDest->GetListBox(); if (pSourceBox && pDestBox) { - pSourceBox->SelectAll(FALSE); - pDestBox->SelectAll(FALSE); + pSourceBox->SelectAll(sal_False); + pDestBox->SelectAll(sal_False); SvLBoxEntry* pFirstSourceVisible = pSourceBox->GetFirstEntryInView(); SvLBoxEntry* pFirstDestVisible = pDestBox->GetFirstEntryInView(); @@ -989,14 +989,14 @@ void OJoinTableView::SelectConn(OTableConnection* pConn) SvLBoxEntry* pSourceEntry = pSourceBox->GetEntryFromText((*aIter)->GetData()->GetSourceFieldName()); if (pSourceEntry) { - pSourceBox->Select(pSourceEntry, TRUE); + pSourceBox->Select(pSourceEntry, sal_True); pSourceBox->MakeVisible(pSourceEntry); } SvLBoxEntry* pDestEntry = pDestBox->GetEntryFromText((*aIter)->GetData()->GetDestFieldName()); if (pDestEntry) { - pDestBox->Select(pDestEntry, TRUE); + pDestBox->Select(pDestEntry, sal_True); pDestBox->MakeVisible(pDestEntry); } @@ -1055,7 +1055,7 @@ sal_Int32 OJoinTableView::getConnectionCount(const OTableWindow* _pFromWin) cons ::std::bind2nd(::std::mem_fun(&OTableConnection::isTableConnection),_pFromWin)); } //------------------------------------------------------------------------------ -BOOL OJoinTableView::ExistsAConn(const OTableWindow* pFrom) const +sal_Bool OJoinTableView::ExistsAConn(const OTableWindow* pFrom) const { DBG_CHKTHIS(OJoinTableView,NULL); return getTableConnections(pFrom) != m_vTableConnection.end(); @@ -1064,7 +1064,7 @@ BOOL OJoinTableView::ExistsAConn(const OTableWindow* pFrom) const void OJoinTableView::ClearAll() { DBG_CHKTHIS(OJoinTableView,NULL); - SetUpdateMode(FALSE); + SetUpdateMode(sal_False); HideTabWins(); @@ -1079,13 +1079,13 @@ void OJoinTableView::ClearAll() m_pSelectedConn = NULL; // scroll to the upper left - ScrollPane(-GetScrollOffset().X(), TRUE, TRUE); - ScrollPane(-GetScrollOffset().Y(), FALSE, TRUE); + ScrollPane(-GetScrollOffset().X(), sal_True, sal_True); + ScrollPane(-GetScrollOffset().Y(), sal_False, sal_True); Invalidate(); } //------------------------------------------------------------------------ -BOOL OJoinTableView::ScrollWhileDragging() +sal_Bool OJoinTableView::ScrollWhileDragging() { DBG_CHKTHIS(OJoinTableView,NULL); OSL_ENSURE(m_pDragWin != NULL, "OJoinTableView::ScrollWhileDragging darf nur waehrend Dragging eines Fensters aufgerufen werden !"); @@ -1099,19 +1099,19 @@ BOOL OJoinTableView::ScrollWhileDragging() Point aLowerRight(aDragWinPos.X() + aDragWinSize.Width(), aDragWinPos.Y() + aDragWinSize.Height()); if (!m_bTrackingInitiallyMoved && (aDragWinPos == m_pDragWin->GetPosPixel())) - return TRUE; + return sal_True; // Darstellungsfehler vermeiden (wenn bei aktivem TrackingRect gescrollt wird) HideTracking(); - BOOL bScrolling = FALSE; - BOOL bNeedScrollTimer = FALSE; + sal_Bool bScrolling = sal_False; + sal_Bool bNeedScrollTimer = sal_False; // An Fenstergrenzen scrollen // TODO : nur dann abfangen, wenn das Fenster komplett verschwinden wuerde (nicht, solange noch ein Pixel sichtbar ist) if( aDragWinPos.X() < 5 ) { - bScrolling = ScrollPane( -LINE_SIZE, TRUE, TRUE ); + bScrolling = ScrollPane( -LINE_SIZE, sal_True, sal_True ); if( !bScrolling && (aDragWinPos.X()<0) ) aDragWinPos.X() = 0; @@ -1121,7 +1121,7 @@ BOOL OJoinTableView::ScrollWhileDragging() if( aLowerRight.X() > m_aOutputSize.Width() - 5 ) { - bScrolling = ScrollPane( LINE_SIZE, TRUE, TRUE ) ; + bScrolling = ScrollPane( LINE_SIZE, sal_True, sal_True ) ; if( !bScrolling && ( aLowerRight.X() > m_aOutputSize.Width() ) ) aDragWinPos.X() = m_aOutputSize.Width() - aDragWinSize.Width(); @@ -1131,7 +1131,7 @@ BOOL OJoinTableView::ScrollWhileDragging() if( aDragWinPos.Y() < 5 ) { - bScrolling = ScrollPane( -LINE_SIZE, FALSE, TRUE ); + bScrolling = ScrollPane( -LINE_SIZE, sal_False, sal_True ); if( !bScrolling && (aDragWinPos.Y()<0) ) aDragWinPos.Y() = 0; @@ -1140,7 +1140,7 @@ BOOL OJoinTableView::ScrollWhileDragging() if( aLowerRight.Y() > m_aOutputSize.Height() - 5 ) { - bScrolling = ScrollPane( LINE_SIZE, FALSE, TRUE ); + bScrolling = ScrollPane( LINE_SIZE, sal_False, sal_True ); if( !bScrolling && ( (aDragWinPos.Y() + aDragWinSize.Height()) > m_aOutputSize.Height() ) ) aDragWinPos.Y() = m_aOutputSize.Height() - aDragWinSize.Height(); @@ -1195,32 +1195,32 @@ void OJoinTableView::TabWinSized(OTableWindow* ptWhich, const Point& ptOldPositi } //------------------------------------------------------------------------------ -BOOL OJoinTableView::IsAddAllowed() +sal_Bool OJoinTableView::IsAddAllowed() { DBG_CHKTHIS(OJoinTableView,NULL); // nicht wenn Db readonly if (m_pView->getController().isReadOnly()) - return FALSE; + return sal_False; try { Reference< XConnection> xConnection = m_pView->getController().getConnection(); if(!xConnection.is()) - return FALSE; + return sal_False; // nicht wenn schon zuviele Tabellen Reference < XDatabaseMetaData > xMetaData( xConnection->getMetaData() ); sal_Int32 nMax = xMetaData.is() ? xMetaData->getMaxTablesInSelect() : 0; if (nMax && nMax <= (sal_Int32)m_aTableMap.size()) - return FALSE; + return sal_False; } catch(SQLException&) { - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- void OJoinTableView::executePopup(const Point& _aPos,OTableConnection* _pSelConnection) @@ -1241,7 +1241,7 @@ void OJoinTableView::Command(const CommandEvent& rEvt) { DBG_CHKTHIS(OJoinTableView,NULL); - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; switch (rEvt.GetCommand()) { @@ -1280,7 +1280,7 @@ void OJoinTableView::Command(const CommandEvent& rEvt) } } } - bHandled = TRUE; + bHandled = sal_True; } } if (!bHandled) @@ -1296,7 +1296,7 @@ OTableConnection* OJoinTableView::GetTabConn(const OTableWindow* pLhs,const OTab if ((!pLhs || pLhs->ExistsAConn()) && (!pRhs || pRhs->ExistsAConn())) { - BOOL bFoundStart = _rpFirstAfter ? FALSE : TRUE; + sal_Bool bFoundStart = _rpFirstAfter ? sal_False : sal_True; ::std::vector<OTableConnection*>::const_iterator aIter = m_vTableConnection.begin(); ::std::vector<OTableConnection*>::const_iterator aEnd = m_vTableConnection.end(); @@ -1333,7 +1333,7 @@ OTableConnection* OJoinTableView::GetTabConn(const OTableWindow* pLhs,const OTab pConn = pData; if (pData == _rpFirstAfter) - bFoundStart = TRUE; + bFoundStart = sal_True; } } } @@ -1343,7 +1343,7 @@ OTableConnection* OJoinTableView::GetTabConn(const OTableWindow* pLhs,const OTab //------------------------------------------------------------------------------ long OJoinTableView::PreNotify(NotifyEvent& rNEvt) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; switch (rNEvt.GetType()) { case EVENT_COMMAND: @@ -1355,10 +1355,10 @@ long OJoinTableView::PreNotify(NotifyEvent& rNEvt) if (pData->GetMode() == COMMAND_WHEEL_SCROLL) { if (pData->GetDelta() > 0) - ScrollPane(-10 * pData->GetScrollLines(), pData->IsHorz(), TRUE); + ScrollPane(-10 * pData->GetScrollLines(), pData->IsHorz(), sal_True); else - ScrollPane(10 * pData->GetScrollLines(), pData->IsHorz(), TRUE); - bHandled = TRUE; + ScrollPane(10 * pData->GetScrollLines(), pData->IsHorz(), sal_True); + bHandled = sal_True; } } } @@ -1379,7 +1379,7 @@ long OJoinTableView::PreNotify(NotifyEvent& rNEvt) if (!HasChildPathFocus()) break; - BOOL bForward = !pKeyEvent->GetKeyCode().IsShift(); + sal_Bool bForward = !pKeyEvent->GetKeyCode().IsShift(); // is there an active tab win ? OTableWindowMapIterator aIter = m_aTableMap.begin(); OTableWindowMapIterator aEnd = m_aTableMap.end(); diff --git a/dbaccess/source/ui/querydesign/QTableConnectionData.cxx b/dbaccess/source/ui/querydesign/QTableConnectionData.cxx index 4f7e2d399..2d0195b16 100644 --- a/dbaccess/source/ui/querydesign/QTableConnectionData.cxx +++ b/dbaccess/source/ui/querydesign/QTableConnectionData.cxx @@ -160,9 +160,9 @@ OTableConnectionData* OQueryTableConnectionData::NewInstance() const return new OQueryTableConnectionData(); } // ----------------------------------------------------------------------------- -BOOL OQueryTableConnectionData::Update() +sal_Bool OQueryTableConnectionData::Update() { - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/querydesign/QTableConnectionData.hxx b/dbaccess/source/ui/querydesign/QTableConnectionData.hxx index 061541663..2abf703fd 100644 --- a/dbaccess/source/ui/querydesign/QTableConnectionData.hxx +++ b/dbaccess/source/ui/querydesign/QTableConnectionData.hxx @@ -66,7 +66,7 @@ namespace dbaui @return true if successful */ - virtual BOOL Update(); + virtual sal_Bool Update(); ::rtl::OUString GetAliasName(EConnectionSide nWhich) const; diff --git a/dbaccess/source/ui/querydesign/QTableWindow.hxx b/dbaccess/source/ui/querydesign/QTableWindow.hxx index b1fe23703..5d90264f1 100644 --- a/dbaccess/source/ui/querydesign/QTableWindow.hxx +++ b/dbaccess/source/ui/querydesign/QTableWindow.hxx @@ -54,12 +54,12 @@ namespace dbaui } // spaeter Constructor, die Basisklasse ERZEUGT beim ersten Aufruf die Listbox - virtual BOOL Init(); + virtual sal_Bool Init(); inline sal_Int32 GetAliasNum() const { return m_nAliasNum; } - BOOL ExistsField(const ::rtl::OUString& strFieldName, OTableFieldDescRef& rInfo); - BOOL ExistsAVisitedConn() const; + sal_Bool ExistsField(const ::rtl::OUString& strFieldName, OTableFieldDescRef& rInfo); + sal_Bool ExistsAVisitedConn() const; virtual ::rtl::OUString GetName() const { return GetWinName(); } diff --git a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx index c94bc1e39..b616acd41 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx +++ b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx @@ -43,16 +43,16 @@ namespace dbaui { protected: OSelectionBrowseBox* pOwner; - USHORT m_nColumnPostion; + sal_uInt16 m_nColumnPostion; virtual void Undo() = 0; virtual void Redo() = 0; public: - OQueryDesignFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, USHORT nCommentID); + OQueryDesignFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, sal_uInt16 nCommentID); virtual ~OQueryDesignFieldUndoAct(); - inline void SetColumnPosition(USHORT _nColumnPostion) + inline void SetColumnPosition(sal_uInt16 _nColumnPostion) { m_nColumnPostion = _nColumnPostion; OSL_ENSURE(m_nColumnPostion != BROWSER_INVALIDID,"Column position was not set add the undo action!"); @@ -107,7 +107,7 @@ namespace dbaui OTableFieldDescRef pDescr; // geloeschte Spaltenbeschreibung public: - OTabFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, USHORT nCommentID) : OQueryDesignFieldUndoAct(pSelBrwBox, nCommentID) { } + OTabFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, sal_uInt16 nCommentID) : OQueryDesignFieldUndoAct(pSelBrwBox, nCommentID) { } void SetTabFieldDescr(OTableFieldDescRef pDescription) { pDescr = pDescription; } }; diff --git a/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx b/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx index 21f37bb16..68b2591f5 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx +++ b/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx @@ -42,7 +42,7 @@ namespace dbaui OJoinTableView* m_pOwner; // in diesem Container spielt sich alles ab public: - OQueryDesignUndoAction(OJoinTableView* pOwner, USHORT nCommentID) : OCommentUndoAction(nCommentID), m_pOwner(pOwner) { } + OQueryDesignUndoAction(OJoinTableView* pOwner, sal_uInt16 nCommentID) : OCommentUndoAction(nCommentID), m_pOwner(pOwner) { } }; } #endif // DBAUI_QUERYDESIGNUNDOACTION_HXX diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 35ee109b1..057e8830e 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -728,7 +728,7 @@ namespace } Reference< XConnection> xConnection = static_cast<OQueryController&>(_pView->getController()).getConnection(); if(!xConnection.is()) - return FALSE; + return sal_False; try { const Reference< XDatabaseMetaData > xMetaData = xConnection->getMetaData(); @@ -953,7 +953,7 @@ namespace aWorkStr += ::dbtools::quoteName(aQuote, aColumnName); } aWorkStr += ::rtl::OUString(' '); - aWorkStr += String::CreateFromAscii( ";ASC;DESC" ).GetToken( (USHORT)eOrder ); + aWorkStr += String::CreateFromAscii( ";ASC;DESC" ).GetToken( (sal_uInt16)eOrder ); aWorkStr += ::rtl::OUString(','); } } @@ -1878,7 +1878,7 @@ namespace pJoinType = pNode->getChild(2); } - if (SQL_ISRULE(pJoinType,join_type) && SQL_ISTOKEN(pJoinType->getChild(0),INNER)) + if (SQL_ISRULE(pJoinType,join_type) && (!pJoinType->count() || SQL_ISTOKEN(pJoinType->getChild(0),INNER))) { eJoinType = INNER_JOIN; } @@ -2098,7 +2098,7 @@ namespace while ( false ); // Durch das Neuerzeugen wurden wieder Undo-Actions in den Manager gestellt - rController.getUndoMgr()->Clear(); + rController.ClearUndoManager(); _pSelectionBrw->Invalidate(); return eErrorCode; } @@ -2453,7 +2453,7 @@ namespace //------------------------------------------------------------------------------ String getParseErrorMessage( SqlParseError _eErrorCode ) { - USHORT nResId; + sal_uInt16 nResId; switch(_eErrorCode) { case eIllegalJoin: @@ -3149,7 +3149,7 @@ void OQueryDesignView::initByFieldDescriptions( const Sequence< PropertyValue >& InsertField( pField, sal_True, sal_False ); } - rController.getUndoMgr()->Clear(); + rController.ClearUndoManager(); m_pSelectionBox->Invalidate(); } diff --git a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx index 7e11cddc7..df2663f47 100644 --- a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx +++ b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx @@ -51,10 +51,10 @@ OQueryTabConnUndoAction::~OQueryTabConnUndoAction() } // ------------------------------------------------------------------------------------------------ -OQueryTabConnUndoAction::OQueryTabConnUndoAction(OQueryTableView* pOwner, USHORT nCommentID) +OQueryTabConnUndoAction::OQueryTabConnUndoAction(OQueryTableView* pOwner, sal_uInt16 nCommentID) :OQueryDesignUndoAction(pOwner, nCommentID) ,m_pConnection(NULL) - ,m_bOwnerOfConn(FALSE) + ,m_bOwnerOfConn(sal_False) { DBG_CTOR(OQueryTabConnUndoAction,NULL); } @@ -67,13 +67,13 @@ OQueryAddTabConnUndoAction::OQueryAddTabConnUndoAction(OQueryTableView* pOwner) void OQueryAddTabConnUndoAction::Undo() { static_cast<OQueryTableView*>(m_pOwner)->DropConnection(m_pConnection); - SetOwnership(TRUE); + SetOwnership(sal_True); } // ----------------------------------------------------------------------------- void OQueryAddTabConnUndoAction::Redo() { static_cast<OQueryTableView*>(m_pOwner)->GetConnection(m_pConnection); - SetOwnership(FALSE); + SetOwnership(sal_False); } // ----------------------------------------------------------------------------- OQueryDelTabConnUndoAction::OQueryDelTabConnUndoAction(OQueryTableView* pOwner) @@ -84,13 +84,13 @@ OQueryDelTabConnUndoAction::OQueryDelTabConnUndoAction(OQueryTableView* pOwner) void OQueryDelTabConnUndoAction::Undo() { static_cast<OQueryTableView*>(m_pOwner)->GetConnection(m_pConnection); - SetOwnership(FALSE); + SetOwnership(sal_False); } // ----------------------------------------------------------------------------- void OQueryDelTabConnUndoAction::Redo() { static_cast<OQueryTableView*>(m_pOwner)->DropConnection(m_pConnection); - SetOwnership(TRUE); + SetOwnership(sal_True); } // ----------------------------------------------------------------------------- OQueryTabWinShowUndoAct::OQueryTabWinShowUndoAct(OQueryTableView* pOwner) @@ -105,13 +105,13 @@ OQueryTabWinShowUndoAct::~OQueryTabWinShowUndoAct() void OQueryTabWinShowUndoAct::Undo() { static_cast<OQueryTableView*>(m_pOwner)->HideTabWin(m_pTabWin, this); - SetOwnership(TRUE); + SetOwnership(sal_True); } // ----------------------------------------------------------------------------- void OQueryTabWinShowUndoAct::Redo() { static_cast<OQueryTableView*>(m_pOwner)->ShowTabWin(m_pTabWin, this,sal_True); - SetOwnership(FALSE); + SetOwnership(sal_False); } // ----------------------------------------------------------------------------- OQueryTabWinDelUndoAct::OQueryTabWinDelUndoAct(OQueryTableView* pOwner) @@ -126,13 +126,13 @@ OQueryTabWinDelUndoAct::~OQueryTabWinDelUndoAct() void OQueryTabWinDelUndoAct::Undo() { static_cast<OQueryTableView*>(m_pOwner)->ShowTabWin( m_pTabWin, this,sal_True ); - SetOwnership(FALSE); + SetOwnership(sal_False); } // ----------------------------------------------------------------------------- void OQueryTabWinDelUndoAct::Redo() { static_cast<OQueryTableView*>(m_pOwner)->HideTabWin( m_pTabWin, this ); - SetOwnership(TRUE); + SetOwnership(sal_True); } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx index 3dcfa4cac..07d6d17ac 100644 --- a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx +++ b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx @@ -38,11 +38,11 @@ namespace dbaui { protected: OQueryTableConnection* m_pConnection; - BOOL m_bOwnerOfConn; + sal_Bool m_bOwnerOfConn; // bin ich alleiniger Eigentuemer der Connection ? (aendert sich mit jedem Redo oder Undo) public: - OQueryTabConnUndoAction(OQueryTableView* pOwner, USHORT nCommentID); + OQueryTabConnUndoAction(OQueryTableView* pOwner, sal_uInt16 nCommentID); virtual ~OQueryTabConnUndoAction(); virtual void Undo() = 0; @@ -50,7 +50,7 @@ namespace dbaui void SetConnection(OQueryTableConnection* pConn) { m_pConnection = pConn; } // anschliessend bitte SetOwnership - void SetOwnership(BOOL bTakeIt) { m_bOwnerOfConn = bTakeIt; } + void SetOwnership(sal_Bool bTakeIt) { m_bOwnerOfConn = bTakeIt; } }; } #endif // DBAUI_QUERYTABCONNUNDOACTION_HXX diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx index 9c1de0aff..365e6d8d5 100644 --- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx +++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx @@ -40,7 +40,7 @@ using namespace dbaui; DBG_NAME(OQueryDesignFieldUndoAct) -OQueryDesignFieldUndoAct::OQueryDesignFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, USHORT nCommentID) +OQueryDesignFieldUndoAct::OQueryDesignFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, sal_uInt16 nCommentID) : OCommentUndoAction(nCommentID) , pOwner(pSelBrwBox) , m_nColumnPostion(BROWSER_INVALIDID) @@ -57,7 +57,7 @@ OQueryDesignFieldUndoAct::~OQueryDesignFieldUndoAct() DBG_NAME(OQueryTabWinUndoAct ) // ------------------------------------------------------------------------------------------------ -OQueryTabWinUndoAct::OQueryTabWinUndoAct(OQueryTableView* pOwner, USHORT nCommentID) +OQueryTabWinUndoAct::OQueryTabWinUndoAct(OQueryTableView* pOwner, sal_uInt16 nCommentID) :OQueryDesignUndoAction(pOwner, nCommentID) ,m_pTabWin(NULL) { @@ -95,7 +95,7 @@ void OTabFieldCellModifiedUndoAct::Undo() OSL_ENSURE(m_nColumnPostion < pOwner->GetColumnCount(),"Position outside the column count!"); if ( m_nColumnPostion != BROWSER_INVALIDID ) { - USHORT nColumnId = pOwner->GetColumnId(m_nColumnPostion); + sal_uInt16 nColumnId = pOwner->GetColumnId(m_nColumnPostion); String strNext = pOwner->GetCellContents(m_nCellIndex, nColumnId); pOwner->SetCellContents(m_nCellIndex, nColumnId, m_strNextCellContents); m_strNextCellContents = strNext; @@ -110,7 +110,7 @@ void OTabFieldSizedUndoAct::Undo() OSL_ENSURE(m_nColumnPostion != BROWSER_INVALIDID,"Column position was not set add the undo action!"); if ( m_nColumnPostion != BROWSER_INVALIDID ) { - USHORT nColumnId = pOwner->GetColumnId(m_nColumnPostion); + sal_uInt16 nColumnId = pOwner->GetColumnId(m_nColumnPostion); long nNextWidth = pOwner->GetColumnWidth(nColumnId); pOwner->SetColWidth(nColumnId, m_nNextWidth); m_nNextWidth = nNextWidth; @@ -125,9 +125,9 @@ void OTabFieldMovedUndoAct::Undo() if ( m_nColumnPostion != BROWSER_INVALIDID ) { sal_uInt16 nId = pDescr->GetColumnId(); - USHORT nOldPos = pOwner->GetColumnPos(nId); + sal_uInt16 nOldPos = pOwner->GetColumnPos(nId); pOwner->SetColumnPos(nId,m_nColumnPostion); - pOwner->ColumnMoved(nId,FALSE); + pOwner->ColumnMoved(nId,sal_False); m_nColumnPostion = nOldPos; } pOwner->LeaveUndoMode(); diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx index e1e055ce2..54b88b82f 100644 --- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx +++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx @@ -49,14 +49,14 @@ namespace dbaui protected: ::std::vector<OTableConnection*> m_vTableConnection; OQueryTableWindow* m_pTabWin; - BOOL m_bOwnerOfObjects; + sal_Bool m_bOwnerOfObjects; // bin ich alleiniger Eigentuemer der verwalteten Objekte ? (aendert sich mit jedem Redo oder Undo) public: - OQueryTabWinUndoAct(OQueryTableView* pOwner, USHORT nCommentID); + OQueryTabWinUndoAct(OQueryTableView* pOwner, sal_uInt16 nCommentID); virtual ~OQueryTabWinUndoAct(); - void SetOwnership(BOOL bTakeIt) { m_bOwnerOfObjects = bTakeIt; } + void SetOwnership(sal_Bool bTakeIt) { m_bOwnerOfObjects = bTakeIt; } virtual void Undo() = 0; @@ -67,7 +67,7 @@ namespace dbaui // anschliessend sollte das SetOwnership aufgerufen werden // Zugriff auf die verwalteten Connections - USHORT ConnCount() { return (USHORT)m_vTableConnection.size(); } + sal_uInt16 ConnCount() { return (sal_uInt16)m_vTableConnection.size(); } ::std::vector<OTableConnection*>* GetTabConnList() { return &m_vTableConnection; } diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx index e79282d55..8bee8c6d3 100644 --- a/dbaccess/source/ui/querydesign/QueryTableView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx @@ -131,7 +131,7 @@ namespace @return true when OK was pressed otherwise false */ - sal_Bool openJoinDialog(OQueryTableView* _pView,const TTableConnectionData::value_type& _pConnectionData,BOOL _bSelectableTables) + sal_Bool openJoinDialog(OQueryTableView* _pView,const TTableConnectionData::value_type& _pConnectionData,sal_Bool _bSelectableTables) { OQueryTableConnectionData* pData = static_cast< OQueryTableConnectionData*>(_pConnectionData.get()); @@ -690,7 +690,7 @@ void OQueryTableView::AddConnection(const OJoinExchangeData& jxdSource, const OJ void OQueryTableView::ConnDoubleClicked(OTableConnection* pConnection) { DBG_CHKTHIS(OQueryTableView,NULL); - if( openJoinDialog(this,pConnection->GetData(),FALSE) ) + if( openJoinDialog(this,pConnection->GetData(),sal_False) ) { connectionModified(this,pConnection,sal_False); SelectConn( pConnection ); @@ -700,7 +700,7 @@ void OQueryTableView::ConnDoubleClicked(OTableConnection* pConnection) void OQueryTableView::createNewConnection() { TTableConnectionData::value_type pData(new OQueryTableConnectionData()); - if( openJoinDialog(this,pData,TRUE) ) + if( openJoinDialog(this,pData,sal_True) ) { OTableWindowMap* pMap = GetTabWinMap(); OQueryTableWindow* pSourceWin = static_cast< OQueryTableWindow*>((*pMap)[pData->getReferencingTable()->GetWinName()]); @@ -785,8 +785,8 @@ void OQueryTableView::RemoveTabWin(OTableWindow* pTabWin) // mein Parent brauche ich, da es vom Loeschen erfahren soll OQueryDesignView* pParent = static_cast<OQueryDesignView*>(getDesignView()); - SfxUndoManager* pUndoMgr = m_pView->getController().getUndoMgr(); - pUndoMgr->EnterListAction( String( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), String() ); + SfxUndoManager& rUndoMgr = m_pView->getController().GetUndoManager(); + rUndoMgr.EnterListAction( String( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), String() ); // Undo-Action anlegen OQueryTabWinDelUndoAct* pUndoAction = new OQueryTabWinDelUndoAct(this); @@ -799,7 +799,7 @@ void OQueryTableView::RemoveTabWin(OTableWindow* pTabWin) pParent->TableDeleted( static_cast< OQueryTableWindowData*>(pTabWin->GetData().get())->GetAliasName() ); m_pView->getController().addUndoActionAndInvalidate( pUndoAction ); - pUndoMgr->LeaveListAction(); + rUndoMgr.LeaveListAction(); if (m_lnkTabWinsChangeHandler.IsSet()) { diff --git a/dbaccess/source/ui/querydesign/QueryTextView.cxx b/dbaccess/source/ui/querydesign/QueryTextView.cxx index 745b9e48f..90b21b69d 100644 --- a/dbaccess/source/ui/querydesign/QueryTextView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTextView.cxx @@ -57,7 +57,7 @@ OQueryTextView::OQueryTextView(OQueryContainerWindow* _pParent) { DBG_CTOR(OQueryTextView,NULL); m_pEdit = new OSqlEdit(this); - m_pEdit->SetRightToLeft(FALSE); + m_pEdit->SetRightToLeft(sal_False); m_pEdit->ClearModifyFlag(); m_pEdit->SaveValue(); m_pEdit->SetPosPixel( Point( 0, 0 ) ); diff --git a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx index 7fee959e7..fb1153e1a 100644 --- a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx +++ b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx @@ -280,7 +280,7 @@ bool OQueryViewSwitch::impl_postViewSwitch( const bool i_bGraphicalDesign, const if ( pContainer ) pContainer->Resize(); - m_pDesignView->getController().getUndoMgr()->Clear(); + m_pDesignView->getController().ClearUndoManager(); m_pDesignView->getController().InvalidateAll(); return i_bSuccess; diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index eef516ee5..a66988def 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -217,7 +217,7 @@ void OSelectionBrowseBox::initialize() m_aFunctionStrings += String(RTL_CONSTASCII_USTRINGPARAM(";")); m_aFunctionStrings += sGroup; - // Diese Funktionen stehen nur unter CORE zur Verfügung + // Diese Funktionen stehen nur unter CORE zur Verf�gung if ( lcl_SupportsCoreSQLGrammar(xConnection) ) { xub_StrLen nCount = m_aFunctionStrings.GetTokenCount(); @@ -303,15 +303,15 @@ BrowserHeader* OSelectionBrowseBox::imp_CreateHeaderBar(BrowseBox* /*pParent*/) return new OSelectionBrwBoxHeader(this); } // ----------------------------------------------------------------------------- -void OSelectionBrowseBox::ColumnMoved( USHORT nColId,BOOL _bCreateUndo ) +void OSelectionBrowseBox::ColumnMoved( sal_uInt16 nColId,sal_Bool _bCreateUndo ) { EditBrowseBox::ColumnMoved( nColId ); // swap the two columns - USHORT nNewPos = GetColumnPos( nColId ); + sal_uInt16 nNewPos = GetColumnPos( nColId ); OTableFields& rFields = getFields(); - if ( rFields.size() > USHORT(nNewPos-1) ) + if ( rFields.size() > sal_uInt16(nNewPos-1) ) { - USHORT nOldPos = 0; + sal_uInt16 nOldPos = 0; OTableFields::iterator aEnd = rFields.end(); OTableFields::iterator aIter = rFields.begin(); for (; aIter != aEnd && ( (*aIter)->GetColumnId() != nColId ); ++aIter,++nOldPos) @@ -484,7 +484,7 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon OSL_ENSURE(nColId != BROWSER_INVALIDID,"An Invalid Id was set!"); if ( nColId == BROWSER_INVALIDID ) return; - USHORT nPos = GetColumnPos(nColId); + sal_uInt16 nPos = GetColumnPos(nColId); if ( nPos == 0 || nPos == BROWSER_INVALIDID || nPos > getFields().size() ) return; OTableFieldDescRef pEntry = getFields()[nPos-1]; @@ -556,7 +556,7 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon } break; case BROW_ORDER_ROW: m_pOrderCell->SelectEntryPos( - sal::static_int_cast< USHORT >(pEntry->GetOrderDir())); + sal::static_int_cast< sal_uInt16 >(pEntry->GetOrderDir())); enableControl(pEntry,m_pOrderCell); break; case BROW_COLUMNALIAS_ROW: @@ -574,14 +574,14 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon Controller()->ClearModified(); } // ----------------------------------------------------------------------------- -void OSelectionBrowseBox::notifyTableFieldChanged(const String& _sOldAlias,const String& _sAlias,sal_Bool& _bListAction,USHORT _nColumnId) +void OSelectionBrowseBox::notifyTableFieldChanged(const String& _sOldAlias,const String& _sAlias,sal_Bool& _bListAction,sal_uInt16 _nColumnId) { appendUndoAction(_sOldAlias,_sAlias,BROW_TABLE_ROW,_bListAction); if ( m_bVisibleRow[BROW_TABLE_ROW] ) RowModified(GetBrowseRow(BROW_TABLE_ROW), _nColumnId); } // ----------------------------------------------------------------------------- -void OSelectionBrowseBox::notifyFunctionFieldChanged(const String& _sOldFunctionName,const String& _sFunctionName,sal_Bool& _bListAction,USHORT _nColumnId) +void OSelectionBrowseBox::notifyFunctionFieldChanged(const String& _sOldFunctionName,const String& _sFunctionName,sal_Bool& _bListAction,sal_uInt16 _nColumnId) { appendUndoAction(_sOldFunctionName,_sFunctionName,BROW_FUNCTION_ROW,_bListAction); if ( !m_bVisibleRow[BROW_FUNCTION_ROW] ) @@ -589,7 +589,7 @@ void OSelectionBrowseBox::notifyFunctionFieldChanged(const String& _sOldFunction RowModified(GetBrowseRow(BROW_FUNCTION_ROW), _nColumnId); } // ----------------------------------------------------------------------------- -void OSelectionBrowseBox::clearEntryFunctionField(const String& _sFieldName,OTableFieldDescRef& _pEntry,sal_Bool& _bListAction,USHORT _nColumnId) +void OSelectionBrowseBox::clearEntryFunctionField(const String& _sFieldName,OTableFieldDescRef& _pEntry,sal_Bool& _bListAction,sal_uInt16 _nColumnId) { if ( isFieldNameAsterix( _sFieldName ) && (!_pEntry->isNoneFunction() || _pEntry->IsGroupBy()) ) { @@ -754,14 +754,14 @@ sal_Bool OSelectionBrowseBox::saveField(const String& _sFieldName,OTableFieldDes ::comphelper::UStringMixEqual bCase(xMetaData->supportsMixedCaseQuotedIdentifiers()); OTableFieldDescRef aSelEntry = _pEntry; - USHORT nColumnId = aSelEntry->GetColumnId(); + sal_uInt16 nColumnId = aSelEntry->GetColumnId(); sal_uInt32 nCount = pSelection->count(); for (sal_uInt32 i = 0; i < nCount; ++i) { if ( i > 0 ) // may we have to append more than one field { - USHORT nColumnPostion; + sal_uInt16 nColumnPostion; aSelEntry = FindFirstFreeCol(nColumnPostion); if ( !aSelEntry.is() ) { @@ -919,8 +919,8 @@ sal_Bool OSelectionBrowseBox::SaveModified() DBG_CHKTHIS(OSelectionBrowseBox,NULL); OQueryController& rController = static_cast<OQueryController&>(getDesignView()->getController()); OTableFieldDescRef pEntry = NULL; - USHORT nCurrentColumnPos = GetColumnPos(GetCurColumnId()); - if(getFields().size() > static_cast<USHORT>(nCurrentColumnPos - 1)) + sal_uInt16 nCurrentColumnPos = GetColumnPos(GetCurColumnId()); + if(getFields().size() > static_cast<sal_uInt16>(nCurrentColumnPos - 1)) pEntry = getEntry(nCurrentColumnPos - 1); sal_Bool bWasEmpty = pEntry.is() ? pEntry->IsEmpty() : sal_False; @@ -972,9 +972,9 @@ sal_Bool OSelectionBrowseBox::SaveModified() strOldCellContents = pEntry->GetField(); bListAction = sal_True; if ( !m_bInUndoMode ) - rController.getUndoMgr()->EnterListAction(String(),String()); + rController.GetUndoManager().EnterListAction(String(),String()); - USHORT nPos = m_pFieldCell->GetEntryPos(aFieldName); + sal_uInt16 nPos = m_pFieldCell->GetEntryPos(aFieldName); String aAliasName = pEntry->GetAlias(); if ( nPos != COMBOBOX_ENTRY_NOTFOUND && !aAliasName.Len() && aFieldName.GetTokenCount('.') > 1 ) { // special case, we have a table field so we must cut the table name @@ -1001,7 +1001,7 @@ sal_Bool OSelectionBrowseBox::SaveModified() { sNewValue = aFieldName; if ( !m_bInUndoMode ) - static_cast<OQueryController&>(getDesignView()->getController()).getUndoMgr()->LeaveListAction(); + static_cast<OQueryController&>(getDesignView()->getController()).GetUndoManager().LeaveListAction(); bListAction = sal_False; } else @@ -1068,7 +1068,7 @@ sal_Bool OSelectionBrowseBox::SaveModified() { strOldCellContents = pEntry->GetFunction(); sal_uInt16 nPos = m_pFunctionCell->GetSelectEntryPos(); - // Diese Funktionen stehen nur unter CORE zur Verfügung + // Diese Funktionen stehen nur unter CORE zur Verf�gung String sFunctionName = m_pFunctionCell->GetEntry(nPos); String sGroupFunctionName = m_aFunctionStrings.GetToken(m_aFunctionStrings.GetTokenCount()-1); sal_Bool bGroupBy = sal_False; @@ -1205,7 +1205,7 @@ sal_Bool OSelectionBrowseBox::SaveModified() if ( bAppendRow ) { - RowInserted( GetRowCount()-1, 1, TRUE ); + RowInserted( GetRowCount()-1, 1, sal_True ); m_bVisibleRow.push_back(sal_True); ++m_nVisibleCount; } @@ -1227,12 +1227,12 @@ sal_Bool OSelectionBrowseBox::SaveModified() RowModified(BROW_VIS_ROW, GetCurColumnId()); // wenn noetig neue freie Spalten anlegen - USHORT nDummy; + sal_uInt16 nDummy; CheckFreeColumns(nDummy); } if ( bListAction && !m_bInUndoMode ) - static_cast<OQueryController&>(getDesignView()->getController()).getUndoMgr()->LeaveListAction(); + static_cast<OQueryController&>(getDesignView()->getController()).GetUndoManager().LeaveListAction(); return pEntry != NULL && !bError; } @@ -1257,7 +1257,7 @@ void OSelectionBrowseBox::PaintCell(OutputDevice& rDev, const Rectangle& rRect, rDev.SetClipRegion( rRect ); OTableFieldDescRef pEntry = NULL; - USHORT nPos = GetColumnPos(nColumnId); + sal_uInt16 nPos = GetColumnPos(nColumnId); if(getFields().size() > sal_uInt16(nPos - 1)) pEntry = getFields()[nPos - 1]; @@ -1289,12 +1289,12 @@ void OSelectionBrowseBox::PaintStatusCell(OutputDevice& rDev, const Rectangle& r } //------------------------------------------------------------------------------ -void OSelectionBrowseBox::RemoveColumn(USHORT _nColumnId) +void OSelectionBrowseBox::RemoveColumn(sal_uInt16 _nColumnId) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); OQueryController& rController = static_cast<OQueryController&>(getDesignView()->getController()); - USHORT nPos = GetColumnPos(_nColumnId); + sal_uInt16 nPos = GetColumnPos(_nColumnId); // das Control sollte immer genau eine Spalte mehr haben, naemlich die HandleColumn OSL_ENSURE((nPos == 0) || (nPos <= getFields().size()), "OSelectionBrowseBox::RemoveColumn : invalid parameter nColId"); // ColId ist bei mir gleichbedeutend mit Position, und da sollte die Bedingung natuerlich zutreffen @@ -1329,7 +1329,7 @@ void OSelectionBrowseBox::RemoveField(sal_uInt16 nColumnId ) DBG_CHKTHIS(OSelectionBrowseBox,NULL); OQueryController& rController = static_cast<OQueryController&>(getDesignView()->getController()); - USHORT nPos = GetColumnPos(nColumnId); + sal_uInt16 nPos = GetColumnPos(nColumnId); OSL_ENSURE(getFields().size() > sal_uInt16(nPos-1),"ID is to great!"); OTableFieldDescRef pDesc = getEntry((sal_uInt32)(nPos - 1)) ; @@ -1352,7 +1352,7 @@ void OSelectionBrowseBox::RemoveField(sal_uInt16 nColumnId ) //------------------------------------------------------------------------------ void OSelectionBrowseBox::adjustSelectionMode( sal_Bool _bClickedOntoHeader, sal_Bool _bClickedOntoHandleCol ) { - // wenn ein Header selectiert wird, muß die selection angezeigt werden, sonst nicht) + // wenn ein Header selectiert wird, mu� die selection angezeigt werden, sonst nicht) if ( _bClickedOntoHeader ) { if (0 == GetSelectColumnCount() ) @@ -1471,7 +1471,7 @@ OTableFieldDescRef OSelectionBrowseBox::AppendNewCol( sal_uInt16 nCnt) { OTableFieldDescRef pEmptyEntry = new OTableFieldDesc(); getFields().push_back(pEmptyEntry); - USHORT nColumnId = sal::static_int_cast< USHORT >(getFields().size()); + sal_uInt16 nColumnId = sal::static_int_cast< sal_uInt16 >(getFields().size()); pEmptyEntry->SetColumnId( nColumnId ); InsertDataColumn( nColumnId , String(), DEFAULT_SIZE, HIB_STDSTYLE, HEADERBAR_APPEND); @@ -1495,7 +1495,7 @@ void OSelectionBrowseBox::DeleteFields(const String& rAliasName) OTableFields::reverse_iterator aIter = getFields().rbegin(); OTableFieldDescRef pEntry = NULL; - for(USHORT nPos=sal::static_int_cast< USHORT >(getFields().size());aIter != getFields().rend();++aIter,--nPos) + for(sal_uInt16 nPos=sal::static_int_cast< sal_uInt16 >(getFields().size());aIter != getFields().rend();++aIter,--nPos) { pEntry = *aIter; if ( pEntry->GetAlias().equals( rAliasName ) ) @@ -1547,7 +1547,7 @@ Rectangle OSelectionBrowseBox::GetInvalidRect( sal_uInt16 nColId ) } //------------------------------------------------------------------------------ -void OSelectionBrowseBox::InsertColumn(OTableFieldDescRef pEntry, USHORT& _nColumnPostion) +void OSelectionBrowseBox::InsertColumn(OTableFieldDescRef pEntry, sal_uInt16& _nColumnPostion) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); // das Control sollte immer genau eine Spalte mehr haben, naemlich die HandleColumn @@ -1560,14 +1560,14 @@ void OSelectionBrowseBox::InsertColumn(OTableFieldDescRef pEntry, USHORT& _nColu DeactivateCell(); // remember the column id of the current positon - USHORT nColumnId = GetColumnId(_nColumnPostion); + sal_uInt16 nColumnId = GetColumnId(_nColumnPostion); // Wenn zu klein oder zu gross, auf Ende der Liste setzen if ((_nColumnPostion == BROWSER_INVALIDID) || (_nColumnPostion >= getFields().size())) // Anhaengen des Feldes { if (FindFirstFreeCol(_nColumnPostion) == NULL) // keine freie Column mehr { AppendNewCol(1); - _nColumnPostion = sal::static_int_cast< USHORT >( + _nColumnPostion = sal::static_int_cast< sal_uInt16 >( getFields().size()); } else @@ -1580,14 +1580,14 @@ void OSelectionBrowseBox::InsertColumn(OTableFieldDescRef pEntry, USHORT& _nColu // check if the column ids are identical, if not we have to move if ( pEntry->GetColumnId() != nColumnId ) { - USHORT nOldPosition = GetColumnPos(pEntry->GetColumnId()); + sal_uInt16 nOldPosition = GetColumnPos(pEntry->GetColumnId()); OSL_ENSURE( nOldPosition != 0,"Old position was 0. Not possible!"); SetColumnPos(pEntry->GetColumnId(),_nColumnPostion); // we have to delete an empty field for the fields list, because the columns must have equal length if ( nOldPosition > 0 && nOldPosition <= getFields().size() ) getFields()[nOldPosition - 1] = pEntry; - ColumnMoved(pEntry->GetColumnId(),FALSE); + ColumnMoved(pEntry->GetColumnId(),sal_False); } if ( pEntry->GetFunctionType() & (FKT_AGGREGATE) ) @@ -1611,7 +1611,7 @@ void OSelectionBrowseBox::InsertColumn(OTableFieldDescRef pEntry, USHORT& _nColu } //------------------------------------------------------------------------------ -OTableFieldDescRef OSelectionBrowseBox::InsertField(const OJoinExchangeData& jxdSource, USHORT _nColumnPostion, sal_Bool bVis, sal_Bool bActivate) +OTableFieldDescRef OSelectionBrowseBox::InsertField(const OJoinExchangeData& jxdSource, sal_uInt16 _nColumnPostion, sal_Bool bVis, sal_Bool bActivate) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); OQueryTableWindow* pSourceWin = static_cast<OQueryTableWindow*>(jxdSource.pListBox->GetTabWin()); @@ -1637,7 +1637,7 @@ OTableFieldDescRef OSelectionBrowseBox::InsertField(const OJoinExchangeData& jxd } //------------------------------------------------------------------------------ -OTableFieldDescRef OSelectionBrowseBox::InsertField(const OTableFieldDescRef& _rInfo, USHORT _nColumnPostion, sal_Bool bVis, sal_Bool bActivate) +OTableFieldDescRef OSelectionBrowseBox::InsertField(const OTableFieldDescRef& _rInfo, sal_uInt16 _nColumnPostion, sal_Bool bVis, sal_Bool bActivate) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1683,7 +1683,7 @@ sal_uInt16 OSelectionBrowseBox::FieldsCount() } //------------------------------------------------------------------------------ -OTableFieldDescRef OSelectionBrowseBox::FindFirstFreeCol(USHORT& _rColumnPosition ) +OTableFieldDescRef OSelectionBrowseBox::FindFirstFreeCol(sal_uInt16& _rColumnPosition ) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); OTableFields::iterator aIter = getFields().begin(); @@ -1704,7 +1704,7 @@ OTableFieldDescRef OSelectionBrowseBox::FindFirstFreeCol(USHORT& _rColumnPositio } //------------------------------------------------------------------------------ -void OSelectionBrowseBox::CheckFreeColumns(USHORT& _rColumnPosition) +void OSelectionBrowseBox::CheckFreeColumns(sal_uInt16& _rColumnPosition) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); if (FindFirstFreeCol(_rColumnPosition) == NULL) @@ -1788,7 +1788,7 @@ void OSelectionBrowseBox::DuplicateConditionLevel( const sal_uInt16 nLevel) pEntry->SetCriteria( nNewLevel, sValue); if ( nNewLevel == (m_nVisibleCount-BROW_CRIT1_ROW-1) ) { - RowInserted( GetRowCount()-1, 1, TRUE ); + RowInserted( GetRowCount()-1, 1, sal_True ); m_bVisibleRow.push_back(sal_True); ++m_nVisibleCount; } @@ -1836,7 +1836,7 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const S pEntry->SetCriteria( nLevel, rValue); if(nLevel == (m_nVisibleCount-BROW_CRIT1_ROW-1)) { - RowInserted( GetRowCount()-1, 1, TRUE ); + RowInserted( GetRowCount()-1, 1, sal_True ); m_bVisibleRow.push_back(sal_True); ++m_nVisibleCount; } @@ -1864,7 +1864,7 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const S pLastEntry->SetCriteria( nLevel, sCriteria); if(nLevel == (m_nVisibleCount-BROW_CRIT1_ROW-1)) { - RowInserted( GetRowCount()-1, 1, TRUE ); + RowInserted( GetRowCount()-1, 1, sal_True ); m_bVisibleRow.push_back(sal_True); ++m_nVisibleCount; } @@ -1881,7 +1881,7 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const S pTmp->SetCriteria( nLevel, rValue); if(nLevel == (m_nVisibleCount-BROW_CRIT1_ROW-1)) { - RowInserted( GetRowCount()-1, 1, TRUE ); + RowInserted( GetRowCount()-1, 1, sal_True ); m_bVisibleRow.push_back(sal_True); ++m_nVisibleCount; } @@ -2022,7 +2022,7 @@ void OSelectionBrowseBox::Command(const CommandEvent& rEvt) if ( 1 == GetSelectColumnCount() ) { sal_uInt16 nSelId = GetColumnId( - sal::static_int_cast< USHORT >( + sal::static_int_cast< sal_uInt16 >( FirstSelectedColumn() ) ); ::Rectangle aColRect( GetFieldRectPixel( 0, nSelId, sal_False ) ); @@ -2145,8 +2145,8 @@ void OSelectionBrowseBox::SetRowVisible(sal_uInt16 _nWhich, sal_Bool _bVis) //------------------------------------------------------------------------------ long OSelectionBrowseBox::GetBrowseRow(long nRowId) const { - USHORT nCount(0); - for(USHORT i = 0 ; i < nRowId ; ++i) + sal_uInt16 nCount(0); + for(sal_uInt16 i = 0 ; i < nRowId ; ++i) { if ( m_bVisibleRow[i] ) ++nCount; @@ -2211,7 +2211,7 @@ String OSelectionBrowseBox::GetCellText(long nRow, sal_uInt16 nColId) const { DBG_CHKTHIS(OSelectionBrowseBox,NULL); - USHORT nPos = GetColumnPos(nColId); + sal_uInt16 nPos = GetColumnPos(nColId); OTableFieldDescRef pEntry = getFields()[nPos-1]; OSL_ENSURE(pEntry != NULL, "OSelectionBrowseBox::GetCellText : invalid column id, prepare for GPF ... "); @@ -2238,7 +2238,7 @@ String OSelectionBrowseBox::GetCellText(long nRow, sal_uInt16 nColId) const } break; case BROW_ORDER_ROW: if (pEntry->GetOrderDir() != ORDER_NONE) - aText = String(ModuleRes(STR_QUERY_SORTTEXT) ).GetToken(sal::static_int_cast< USHORT >(pEntry->GetOrderDir())); + aText = String(ModuleRes(STR_QUERY_SORTTEXT) ).GetToken(sal::static_int_cast< sal_uInt16 >(pEntry->GetOrderDir())); break; case BROW_VIS_ROW: break; @@ -2330,13 +2330,13 @@ sal_Bool OSelectionBrowseBox::GetFunctionName(sal_uInt32 _nFunctionTokenId,Strin return bErg; } //------------------------------------------------------------------------------ -String OSelectionBrowseBox::GetCellContents(sal_Int32 nCellIndex, USHORT nColId) +String OSelectionBrowseBox::GetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); if ( GetCurColumnId() == nColId && !m_bInUndoMode ) SaveModified(); - USHORT nPos = GetColumnPos(nColId); + sal_uInt16 nPos = GetColumnPos(nColId); OTableFieldDescRef pEntry = getFields()[nPos - 1]; OSL_ENSURE(pEntry != NULL, "OSelectionBrowseBox::GetCellContents : invalid column id, prepare for GPF ... "); @@ -2357,14 +2357,14 @@ String OSelectionBrowseBox::GetCellContents(sal_Int32 nCellIndex, USHORT nColId) } //------------------------------------------------------------------------------ -void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, USHORT nColId, const String& strNewText) +void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, sal_uInt16 nColId, const String& strNewText) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); - sal_Bool bWasEditing = IsEditing() && (GetCurColumnId() == nColId) && IsRowVisible(static_cast<USHORT>(nRow)) && (GetCurRow() == static_cast<USHORT>(GetBrowseRow(nRow))); + sal_Bool bWasEditing = IsEditing() && (GetCurColumnId() == nColId) && IsRowVisible(static_cast<sal_uInt16>(nRow)) && (GetCurRow() == static_cast<sal_uInt16>(GetBrowseRow(nRow))); if (bWasEditing) DeactivateCell(); - USHORT nPos = GetColumnPos(nColId); + sal_uInt16 nPos = GetColumnPos(nColId); OTableFieldDescRef pEntry = getEntry(nPos - 1); OSL_ENSURE(pEntry != NULL, "OSelectionBrowseBox::SetCellContents : invalid column id, prepare for GPF ... "); @@ -2414,7 +2414,7 @@ void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, USHORT nColId, const S } long nCellIndex = GetRealRow(nRow); - if(IsRowVisible(static_cast<USHORT>(nRow))) + if(IsRowVisible(static_cast<sal_uInt16>(nRow))) RowModified(nCellIndex, nColId); // die entsprechende Feld-Beschreibung ist jetzt leer -> Visible auf sal_False (damit das konsistent mit normalen leeren Spalten ist) @@ -2448,7 +2448,7 @@ void OSelectionBrowseBox::ColumnResized(sal_uInt16 nColId) // but the changes aren't permanent ... DBG_CHKTHIS(OSelectionBrowseBox,NULL); - USHORT nPos = GetColumnPos(nColId); + sal_uInt16 nPos = GetColumnPos(nColId); OSL_ENSURE(nPos <= getFields().size(),"ColumnResized:: nColId sollte nicht groesser als List::count sein!"); OTableFieldDescRef pEntry = getEntry(nPos-1); OSL_ENSURE(pEntry.is(), "OSelectionBrowseBox::ColumnResized : keine FieldDescription !"); @@ -2473,7 +2473,7 @@ void OSelectionBrowseBox::ColumnResized(sal_uInt16 nColId) sal_uInt32 OSelectionBrowseBox::GetTotalCellWidth(long nRowId, sal_uInt16 nColId) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); - USHORT nPos = GetColumnPos(nColId); + sal_uInt16 nPos = GetColumnPos(nColId); OSL_ENSURE((nPos == 0) || (nPos <= getFields().size()), "OSelectionBrowseBox::GetTotalCellWidth : invalid parameter nColId"); OTableFieldDescRef pEntry = getFields()[nPos-1]; @@ -2592,7 +2592,7 @@ void OSelectionBrowseBox::appendUndoAction(const String& _rOldValue,const String if ( !_bListAction ) { _bListAction = sal_True; - static_cast<OQueryController&>(getDesignView()->getController()).getUndoMgr()->EnterListAction(String(),String()); + static_cast<OQueryController&>(getDesignView()->getController()).GetUndoManager().EnterListAction(String(),String()); } appendUndoAction(_rOldValue,_rNewValue,_nRow); } @@ -2643,12 +2643,12 @@ OTableFields& OSelectionBrowseBox::getFields() const // ----------------------------------------------------------------------------- void OSelectionBrowseBox::enableControl(const OTableFieldDescRef& _rEntry,Window* _pControl) { - BOOL bEnable = !_rEntry->isCondition(); + sal_Bool bEnable = !_rEntry->isCondition(); _pControl->Enable(bEnable); _pControl->EnableInput(bEnable); } // ----------------------------------------------------------------------------- -void OSelectionBrowseBox::setTextCellContext(const OTableFieldDescRef& _rEntry,const String& _sText,ULONG _nHelpId) +void OSelectionBrowseBox::setTextCellContext(const OTableFieldDescRef& _rEntry,const String& _sText,const rtl::OString& _sHelpId) { m_pTextCell->SetText(_sText); m_pTextCell->ClearModifyFlag(); @@ -2657,10 +2657,10 @@ void OSelectionBrowseBox::setTextCellContext(const OTableFieldDescRef& _rEntry,c enableControl(_rEntry,m_pTextCell); - if (m_pTextCell->GetHelpId() != _nHelpId) + if (m_pTextCell->GetHelpId() != _sHelpId) // da TextCell in verschiedenen Kontexten verwendet wird, muss ich den gecachten HelpText loeschen m_pTextCell->SetHelpText(String()); - m_pTextCell->SetHelpId(_nHelpId); + m_pTextCell->SetHelpId(_sHelpId); } // ----------------------------------------------------------------------------- void OSelectionBrowseBox::invalidateUndoRedo() @@ -2683,7 +2683,7 @@ OTableFieldDescRef OSelectionBrowseBox::getEntry(OTableFields::size_type _nPos) { pEntry = new OTableFieldDesc(); pEntry->SetColumnId( - GetColumnId(sal::static_int_cast< USHORT >(_nPos+1))); + GetColumnId(sal::static_int_cast< sal_uInt16 >(_nPos+1))); aFields[_nPos] = pEntry; } return pEntry; @@ -2754,7 +2754,7 @@ void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef& _pEntry) Reference< XConnection> xConnection = static_cast<OQueryController&>(getDesignView()->getController()).getConnection(); if ( xConnection.is() ) { - // Diese Funktionen stehen nur unter CORE zur Verfügung + // Diese Funktionen stehen nur unter CORE zur Verf�gung if ( lcl_SupportsCoreSQLGrammar(xConnection) ) { // if we have an asterix, no other function than count is allowed diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx index 6b01ccb6c..8b100adbc 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx @@ -99,10 +99,10 @@ namespace dbaui ~OSelectionBrowseBox(); void initialize(); - OTableFieldDescRef InsertField( const OJoinExchangeData& jxdSource, USHORT _nColumnPostion = BROWSER_INVALIDID, sal_Bool bVis=sal_True, sal_Bool bActivate=sal_True ); - OTableFieldDescRef InsertField( const OTableFieldDescRef& rInfo, USHORT _nColumnPostion = BROWSER_INVALIDID, sal_Bool bVis=sal_True, sal_Bool bActivate=sal_True ); - void InsertColumn( OTableFieldDescRef pEntry, USHORT& _nColumnPostion ); - void RemoveColumn( USHORT _nColumnId ); + OTableFieldDescRef InsertField( const OJoinExchangeData& jxdSource, sal_uInt16 _nColumnPostion = BROWSER_INVALIDID, sal_Bool bVis=sal_True, sal_Bool bActivate=sal_True ); + OTableFieldDescRef InsertField( const OTableFieldDescRef& rInfo, sal_uInt16 _nColumnPostion = BROWSER_INVALIDID, sal_Bool bVis=sal_True, sal_Bool bActivate=sal_True ); + void InsertColumn( OTableFieldDescRef pEntry, sal_uInt16& _nColumnPostion ); + void RemoveColumn( sal_uInt16 _nColumnId ); void DeleteFields( const String& rAliasName ); bool HasFieldByAliasName(const ::rtl::OUString& rFieldName, OTableFieldDescRef& rInfo) const; @@ -125,8 +125,8 @@ namespace dbaui void SetColWidth(sal_uInt16 nColId, long lNewWidth); // beachtet im Gegensatz zum SetColumnWidth der Basisklasse auch eine eventuell aktive Zelle in dieser Spalte - String GetCellContents(sal_Int32 nCellIndex, USHORT nColId); - void SetCellContents(sal_Int32 nCellIndex, USHORT nColId, const String& strNewText); + String GetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId); + void SetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId, const String& strNewText); // Zelleninhalt (als String formatiert) setzen/liefern sal_Int32 GetNoneVisibleRows() const; void SetNoneVisbleRow(long nRows); @@ -147,8 +147,8 @@ namespace dbaui virtual void GetFocus(); virtual void DeactivateCell(sal_Bool bUpdate = sal_True); - virtual void ColumnMoved( USHORT nColId ) { ColumnMoved(nColId,TRUE); } - void ColumnMoved( USHORT nColId,BOOL _bCreateUndo); + virtual void ColumnMoved( sal_uInt16 nColId ) { ColumnMoved(nColId,sal_True); } + void ColumnMoved( sal_uInt16 nColId,sal_Bool _bCreateUndo); void Fill(); void PreFill(); @@ -168,7 +168,7 @@ namespace dbaui @return the text out of the cell */ - virtual String GetCellText(long _nRow, USHORT _nColId) const; + virtual String GetCellText(long _nRow, sal_uInt16 _nColId) const; /** returns the description of the row. @param _nRow @@ -229,10 +229,10 @@ namespace dbaui void startTimer(); private: - OTableFieldDescRef FindFirstFreeCol(USHORT& _rColumnPosition); + OTableFieldDescRef FindFirstFreeCol(sal_uInt16& _rColumnPosition); // rCol enthaelt die Nummer (in pOTableFieldDescList) der ersten Spalte, die von sich sagt, dass sie leer ist // wenn es keine solche gibt, ist rCol undefiniert und der Rueckgabewert NULL - void CheckFreeColumns(USHORT& _rColumnPosition); + void CheckFreeColumns(sal_uInt16& _rColumnPosition); // testet, ob es noch freie Spalten gibt, wenn nicht, wird ein neuer Packen angefuegt // rCol enthaelt die Nummer der ersten freien Spalte (in pOTableFieldDescList) @@ -245,7 +245,7 @@ namespace dbaui void appendUndoAction(const String& _rOldValue,const String& _rNewValue,sal_Int32 _nRow); OTableFields& getFields() const; void enableControl(const OTableFieldDescRef& _rEntry,Window* _pControl); - void setTextCellContext(const OTableFieldDescRef& _rEntry,const String& _sText,ULONG _nHelpId); + void setTextCellContext(const OTableFieldDescRef& _rEntry,const String& _sText,const rtl::OString& _sHelpId); void invalidateUndoRedo(); OTableFieldDescRef getEntry(OTableFields::size_type _nPos); @@ -304,7 +304,7 @@ namespace dbaui @param _bListAction Will be set to <TRUE/> when we are in a list action otherwise <FALSE/> */ - void notifyTableFieldChanged(const String& _sOldAlias,const String& _sAlias,sal_Bool& _bListAction,USHORT _nColumnId); + void notifyTableFieldChanged(const String& _sOldAlias,const String& _sAlias,sal_Bool& _bListAction,sal_uInt16 _nColumnId); /** append an undo action for the function field @param _sOldFunctionName @@ -314,7 +314,7 @@ namespace dbaui @param _bListAction Will be set to <TRUE/> when we are in a list action otherwise <FALSE/> */ - void notifyFunctionFieldChanged(const String& _sOldFunctionName,const String& _sFunctionName,sal_Bool& _bListAction,USHORT _nColumnId); + void notifyFunctionFieldChanged(const String& _sOldFunctionName,const String& _sFunctionName,sal_Bool& _bListAction,sal_uInt16 _nColumnId); /** clears the function fields of the submitted entry if it doesn't match the SQL standard and append an undo action. E.q. AGGREGATE functions are only valid when the field name isn't an asterix @@ -325,7 +325,7 @@ namespace dbaui @param _bListAction When <TRUE/> an list action will be created. */ - void clearEntryFunctionField(const String& _sFieldName,OTableFieldDescRef& _pEntry,sal_Bool& _bListAction,USHORT _nColumnId); + void clearEntryFunctionField(const String& _sFieldName,OTableFieldDescRef& _pEntry,sal_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 8909fad0f..0c361c819 100644 --- a/dbaccess/source/ui/querydesign/TableConnection.cxx +++ b/dbaccess/source/ui/querydesign/TableConnection.cxx @@ -53,7 +53,7 @@ namespace dbaui :Window(_pContainer) ,m_pData( _pTabConnData ) ,m_pParent( _pContainer ) - ,m_bSelected( FALSE ) + ,m_bSelected( sal_False ) { DBG_CTOR(OTableConnection,NULL); Init(); @@ -168,19 +168,19 @@ namespace dbaui //------------------------------------------------------------------------ void OTableConnection::Select() { - m_bSelected = TRUE; + m_bSelected = sal_True; m_pParent->Invalidate( GetBoundingRect(), INVALIDATE_NOCHILDREN); } //------------------------------------------------------------------------ void OTableConnection::Deselect() { - m_bSelected = FALSE; + m_bSelected = sal_False; InvalidateConnection(); } //------------------------------------------------------------------------ - BOOL OTableConnection::CheckHit( const Point& rMousePos ) const + sal_Bool OTableConnection::CheckHit( const Point& rMousePos ) const { ////////////////////////////////////////////////////////////////////// // check if the point hit our line diff --git a/dbaccess/source/ui/querydesign/TableConnectionData.cxx b/dbaccess/source/ui/querydesign/TableConnectionData.cxx index bd9ca5398..deec88863 100644 --- a/dbaccess/source/ui/querydesign/TableConnectionData.cxx +++ b/dbaccess/source/ui/querydesign/TableConnectionData.cxx @@ -62,7 +62,7 @@ void OTableConnectionData::Init() ////////////////////////////////////////////////////////////////////// // LineDataList mit Defaults initialisieren OSL_ENSURE(m_vConnLineData.size() == 0, "OTableConnectionData::Init() : nur mit leere Linienliste aufzurufen !"); - ResetConnLines(TRUE); + ResetConnLines(sal_True); // das legt Defaults an } //------------------------------------------------------------------------ @@ -97,7 +97,7 @@ OTableConnectionData& OTableConnectionData::operator=( const OTableConnectionDat m_aConnName = rConnData.GetConnName(); // clear line list - ResetConnLines(FALSE); + ResetConnLines(sal_False); // und kopieren OConnectionLineDataVec* pLineData = const_cast<OTableConnectionData*>(&rConnData)->GetConnLineDataList(); @@ -111,10 +111,10 @@ OTableConnectionData& OTableConnectionData::operator=( const OTableConnectionDat } //------------------------------------------------------------------------ -BOOL OTableConnectionData::SetConnLine( USHORT nIndex, const String& rSourceFieldName, const String& rDestFieldName ) +sal_Bool OTableConnectionData::SetConnLine( sal_uInt16 nIndex, const String& rSourceFieldName, const String& rDestFieldName ) { - if (USHORT(m_vConnLineData.size()) < nIndex) - return FALSE; + if (sal_uInt16(m_vConnLineData.size()) < nIndex) + return sal_False; // == ist noch erlaubt, das entspricht einem Append if (m_vConnLineData.size() == nIndex) @@ -126,11 +126,11 @@ BOOL OTableConnectionData::SetConnLine( USHORT nIndex, const String& rSourceFiel pConnLineData->SetSourceFieldName( rSourceFieldName ); pConnLineData->SetDestFieldName( rDestFieldName ); - return TRUE; + return sal_True; } //------------------------------------------------------------------------ -BOOL OTableConnectionData::AppendConnLine( const ::rtl::OUString& rSourceFieldName, const ::rtl::OUString& rDestFieldName ) +sal_Bool OTableConnectionData::AppendConnLine( const ::rtl::OUString& rSourceFieldName, const ::rtl::OUString& rDestFieldName ) { OConnectionLineDataVec::iterator aIter = m_vConnLineData.begin(); OConnectionLineDataVec::iterator aEnd = m_vConnLineData.end(); @@ -143,15 +143,15 @@ BOOL OTableConnectionData::AppendConnLine( const ::rtl::OUString& rSourceFieldNa { OConnectionLineDataRef pNew = new OConnectionLineData(rSourceFieldName, rDestFieldName); if (!pNew.is()) - return FALSE; + return sal_False; m_vConnLineData.push_back(pNew); } - return TRUE; + return sal_True; } //------------------------------------------------------------------------ -void OTableConnectionData::ResetConnLines( BOOL /*bUseDefaults*/ ) +void OTableConnectionData::ResetConnLines( sal_Bool /*bUseDefaults*/ ) { OConnectionLineDataVec().swap(m_vConnLineData); } diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx index b072cc97d..5e1f517e2 100644 --- a/dbaccess/source/ui/querydesign/TableWindow.cxx +++ b/dbaccess/source/ui/querydesign/TableWindow.cxx @@ -90,7 +90,7 @@ OTableWindow::OTableWindow( Window* pParent, const TTableWindowData::value_type& ,m_nMoveCount(0) ,m_nMoveIncrement(1) ,m_nSizingFlags( SIZING_NONE ) - ,m_bActive( FALSE ) + ,m_bActive( sal_False ) { DBG_CTOR(OTableWindow,NULL); @@ -178,7 +178,7 @@ OTableWindowListBox* OTableWindow::CreateListBox() } //------------------------------------------------------------------------------ -BOOL OTableWindow::FillListBox() +sal_Bool OTableWindow::FillListBox() { m_pListBox->Clear(); if ( !m_pContainerListener.is() ) @@ -237,7 +237,7 @@ BOOL OTableWindow::FillListBox() OSL_ENSURE(0,"Exception occurred!"); } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- void* OTableWindow::createUserData(const Reference< XPropertySet>& /*_xColumn*/,bool /*_bPrimaryKey*/) @@ -287,7 +287,7 @@ void OTableWindow::impl_updateImage() } //------------------------------------------------------------------------------ -BOOL OTableWindow::Init() +sal_Bool OTableWindow::Init() { // create list box if necessary if ( !m_pListBox ) @@ -305,9 +305,9 @@ BOOL OTableWindow::Init() // die Felder in die ListBox eintragen clearListBox(); - BOOL bSuccess = FillListBox(); + sal_Bool bSuccess = FillListBox(); if ( bSuccess ) - m_pListBox->SelectAll( FALSE ); + m_pListBox->SelectAll( sal_False ); impl_updateImage(); @@ -359,7 +359,7 @@ void OTableWindow::Draw3DBorder(const Rectangle& rRect) Rectangle OTableWindow::getSizingRect(const Point& _rPos,const Size& _rOutputSize) const { Rectangle aSizingRect = Rectangle( GetPosPixel(), GetSizePixel() ); - UINT16 nSizingFlags = GetSizingFlags(); + sal_uInt16 nSizingFlags = GetSizingFlags(); if( nSizingFlags & SIZING_TOP ) { @@ -509,7 +509,7 @@ void OTableWindow::Resize() } //------------------------------------------------------------------------------ -void OTableWindow::SetBoldTitle( BOOL bBold ) +void OTableWindow::SetBoldTitle( sal_Bool bBold ) { Font aFont = m_aTitle.GetFont(); aFont.SetWeight( bBold?WEIGHT_BOLD:WEIGHT_NORMAL ); @@ -531,7 +531,7 @@ void OTableWindow::setActive(sal_Bool _bActive) SetBoldTitle( _bActive ); m_bActive = _bActive; if (!_bActive && m_pListBox && m_pListBox->GetSelectionCount() != 0) - m_pListBox->SelectAll(FALSE); + m_pListBox->SelectAll(sal_False); } //------------------------------------------------------------------------------ @@ -544,25 +544,25 @@ void OTableWindow::Remove() pTabWinCont->Invalidate(); } //------------------------------------------------------------------------------ -BOOL OTableWindow::HandleKeyInput( const KeyEvent& rEvt ) +sal_Bool OTableWindow::HandleKeyInput( const KeyEvent& rEvt ) { const KeyCode& rCode = rEvt.GetKeyCode(); - USHORT nCode = rCode.GetCode(); - BOOL bShift = rCode.IsShift(); - BOOL bCtrl = rCode.IsMod1(); + sal_uInt16 nCode = rCode.GetCode(); + sal_Bool bShift = rCode.IsShift(); + sal_Bool bCtrl = rCode.IsMod1(); - BOOL bHandle = FALSE; + sal_Bool bHandle = sal_False; if( !bCtrl && !bShift && (nCode==KEY_DELETE) ) { Remove(); - bHandle = TRUE; + bHandle = sal_True; } return bHandle; } //------------------------------------------------------------------------------ -BOOL OTableWindow::ExistsAConn() const +sal_Bool OTableWindow::ExistsAConn() const { return getTableView()->ExistsAConn(this); } @@ -648,7 +648,7 @@ void OTableWindow::Command(const CommandEvent& rEvt) // ----------------------------------------------------------------------------- long OTableWindow::PreNotify(NotifyEvent& rNEvt) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; switch (rNEvt.GetType()) { case EVENT_KEYINPUT: @@ -670,19 +670,19 @@ long OTableWindow::PreNotify(NotifyEvent& rNEvt) switch( rCode.GetCode() ) { case KEY_DOWN: - bHandled = TRUE; + bHandled = sal_True; aStartPoint.Y() += m_nMoveIncrement; break; case KEY_UP: - bHandled = TRUE; + bHandled = sal_True; aStartPoint.Y() += -m_nMoveIncrement; break; case KEY_LEFT: - bHandled = TRUE; + bHandled = sal_True; aStartPoint.X() += -m_nMoveIncrement; break; case KEY_RIGHT: - bHandled = TRUE; + bHandled = sal_True; aStartPoint.X() += m_nMoveIncrement; break; } @@ -765,7 +765,7 @@ long OTableWindow::PreNotify(NotifyEvent& rNEvt) { const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent(); const KeyCode& rCode = pKeyEvent->GetKeyCode(); - USHORT nKeyCode = rCode.GetCode(); + sal_uInt16 nKeyCode = rCode.GetCode(); if ( rCode.IsMod2() && nKeyCode != KEY_UP && nKeyCode != KEY_DOWN && nKeyCode != KEY_LEFT && nKeyCode != KEY_RIGHT ) { m_nMoveCount = 0; // reset our movement count diff --git a/dbaccess/source/ui/querydesign/TableWindowData.cxx b/dbaccess/source/ui/querydesign/TableWindowData.cxx index 41457eaa3..8c34221e7 100644 --- a/dbaccess/source/ui/querydesign/TableWindowData.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowData.cxx @@ -61,7 +61,7 @@ OTableWindowData::OTableWindowData( const Reference< XPropertySet>& _xTable ,m_sComposedName(_rComposedName) ,m_aPosition( Point(-1,-1) ) ,m_aSize( Size(-1,-1) ) - ,m_bShowAll( TRUE ) + ,m_bShowAll( sal_True ) ,m_bIsQuery(false) ,m_bIsValid(true) { @@ -82,13 +82,13 @@ OTableWindowData::~OTableWindowData() } //------------------------------------------------------------------------------ -BOOL OTableWindowData::HasPosition() const +sal_Bool OTableWindowData::HasPosition() const { return ( (m_aPosition.X() != -1) && (m_aPosition.Y() != -1) ); } //------------------------------------------------------------------------------ -BOOL OTableWindowData::HasSize() const +sal_Bool OTableWindowData::HasSize() const { return ( (m_aSize.Width() != -1) && (m_aSize.Height() !=-1) ); } diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx index f4f30d1ad..9af30a6df 100644 --- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx @@ -49,7 +49,7 @@ OJoinExchangeData::OJoinExchangeData(OTableWindowListBox* pBox) , pEntry(pBox->FirstSelected()) { } -const ULONG SCROLLING_TIMESPAN = 500; +const sal_uLong SCROLLING_TIMESPAN = 500; const long LISTBOX_SCROLLING_AREA = 6; //================================================================== // class OTableWindowListBox @@ -107,7 +107,7 @@ SvLBoxEntry* OTableWindowListBox::GetEntryFromText( const String& rEntryText ) OJoinDesignView* pView = m_pTabWin->getDesignView(); OJoinController& rController = pView->getController(); - BOOL bCase = FALSE; + sal_Bool bCase = sal_False; try { Reference<XConnection> xConnection = rController.getConnection(); @@ -136,7 +136,7 @@ SvLBoxEntry* OTableWindowListBox::GetEntryFromText( const String& rEntryText ) //------------------------------------------------------------------------------ void OTableWindowListBox::NotifyScrolled() { - m_bReallyScrolled = TRUE; + m_bReallyScrolled = sal_True; } //------------------------------------------------------------------------------ @@ -147,13 +147,13 @@ void OTableWindowListBox::NotifyEndScroll() m_pTabWin->getTableView()->Invalidate(INVALIDATE_NOCHILDREN); // ohne das INVALIDATE_NOCHILDREN wuerden auch alle Tabellen neu gezeichnet werden, // sprich : es flackert - m_bReallyScrolled = FALSE; + m_bReallyScrolled = sal_False; } //------------------------------------------------------------------------------ long OTableWindowListBox::PreNotify(NotifyEvent& rNEvt) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; switch (rNEvt.GetType()) { case EVENT_KEYINPUT: @@ -194,7 +194,7 @@ IMPL_LINK( OTableWindowListBox, ScrollUpHdl, SvTreeListBox*, /*pBox*/ ) { ScrollOutputArea( -1 ); pEntry = GetEntry( m_aMousePos ); - Select( pEntry, TRUE ); + Select( pEntry, sal_True ); } return 0; @@ -211,7 +211,7 @@ IMPL_LINK( OTableWindowListBox, ScrollDownHdl, SvTreeListBox*, /*pBox*/ ) { ScrollOutputArea( 1 ); pEntry = GetEntry( m_aMousePos ); - Select( pEntry, TRUE ); + Select( pEntry, sal_True ); } return 0; @@ -246,7 +246,7 @@ sal_Int8 OTableWindowListBox::AcceptDrop( const AcceptDropEvent& _rEvt ) // remove the selection if the dragging operation is leaving the window if (_rEvt.mbLeaving) - SelectAll(FALSE); + SelectAll(sal_False); else { // hit test @@ -288,8 +288,8 @@ sal_Int8 OTableWindowListBox::AcceptDrop( const AcceptDropEvent& _rEvt ) // Beim Drag automatisch den richtigen Eintrag selektieren if ((FirstSelected() != pEntry) || (FirstSelected() && NextSelected(FirstSelected()))) - SelectAll(FALSE); - Select(pEntry, TRUE); + SelectAll(sal_False); + Select(pEntry, sal_True); // Auf den ersten Eintrag (*) kann nicht gedroppt werden if(!( m_pTabWin->GetData()->IsShowAll() && (pEntry==First()) )) @@ -363,8 +363,8 @@ void OTableWindowListBox::GetFocus() if ( GetSelectionCount() == 0 || GetCurEntry() != FirstSelected() ) { if ( FirstSelected() ) - Select(FirstSelected(), FALSE); - Select(GetCurEntry(), TRUE); + Select(FirstSelected(), sal_False); + Select(GetCurEntry(), sal_True); } else ShowFocusRect(FirstSelected()); diff --git a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx index 5887547d9..4f22072f6 100644 --- a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx @@ -64,7 +64,7 @@ OTableWindowTitle::OTableWindowTitle( OTableWindow* pParent ) : SetTextColor(aSystemStyle.GetButtonTextColor()); Font aFont( GetFont() ); - aFont.SetTransparent( TRUE ); + aFont.SetTransparent( sal_True ); SetFont( aFont ); } diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx index 43123df1f..50080c7e6 100644 --- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx +++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx @@ -183,7 +183,7 @@ namespace dbaui // ----------------------------------------------------------------------------- long OQueryContainerWindow::PreNotify( NotifyEvent& rNEvt ) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; switch (rNEvt.GetType()) { case EVENT_GETFOCUS: diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 5f86ed31b..2639bf37c 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -245,13 +245,13 @@ namespace dbaui namespace { // ----------------------------------------------------------------------------- - String lcl_getObjectResourceString( USHORT _nResId, sal_Int32 _nCommandType ) + String lcl_getObjectResourceString( sal_uInt16 _nResId, sal_Int32 _nCommandType ) { String sMessageText = String( ModuleRes( _nResId ) ); String sObjectType; { LocalResourceAccess aLocalRes( RSC_QUERY_OBJECT_TYPE, RSC_RESOURCE ); - sObjectType = String( ModuleRes( (USHORT)( _nCommandType + 1 ) ) ); + sObjectType = String( ModuleRes( (sal_uInt16)( _nCommandType + 1 ) ) ); } sMessageText.SearchAndReplace( String::CreateFromAscii( "$object$" ), sObjectType ); return sMessageText; @@ -692,9 +692,9 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& break; case SID_BROWSER_CLEAR_QUERY: { - getUndoMgr()->EnterListAction( String( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), String() ); + GetUndoManager().EnterListAction( String( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), String() ); getContainer()->clear(); - getUndoMgr()->LeaveListAction(); + GetUndoManager().LeaveListAction(); setStatement_fireEvent( ::rtl::OUString() ); if(m_bGraphicalDesign) @@ -1037,7 +1037,7 @@ void OQueryController::impl_initialize() } } - getUndoMgr()->Clear(); + ClearUndoManager(); if ( ( m_bGraphicalDesign ) && ( ( !m_sName.getLength() && !editingCommand() ) @@ -1788,7 +1788,7 @@ void OQueryController::reset() { impl_reset(); getContainer()->reset( NULL ); - getUndoMgr()->Clear(); + ClearUndoManager(); } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx b/dbaccess/source/ui/querydesign/querydlg.cxx index b3e277bbc..0ac429882 100644 --- a/dbaccess/source/ui/querydesign/querydlg.cxx +++ b/dbaccess/source/ui/querydesign/querydlg.cxx @@ -75,7 +75,7 @@ DlgQryJoin::DlgQryJoin( OQueryTableView * pParent, const TTableConnectionData::value_type& _pData, OJoinTableView::OTableWindowMap* _pTableMap, const Reference< XConnection >& _xConnection, - BOOL _bAllowTableSelect) + sal_Bool _bAllowTableSelect) :ModalDialog( pParent, ModuleRes(DLG_QRY_JOIN) ) ,aML_HelpText( this, ModuleRes(ML_HELPTEXT) ) ,aPB_OK( this, ModuleRes( PB_OK ) ) @@ -154,8 +154,8 @@ DlgQryJoin::DlgQryJoin( OQueryTableView * pParent, } else { - const USHORT nCount = m_pJoinControl->aLB_JoinType.GetEntryCount(); - for (USHORT i = 0; i < nCount; ++i) + const sal_uInt16 nCount = m_pJoinControl->aLB_JoinType.GetEntryCount(); + for (sal_uInt16 i = 0; i < nCount; ++i) { const long nJoinTyp = reinterpret_cast<long>(m_pJoinControl->aLB_JoinType.GetEntryData(i)); if ( !bSupportFullJoin && nJoinTyp == ID_FULL_JOIN ) @@ -193,8 +193,8 @@ IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ ) String sFirstWinName = m_pConnData->getReferencingTable()->GetWinName(); String sSecondWinName = m_pConnData->getReferencedTable()->GetWinName(); const EJoinType eOldJoinType = eJoinType; - USHORT nResId = 0; - const USHORT nPos = m_pJoinControl->aLB_JoinType.GetSelectEntryPos(); + sal_uInt16 nResId = 0; + const sal_uInt16 nPos = m_pJoinControl->aLB_JoinType.GetSelectEntryPos(); const long nJoinType = reinterpret_cast<long>(m_pJoinControl->aLB_JoinType.GetEntryData(nPos)); sal_Bool bAddHint = sal_True; switch ( nJoinType ) @@ -229,11 +229,11 @@ IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ ) m_pConnData->ResetConnLines(); m_pTableControl->lateInit(); - m_pJoinControl->m_aCBNatural.Check(FALSE); + m_pJoinControl->m_aCBNatural.Check(sal_False); m_pTableControl->enableRelation(false); ::rtl::OUString sEmpty; m_pConnData->AppendConnLine(sEmpty,sEmpty); - aPB_OK.Enable(TRUE); + aPB_OK.Enable(sal_True); } break; } @@ -284,7 +284,7 @@ IMPL_LINK( DlgQryJoin, OKClickHdl, Button*, /*pButton*/ ) IMPL_LINK( DlgQryJoin, NaturalToggleHdl, CheckBox*, /*pButton*/ ) { DBG_CHKTHIS(DlgQryJoin,NULL); - BOOL bChecked = m_pJoinControl->m_aCBNatural.IsChecked(); + sal_Bool bChecked = m_pJoinControl->m_aCBNatural.IsChecked(); static_cast<OQueryTableConnectionData*>(m_pConnData.get())->setNatural(bChecked); m_pTableControl->enableRelation(!bChecked); if ( bChecked ) @@ -356,8 +356,8 @@ void DlgQryJoin::setJoinType(EJoinType _eNewJoinType) break; } - const USHORT nCount = m_pJoinControl->aLB_JoinType.GetEntryCount(); - for (USHORT i = 0; i < nCount; ++i) + const sal_uInt16 nCount = m_pJoinControl->aLB_JoinType.GetEntryCount(); + for (sal_uInt16 i = 0; i < nCount; ++i) { if ( nJoinType == reinterpret_cast<long>(m_pJoinControl->aLB_JoinType.GetEntryData(i)) ) { diff --git a/dbaccess/source/ui/querydesign/querydlg.hxx b/dbaccess/source/ui/querydesign/querydlg.hxx index f18fde030..20e81bc30 100644 --- a/dbaccess/source/ui/querydesign/querydlg.hxx +++ b/dbaccess/source/ui/querydesign/querydlg.hxx @@ -79,7 +79,7 @@ namespace dbaui const TTableConnectionData::value_type& pData, OJoinTableView::OTableWindowMap* _pTableMap, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection, - BOOL _bAllowTableSelect); + sal_Bool _bAllowTableSelect); virtual ~DlgQryJoin(); EJoinType GetJoinType() const { return eJoinType; }; diff --git a/dbaccess/source/ui/querydesign/querydlg.src b/dbaccess/source/ui/querydesign/querydlg.src index 0da839f7b..6a10478d1 100644 --- a/dbaccess/source/ui/querydesign/querydlg.src +++ b/dbaccess/source/ui/querydesign/querydlg.src @@ -82,6 +82,7 @@ ModalDialog DLG_QRY_JOIN }; CheckBox CB_NATURAL { + HelpID = "dbaccess:CheckBox:DLG_QRY_JOIN:CB_NATURAL"; Pos = MAP_APPFONT ( 101 , 31 ) ; Size = MAP_APPFONT ( 89 , 8 ) ; diff --git a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx index f875bee17..03ac283fa 100644 --- a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx +++ b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx @@ -97,7 +97,7 @@ ORelationTableConnectionData::~ORelationTableConnectionData() } //------------------------------------------------------------------------ -BOOL ORelationTableConnectionData::DropRelation() +sal_Bool ORelationTableConnectionData::DropRelation() { DBG_CHKTHIS(ORelationTableConnectionData,NULL); ::osl::MutexGuard aGuard( m_aMutex ); @@ -126,7 +126,7 @@ BOOL ORelationTableConnectionData::DropRelation() } } } - return TRUE; + return sal_True; } //------------------------------------------------------------------------ @@ -175,10 +175,10 @@ void ORelationTableConnectionData::SetCardinality() } // ----------------------------------------------------------------------------- -BOOL ORelationTableConnectionData::checkPrimaryKey(const Reference< XPropertySet>& i_xTable,EConnectionSide _eEConnectionSide) const +sal_Bool ORelationTableConnectionData::checkPrimaryKey(const Reference< XPropertySet>& i_xTable,EConnectionSide _eEConnectionSide) const { // check if Table has the primary key column dependig on _eEConnectionSide - USHORT nPrimKeysCount = 0, + sal_uInt16 nPrimKeysCount = 0, nValidLinesCount = 0; const Reference< XNameAccess> xKeyColumns = dbtools::getPrimaryKeyColumns_throw(i_xTable); if ( xKeyColumns.is() ) @@ -202,15 +202,15 @@ BOOL ORelationTableConnectionData::checkPrimaryKey(const Reference< XPropertySet } } if ( nPrimKeysCount != aKeyColumns.getLength() ) - return FALSE; + return sal_False; } if ( !nPrimKeysCount || nPrimKeysCount != nValidLinesCount ) - return FALSE; + return sal_False; - return TRUE; + return sal_True; } //------------------------------------------------------------------------ -BOOL ORelationTableConnectionData::IsConnectionPossible() +sal_Bool ORelationTableConnectionData::IsConnectionPossible() { DBG_CHKTHIS(ORelationTableConnectionData,NULL); ::osl::MutexGuard aGuard( m_aMutex ); @@ -220,7 +220,7 @@ BOOL ORelationTableConnectionData::IsConnectionPossible() if ( IsSourcePrimKey() && !IsDestPrimKey() ) ChangeOrientation(); - return TRUE; + return sal_True; } //------------------------------------------------------------------------ @@ -283,7 +283,7 @@ bool operator==(const ORelationTableConnectionData& lhs, const ORelationTableCon } } //------------------------------------------------------------------------ -BOOL ORelationTableConnectionData::Update() +sal_Bool ORelationTableConnectionData::Update() { ::osl::MutexGuard aGuard( m_aMutex ); //////////////////////////////////////////////////////////// @@ -291,7 +291,7 @@ BOOL ORelationTableConnectionData::Update() { DropRelation(); if( !IsConnectionPossible() ) - return FALSE; + return sal_False; } // reassign the keys because the orientaion could be changed @@ -299,7 +299,7 @@ BOOL ORelationTableConnectionData::Update() Reference< XIndexAccess> xKeys ( getReferencingTable()->getKeys()); if ( !xKeys.is() ) - return FALSE; + return sal_False; //////////////////////////////////////////////////////////// // Neue Relation erzeugen Reference<XDataDescriptorFactory> xKeyFactory(xKeys,UNO_QUERY); @@ -459,7 +459,7 @@ xKey.clear(); // Kardinalitaet bestimmen SetCardinality(); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx index 2da0baadc..6ac150adc 100644 --- a/dbaccess/source/ui/relationdesign/RelationController.cxx +++ b/dbaccess/source/ui/relationdesign/RelationController.cxx @@ -368,7 +368,7 @@ namespace if ( aFind == m_aTableData.end() ) { aFind = m_aTableData.insert(TTableDataHelper::value_type(sSourceName,::boost::shared_ptr<OTableWindowData>(new OTableWindowData(xTableProp,sSourceName, sSourceName)))).first; - aFind->second->ShowAll(FALSE); + aFind->second->ShowAll(sal_False); } TTableWindowData::value_type pReferencingTable = aFind->second; Reference<XIndexAccess> xKeys = pReferencingTable->getKeys(); @@ -401,7 +401,7 @@ namespace { Reference<XPropertySet> xReferencedTable(m_xTables->getByName(sReferencedTable),UNO_QUERY); aRefFind = m_aTableData.insert(TTableDataHelper::value_type(sReferencedTable,::boost::shared_ptr<OTableWindowData>(new OTableWindowData(xReferencedTable,sReferencedTable, sReferencedTable)))).first; - aRefFind->second->ShowAll(FALSE); + aRefFind->second->ShowAll(sal_False); } else continue; // table name could not be found so we do not show this table releation @@ -490,7 +490,7 @@ IMPL_LINK( ORelationController, OnThreadFinished, void*, /*NOTINTERESTEDIN*/ ) { getView()->initialize(); // show the windows and fill with our informations getView()->Invalidate(INVALIDATE_NOERASE); - getUndoMgr()->Clear(); // clear all undo redo things + ClearUndoManager(); setModified(sal_False); // and we are not modified yet if(m_vTableData.empty()) diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx index 0bb53fd3c..837e28065 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -171,7 +171,7 @@ void ORelationTableView::ReSync() GetTabWinMap()->begin()->second->GrabFocus(); } //------------------------------------------------------------------------------ -BOOL ORelationTableView::IsAddAllowed() +sal_Bool ORelationTableView::IsAddAllowed() { DBG_CHKTHIS(ORelationTableView,NULL); @@ -274,9 +274,9 @@ void ORelationTableView::AddNewRelation() DBG_CHKTHIS(ORelationTableView,NULL); TTableConnectionData::value_type pNewConnData( new ORelationTableConnectionData() ); - ORelationDialog aRelDlg(this, pNewConnData, TRUE); + ORelationDialog aRelDlg(this, pNewConnData, sal_True); - BOOL bSuccess = (aRelDlg.Execute() == RET_OK); + sal_Bool bSuccess = (aRelDlg.Execute() == RET_OK); if (bSuccess) { // already updated by the dialog @@ -307,7 +307,7 @@ bool ORelationTableView::RemoveConnection( OTableConnection* pConn ,sal_Bool /*_ } //------------------------------------------------------------------------------ -void ORelationTableView::AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, BOOL /*bNewTable*/) +void ORelationTableView::AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, sal_Bool /*bNewTable*/) { DBG_CHKTHIS(ORelationTableView,NULL); OSL_ENSURE(_rComposedName.getLength(),"There must be a table name supplied!"); @@ -325,7 +325,7 @@ void ORelationTableView::AddTabWin(const ::rtl::OUString& _rComposedName, const ////////////////////////////////////////////////////////////////// // Neue Datenstruktur in DocShell eintragen TTableWindowData::value_type pNewTabWinData(createTableWindowData( _rComposedName, rWinName,rWinName )); - pNewTabWinData->ShowAll(FALSE); + pNewTabWinData->ShowAll(sal_False); ////////////////////////////////////////////////////////////////// // Neues Fenster in Fensterliste eintragen @@ -358,7 +358,7 @@ void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin ) OSQLWarningBox aDlg( this, ModuleRes( STR_QUERY_REL_DELETE_WINDOW ), WB_YES_NO | WB_DEF_YES ); if ( m_bInRemove || aDlg.Execute() == RET_YES ) { - m_pView->getController().getUndoMgr()->Clear(); + m_pView->getController().ClearUndoManager(); OJoinTableView::RemoveTabWin( pTabWin ); m_pView->getController().InvalidateFeature(SID_RELATION_ADD_RELATION); @@ -366,7 +366,7 @@ void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin ) m_pView->getController().InvalidateFeature(ID_BROWSER_REDO); } } -// ----------------------------------------------------------------------------- + void ORelationTableView::lookForUiActivities() { if(m_pExistingConnection) @@ -379,7 +379,7 @@ void ORelationTableView::lookForUiActivities() aDlg.AddButton( ModuleRes(STR_QUERY_REL_EDIT), BUTTONID_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON); aDlg.AddButton( ModuleRes(STR_QUERY_REL_CREATE), BUTTONID_YES, 0); aDlg.AddButton(BUTTON_CANCEL,BUTTONID_CANCEL,0); - UINT16 nRet = aDlg.Execute(); + sal_uInt16 nRet = aDlg.Execute(); if( nRet == RET_CANCEL) { m_pCurrentlyTabConnData.reset(); @@ -428,7 +428,7 @@ void ORelationTableView::_elementRemoved( const container::ContainerEvent& _rEve OTableWindow* pTableWindow = GetTabWindow(sName); if ( pTableWindow ) { - m_pView->getController().getUndoMgr()->Clear(); + m_pView->getController().ClearUndoManager(); OJoinTableView::RemoveTabWin( pTableWindow ); m_pView->getController().InvalidateFeature(SID_RELATION_ADD_RELATION); diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx index 366fd36fb..5f9872de1 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx +++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx @@ -56,9 +56,9 @@ namespace dbaui void DisplayData( OFieldDescription* pFieldDescr ); void SaveData( OFieldDescription* pFieldDescr ); - void SetControlText( USHORT nControlId, const String& rText ); - String GetControlText( USHORT nControlId ); - void SetReadOnly( BOOL bReadOnly ); + void SetControlText( sal_uInt16 nControlId, const String& rText ); + String GetControlText( sal_uInt16 nControlId ); + void SetReadOnly( sal_Bool bReadOnly ); #if OSL_DEBUG_LEVEL > 0 OTableEditorCtrl* GetEditorCtrl(); #endif diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index b01b3eccb..ca5708ff8 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -56,6 +56,8 @@ #include "TableFieldControl.hxx" #include "dsntypes.hxx" +#include "dbaccess_slotid.hrc" + using namespace ::dbaui; using namespace ::comphelper; using namespace ::svt; @@ -104,7 +106,7 @@ DBG_NAME(OTableEditorCtrl) //================================================================== DBG_NAME(ClipboardInvalidator) //------------------------------------------------------------------ -OTableEditorCtrl::ClipboardInvalidator::ClipboardInvalidator(ULONG nTimeout,OTableEditorCtrl* _pOwner) +OTableEditorCtrl::ClipboardInvalidator::ClipboardInvalidator(sal_uLong nTimeout,OTableEditorCtrl* _pOwner) : m_pOwner(_pOwner) { DBG_CTOR(ClipboardInvalidator,NULL); @@ -210,13 +212,13 @@ OTableEditorCtrl::OTableEditorCtrl(Window* pWindow) } //------------------------------------------------------------------------------ -SfxUndoManager* OTableEditorCtrl::GetUndoManager() const +SfxUndoManager& OTableEditorCtrl::GetUndoManager() const { - return GetView()->getController().getUndoMgr(); + return GetView()->getController().GetUndoManager(); } //------------------------------------------------------------------------------ -BOOL OTableEditorCtrl::IsReadOnly() +sal_Bool OTableEditorCtrl::IsReadOnly() { DBG_CHKTHIS(OTableEditorCtrl,NULL); return bReadOnly; @@ -330,7 +332,7 @@ OTableEditorCtrl::~OTableEditorCtrl() DBG_DTOR(OTableEditorCtrl,NULL); ////////////////////////////////////////////////////////////////////// // Undo-Manager zuruecksetzen - GetUndoManager()->Clear(); + GetUndoManager().Clear(); ////////////////////////////////////////////////////////////////////// // Moegliche Events aus Queue entfernen @@ -623,7 +625,7 @@ sal_Bool OTableEditorCtrl::SaveData(long nRow, sal_uInt16 nColId) // Wenn FieldDescr existiert, wurde Feld geloescht und alter Inhalt wird wiederhergestellt if (pActFieldDescr) { - GetUndoManager()->AddUndoAction(new OTableEditorTypeSelUndoAct(this, nRow, FIELD_TYPE, pActFieldDescr->getTypeInfo())); + GetUndoManager().AddUndoAction(new OTableEditorTypeSelUndoAct(this, nRow, FIELD_TYPE, pActFieldDescr->getTypeInfo())); SwitchType(TOTypeInfoSP()); pActFieldDescr = pActRow->GetActFieldDescr(); } @@ -789,7 +791,7 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId ) default: sActionDescription = String( ModuleRes( STR_CHANGE_COLUMN_ATTRIBUTE ) ); break; } - GetUndoManager()->EnterListAction( sActionDescription, String() ); + GetUndoManager().EnterListAction( sActionDescription, String() ); if (!pActFieldDescr) { const OTypeInfoMap* pTypeInfoMap = GetView()->getController().getTypeInfo(); @@ -806,20 +808,20 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId ) nInvalidateTypeEvent = Application::PostUserEvent( LINK(this, OTableEditorCtrl, InvalidateFieldType) ); pActFieldDescr = pActRow->GetActFieldDescr(); pDescrWin->DisplayData( pActFieldDescr ); - GetUndoManager()->AddUndoAction( new OTableEditorTypeSelUndoAct(this, nRow, nColId+1, TOTypeInfoSP()) ); + GetUndoManager().AddUndoAction( new OTableEditorTypeSelUndoAct(this, nRow, nColId+1, TOTypeInfoSP()) ); } if( nColId != FIELD_TYPE ) - GetUndoManager()->AddUndoAction( new OTableDesignCellUndoAct(this, nRow, nColId) ); + GetUndoManager().AddUndoAction( new OTableDesignCellUndoAct(this, nRow, nColId) ); else { - GetUndoManager()->AddUndoAction(new OTableEditorTypeSelUndoAct(this, GetCurRow(), nColId, GetFieldDescr(GetCurRow())->getTypeInfo())); + GetUndoManager().AddUndoAction(new OTableEditorTypeSelUndoAct(this, GetCurRow(), nColId, GetFieldDescr(GetCurRow())->getTypeInfo())); resetType(); } SaveData(nRow,nColId); // SaveData could create a undo action as well - GetUndoManager()->LeaveListAction(); + GetUndoManager().LeaveListAction(); RowModified(nRow); CellControllerRef xController(Controller()); if(xController.Is()) @@ -833,7 +835,7 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId ) // ----------------------------------------------------------------------------- void OTableEditorCtrl::resetType() { - USHORT nPos = pTypeCell->GetSelectEntryPos(); + sal_uInt16 nPos = pTypeCell->GetSelectEntryPos(); if(nPos != LISTBOX_ENTRY_NOTFOUND) SwitchType( GetView()->getController().getTypeInfo(nPos) ); else @@ -982,7 +984,7 @@ void OTableEditorCtrl::InsertRows( long nRow ) ////////////////////////////////////////////////////////////////////// // Undo-Action erzeugen - GetUndoManager()->AddUndoAction( new OTableEditorInsUndoAct(this, nRow,vInsertedUndoRedoRows) ); + GetUndoManager().AddUndoAction( new OTableEditorInsUndoAct(this, nRow,vInsertedUndoRedoRows) ); GetView()->getController().setModified( sal_True ); InvalidateFeatures(); } @@ -994,7 +996,7 @@ void OTableEditorCtrl::DeleteRows() OSL_ENSURE(GetView()->getController().isDropAllowed(),"Call of DeleteRows not valid here. Please check isDropAllowed!"); ////////////////////////////////////////////////////////////////////// // Undo-Action erzeugen - GetUndoManager()->AddUndoAction( new OTableEditorDelUndoAct(this) ); + GetUndoManager().AddUndoAction( new OTableEditorDelUndoAct(this) ); ////////////////////////////////////////////////////////////////////// @@ -1042,7 +1044,7 @@ void OTableEditorCtrl::InsertNewRows( long nRow ) long nInsertRows = GetSelectRowCount(); if( !nInsertRows ) nInsertRows = 1; - GetUndoManager()->AddUndoAction( new OTableEditorInsNewUndoAct(this, nRow, nInsertRows) ); + GetUndoManager().AddUndoAction( new OTableEditorInsNewUndoAct(this, nRow, nInsertRows) ); ////////////////////////////////////////////////////////////////////// // Zahl der selektierten Zeilen werden neu eingefuegt for( long i=nRow; i<(nRow+nInsertRows); i++ ) @@ -1578,7 +1580,7 @@ void OTableEditorCtrl::Command(const CommandEvent& rEvt) if ( 1 == GetSelectColumnCount() ) { sal_uInt16 nSelId = GetColumnId( - sal::static_int_cast< USHORT >( + sal::static_int_cast< sal_uInt16 >( FirstSelectedColumn() ) ); ::Rectangle aColRect( GetFieldRectPixel( 0, nSelId, sal_False ) ); @@ -1813,7 +1815,7 @@ void OTableEditorCtrl::SetPrimaryKey( sal_Bool bSet ) } } - GetUndoManager()->AddUndoAction( new OPrimKeyUndoAct(this, aDeletedPrimKeys, aInsertedPrimKeys) ); + GetUndoManager().AddUndoAction( new OPrimKeyUndoAct(this, aDeletedPrimKeys, aInsertedPrimKeys) ); ////////////////////////////////////////////////////////////////////// // Handle-Spalte invalidieren @@ -1875,7 +1877,7 @@ void OTableEditorCtrl::SwitchType( const TOTypeInfoSP& _pType ) || ( GetView()->getController().getTypeInfo( nCurrentlySelected ) != _pType ) ) { - USHORT nEntryPos = 0; + sal_uInt16 nEntryPos = 0; const OTypeInfoMap* pTypeInfo = GetView()->getController().getTypeInfo(); OTypeInfoMap::const_iterator aIter = pTypeInfo->begin(); OTypeInfoMap::const_iterator aEnd = pTypeInfo->end(); diff --git a/dbaccess/source/ui/tabledesign/TEditControl.hxx b/dbaccess/source/ui/tabledesign/TEditControl.hxx index 69d611c4d..66e2627e6 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.hxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.hxx @@ -63,19 +63,19 @@ namespace dbaui ::boost::shared_ptr<OTableRow> pActRow; - ULONG nIndexEvent; - ULONG nCutEvent; - ULONG nPasteEvent; - ULONG nDeleteEvent; - ULONG nInsNewRowsEvent; - ULONG nInvalidateTypeEvent; - ULONG nEntryNotFoundEvent; + sal_uLong nIndexEvent; + sal_uLong nCutEvent; + sal_uLong nPasteEvent; + sal_uLong nDeleteEvent; + sal_uLong nInsNewRowsEvent; + sal_uLong nInvalidateTypeEvent; + sal_uLong nEntryNotFoundEvent; ChildFocusState m_eChildFocus; long nOldDataPos; - BOOL bSaveOnMove; - BOOL bReadOnly; + sal_Bool bSaveOnMove; + sal_Bool bReadOnly; //------------------------------------------------------------------ // Hilfsklasse class ClipboardInvalidator @@ -85,7 +85,7 @@ namespace dbaui OTableEditorCtrl* m_pOwner; public: - ClipboardInvalidator(ULONG nTimeout,OTableEditorCtrl*); + ClipboardInvalidator(sal_uLong nTimeout,OTableEditorCtrl*); ~ClipboardInvalidator(); protected: @@ -97,19 +97,19 @@ namespace dbaui protected: virtual void Command( const CommandEvent& rEvt ); - virtual BOOL SeekRow(long nRow); + virtual sal_Bool SeekRow(long nRow); virtual void PaintCell(OutputDevice& rDev, const Rectangle& rRect, - USHORT nColumnId ) const; + sal_uInt16 nColumnId ) const; virtual void CursorMoved(); virtual RowStatus GetRowStatus(long nRow) const; - virtual ::svt::CellController* GetController(long nRow, USHORT nCol); - virtual void InitController(::svt::CellControllerRef& rController, long nRow, USHORT nCol); + virtual ::svt::CellController* GetController(long nRow, sal_uInt16 nCol); + virtual void InitController(::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol); virtual void CellModified(); - virtual BOOL SaveModified(); // wird aufgerufen vor einem Zellenwechsel - // return FALSE, verhindert Zellenwechsel + virtual sal_Bool SaveModified(); // wird aufgerufen vor einem Zellenwechsel + // return sal_False, verhindert Zellenwechsel virtual void Undo(); virtual void Redo(); virtual String GetCellText(long nRow, sal_uInt16 nColId) const; @@ -126,8 +126,8 @@ namespace dbaui void ClearModified(); - void SetPrimaryKey( BOOL bSet ); - BOOL IsPrimaryKey(); + void SetPrimaryKey( sal_Bool bSet ); + sal_Bool IsPrimaryKey(); DECL_LINK(ControlPreNotifyHdl, NotifyEvent*); @@ -135,15 +135,15 @@ namespace dbaui // TYPEINFO(); OTableEditorCtrl(Window* pParentWin); virtual ~OTableEditorCtrl(); - virtual BOOL CursorMoving(long nNewRow, USHORT nNewCol); + virtual sal_Bool CursorMoving(long nNewRow, sal_uInt16 nNewCol); virtual void UpdateAll(); - SfxUndoManager* GetUndoManager() const; + SfxUndoManager& GetUndoManager() const; void SetDescrWin( OTableFieldDescWin* pWin ){ pDescrWin = pWin; if (pDescrWin && pActRow) pDescrWin->DisplayData(pActRow->GetActFieldDescr()); } - BOOL SaveCurRow(); + sal_Bool SaveCurRow(); void SwitchType( const TOTypeInfoSP& _pType ); - void DisplayData( long nRow, BOOL bGrabFocus = TRUE ); + void DisplayData( long nRow, sal_Bool bGrabFocus = sal_True ); // erzwingt das Anzeigen der genannten Zeile (selbst wenn es eigentlich schon die aktuelle ist) virtual void SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ); @@ -158,15 +158,15 @@ namespace dbaui ::boost::shared_ptr<OTableRow> GetActRow(){ return pActRow; } void CellModified( long nRow, sal_uInt16 nColId ); - void SetReadOnly( BOOL bRead=TRUE ); + void SetReadOnly( sal_Bool bRead=sal_True ); virtual void Init(); virtual void DeactivateCell(sal_Bool bUpdate = sal_True); - BOOL IsCutAllowed( long nRow = -1 ); - BOOL IsCopyAllowed( long nRow = -1 ); - BOOL IsPasteAllowed( long nRow = -1 ); - BOOL IsReadOnly(); + sal_Bool IsCutAllowed( long nRow = -1 ); + sal_Bool IsCopyAllowed( long nRow = -1 ); + sal_Bool IsPasteAllowed( long nRow = -1 ); + sal_Bool IsReadOnly(); OFieldDescription* GetFieldDescr( long nRow ); // window overloads @@ -191,11 +191,11 @@ namespace dbaui DECL_LINK( EntryNotFound, void* ); void InitCellController(); - INT32 HasFieldName( const String& rFieldName ); + sal_Int32 HasFieldName( const String& rFieldName ); String GenerateName( const String& rName ); - BOOL SetDataPtr( long nRow ); + sal_Bool SetDataPtr( long nRow ); - BOOL SaveData(long nRow, USHORT nColumnId); + sal_Bool SaveData(long nRow, sal_uInt16 nColumnId); /** AdjustFieldDescription set the needed values for the description @param _pFieldDesc the field description where to set the values @param _rMultiSel contains the postions which changed for undo/redo diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index c4ba7063e..53b88f1ef 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -566,7 +566,7 @@ void OTableController::impl_initialize() { loadData(); // fill the column information form the table getView()->initialize(); // show the windows and fill with our informations - getUndoMgr()->Clear(); // clear all undo redo things + ClearUndoManager(); setModified(sal_False); // and we are not modified yet } catch( const Exception& ) @@ -659,11 +659,6 @@ void OTableController::describeSupportedFeatures() implDescribeSupportedFeature( ".uno:EditDoc", ID_BROWSER_EDITDOC, CommandGroup::EDIT ); } // ----------------------------------------------------------------------------- -SfxUndoManager* OTableController::getUndoMgr() -{ - return &m_aUndoManager; -} -// ----------------------------------------------------------------------------- void OTableController::impl_onModifyChanged() { OSingleDocumentController::impl_onModifyChanged(); @@ -1511,7 +1506,7 @@ void OTableController::reSyncRows() } static_cast<OTableDesignView*>(getView())->reSync(); // show the windows and fill with our informations - getUndoMgr()->Clear(); // clear all undo redo things + ClearUndoManager(); setModified(sal_False); // and we are not modified yet } // ----------------------------------------------------------------------------- @@ -1567,7 +1562,7 @@ void OTableController::reload() { loadData(); // fill the column information form the table static_cast<OTableDesignView*>(getView())->reSync(); // show the windows and fill with our informations - getUndoMgr()->Clear(); // clear all undo redo things + ClearUndoManager(); setModified(sal_False); // and we are not modified yet static_cast<OTableDesignView*>(getView())->Invalidate(); } diff --git a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx index e35fc3236..95b71b949 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx @@ -55,9 +55,9 @@ OTableRowView::OTableRowView(Window* pParent) ,m_nDataPos(-1) ,m_nCurrentPos(-1) ,m_nCurUndoActId(0) - ,m_bCurrentModified(FALSE) - ,m_bUpdatable(FALSE) - ,m_bClipboardFilled(FALSE) + ,m_bCurrentModified(sal_False) + ,m_bUpdatable(sal_False) + ,m_bClipboardFilled(sal_False) { DBG_CTOR(OTableRowView,NULL); @@ -85,7 +85,7 @@ void OTableRowView::Init() SetFont(aFont); // HandleColumn, fuer maximal fuenf Ziffern einrichten - InsertHandleColumn(static_cast<USHORT>(GetTextWidth('0') * 4)/*, TRUE */); + InsertHandleColumn(static_cast<sal_uInt16>(GetTextWidth('0') * 4)/*, sal_True */); BrowserMode nMode = BROWSER_COLUMNSELECTION | BROWSER_MULTISELECTION | BROWSER_KEEPSELECTION | BROWSER_HLINESFULL | BROWSER_VLINESFULL | BROWSER_AUTOSIZE_LASTCOL; @@ -118,7 +118,7 @@ void OTableRowView::KeyInput( const KeyEvent& rEvt ) } //------------------------------------------------------------------------ -void OTableRowView::SetUpdatable( BOOL bUpdate ) +void OTableRowView::SetUpdatable( sal_Bool bUpdate ) { m_bUpdatable = bUpdate; @@ -138,7 +138,7 @@ void OTableRowView::Command(const CommandEvent& rEvt) return; } - USHORT nColId = GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X()); + sal_uInt16 nColId = GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X()); long nRow = GetRowAtYPosPixel(rEvt.GetMousePosPixel().Y()); if ( nColId == HANDLE_ID ) diff --git a/dbaccess/source/ui/tabledesign/TableDesignView.cxx b/dbaccess/source/ui/tabledesign/TableDesignView.cxx index 8e52ba38c..c77a92397 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignView.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignView.cxx @@ -277,7 +277,7 @@ IMPL_LINK( OTableDesignView, SwitchHdl, Accelerator*, /*pAcc*/ ) //------------------------------------------------------------------------------ long OTableDesignView::PreNotify( NotifyEvent& rNEvt ) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; switch(rNEvt.GetType()) { case EVENT_GETFOCUS: diff --git a/dbaccess/source/ui/tabledesign/TableFieldControl.cxx b/dbaccess/source/ui/tabledesign/TableFieldControl.cxx index 65b0dfc88..53926cb9a 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldControl.cxx +++ b/dbaccess/source/ui/tabledesign/TableFieldControl.cxx @@ -104,7 +104,7 @@ void OTableFieldControl::DeactivateAggregate( EControlType eType ) } } // ----------------------------------------------------------------------------- -void OTableFieldControl::SetModified(BOOL bModified) +void OTableFieldControl::SetModified(sal_Bool bModified) { GetCtrl()->GetView()->getController().setModified(bModified); } diff --git a/dbaccess/source/ui/tabledesign/TableFieldControl.hxx b/dbaccess/source/ui/tabledesign/TableFieldControl.hxx index d34d77a5f..8b78d42f5 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldControl.hxx +++ b/dbaccess/source/ui/tabledesign/TableFieldControl.hxx @@ -44,9 +44,9 @@ namespace dbaui virtual void ActivateAggregate( EControlType eType ); virtual void DeactivateAggregate( EControlType eType ); // Sind von den abgeleiteten Klassen zu impl. - virtual void CellModified(long nRow, USHORT nColId ); - virtual BOOL IsReadOnly(); - virtual void SetModified(BOOL bModified); + virtual void CellModified(long nRow, sal_uInt16 nColId ); + virtual sal_Bool IsReadOnly(); + virtual void SetModified(sal_Bool bModified); virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > GetFormatter() const; virtual ::com::sun::star::lang::Locale GetLocale() const; diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx index 54ec43687..cf3a65c1e 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx +++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx @@ -303,7 +303,7 @@ void OTableFieldDescWin::LoseFocus() // ----------------------------------------------------------------------------- long OTableFieldDescWin::PreNotify( NotifyEvent& rNEvt ) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; switch(rNEvt.GetType()) { case EVENT_GETFOCUS: diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx index 0356365ef..f1c19a9df 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx +++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx @@ -70,16 +70,16 @@ namespace dbaui void DisplayData( OFieldDescription* pFieldDescr ); void SaveData( OFieldDescription* pFieldDescr ); - void SetReadOnly( BOOL bReadOnly ); + void SetReadOnly( sal_Bool bReadOnly ); // window overloads virtual long PreNotify( NotifyEvent& rNEvt ); virtual void GetFocus(); virtual void LoseFocus(); - void SetControlText( USHORT nControlId, const String& rText ) + void SetControlText( sal_uInt16 nControlId, const String& rText ) { m_pGenPage->SetControlText(nControlId,rText); } - String GetControlText( USHORT nControlId ) + String GetControlText( sal_uInt16 nControlId ) { return m_pGenPage->GetControlText(nControlId); } // short GetFormatCategory(OFieldDescription* pFieldDescr) { return m_pGenPage ? m_pGenPage->GetFormatCategory(pFieldDescr) : -1; } diff --git a/dbaccess/source/ui/tabledesign/TableRowExchange.cxx b/dbaccess/source/ui/tabledesign/TableRowExchange.cxx index 249698c19..11913c22a 100644 --- a/dbaccess/source/ui/tabledesign/TableRowExchange.cxx +++ b/dbaccess/source/ui/tabledesign/TableRowExchange.cxx @@ -68,7 +68,7 @@ namespace dbaui // ----------------------------------------------------------------------------- sal_Bool OTableRowExchange::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) { - ULONG nFormat = SotExchange::GetFormat(rFlavor); + sal_uLong nFormat = SotExchange::GetFormat(rFlavor); if(nFormat == SOT_FORMATSTR_ID_SBA_TABED) return SetObject(&m_vTableRow,SOT_FORMATSTR_ID_SBA_TABED,rFlavor); return sal_False; diff --git a/dbaccess/source/ui/tabledesign/TableUndo.cxx b/dbaccess/source/ui/tabledesign/TableUndo.cxx index ec5421a28..96ebd4ac5 100644 --- a/dbaccess/source/ui/tabledesign/TableUndo.cxx +++ b/dbaccess/source/ui/tabledesign/TableUndo.cxx @@ -55,7 +55,7 @@ TYPEINIT1( OPrimKeyUndoAct, OTableEditorUndoAct ); // class OTableDesignUndoAct //============================================================================== DBG_NAME(OTableDesignUndoAct); -OTableDesignUndoAct::OTableDesignUndoAct( OTableRowView* pOwner,USHORT nCommentID ) : OCommentUndoAction(nCommentID) +OTableDesignUndoAct::OTableDesignUndoAct( OTableRowView* pOwner,sal_uInt16 nCommentID ) : OCommentUndoAction(nCommentID) ,m_pTabDgnCtrl( pOwner ) { DBG_CTOR(OTableDesignUndoAct,NULL); @@ -99,7 +99,7 @@ void OTableDesignUndoAct::Redo() // class OTableDesignCellUndoAct //============================================================================== DBG_NAME(OTableDesignCellUndoAct); -OTableDesignCellUndoAct::OTableDesignCellUndoAct( OTableRowView* pOwner, long nRowID, USHORT nColumn ) : +OTableDesignCellUndoAct::OTableDesignCellUndoAct( OTableRowView* pOwner, long nRowID, sal_uInt16 nColumn ) : OTableDesignUndoAct( pOwner ,STR_TABED_UNDO_CELLMODIFIED) ,m_nCol( nColumn ) ,m_nRow( nRowID ) @@ -153,7 +153,7 @@ void OTableDesignCellUndoAct::Redo() // class OTableEditorUndoAct //============================================================================== DBG_NAME(OTableEditorUndoAct); -OTableEditorUndoAct::OTableEditorUndoAct( OTableEditorCtrl* pOwner,USHORT _nCommentID ) : +OTableEditorUndoAct::OTableEditorUndoAct( OTableEditorCtrl* pOwner,sal_uInt16 _nCommentID ) : OTableDesignUndoAct( pOwner ,_nCommentID) ,pTabEdCtrl(pOwner) { @@ -170,7 +170,7 @@ OTableEditorUndoAct::~OTableEditorUndoAct() // class OTableEditorTypeSelUndoAct //============================================================================== DBG_NAME(OTableEditorTypeSelUndoAct); -OTableEditorTypeSelUndoAct::OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, long nRowID, USHORT nColumn, const TOTypeInfoSP& _pOldType ) +OTableEditorTypeSelUndoAct::OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, long nRowID, sal_uInt16 nColumn, const TOTypeInfoSP& _pOldType ) :OTableEditorUndoAct( pOwner ,STR_TABED_UNDO_TYPE_CHANGED) ,m_nCol( nColumn ) ,m_nRow( nRowID ) @@ -249,7 +249,7 @@ void OTableEditorDelUndoAct::Undo() { ////////////////////////////////////////////////////////////////////// // Geloeschte Zeilen wieder einfuegen - ULONG nPos; + sal_uLong nPos; ::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aIter = m_aDeletedRows.begin(); ::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aEnd = m_aDeletedRows.end(); @@ -273,7 +273,7 @@ void OTableEditorDelUndoAct::Redo() { ////////////////////////////////////////////////////////////////////// // Zeilen wieder loeschen - ULONG nPos; + sal_uLong nPos; ::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aIter = m_aDeletedRows.begin(); ::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aEnd = m_aDeletedRows.end(); ::std::vector< ::boost::shared_ptr<OTableRow> >* pOriginalRows = pTabEdCtrl->GetRowList(); @@ -322,7 +322,7 @@ void OTableEditorInsUndoAct::Undo() pOriginalRows->erase(pOriginalRows->begin()+i); } - pTabEdCtrl->RowRemoved( m_nInsPos, m_vInsertedRows.size(), TRUE ); + pTabEdCtrl->RowRemoved( m_nInsPos, m_vInsertedRows.size(), sal_True ); pTabEdCtrl->InvalidateHandleColumn(); OTableEditorUndoAct::Undo(); @@ -345,7 +345,7 @@ void OTableEditorInsUndoAct::Redo() nInsertRow++; } - pTabEdCtrl->RowInserted( m_nInsPos, m_vInsertedRows.size(), TRUE ); + pTabEdCtrl->RowInserted( m_nInsPos, m_vInsertedRows.size(), sal_True ); pTabEdCtrl->InvalidateHandleColumn(); OTableEditorUndoAct::Redo(); @@ -381,7 +381,7 @@ void OTableEditorInsNewUndoAct::Undo() pOriginalRows->erase(pOriginalRows->begin()+i); } - pTabEdCtrl->RowRemoved( m_nInsPos, m_nInsRows, TRUE ); + pTabEdCtrl->RowRemoved( m_nInsPos, m_nInsRows, sal_True ); pTabEdCtrl->InvalidateHandleColumn(); OTableEditorUndoAct::Undo(); @@ -397,7 +397,7 @@ void OTableEditorInsNewUndoAct::Redo() for( long i=m_nInsPos; i<(m_nInsPos+m_nInsRows); i++ ) pRowList->insert( pRowList->begin()+i,::boost::shared_ptr<OTableRow>(new OTableRow()) ); - pTabEdCtrl->RowInserted( m_nInsPos, m_nInsRows, TRUE ); + pTabEdCtrl->RowInserted( m_nInsPos, m_nInsRows, sal_True ); pTabEdCtrl->InvalidateHandleColumn(); OTableEditorUndoAct::Redo(); @@ -437,7 +437,7 @@ void OPrimKeyUndoAct::Undo() { OSL_ENSURE(nIndex <= static_cast<long>(pRowList->size()),"Index for undo isn't valid!"); pRow = (*pRowList)[nIndex]; - pRow->SetPrimaryKey( FALSE ); + pRow->SetPrimaryKey( sal_False ); } ////////////////////////////////////////////////////////////////////// @@ -446,7 +446,7 @@ void OPrimKeyUndoAct::Undo() { OSL_ENSURE(nIndex <= static_cast<long>(pRowList->size()),"Index for undo isn't valid!"); pRow = (*pRowList)[nIndex]; - pRow->SetPrimaryKey( TRUE ); + pRow->SetPrimaryKey( sal_True ); } m_pEditorCtrl->InvalidateHandleColumn(); @@ -462,12 +462,12 @@ void OPrimKeyUndoAct::Redo() ////////////////////////////////////////////////////////////////////// // Die geloeschten Keys loeschen for( nIndex = m_aDelKeys.FirstSelected(); nIndex != (long)SFX_ENDOFSELECTION; nIndex=m_aDelKeys.NextSelected() ) - (*pRowList)[nIndex]->SetPrimaryKey( FALSE ); + (*pRowList)[nIndex]->SetPrimaryKey( sal_False ); ////////////////////////////////////////////////////////////////////// // Die eingefuegten Keys herstellen for( nIndex = m_aInsKeys.FirstSelected(); nIndex != (long)SFX_ENDOFSELECTION; nIndex=m_aInsKeys.NextSelected() ) - (*pRowList)[nIndex]->SetPrimaryKey( TRUE ); + (*pRowList)[nIndex]->SetPrimaryKey( sal_True ); m_pEditorCtrl->InvalidateHandleColumn(); OTableEditorUndoAct::Redo(); diff --git a/dbaccess/source/ui/tabledesign/TableUndo.hxx b/dbaccess/source/ui/tabledesign/TableUndo.hxx index 5f096d87a..0e3b04a59 100644 --- a/dbaccess/source/ui/tabledesign/TableUndo.hxx +++ b/dbaccess/source/ui/tabledesign/TableUndo.hxx @@ -50,7 +50,7 @@ namespace dbaui virtual void Redo(); public: TYPEINFO(); - OTableDesignUndoAct( OTableRowView* pOwner ,USHORT nCommentID); + OTableDesignUndoAct( OTableRowView* pOwner ,sal_uInt16 nCommentID); virtual ~OTableDesignUndoAct(); }; @@ -63,7 +63,7 @@ namespace dbaui public: TYPEINFO(); - OTableEditorUndoAct( OTableEditorCtrl* pOwner,USHORT nCommentID ); + OTableEditorUndoAct( OTableEditorCtrl* pOwner,sal_uInt16 nCommentID ); virtual ~OTableEditorUndoAct(); }; @@ -72,7 +72,7 @@ namespace dbaui class OTableDesignCellUndoAct : public OTableDesignUndoAct { protected: - USHORT m_nCol; + sal_uInt16 m_nCol; long m_nRow; ::com::sun::star::uno::Any m_sOldText; ::com::sun::star::uno::Any m_sNewText; @@ -81,7 +81,7 @@ namespace dbaui virtual void Redo(); public: TYPEINFO(); - OTableDesignCellUndoAct( OTableRowView* pOwner, long nRowID, USHORT nColumn ); + OTableDesignCellUndoAct( OTableRowView* pOwner, long nRowID, sal_uInt16 nColumn ); virtual ~OTableDesignCellUndoAct(); }; @@ -90,7 +90,7 @@ namespace dbaui class OTableEditorTypeSelUndoAct : public OTableEditorUndoAct { protected: - USHORT m_nCol; + sal_uInt16 m_nCol; long m_nRow; TOTypeInfoSP m_pOldType; TOTypeInfoSP m_pNewType; @@ -99,7 +99,7 @@ namespace dbaui virtual void Redo(); public: TYPEINFO(); - OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, long nRowID, USHORT nColumn, const TOTypeInfoSP& _pOldType ); + OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, long nRowID, sal_uInt16 nColumn, const TOTypeInfoSP& _pOldType ); virtual ~OTableEditorTypeSelUndoAct(); }; @@ -155,7 +155,7 @@ namespace dbaui protected: MultiSelection m_aDelKeys, m_aInsKeys; - BOOL m_bActPrimKeySet; + sal_Bool m_bActPrimKeySet; OTableEditorCtrl* m_pEditorCtrl; virtual void Undo(); diff --git a/dbaccess/source/ui/tabledesign/table.src b/dbaccess/source/ui/tabledesign/table.src index bffb9404d..06f3f5a24 100644 --- a/dbaccess/source/ui/tabledesign/table.src +++ b/dbaccess/source/ui/tabledesign/table.src @@ -190,7 +190,7 @@ Menu RID_TABLEDESIGNROWPOPUPMENU MenuItem { Identifier = SID_TABLEDESIGN_INSERTROWS ; - HelpID = SID_TABLEDESIGN_INSERTROWS ; + HelpID = HID_TABLEDESIGN_INSERTROWS ; Text [ en-US ] = "Insert Rows" ; }; MenuItem @@ -200,7 +200,7 @@ Menu RID_TABLEDESIGNROWPOPUPMENU MenuItem { Identifier = SID_TABLEDESIGN_TABED_PRIMARYKEY ; - HelpID = SID_TABLEDESIGN_TABED_PRIMARYKEY ; + HelpID = HID_TABLEDESIGN_TABED_PRIMARYKEY ; Checkable = TRUE ; Text [ en-US ] = "Primary Key" ; }; diff --git a/dbaccess/source/ui/uno/ColumnControl.cxx b/dbaccess/source/ui/uno/ColumnControl.cxx index 77a4c50e6..be6a0a717 100644 --- a/dbaccess/source/ui/uno/ColumnControl.cxx +++ b/dbaccess/source/ui/uno/ColumnControl.cxx @@ -50,7 +50,7 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::sdbc; OColumnControl::OColumnControl(const Reference<XMultiServiceFactory>& _rxFactory) -: m_xORB(_rxFactory) + :UnoControl( _rxFactory ) { } // ----------------------------------------------------------------------------- @@ -76,7 +76,7 @@ void SAL_CALL OColumnControl::createPeer(const Reference< XToolkit >& /*rToolkit pParentWin = pParent->GetWindow(); } - OColumnPeer* pPeer = new OColumnPeer(pParentWin,m_xORB); + OColumnPeer* pPeer = new OColumnPeer( pParentWin, maContext.getLegacyServiceFactory() ); OSL_ENSURE(pPeer != NULL, "FmXGridControl::createPeer : imp_CreatePeer didn't return a peer !"); setPeer( pPeer ); diff --git a/dbaccess/source/ui/uno/ColumnControl.hxx b/dbaccess/source/ui/uno/ColumnControl.hxx index c2add8b72..6b4fe0e23 100644 --- a/dbaccess/source/ui/uno/ColumnControl.hxx +++ b/dbaccess/source/ui/uno/ColumnControl.hxx @@ -35,7 +35,6 @@ namespace dbaui { class OColumnControl : public UnoControl { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xORB; public: OColumnControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index 55213d366..a96cbc779 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -1179,8 +1179,15 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou aSourceColTypes.reserve( nCount + 1 ); aSourceColTypes.push_back( -1 ); // just to avoid a everytime i-1 call + ::std::vector< sal_Int32 > aSourcePrec; + aSourcePrec.reserve( nCount + 1 ); + aSourcePrec.push_back( -1 ); // just to avoid a everytime i-1 call + for ( sal_Int32 k=1; k <= nCount; ++k ) + { aSourceColTypes.push_back( xMeta->getColumnType( k ) ); + aSourcePrec.push_back( xMeta->getPrecision( k ) ); + } // now create, fill and execute the prepared statement Reference< XPreparedStatement > xStatement( ODatabaseExport::createPreparedStatment( xDestMetaData, _rxDestTable, aColumnMapping ), UNO_SET_THROW ); @@ -1292,7 +1299,6 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou case DataType::LONGVARBINARY: case DataType::BINARY: case DataType::VARBINARY: - case DataType::BIT: aTransfer.transferComplexValue( &XRow::getBytes, &XParameters::setBytes ); break; @@ -1307,8 +1313,15 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou case DataType::TIMESTAMP: aTransfer.transferComplexValue( &XRow::getTimestamp, &XParameters::setTimestamp ); break; - - case DataType::BOOLEAN: + + case DataType::BIT: + if ( aSourcePrec[nSourceColumn] > 1 ) + { + aTransfer.transferComplexValue( &XRow::getBytes, &XParameters::setBytes ); + break; + } + // run through + case DataType::BOOLEAN: aTransfer.transferValue( &XRow::getBoolean, &XParameters::setBoolean ); break; diff --git a/dbaccess/util/dba.component b/dbaccess/util/dba.component new file mode 100644 index 000000000..b25768dbf --- /dev/null +++ b/dbaccess/util/dba.component @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.chart2.data.DatabaseDataProvider"> + <service name="com.sun.star.chart2.data.DatabaseDataProvider"/> + </implementation> + <implementation name="com.sun.star.comp.dba.DataAccessDescriptorFactory"> + <service name="com.sun.star.sdb.DataAccessDescriptorFactory"/> + <singleton name="com.sun.star.sdb.DataAccessDescriptorFactory"/> + </implementation> + <implementation name="com.sun.star.comp.dba.OCommandDefinition"> + <service name="com.sun.star.sdb.CommandDefinition"/> + <service name="com.sun.star.sdb.QueryDefinition"/> + </implementation> + <implementation name="com.sun.star.comp.dba.OComponentDefinition"> + <service name="com.sun.star.sdb.TableDefinition"/> + </implementation> + <implementation name="com.sun.star.comp.dba.ODatabaseContext"> + <service name="com.sun.star.sdb.DatabaseContext"/> + </implementation> + <implementation name="com.sun.star.comp.dba.ODatabaseDocument"> + <service name="com.sun.star.document.OfficeDocument"/> + <service name="com.sun.star.sdb.OfficeDatabaseDocument"/> + </implementation> + <implementation name="com.sun.star.comp.dba.ODatabaseSource"> + <service name="com.sun.star.sdb.DataSource"/> + <service name="com.sun.star.sdb.DocumentDataSource"/> + </implementation> + <implementation name="com.sun.star.comp.dba.ORowSet"> + <service name="com.sun.star.sdb.ResultSet"/> + <service name="com.sun.star.sdb.RowSet"/> + <service name="com.sun.star.sdbc.ResultSet"/> + <service name="com.sun.star.sdbc.RowSet"/> + <service name="com.sun.star.sdbcx.ResultSet"/> + </implementation> +</component> diff --git a/dbaccess/util/dbu.component b/dbaccess/util/dbu.component new file mode 100644 index 000000000..ce0dc45cf --- /dev/null +++ b/dbaccess/util/dbu.component @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.dbaccess.DatabaseInteractionHandler"> + <service name="com.sun.star.sdb.DatabaseInteractionHandler"/> + </implementation> + <implementation name="com.sun.star.comp.dbaccess.LegacyInteractionHandler"> + <service name="com.sun.star.sdb.InteractionHandler"/> + </implementation> + <implementation + name="com.sun.star.comp.dbaccess.OTextConnectionSettingsDialog"> + <service name="com.sun.star.sdb.TextConnectionSettings"/> + </implementation> + <implementation name="com.sun.star.comp.dbu.OColumnControl"> + <service name="com.sun.star.sdb.ColumnDescriptorControl"/> + </implementation> + <implementation name="com.sun.star.comp.dbu.OColumnControlModel"> + <service name="com.sun.star.sdb.ColumnDescriptorControlModel"/> + </implementation> + <implementation name="com.sun.star.comp.dbu.SbaXGridControl"> + <service name="com.sun.star.form.control.GridControl"/> + <service name="com.sun.star.form.control.InteractionGridControl"/> + </implementation> + <implementation name="com.sun.star.comp.sdb.DirectSQLDialog"> + <service name="org.openoffice.comp.dbu.DirectSqlDialog"/> + </implementation> + <implementation name="com.sun.star.sdb.ApplicationStatusbarController"> + <service name="com.sun.star.frame.StatusbarController"/> + </implementation> + <implementation name="com.sun.star.sdb.ApplicationToolboxController"> + <service name="com.sun.star.frame.ToolboxController"/> + </implementation> + <implementation name="com.sun.star.uno.comp.sdb.RowsetFilterDialog"> + <service name="com.sun.star.sdb.FilterDialog"/> + </implementation> + <implementation name="com.sun.star.uno.comp.sdb.RowsetOrderDialog"> + <service name="com.sun.star.sdb.OrderDialog"/> + </implementation> + <implementation name="org.openoffice.comp.dbu.CopyTableWizard"> + <service name="com.sun.star.sdb.application.CopyTableWizard"/> + </implementation> + <implementation name="org.openoffice.comp.dbu.DBContentLoader"> + <service name="com.sun.star.frame.FrameLoader"/> + <service name="com.sun.star.sdb.ContentLoader"/> + </implementation> + <implementation name="org.openoffice.comp.dbu.OAdvancedSettingsDialog"> + <service name="com.sun.star.sdb.AdvancedDatabaseSettingsDialog"/> + </implementation> + <implementation name="org.openoffice.comp.dbu.OApplicationController"> + <service name="com.sun.star.sdb.application.DefaultViewController"/> + </implementation> + <implementation name="org.openoffice.comp.dbu.ODBTypeWizDialog"> + <service name="com.sun.star.sdb.DataSourceTypeChangeDialog"/> + </implementation> + <implementation name="org.openoffice.comp.dbu.ODBTypeWizDialogSetup"> + <service name="com.sun.star.sdb.DatabaseWizardDialog"/> + </implementation> + <implementation + name="org.openoffice.comp.dbu.ODatasourceAdministrationDialog"> + <service name="com.sun.star.sdb.DatasourceAdministrationDialog"/> + </implementation> + <implementation name="org.openoffice.comp.dbu.ODatasourceBrowser"> + <service name="com.sun.star.sdb.DataSourceBrowser"/> + </implementation> + <implementation name="org.openoffice.comp.dbu.OFormGridView"> + <service name="com.sun.star.sdb.FormGridView"/> + </implementation> + <implementation name="org.openoffice.comp.dbu.OQueryDesign"> + <service name="com.sun.star.sdb.QueryDesign"/> + </implementation> + <implementation name="org.openoffice.comp.dbu.ORelationDesign"> + <service name="com.sun.star.sdb.RelationDesign"/> + </implementation> + <implementation name="org.openoffice.comp.dbu.OSQLMessageDialog"> + <service name="com.sun.star.sdb.ErrorMessageDialog"/> + </implementation> + <implementation name="org.openoffice.comp.dbu.OTableDesign"> + <service name="com.sun.star.sdb.TableDesign"/> + </implementation> + <implementation name="org.openoffice.comp.dbu.OTableFilterDialog"> + <service name="com.sun.star.sdb.TableFilterDialog"/> + </implementation> + <implementation name="org.openoffice.comp.dbu.OUserSettingsDialog"> + <service name="com.sun.star.sdb.UserAdministrationDialog"/> + </implementation> + <implementation name="org.openoffice.comp.dbu.OViewDesign"> + <service name="com.sun.star.sdb.ViewDesign"/> + </implementation> +</component> diff --git a/dbaccess/util/hidother.src b/dbaccess/util/hidother.src index e929d63d0..1fe5b6ca2 100644 --- a/dbaccess/util/hidother.src +++ b/dbaccess/util/hidother.src @@ -26,10 +26,6 @@ ************************************************************************/ #include "../inc/dbaccess_helpid.hrc" -#include "../inc/dbaccess_slotid.hrc" -#ifndef _SBASLTID_HRC -#include <svx/svxids.hrc> -#endif hidspecial HID_DLG_FILTERCRIT { HelpId = HID_DLG_FILTERCRIT; }; hidspecial HID_DLG_ORDERCRIT { HelpId = HID_DLG_ORDERCRIT; }; @@ -148,8 +144,11 @@ hidspecial HID_TABDESIGN_TYPECELL { HelpId = HID_TABDESIGN_TYPECELL; }; hidspecial HID_TABDESIGN_COMMENTCELL { HelpId = HID_TABDESIGN_COMMENTCELL; }; hidspecial HID_TABDESIGN_HELPTEXT { HelpId = HID_TABDESIGN_HELPTEXT; }; +/* hidspecial SID_TABLEDESIGN_INSERTROWS { HelpId = SID_TABLEDESIGN_INSERTROWS; }; hidspecial SID_TABLEDESIGN_TABED_PRIMARYKEY { HelpId = SID_TABLEDESIGN_TABED_PRIMARYKEY; }; +*/ + hidspecial HID_TLB_TABLEDESIGN { HelpId = HID_TLB_TABLEDESIGN; }; hidspecial HID_TAB_DESIGN_HELP_TEXT_FRAME { HelpId = HID_TAB_DESIGN_HELP_TEXT_FRAME; }; hidspecial HID_TABLE_DESIGN_TABPAGE_GENERAL { HelpId = HID_TABLE_DESIGN_TABPAGE_GENERAL; }; @@ -169,7 +168,6 @@ hidspecial HID_BROWSER_TABLE_CREATE_DESIGN { HelpId = HID_BROWSER_TABLE_CREAT hidspecial HID_BROWSER_TABLE_EDIT { HelpId = HID_BROWSER_TABLE_EDIT; }; hidspecial HID_BROWSER_TABLE_DELETE { HelpId = HID_BROWSER_TABLE_DELETE; }; hidspecial HID_SQLERROR_EXCHAIN_ERRORS { HelpId = HID_SQLERROR_EXCHAIN_ERRORS; }; -hidspecial HID_DBACCESS_START { HelpId = HID_DBACCESS_START; }; hidspecial HID_SQLERROR_EXCHAIN_TEXT { HelpId = HID_SQLERROR_EXCHAIN_TEXT; }; hidspecial HID_TAB_WIZ_COLUMN_SELECT { HelpId = HID_TAB_WIZ_COLUMN_SELECT; }; hidspecial HID_TAB_WIZ_TYPE_SELECT { HelpId = HID_TAB_WIZ_TYPE_SELECT; }; @@ -254,11 +252,13 @@ hidspecial HID_DLG_REL_CASC_UPD_DEFAULT { HelpId = HID_DLG_REL_CASC_UPD_DEFA hidspecial HID_BROWSER_SAVE_RECORD { HelpId = HID_BROWSER_SAVE_RECORD ; }; hidspecial HID_BROWSER_UNDO_RECORD { HelpId = HID_BROWSER_UNDO_RECORD ; }; +/* // missing pre processor for helpids so we have to include them here hidspecial SID_RELATION_ADD_RELATION { HelpId = SID_RELATION_ADD_RELATION ; }; hidspecial SID_FM_NATIVESQL { HelpId = SID_FM_NATIVESQL ; }; hidspecial SID_FM_ADDTABLE { HelpId = SID_FM_ADDTABLE ; }; hidspecial SID_FM_EXECUTE { HelpId = SID_FM_EXECUTE ; }; +*/ hidspecial HID_DSADMIN_SQL92CHECK { HelpId = HID_DSADMIN_SQL92CHECK ; }; hidspecial HID_DSADMIN_AUTOINCREMENTVALUE { HelpId = HID_DSADMIN_AUTOINCREMENTVALUE ; }; @@ -301,7 +301,6 @@ hidspecial UID_APP_VIEW_VERT_SPLIT { HelpId = UID_APP_VIEW_VERT_SPLIT ; }; hidspecial UID_APP_VIEW_BORDER_WIN { HelpId = UID_APP_VIEW_BORDER_WIN ; }; hidspecial HID_APP_CREATION_LIST { HelpId = HID_APP_CREATION_LIST ; }; hidspecial UID_APP_SWAP_VIEW { HelpId = UID_APP_SWAP_VIEW ; }; -hidspecial UID_DLG_TABLE_FILTER { HelpId = UID_DLG_TABLE_FILTER ; }; hidspecial HID_APP_SWAP_ICONCONTROL { HelpId = HID_APP_SWAP_ICONCONTROL ; }; hidspecial HID_DSADMIN_APPENDTABLEALIAS { HelpId = HID_DSADMIN_APPENDTABLEALIAS ; }; @@ -350,13 +349,13 @@ hidspecial HID_PAGE_DBWIZARD_GENERAL_RB_GETEXISTINGDATABASE { HelpId = HID_PAG hidspecial HID_PAGE_DBWIZARD_DBASE_ET_DBASELOCATION { HelpId = HID_PAGE_DBWIZARD_DBASE_ET_DBASELOCATION ; }; hidspecial HID_PAGE_DBWIZARD_DBASE_PB_DBASELOCATION { HelpId = HID_PAGE_DBWIZARD_DBASE_PB_DBASELOCATION ; }; +/* hidspecial SID_INDEXDESIGN { HelpId = SID_INDEXDESIGN; }; hidspecial SID_DOCUMENT_DATA_SOURCE { HelpId = SID_DOCUMENT_DATA_SOURCE; }; hidspecial SID_DB_NEW { HelpId = SID_DB_NEW; }; hidspecial SID_DB_APP_DISABLE_PREVIEW { HelpId = SID_DB_APP_DISABLE_PREVIEW; }; hidspecial SID_DB_APP_DSCONNECTION_TYPE { HelpId = SID_DB_APP_DSCONNECTION_TYPE; }; hidspecial SID_DB_APP_DSADVANCED_SETTINGS { HelpId = SID_DB_APP_DSADVANCED_SETTINGS; }; - hidspecial SID_DB_APP_VIEW_DOCINFO_PREVIEW { HelpId = SID_DB_APP_VIEW_DOCINFO_PREVIEW; }; hidspecial SID_DB_APP_VIEW_DOC_PREVIEW { HelpId = SID_DB_APP_VIEW_DOC_PREVIEW; }; hidspecial SID_DB_APP_VIEW_TABLES { HelpId = SID_DB_APP_VIEW_TABLES; }; @@ -369,38 +368,31 @@ hidspecial SID_DB_APP_TABLEFILTER { HelpId = SID_DB_APP_TABLEFILTER; }; hidspecial SID_DB_APP_CLOSECONNECTION { HelpId = SID_DB_APP_CLOSECONNECTION; }; hidspecial SID_DB_APP_DSPROPS { HelpId = SID_DB_APP_DSPROPS; }; hidspecial SID_DB_APP_DBADMIN { HelpId = SID_DB_APP_DBADMIN; }; - hidspecial SID_DB_APP_CONVERTTOVIEW { HelpId = SID_DB_APP_CONVERTTOVIEW; }; hidspecial SID_DB_APP_REFRESH_TABLES { HelpId = SID_DB_APP_REFRESH_TABLES; }; hidspecial SID_DB_APP_VIEW_REPORTS { HelpId = SID_DB_APP_VIEW_REPORTS; }; hidspecial SID_DB_APP_DSEXPORT { HelpId = SID_DB_APP_DSEXPORT; }; - hidspecial SID_DB_APP_TABLE_DELETE { HelpId = SID_DB_APP_TABLE_DELETE; }; hidspecial SID_DB_APP_TABLE_RENAME { HelpId = SID_DB_APP_TABLE_RENAME; }; hidspecial SID_DB_APP_TABLE_EDIT { HelpId = SID_DB_APP_TABLE_EDIT; }; hidspecial SID_DB_APP_TABLE_OPEN { HelpId = SID_DB_APP_TABLE_OPEN; }; - hidspecial SID_DB_APP_QUERY_DELETE { HelpId = SID_DB_APP_QUERY_DELETE; }; hidspecial SID_DB_APP_QUERY_RENAME { HelpId = SID_DB_APP_QUERY_RENAME; }; hidspecial SID_DB_APP_QUERY_EDIT { HelpId = SID_DB_APP_QUERY_EDIT; }; hidspecial SID_DB_APP_QUERY_OPEN { HelpId = SID_DB_APP_QUERY_OPEN; }; - hidspecial SID_DB_APP_FORM_DELETE { HelpId = SID_DB_APP_FORM_DELETE; }; hidspecial SID_DB_APP_FORM_RENAME { HelpId = SID_DB_APP_FORM_RENAME; }; hidspecial SID_DB_APP_FORM_EDIT { HelpId = SID_DB_APP_FORM_EDIT; }; hidspecial SID_DB_APP_FORM_OPEN { HelpId = SID_DB_APP_FORM_OPEN; }; - hidspecial SID_DB_APP_REPORT_DELETE { HelpId = SID_DB_APP_REPORT_DELETE; }; hidspecial SID_DB_APP_REPORT_RENAME { HelpId = SID_DB_APP_REPORT_RENAME; }; hidspecial SID_DB_APP_REPORT_EDIT { HelpId = SID_DB_APP_REPORT_EDIT; }; hidspecial SID_DB_APP_REPORT_OPEN { HelpId = SID_DB_APP_REPORT_OPEN; }; - hidspecial SID_DB_APP_DELETE { HelpId = SID_DB_APP_DELETE; }; hidspecial SID_DB_APP_RENAME { HelpId = SID_DB_APP_RENAME; }; hidspecial SID_DB_APP_EDIT { HelpId = SID_DB_APP_EDIT; }; hidspecial SID_DB_APP_EDIT_SQL_VIEW { HelpId = SID_DB_APP_EDIT_SQL_VIEW; }; hidspecial SID_DB_APP_OPEN { HelpId = SID_DB_APP_OPEN; }; - hidspecial SID_BROWSER_CLEAR_QUERY { HelpId = SID_BROWSER_CLEAR_QUERY; }; hidspecial SID_RELATION_ADD_RELATION { HelpId = SID_RELATION_ADD_RELATION; }; hidspecial SID_QUERY_VIEW_FUNCTIONS { HelpId = SID_QUERY_VIEW_FUNCTIONS; }; @@ -410,58 +402,47 @@ hidspecial SID_QUERY_DISTINCT_VALUES { HelpId = SID_QUERY_DISTINCT_VALUES; }; hidspecial SID_FORM_CREATE_REPWIZ_PRE_SEL { HelpId = SID_FORM_CREATE_REPWIZ_PRE_SEL; }; hidspecial SID_REPORT_CREATE_REPWIZ_PRE_SEL { HelpId = SID_REPORT_CREATE_REPWIZ_PRE_SEL; }; hidspecial SID_APP_NEW_REPORT_PRE_SEL { HelpId = SID_APP_NEW_REPORT_PRE_SEL; }; - hidspecial SID_APP_NEW_FOLDER { HelpId = SID_APP_NEW_FOLDER; }; hidspecial SID_APP_NEW_FORM { HelpId = SID_APP_NEW_FORM; }; hidspecial SID_DB_APP_PASTE_SPECIAL { HelpId = SID_DB_APP_PASTE_SPECIAL; }; hidspecial SID_DB_QUERY_PREVIEW { HelpId = SID_DB_QUERY_PREVIEW; }; - hidspecial SID_DB_APP_STATUS_TYPE { HelpId = SID_DB_APP_STATUS_TYPE; }; hidspecial SID_DB_APP_STATUS_DBNAME { HelpId = SID_DB_APP_STATUS_DBNAME; }; hidspecial SID_DB_APP_STATUS_USERNAME { HelpId = SID_DB_APP_STATUS_USERNAME; }; hidspecial SID_DB_APP_STATUS_HOSTNAME { HelpId = SID_DB_APP_STATUS_HOSTNAME; }; - hidspecial SID_DB_APP_SENDREPORTASMAIL { HelpId = SID_DB_APP_SENDREPORTASMAIL; }; hidspecial SID_DB_APP_SENDREPORTTOWRITER { HelpId = SID_DB_APP_SENDREPORTTOWRITER; }; hidspecial SID_DB_NEW_VIEW_SQL { HelpId = SID_DB_NEW_VIEW_SQL; }; +*/ hidspecial HID_PAGE_DBWIZARD_TEXT_ET_LOCATIONTEXTFILE { HelpId = HID_PAGE_DBWIZARD_TEXT_ET_LOCATIONTEXTFILE ; }; hidspecial HID_PAGE_DBWIZARD_TEXT_PB_LOCATIONTEXTFILE { HelpId = HID_PAGE_DBWIZARD_TEXT_PB_LOCATIONTEXTFILE ; }; - hidspecial HID_PAGE_DBWIZARD_TEXT_RB_ACCESSTXTFILES { HelpId = HID_PAGE_DBWIZARD_TEXT_RB_ACCESSTXTFILES ; }; hidspecial HID_PAGE_DBWIZARD_TEXT_RB_ACCESSCSVFILES { HelpId = HID_PAGE_DBWIZARD_TEXT_RB_ACCESSCSVFILES ; }; hidspecial HID_PAGE_DBWIZARD_TEXT_RB_ACCESSOTHERFILES { HelpId = HID_PAGE_DBWIZARD_TEXT_RB_ACCESSOTHERFILES ; }; hidspecial HID_PAGE_DBWIZARD_TEXT_ET_OWNEXTENSION { HelpId = HID_PAGE_DBWIZARD_TEXT_ET_OWNEXTENSION ; }; - hidspecial HID_PAGE_DBWIZARD_TEXT_CB_FIELDSEPARATOR { HelpId = HID_PAGE_DBWIZARD_TEXT_CB_FIELDSEPARATOR ; }; hidspecial HID_PAGE_DBWIZARD_TEXT_CB_TEXTSEPARATOR { HelpId = HID_PAGE_DBWIZARD_TEXT_CB_TEXTSEPARATOR ; }; hidspecial HID_PAGE_DBWIZARD_TEXT_CB_DECIMALSEPARATOR { HelpId = HID_PAGE_DBWIZARD_TEXT_CB_DECIMALSEPARATOR ; }; hidspecial HID_PAGE_DBWIZARD_TEXT_CB_THOUSANDSSEPARATOR { HelpId = HID_PAGE_DBWIZARD_TEXT_CB_THOUSANDSSEPARATOR ; }; - hidspecial HID_PAGE_DBWIZARD_MSACCESS_ET_MSACCESSLOCATION { HelpId = HID_PAGE_DBWIZARD_MSACCESS_ET_MSACCESSLOCATION ; }; hidspecial HID_PAGE_DBWIZARD_MSACCESS_PB_MSACCESSLOCATION { HelpId = HID_PAGE_DBWIZARD_MSACCESS_PB_MSACCESSLOCATION ; }; - hidspecial HID_PAGE_DBWIZARD_LDAP_ET_HOSTSERVER { HelpId = HID_PAGE_DBWIZARD_LDAP_ET_HOSTSERVER ; }; hidspecial HID_PAGE_DBWIZARD_LDAP_ET_BASEDN { HelpId = HID_PAGE_DBWIZARD_LDAP_ET_BASEDN ; }; hidspecial HID_PAGE_DBWIZARD_LDAP_ET_PORTNUMBER { HelpId = HID_PAGE_DBWIZARD_LDAP_ET_PORTNUMBER ; }; hidspecial HID_PAGE_DBWIZARD_LDAP_CB_USESSL { HelpId = HID_PAGE_DBWIZARD_LDAP_CB_USESSL ; }; hidspecial HID_PAGE_DBWIZARD_LDAP_PB_TESTLDAPCONNECTION { HelpId = HID_PAGE_DBWIZARD_LDAP_PB_TESTLDAPCONNECTION ; }; - hidspecial HID_PAGE_DBWIZARD_ADABAS_ET_ADABASNAME { HelpId = HID_PAGE_DBWIZARD_ADABAS_ET_ADABASNAME ; }; hidspecial HID_PAGE_DBWIZARD_ADABAS_PB_ADABASNAME { HelpId = HID_PAGE_DBWIZARD_ADABAS_PB_ADABASNAME ; }; - hidspecial HID_PAGE_DBWIZARD_MYSQL_RB_CONNECTVIAODBC { HelpId = HID_PAGE_DBWIZARD_MYSQL_RB_CONNECTVIAODBC ; }; hidspecial HID_PAGE_DBWIZARD_MYSQL_RB_CONNECTVIAJDBC { HelpId = HID_PAGE_DBWIZARD_MYSQL_RB_CONNECTVIAJDBC ; }; - hidspecial HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEDBNAME { HelpId = HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEDBNAME ; }; hidspecial HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEHOSTSERVER { HelpId = HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEHOSTSERVER ; }; hidspecial HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEPORT { HelpId = HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEPORT ; }; hidspecial HID_PAGE_DBWIZARD_ORACLE_ET_ORACLECLASS { HelpId = HID_PAGE_DBWIZARD_ORACLE_ET_ORACLECLASS ; }; hidspecial HID_PAGE_DBWIZARD_ORACLE_PB_TESTORACLECLASS { HelpId = HID_PAGE_DBWIZARD_ORACLE_PB_TESTORACLECLASS ; }; - hidspecial HID_PAGE_DBWIZARD_JDBC_ET_JDBCURL { HelpId = HID_PAGE_DBWIZARD_JDBC_ET_JDBCURL ; }; hidspecial HID_PAGE_DBWIZARD_JDBC_PB_JDBCURL { HelpId = HID_PAGE_DBWIZARD_JDBC_PB_JDBCURL ; }; - hidspecial HID_PAGE_DBWIZARD_JDBC_ET_MYSQLDBNAME { HelpId = HID_PAGE_DBWIZARD_JDBC_ET_MYSQLDBNAME ; }; hidspecial HID_PAGE_DBWIZARD_JDBC_ET_MYSQLHOSTSERVER { HelpId = HID_PAGE_DBWIZARD_JDBC_ET_MYSQLHOSTSERVER ; }; hidspecial HID_PAGE_DBWIZARD_JDBC_ET_MYSQLPORT { HelpId = HID_PAGE_DBWIZARD_JDBC_ET_MYSQLPORT ; }; @@ -487,7 +468,11 @@ hidspecial HID_PAGE_DBWIZARD_FINAL_CB_STARTTABLEWIZARD { HelpId = HID_PAGE hidspecial HID_PAGE_DBWIZARD_FINAL_CB_OPENAFTERWARDS { HelpId = HID_PAGE_DBWIZARD_FINAL_CB_OPENAFTERWARDS ; }; hidspecial HID_DSADMIN_USESSL_LDAP { HelpId = HID_DSADMIN_USESSL_LDAP ; }; hidspecial HID_DSADMIN_DOSLINEENDS { HelpId = HID_DSADMIN_DOSLINEENDS ; }; + +/* hidspecial SID_DB_QUERY_PREVIEW { HelpId = SID_DB_QUERY_PREVIEW ; }; +*/ + hidspecial HID_PAGE_DBWIZARD_USERDEFINED_ET_BROWSE { HelpId = HID_PAGE_DBWIZARD_USERDEFINED_ET_BROWSE ; }; hidspecial HID_PAGE_DBWIZARD_USERDEFINED_BROWSE { HelpId = HID_PAGE_DBWIZARD_USERDEFINED_BROWSE ; }; hidspecial HID_DLG_DATABASE_WIZARD { HelpId = HID_DLG_DATABASE_WIZARD ; }; diff --git a/dbaccess/util/makefile.mk b/dbaccess/util/makefile.mk index ee38f8141..3202f0ba5 100644 --- a/dbaccess/util/makefile.mk +++ b/dbaccess/util/makefile.mk @@ -240,3 +240,23 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk .ENDIF .ENDIF + +ALLTAR : $(MISC)/dba.component $(MISC)/dbu.component $(MISC)/sdbt.component + +$(MISC)/dba.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + dba.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt dba.component + +$(MISC)/dbu.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + dbu.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt dbu.component + +$(MISC)/sdbt.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + sdbt.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL3TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt sdbt.component diff --git a/dbaccess/util/sdbt.component b/dbaccess/util/sdbt.component new file mode 100644 index 000000000..0038c0cad --- /dev/null +++ b/dbaccess/util/sdbt.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.dbaccess.ConnectionTools"> + <service name="com.sun.star.sdb.tools.ConnectionTools"/> + </implementation> +</component> |